Lines getting the matched track moved to a method in AliCalorimeterUtils. Lines copie...
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemtoUser / AliFemtoModelAllHiddenInfo.cxx
1 //K//////////////////////////////////////////////////////////////////////////M//
2 //K                                                                          M//
3 //K AliFemtoModelAllHiddenInfo -                                             M//
4 //K derived class inherits  the base class AliFemtoModelHiddenInfo           M//
5 //K the hidden info for model calculations                                   M//
6 //K Stores information needed for the weight generation -                    M//
7 //K                                                                          M//
8 //K in addition to  the base class AliFemtoModelHiddenInfo - the true        M//
9 //K simulated momenta, freeze-out coordinates from model and particle PID    M//
10 //K New information was added                                                M//
11 //K 1. Mother ID                                                             M//
12 //K 2. Mother 4-Momentum                                                     M//
13 //K 3. Mother emission point 4-vector                                        M//
14 //K 4. Childs IDs                                                            M//
15 //K 5. Childs 4-Momentum                                                     M//
16 //K--------------------------------------------------------------------------M//                                                                            //
17 //K APR2008  Konstantin Mikhailov Konstantin.Mikhailov@itep.ru               M//
18 //K                                                                          M//
19 //K//////////////////////////////////////////////////////////////////////////M//
20 #include "AliFemtoModelAllHiddenInfo.h"
21
22 //_____________________________________________
23 AliFemtoModelAllHiddenInfo::AliFemtoModelAllHiddenInfo() :
24   fTrueMomentumMother(0),
25   fEmissionPointMother(0),
26   fPDGPidMother(0),
27   fTrueMomentumChild1(0),
28   fTrueMomentumChild2(0),
29   fPDGPidChild1(0),
30   fPDGPidChild2(0)
31 {
32   // Default constructor
33 }
34 //_____________________________________________
35 AliFemtoModelAllHiddenInfo::AliFemtoModelAllHiddenInfo(const AliFemtoModelAllHiddenInfo &aInfo) :
36   AliFemtoModelHiddenInfo(aInfo),
37   fTrueMomentumMother(new AliFemtoLorentzVector(*(aInfo.fTrueMomentumMother))),
38   fEmissionPointMother(new AliFemtoLorentzVector(*(aInfo.fEmissionPointMother))),
39   fPDGPidMother(aInfo.fPDGPidMother),
40   fTrueMomentumChild1(new AliFemtoLorentzVector(*(aInfo.fTrueMomentumChild1))),
41   fTrueMomentumChild2(new AliFemtoLorentzVector(*(aInfo.fTrueMomentumChild2))),
42   fPDGPidChild1(aInfo.fPDGPidChild1),
43   fPDGPidChild2(aInfo.fPDGPidChild2)
44 {
45   //
46   // Copy constructor
47   //
48 }
49 //_____________________________________________
50 AliFemtoModelAllHiddenInfo::~AliFemtoModelAllHiddenInfo()
51 {
52   // Destructor
53   delete fTrueMomentumMother;
54   delete fEmissionPointMother;
55   delete fTrueMomentumChild1;
56   delete fTrueMomentumChild2;
57 }
58 //_____________________________________________
59 AliFemtoModelAllHiddenInfo& AliFemtoModelAllHiddenInfo::operator=(const AliFemtoModelAllHiddenInfo& aInfo)
60 {
61   //
62   // assignment operator
63   //
64   if (this != &aInfo) {
65     AliFemtoModelHiddenInfo::operator=(aInfo);
66     delete fTrueMomentumMother;
67     fTrueMomentumMother = new AliFemtoLorentzVector(*(aInfo.fTrueMomentumMother));
68     delete fEmissionPointMother;
69     fEmissionPointMother = new AliFemtoLorentzVector(*(aInfo.fEmissionPointMother));
70     fPDGPidMother = aInfo.fPDGPidMother;
71     delete fTrueMomentumChild1;
72     fTrueMomentumChild1 = new AliFemtoLorentzVector(*(aInfo.fTrueMomentumChild1));
73     delete fTrueMomentumChild2;
74     fTrueMomentumChild2 = new AliFemtoLorentzVector(*(aInfo.fTrueMomentumChild2));
75     fPDGPidChild1 = aInfo.fPDGPidChild1;      
76     fPDGPidChild2 = aInfo.fPDGPidChild2;   
77   }
78   return *this;
79 }
80 //
81 //   GET
82 //
83 //_____________________________________________
84 AliFemtoLorentzVector *AliFemtoModelAllHiddenInfo::GetTrueMomentumMother() const
85 {
86 return fTrueMomentumMother;
87 }
88 //_____________________________________________
89 AliFemtoLorentzVector *AliFemtoModelAllHiddenInfo::GetEmissionPointMother() const
90 {
91   return fEmissionPoint;
92 }
93 //_____________________________________________
94   Int_t                AliFemtoModelAllHiddenInfo::GetPDGPidMother() const
95 {
96   return fPDGPidMother;
97 }
98 //_____________________________________________
99 AliFemtoLorentzVector *AliFemtoModelAllHiddenInfo::GetTrueMomentumChild1() const
100 {
101 return fTrueMomentumChild1;
102 }
103 //_____________________________________________
104 AliFemtoLorentzVector *AliFemtoModelAllHiddenInfo::GetTrueMomentumChild2() const
105 {
106 return fTrueMomentumChild2;
107 }
108 //_____________________________________________
109   Int_t                AliFemtoModelAllHiddenInfo::GetPDGPidChild1() const
110 {
111   return fPDGPidChild1;
112 }
113 //_____________________________________________
114   Int_t                AliFemtoModelAllHiddenInfo::GetPDGPidChild2() const
115 {
116   return fPDGPidChild2;
117 }
118 //
119 //   SET
120 //
121 //_____________________________________________
122 //  Mother momentum
123 //_____________________________________________
124 void AliFemtoModelAllHiddenInfo::SetTrueMomentumMother(AliFemtoLorentzVector *aMomMother)
125 {
126   // Set momentum from vector
127   if (fTrueMomentumMother) {
128     fTrueMomentumMother->SetX(aMomMother->px());
129     fTrueMomentumMother->SetY(aMomMother->py());
130     fTrueMomentumMother->SetZ(aMomMother->pz());
131     fTrueMomentumMother->SetT(aMomMother->e());
132   }
133   else {
134     fTrueMomentumMother = new AliFemtoLorentzVector(*aMomMother);
135   }
136 }
137 //_____________________________________________
138 void AliFemtoModelAllHiddenInfo::SetTrueMomentumMother(const AliFemtoLorentzVector& aMomMother)
139 {
140   // Set momentum from vector and energy
141   if (fTrueMomentumMother) {
142     fTrueMomentumMother->SetX(aMomMother.px());
143     fTrueMomentumMother->SetY(aMomMother.py());
144     fTrueMomentumMother->SetZ(aMomMother.pz());
145     fTrueMomentumMother->SetT(aMomMother.e());
146   }
147   else {
148     fTrueMomentumMother = new AliFemtoLorentzVector();
149     *fTrueMomentumMother = aMomMother;
150   }
151 }
152 //_____________________________________________
153 void AliFemtoModelAllHiddenInfo::SetTrueMomentumMother(Double_t aMotherPx, Double_t aMotherPy, Double_t aMotherPz, Double_t aMotherE)
154 {
155   // Set momentum from components and energy
156   if (!fTrueMomentumMother) fTrueMomentumMother = new AliFemtoLorentzVector();
157     fTrueMomentumMother->SetX(aMotherPx);
158     fTrueMomentumMother->SetY(aMotherPy);
159     fTrueMomentumMother->SetZ(aMotherPz);
160     fTrueMomentumMother->SetT(aMotherE);
161 }
162 //_____________________________________________
163 //   Mother Emissin Point
164 //_____________________________________________
165 void                   AliFemtoModelAllHiddenInfo::SetEmissionPointMother(AliFemtoLorentzVector *aPos)
166 {
167   // Set position from vector
168   if (fEmissionPointMother) {
169     fEmissionPointMother->SetX(aPos->px());
170     fEmissionPointMother->SetY(aPos->py());
171     fEmissionPointMother->SetZ(aPos->pz());
172     fEmissionPointMother->SetT(aPos->e());
173   }
174   else {
175     fEmissionPointMother = new AliFemtoLorentzVector(*aPos);
176   }
177 }
178 //_____________________________________________
179 void                   AliFemtoModelAllHiddenInfo::SetEmissionPointMother(const AliFemtoLorentzVector& aPos)
180 {
181   // Set position from vector
182   if (fEmissionPointMother) {
183     fEmissionPointMother->SetX(aPos.px());
184     fEmissionPointMother->SetY(aPos.py());
185     fEmissionPointMother->SetZ(aPos.pz());
186     fEmissionPointMother->SetT(aPos.e());
187   }
188   else {
189     fEmissionPointMother = new AliFemtoLorentzVector();
190     *fEmissionPointMother = aPos;
191   }
192 }
193 //_____________________________________________
194 void                   AliFemtoModelAllHiddenInfo::SetEmissionPointMother(Double_t aRx, Double_t aRy, Double_t aRz, Double_t aT)
195 {
196   // Set position from components
197   if (fEmissionPointMother) {
198     fEmissionPointMother->SetX(aRx);
199     fEmissionPointMother->SetY(aRy);
200     fEmissionPointMother->SetZ(aRz);
201     fEmissionPointMother->SetT(aT);
202   }
203   else {
204     fEmissionPointMother = new AliFemtoLorentzVector(aRx, aRy, aRz, aT); 
205   }
206 }
207 //_____________________________________________
208 //  Mother PID
209 //_____________________________________________
210 void                   AliFemtoModelAllHiddenInfo::SetPDGPidMother(Int_t aPidMother)
211 {
212   fPDGPidMother = aPidMother;
213 }
214 //_____________________________________________
215 //  Child1 momentum
216 //_____________________________________________
217 void AliFemtoModelAllHiddenInfo::SetTrueMomentumChild1(AliFemtoLorentzVector *aMomChild1)
218 {
219   // Set momentum from vector
220   if (fTrueMomentumChild1) {
221     fTrueMomentumChild1->SetX(aMomChild1->px());
222     fTrueMomentumChild1->SetY(aMomChild1->py());
223     fTrueMomentumChild1->SetZ(aMomChild1->pz());
224     fTrueMomentumChild1->SetT(aMomChild1->e());
225   }
226   else {
227     fTrueMomentumChild1 = new AliFemtoLorentzVector(*aMomChild1);
228   }
229 }
230 //_____________________________________________
231 void AliFemtoModelAllHiddenInfo::SetTrueMomentumChild1(const AliFemtoLorentzVector& aMomChild1)
232 {
233   // Set momentum from vector and energy
234   if (fTrueMomentumChild1) {
235     fTrueMomentumChild1->SetX(aMomChild1.px());
236     fTrueMomentumChild1->SetY(aMomChild1.py());
237     fTrueMomentumChild1->SetZ(aMomChild1.pz());
238     fTrueMomentumChild1->SetT(aMomChild1.e());
239   }
240   else {
241     fTrueMomentumChild1 = new AliFemtoLorentzVector();
242     *fTrueMomentumChild1 = aMomChild1;
243   }
244 }
245 //_____________________________________________
246 void AliFemtoModelAllHiddenInfo::SetTrueMomentumChild1(Double_t aChild1Px, Double_t aChild1Py, Double_t aChild1Pz, Double_t aChild1E)
247 {
248   // Set momentum from components and energy
249   if (!fTrueMomentumChild1) fTrueMomentumChild1 = new AliFemtoLorentzVector();
250     fTrueMomentumChild1->SetX(aChild1Px);
251     fTrueMomentumChild1->SetY(aChild1Py);
252     fTrueMomentumChild1->SetZ(aChild1Pz);
253     fTrueMomentumChild1->SetT(aChild1E);
254 }
255 //_____________________________________________
256 //  Child2 momentum
257 //_____________________________________________
258 void AliFemtoModelAllHiddenInfo::SetTrueMomentumChild2(AliFemtoLorentzVector *aMomChild2)
259 {
260   // Set momentum from vector
261   if (fTrueMomentumChild2) {
262     fTrueMomentumChild2->SetX(aMomChild2->px());
263     fTrueMomentumChild2->SetY(aMomChild2->py());
264     fTrueMomentumChild2->SetZ(aMomChild2->pz());
265     fTrueMomentumChild2->SetT(aMomChild2->e());
266   }
267   else {
268     fTrueMomentumChild2 = new AliFemtoLorentzVector(*aMomChild2);
269   }
270 }
271 //_____________________________________________
272 void AliFemtoModelAllHiddenInfo::SetTrueMomentumChild2(const AliFemtoLorentzVector& aMomChild2)
273 {
274   // Set momentum from vector and energy
275   if (fTrueMomentumChild2) {
276     fTrueMomentumChild2->SetX(aMomChild2.px());
277     fTrueMomentumChild2->SetY(aMomChild2.py());
278     fTrueMomentumChild2->SetZ(aMomChild2.pz());
279     fTrueMomentumChild2->SetT(aMomChild2.e());
280   }
281   else {
282     fTrueMomentumChild2 = new AliFemtoLorentzVector();
283     *fTrueMomentumChild2 = aMomChild2;
284   }
285 }
286 //_____________________________________________
287 void AliFemtoModelAllHiddenInfo::SetTrueMomentumChild2(Double_t aChild2Px, Double_t aChild2Py, Double_t aChild2Pz, Double_t aChild2E)
288 {
289   // Set momentum from components and energy
290   if (!fTrueMomentumChild2) fTrueMomentumChild2 = new AliFemtoLorentzVector();
291     fTrueMomentumChild2->SetX(aChild2Px);
292     fTrueMomentumChild2->SetY(aChild2Py);
293     fTrueMomentumChild2->SetZ(aChild2Pz);
294     fTrueMomentumChild2->SetT(aChild2E);
295 }
296 //_____________________________________________
297 //  Child1 PID
298 //_____________________________________________
299 void                   AliFemtoModelAllHiddenInfo::SetPDGPidChild1(Int_t aPidChild1)
300 {
301   fPDGPidMother = aPidChild1;
302 }
303 //_____________________________________________
304 //  Child2 PID
305 //_____________________________________________
306 void                   AliFemtoModelAllHiddenInfo::SetPDGPidChild2(Int_t aPidChild2)
307 {
308   fPDGPidMother = aPidChild2;
309 }
310 //
311 //  RETURN COPY
312 //
313 //_____________________________________________
314  AliFemtoModelHiddenInfo* AliFemtoModelAllHiddenInfo::GetParticleHiddenInfo() const
315 {
316   // return copy of this hidden info
317   AliFemtoModelAllHiddenInfo* tBuf = new AliFemtoModelAllHiddenInfo(*this);
318   return tBuf;
319 }