46 void Femto1DCFAnaMapMCRoco::Exec(Int_t pairs_per_bin, Bool_t autoscale) {
47 if (autoscale) pairs_per_bin = (Double_t) pairs_per_bin * fIntegralScale;
48 const Int_t pointsQ = fMap->GetNum()->GetNbinsX() + 1;
49 Double_t* kstar =
new Double_t[pointsQ];
50 Double_t* kfill =
new Double_t[pointsQ];
51 Double_t** parametrizations =
new Double_t*[fRBins];
53 FemtoSourceModel* sourceModelntegrated = fGeneratorIntegrated->GetSourceModel();
56 Int_t sourceParamsNo = sourceModel->
GetNpar();
57 for (
int i = 0; i < fRBins; i++) {
58 parametrizations[i] =
new Double_t[sourceParamsNo];
61 for (
int i = 1; i <= fMap->GetNum()->GetNbinsX(); i++) {
62 kstar[i] = fMap->GetNum()->GetXaxis()->GetBinCenter(i);
64 if (fKinematics == Femto::EKinematics::kLCMS) { kstar[i] = kstar[i] * 0.5; }
66 TVector3 boost(0.1, 0.1, 0.1);
68 const Double_t scale = 1.0 / TMath::Sqrt(3.0);
71 for (
int i = 0; i < fRBins; i++) {
72 for (
int j = 0; j < sourceParamsNo; j++) {
73 parametrizations[i][j] = fSourceParams[j];
77 case EModelType::k1dModel: {
78 for (
int i = 0; i < fRBins; i++) {
79 parametrizations[i][0] = fRadiiBins[i];
82 case EModelType::k3dModel: {
83 for (
int i = 0; i < fRBins; i++) {
84 parametrizations[i][0] = fRadiiBins[i] * scale;
85 parametrizations[i][1] = fRadiiBins[i] * scale;
86 parametrizations[i][2] = fRadiiBins[i] * scale;
89 case EModelType::kOther: {
98 TH1D* monGaus1 =
new TH1D(
"monG1",
"monG", 500, 0, 50);
99 TH1D* monGaus2 =
new TH1D(
"monG3",
"monG", 500, 0, 50);
100 TH1D* monGaus3 =
new TH1D(
"monG6",
"monG", 500, 0, 50);
101 TH1D* monGaus4 =
new TH1D(
"monG9",
"monG", 500, 0, 50);
102 TH1D* monGaus5 =
new TH1D(
"monG10",
"monG", 500, 0, 50);
103 TH1D* monRaw =
new TH1D(
"monR",
"monR", 500, 0, 50);
105 TDatabasePDG* pdg = TDatabasePDG::Instance();
106 TParticlePDG* pid1 = pdg->GetParticle(fPid1);
107 TParticlePDG* pid2 = pdg->GetParticle(fPid2);
108 Double_t m1 = Const::PionPlusMass();
109 Double_t m2 = Const::PionPlusMass();
110 if (pid1) m1 = pid1->Mass();
111 if (pid2) m2 = pid2->Mass();
114 Int_t nbinsX, nbinsY;
115 Double_t minX, maxX, minY, maxY;
116 Hal::Std::GetAxisPar(*fMap->GetNum(), nbinsX, minX, maxX,
"x");
117 Hal::Std::GetAxisPar(*fMap->GetNum(), nbinsY, minY, maxY,
"y");
121 for (
int ikst = 1; ikst <= fMap->GetNum()->GetNbinsX(); ikst++) {
122 Double_t E1 = TMath::Sqrt(m1 + kstar[ikst] * kstar[ikst]);
123 Double_t E2 = TMath::Sqrt(m2 + kstar[ikst] * kstar[ikst]);
125 gRandom->Sphere(px, py, pz, kstar[ikst]);
126 TLorentzVector p1(px, py, pz, E1);
127 TLorentzVector p2(-px, -py, -pz, E2);
130 fPair->SetTrueMomenta1(p1.X(), p1.Y(), p1.Z(), p1.T());
131 fPair->SetTrueMomenta2(p2.X(), p2.Y(), p2.Z(), p2.T());
133 for (
int i = 0; i < pairs_per_bin; i++) {
134 fGeneratorIntegrated->GenerateFreezoutCooordinates(fPair);
135 Double_t weight = fWeight->GenerateWeight(fPair);
136 TVector3 Radius(sourceModelntegrated->
GetROut(), sourceModelntegrated->
GetRSide(), sourceModelntegrated->
GetRLong());
138 Double_t Rinv = Radius.Mag();
140 Double_t refWeight = 1;
142 if (TMath::IsNaN(refWeight)) {
147 for (
int r_bin = 0; r_bin < fRBins; r_bin++) {
148 Double_t R = fRadiiBins[r_bin];
149 Double_t newWeight = 1;
151 Double_t effWeight = newWeight * refWeight;
152 if (fDebugDistribution) {
154 monRaw->Fill(Rinv, 1);
155 monGaus1->Fill(Rinv, effWeight);
159 monGaus2->Fill(Rinv, effWeight);
163 monGaus3->Fill(Rinv, effWeight);
167 monGaus4->Fill(Rinv, effWeight);
171 monGaus5->Fill(Rinv, effWeight);
175 Int_t bin = num1->FindBin(kfill[ikst], R);
176 num1->IncrementRawBinContent(bin, weight * effWeight);
177 num2->IncrementRawBinContent(bin, effWeight);
181 for (
int i = 0; i <= nbinsX + 1; i++) {
182 for (
int j = 0; j <= nbinsY + 1; j++) {
183 fMap->GetNum()->SetBinContent(i, j, num1->GetBinContent(i, j));
184 fMap->GetDen()->SetBinContent(i, j, num2->GetBinContent(i, j));
189 if (fDebugDistribution) {
190 TFile* fx =
new TFile(
"ctrl.root",
"recreate");
267 for (
int i = 0; i < fRBins; i++) {
268 delete[] parametrizations[i];
270 delete[] parametrizations;
282 Bool_t Femto1DCFAnaMapMCRoco::Init() {
283 if (fGenerator ==
nullptr)
return kFALSE;
284 if (fGenerator->GetSourceModel()->GetModelNumProp() != FemtoSourceModel::ENumProperty::kFullyAnalytical) {
285 Cout::PrintInfo(
" Femto1DCFAnaMapMCRoco::Init - cannot use nonanalytical source emission function", EInfo::kLowWarning);
289 Int_t sourceParamsNo = sourceModel->
GetNpar();
290 fSourceParams =
new Double_t[sourceParamsNo];
291 for (
int i = 0; i < sourceParamsNo; i++) {
296 fModelType = EModelType::k1dModel;
298 fModelType = EModelType::k3dModel;
300 Cout::PrintInfo(
" Femto1DCFAnaMapMCRoco::Init - cannot use analytical model that not base from 1d or 3d source model",
305 fPair = Femto::MakePair(fKinematics, kFALSE);
306 fMap =
new DividedHisto2D(
"map", fKStarBins, fKStarMin, fKStarMax, fRBins, fRMin, fRMax,
'D');
307 fMap->SetDirectory(
nullptr);
308 fRStep = (fRMax - fRMin) / ((Double_t) fRBins);
309 fRMinEff = fRMin + 0.5 * fRStep;
310 fRadiiBins.MakeBigger(fRBins);
311 for (
int r_bin = 0; r_bin < fRBins; r_bin++) {
312 fRadiiBins[r_bin] = fRMinEff + ((double) r_bin) * fRStep;
315 TDatabasePDG* pdg = TDatabasePDG::Instance();
316 Int_t pid1 = fWeight->GetPdg1();
317 Int_t pid2 = fWeight->GetPdg2();
318 TParticlePDG* part1 = pdg->GetParticle(pid1);
319 TParticlePDG* part2 = pdg->GetParticle(pid2);
320 if (part1 ==
nullptr)
return kFALSE;
321 if (part2 ==
nullptr)
return kFALSE;
322 fPair->SetPdg1(pid1);
323 fPair->SetPdg2(pid2);
329 Double_t rmax = fRadiiBins[fRBins - 1] * 5;
331 delete fSampleRandom;
332 fSampleRandom =
nullptr;
334 fSampleRandom =
new TH1D(
"samram",
"samram", 50, rmin, rmax);
335 Double_t params[1] = {0};
336 Double_t minIntegral = 1E+9;
338 for (
int r_bin = 0; r_bin < fRBins; r_bin++) {
339 params[0] = fRadiiBins[r_bin];
340 Double_t localIntegral = 0;
341 for (
int i = 1; i <= fSampleRandom->GetNbinsX(); i++) {
342 Double_t r = fSampleRandom->GetXaxis()->GetBinCenter(i);
344 localIntegral += val;
345 if (val > fSampleRandom->GetBinContent(i)) { fSampleRandom->SetBinContent(i, val); }
347 if (localIntegral < minIntegral) { minIntegral = localIntegral; }
349 Double_t maxIntegral = 0;
350 for (
int i = 1; i <= fSampleRandom->GetNbinsX(); i++) {
351 maxIntegral += fSampleRandom->GetBinContent(i);
353 fIntegralScale = maxIntegral / minIntegral;
354 Cout::Text(Form(
"Integral scale = %4.2f ", fIntegralScale),
"L", kYellow);
355 fGeneratorIntegrated = fGenerator->MakeCopy();
357 model.SetRadiusDistribution(*fSampleRandom);
358 fGeneratorIntegrated->SetSourceModel(model);
359 delete fSampleRandom;
360 fSampleRandom =
nullptr;