Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
FemtoConst.cxx
1/*
2 * FemtoConst.h
3 *
4 * Created on: 26-11-2013
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "FemtoConst.h"
11#include "Const.h"
12#include "Femto1DCF.h"
13#include "Femto3DCF.h"
14#include "FemtoDPhiDEta.h"
15#include "FemtoPairKinematics.h"
16#include "FemtoSHCF.h"
17#include "FemtoWeightGenerator.h"
18#include "FemtoWeightGeneratorLednicky.h"
19#include "StdString.h"
20#include "XMLNode.h"
21
22#include <TClass.h>
23#include <TDatabasePDG.h>
24#include <TLorentzVector.h>
25#include <TRandom.h>
26#include <iostream>
27
28namespace Hal {
29 namespace Femto {
30 Bool_t IsPairIdentical(EPairType pt) {
31 switch (pt) {
32 case EPairType::kPionPlusPionPlus: {
33 return kTRUE;
34 } break;
35 case EPairType::kPionZeroPionZero: {
36 return kTRUE;
37 } break;
38 case EPairType::kKaonZeroKaonZero: {
39 return kTRUE;
40 } break;
41 case EPairType::kPionPlusKaonPlus: {
42 return kTRUE;
43 } break;
44 case EPairType::kProtonProton: {
45 return kTRUE;
46 } break;
47 case EPairType::kNeutronNeutron: {
48 return kTRUE;
49 } break;
50 case EPairType::kLambdaLambda: {
51 return kTRUE;
52 } break;
53 case EPairType::kSigmaPlusSigmaPlus: {
54 return kTRUE;
55 } break;
56 case EPairType::kSigmaZeroSigmaZero: {
57 return kTRUE;
58 } break;
59 default: return kFALSE; break;
60 }
61 }
62
63 std::pair<Int_t, Int_t> PairTypeToPid(EPairType pt) {
64 std::pair<Int_t, Int_t> pair;
65 switch (pt) {
66 case EPairType::kUnknown: {
67 } break;
68 case EPairType::kPionPlusPionPlus: {
69 pair.first = Const::PionPlusPID();
70 pair.second = Const::PionPlusPID();
71 } break;
72 case EPairType::kPionPlusPionMinus: {
73 pair.first = Const::PionPlusPID();
74 pair.second = -Const::PionPlusPID();
75 } break;
76 case EPairType::kKaonPlusKaonPlus: {
77 pair.first = Const::KaonPlusPID();
78 pair.second = Const::KaonPlusPID();
79 } break;
80 case EPairType::kKaonPlusKaonMinus: {
81 pair.first = Const::KaonPlusPID();
82 pair.second = -Const::KaonPlusPID();
83 } break;
84
85 case EPairType::kProtonProton: {
86 pair.first = Const::ProtonPID();
87 pair.second = Const::ProtonPID();
88 } break;
89 case EPairType::kProtonAntiproton: {
90 pair.first = Const::ProtonPID();
91 pair.second = -Const::ProtonPID();
92 } break;
93 case EPairType::kPionPlusKaonPlus: {
94 pair.first = Const::PionPlusPID();
95 pair.second = Const::KaonPlusPID();
96 } break;
97 case EPairType::kPionPlusKaonMinus: {
98 pair.first = Const::PionPlusPID();
99 pair.second = -Const::KaonPlusPID();
100 } break;
101
102 case EPairType::kPionPlusProton: {
103 pair.first = Const::PionPlusPID();
104 pair.second = Const::ProtonPID();
105 } break;
106 case EPairType::kPionPlusAntiproton: {
107 pair.first = Const::PionPlusPID();
108 pair.second = -Const::ProtonPID();
109 } break;
110 case EPairType::kKaonPlusProton: {
111 pair.first = Const::KaonPlusPID();
112 pair.second = Const::ProtonPID();
113 } break;
114 case EPairType::kKaonPlusAntiproton: {
115 pair.first = Const::KaonPlusPID();
116 pair.second = -Const::ProtonPID();
117 } break;
118
119 case EPairType::kProtonLambda: {
120 pair.first = Const::ProtonPID();
121 pair.second = Const::LambdaPID();
122 } break;
123 case EPairType::kLambdaLambda: {
124 pair.first = Const::LambdaPID();
125 pair.second = Const::LambdaPID();
126 } break;
127 case EPairType::kKaonZeroKaonZero: {
128 pair.first = Const::KaonZeroShortPID();
129 pair.second = Const::KaonZeroShortPID();
130 } break;
131 case EPairType::kKaonZeroKaonZeroBar: {
132 pair.first = Const::KaonZeroShortPID();
133 pair.second = -Const::KaonZeroShortPID();
134 } break;
135
136
137 case EPairType::kNeutronNeutron: {
138 pair.first = Const::NeutronPID();
139 pair.second = Const::NeutronPID();
140 } break;
141 case EPairType::kNeutronProton: {
142 pair.first = Const::NeutronPID();
143 pair.second = Const::ProtonPID();
144 } break;
145 case EPairType::kPionZeroPionZero: {
146 pair.first = Const::PionZeroPID();
147 pair.second = Const::PionZeroPID();
148 } break;
149 case EPairType::kNeutronLambda: {
150 pair.first = Const::NeutronPID();
151 pair.second = Const::LambdaPID();
152 } break;
153 //
154 case EPairType::kProtonSigmaPlus: {
155 pair.first = Const::ProtonPID();
156 pair.second = Const::SigmaPlusPID();
157 } break;
158 case EPairType::kProtonAntiSigmaPlus: {
159 pair.first = Const::NeutronPID();
160 pair.second = -Const::SigmaPlusPID();
161 } break;
162 case EPairType::kProtonAntiLambda: {
163 pair.first = Const::ProtonPID();
164 pair.second = -Const::LambdaPID();
165 } break;
166 case EPairType::kSigmaPlusSigmaPlus: {
167 pair.first = Const::SigmaPlusPID();
168 pair.second = Const::SigmaPlusPID();
169 } break;
170 case EPairType::kSigmaPlusAntiSigmaPlus: {
171 pair.first = Const::SigmaPlusPID();
172 pair.second = -Const::SigmaPlusPID();
173 } break;
174 case EPairType::kProtonXiZero: {
175 pair.first = Const::ProtonPID();
176 pair.second = Const::XiZeroPID();
177 } break;
178 case EPairType::kNeutronXiMinus: {
179 pair.first = Const::NeutronPID();
180 pair.second = Const::XiMinusPID();
181 } break;
182 case EPairType::kProtonXIMInus: {
183 pair.first = Const::ProtonPID();
184 pair.second = Const::XiMinusPID();
185 } break;
186
187 case EPairType::kNeutronXiZero: {
188 pair.first = Const::NeutronPID();
189 pair.second = Const::XiZeroPID();
190 } break;
191 case EPairType::kProtonSigmaZero: {
192 pair.first = Const::ProtonPID();
193 pair.second = Const::SigmaZeroPID();
194 } break;
195 case EPairType::kSigmaZeroSigmaZero: {
196 pair.first = Const::SigmaZeroPID();
197 pair.second = Const::SigmaZeroPID();
198 } break;
199 case EPairType::kLambdaSigmaZero: {
200 pair.first = Const::LambdaPID();
201 pair.second = Const::SigmaZeroPID();
202 } break;
203 case EPairType::kLambdaAntiLambda: {
204 pair.first = Const::LambdaPID();
205 pair.second = -Const::LambdaPID();
206 } break;
207 }
208 return pair;
209 } // namespace Femto
210
211 EPairType PidToPairType(Int_t pid1, Int_t pid2) {
212 if (pid1 < 0) {
213 pid1 = -pid1;
214 pid2 = -pid2;
215 }
216 switch (pid1) {
217 case 211: { // pion
218 switch (pid2) {
219 case 211: return EPairType::kPionPlusPionPlus; break;
220 case -211: return EPairType::kPionPlusPionMinus; break;
221 case 321: return EPairType::kPionPlusKaonPlus; break;
222 case -321: return EPairType::kPionPlusKaonMinus; break;
223 case 2212: return EPairType::kPionPlusProton; break;
224 case -2212: return EPairType::kPionPlusAntiproton; break;
225 }
226 } break;
227 case 321: { // kaon
228 switch (pid2) {
229 case 321: return EPairType::kKaonPlusKaonPlus; break;
230 case -321: return EPairType::kKaonPlusKaonMinus; break;
231 case 2212: return EPairType::kKaonPlusProton; break;
232 case -2212: return EPairType::kKaonPlusAntiproton; break;
233 }
234 } break;
235
236 case 2212: { // proton
237 switch (pid2) {
238 case 2212: return EPairType::kProtonProton; break;
239 case -2212: return EPairType::kProtonAntiproton; break;
240 case 3122: return EPairType::kProtonLambda; break;
241 case 2112: return EPairType::kNeutronProton; break;
242 case 3222: return EPairType::kProtonSigmaPlus; break;
243 case -3222: return EPairType::kProtonAntiSigmaPlus; break;
244 case -3122: return EPairType::kProtonAntiLambda; break;
245 case 3322: return EPairType::kProtonXiZero; break;
246 case 3312: return EPairType::kProtonXIMInus; break;
247 case 3212: return EPairType::kProtonSigmaZero; break;
248 }
249 } break;
250 case 2112: { // neutron
251 switch (pid2) {
252 case 2112: return EPairType::kNeutronNeutron; break;
253 case 3122: return EPairType::kNeutronLambda; break;
254 case 2212: return EPairType::kNeutronProton; break; // why?
255 case 3312: return EPairType::kNeutronXiMinus; break;
256 case 3322: return EPairType::kNeutronXiZero; break;
257 }
258 } break;
259 case 3122: {
260 switch (pid2) {
261 case 3122: return EPairType::kLambdaLambda; break;
262 case -3122: return EPairType::kLambdaAntiLambda; break;
263 case 3212: return EPairType::kLambdaSigmaZero; break;
264 }
265 } break;
266 case 310: {
267 switch (pid2) {
268 case 310: return EPairType::kKaonZeroKaonZero; break;
269 case -310: return EPairType::kKaonZeroKaonZeroBar; break;
270 }
271 break;
272 }
273 case 111: {
274 if (pid2 == 111) return EPairType::kPionZeroPionZero;
275 break;
276 } break;
277 case 3222: {
278 switch (pid2) {
279 case -3222: {
280 return EPairType::kSigmaPlusAntiSigmaPlus;
281 } break;
282 case 3222: {
283 return EPairType::kSigmaPlusSigmaPlus;
284 } break;
285 }
286 } break;
287 case 3212: {
288 if (pid2 == 3212) return EPairType::kSigmaZeroSigmaZero;
289 } break;
290 }
291 return EPairType::kUnknown;
292 }
293
294 TString PairTypeToString(EPairType type) {
295 switch (type) {
296 case EPairType::kUnknown: {
297 } break;
298 case EPairType::kPionPlusPionPlus: {
299 return "pi+pi+";
300 } break;
301 case EPairType::kPionPlusPionMinus: {
302 return "pi+pi-";
303 } break;
304 case EPairType::kKaonPlusKaonPlus: {
305 return "K+K+";
306 } break;
307 case EPairType::kKaonPlusKaonMinus: {
308 return "K+K-";
309 } break;
310
311 case EPairType::kProtonProton: {
312 return "pp";
313 } break;
314 case EPairType::kProtonAntiproton: {
315 return "ppb";
316 } break;
317 case EPairType::kPionPlusKaonPlus: {
318 return "pi+K+";
319 } break;
320 case EPairType::kPionPlusKaonMinus: {
321 return "pi+K-";
322 } break;
323
324 case EPairType::kPionPlusProton: {
325 return "pi+p";
326 } break;
327 case EPairType::kPionPlusAntiproton: {
328 return "pi+pb";
329 } break;
330 case EPairType::kKaonPlusProton: {
331 return "K+p";
332 } break;
333 case EPairType::kKaonPlusAntiproton: {
334 return "K+pb";
335 } break;
336
337 case EPairType::kProtonLambda: {
338 return "pL";
339 } break;
340 case EPairType::kLambdaLambda: {
341 return "LL";
342 } break;
343 case EPairType::kKaonZeroKaonZero: {
344 return "K0K0";
345 } break;
346 case EPairType::kKaonZeroKaonZeroBar: {
347 return "K0K0b";
348 } break;
349 case EPairType::kNeutronNeutron: {
350 return "nn";
351 } break;
352 case EPairType::kNeutronProton: {
353 return "np";
354 } break;
355 case EPairType::kPionZeroPionZero: {
356 return "pi0pi0";
357 } break;
358 case EPairType::kNeutronLambda: {
359 return "nLam";
360 } break;
361 case EPairType::kProtonSigmaPlus: {
362 return "pSig+";
363 } break;
364 case EPairType::kProtonAntiSigmaPlus: {
365 return "pAntiSig+";
366 } break;
367 case EPairType::kProtonAntiLambda: {
368 return "pLb";
369 } break;
370 case EPairType::kSigmaPlusSigmaPlus: {
371 return "Sig+Sig+";
372 } break;
373 case EPairType::kSigmaPlusAntiSigmaPlus: {
374 return "SIg+AntiSig+";
375 } break;
376 case EPairType::kProtonXiZero: {
377 return "pXi0";
378 } break;
379 case EPairType::kNeutronXiMinus: {
380 return "nXi-";
381 } break;
382 case EPairType::kProtonXIMInus: {
383 return "pXi-";
384 } break;
385
386 case EPairType::kNeutronXiZero: {
387 return "nXi0";
388 } break;
389 case EPairType::kProtonSigmaZero: {
390 return "pSig0";
391 } break;
392 case EPairType::kSigmaZeroSigmaZero: {
393 return "Sig0Sig0";
394 } break;
395 case EPairType::kLambdaSigmaZero: {
396 return "LSig0";
397 } break;
398 case EPairType::kLambdaAntiLambda: {
399 return "LLb";
400 } break;
401 }
402 return "uknonwn";
403 }
404
405 FemtoPair* MakePair(EKinematics frame, Bool_t use_fake) {
406 switch (frame) {
407 case EKinematics::kPRF: return new FemtoPairPRF(use_fake); break;
408 case EKinematics::kLCMS: return new FemtoPairLCMS(use_fake); break;
409 case EKinematics::kSH_LCMS: return new FemtoPairLCMS_SH(use_fake); break;
410 case EKinematics::kSH_PRF: return new FemtoPairPRF_SH(use_fake); break;
411 case EKinematics::kPHIETA: return new FemtoPairDPhiDEta(use_fake); break;
412 case EKinematics::kPRFL: return new FemtoPairPRFL(use_fake); break;
413 default: return NULL; break;
414 }
415 }
416
417 TString KinematicsToLabel(EKinematics kin) {
418 switch (kin) {
419 case EKinematics::kPRF: return "prf"; break;
420 case EKinematics::kLCMS: return "lcms"; break;
421 case EKinematics::kSH_LCMS: return "sh_lcms"; break;
422 case EKinematics::kSH_PRF: return "sh_prf"; break;
423 case EKinematics::kPHIETA: return "dphideta"; break;
424 case EKinematics::kPRFL: return "prfl"; break;
425 default: return ""; break;
426 }
427 }
428
429 EKinematics LabelToKinematics(TString label) {
430 if (label.EqualTo("prf")) {
431 return EKinematics::kPRF;
432 } else if (label.EqualTo("lcms")) {
433 return EKinematics::kLCMS;
434 } else if (label.EqualTo("sh_prf")) {
435 return EKinematics::kSH_PRF;
436 } else if (label.EqualTo("sh_lcms")) {
437 return EKinematics::kSH_LCMS;
438 } else if (label.EqualTo("dphideta")) {
439 return EKinematics::kPHIETA;
440 }
441 return EKinematics::kLCMS;
442 }
443
444 DividedHisto1D* GetHistoFromXML(XMLNode* nod) {
445 if (nod == nullptr) return nullptr;
446 XMLNode* frame = nod->GetChild("Frame");
447 XMLNode* name = nod->GetChild("Name");
448 XMLNode* type = nod->GetChild("Type");
449
450 Int_t bins[3] = {100, 100, 100};
451 Double_t min[3] = {0, 0, 0}, max[3] = {1, 1, 1};
452 TString axes[3] = {"Xaxis", "Xaxis", "Zaxis"};
453 for (int i = 0; i < 3; i++) {
454 XMLNode* xaxis = nod->GetChild(axes[i]);
455 if (xaxis != nullptr) {
456 XMLAttrib* binsXml = xaxis->GetAttrib("bins");
457 XMLAttrib* minXml = xaxis->GetAttrib("min");
458 XMLAttrib* maxXml = xaxis->GetAttrib("max");
459 if (binsXml) bins[i] = binsXml->GetValue().Atoi();
460 if (minXml) min[i] = minXml->GetValue().Atof();
461 if (maxXml) max[i] = maxXml->GetValue().Atof();
462 }
463 }
464
465 EKinematics Frame = EKinematics::kLCMS;
466 if (frame) Frame = CodeLabelToKinematics(frame->GetValue());
467
468 TString cfName = "cf";
469 if (name != nullptr) cfName = name->GetValue();
470 if (type == nullptr) return nullptr;
471 TString classType = type->GetValue();
472 if (classType.EqualTo("Femto1DCF")) {
473 return new Femto1DCF(cfName, bins[0], min[0], max[0], Frame);
474 } else if (classType.EqualTo("Femto3DCF")) {
475 return new Femto3DCF(cfName, bins[0], min[0], max[0], bins[1], min[1], max[1], bins[2], min[2], max[2], Frame);
476 } else if (classType.EqualTo("FemtoSHCF")) {
477 XMLNode* lXml = nod->GetChild("L");
478 Int_t L = 3;
479 if (lXml) L = lXml->GetValue().Atoi();
480 return new FemtoSHCF(cfName, L, bins[0], min[0], max[0], Frame);
481 } else if (classType.EqualTo("FemtoDPhiDEta")) {
482 return new FemtoDPhiDEta(cfName, bins[0], bins[1], min[1], max[1]);
483 }
484 std::cout << "Cannot create correlation function from this node" << std::endl;
485 return nullptr;
486 }
487
488 EKinematics CodeLabelToKinematics(TString label) {
489 if (label.Contains("Hal::")) { label.ReplaceAll("Hal::", ""); }
490 if (label.Contains("Femto::")) { label.ReplaceAll("Femto::", ""); }
491 if (label.Contains("EKinematics::")) { label.ReplaceAll("EKinematics::", ""); }
492 if (label.EqualTo("kPRF")) {
493 return EKinematics::kPRF;
494 } else if (label.EqualTo("kLCMS")) {
495 return EKinematics::kLCMS;
496 } else if (label.EqualTo("kSH_PRF")) {
497 return EKinematics::kSH_PRF;
498 } else if (label.EqualTo("kSH_LCMS")) {
499 return EKinematics::kSH_LCMS;
500 } else if (label.EqualTo("kPHIETA")) {
501 return EKinematics::kPHIETA;
502 }
503 return EKinematics::kLCMS;
504 }
505
506 TString KinematicsToAxisLabel(EKinematics kin, Int_t ax, Int_t ndim) {
507 switch (kin) {
508 case EKinematics::kPRF: {
509 switch (ndim) {
510 case 1: {
511 switch (ax) {
512 case 0: return "k* [GeV/c]"; break;
513 case 1: return "dN_{pairs}/dk*"; break;
514 case 3: return "CF(k*)"; break;
515 }
516 } break;
517 case 3: {
518 switch (ax) {
519 case 0: return "k*_{out} [GeV/c]"; break;
520 case 1: return "k*_{side} [GeV/c]"; break;
521 case 2: return "k*_{long} [GeV/c]"; break;
522 case 3: return "CF(k*)"; break;
523 }
524 } break;
525 }
526 } break;
527 case EKinematics::kLCMS: {
528 switch (ndim) {
529 case 1: {
530 switch (ax) {
531 case 0: return "q_{inv} [GeV/c]"; break;
532 case 1: return "dN_{pairs}/dq_{inv}"; break;
533 case 3: return "CF(q_{inv})"; break;
534 }
535 } break;
536 case 3: {
537 switch (ax) {
538 case 0: return "q_{out} [GeV/c]"; break;
539 case 1: return "q_{side} [GeV/c]"; break;
540 case 2: return "q_{long} [GeV/c]"; break;
541 case 3: return "CF(q)"; break;
542 }
543 } break;
544 }
545 } break;
546 case EKinematics::kSH_PRF: {
547 switch (ax) {
548 case 0: return "k* [GeV/c]"; break;
549 case 1: return "#phi*"; break;
550 case 2: return "#theta*"; break;
551 case 3: return "CF(k*)"; break;
552 }
553 } break;
554 case EKinematics::kSH_LCMS: {
555 switch (ax) {
556 case 0: return "q_{inv} [GeV/c]"; break;
557 case 1: return "#phi_{inv}"; break;
558 case 2: return "#theta_{inv}"; break;
559 case 3: return "CF(q_{inv})"; break;
560 }
561 } break;
562 case EKinematics::kPHIETA: {
563 switch (ax) {
564 case 0: return "#Delta#phi"; break;
565 case 1: return "#Delta#eta"; break;
566 case 2: return "dN_{pairs}/dN_{#Delta#phi#Delta#eta}"; break;
567 case 3: return "C(#Delta#phi,#Delta#eta)"; break;
568 }
569 break;
570 }
571 case EKinematics::kPRFL: {
572 switch (ndim) {
573 case 1: {
574 switch (ax) {
575 case 0: return "k* [GeV/c]";
576 case 1: return "dN_{pairs}/dk*";
577 case 3: return "CF(k*)";
578 }
579 } break;
580 case 3: {
581 switch (ax) {
582 case 0: return "k*_{out} [GeV/c]";
583 case 1: return "k*_{side} [GeV/c]";
584 case 2: return "k*_{long} [GeV/c]";
585 case 3: return "CF(k*)";
586 }
587 } break;
588 }
589 } break;
590 }
591 return "";
592 }
593
594 void FillRandomPair(FemtoPair& p, Int_t pid1, Int_t pid2, Double_t sigmaq, Double_t sigmar) {
595 auto pdg = TDatabasePDG::Instance();
596 Double_t m1 = pdg->GetParticle(pid1)->Mass();
597 Double_t m2 = pdg->GetParticle(pid2)->Mass();
598 TLorentzVector p1, p2;
599 auto rgaus = [](Double_t s) { return gRandom->Gaus(0, s); };
600 p1.SetXYZM(rgaus(sigmaq), rgaus(sigmaq), rgaus(sigmaq), m1);
601 p2.SetXYZM(rgaus(sigmaq), rgaus(sigmaq), rgaus(sigmaq), m2);
602 p.SetTrueMomenta(p1, p2);
603 p.SetMomenta(p1, p2);
604 TLorentzVector x1(rgaus(sigmar), rgaus(sigmar), rgaus(sigmar), 0);
605 TLorentzVector x2(rgaus(sigmar), rgaus(sigmar), rgaus(sigmar), 0);
606 p.SetFreezouts(x1, x2);
607 }
608
609 void FillRandomKinematics(FemtoPair& p, const TVector3& sum, const TVector3& diff, EKinematics kin) {
610 Double_t m1 = p.GetM1();
611 Double_t m2 = p.GetM2();
612 Double_t ms = m1 + m2;
613 TLorentzVector summ(sum.X(), sum.Y(), sum.Z(), TMath::Sqrt(ms * ms + sum.Mag2()));
614 auto summ2 = summ;
615 Double_t vz = summ.Z() / summ.E();
616 summ.Boost(0, 0, -vz);
617 Double_t phi = summ.Phi();
618 switch (kin) {
619 case EKinematics::kLCMS: {
620 TLorentzVector p1(diff.X() * 0.5, diff.Y() * 0.5, diff.Z() * 0.5, TMath::Sqrt(m1 * m1 + diff.Mag2() * 0.25));
621 TLorentzVector p2(-diff.X() * 0.5, -diff.Y() * 0.5, -diff.Z() * 0.5, TMath::Sqrt(m2 * m2 + diff.Mag2() * 0.25));
622 p1.Boost(0, 0, vz);
623 p2.Boost(0, 0, vz);
624 p1.RotateZ(phi);
625 p2.RotateZ(phi);
626 p.SetTrueMomenta(p1, p2);
627 p.SetMomenta(p1, p2);
628 } break;
629 case EKinematics::kPRF: {
630 TLorentzVector p1(diff.X(), diff.Y(), diff.Z(), TMath::Sqrt(m1 * m1 + diff.Mag2()));
631 TLorentzVector p2(-diff.X(), -diff.Y(), -diff.Z(), TMath::Sqrt(m2 * m2 + diff.Mag2()));
632 Double_t ptboost = summ.BoostVector().Pt();
633 p1.Boost(ptboost, 0, 0);
634 p2.Boost(ptboost, 0, 0);
635 p1.Boost(0, 0, vz);
636 p2.Boost(0, 0, vz);
637 p1.RotateZ(phi);
638 p2.RotateZ(phi);
639 p.SetTrueMomenta(p1, p2);
640 p.SetMomenta(p1, p2);
641 } break;
642 default: {
643 std::cout << __FILE__ << " " << __LINE__ << " unsupported frame" << std::endl;
644 break;
645 }
646 }
647 }
648
654 ECFType GetCFType(TObject* obj) {
655 if (!obj) return ECFType::kUnkown;
656 if (dynamic_cast<Hal::FemtoSHCF*>(obj)) { return ECFType::kSpherical; }
657 if (dynamic_cast<Hal::Femto1DCF*>(obj)) { return ECFType::kOneDim; }
658 if (dynamic_cast<Hal::Femto3DCF*>(obj)) { return ECFType::kThreeDim; }
659 if (dynamic_cast<Hal::FemtoDPhiDEta*>(obj)) { return ECFType::kPhiEta; }
660 return ECFType::kUnkown;
661 }
662
663 FemtoWeightGenerator* GetWeightGeneratorFromXLM(XMLNode* nod) {
664 XMLNode* weightType = nod->GetChild("Type");
665 if (!weightType) return nullptr;
666 TClass* weightClass = TClass::GetClass(weightType->GetValue(), 1, 0);
667 FemtoWeightGenerator* w = static_cast<FemtoWeightGenerator*>(weightClass->New());
668 if (!w) return nullptr;
669 XMLNode* pairType = nod->GetChild("PairType");
670 TString val = pairType->GetValue();
671 std::vector<TString> str = Hal::Std::ExplodeString(val, ';');
672 if (str.size() == 2) {
673 Int_t pid1 = str[0].Atoi();
674 Int_t pid2 = str[1].Atoi();
675 w->SetPairType(Femto::PidToPairType(pid1, pid2));
676 }
677 FemtoWeightGeneratorLednicky* lednicky = dynamic_cast<FemtoWeightGeneratorLednicky*>(w);
678 if (lednicky) {
679 lednicky->SetStrongOff();
680 lednicky->SetCoulOff();
681 lednicky->SetQuantumOff();
682
683 XMLNode* quantum = nod->GetChild("QuantumOn");
684 XMLNode* strong = nod->GetChild("StrongOn");
685 XMLNode* coul = nod->GetChild("CoulombOn");
686 if (quantum) {
687 if (quantum->GetValue() == "kTRUE") lednicky->SetQuantumOn();
688 }
689 if (strong) {
690 if (strong->GetValue() == "kTRUE") lednicky->SetStrongOn();
691 }
692 if (coul) {
693 if (coul->GetValue() == "kTRUE") lednicky->SetCoulOn();
694 }
695 }
696 return w;
697 }
698
699 void CorrFitGammaCalc::ReInit(Double_t a, Double_t b, Double_t c, Double_t d) {
700 fA2 = a * a;
701 fB2 = b * b;
702 Double_t c2 = c * c;
703 Double_t d2 = d * d;
704 fConsA = (c2 - d2) * (c2 - d2);
705 fConsB = -2.0 * (c2 + d2);
706 }
707
708
709 Double_t CorrFitGammaCalc::Calculate(Double_t kstar) const {
710 const Double_t kstar2 = kstar * kstar;
711 const Double_t E1 = TMath::Sqrt(kstar2 + fA2);
712 const Double_t E2 = TMath::Sqrt(kstar2 + fB2);
713 const Double_t E = E1 + E2;
714 const Double_t E_2 = E * E;
715 return TMath::Sqrt(fConsA + fConsB * E_2 + E_2 * E_2) / (2.0 * E);
716 }
717 } // namespace Femto
718} // namespace Hal
void ReInit(Double_t a, Double_t b, Double_t c, Double_t d)
Double_t Calculate(Double_t kstar) const