1 ///////////////////////////////////////////////////////////////////////////
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 //
9 ///////////////////////////////////////////////////////////////////////////
10 #ifndef ALIFEMTOPAIR_H
11 #define ALIFEMTOPAIR_H
15 #include "AliFemtoParticle.h"
16 #include "AliFemtoTypes.h"
21 AliFemtoPair(const AliFemtoPair& aPair);
22 AliFemtoPair(AliFemtoParticle*, AliFemtoParticle*);
24 AliFemtoPair& operator=(const AliFemtoPair& aPair);
27 AliFemtoParticle* Track1() const;
28 AliFemtoParticle* Track2() const;
30 void SetTrack1(const AliFemtoParticle* trkPtr);
31 void SetTrack2(const AliFemtoParticle* trkPtr);
33 AliFemtoLorentzVector FourMomentumDiff() const;
34 AliFemtoLorentzVector FourMomentumSum() const;
40 double EmissionAngle() const;
42 // Bertsch-Pratt momentum components in Pair Frame - written by Bekele/Humanic
43 double QSidePf() const;
44 double QOutPf() const;
45 double QLongPf() const;
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;
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;
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 ;
70 void QYKPPF(double& qP, double& qT, double& q0) const ;
73 double Quality() const;
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;
88 double TpcExitSeparationTrackV0Neg() const;
89 double TpcEntranceSeparationTrackV0Neg() const;
90 double TpcAverageSeparationTrackV0Neg() const;
92 double TpcExitSeparationV0PosV0Pos() const;
93 double TpcEntranceSeparationV0PosV0Pos() const;
94 double TpcAverageSeparationV0PosV0Pos() const;
96 double TpcExitSeparationV0PosV0Neg() const;
97 double TpcEntranceSeparationV0PosV0Neg() const;
98 double TpcAverageSeparationV0PosV0Neg() const;
100 double TpcExitSeparationV0NegV0Pos() const;
101 double TpcEntranceSeparationV0NegV0Pos() const;
102 double TpcAverageSeparationV0NegV0Pos() const;
104 double TpcExitSeparationV0NegV0Neg() const;
105 double TpcEntranceSeparationV0NegV0Neg() const;
106 double TpcAverageSeparationV0NegV0Neg() const;
109 double KStar() const;
110 double KStarFlipped() const;
112 double CVKFlipped() const;
113 double QInvFlippedXY() const;
115 double OpeningAngle() const;
117 // Fabrice Private <<<
118 double KStarSide() const;
119 double KStarOut() const;
120 double KStarLong() const;
122 float PionPairProbability() const;
123 float ElectronPairProbability() const;
124 float KaonPairProbability() const;
125 float ProtonPairProbability() const;
126 float KaonPionPairProbability() const;
128 double DcaInsideTpc() const;
129 double Quality2() const;
131 /* double KStarGlobal() const;
132 double CVKGlobal() const;
133 double KStarSideGlobal() const;
134 double KStarOutGlobal() const;
135 double KStarLongGlobal() const;*/
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;
145 double GetFracOfMergedRowTrkV0Pos() const;
146 double GetClosestRowAtDCATrkV0Pos() const;
148 double GetFracOfMergedRowTrkV0Neg() const;
149 double GetClosestRowAtDCATrkV0Neg() const;
151 double GetFracOfMergedRowV0PosV0Neg() const;
152 double GetFracOfMergedRowV0NegV0Pos() const;
153 double GetFracOfMergedRowV0PosV0Pos() const;
154 double GetFracOfMergedRowV0NegV0Neg() const;
157 AliFemtoParticle* fTrack1; // Link to the first track in the pair
158 AliFemtoParticle* fTrack2; // Link to the second track in the pair
160 mutable short fNonIdParNotCalculated; // Set to 1 when NonId variables (kstar) have been already calculated for this pair
161 mutable double fDKSide; // momemntum of first particle in PRF - k* side component
162 mutable double fDKOut; // momemntum of first particle in PRF - k* out component
163 mutable double fDKLong; // momemntum of first particle in PRF - k* long component
164 mutable double fCVK; // cos between velocity and relative momentum k*
165 mutable double fKStarCalc; // momemntum of first particle in PRF - k*
166 void CalcNonIdPar() const;
168 mutable short fNonIdParNotCalculatedGlobal; // If global k* was calculated
169 /* mutable double fDKSideGlobal;
170 mutable double fDKOutGlobal;
171 mutable double fDKLongGlobal;
172 mutable double kStarCalcGlobal;
173 mutable double fCVKGlobal;*/
174 //void calcNonIdParGlobal() const;
176 mutable short fMergingParNotCalculated; // If merging parameters were calculated
177 mutable double fWeightedAvSep; // Weighted average separation
178 mutable double fFracOfMergedRow; // Fraction of merged rows
179 mutable double fClosestRowAtDCA; // Row at wchich DCA occurs
181 mutable short fMergingParNotCalculatedTrkV0Pos; // merging parameters for track - V0 pos
182 mutable double fFracOfMergedRowTrkV0Pos; // fraction of merged rows for track - V0 pos
183 mutable double fClosestRowAtDCATrkV0Pos; // Row at which DCA occurs for track - V0 pos
185 mutable short fMergingParNotCalculatedTrkV0Neg; // merging parameters for track - V0 neg
186 mutable double fFracOfMergedRowTrkV0Neg; // fraction of merged rows for track - V0 neg
187 mutable double fClosestRowAtDCATrkV0Neg; // Row at which DCA occurs for track - V0 neg
189 mutable short fMergingParNotCalculatedV0PosV0Neg; // merging parameters for V0 pos - V0 neg
190 mutable double fFracOfMergedRowV0PosV0Neg; // fraction of merged rows for V0 pos - V0 neg
191 mutable double fClosestRowAtDCAV0PosV0Neg; // Row at which DCA occurs for V0 pos - V0 neg
193 mutable short fMergingParNotCalculatedV0NegV0Pos; // merging parameters for V0 neg - V0 pos
194 mutable double fFracOfMergedRowV0NegV0Pos; // fraction of merged rows for V0 neg - V0 pos
195 mutable double fClosestRowAtDCAV0NegV0Pos; // Row at which DCA occurs for V0 neg - V0 pos
197 mutable short fMergingParNotCalculatedV0PosV0Pos; // merging parameters for V0 pos - V0 pos
198 mutable double fFracOfMergedRowV0PosV0Pos; // fraction of merged rows for V0 pos - V0 pos
199 mutable double fClosestRowAtDCAV0PosV0Pos; // Row at which DCA occurs for V0 pos - V0 pos
201 mutable short fMergingParNotCalculatedV0NegV0Neg; // merging parameters for V0 neg - V0 neg
202 mutable double fFracOfMergedRowV0NegV0Neg; // fraction of merged rows for V0 neg - V0 neg
203 mutable double fClosestRowAtDCAV0NegV0Neg; // Row at which DCA occurs for V0 neg - V0 neg
205 static double fgMaxDuInner; // Minimum cluster separation in x in inner TPC padrow
206 static double fgMaxDzInner; // Minimum cluster separation in z in inner TPC padrow
207 static double fgMaxDuOuter; // Minimum cluster separation in x in outer TPC padrow
208 static double fgMaxDzOuter; // Minimum cluster separation in z in outer TPC padrow
209 void CalcMergingPar() const;
211 void CalcMergingParFctn(short* tmpMergingParNotCalculatedFctn,
212 float* tmpZ1,float* tmpU1,
213 float* tmpZ2,float* tmpU2,
214 int *tmpSect1,int *tmpSect2,
215 double* tmpFracOfMergedRow,
216 double* tmpClosestRowAtDCA
219 void ResetParCalculated();
222 inline void AliFemtoPair::ResetParCalculated(){
223 fNonIdParNotCalculated=1;
224 fNonIdParNotCalculatedGlobal=1;
225 fMergingParNotCalculated=1;
226 fMergingParNotCalculatedTrkV0Pos=1;
227 fMergingParNotCalculatedTrkV0Neg=1;
228 fMergingParNotCalculatedV0PosV0Pos=1;
229 fMergingParNotCalculatedV0NegV0Pos=1;
230 fMergingParNotCalculatedV0PosV0Neg=1;
231 fMergingParNotCalculatedV0NegV0Neg=1;
234 inline void AliFemtoPair::SetTrack1(const AliFemtoParticle* trkPtr){
235 fTrack1=(AliFemtoParticle*)trkPtr;
236 ResetParCalculated();
238 inline void AliFemtoPair::SetTrack2(const AliFemtoParticle* trkPtr){
239 fTrack2=(AliFemtoParticle*)trkPtr;
240 ResetParCalculated();
243 inline AliFemtoParticle* AliFemtoPair::Track1() const {return fTrack1;}
244 inline AliFemtoParticle* AliFemtoPair::Track2() const {return fTrack2;}
246 inline double AliFemtoPair::KSide() const{
247 if(fNonIdParNotCalculated) CalcNonIdPar();
250 inline double AliFemtoPair::KOut() const{
251 if(fNonIdParNotCalculated) CalcNonIdPar();
254 inline double AliFemtoPair::KLong() const{
255 if(fNonIdParNotCalculated) CalcNonIdPar();
258 inline double AliFemtoPair::KStar() const{
259 if(fNonIdParNotCalculated) CalcNonIdPar();
262 inline double AliFemtoPair::QInv() const {
263 AliFemtoLorentzVector tDiff = (fTrack1->FourMomentum()-fTrack2->FourMomentum());
264 return ( -1.* tDiff.m());
267 // Fabrice private <<<
268 inline double AliFemtoPair::KStarSide() const{
269 if(fNonIdParNotCalculated) CalcNonIdPar();
270 return fDKSide;//mKStarSide;
272 inline double AliFemtoPair::KStarOut() const{
273 if(fNonIdParNotCalculated) CalcNonIdPar();
274 return fDKOut;//mKStarOut;
276 inline double AliFemtoPair::KStarLong() const{
277 if(fNonIdParNotCalculated) CalcNonIdPar();
278 return fDKLong;//mKStarLong;
280 inline double AliFemtoPair::CVK() const{
281 if(fNonIdParNotCalculated) CalcNonIdPar();
285 inline float AliFemtoPair::PionPairProbability() const{
286 return (fTrack1->Track()->PidProbPion()) *
287 (fTrack2->Track()->PidProbPion());
289 inline float AliFemtoPair::ElectronPairProbability() const{
290 return (fTrack1->Track()->PidProbElectron()) *
291 (fTrack2->Track()->PidProbElectron());
293 inline float AliFemtoPair::KaonPairProbability() const{
294 return (fTrack1->Track()->PidProbKaon()) *
295 (fTrack2->Track()->PidProbKaon());
297 inline float AliFemtoPair::ProtonPairProbability() const{
298 return (fTrack1->Track()->PidProbProton()) *
299 (fTrack2->Track()->PidProbProton());
301 inline float AliFemtoPair::KaonPionPairProbability() const{
302 return (fTrack1->Track()->PidProbKaon()) *
303 (fTrack2->Track()->PidProbPion());
306 inline double AliFemtoPair::GetFracOfMergedRow() const{
307 if(fMergingParNotCalculated) CalcMergingPar();
308 return fFracOfMergedRow;
310 inline double AliFemtoPair::GetClosestRowAtDCA() const {
311 if(fMergingParNotCalculated) CalcMergingPar();
312 return fClosestRowAtDCA;
314 inline double AliFemtoPair::GetWeightedAvSep() const {
315 if(fMergingParNotCalculated) CalcMergingPar();
316 return fWeightedAvSep;
320 inline double AliFemtoPair::GetFracOfMergedRowTrkV0Pos() const{
321 if(fMergingParNotCalculatedTrkV0Pos)
322 CalcMergingParFctn(&fMergingParNotCalculatedTrkV0Pos,
323 &(fTrack1->fZ[0]),&(fTrack1->fU[0]),
324 &(fTrack2->fZ[0]),&(fTrack2->fU[0]),
325 &(fTrack1->fSect[0]),&(fTrack2->fSect[0]),
326 &(fFracOfMergedRowTrkV0Pos),&(fClosestRowAtDCATrkV0Pos)
328 return fFracOfMergedRowTrkV0Pos;
330 inline double AliFemtoPair::GetClosestRowAtDCATrkV0Pos() const{
331 if(fMergingParNotCalculatedTrkV0Pos)
332 CalcMergingParFctn(&fMergingParNotCalculatedTrkV0Pos,
333 &(fTrack1->fZ[0]),&(fTrack1->fU[0]),
334 &(fTrack2->fZ[0]),&(fTrack2->fU[0]),
335 &(fTrack1->fSect[0]),&(fTrack2->fSect[0]),
336 &fFracOfMergedRowTrkV0Pos,&fClosestRowAtDCATrkV0Pos
338 return fClosestRowAtDCATrkV0Pos;
340 inline double AliFemtoPair::GetFracOfMergedRowTrkV0Neg() const{
341 if(fMergingParNotCalculatedTrkV0Neg)
342 CalcMergingParFctn(&fMergingParNotCalculatedTrkV0Neg,
343 &(fTrack1->fZ[0]),&(fTrack1->fU[0]),
344 &(fTrack2->fV0NegZ[0]),&(fTrack2->fV0NegU[0]),
345 &(fTrack1->fSect[0]),&(fTrack2->fV0NegSect[0]),
346 &(fFracOfMergedRowTrkV0Neg),&(fClosestRowAtDCATrkV0Neg)
348 return fFracOfMergedRowTrkV0Neg;
350 inline double AliFemtoPair::GetClosestRowAtDCATrkV0Neg() const{
351 if(fMergingParNotCalculatedTrkV0Neg)
352 CalcMergingParFctn(&fMergingParNotCalculatedTrkV0Neg,
353 &(fTrack1->fZ[0]),&(fTrack1->fU[0]),
354 &(fTrack2->fV0NegZ[0]),&(fTrack2->fV0NegU[0]),
355 &(fTrack1->fSect[0]),&(fTrack2->fV0NegSect[0]),
356 &fFracOfMergedRowTrkV0Neg,&fClosestRowAtDCATrkV0Neg
358 return fClosestRowAtDCATrkV0Neg;
360 inline double AliFemtoPair::GetFracOfMergedRowV0PosV0Neg() const{
361 if(fMergingParNotCalculatedV0PosV0Neg)
362 CalcMergingParFctn(&fMergingParNotCalculatedV0PosV0Neg,
363 &(fTrack1->fZ[0]),&(fTrack1->fU[0]),
364 &(fTrack2->fV0NegZ[0]),&(fTrack2->fV0NegU[0]),
365 &(fTrack1->fSect[0]),&(fTrack2->fV0NegSect[0]),
366 &(fFracOfMergedRowV0PosV0Neg),
367 &(fClosestRowAtDCAV0PosV0Neg)
369 return fFracOfMergedRowV0PosV0Neg;
371 inline double AliFemtoPair::GetFracOfMergedRowV0NegV0Pos() const{
372 if(fMergingParNotCalculatedV0NegV0Pos)
373 CalcMergingParFctn(&fMergingParNotCalculatedV0NegV0Pos,
374 &(fTrack1->fV0NegZ[0]),&(fTrack1->fV0NegU[0]),
375 &(fTrack2->fZ[0]),&(fTrack2->fU[0]),
376 &(fTrack1->fV0NegSect[0]),
377 &(fTrack2->fSect[0]),
378 &(fFracOfMergedRowV0NegV0Pos),
379 &(fClosestRowAtDCAV0NegV0Pos)
381 return fFracOfMergedRowV0NegV0Pos;
383 inline double AliFemtoPair::GetFracOfMergedRowV0PosV0Pos() const{
384 if(fMergingParNotCalculatedV0PosV0Pos)
385 CalcMergingParFctn(&fMergingParNotCalculatedV0PosV0Pos,
386 &(fTrack1->fZ[0]),&(fTrack1->fU[0]),
387 &(fTrack2->fZ[0]),&(fTrack2->fU[0]),
388 &(fTrack1->fSect[0]),
389 &(fTrack2->fSect[0]),
390 &(fFracOfMergedRowV0PosV0Pos),
391 &(fClosestRowAtDCAV0PosV0Pos)
393 return fFracOfMergedRowV0PosV0Pos;
395 inline double AliFemtoPair::GetFracOfMergedRowV0NegV0Neg() const{
396 if(fMergingParNotCalculatedV0NegV0Neg)
397 CalcMergingParFctn(&fMergingParNotCalculatedV0NegV0Neg,
398 &(fTrack1->fV0NegZ[0]),&(fTrack1->fV0NegU[0]),
399 &(fTrack2->fV0NegZ[0]),&(fTrack2->fV0NegU[0]),
400 &(fTrack1->fV0NegSect[0]),
401 &(fTrack2->fV0NegSect[0]),
402 &(fFracOfMergedRowV0NegV0Neg),
403 &(fClosestRowAtDCAV0NegV0Neg)
405 return fFracOfMergedRowV0NegV0Neg;