StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtPair.hh
1 /***************************************************************************
2  *
3  * StHbtPair.hh,v 1.17
4  *
5  * Author: Brian Laziuk, Yale University
6  * slightly modified by Mike Lisa
7  ***************************************************************************
8  *
9  * Description: part of STAR HBT Framework: StHbtMaker 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
13  *
14  ***************************************************************************
15  *
16  * $Log: StHbtPair.hh,v $
17  * Revision 1.19 2003/01/14 09:44:00 renault
18  * corrections on average separation calculation for tracks which doesn't cross
19  * all 45 padrows.
20  *
21  * Revision 1.18 2002/11/19 23:33:18 renault
22  * Enable average separation calculation for all combinaisons of
23  * V0 daughters and tracks
24  *
25  * Revision 1.16 2002/02/28 14:18:36 rcwells
26  * Added emissionAngle function to StHbtPair
27  *
28  * Revision 1.15 2001/12/14 23:11:30 fretiere
29  * Add class HitMergingCut. Add class fabricesPairCut = HitMerginCut + pair purity cuts. Add TpcLocalTransform function which convert to local tpc coord (not pretty). Modify StHbtTrack, StHbtParticle, StHbtHiddenInfo, StHbtPair to handle the hit information and cope with my code
30  *
31  * Revision 1.14 2001/04/03 21:04:36 kisiel
32  *
33  *
34  * Changes needed to make the Theoretical code
35  * work. The main code is the ThCorrFctn directory.
36  * The most visible change is the addition of the
37  * HiddenInfo to StHbtPair.
38  *
39  * Revision 1.13 2001/03/28 22:35:23 flierl
40  * changes and bugfixes in qYKP*
41  * add pairrapidity
42  *
43  * Revision 1.12 2001/01/22 22:56:40 laue
44  * Yano-Koonin-Podgoretskii Parametrisation added
45  *
46  * Revision 1.11 2000/10/26 16:09:16 lisa
47  * Added OpeningAngle PairCut class and method to StHbtPair
48  *
49  * Revision 1.10 2000/10/05 23:09:05 lisa
50  * Added kT-dependent radii to mixed-event simulator AND implemented AverageSeparation Cut and CorrFctn
51  *
52  * Revision 1.9 2000/07/17 20:03:17 lisa
53  * Implemented tools for addressing and assessing trackmerging
54  *
55  * Revision 1.8 2000/04/04 16:13:09 lisa
56  * StHbtPair:quality() now returns normalized value (and so is double) and add a CorrFctn which looks at quality()
57  *
58  * Revision 1.7 2000/04/03 22:09:12 rcwells
59  * Add member function ... quality().
60  *
61  * Revision 1.6 2000/02/13 21:13:34 lisa
62  * changed ambiguous StHbtPair::fourMomentum() to fourMomentumSum() and fourMomentumDiff() and fixed related bug in QvecCorrFctn
63  *
64  * Revision 1.5 2000/01/25 17:35:17 laue
65  * I. In order to run the stand alone version of the StHbtMaker the following
66  * changes have been done:
67  * a) all ClassDefs and ClassImps have been put into #ifdef __ROOT__ statements
68  * b) unnecessary includes of StMaker.h have been removed
69  * c) the subdirectory StHbtMaker/doc/Make has been created including everything
70  * needed for the stand alone version
71  *
72  * II. To reduce the amount of compiler warning
73  * a) some variables have been type casted
74  * b) some destructors have been declared as virtual
75  *
76  * Revision 1.4 1999/07/29 16:16:34 lisa
77  * Selemons upgrade of StHbtPair class
78  *
79  * Revision 1.3 1999/07/22 18:49:10 lisa
80  * Implement idea of Fabrice to not create and delete StHbtPair all the time
81  *
82  * Revision 1.2 1999/07/06 22:33:22 lisa
83  * Adjusted all to work in pro and new - dev itself is broken
84  *
85  * Revision 1.1.1.1 1999/06/29 16:02:57 lisa
86  * Installation of StHbtMaker
87  *
88  **************************************************************************/
89 
90 #ifndef ST_HBT_PAIR_HH
91 #define ST_HBT_PAIR_HH
92 
93 #include <utility>
94 
95 #include "StHbtMaker/Infrastructure/StHbtParticle.hh"
96 #include "StHbtMaker/Infrastructure/StHbtTypes.hh"
97 
98 class StHbtPair {
99 public:
100  StHbtPair();
102 
103 
104  ~StHbtPair();
105  //StHbtPair(const StHbtPair&);
106  //StHbtPair& operator=(const StHbtPair&);
107 
108  // track Gets:
109  StHbtParticle* track1() const;
110  StHbtParticle* track2() const;
111  // track Sets:
112  void SetTrack1(const StHbtParticle* trkPtr);
113  void SetTrack2(const StHbtParticle* trkPtr);
114 
115  StHbtLorentzVector fourMomentumDiff() const;
116  StHbtLorentzVector fourMomentumSum() const;
117  double qInv() const;
118  double kT() const;
119  double mInv() const;
120  // pair rapidity
121  double rap() const;
122  double emissionAngle() const;
123 
124  // Bertsch-Pratt momentum components in Pair Frame - written by Bekele/Humanic
125  double qSidePf() const;
126  double qOutPf() const;
127  double qLongPf() const;
128 
129  // Bertsch-Pratt momentum components in Local CMS (longitudinally comoving) frame
130  // - written by Bekele/Humanic
131  double qSideCMS() const;
132  double qOutCMS() const;
133  double qLongCMS() const;
134 
135  double dKSide() const;
136  double dKOut() const;
137  double dKLong() const;
138 
139  // Bertsch-Pratt momentum components in a longitudinally boosted frame
140  // the argument is the beta of the longitudinal boost (default is 0.0, meaning lab frame)
141  // - written by Bekele/Humanic
142  double qSideBf(double beta=0.0) const;
143  double qOutBf(double beta=0.0) const;
144  double qLongBf(double beta=0.0) const;
145 
146  // Yano-Koonin-Podgoretskii Parametrisation
147  // source rest frame (usually lab frame)
148  void qYKPCMS(double& qP, double& qT, double& q0) const ;
149  // longitudinal comoving frame
150  void qYKPLCMS(double& qP, double& qT, double& q0) const ;
151  // pair rest frame
152  void qYKPPF(double& qP, double& qT, double& q0) const ;
153 
154 
155  double quality() const;
156 
157  // the following two methods calculate the "nominal" separation of the tracks
158  // at the inner field cage (EntranceSeparation) and when they exit the TPC,
159  // which may be at the outer field cage, or at the endcaps.
160  // "nominal" means that the tracks are assumed to start at (0,0,0). Making this
161  // assumption is important for the Event Mixing-- it is not a mistake. - MALisa
162  double NominalTpcExitSeparation() const;
163  double NominalTpcEntranceSeparation() const;
164  double NominalTpcAverageSeparation() const;
165  // adapted calculation of Entrance/Exit/Average Tpc separation to V0 daughters
166  double TpcExitSeparationTrackV0Pos() const;
167  double TpcEntranceSeparationTrackV0Pos() const;
168  double TpcAverageSeparationTrackV0Pos() const;
169 
170  double TpcExitSeparationTrackV0Neg() const;
171  double TpcEntranceSeparationTrackV0Neg() const;
172  double TpcAverageSeparationTrackV0Neg() const;
173 
174  double TpcExitSeparationV0PosV0Pos() const;
175  double TpcEntranceSeparationV0PosV0Pos() const;
176  double TpcAverageSeparationV0PosV0Pos() const;
177 
178  double TpcExitSeparationV0PosV0Neg() const;
179  double TpcEntranceSeparationV0PosV0Neg() const;
180  double TpcAverageSeparationV0PosV0Neg() const;
181 
182  double TpcExitSeparationV0NegV0Pos() const;
183  double TpcEntranceSeparationV0NegV0Pos() const;
184  double TpcAverageSeparationV0NegV0Pos() const;
185 
186  double TpcExitSeparationV0NegV0Neg() const;
187  double TpcEntranceSeparationV0NegV0Neg() const;
188  double TpcAverageSeparationV0NegV0Neg() const;
189 
190  double pInv() const;
191  double KStar() const;
192  double KStarFlipped() const;
193  double CVK() const;
194  double CVKFlipped() const;
195  double qInvFlippedXY() const;
196 
197  double OpeningAngle() const;
198 
199  // Fabrice Private <<<
200  double KStarSide() const;
201  double KStarOut() const;
202  double KStarLong() const;
203 
204  float PionPairProbability() const;
205  float ElectronPairProbability() const;
206  float KaonPairProbability() const;
207  float ProtonPairProbability() const;
208  float KaonPionPairProbability() const;
209 
210  double dcaInsideTpc() const;
211  double quality2() const;
212 
213  double KStarGlobal() const;
214  double CVKGlobal() const;
215  double KStarSideGlobal() const;
216  double KStarOutGlobal() const;
217  double KStarLongGlobal() const;
218 
219  void setMergingPar(double aMaxDuInner, double aMaxDzInner,
220  double aMaxDuOuter, double aMaxDzOuter);
221  void setDefaultHalfFieldMergingPar();
222  void setDefaultFullFieldMergingPar();
223  double getFracOfMergedRow() const;
224  double getClosestRowAtDCA() const;
225  double getWeightedAvSep() const;
226  // >>>
227  double getFracOfMergedRowTrkV0Pos() const;
228  double getClosestRowAtDCATrkV0Pos() const;
229 
230  double getFracOfMergedRowTrkV0Neg() const;
231  double getClosestRowAtDCATrkV0Neg() const;
232 
233  double getFracOfMergedRowV0PosV0Neg() const;
234  double getFracOfMergedRowV0NegV0Pos() const;
235  double getFracOfMergedRowV0PosV0Pos() const;
236  double getFracOfMergedRowV0NegV0Neg() const;
237 
238 private:
239  StHbtParticle* mTrack1;
240  StHbtParticle* mTrack2;
241 
242  mutable short mNonIdParNotCalculated;
243  mutable double mDKSide;
244  mutable double mDKOut;
245  mutable double mDKLong;
246  mutable double mCVK;
247  mutable double kStarCalc;
248  void calcNonIdPar() const;
249 
250  mutable short mNonIdParNotCalculatedGlobal;
251  mutable double mDKSideGlobal;
252  mutable double mDKOutGlobal;
253  mutable double mDKLongGlobal;
254  mutable double kStarCalcGlobal;
255  mutable double mCVKGlobal;
256  void calcNonIdParGlobal() const;
257 
258  mutable short mMergingParNotCalculated;
259  mutable double mWeightedAvSep;
260  mutable double mFracOfMergedRow;
261  mutable double mClosestRowAtDCA;
262 
263  mutable short mMergingParNotCalculatedTrkV0Pos;
264  mutable double mFracOfMergedRowTrkV0Pos;
265  mutable double mClosestRowAtDCATrkV0Pos;
266 
267  mutable short mMergingParNotCalculatedTrkV0Neg;
268  mutable double mFracOfMergedRowTrkV0Neg;
269  mutable double mClosestRowAtDCATrkV0Neg;
270 
271  mutable short mMergingParNotCalculatedV0PosV0Neg;
272  mutable double mFracOfMergedRowV0PosV0Neg;
273  mutable double mClosestRowAtDCAV0PosV0Neg;
274 
275  mutable short mMergingParNotCalculatedV0NegV0Pos;
276  mutable double mFracOfMergedRowV0NegV0Pos;
277  mutable double mClosestRowAtDCAV0NegV0Pos;
278 
279  mutable short mMergingParNotCalculatedV0PosV0Pos;
280  mutable double mFracOfMergedRowV0PosV0Pos;
281  mutable double mClosestRowAtDCAV0PosV0Pos;
282 
283  mutable short mMergingParNotCalculatedV0NegV0Neg;
284  mutable double mFracOfMergedRowV0NegV0Neg;
285  mutable double mClosestRowAtDCAV0NegV0Neg;
286 
287  static double mMaxDuInner;
288  static double mMaxDzInner;
289  static double mMaxDuOuter;
290  static double mMaxDzOuter;
291  void calcMergingPar() const;
292 
293  void CalcMergingParFctn(short* tmpMergingParNotCalculatedFctn,
294  float* tmpZ1,float* tmpU1,
295  float* tmpZ2,float* tmpU2,
296  int *tmpSect1,int *tmpSect2,
297  double* tmpFracOfMergedRow,
298  double* tmpClosestRowAtDCA
299  ) const;
300 
301  void resetParCalculated();
302 };
303 
304 inline void StHbtPair::resetParCalculated(){
305  mNonIdParNotCalculated=1;
306  mNonIdParNotCalculatedGlobal=1;
307  mMergingParNotCalculated=1;
308  mMergingParNotCalculatedTrkV0Pos=1;
309  mMergingParNotCalculatedTrkV0Neg=1;
310  mMergingParNotCalculatedV0PosV0Pos=1;
311  mMergingParNotCalculatedV0NegV0Pos=1;
312  mMergingParNotCalculatedV0PosV0Neg=1;
313  mMergingParNotCalculatedV0NegV0Neg=1;
314 }
315 
316 inline void StHbtPair::SetTrack1(const StHbtParticle* trkPtr){
317  mTrack1=(StHbtParticle*)trkPtr;
318  resetParCalculated();
319 }
320 inline void StHbtPair::SetTrack2(const StHbtParticle* trkPtr){
321  mTrack2=(StHbtParticle*)trkPtr;
322  resetParCalculated();
323 }
324 
325 inline StHbtParticle* StHbtPair::track1() const {return mTrack1;}
326 inline StHbtParticle* StHbtPair::track2() const {return mTrack2;}
327 
328 inline double StHbtPair::dKSide() const{
329  if(mNonIdParNotCalculated) calcNonIdPar();
330  return mDKSide;
331 }
332 inline double StHbtPair::dKOut() const{
333  if(mNonIdParNotCalculated) calcNonIdPar();
334  return mDKOut;
335 }
336 inline double StHbtPair::dKLong() const{
337  if(mNonIdParNotCalculated) calcNonIdPar();
338  return mDKLong;
339 }
340 inline double StHbtPair::KStar() const{
341  if(mNonIdParNotCalculated) calcNonIdPar();
342  return kStarCalc;
343 }
344 inline double StHbtPair::qInv() const {
345  StHbtLorentzVector tDiff = (mTrack1->FourMomentum()-mTrack2->FourMomentum());
346  return ( -1.* tDiff.m());
347 }
348 
349 // Fabrice private <<<
350 inline double StHbtPair::KStarSide() const{
351  if(mNonIdParNotCalculated) calcNonIdPar();
352  return mDKSide;//mKStarSide;
353 }
354 inline double StHbtPair::KStarOut() const{
355  if(mNonIdParNotCalculated) calcNonIdPar();
356  return mDKOut;//mKStarOut;
357 }
358 inline double StHbtPair::KStarLong() const{
359  if(mNonIdParNotCalculated) calcNonIdPar();
360  return mDKLong;//mKStarLong;
361 }
362 inline double StHbtPair::CVK() const{
363  if(mNonIdParNotCalculated) calcNonIdPar();
364  return mCVK;
365 }
366 
367 inline double StHbtPair::KStarGlobal() const{
368  if(mNonIdParNotCalculatedGlobal) calcNonIdParGlobal();
369  return kStarCalcGlobal;
370 }
371 inline double StHbtPair::KStarSideGlobal() const{
372  if(mNonIdParNotCalculatedGlobal) calcNonIdParGlobal();
373  return mDKSideGlobal;//mKStarSide;
374 }
375 inline double StHbtPair::KStarOutGlobal() const{
376  if(mNonIdParNotCalculatedGlobal) calcNonIdParGlobal();
377  return mDKOutGlobal;//mKStarOut;
378 }
379 inline double StHbtPair::KStarLongGlobal() const{
380  if(mNonIdParNotCalculatedGlobal) calcNonIdParGlobal();
381  return mDKLongGlobal;//mKStarLong;
382 }
383 inline double StHbtPair::CVKGlobal() const{
384  if(mNonIdParNotCalculatedGlobal) calcNonIdParGlobal();
385  return mCVKGlobal;
386 }
387 
388 
389 inline float StHbtPair::PionPairProbability() const{
390  return (mTrack1->Track()->PidProbPion()) *
391  (mTrack2->Track()->PidProbPion());
392 }
393 inline float StHbtPair::ElectronPairProbability() const{
394  return (mTrack1->Track()->PidProbElectron()) *
395  (mTrack2->Track()->PidProbElectron());
396 }
397 inline float StHbtPair::KaonPairProbability() const{
398  return (mTrack1->Track()->PidProbKaon()) *
399  (mTrack2->Track()->PidProbKaon());
400 }
401 inline float StHbtPair::ProtonPairProbability() const{
402  return (mTrack1->Track()->PidProbProton()) *
403  (mTrack2->Track()->PidProbProton());
404 }
405 inline float StHbtPair::KaonPionPairProbability() const{
406  return (mTrack1->Track()->PidProbKaon()) *
407  (mTrack2->Track()->PidProbPion());
408 }
409 
410 inline double StHbtPair::getFracOfMergedRow() const{
411  if(mMergingParNotCalculated) calcMergingPar();
412  return mFracOfMergedRow;
413 }
414 inline double StHbtPair::getClosestRowAtDCA() const {
415  if(mMergingParNotCalculated) calcMergingPar();
416  return mClosestRowAtDCA;
417 }
418 inline double StHbtPair::getWeightedAvSep() const {
419  if(mMergingParNotCalculated) calcMergingPar();
420  return mWeightedAvSep;
421 }
422 
423 
424 inline double StHbtPair::getFracOfMergedRowTrkV0Pos() const{
425  if(mMergingParNotCalculatedTrkV0Pos)
426  CalcMergingParFctn(&mMergingParNotCalculatedTrkV0Pos,
427  &(mTrack1->mZ[0]),&(mTrack1->mU[0]),
428  &(mTrack2->mZ[0]),&(mTrack2->mU[0]),
429  &(mTrack1->mSect[0]),&(mTrack2->mSect[0]),
430  &(mFracOfMergedRowTrkV0Pos),&(mClosestRowAtDCATrkV0Pos)
431  );
432  return mFracOfMergedRowTrkV0Pos;
433 }
434 inline double StHbtPair::getClosestRowAtDCATrkV0Pos() const{
435  if(mMergingParNotCalculatedTrkV0Pos)
436  CalcMergingParFctn(&mMergingParNotCalculatedTrkV0Pos,
437  &(mTrack1->mZ[0]),&(mTrack1->mU[0]),
438  &(mTrack2->mZ[0]),&(mTrack2->mU[0]),
439  &(mTrack1->mSect[0]),&(mTrack2->mSect[0]),
440  &mFracOfMergedRowTrkV0Pos,&mClosestRowAtDCATrkV0Pos
441  );
442  return mClosestRowAtDCATrkV0Pos;
443 }
444 inline double StHbtPair::getFracOfMergedRowTrkV0Neg() const{
445  if(mMergingParNotCalculatedTrkV0Neg)
446  CalcMergingParFctn(&mMergingParNotCalculatedTrkV0Neg,
447  &(mTrack1->mZ[0]),&(mTrack1->mU[0]),
448  &(mTrack2->mV0NegZ[0]),&(mTrack2->mV0NegU[0]),
449  &(mTrack1->mSect[0]),&(mTrack2->mV0NegSect[0]),
450  &(mFracOfMergedRowTrkV0Neg),&(mClosestRowAtDCATrkV0Neg)
451  );
452  return mFracOfMergedRowTrkV0Neg;
453 }
454 inline double StHbtPair::getClosestRowAtDCATrkV0Neg() const{
455  if(mMergingParNotCalculatedTrkV0Neg)
456  CalcMergingParFctn(&mMergingParNotCalculatedTrkV0Neg,
457  &(mTrack1->mZ[0]),&(mTrack1->mU[0]),
458  &(mTrack2->mV0NegZ[0]),&(mTrack2->mV0NegU[0]),
459  &(mTrack1->mSect[0]),&(mTrack2->mV0NegSect[0]),
460  &mFracOfMergedRowTrkV0Neg,&mClosestRowAtDCATrkV0Neg
461  );
462  return mClosestRowAtDCATrkV0Neg;
463 }
464 inline double StHbtPair::getFracOfMergedRowV0PosV0Neg() const{
465  if(mMergingParNotCalculatedV0PosV0Neg)
466  CalcMergingParFctn(&mMergingParNotCalculatedV0PosV0Neg,
467  &(mTrack1->mZ[0]),&(mTrack1->mU[0]),
468  &(mTrack2->mV0NegZ[0]),&(mTrack2->mV0NegU[0]),
469  &(mTrack1->mSect[0]),&(mTrack2->mV0NegSect[0]),
470  &(mFracOfMergedRowV0PosV0Neg),
471  &(mClosestRowAtDCAV0PosV0Neg)
472  );
473  return mFracOfMergedRowV0PosV0Neg;
474 }
475 inline double StHbtPair::getFracOfMergedRowV0NegV0Pos() const{
476  if(mMergingParNotCalculatedV0NegV0Pos)
477  CalcMergingParFctn(&mMergingParNotCalculatedV0NegV0Pos,
478  &(mTrack1->mV0NegZ[0]),&(mTrack1->mV0NegU[0]),
479  &(mTrack2->mZ[0]),&(mTrack2->mU[0]),
480  &(mTrack1->mV0NegSect[0]),
481  &(mTrack2->mSect[0]),
482  &(mFracOfMergedRowV0NegV0Pos),
483  &(mClosestRowAtDCAV0NegV0Pos)
484  );
485  return mFracOfMergedRowV0NegV0Pos;
486 }
487 inline double StHbtPair::getFracOfMergedRowV0PosV0Pos() const{
488  if(mMergingParNotCalculatedV0PosV0Pos)
489  CalcMergingParFctn(&mMergingParNotCalculatedV0PosV0Pos,
490  &(mTrack1->mZ[0]),&(mTrack1->mU[0]),
491  &(mTrack2->mZ[0]),&(mTrack2->mU[0]),
492  &(mTrack1->mSect[0]),
493  &(mTrack2->mSect[0]),
494  &(mFracOfMergedRowV0PosV0Pos),
495  &(mClosestRowAtDCAV0PosV0Pos)
496  );
497  return mFracOfMergedRowV0PosV0Pos;
498 }
499 inline double StHbtPair::getFracOfMergedRowV0NegV0Neg() const{
500  if(mMergingParNotCalculatedV0NegV0Neg)
501  CalcMergingParFctn(&mMergingParNotCalculatedV0NegV0Neg,
502  &(mTrack1->mV0NegZ[0]),&(mTrack1->mV0NegU[0]),
503  &(mTrack2->mV0NegZ[0]),&(mTrack2->mV0NegU[0]),
504  &(mTrack1->mV0NegSect[0]),
505  &(mTrack2->mV0NegSect[0]),
506  &(mFracOfMergedRowV0NegV0Neg),
507  &(mClosestRowAtDCAV0NegV0Neg)
508  );
509  return mFracOfMergedRowV0NegV0Neg;
510 }
511 
512 #endif