]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FEMTOSCOPY/AliFemto/AliFemtoPair.h
Lines getting the matched track moved to a method in AliCalorimeterUtils. Lines copie...
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemto / AliFemtoPair.h
1 ///////////////////////////////////////////////////////////////////////////
2 //                                                                       //
3 // AliFemtoPair: the Pair object is passed to the PairCuts for           //
4 // verification, and then to the AddRealPair and AddMixedPair methods of //
5 // the Correlation Functions. It holds pair-specific variables like      //
6 // relative momenta and has links to the particles and tracks that form  //
7 // the pair.                                                             //
8 //                                                                       //
9 ///////////////////////////////////////////////////////////////////////////
10 #ifndef ALIFEMTOPAIR_H
11 #define ALIFEMTOPAIR_H
12
13 #include <utility>
14
15 #include "AliFemtoParticle.h"
16 #include "AliFemtoTypes.h"
17
18 class AliFemtoPair {
19 public:
20   AliFemtoPair();
21   AliFemtoPair(const AliFemtoPair& aPair);
22   AliFemtoPair(AliFemtoParticle*, AliFemtoParticle*);
23   ~AliFemtoPair();
24   AliFemtoPair& operator=(const AliFemtoPair& aPair);
25
26   // track Gets:
27   AliFemtoParticle* Track1() const;
28   AliFemtoParticle* Track2() const;
29   // track Sets:
30   void SetTrack1(const AliFemtoParticle* trkPtr);
31   void SetTrack2(const AliFemtoParticle* trkPtr);
32
33   AliFemtoLorentzVector FourMomentumDiff() const;
34   AliFemtoLorentzVector FourMomentumSum() const;
35   double QInv() const;
36   double KT()   const;
37   double MInv() const;
38   // pair rapidity
39   double Rap() const;
40   double EmissionAngle() const;
41
42   // Bertsch-Pratt momentum components in Pair Frame - written by Bekele/Humanic
43   double QSidePf() const;
44   double QOutPf() const;
45   double QLongPf() const;
46    
47   // Bertsch-Pratt momentum components in Local CMS (longitudinally comoving) frame
48   // - written by Bekele/Humanic
49   double QSideCMS() const;
50   double QOutCMS() const;
51   double QLongCMS() const;
52
53   double KSide() const;
54   double KOut() const;
55   double KLong() const;
56
57   // Bertsch-Pratt momentum components in a longitudinally boosted frame
58   // the argument is the beta of the longitudinal boost (default is 0.0, meaning lab frame)
59   // - written by Bekele/Humanic
60   double QSideBf(double beta=0.0) const;
61   double QOutBf(double beta=0.0) const;
62   double QLongBf(double beta=0.0) const;
63
64   // Yano-Koonin-Podgoretskii Parametrisation 
65   // source rest frame (usually lab frame)
66   void QYKPCMS(double& qP, double& qT, double& q0) const ;
67   // longitudinal comoving frame
68   void QYKPLCMS(double& qP, double& qT, double& q0) const ;
69   // pair rest frame
70   void QYKPPF(double& qP, double& qT, double& q0) const ;
71
72
73   double Quality() const;
74
75   // the following two methods calculate the "nominal" separation of the tracks 
76   // at the inner field cage (EntranceSeparation) and when they exit the TPC,
77   // which may be at the outer field cage, or at the endcaps.
78   // "nominal" means that the tracks are assumed to start at (0,0,0).  Making this
79   // assumption is important for the Event Mixing-- it is not a mistake. - MALisa
80   double NominalTpcExitSeparation() const;
81   double NominalTpcEntranceSeparation() const;
82   //  double NominalTpcAverageSeparation() const;
83   // adapted calculation of Entrance/Exit/Average Tpc separation to V0 daughters
84 /*   double TpcExitSeparationTrackV0Pos() const; */
85 /*   double TpcEntranceSeparationTrackV0Pos() const; */
86 /*   double TpcAverageSeparationTrackV0Pos() const;  */
87
88 /*   double TpcExitSeparationTrackV0Neg() const; */
89 /*   double TpcEntranceSeparationTrackV0Neg() const; */
90 /*   double TpcAverageSeparationTrackV0Neg() const;  */
91
92 /*   double TpcExitSeparationV0PosV0Pos() const; */
93 /*   double TpcEntranceSeparationV0PosV0Pos() const; */
94 /*   double TpcAverageSeparationV0PosV0Pos() const;  */
95
96 /*   double TpcExitSeparationV0PosV0Neg() const; */
97 /*   double TpcEntranceSeparationV0PosV0Neg() const; */
98 /*   double TpcAverageSeparationV0PosV0Neg() const;  */
99  
100 /*   double TpcExitSeparationV0NegV0Pos() const; */
101 /*   double TpcEntranceSeparationV0NegV0Pos() const; */
102 /*   double TpcAverageSeparationV0NegV0Pos() const;  */
103   
104 /*   double TpcExitSeparationV0NegV0Neg() const; */
105 /*   double TpcEntranceSeparationV0NegV0Neg() const; */
106 /*   double TpcAverageSeparationV0NegV0Neg() const;  */
107
108   double PInv() const;
109   double KStar() const;
110   double KStarFlipped() const;
111   double CVK() const;
112   double CVKFlipped() const;
113   double QInvFlippedXY() const;
114
115   double OpeningAngle() const;
116
117   // Fabrice Private <<<
118   double KStarSide() const;
119   double KStarOut() const;
120   double KStarLong() const;
121
122   float PionPairProbability() const;
123   float ElectronPairProbability() const;
124   float KaonPairProbability() const;
125   float ProtonPairProbability() const;
126   float KaonPionPairProbability() const;
127
128   double DcaInsideTpc() const;
129   double Quality2() const;
130
131  /* double KStarGlobal() const;
132   double CVKGlobal() const;
133   double KStarSideGlobal() const;
134   double KStarOutGlobal() const;
135   double KStarLongGlobal() const;*/
136
137   void SetMergingPar(double aMaxDuInner, double aMaxDzInner,
138                      double aMaxDuOuter, double aMaxDzOuter);
139   void SetDefaultHalfFieldMergingPar();
140   void SetDefaultFullFieldMergingPar();
141   double GetFracOfMergedRow() const;
142   double GetClosestRowAtDCA() const;
143   double GetWeightedAvSep() const;
144   // >>>
145 /*   double GetFracOfMergedRowTrkV0Pos() const; */
146 /*   double GetClosestRowAtDCATrkV0Pos() const; */
147
148 /*   double GetFracOfMergedRowTrkV0Neg() const; */
149 /*   double GetClosestRowAtDCATrkV0Neg() const; */
150
151 /*   double GetFracOfMergedRowV0PosV0Neg() const; */
152 /*   double GetFracOfMergedRowV0NegV0Pos() const; */
153 /*   double GetFracOfMergedRowV0PosV0Pos() const; */
154 /*   double GetFracOfMergedRowV0NegV0Neg() const; */
155
156 //Setting and getting emission angle wrt EP
157   double        GetPairAngleEP() const;
158   void          SetPairAngleEP(double x) {fPairAngleEP = x;}
159
160 private:
161   AliFemtoParticle* fTrack1; // Link to the first track in the pair
162   AliFemtoParticle* fTrack2; // Link to the second track in the pair
163
164   double fPairAngleEP;  //Pair emission angle wrt EP
165
166   mutable short fNonIdParNotCalculated; // Set to 1 when NonId variables (kstar) have been already calculated for this pair
167   mutable double fDKSide; // momemntum of first particle in PRF - k* side component
168   mutable double fDKOut;  // momemntum of first particle in PRF - k* out component
169   mutable double fDKLong; // momemntum of first particle in PRF - k* long component
170   mutable double fCVK;    // cos between velocity and relative momentum k*
171   mutable double fKStarCalc; // momemntum of first particle in PRF - k* 
172   void CalcNonIdPar() const;
173
174   mutable short fNonIdParNotCalculatedGlobal; // If global k* was calculated
175  /* mutable double fDKSideGlobal;
176   mutable double fDKOutGlobal;
177   mutable double fDKLongGlobal;
178   mutable double kStarCalcGlobal;
179   mutable double fCVKGlobal;*/
180   //void calcNonIdParGlobal() const;
181
182   mutable short fMergingParNotCalculated; // If merging parameters were calculated
183   mutable double fWeightedAvSep;          // Weighted average separation
184   mutable double fFracOfMergedRow;        // Fraction of merged rows
185   mutable double fClosestRowAtDCA;        // Row at wchich DCA occurs
186
187   mutable short fMergingParNotCalculatedTrkV0Pos; // merging parameters for track - V0 pos       
188   mutable double fFracOfMergedRowTrkV0Pos;        // fraction of merged rows for track - V0 pos 
189   mutable double fClosestRowAtDCATrkV0Pos;        // Row at which DCA occurs for track - V0 pos 
190
191   mutable short fMergingParNotCalculatedTrkV0Neg; // merging parameters for track - V0 neg       
192   mutable double fFracOfMergedRowTrkV0Neg;        // fraction of merged rows for track - V0 neg 
193   mutable double fClosestRowAtDCATrkV0Neg;        // Row at which DCA occurs for track - V0 neg 
194
195   mutable short fMergingParNotCalculatedV0PosV0Neg; // merging parameters for V0 pos - V0 neg    
196   mutable double fFracOfMergedRowV0PosV0Neg;        // fraction of merged rows for V0 pos - V0 neg 
197   mutable double fClosestRowAtDCAV0PosV0Neg;        // Row at which DCA occurs for V0 pos - V0 neg 
198
199   mutable short fMergingParNotCalculatedV0NegV0Pos; // merging parameters for V0 neg - V0 pos    
200   mutable double fFracOfMergedRowV0NegV0Pos;        // fraction of merged rows for V0 neg - V0 pos 
201   mutable double fClosestRowAtDCAV0NegV0Pos;        // Row at which DCA occurs for V0 neg - V0 pos 
202
203   mutable short fMergingParNotCalculatedV0PosV0Pos; // merging parameters for V0 pos - V0 pos    
204   mutable double fFracOfMergedRowV0PosV0Pos;        // fraction of merged rows for V0 pos - V0 pos 
205   mutable double fClosestRowAtDCAV0PosV0Pos;        // Row at which DCA occurs for V0 pos - V0 pos 
206
207   mutable short fMergingParNotCalculatedV0NegV0Neg; // merging parameters for V0 neg - V0 neg    
208   mutable double fFracOfMergedRowV0NegV0Neg;        // fraction of merged rows for V0 neg - V0 neg 
209   mutable double fClosestRowAtDCAV0NegV0Neg;        // Row at which DCA occurs for V0 neg - V0 neg 
210
211   static double fgMaxDuInner; // Minimum cluster separation in x in inner TPC padrow
212   static double fgMaxDzInner; // Minimum cluster separation in z in inner TPC padrow
213   static double fgMaxDuOuter; // Minimum cluster separation in x in outer TPC padrow
214   static double fgMaxDzOuter; // Minimum cluster separation in z in outer TPC padrow
215   void CalcMergingPar() const;
216
217   void CalcMergingParFctn(short* tmpMergingParNotCalculatedFctn,
218                           float* tmpZ1,float* tmpU1,
219                           float* tmpZ2,float* tmpU2,
220                           int *tmpSect1,int *tmpSect2,
221                           double* tmpFracOfMergedRow,
222                           double* tmpClosestRowAtDCA
223                           ) const;
224
225   void ResetParCalculated();
226 };
227
228 inline void AliFemtoPair::ResetParCalculated(){
229   fNonIdParNotCalculated=1;
230   fNonIdParNotCalculatedGlobal=1;
231   fMergingParNotCalculated=1;
232   fMergingParNotCalculatedTrkV0Pos=1;
233   fMergingParNotCalculatedTrkV0Neg=1;
234   fMergingParNotCalculatedV0PosV0Pos=1;
235   fMergingParNotCalculatedV0NegV0Pos=1;
236   fMergingParNotCalculatedV0PosV0Neg=1;
237   fMergingParNotCalculatedV0NegV0Neg=1;
238 }
239
240 inline void AliFemtoPair::SetTrack1(const AliFemtoParticle* trkPtr){
241   fTrack1=(AliFemtoParticle*)trkPtr;
242   ResetParCalculated();
243 }
244 inline void AliFemtoPair::SetTrack2(const AliFemtoParticle* trkPtr){
245   fTrack2=(AliFemtoParticle*)trkPtr;
246   ResetParCalculated();
247 }
248
249 inline AliFemtoParticle* AliFemtoPair::Track1() const {return fTrack1;}
250 inline AliFemtoParticle* AliFemtoPair::Track2() const {return fTrack2;}
251
252 inline double AliFemtoPair::KSide() const{
253   if(fNonIdParNotCalculated) CalcNonIdPar();
254   return fDKSide;
255 }
256 inline double AliFemtoPair::KOut() const{
257   if(fNonIdParNotCalculated) CalcNonIdPar();
258   return fDKOut;
259 }
260 inline double AliFemtoPair::KLong() const{
261   if(fNonIdParNotCalculated) CalcNonIdPar();
262   return fDKLong;
263 }
264 inline double AliFemtoPair::KStar() const{
265   if(fNonIdParNotCalculated) CalcNonIdPar();
266   return fKStarCalc;
267 }
268 inline double AliFemtoPair::QInv() const {
269   AliFemtoLorentzVector tDiff = (fTrack1->FourMomentum()-fTrack2->FourMomentum());
270   return ( -1.* tDiff.m());
271 }
272
273 // Fabrice private <<<
274 inline double AliFemtoPair::KStarSide() const{
275   if(fNonIdParNotCalculated) CalcNonIdPar();
276   return fDKSide;//mKStarSide;
277 }
278 inline double AliFemtoPair::KStarOut() const{
279   if(fNonIdParNotCalculated) CalcNonIdPar();
280   return fDKOut;//mKStarOut;
281 }
282 inline double AliFemtoPair::KStarLong() const{
283   if(fNonIdParNotCalculated) CalcNonIdPar();
284   return fDKLong;//mKStarLong;
285 }
286 inline double AliFemtoPair::CVK() const{
287   if(fNonIdParNotCalculated) CalcNonIdPar();
288   return fCVK;
289 }
290
291 inline float AliFemtoPair::PionPairProbability() const{
292   return (fTrack1->Track()->PidProbPion()) * 
293          (fTrack2->Track()->PidProbPion());
294 }
295 inline float AliFemtoPair::ElectronPairProbability() const{
296   return (fTrack1->Track()->PidProbElectron()) * 
297          (fTrack2->Track()->PidProbElectron());
298 }
299 inline float AliFemtoPair::KaonPairProbability() const{
300   return (fTrack1->Track()->PidProbKaon()) * 
301          (fTrack2->Track()->PidProbKaon());
302 }
303 inline float AliFemtoPair::ProtonPairProbability() const{
304   return (fTrack1->Track()->PidProbProton()) * 
305          (fTrack2->Track()->PidProbProton());
306 }
307 inline float AliFemtoPair::KaonPionPairProbability() const{
308   return (fTrack1->Track()->PidProbKaon()) * 
309          (fTrack2->Track()->PidProbPion());
310 }
311
312 inline double AliFemtoPair::GetFracOfMergedRow() const{
313   if(fMergingParNotCalculated) CalcMergingPar();
314   return fFracOfMergedRow;
315 }
316 inline double AliFemtoPair::GetClosestRowAtDCA() const { 
317   if(fMergingParNotCalculated) CalcMergingPar();
318   return fClosestRowAtDCA;
319 }
320 inline double AliFemtoPair::GetWeightedAvSep() const {
321   if(fMergingParNotCalculated) CalcMergingPar();
322   return fWeightedAvSep;
323 }
324
325
326 /* inline double AliFemtoPair::GetFracOfMergedRowTrkV0Pos() const{ */
327 /*   if(fMergingParNotCalculatedTrkV0Pos) */
328 /*     CalcMergingParFctn(&fMergingParNotCalculatedTrkV0Pos, */
329 /*                     &(fTrack1->fZ[0]),&(fTrack1->fU[0]), */
330 /*                     &(fTrack2->fZ[0]),&(fTrack2->fU[0]), */
331 /*                     &(fTrack1->fSect[0]),&(fTrack2->fSect[0]), */
332 /*                     &(fFracOfMergedRowTrkV0Pos),&(fClosestRowAtDCATrkV0Pos) */
333 /*                     ); */
334 /*   return fFracOfMergedRowTrkV0Pos; */
335 /* } */
336 /* inline double AliFemtoPair::GetClosestRowAtDCATrkV0Pos() const{ */
337 /*   if(fMergingParNotCalculatedTrkV0Pos) */
338 /*     CalcMergingParFctn(&fMergingParNotCalculatedTrkV0Pos, */
339 /*                     &(fTrack1->fZ[0]),&(fTrack1->fU[0]), */
340 /*                     &(fTrack2->fZ[0]),&(fTrack2->fU[0]), */
341 /*                     &(fTrack1->fSect[0]),&(fTrack2->fSect[0]), */
342 /*                     &fFracOfMergedRowTrkV0Pos,&fClosestRowAtDCATrkV0Pos */
343 /*                     ); */
344 /*   return fClosestRowAtDCATrkV0Pos; */
345 /* } */
346 /* inline double AliFemtoPair::GetFracOfMergedRowTrkV0Neg() const{ */
347 /*   if(fMergingParNotCalculatedTrkV0Neg) */
348 /*     CalcMergingParFctn(&fMergingParNotCalculatedTrkV0Neg, */
349 /*                     &(fTrack1->fZ[0]),&(fTrack1->fU[0]), */
350 /*                     &(fTrack2->fV0NegZ[0]),&(fTrack2->fV0NegU[0]), */
351 /*                     &(fTrack1->fSect[0]),&(fTrack2->fV0NegSect[0]), */
352 /*                     &(fFracOfMergedRowTrkV0Neg),&(fClosestRowAtDCATrkV0Neg) */
353 /*                     ); */
354 /*   return fFracOfMergedRowTrkV0Neg; */
355 /* } */
356 /* inline double AliFemtoPair::GetClosestRowAtDCATrkV0Neg() const{ */
357 /*   if(fMergingParNotCalculatedTrkV0Neg) */
358 /*     CalcMergingParFctn(&fMergingParNotCalculatedTrkV0Neg, */
359 /*                     &(fTrack1->fZ[0]),&(fTrack1->fU[0]), */
360 /*                     &(fTrack2->fV0NegZ[0]),&(fTrack2->fV0NegU[0]), */
361 /*                     &(fTrack1->fSect[0]),&(fTrack2->fV0NegSect[0]), */
362 /*                     &fFracOfMergedRowTrkV0Neg,&fClosestRowAtDCATrkV0Neg */
363 /*                     ); */
364 /*   return fClosestRowAtDCATrkV0Neg; */
365 /* } */
366 /* inline double AliFemtoPair::GetFracOfMergedRowV0PosV0Neg() const{ */
367 /*   if(fMergingParNotCalculatedV0PosV0Neg) */
368 /*     CalcMergingParFctn(&fMergingParNotCalculatedV0PosV0Neg, */
369 /*                     &(fTrack1->fZ[0]),&(fTrack1->fU[0]), */
370 /*                     &(fTrack2->fV0NegZ[0]),&(fTrack2->fV0NegU[0]), */
371 /*                     &(fTrack1->fSect[0]),&(fTrack2->fV0NegSect[0]), */
372 /*                     &(fFracOfMergedRowV0PosV0Neg), */
373 /*                     &(fClosestRowAtDCAV0PosV0Neg) */
374 /*                     ); */
375 /*   return fFracOfMergedRowV0PosV0Neg; */
376 /* } */
377 /* inline double AliFemtoPair::GetFracOfMergedRowV0NegV0Pos() const{ */
378 /*   if(fMergingParNotCalculatedV0NegV0Pos) */
379 /*     CalcMergingParFctn(&fMergingParNotCalculatedV0NegV0Pos, */
380 /*                     &(fTrack1->fV0NegZ[0]),&(fTrack1->fV0NegU[0]), */
381 /*                     &(fTrack2->fZ[0]),&(fTrack2->fU[0]), */
382 /*                     &(fTrack1->fV0NegSect[0]), */
383 /*                     &(fTrack2->fSect[0]), */
384 /*                     &(fFracOfMergedRowV0NegV0Pos), */
385 /*                     &(fClosestRowAtDCAV0NegV0Pos) */
386 /*                     ); */
387 /*   return fFracOfMergedRowV0NegV0Pos; */
388 /* } */
389 /* inline double AliFemtoPair::GetFracOfMergedRowV0PosV0Pos() const{ */
390 /*   if(fMergingParNotCalculatedV0PosV0Pos) */
391 /*     CalcMergingParFctn(&fMergingParNotCalculatedV0PosV0Pos, */
392 /*                     &(fTrack1->fZ[0]),&(fTrack1->fU[0]), */
393 /*                     &(fTrack2->fZ[0]),&(fTrack2->fU[0]), */
394 /*                     &(fTrack1->fSect[0]), */
395 /*                     &(fTrack2->fSect[0]), */
396 /*                     &(fFracOfMergedRowV0PosV0Pos), */
397 /*                     &(fClosestRowAtDCAV0PosV0Pos) */
398 /*                     ); */
399 /*   return fFracOfMergedRowV0PosV0Pos; */
400 /* } */
401 /* inline double AliFemtoPair::GetFracOfMergedRowV0NegV0Neg() const{ */
402 /*   if(fMergingParNotCalculatedV0NegV0Neg) */
403 /*     CalcMergingParFctn(&fMergingParNotCalculatedV0NegV0Neg, */
404 /*                     &(fTrack1->fV0NegZ[0]),&(fTrack1->fV0NegU[0]), */
405 /*                     &(fTrack2->fV0NegZ[0]),&(fTrack2->fV0NegU[0]), */
406 /*                     &(fTrack1->fV0NegSect[0]), */
407 /*                     &(fTrack2->fV0NegSect[0]), */
408 /*                     &(fFracOfMergedRowV0NegV0Neg), */
409 /*                     &(fClosestRowAtDCAV0NegV0Neg) */
410 /*                     ); */
411 /*   return fFracOfMergedRowV0NegV0Neg; */
412 /* } */
413
414 #endif