Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
FemtoWielanekMapGenerator.cxx
1/*
2 * WielanekMapGenerator.cxx
3 *
4 * Created on: 28 sty 2016
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "FemtoWielanekMapGenerator.h"
11#include "Cout.h"
12#include "DividedHisto.h"
13#include "Femto1DMapGenerator.h"
14
15#include <TAxis.h>
16#include <TDatabasePDG.h>
17#include <TFile.h>
18#include <TH1.h>
19#include <TH2.h>
20#include <TLorentzVector.h>
21#include <TMath.h>
22#include <TParticlePDG.h>
23#include <TVector3.h>
24#include <cstdlib>
25
26#include "FemtoPair.h"
27#include "FemtoPairKinematics.h"
28#include "Std.h"
29
30namespace Hal {
32 Femto1DMapGenerator(kFALSE), fPairsNo(100), fWeightArray(nullptr), fAngleArray(nullptr) {}
33
34 void FemtoWielanekMapGenerator::Exec(Int_t pairs_per_bin) {
35 fPairsNo = pairs_per_bin;
36 FemtoPairPRF* pair = new FemtoPairPRF();
37 fWeightArray = new Double_t[fPairsNo];
38 fAngleArray = new Double_t[fPairsNo];
39 Double_t step = TMath::Pi() / ((Double_t) fPairsNo);
40 Double_t sum = 0;
41 Int_t count = 0;
42 // calculate angular weight
43 for (Double_t i = 0; i < TMath::Pi(); i += step) {
44 fWeightArray[count] = TMath::Cos(i - 0.5 * step) - TMath::Cos(i + 0.5 * step);
45 fAngleArray[count] = i + 0.5 * step;
46 sum += fWeightArray[count];
47 count++;
48 }
49 // normalizing weight
50 for (int i = 0; i < fPairsNo; i++) {
51 fWeightArray[i] = fWeightArray[i] / sum;
52 }
53 for (int i = 1; i <= fMap->GetNum()->GetNbinsX(); i++) {
54 Double_t k = fMap->GetNum()->GetXaxis()->GetBinCenter(i);
55 for (int j = 1; j <= fMap->GetNum()->GetNbinsY(); j++) {
56 Double_t r = fMap->GetNum()->GetYaxis()->GetBinCenter(j);
57 fMap->GetNum()->SetBinContent(i, j, GeneratePairs(pair, r, k));
58 // fMap->GetDen()->SetBinContent(i, j, 1);
59 }
60 }
61 delete[] fWeightArray;
62 delete[] fAngleArray;
63 }
64
66 Bool_t res = Femto1DMapGenerator::Init();
67 fMap->GetNum()->GetXaxis()->SetTitle("K*[GeV/c]");
68 fMap->GetNum()->GetYaxis()->SetTitle("R*[fm]");
69 return res;
70 }
71
72 Double_t FemtoWielanekMapGenerator::GeneratePairs(FemtoPair* pair, Double_t R, Double_t K) {
73 Double_t sum = 0;
74 Double_t px1 = K;
75 Double_t e1 = TMath::Sqrt(px1 * px1 + 0.02 + fMass12);
76 Double_t e2 = TMath::Sqrt(px1 * px1 + 0.02 + fMass22);
77 TLorentzVector p, x;
78 p.SetPxPyPzE(0.2, 0, 0.2, e1 + e2);
79 TVector3 boost = p.BoostVector();
80 pair->SetTrueMomenta1(0.1, px1, 0.1, e1);
81 pair->SetTrueMomenta2(0.1, -px1, 0.1, e2);
82 for (int i = 0; i < fPairsNo; i++) {
83 x.SetXYZT(R * TMath::Sin(fAngleArray[i]), R * TMath::Cos(fAngleArray[i]), 0, 0);
84 x.Boost(boost);
85 pair->SetX1(x.X());
86 pair->SetY1(x.Y());
87 Double_t v = fWeight->GenerateWeight(pair);
88 sum += fWeightArray[i] * v;
89 }
90 return sum;
91 }
92
93 FemtoWielanekMapGenerator::~FemtoWielanekMapGenerator() {}
94} // namespace Hal
void SetY1(Double_t val)
Definition FemtoPair.h:352
void SetX1(Double_t val)
Definition FemtoPair.h:347
virtual Double_t GenerateWeight(FemtoPair *pair)