1 ////////////////////////////////////////////////////////////////////////////////
3 /// AliFemtoModelGausRinvFreezeOutGenerator - freeze-out ///
4 /// coordinates generator, generating a 3D gaussian ellipsoid in LCMS ///
5 /// Authors: Adam Kisiel kisiel@mps.ohio-state.edu ///
7 ////////////////////////////////////////////////////////////////////////////////
9 ClassImp(AliFemtoModelGausRinvFreezeOutGenerator, 1)
13 #include "AliFemtoModelGausRinvFreezeOutGenerator.h"
14 #include "AliFemtoModelHiddenInfo.h"
15 #include "AliFemtoLorentzVector.h"
17 //_______________________
18 AliFemtoModelGausRinvFreezeOutGenerator::AliFemtoModelGausRinvFreezeOutGenerator() :
22 // Default constructor
23 fRandom = new TRandom2();
26 //_______________________
27 AliFemtoModelGausRinvFreezeOutGenerator::AliFemtoModelGausRinvFreezeOutGenerator(const AliFemtoModelGausRinvFreezeOutGenerator &aModel):
28 AliFemtoModelFreezeOutGenerator(),
33 fRandom = new TRandom2();
34 SetSizeInv(aModel.GetSizeInv());
36 //_______________________
37 AliFemtoModelGausRinvFreezeOutGenerator::~AliFemtoModelGausRinvFreezeOutGenerator()
39 if (fRandom) delete fRandom;
41 //_______________________
42 void AliFemtoModelGausRinvFreezeOutGenerator::GenerateFreezeOut(AliFemtoPair *aPair)
44 AliFemtoModelHiddenInfo *inf1 = (AliFemtoModelHiddenInfo *) aPair->Track1()->HiddenInfo();
45 AliFemtoModelHiddenInfo *inf2 = (AliFemtoModelHiddenInfo *) aPair->Track2()->HiddenInfo();
47 if ((!inf1) || (!inf2)) { cout << "Hidden info not created! " << endl; exit(kFALSE); }
50 // assume the emission point is in [cm] and try to judge if
51 // both particles are primary
52 Double_t dist1 = inf1->GetEmissionPoint()->perp();
53 Double_t dist2 = inf2->GetEmissionPoint()->perp();
55 if ((dist1 > 0.005) && (dist2 > 0.005)) {
56 // At least one particle is non primary
57 if (!(inf1->GetEmissionPoint())) {
58 AliFemtoLorentzVector tPos(-1000,1000,-500,0);
59 inf1->SetEmissionPoint(&tPos);
62 inf1->SetEmissionPoint(-1000,1000,-500,0);
63 if (!(inf2->GetEmissionPoint())) {
64 AliFemtoLorentzVector tPos(fRandom->Gaus(0,1000.0),fRandom->Gaus(0,1000),fRandom->Gaus(0,1000),0.0);
65 inf2->SetEmissionPoint(&tPos);
68 inf2->SetEmissionPoint(fRandom->Gaus(0,1000), fRandom->Gaus(0,1000), fRandom->Gaus(0,1000), 0.0);
74 // Generate two particle emission points with respect
75 // to their pair momentum
76 // The source is the 3D Gaussian ellipsoid in the LCMS frame
78 // Calculate sum momenta
79 Double_t tPx = inf1->GetTrueMomentum()->x() + inf2->GetTrueMomentum()->x();
80 Double_t tPy = inf1->GetTrueMomentum()->y() + inf2->GetTrueMomentum()->y();
81 Double_t tPz = inf1->GetTrueMomentum()->z() + inf2->GetTrueMomentum()->z();
82 Double_t tM1 = inf1->GetMass();
83 Double_t tM2 = inf2->GetMass();
84 Double_t tE1 = sqrt(tM1*tM1 + inf1->GetTrueMomentum()->mag2());
85 Double_t tE2 = sqrt(tM2*tM2 + inf2->GetTrueMomentum()->mag2());
86 Double_t tEs = tE1 + tE2;
88 Double_t tPt = sqrt(tPx*tPx + tPy*tPy);
89 Double_t tMt = sqrt(tEs*tEs - tPz*tPz);
91 // Generate positions in PRF from a Gaussian
92 Double_t tROutS = fRandom->Gaus(0,fSizeInv); // reuse of long
93 Double_t tRSideS = fRandom->Gaus(0,fSizeInv);
94 Double_t tRLongS = fRandom->Gaus(0,fSizeInv);
97 Double_t tBetat = tPt/tMt;
98 Double_t tGammat = 1.0/sqrt(1.0-tBetat*tBetat);
100 Double_t tBetaz = tPz/tEs;
101 Double_t tGammaz = 1.0/sqrt(1.0-tBetaz*tBetaz);
103 Double_t tROut = tGammat * (tROutS + tBetat * tRTimeS);
104 Double_t tDtL = tGammat * (tRTimeS + tBetat * tROutS);
105 Double_t tRSide = tRSideS;
107 Double_t tRLong = tGammaz * (tRLongS + tBetaz * tDtL);
108 Double_t tDt = tGammaz * (tDtL + tBetaz * tRLongS);
113 Double_t tXout = tROut*tPx-tRSide*tPy;
114 Double_t tXside = tROut*tPy+tRSide*tPx;
115 Double_t tXlong = tRLong;
116 Double_t tXtime = tDt;
118 if (!(inf1->GetEmissionPoint())) {
119 AliFemtoLorentzVector tPos(0,0,0,0);
120 inf1->SetEmissionPoint(&tPos);
123 inf1->SetEmissionPoint(0,0,0,0);
124 if (!(inf2->GetEmissionPoint())) {
125 AliFemtoLorentzVector tPos(tXout,tXside,tXlong,tXtime);
126 inf2->SetEmissionPoint(&tPos);
129 inf2->SetEmissionPoint(tXout, tXside, tXlong, tXtime);
132 //_______________________
133 void AliFemtoModelGausRinvFreezeOutGenerator::SetSizeInv(Double_t aSizeInv)
137 //_______________________
138 Double_t AliFemtoModelGausRinvFreezeOutGenerator::GetSizeInv() const
142 //_______________________
143 AliFemtoModelFreezeOutGenerator* AliFemtoModelGausRinvFreezeOutGenerator::Clone() const
145 return GetGenerator();
147 //_______________________
148 inline AliFemtoModelFreezeOutGenerator* AliFemtoModelGausRinvFreezeOutGenerator::GetGenerator() const
150 AliFemtoModelFreezeOutGenerator* tModel = new AliFemtoModelGausRinvFreezeOutGenerator(*this);
153 //_______________________
154 void AliFemtoModelGausRinvFreezeOutGenerator::SetSelectPrimaryFromHidden(bool aUse)
156 fSelectPrimary = aUse;
158 Bool_t AliFemtoModelGausRinvFreezeOutGenerator::GetSelectPrimaryFromHidden()
160 return fSelectPrimary;