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 "AliFemtoModelGlobalHiddenInfo.h"
16 #include "AliFemtoLorentzVector.h"
18 //_______________________
19 AliFemtoModelGausRinvFreezeOutGenerator::AliFemtoModelGausRinvFreezeOutGenerator() :
23 // Default constructor
24 fRandom = new TRandom2();
27 //_______________________
28 AliFemtoModelGausRinvFreezeOutGenerator::AliFemtoModelGausRinvFreezeOutGenerator(const AliFemtoModelGausRinvFreezeOutGenerator &aModel):
29 AliFemtoModelFreezeOutGenerator(),
34 fRandom = new TRandom2();
35 SetSizeInv(aModel.GetSizeInv());
37 //_______________________
38 AliFemtoModelGausRinvFreezeOutGenerator::~AliFemtoModelGausRinvFreezeOutGenerator()
40 if (fRandom) delete fRandom;
42 //_______________________
43 void AliFemtoModelGausRinvFreezeOutGenerator::GenerateFreezeOut(AliFemtoPair *aPair)
45 AliFemtoModelHiddenInfo *inf1 = (AliFemtoModelHiddenInfo *) aPair->Track1()->HiddenInfo();
46 AliFemtoModelHiddenInfo *inf2 = (AliFemtoModelHiddenInfo *) aPair->Track2()->HiddenInfo();
48 if ((!inf1) || (!inf2)) { cout << "Hidden info not created! " << endl; exit(kFALSE); }
51 const AliFemtoModelGlobalHiddenInfo *infg1 = dynamic_cast<const AliFemtoModelGlobalHiddenInfo *>(aPair->Track1()->HiddenInfo());
52 const AliFemtoModelGlobalHiddenInfo *infg2 = dynamic_cast<const AliFemtoModelGlobalHiddenInfo *>(aPair->Track2()->HiddenInfo());
54 if ((infg1) && (infg2)) {
55 // assume the emission point is in [cm] and try to judge if
56 // both particles are primary
57 Double_t dist1 = infg1->GetGlobalEmissionPoint()->perp();
58 Double_t dist2 = infg2->GetGlobalEmissionPoint()->perp();
60 if ((dist1 > 0.05) && (dist2 > 0.05)) {
61 // At least one particle is non primary
62 if (!(inf1->GetEmissionPoint())) {
63 AliFemtoLorentzVector tPos(-1000,1000,-500,0);
64 inf1->SetEmissionPoint(&tPos);
67 inf1->SetEmissionPoint(-1000,1000,-500,0);
68 if (!(inf2->GetEmissionPoint())) {
69 AliFemtoLorentzVector tPos(fRandom->Gaus(0,1000.0),fRandom->Gaus(0,1000),fRandom->Gaus(0,1000),0.0);
70 inf2->SetEmissionPoint(&tPos);
73 inf2->SetEmissionPoint(fRandom->Gaus(0,1000), fRandom->Gaus(0,1000), fRandom->Gaus(0,1000), 0.0);
80 // Generate two particle emission points with respect
81 // to their pair momentum
82 // The source is the 3D Gaussian ellipsoid in the LCMS frame
84 // Calculate sum momenta
85 Double_t tPx = inf1->GetTrueMomentum()->x() + inf2->GetTrueMomentum()->x();
86 Double_t tPy = inf1->GetTrueMomentum()->y() + inf2->GetTrueMomentum()->y();
87 Double_t tPz = inf1->GetTrueMomentum()->z() + inf2->GetTrueMomentum()->z();
88 Double_t tM1 = inf1->GetMass();
89 Double_t tM2 = inf2->GetMass();
90 Double_t tE1 = sqrt(tM1*tM1 + inf1->GetTrueMomentum()->mag2());
91 Double_t tE2 = sqrt(tM2*tM2 + inf2->GetTrueMomentum()->mag2());
92 Double_t tEs = tE1 + tE2;
94 Double_t tPt = sqrt(tPx*tPx + tPy*tPy);
95 Double_t tMt = sqrt(tEs*tEs - tPz*tPz);
97 // Generate positions in PRF from a Gaussian
98 Double_t tROutS = fRandom->Gaus(0,fSizeInv); // reuse of long
99 Double_t tRSideS = fRandom->Gaus(0,fSizeInv);
100 Double_t tRLongS = fRandom->Gaus(0,fSizeInv);
101 Double_t tRTimeS = 0;
103 Double_t tBetat = tPt/tMt;
104 Double_t tGammat = 1.0/sqrt(1.0-tBetat*tBetat);
106 Double_t tBetaz = tPz/tEs;
107 Double_t tGammaz = 1.0/sqrt(1.0-tBetaz*tBetaz);
109 Double_t tROut = tGammat * (tROutS + tBetat * tRTimeS);
110 Double_t tDtL = tGammat * (tRTimeS + tBetat * tROutS);
111 Double_t tRSide = tRSideS;
113 Double_t tRLong = tGammaz * (tRLongS + tBetaz * tDtL);
114 Double_t tDt = tGammaz * (tDtL + tBetaz * tRLongS);
119 Double_t tXout = tROut*tPx-tRSide*tPy;
120 Double_t tXside = tROut*tPy+tRSide*tPx;
121 Double_t tXlong = tRLong;
122 Double_t tXtime = tDt;
124 if (!(inf1->GetEmissionPoint())) {
125 AliFemtoLorentzVector tPos(0,0,0,0);
126 inf1->SetEmissionPoint(&tPos);
129 inf1->SetEmissionPoint(0,0,0,0);
130 if (!(inf2->GetEmissionPoint())) {
131 AliFemtoLorentzVector tPos(tXout,tXside,tXlong,tXtime);
132 inf2->SetEmissionPoint(&tPos);
135 inf2->SetEmissionPoint(tXout, tXside, tXlong, tXtime);
138 //_______________________
139 void AliFemtoModelGausRinvFreezeOutGenerator::SetSizeInv(Double_t aSizeInv)
143 //_______________________
144 Double_t AliFemtoModelGausRinvFreezeOutGenerator::GetSizeInv() const
148 //_______________________
149 AliFemtoModelFreezeOutGenerator* AliFemtoModelGausRinvFreezeOutGenerator::Clone() const
151 return GetGenerator();
153 //_______________________
154 inline AliFemtoModelFreezeOutGenerator* AliFemtoModelGausRinvFreezeOutGenerator::GetGenerator() const
156 AliFemtoModelFreezeOutGenerator* tModel = new AliFemtoModelGausRinvFreezeOutGenerator(*this);
159 //_______________________
160 void AliFemtoModelGausRinvFreezeOutGenerator::SetSelectPrimaryFromHidden(bool aUse)
162 fSelectPrimary = aUse;
164 Bool_t AliFemtoModelGausRinvFreezeOutGenerator::GetSelectPrimaryFromHidden()
166 return fSelectPrimary;