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 AliFemtoModelGausRinvFreezeOutGenerator& AliFemtoModelGausRinvFreezeOutGenerator::operator=(const AliFemtoModelGausRinvFreezeOutGenerator &aModel)
45 if (this != &aModel) {
46 fRandom = new TRandom2();
47 SetSizeInv(aModel.GetSizeInv());
53 //_______________________
54 void AliFemtoModelGausRinvFreezeOutGenerator::GenerateFreezeOut(AliFemtoPair *aPair)
56 AliFemtoModelHiddenInfo *inf1 = (AliFemtoModelHiddenInfo *) aPair->Track1()->HiddenInfo();
57 AliFemtoModelHiddenInfo *inf2 = (AliFemtoModelHiddenInfo *) aPair->Track2()->HiddenInfo();
59 if ((!inf1) || (!inf2)) { cout << "Hidden info not created! " << endl; exit(kFALSE); }
62 const AliFemtoModelGlobalHiddenInfo *infg1 = dynamic_cast<const AliFemtoModelGlobalHiddenInfo *>(aPair->Track1()->HiddenInfo());
63 const AliFemtoModelGlobalHiddenInfo *infg2 = dynamic_cast<const AliFemtoModelGlobalHiddenInfo *>(aPair->Track2()->HiddenInfo());
65 if ((infg1) && (infg2)) {
66 // assume the emission point is in [cm] and try to judge if
67 // both particles are primary
68 Double_t dist1 = infg1->GetGlobalEmissionPoint()->Perp();
69 Double_t dist2 = infg2->GetGlobalEmissionPoint()->Perp();
71 if ((dist1 > 0.05) && (dist2 > 0.05)) {
72 // At least one particle is non primary
73 if (!(inf1->GetEmissionPoint())) {
74 AliFemtoLorentzVector tPos(-1000,1000,-500,0);
75 inf1->SetEmissionPoint(&tPos);
78 inf1->SetEmissionPoint(-1000,1000,-500,0);
79 if (!(inf2->GetEmissionPoint())) {
80 AliFemtoLorentzVector tPos(fRandom->Gaus(0,1000.0),fRandom->Gaus(0,1000),fRandom->Gaus(0,1000),0.0);
81 inf2->SetEmissionPoint(&tPos);
84 inf2->SetEmissionPoint(fRandom->Gaus(0,1000), fRandom->Gaus(0,1000), fRandom->Gaus(0,1000), 0.0);
91 // Generate two particle emission points with respect
92 // to their pair momentum
93 // The source is the 3D Gaussian ellipsoid in the LCMS frame
95 // Calculate sum momenta
96 Double_t tPx = inf1->GetTrueMomentum()->x() + inf2->GetTrueMomentum()->x();
97 Double_t tPy = inf1->GetTrueMomentum()->y() + inf2->GetTrueMomentum()->y();
98 Double_t tPz = inf1->GetTrueMomentum()->z() + inf2->GetTrueMomentum()->z();
99 Double_t tM1 = inf1->GetMass();
100 Double_t tM2 = inf2->GetMass();
101 Double_t tE1 = sqrt(tM1*tM1 + inf1->GetTrueMomentum()->Mag2());
102 Double_t tE2 = sqrt(tM2*tM2 + inf2->GetTrueMomentum()->Mag2());
103 Double_t tEs = tE1 + tE2;
105 Double_t tPt = sqrt(tPx*tPx + tPy*tPy);
106 Double_t tMt = sqrt(tEs*tEs - tPz*tPz);
108 // Generate positions in PRF from a Gaussian
109 Double_t tROutS = fRandom->Gaus(0,fSizeInv); // reuse of long
110 Double_t tRSideS = fRandom->Gaus(0,fSizeInv);
111 Double_t tRLongS = fRandom->Gaus(0,fSizeInv);
112 Double_t tRTimeS = 0;
114 Double_t tBetat = tPt/tMt;
115 Double_t tGammat = 1.0/sqrt(1.0-tBetat*tBetat);
117 Double_t tBetaz = tPz/tEs;
118 Double_t tGammaz = 1.0/sqrt(1.0-tBetaz*tBetaz);
120 Double_t tROut = tGammat * (tROutS + tBetat * tRTimeS);
121 Double_t tDtL = tGammat * (tRTimeS + tBetat * tROutS);
122 Double_t tRSide = tRSideS;
124 Double_t tRLong = tGammaz * (tRLongS + tBetaz * tDtL);
125 Double_t tDt = tGammaz * (tDtL + tBetaz * tRLongS);
130 Double_t tXout = tROut*tPx-tRSide*tPy;
131 Double_t tXside = tROut*tPy+tRSide*tPx;
132 Double_t tXlong = tRLong;
133 Double_t tXtime = tDt;
135 if (!(inf1->GetEmissionPoint())) {
136 AliFemtoLorentzVector tPos(0,0,0,0);
137 inf1->SetEmissionPoint(&tPos);
140 inf1->SetEmissionPoint(0,0,0,0);
141 if (!(inf2->GetEmissionPoint())) {
142 AliFemtoLorentzVector tPos(tXout,tXside,tXlong,tXtime);
143 inf2->SetEmissionPoint(&tPos);
146 inf2->SetEmissionPoint(tXout, tXside, tXlong, tXtime);
149 //_______________________
150 void AliFemtoModelGausRinvFreezeOutGenerator::SetSizeInv(Double_t aSizeInv)
154 //_______________________
155 Double_t AliFemtoModelGausRinvFreezeOutGenerator::GetSizeInv() const
159 //_______________________
160 AliFemtoModelFreezeOutGenerator* AliFemtoModelGausRinvFreezeOutGenerator::Clone() const
162 return GetGenerator();
164 //_______________________
165 inline AliFemtoModelFreezeOutGenerator* AliFemtoModelGausRinvFreezeOutGenerator::GetGenerator() const
167 AliFemtoModelFreezeOutGenerator* tModel = new AliFemtoModelGausRinvFreezeOutGenerator(*this);
170 //_______________________
171 void AliFemtoModelGausRinvFreezeOutGenerator::SetSelectPrimaryFromHidden(bool aUse)
173 fSelectPrimary = aUse;
175 Bool_t AliFemtoModelGausRinvFreezeOutGenerator::GetSelectPrimaryFromHidden()
177 return fSelectPrimary;