Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
FemtoWeightGenerator.cxx
1/*
2 * FemtoWeightGenerator.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 "FemtoWeightGenerator.h"
11
12#include "Cout.h"
13#include "FemtoPair.h"
14
15namespace Hal {
17 fPairType(Femto::EPairType::kUnknown),
18 fTaskID(0),
19 fKStarOut(0),
20 fKStarSide(0),
21 fKStarLong(0),
22 fKStar(0),
23 fRStarOut(0),
24 fRStarSide(0),
25 fRStarLong(0),
26 fRStar(0) {}
27
29 TObject(aModel),
30 fPairType(aModel.fPairType),
31 fTaskID(aModel.fTaskID),
32 fKStarOut(0),
33 fKStarSide(0),
34 fKStarLong(0),
35 fKStar(0),
36 fRStarOut(0),
37 fRStarSide(0),
38 fRStarLong(0),
39 fRStar(0) {}
40
42 if (this != &aModel) {
43 fTaskID = aModel.fTaskID;
44 fKStarOut = aModel.fKStarOut;
45 fKStarSide = aModel.fKStarSide;
46 fKStarLong = aModel.fKStarLong;
47 fKStar = aModel.fKStar;
48 fRStarOut = aModel.fRStarOut;
49 fRStarSide = aModel.fRStarSide;
50 fRStarLong = aModel.fRStarLong;
51 fRStar = aModel.fRStar;
52 fPairType = aModel.fPairType;
53 }
54 return *this;
55 }
56
57 void FemtoWeightGenerator::SetPairType(Femto::EPairType aPairType) { fPairType = aPairType; }
58
59 Femto::EPairType FemtoWeightGenerator::GetPairType() const { return fPairType; }
60
61 FemtoWeightGenerator::~FemtoWeightGenerator() {
62 // TODO Auto-generated destructor stub
63 }
64
65 Double_t FemtoWeightGenerator::GenerateWeight(FemtoPair* /*pair*/) { return 1; }
66
68
69 void FemtoWeightGenerator::Print(Option_t* /*option*/) const {
70 Cout::Text(ClassName(), "L");
71 Cout::Text(Femto::PairTypeToString(fPairType), "L");
72 }
73
75 const Int_t ktPid1 = pair->GetPdg1();
76 const Int_t ktPid2 = pair->GetPdg2();
77 return Femto::PidToPairType(ktPid1, ktPid2);
78 }
79
80 Int_t FemtoWeightGenerator::GetPdg1() { return Femto::PairTypeToPid(fPairType).first; }
81
82 Int_t FemtoWeightGenerator::GetPdg2() { return Femto::PairTypeToPid(fPairType).second; }
83
85 Double_t tPx = pair->TruePx1() + pair->TruePx2();
86 Double_t tPy = pair->TruePy1() + pair->TruePy2();
87 Double_t tPz = pair->TruePz1() + pair->TruePz2();
88 Double_t tE1 = pair->TrueE1();
89 Double_t tE2 = pair->TrueE2();
90 Double_t tE = tE1 + tE2;
91 Double_t tPt = tPx * tPx + tPy * tPy;
92 Double_t tMt = tE * tE - tPz * tPz; // mCVK;
93 Double_t tM = sqrt(tMt - tPt);
94 tMt = sqrt(tMt);
95 tPt = sqrt(tPt);
96 // Double_t tBetat = tPt/tMt;
97
98 // Boost to LCMS
99 Double_t tBeta = tPz / tE;
100 Double_t tGamma = tE / tMt;
101 fKStarLong = tGamma * (pair->TruePz1() - tBeta * tE1);
102 Double_t tE1L = tGamma * (tE1 - tBeta * pair->TruePz1());
103
104 // Rotate in transverse plane
105 fKStarOut = (pair->TruePx1() * tPx + pair->TruePy1() * tPy) / tPt;
106 fKStarSide = (-pair->TruePx1() * tPy + pair->TruePy1() * tPx) / tPt;
107
108
109 // Boost to pair cms
110 fKStarOut = tMt / tM * (fKStarOut - tPt / tMt * tE1L);
111
112
113 Double_t tDX = pair->GetX1() - pair->GetX2();
114 Double_t tDY = pair->GetY1() - pair->GetY2();
115 Double_t tRLong = pair->GetZ1() - pair->GetZ2();
116 Double_t tDTime = pair->GetT1() - pair->GetT2();
117
118 Double_t tROut = (tDX * tPx + tDY * tPy) / tPt;
119 Double_t tRSide = (-tDX * tPy + tDY * tPx) / tPt;
120
121 fRStarSide = tRSide;
122 Double_t tRSS = fRStarSide / 0.197327;
123
124 fRStarLong = tGamma * (tRLong - tBeta * tDTime);
125 Double_t tDTimePairLCMS = tGamma * (tDTime - tBeta * tRLong);
126
127 Double_t tRLS = fRStarLong / 0.197327;
128 // 1/.1973
129 tBeta = tPt / tMt;
130 tGamma = tMt / tM;
131 // std::cout<<tROut<<" x "<<fRStarSide<<" "<<fRStarLong<<std::endl;
132 fRStarOut = tGamma * (tROut - tBeta * tDTimePairLCMS);
133
134 Double_t tROS = fRStarOut / 0.197327;
135 // Double_t tDTimePairCMS = tGamma*(tDTimePairLCMS - tBeta* tROut);
138 if (fKStarOut < 0) fKStar = -fKStar;
139 }
140} // namespace Hal
static void Text(TString text, TString option="L", Color_t color=-1)
Definition Cout.cxx:92
Int_t GetPdg2() const
Definition FemtoPair.h:302
Double_t GetY1() const
Definition FemtoPair.h:197
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 TruePy1() const
Definition FemtoPair.h:147
Double_t GetX2() const
Definition FemtoPair.h:212
Double_t TruePz2() const
Definition FemtoPair.h:177
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 TrueE2() const
Definition FemtoPair.h:182
Double_t TruePz1() const
Definition FemtoPair.h:152
Int_t GetPdg1() const
Definition FemtoPair.h:297
Double_t GetT2() const
Definition FemtoPair.h:227
Double_t GetX1() const
Definition FemtoPair.h:192
virtual FemtoWeightGenerator & operator=(const FemtoWeightGenerator &aModel)
void CalculateKinematics(FemtoPair *pair)
virtual Double_t GenerateWeight(FemtoPair *pair)
virtual void SetPairTypeFromPair(FemtoPair *pair)
virtual Femto::EPairType GetPairTypeFromPair(FemtoPair *pair)
virtual Femto::EPairType GetPairType() const
virtual void SetPairType(Femto::EPairType aPairType)