StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuProbPidTraits.h
1 /***************************************************************************
2  *
3  * $Id: StMuProbPidTraits.h,v 1.12 2016/09/18 23:00:49 fisyak Exp $
4  * Author: Frank Laue, BNL, laue@bnl.gov
5  *
6  ***************************************************************************/
7 
22 #ifndef StMuProbPidTraits_h
23 #define StMuProbPidTraits_h
24 #include <string.h>
25 #include "TObject.h"
26 
27 #define __NPARTICLES__ 9
28 
29 class StMuProbPidTraits : public TObject {
30 public:
32  double dEdxFit() const;
33  double dEdxErrorFit() const;
34  double dNdxFit() const;
35  double dNdxErrorFit() const;
36  double dEdxTruncated() const;
37  double dEdxErrorTruncated() const;
38  double dEdxTrackLength() const;
39  double log2dX() const { return mLog2dX;}
40  double ndf() const;
41  double probability(unsigned int i) const;
42  double sum() const;
43  int numberOfParticles() const;
44 
45  void setdEdxFit(double dedx );
46  void setdEdxErrorFit(double dedx );
47  void setdNdxFit(double dedx );
48  void setdNdxErrorFit(double dedx );
49  void setdEdxTruncated(double dedx);
50  void setdEdxErrorTruncated(double dedx);
51  void setdEdxTrackLength(double dedx );
52  void setNdf(unsigned int);
53  void setProbability(unsigned int, double);
54  void setLog2dX(Float_t Log2dX = 1) {mLog2dX = Log2dX;}
55 protected:
56  unsigned char mNDF;
57  float mdEdxFit;
58  float mdEdxErrorFit;
59  float mdEdxTruncated;
60  float mdEdxErrorTruncated;
61  float mdNdxFit;
62  float mdNdxErrorFit;
63  float mdEdxTrackLength;
64  float mLog2dX;
65  float mProbabilities[__NPARTICLES__];
66 
67  ClassDef(StMuProbPidTraits,5)
68 };
69 
70 inline double StMuProbPidTraits::dEdxFit() const {return mdEdxFit;}
71 inline double StMuProbPidTraits::dEdxErrorFit() const {return mdEdxErrorFit;}
72 inline double StMuProbPidTraits::dNdxFit() const {return mdNdxFit;}
73 inline double StMuProbPidTraits::dNdxErrorFit() const {return mdNdxErrorFit;}
74 inline double StMuProbPidTraits::dEdxTruncated() const { return mdEdxTruncated;}
75 inline double StMuProbPidTraits::dEdxErrorTruncated() const { return mdEdxErrorTruncated;}
76 inline double StMuProbPidTraits::dEdxTrackLength() const {return mdEdxTrackLength;}
77 inline double StMuProbPidTraits::ndf() const { return mNDF;}
78 inline double StMuProbPidTraits::probability(unsigned int i) const { return (i<__NPARTICLES__) ? mProbabilities[i] : 0;}
79 inline double StMuProbPidTraits::sum() const { double s=0; for (int i=0;i<__NPARTICLES__;i++) s += mProbabilities[i]; return s;}
80 inline int StMuProbPidTraits::numberOfParticles() const { return __NPARTICLES__; }
81 
82 inline void StMuProbPidTraits::setdEdxFit(double dEdx ) { mdEdxFit = dEdx; }
83 inline void StMuProbPidTraits::setdEdxErrorFit(double dEdx ) { mdEdxErrorFit = dEdx; }
84 inline void StMuProbPidTraits::setdNdxFit(double dNdx ) { mdNdxFit = dNdx; }
85 inline void StMuProbPidTraits::setdNdxErrorFit(double dNdx ) { mdNdxErrorFit = dNdx; }
86 inline void StMuProbPidTraits::setdEdxTruncated(double dEdx) { mdEdxTruncated = dEdx; }
87 inline void StMuProbPidTraits::setdEdxErrorTruncated(double dEdx) { mdEdxErrorTruncated = dEdx; }
88 inline void StMuProbPidTraits::setdEdxTrackLength(double length) { mdEdxTrackLength = length; }
89 inline void StMuProbPidTraits::setProbability(unsigned int i, double prob) { if (i<__NPARTICLES__) mProbabilities[i]=prob;}
90 inline void StMuProbPidTraits::setNdf(unsigned int i) { mNDF = i; }
91 
92 
93 
94 #endif
95 
96 /***************************************************************************
97  *
98  * $Log: StMuProbPidTraits.h,v $
99  * Revision 1.12 2016/09/18 23:00:49 fisyak
100  * Add dNdx
101  *
102  * Revision 1.10 2013/07/16 14:30:30 fisyak
103  * Restore mass fit tracks
104  *
105  * Revision 1.8 2013/04/08 18:07:55 fisyak
106  * Add branches for KFParticles, fix problem with zero cov. matrix for primary tracks
107  *
108  * Revision 1.7 2012/05/07 14:47:06 fisyak
109  * Add handles for track to fast detector matching
110  *
111  * Revision 1.6 2007/07/12 19:46:19 fisyak
112  * Add includes for ROOT 5.16
113  *
114  * Revision 1.5 2004/05/02 04:10:14 perev
115  * private => protected
116  *
117  * Revision 1.4 2003/11/08 14:18:41 laue
118  * incrmented ClassDef version numbber
119  *
120  * Revision 1.3 2003/11/07 15:23:26 laue
121  * added error on dEdx measurements to the StMuProbPidTraits
122  *
123  * Revision 1.2 2003/02/21 14:32:47 laue
124  * Yuri's updates to the PID probabilities. dE/dx track length in TPC added
125  *
126  * Revision 1.1 2002/11/18 20:29:01 laue
127  * New class. Wrapper for Yuri's new StProbPidTraits.
128  *
129  *
130  **************************************************************************/
void setdEdxTrackLength(double dedx)
sets the track length in TPC used for dE/dx calculations
void setdEdxTruncated(double dedx)
sets the truncated dEdx value;
void setdEdxErrorFit(double dedx)
sets the fitted dEdx error value;
double dEdxFit() const
returns the fitted dEdx value
void setdNdxErrorFit(double dedx)
sets the fitted dNdx error value;
double probability(unsigned int i) const
returns the probability of the track being of particle type i
int numberOfParticles() const
returns the number of particles avaiable
double sum() const
returns the sum of all probabilities
void setdEdxErrorTruncated(double dedx)
sets the truncated dEdx error value;
double dNdxErrorFit() const
returns the fitted dNdx resolution value
double ndf() const
returns number of degrees of freedon
void setProbability(unsigned int, double)
set the probability for particle i
void setNdf(unsigned int)
set number of degrees of freedom
float mProbabilities[__NPARTICLES__]
array holding the pid probabilities
double dEdxErrorFit() const
returns the fitted dEdx resolution value
double dEdxTrackLength() const
returns the track length in TPC used for dE/dx calculations
void setdNdxFit(double dedx)
sets the fitted dNdx value;
double dEdxErrorTruncated() const
returns the truncated 70% dEdx resolution value
double dNdxFit() const
returns the fitted dNdx value
double dEdxTruncated() const
returns the truncated 70% dEdx value
void setdEdxFit(double dedx)
sets the fitted dEdx value;