Fix AliFemtoModelFreezeOutGenerator undefined references
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemto / Model / AliFemtoModelGausLCMSFreezeOutGenerator.cxx
CommitLineData
75c432a7 1////////////////////////////////////////////////////////////////////////////////
2/// ///
3/// AliFemtoModelGausLCMSFreezeOutGenerator - freeze-out ///
4/// coordinates generator, generating a 3D gaussian ellipsoid in LCMS ///
5/// Authors: Adam Kisiel kisiel@mps.ohio-state.edu ///
6/// ///
7////////////////////////////////////////////////////////////////////////////////
8#ifdef __ROOT__
9 ClassImp(AliFemtoModelGausLCMSFreezeOutGenerator, 1)
10#endif
11
12#include "math.h"
13#include "AliFemtoModelGausLCMSFreezeOutGenerator.h"
14#include "AliFemtoModelHiddenInfo.h"
15#include "AliFemtoLorentzVector.h"
16
17//_______________________
18AliFemtoModelGausLCMSFreezeOutGenerator::AliFemtoModelGausLCMSFreezeOutGenerator() :
19 fSizeOut(0), fSizeSide(0), fSizeLong(0)
20{
21 // Default constructor
22 fRandom = new TRandom2();
23}
24
25//_______________________
26AliFemtoModelGausLCMSFreezeOutGenerator::AliFemtoModelGausLCMSFreezeOutGenerator(const AliFemtoModelGausLCMSFreezeOutGenerator &aModel):
27 fSizeOut(0), fSizeSide(0), fSizeLong(0)
28{
29 // Copy constructor
30 fRandom = new TRandom2();
31 SetSizeOut(aModel.GetSizeOut());
32 SetSizeSide(aModel.GetSizeSide());
33 SetSizeLong(aModel.GetSizeLong());
34}
35//_______________________
36AliFemtoModelGausLCMSFreezeOutGenerator::~AliFemtoModelGausLCMSFreezeOutGenerator()
37{
38 if (fRandom) delete fRandom;
39}
40//_______________________
41void AliFemtoModelGausLCMSFreezeOutGenerator::GenerateFreezeOut(AliFemtoPair *aPair)
42{
43 // Generate two particle emission points with respect
44 // to their pair momentum
45 // The source is the 3D Gaussian ellipsoid in the LCMS frame
46 AliFemtoModelHiddenInfo *inf1 = (AliFemtoModelHiddenInfo *) aPair->track1()->HiddenInfo();
47 AliFemtoModelHiddenInfo *inf2 = (AliFemtoModelHiddenInfo *) aPair->track2()->HiddenInfo();
48
49 if ((!inf1) || (!inf2)) { cout << "Hidden info not created! " << endl; exit(kFALSE); }
50
51 Double_t tPx = inf1->GetTrueMomentum()->x() + inf2->GetTrueMomentum()->x();
52 Double_t tPy = inf1->GetTrueMomentum()->y() + inf2->GetTrueMomentum()->y();
53 Double_t tPz = inf1->GetTrueMomentum()->z() + inf2->GetTrueMomentum()->z();
54 Double_t tM1 = inf1->GetMass();
55 Double_t tM2 = inf2->GetMass();
56 Double_t tE1 = sqrt(tM1*tM1 + inf1->GetTrueMomentum()->mag2());
57 Double_t tE2 = sqrt(tM2*tM2 + inf2->GetTrueMomentum()->mag2());
58 Double_t tEs = tE1 + tE2;
59
60 Double_t tPt = sqrt(tPx*tPx + tPy*tPy);
61
62 Double_t tRout = fRandom->Gaus(0.0, fSizeOut);
63 Double_t tRside = fRandom->Gaus(0.0, fSizeSide);
64 Double_t tRlong = fRandom->Gaus(0.0, fSizeLong);
65
66 Double_t tXout = (tPx * tRout + tPy * tRside)/tPt;
67 Double_t tXside = (tPy * tRout - tPx * tRside)/tPt;
68
69 Double_t tBetaz = tPz/tEs;
70 Double_t tGammaz = 1.0/(1-tBetaz*tBetaz);
71
72 Double_t tXlong = tGammaz * (tRlong + tBetaz * 0);
73 Double_t tXtime = tGammaz * (0 + tBetaz * tRlong);
74
75 if (!(inf1->GetEmissionPoint())) {
76 AliFemtoLorentzVector *tPos = new AliFemtoLorentzVector(0,0,0,0);
77 inf1->SetEmissionPoint(tPos);
78 }
79 else
80 inf1->SetEmissionPoint(0,0,0,0);
81 if (!(inf2->GetEmissionPoint())) {
82 AliFemtoLorentzVector *tPos = new AliFemtoLorentzVector(tXout,tXside,tXlong,tXtime);
83 inf2->SetEmissionPoint(tPos);
84 }
85 else
86 inf2->SetEmissionPoint(tXout, tXside, tXlong, tXtime);
87}
88
89//_______________________
90void AliFemtoModelGausLCMSFreezeOutGenerator::SetSizeOut(Double_t aSizeOut)
91{
92 fSizeOut = aSizeOut;
93}
94//_______________________
95void AliFemtoModelGausLCMSFreezeOutGenerator::SetSizeSide(Double_t aSizeSide)
96{
97 fSizeSide = aSizeSide;
98}
99//_______________________
100void AliFemtoModelGausLCMSFreezeOutGenerator::SetSizeLong(Double_t aSizeLong)
101{
102 fSizeLong = aSizeLong;
103}
104
105//_______________________
106Double_t AliFemtoModelGausLCMSFreezeOutGenerator::GetSizeOut() const
107{
108 return fSizeOut;
109}
110//_______________________
111Double_t AliFemtoModelGausLCMSFreezeOutGenerator::GetSizeSide() const
112{
113 return fSizeSide;
114}
115//_______________________
116Double_t AliFemtoModelGausLCMSFreezeOutGenerator::GetSizeLong() const
117{
118 return fSizeLong;
119}
120//_______________________
121AliFemtoModelFreezeOutGenerator* AliFemtoModelGausLCMSFreezeOutGenerator::Clone() const
122{
123 return GetGenerator();
124}
125//_______________________
126AliFemtoModelFreezeOutGenerator* AliFemtoModelGausLCMSFreezeOutGenerator::GetGenerator() const
127{
128 AliFemtoModelFreezeOutGenerator* tModel = new AliFemtoModelGausLCMSFreezeOutGenerator(*this); return tModel;
129}