Add possibility to swich off creating hidden info
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemto / AliFemtoModelManager.cxx
CommitLineData
75c432a7 1////////////////////////////////////////////////////////////////////////////////
2/// ///
3/// AliFemtoModelManager - main helper class for femtoscopy calculations ///
4/// Manages weight generation, freeze-out coordinates generation ///
5/// Authors: Adam Kisiel kisiel@mps.ohio-state.edu ///
6/// ///
7////////////////////////////////////////////////////////////////////////////////
8#ifdef __ROOT__
9 ClassImp(AliFemtoModelManager, 1)
10#endif
11
12#include "AliFemtoModelManager.h"
13#include "AliFemtoModelHiddenInfo.h"
14
15//_____________________________________________
16AliFemtoModelManager::AliFemtoModelManager():
17 fFreezeOutGenerator(0),
18 fWeightGenerator(0),
19 fCreateCopyHiddenInfo(kFALSE)
20{
21}
22//_____________________________________________
23AliFemtoModelManager::AliFemtoModelManager(const AliFemtoModelManager& aManager):
24 fFreezeOutGenerator(0),
25 fWeightGenerator(0),
26 fCreateCopyHiddenInfo(aManager.fCreateCopyHiddenInfo)
27{
28 if (aManager.fFreezeOutGenerator) {
29 fFreezeOutGenerator = aManager.fFreezeOutGenerator->Clone();
30 }
31 if (aManager.fWeightGenerator) {
32 fWeightGenerator = aManager.fWeightGenerator->Clone();
33 }
34}
35//_____________________________________________
36AliFemtoModelManager::~AliFemtoModelManager()
37{
38 if (fFreezeOutGenerator) delete fFreezeOutGenerator;
39 if (fWeightGenerator) delete fWeightGenerator;
40}
41//_____________________________________________
42AliFemtoModelManager& AliFemtoModelManager::operator=(const AliFemtoModelManager& aManager)
43{
44 if (this == &aManager)
45 return *this;
46 if (aManager.fFreezeOutGenerator) {
47 fFreezeOutGenerator = aManager.fFreezeOutGenerator->Clone();
48 }
49 else fFreezeOutGenerator = 0;
50 if (aManager.fWeightGenerator) {
51 fWeightGenerator = aManager.fWeightGenerator->Clone();
52 }
53 else fWeightGenerator = 0;
54 fCreateCopyHiddenInfo = aManager.fCreateCopyHiddenInfo;
55
56 return *this;
57}
58//_____________________________________________
59void AliFemtoModelManager::AcceptFreezeOutGenerator(AliFemtoModelFreezeOutGenerator *aFreeze)
60{
61 fFreezeOutGenerator = aFreeze;
62}
63//_____________________________________________
64void AliFemtoModelManager::AcceptWeightGenerator(AliFemtoModelWeightGenerator *aWeight)
65{
66 fWeightGenerator = aWeight;
67}
68//_____________________________________________
69Double_t AliFemtoModelManager::GetWeight(AliFemtoPair *aPair)
70{
d92ed900 71 if (!fWeightGenerator) {
72 cout << "No weight generator set! Cannot calculate weight" << endl;
73 exit(0);
74 }
75c432a7 75 // Return femtoscopic weight for a fiven pair
76 if (fCreateCopyHiddenInfo) {
d92ed900 77 // Try to gess particle masses and pid from the weight generator
78 Double_t tMass1, tMass2;
79 Int_t tPid1, tPid2;
80 if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::fgkPionPlusPionPlus) {
81 tMass1 = 0.13957;
82 tMass2 = 0.13957;
83 tPid1 = 211;
84 tPid2 = 211;
85 }
86 if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::fgkPionPlusPionMinus) {
87 tMass1 = 0.13957;
88 tMass2 = 0.13957;
89 tPid1 = 211;
90 tPid2 = -211;
91 }
92 if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::fgkKaonPlusKaonPlus) {
93 tMass1 = 0.493677;
94 tMass2 = 0.493677;
95 tPid1 = 321;
96 tPid2 = 321;
97 }
98 if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::fgkKaonPlusKaonMinus) {
99 tMass1 = 0.493677;
100 tMass2 = 0.493677;
101 tPid1 = 321;
102 tPid2 = -321;
103 }
104 if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::fgkProtonProton) {
105 tMass1 = 0.938272;
106 tMass2 = 0.938272;
107 tPid1 = 2212;
108 tPid2 = 2212;
109 }
110 if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::fgkProtonAntiproton) {
111 tMass1 = 0.938272;
112 tMass2 = 0.938272;
113 tPid1 = 2212;
114 tPid2 = -2212;
115 }
116 if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::fgkPionPlusKaonPlus) {
117 tMass1 = 0.13957;
118 tMass2 = 0.493677;
119 tPid1 = 211;
120 tPid2 = 321;
121 }
122 if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::fgkPionPlusKaonMinus) {
123 tMass1 = 0.13957;
124 tMass2 = 0.493677;
125 tPid1 = 211;
126 tPid2 = -321;
127 }
128 if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::fgkPionPlusProton) {
129 tMass1 = 0.13957;
130 tMass2 = 0.938272;
131 tPid1 = 211;
132 tPid2 = 2212;
133 }
134 if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::fgkPionPlusAntiproton) {
135 tMass1 = 0.13957;
136 tMass2 = 0.938272;
137 tPid1 = 211;
138 tPid2 = -2212;
139 }
140 if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::fgkKaonPlusProton) {
141 tMass1 = 0.493677;
142 tMass2 = 0.938272;
143 tPid1 = 321;
144 tPid2 = 2212;
145 }
146 if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::fgkKaonPlusAntiproton) {
147 tMass1 = 0.493677;
148 tMass2 = 0.938272;
149 tPid1 = 321;
150 tPid2 = -2212;
151 }
152
d0e92d9a 153 if (!(aPair->Track1()->HiddenInfo())) {
75c432a7 154 AliFemtoModelHiddenInfo *inf1 = new AliFemtoModelHiddenInfo();
d0e92d9a 155 inf1->SetTrueMomentum(aPair->Track1()->Track()->P());
d92ed900 156 inf1->SetMass(tMass1);
157 inf1->SetPDGPid(tPid1);
d0e92d9a 158 aPair->Track1()->SetHiddenInfo(inf1);
75c432a7 159 delete inf1;
160 }
d0e92d9a 161 if (!(aPair->Track2()->HiddenInfo())) {
75c432a7 162 AliFemtoModelHiddenInfo *inf2 = new AliFemtoModelHiddenInfo();
d0e92d9a 163 inf2->SetTrueMomentum(aPair->Track2()->Track()->P());
d92ed900 164 inf2->SetMass(tMass2);
165 inf2->SetPDGPid(tPid2);
d0e92d9a 166 aPair->Track2()->SetHiddenInfo(inf2);
75c432a7 167 delete inf2;
168 }
169 }
170
171 if (fFreezeOutGenerator) {
172 fFreezeOutGenerator->GenerateFreezeOut(aPair);
173 }
174 return fWeightGenerator->GenerateWeight(aPair);
175}
176//_____________________________________________
fd27c54f 177void AliFemtoModelManager::CreateCopyHiddenInfo(Bool_t aCopy)
75c432a7 178{
fd27c54f 179 fCreateCopyHiddenInfo = aCopy;
75c432a7 180}
181//_____________________________________________
182AliFemtoModelFreezeOutGenerator* AliFemtoModelManager::GetFreezeOutGenerator()
183{
184 return fFreezeOutGenerator;
185}
186//_____________________________________________
187AliFemtoModelWeightGenerator* AliFemtoModelManager::GetWeightGenerator()
188{
189 return fWeightGenerator;
190}