1 /***************************************************************************
3 * $Id: AliFemtoPair.h,v 1.17
5 * Author: Brian Laziuk, Yale University
6 * slightly modified by Mike Lisa
7 ***************************************************************************
9 * Description: part of STAR HBT Framework: AliFemtoMaker package
10 * the Pair object is passed to the PairCuts for verification, and
11 * then to the AddRealPair and AddMixedPair methods of the
12 * Correlation Functions
14 ***************************************************************************
17 * Revision 1.1.1.1 2007/03/07 10:14:49 mchojnacki
18 * First version on CVS
20 * Revision 1.19 2003/01/14 09:44:00 renault
21 * corrections on average separation calculation for tracks which doesn't cross
24 * Revision 1.18 2002/11/19 23:33:18 renault
25 * Enable average separation calculation for all combinaisons of
26 * V0 daughters and tracks
28 * Revision 1.16 2002/02/28 14:18:36 rcwells
29 * Added emissionAngle function to AliFemtoPair
31 * Revision 1.15 2001/12/14 23:11:30 fretiere
32 * Add class HitMergingCut. Add class fabricesPairCut = HitMerginCut + pair purity cuts. Add TpcLocalTransform function which convert to local tpc coord (not pretty). Modify AliFemtoTrack, AliFemtoParticle, AliFemtoHiddenInfo, AliFemtoPair to handle the hit information and cope with my code
34 * Revision 1.14 2001/04/03 21:04:36 kisiel
37 * Changes needed to make the Theoretical code
38 * work. The main code is the ThCorrFctn directory.
39 * The most visible change is the addition of the
40 * HiddenInfo to AliFemtoPair.
42 * Revision 1.13 2001/03/28 22:35:23 flierl
43 * changes and bugfixes in qYKP*
46 * Revision 1.12 2001/01/22 22:56:40 laue
47 * Yano-Koonin-Podgoretskii Parametrisation added
49 * Revision 1.11 2000/10/26 16:09:16 lisa
50 * Added OpeningAngle PairCut class and method to AliFemtoPair
52 * Revision 1.10 2000/10/05 23:09:05 lisa
53 * Added kT-dependent radii to mixed-event simulator AND implemented AverageSeparation Cut and CorrFctn
55 * Revision 1.9 2000/07/17 20:03:17 lisa
56 * Implemented tools for addressing and assessing trackmerging
58 * Revision 1.8 2000/04/04 16:13:09 lisa
59 * AliFemtoPair:quality() now returns normalized value (and so is double) and add a CorrFctn which looks at quality()
61 * Revision 1.7 2000/04/03 22:09:12 rcwells
62 * Add member function ... quality().
64 * Revision 1.6 2000/02/13 21:13:34 lisa
65 * changed ambiguous AliFemtoPair::fourMomentum() to fourMomentumSum() and fourMomentumDiff() and fixed related bug in QvecCorrFctn
67 * Revision 1.5 2000/01/25 17:35:17 laue
68 * I. In order to run the stand alone version of the AliFemtoMaker the following
69 * changes have been done:
70 * a) all ClassDefs and ClassImps have been put into #ifdef __ROOT__ statements
71 * b) unnecessary includes of StMaker.h have been removed
72 * c) the subdirectory AliFemtoMaker/doc/Make has been created including everything
73 * needed for the stand alone version
75 * II. To reduce the amount of compiler warning
76 * a) some variables have been type casted
77 * b) some destructors have been declared as virtual
79 * Revision 1.4 1999/07/29 16:16:34 lisa
80 * Selemons upgrade of AliFemtoPair class
82 * Revision 1.3 1999/07/22 18:49:10 lisa
83 * Implement idea of Fabrice to not create and delete AliFemtoPair all the time
85 * Revision 1.2 1999/07/06 22:33:22 lisa
86 * Adjusted all to work in pro and new - dev itself is broken
88 * Revision 1.1.1.1 1999/06/29 16:02:57 lisa
89 * Installation of AliFemtoMaker
91 **************************************************************************/
93 #ifndef ST_HBT_PAIR_HH
94 #define ST_HBT_PAIR_HH
98 #include "Infrastructure/AliFemtoParticle.h"
99 #include "Infrastructure/AliFemtoTypes.h"
104 AliFemtoPair(AliFemtoParticle*, AliFemtoParticle*);
108 //AliFemtoPair(const AliFemtoPair&);
109 //AliFemtoPair& operator=(const AliFemtoPair&);
112 AliFemtoParticle* track1() const;
113 AliFemtoParticle* track2() const;
115 void SetTrack1(const AliFemtoParticle* trkPtr);
116 void SetTrack2(const AliFemtoParticle* trkPtr);
118 AliFemtoLorentzVector fourMomentumDiff() const;
119 AliFemtoLorentzVector fourMomentumSum() const;
125 double emissionAngle() const;
127 // Bertsch-Pratt momentum components in Pair Frame - written by Bekele/Humanic
128 double qSidePf() const;
129 double qOutPf() const;
130 double qLongPf() const;
132 // Bertsch-Pratt momentum components in Local CMS (longitudinally comoving) frame
133 // - written by Bekele/Humanic
134 double qSideCMS() const;
135 double qOutCMS() const;
136 double qLongCMS() const;
138 double dKSide() const;
139 double dKOut() const;
140 double dKLong() const;
142 // Bertsch-Pratt momentum components in a longitudinally boosted frame
143 // the argument is the beta of the longitudinal boost (default is 0.0, meaning lab frame)
144 // - written by Bekele/Humanic
145 double qSideBf(double beta=0.0) const;
146 double qOutBf(double beta=0.0) const;
147 double qLongBf(double beta=0.0) const;
149 // Yano-Koonin-Podgoretskii Parametrisation
150 // source rest frame (usually lab frame)
151 void qYKPCMS(double& qP, double& qT, double& q0) const ;
152 // longitudinal comoving frame
153 void qYKPLCMS(double& qP, double& qT, double& q0) const ;
155 void qYKPPF(double& qP, double& qT, double& q0) const ;
158 double quality() const;
160 // the following two methods calculate the "nominal" separation of the tracks
161 // at the inner field cage (EntranceSeparation) and when they exit the TPC,
162 // which may be at the outer field cage, or at the endcaps.
163 // "nominal" means that the tracks are assumed to start at (0,0,0). Making this
164 // assumption is important for the Event Mixing-- it is not a mistake. - MALisa
165 double NominalTpcExitSeparation() const;
166 double NominalTpcEntranceSeparation() const;
167 double NominalTpcAverageSeparation() const;
168 // adapted calculation of Entrance/Exit/Average Tpc separation to V0 daughters
169 double TpcExitSeparationTrackV0Pos() const;
170 double TpcEntranceSeparationTrackV0Pos() const;
171 double TpcAverageSeparationTrackV0Pos() const;
173 double TpcExitSeparationTrackV0Neg() const;
174 double TpcEntranceSeparationTrackV0Neg() const;
175 double TpcAverageSeparationTrackV0Neg() const;
177 double TpcExitSeparationV0PosV0Pos() const;
178 double TpcEntranceSeparationV0PosV0Pos() const;
179 double TpcAverageSeparationV0PosV0Pos() const;
181 double TpcExitSeparationV0PosV0Neg() const;
182 double TpcEntranceSeparationV0PosV0Neg() const;
183 double TpcAverageSeparationV0PosV0Neg() const;
185 double TpcExitSeparationV0NegV0Pos() const;
186 double TpcEntranceSeparationV0NegV0Pos() const;
187 double TpcAverageSeparationV0NegV0Pos() const;
189 double TpcExitSeparationV0NegV0Neg() const;
190 double TpcEntranceSeparationV0NegV0Neg() const;
191 double TpcAverageSeparationV0NegV0Neg() const;
194 double KStar() const;
195 double KStarFlipped() const;
197 double CVKFlipped() const;
198 double qInvFlippedXY() const;
200 double OpeningAngle() const;
202 // Fabrice Private <<<
203 double KStarSide() const;
204 double KStarOut() const;
205 double KStarLong() const;
207 float PionPairProbability() const;
208 float ElectronPairProbability() const;
209 float KaonPairProbability() const;
210 float ProtonPairProbability() const;
211 float KaonPionPairProbability() const;
213 double dcaInsideTpc() const;
214 double quality2() const;
216 /* double KStarGlobal() const;
217 double CVKGlobal() const;
218 double KStarSideGlobal() const;
219 double KStarOutGlobal() const;
220 double KStarLongGlobal() const;*/
222 void setMergingPar(double aMaxDuInner, double aMaxDzInner,
223 double aMaxDuOuter, double aMaxDzOuter);
224 void setDefaultHalfFieldMergingPar();
225 void setDefaultFullFieldMergingPar();
226 double getFracOfMergedRow() const;
227 double getClosestRowAtDCA() const;
228 double getWeightedAvSep() const;
230 double getFracOfMergedRowTrkV0Pos() const;
231 double getClosestRowAtDCATrkV0Pos() const;
233 double getFracOfMergedRowTrkV0Neg() const;
234 double getClosestRowAtDCATrkV0Neg() const;
236 double getFracOfMergedRowV0PosV0Neg() const;
237 double getFracOfMergedRowV0NegV0Pos() const;
238 double getFracOfMergedRowV0PosV0Pos() const;
239 double getFracOfMergedRowV0NegV0Neg() const;
242 AliFemtoParticle* fTrack1;
243 AliFemtoParticle* fTrack2;
245 mutable short fNonIdParNotCalculated;
246 mutable double fDKSide;
247 mutable double fDKOut;
248 mutable double fDKLong;
250 mutable double kStarCalc;
251 void calcNonIdPar() const;
253 mutable short fNonIdParNotCalculatedGlobal;
254 /* mutable double fDKSideGlobal;
255 mutable double fDKOutGlobal;
256 mutable double fDKLongGlobal;
257 mutable double kStarCalcGlobal;
258 mutable double fCVKGlobal;*/
259 //void calcNonIdParGlobal() const;
261 mutable short fMergingParNotCalculated;
262 mutable double fWeightedAvSep;
263 mutable double fFracOfMergedRow;
264 mutable double fClosestRowAtDCA;
266 mutable short fMergingParNotCalculatedTrkV0Pos;
267 mutable double fFracOfMergedRowTrkV0Pos;
268 mutable double fClosestRowAtDCATrkV0Pos;
270 mutable short fMergingParNotCalculatedTrkV0Neg;
271 mutable double fFracOfMergedRowTrkV0Neg;
272 mutable double fClosestRowAtDCATrkV0Neg;
274 mutable short fMergingParNotCalculatedV0PosV0Neg;
275 mutable double fFracOfMergedRowV0PosV0Neg;
276 mutable double fClosestRowAtDCAV0PosV0Neg;
278 mutable short fMergingParNotCalculatedV0NegV0Pos;
279 mutable double fFracOfMergedRowV0NegV0Pos;
280 mutable double fClosestRowAtDCAV0NegV0Pos;
282 mutable short fMergingParNotCalculatedV0PosV0Pos;
283 mutable double fFracOfMergedRowV0PosV0Pos;
284 mutable double fClosestRowAtDCAV0PosV0Pos;
286 mutable short fMergingParNotCalculatedV0NegV0Neg;
287 mutable double fFracOfMergedRowV0NegV0Neg;
288 mutable double fClosestRowAtDCAV0NegV0Neg;
290 static double fMaxDuInner;
291 static double fMaxDzInner;
292 static double fMaxDuOuter;
293 static double fMaxDzOuter;
294 void calcMergingPar() const;
296 void CalcMergingParFctn(short* tmpMergingParNotCalculatedFctn,
297 float* tmpZ1,float* tmpU1,
298 float* tmpZ2,float* tmpU2,
299 int *tmpSect1,int *tmpSect2,
300 double* tmpFracOfMergedRow,
301 double* tmpClosestRowAtDCA
304 void resetParCalculated();
307 inline void AliFemtoPair::resetParCalculated(){
308 fNonIdParNotCalculated=1;
309 fNonIdParNotCalculatedGlobal=1;
310 fMergingParNotCalculated=1;
311 fMergingParNotCalculatedTrkV0Pos=1;
312 fMergingParNotCalculatedTrkV0Neg=1;
313 fMergingParNotCalculatedV0PosV0Pos=1;
314 fMergingParNotCalculatedV0NegV0Pos=1;
315 fMergingParNotCalculatedV0PosV0Neg=1;
316 fMergingParNotCalculatedV0NegV0Neg=1;
319 inline void AliFemtoPair::SetTrack1(const AliFemtoParticle* trkPtr){
320 fTrack1=(AliFemtoParticle*)trkPtr;
321 resetParCalculated();
323 inline void AliFemtoPair::SetTrack2(const AliFemtoParticle* trkPtr){
324 fTrack2=(AliFemtoParticle*)trkPtr;
325 resetParCalculated();
328 inline AliFemtoParticle* AliFemtoPair::track1() const {return fTrack1;}
329 inline AliFemtoParticle* AliFemtoPair::track2() const {return fTrack2;}
331 inline double AliFemtoPair::dKSide() const{
332 if(fNonIdParNotCalculated) calcNonIdPar();
335 inline double AliFemtoPair::dKOut() const{
336 if(fNonIdParNotCalculated) calcNonIdPar();
339 inline double AliFemtoPair::dKLong() const{
340 if(fNonIdParNotCalculated) calcNonIdPar();
343 inline double AliFemtoPair::KStar() const{
344 if(fNonIdParNotCalculated) calcNonIdPar();
347 inline double AliFemtoPair::qInv() const {
348 AliFemtoLorentzVector tDiff = (fTrack1->FourMomentum()-fTrack2->FourMomentum());
349 return ( -1.* tDiff.m());
352 // Fabrice private <<<
353 inline double AliFemtoPair::KStarSide() const{
354 if(fNonIdParNotCalculated) calcNonIdPar();
355 return fDKSide;//mKStarSide;
357 inline double AliFemtoPair::KStarOut() const{
358 if(fNonIdParNotCalculated) calcNonIdPar();
359 return fDKOut;//mKStarOut;
361 inline double AliFemtoPair::KStarLong() const{
362 if(fNonIdParNotCalculated) calcNonIdPar();
363 return fDKLong;//mKStarLong;
365 inline double AliFemtoPair::CVK() const{
366 if(fNonIdParNotCalculated) calcNonIdPar();
370 /*inline double AliFemtoPair::KStarGlobal() const{
371 if(fNonIdParNotCalculatedGlobal) calcNonIdParGlobal();
372 return kStarCalcGlobal;
374 inline double AliFemtoPair::KStarSideGlobal() const{
375 if(fNonIdParNotCalculatedGlobal) calcNonIdParGlobal();
376 return fDKSideGlobal;//mKStarSide;
378 inline double AliFemtoPair::KStarOutGlobal() const{
379 if(fNonIdParNotCalculatedGlobal) calcNonIdParGlobal();
380 return fDKOutGlobal;//mKStarOut;
382 inline double AliFemtoPair::KStarLongGlobal() const{
383 if(fNonIdParNotCalculatedGlobal) calcNonIdParGlobal();
384 return fDKLongGlobal;//mKStarLong;
386 inline double AliFemtoPair::CVKGlobal() const{
387 if(fNonIdParNotCalculatedGlobal) calcNonIdParGlobal();
392 inline float AliFemtoPair::PionPairProbability() const{
393 return (fTrack1->Track()->PidProbPion()) *
394 (fTrack2->Track()->PidProbPion());
396 inline float AliFemtoPair::ElectronPairProbability() const{
397 return (fTrack1->Track()->PidProbElectron()) *
398 (fTrack2->Track()->PidProbElectron());
400 inline float AliFemtoPair::KaonPairProbability() const{
401 return (fTrack1->Track()->PidProbKaon()) *
402 (fTrack2->Track()->PidProbKaon());
404 inline float AliFemtoPair::ProtonPairProbability() const{
405 return (fTrack1->Track()->PidProbProton()) *
406 (fTrack2->Track()->PidProbProton());
408 inline float AliFemtoPair::KaonPionPairProbability() const{
409 return (fTrack1->Track()->PidProbKaon()) *
410 (fTrack2->Track()->PidProbPion());
413 inline double AliFemtoPair::getFracOfMergedRow() const{
414 if(fMergingParNotCalculated) calcMergingPar();
415 return fFracOfMergedRow;
417 inline double AliFemtoPair::getClosestRowAtDCA() const {
418 if(fMergingParNotCalculated) calcMergingPar();
419 return fClosestRowAtDCA;
421 inline double AliFemtoPair::getWeightedAvSep() const {
422 if(fMergingParNotCalculated) calcMergingPar();
423 return fWeightedAvSep;
427 inline double AliFemtoPair::getFracOfMergedRowTrkV0Pos() const{
428 if(fMergingParNotCalculatedTrkV0Pos)
429 CalcMergingParFctn(&fMergingParNotCalculatedTrkV0Pos,
430 &(fTrack1->fZ[0]),&(fTrack1->fU[0]),
431 &(fTrack2->fZ[0]),&(fTrack2->fU[0]),
432 &(fTrack1->fSect[0]),&(fTrack2->fSect[0]),
433 &(fFracOfMergedRowTrkV0Pos),&(fClosestRowAtDCATrkV0Pos)
435 return fFracOfMergedRowTrkV0Pos;
437 inline double AliFemtoPair::getClosestRowAtDCATrkV0Pos() const{
438 if(fMergingParNotCalculatedTrkV0Pos)
439 CalcMergingParFctn(&fMergingParNotCalculatedTrkV0Pos,
440 &(fTrack1->fZ[0]),&(fTrack1->fU[0]),
441 &(fTrack2->fZ[0]),&(fTrack2->fU[0]),
442 &(fTrack1->fSect[0]),&(fTrack2->fSect[0]),
443 &fFracOfMergedRowTrkV0Pos,&fClosestRowAtDCATrkV0Pos
445 return fClosestRowAtDCATrkV0Pos;
447 inline double AliFemtoPair::getFracOfMergedRowTrkV0Neg() const{
448 if(fMergingParNotCalculatedTrkV0Neg)
449 CalcMergingParFctn(&fMergingParNotCalculatedTrkV0Neg,
450 &(fTrack1->fZ[0]),&(fTrack1->fU[0]),
451 &(fTrack2->fV0NegZ[0]),&(fTrack2->fV0NegU[0]),
452 &(fTrack1->fSect[0]),&(fTrack2->fV0NegSect[0]),
453 &(fFracOfMergedRowTrkV0Neg),&(fClosestRowAtDCATrkV0Neg)
455 return fFracOfMergedRowTrkV0Neg;
457 inline double AliFemtoPair::getClosestRowAtDCATrkV0Neg() const{
458 if(fMergingParNotCalculatedTrkV0Neg)
459 CalcMergingParFctn(&fMergingParNotCalculatedTrkV0Neg,
460 &(fTrack1->fZ[0]),&(fTrack1->fU[0]),
461 &(fTrack2->fV0NegZ[0]),&(fTrack2->fV0NegU[0]),
462 &(fTrack1->fSect[0]),&(fTrack2->fV0NegSect[0]),
463 &fFracOfMergedRowTrkV0Neg,&fClosestRowAtDCATrkV0Neg
465 return fClosestRowAtDCATrkV0Neg;
467 inline double AliFemtoPair::getFracOfMergedRowV0PosV0Neg() const{
468 if(fMergingParNotCalculatedV0PosV0Neg)
469 CalcMergingParFctn(&fMergingParNotCalculatedV0PosV0Neg,
470 &(fTrack1->fZ[0]),&(fTrack1->fU[0]),
471 &(fTrack2->fV0NegZ[0]),&(fTrack2->fV0NegU[0]),
472 &(fTrack1->fSect[0]),&(fTrack2->fV0NegSect[0]),
473 &(fFracOfMergedRowV0PosV0Neg),
474 &(fClosestRowAtDCAV0PosV0Neg)
476 return fFracOfMergedRowV0PosV0Neg;
478 inline double AliFemtoPair::getFracOfMergedRowV0NegV0Pos() const{
479 if(fMergingParNotCalculatedV0NegV0Pos)
480 CalcMergingParFctn(&fMergingParNotCalculatedV0NegV0Pos,
481 &(fTrack1->fV0NegZ[0]),&(fTrack1->fV0NegU[0]),
482 &(fTrack2->fZ[0]),&(fTrack2->fU[0]),
483 &(fTrack1->fV0NegSect[0]),
484 &(fTrack2->fSect[0]),
485 &(fFracOfMergedRowV0NegV0Pos),
486 &(fClosestRowAtDCAV0NegV0Pos)
488 return fFracOfMergedRowV0NegV0Pos;
490 inline double AliFemtoPair::getFracOfMergedRowV0PosV0Pos() const{
491 if(fMergingParNotCalculatedV0PosV0Pos)
492 CalcMergingParFctn(&fMergingParNotCalculatedV0PosV0Pos,
493 &(fTrack1->fZ[0]),&(fTrack1->fU[0]),
494 &(fTrack2->fZ[0]),&(fTrack2->fU[0]),
495 &(fTrack1->fSect[0]),
496 &(fTrack2->fSect[0]),
497 &(fFracOfMergedRowV0PosV0Pos),
498 &(fClosestRowAtDCAV0PosV0Pos)
500 return fFracOfMergedRowV0PosV0Pos;
502 inline double AliFemtoPair::getFracOfMergedRowV0NegV0Neg() const{
503 if(fMergingParNotCalculatedV0NegV0Neg)
504 CalcMergingParFctn(&fMergingParNotCalculatedV0NegV0Neg,
505 &(fTrack1->fV0NegZ[0]),&(fTrack1->fV0NegU[0]),
506 &(fTrack2->fV0NegZ[0]),&(fTrack2->fV0NegU[0]),
507 &(fTrack1->fV0NegSect[0]),
508 &(fTrack2->fV0NegSect[0]),
509 &(fFracOfMergedRowV0NegV0Neg),
510 &(fClosestRowAtDCAV0NegV0Neg)
512 return fFracOfMergedRowV0NegV0Neg;