Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
FemtoWeightGeneratorBasic.cxx
1/*
2 * FemtoWeightGeneratorBasic.cxx
3 *
4 * Created on: 21-08-2013
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "FemtoWeightGeneratorBasic.h"
11
12
13#include <RtypesCore.h>
14#include <TString.h>
15#include <cmath>
16
17#include "FemtoConst.h"
18#include "FemtoPair.h"
19#include "Package.h"
20#include "Parameter.h"
21
22namespace Hal {
24
25 FemtoWeightGenerator* FemtoWeightGeneratorBasic::GetGenerator() const {
27 return tGen;
28 }
29
31
33 if (this != &aModel) { FemtoWeightGenerator::operator=(aModel); }
34
35 return *this;
36 }
37
39 // Generate a simple femtoscopic weight coming only from
40 // quantum statistics - symmetrization or anti-symmetrization
41 // of the pair wave function
42
43 // Get hidden information pointers
44 // return 1;
45 // Calculate pair variables
46 Double_t tPx = pair->TruePx1() + pair->TruePx2();
47 Double_t tPy = pair->TruePy1() + pair->TruePy2();
48 Double_t tPz = pair->TruePz1() + pair->TruePz2();
49 Double_t tE1 = pair->TrueE1();
50 Double_t tE2 = pair->TrueE2();
51 Double_t tE = tE1 + tE2;
52 Double_t tPt = tPx * tPx + tPy * tPy;
53 Double_t tMt = tE * tE - tPz * tPz; // mCVK;
54 Double_t tM = sqrt(tMt - tPt);
55 tMt = sqrt(tMt);
56 tPt = sqrt(tPt);
57 // Double_t tBetat = tPt/tMt;
58
59 // Boost to LCMS
60 Double_t tBeta = tPz / tE;
61 Double_t tGamma = tE / tMt;
62 fKStarLong = tGamma * (pair->TruePz1() - tBeta * tE1);
63 Double_t tE1L = tGamma * (tE1 - tBeta * pair->TruePz1());
64
65 // Transform positions to LCMS
66 // Double_t tP1zl = tGamma * (track1->GetEmissionPoint()->z() - tBeta *
67 // track1->GetEmissionPoint()->t()); Double_t tP1tl = tGamma *
68 // (track1->GetEmissionPoint()->t() - tBeta *
69 // track1->GetEmissionPoint()->z());
70
71 // Double_t tP2zl = tGamma * (track2->GetEmissionPoint()->z() - tBeta *
72 // track2->GetEmissionPoint()->t()); Double_t tP2tl = tGamma *
73 // (track2->GetEmissionPoint()->t() - tBeta *
74 // track2->GetEmissionPoint()->z());
75
76 // Double_t tP1pzl = tGamma * (track1->GetTrueMomentum()->z() - tBeta *
77 // tE1); Double_t tP1el = tGamma * (tE1 - tBeta *
78 // track1->GetTrueMomentum()->z());
79
80 // Double_t tP2pzl = tGamma * (track2->GetTrueMomentum()->z() - tBeta *
81 // tE2); Double_t tP2el = tGamma * (tE2 - tBeta *
82 // track2->GetTrueMomentum()->z());
83
84 // Rotate in transverse plane
85 fKStarOut = (pair->TruePx1() * tPx + pair->TruePy1() * tPy) / tPt;
86 fKStarSide = (-pair->TruePx1() * tPy + pair->TruePy1() * tPx) / tPt;
87
88 // Double_t tP1pxl = fKStarOut;
89 // Double_t tP1pyl = fKStarSide;
90
91 // Double_t tP2pxl = (track2->GetTrueMomentum()->x()*tPx +
92 // track2->GetTrueMomentum()->y()*tPy)/tPt; Double_t tP2pyl =
93 // (track2->GetTrueMomentum()->y()*tPx -
94 // track2->GetTrueMomentum()->x()*tPy)/tPt;;
95
96 // Double_t tKO = tP1pxl - tP2pxl;
97 // Double_t tKS = tP1pyl - tP2pyl;
98 // Double_t tKL = tP1pzl - tP2pzl;
99 // Double_t tDE = tP1el - tP2el;
100
101 // save the rotated coordinates in LCMS variables
102 // Double_t tP1xl = ( track1->GetEmissionPoint()->x()*tPx +
103 // track1->GetEmissionPoint()->y()*tPy)/tPt; Double_t tP1yl =
104 // (-track1->GetEmissionPoint()->x()*tPy +
105 // track1->GetEmissionPoint()->y()*tPx)/tPt;
106
107 // Double_t tP2xl = ( track2->GetEmissionPoint()->x()*tPx +
108 // track2->GetEmissionPoint()->y()*tPy)/tPt; Double_t tP2yl =
109 // (-track2->GetEmissionPoint()->x()*tPy +
110 // track2->GetEmissionPoint()->y()*tPx)/tPt;
111
112 // Boost to pair cms
113 fKStarOut = tMt / tM * (fKStarOut - tPt / tMt * tE1L);
114
115 // tBetat = tPt/tMt;
116 // Double_t tGammat = 1.0/sqrt(1.0-tBetat*tBetat);
117
118 // Double_t tP1xp = tGammat*(tP1xl - tBetat*tP1tl);
119 // Double_t tP1tp = tGammat*(tP1tl - tBetat*tP1xl);
120
121 // Double_t tP2xp = tGammat*(tP2xl - tBetat*tP2tl);
122 // Double_t tP2tp = tGammat*(tP2tl - tBetat*tP2xl);
123
124 // Double_t tRO = (tP1xl - tP2xl)/0.197327;
125 // Double_t tRS = (tP1yl - tP2yl)/0.197327;
126 // Double_t tRL = (tP1zl - tP2zl)/0.197327;
127 // Double_t tDT = (tP1tl - tP2tl)/0.197327;
128
129 Double_t tDX = pair->GetX1() - pair->GetX2();
130 Double_t tDY = pair->GetY1() - pair->GetY2();
131 Double_t tRLong = pair->GetZ1() - pair->GetZ2();
132 Double_t tDTime = pair->GetT1() - pair->GetT2();
133
134 Double_t tROut = (tDX * tPx + tDY * tPy) / tPt;
135 Double_t tRSide = (-tDX * tPy + tDY * tPx) / tPt;
136
137 fRStarSide = tRSide;
138 Double_t tRSS = fRStarSide / 0.197327;
139
140 fRStarLong = tGamma * (tRLong - tBeta * tDTime);
141 Double_t tDTimePairLCMS = tGamma * (tDTime - tBeta * tRLong);
142
143 Double_t tRLS = fRStarLong / 0.197327;
144 // 1/.1973
145 tBeta = tPt / tMt;
146 tGamma = tMt / tM;
147 // std::cout<<tROut<<" x "<<fRStarSide<<" "<<fRStarLong<<std::endl;
148 fRStarOut = tGamma * (tROut - tBeta * tDTimePairLCMS);
149 // TLorentzVector TX;
150 // TX.SetXYZT(-pair->X2(),-pair->Y2(),-pair->Z2(),-pair->T2());
151 // TX.Boost(0,0,-tPz/tE);
152 // TX.RotateZ(-TMath::ATan2(tPy,tPx));
153 // std::cout<<" contorl of weight "<<TX.X()<<" "<<TX.Y()<<"
154 // "<<TX.Z()<<std::endl;
155 Double_t tROS = fRStarOut / 0.197327;
156 // Double_t tDTimePairCMS = tGamma*(tDTimePairLCMS - tBeta* tROut);
159
160 // Double_t tRSt = fRStar/0.197327;
161#ifdef _kinetic_debug
162
163 Double_t tpx = pair->GetPx1() - pair->GetPx2();
164 Double_t tpy = pair->GetPy1() - pair->y2();
165 Double_t tpz = pair->GetPz1() - pair->GetPz2();
166 Double_t tpe = pair->GetE1() - pair->GetE2();
167 TLorentzVector p1, p2;
168 p1.SetPxPyPzE(pair->GetPx1(), pair->GetPy1(), pair->GetPz1(), pair->GetE1());
169 p2.SetPxPyPzE(pair->GetPx2(), pair->GetPy2(), pair->GetPz2(), pair->GetE2());
170 TLorentzVector x1, x2;
171 x1.SetPxPyPzE(pair->GetX1(), pair->GetY1(), pair->GetZ1(), pair->GetT1());
172 x2.SetPxPyPzE(pair->GetX2(), pair->GetY2(), pair->GetZ2(), pair->GetT2());
173 TLorentzVector sum = p1 + p2;
174 Double_t vz = sum.Pz() / sum.E();
175 p1.Boost(0, 0, -vz);
176 p2.Boost(0, 0, -vz);
177 x1.Boost(0, 0, -vz);
178 x2.Boost(0, 0, -vz);
179 Double_t phi = sum.Phi();
180 p1.RotateZ(-phi);
181 p2.RotateZ(-phi);
182 x1.RotateZ(-phi);
183 x2.RotateZ(-phi);
184 sum.Boost(0, 0, -vz);
185 Double_t vx = sum.Pt() / sum.E();
186 p1.Boost(-vx, 0, 0);
187 p2.Boost(-vx, 0, 0);
188 x1.Boost(-vx, 0, 0);
189 x2.Boost(-vx, 0, 0);
190 TLorentzVector R = x1 - x2;
191 std::cout << " ---WEIGHT--PRF-------- " << std::endl;
192
193 std::cout << " out " << 2 * fKStarOut << " " << p1.Px() << std::endl;
194 std::cout << " side " << 2 * fKStarSide << " " << p1.Py() << std::endl;
195 std::cout << " long " << 2 * fKStarLong << " " << p1.Pz() << std::endl;
196 std::cout << " star " << 2 * fKStar << " " << (p1.Rho()) << std::endl;
197
198 std::cout << " Rlong " << fRStarLong << " " << R.Pz() << std::endl;
199 std::cout << " Rout " << fRStarOut << " " << R.Px() << std::endl;
200 std::cout << " Rside " << fRStarSide << " " << R.Py() << std::endl;
201
202 pair->PrintInfo();
203 std::cout << " ---END WEIGHT-------- " << std::endl;
204 // std::cout<<" Rstar "<<fKStar <<" " <<(p1.Rho())<<std::endl;
205 std::cout << " WAGA BASIC " << 2.0 * (fKStarOut * tROS) << " " << 2.0 * (fKStarSide * tRSS) << " "
206 << 2.0 * (fKStarLong * tRLS) << std::endl;
207 std::cout << "WAGA BASIC " << 2.0 * (fKStarOut * tROS + fKStarSide * tRSS + fKStarLong * tRLS) << std::endl;
208#endif
210 if (fPairType != Femto::EPairType::kUnknown) {
211 if ((fPairType == Femto::EPairType::kPionPlusPionPlus) || (fPairType == Femto::EPairType::kKaonPlusKaonPlus)) {
212 return 1.0 + cos(2.0 * (fKStarOut * tROS + fKStarSide * tRSS + fKStarLong * tRLS));
213 } else if (fPairType == Femto::EPairType::kProtonProton || fPairType == Femto::EPairType::kLambdaLambda)
214 return 1.0 - 0.5 * cos(2.0 * (fKStarOut * tROS + fKStarSide * tRSS + fKStarLong * tRLS));
215 else
216 return 1.0;
217 } else {
218 Femto::EPairType tPairType = GetPairTypeFromPair(pair);
219 if ((tPairType == Femto::EPairType::kPionPlusPionPlus) || (tPairType == Femto::EPairType::kKaonPlusKaonPlus)) {
220 return 1.0 + cos(2.0 * (fKStarOut * tROS + fKStarSide * tRSS + fKStarLong * tRLS));
221 } else if (tPairType == Femto::EPairType::kProtonProton || tPairType == Femto::EPairType::kLambdaLambda)
222 return 1.0 - 0.5 * cos(2.0 * (fKStarOut * tROS + fKStarSide * tRSS + fKStarLong * tRLS));
223 else
224 return 1.0;
225 }
226 }
227
228 FemtoWeightGenerator* FemtoWeightGeneratorBasic::Clone(const char* /*newname*/) const { return GetGenerator(); }
229
230 FemtoWeightGeneratorBasic::~FemtoWeightGeneratorBasic() {}
231
232 Package* FemtoWeightGeneratorBasic::Report() const {
233 Package* report = FemtoWeightGenerator::Report();
234 report->AddObject(new ParameterString("PairType", Femto::PairTypeToString(fPairType)));
235 return report;
236 }
237} // namespace Hal
void PrintInfo() const
Double_t GetY1() const
Definition FemtoPair.h:197
Double_t GetPy1() const
Definition FemtoPair.h:237
Double_t GetPy2() const
Definition FemtoPair.h:262
Double_t GetY2() const
Definition FemtoPair.h:217
Double_t TruePx1() const
Definition FemtoPair.h:142
Double_t TruePy2() const
Definition FemtoPair.h:172
Double_t GetZ1() const
Definition FemtoPair.h:202
Double_t GetPz1() const
Definition FemtoPair.h:242
Double_t TruePy1() const
Definition FemtoPair.h:147
Double_t GetX2() const
Definition FemtoPair.h:212
Double_t GetPx2() const
Definition FemtoPair.h:257
Double_t GetE2() const
Definition FemtoPair.h:272
Double_t TruePz2() const
Definition FemtoPair.h:177
Double_t GetE1() const
Definition FemtoPair.h:247
Double_t TruePx2() const
Definition FemtoPair.h:167
Double_t GetZ2() const
Definition FemtoPair.h:222
Double_t TrueE1() const
Definition FemtoPair.h:157
Double_t GetT1() const
Definition FemtoPair.h:207
Double_t GetPx1() const
Definition FemtoPair.h:232
Double_t TrueE2() const
Definition FemtoPair.h:182
Double_t TruePz1() const
Definition FemtoPair.h:152
Double_t GetPz2() const
Definition FemtoPair.h:267
Double_t GetT2() const
Definition FemtoPair.h:227
Double_t GetX1() const
Definition FemtoPair.h:192
FemtoWeightGeneratorBasic & operator=(const FemtoWeightGeneratorBasic &aModel)
virtual Double_t GenerateWeight(FemtoPair *track)
virtual FemtoWeightGenerator * Clone(const char *newame="") const
virtual FemtoWeightGenerator & operator=(const FemtoWeightGenerator &aModel)
virtual Femto::EPairType GetPairTypeFromPair(FemtoPair *pair)