StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StuProbabilityPidAlgorithm.h
1 /***************************************************************************
2  *
3  * $Id: StuProbabilityPidAlgorithm.h,v 1.17 2006/08/06 23:30:15 perev Exp $
4  *
5  * Author:Aihong Tang, Richard Witt(FORTRAN version). Kent State University
6  * Send questions to aihong@cnr.physics.kent.edu
7  ***************************************************************************
8  *
9  * Description: A functor that do PID base on Probability (Amplitude) info.
10  *
11  ***************************************************************************
12  *
13  * $Log: StuProbabilityPidAlgorithm.h,v $
14  * Revision 1.17 2006/08/06 23:30:15 perev
15  * ROOT5 corrs
16  *
17  * Revision 1.16 2004/04/09 15:46:21 aihong
18  * add isPIDTableRead()
19  *
20  * Revision 1.15 2003/06/24 02:53:14 aihong
21  * update for dAu PIDtable
22  *
23  * Revision 1.14 2002/01/17 03:25:37 aihong
24  * add production Tag to take care of different centrality def. between different productions
25  *
26  * Revision 1.13 2001/03/21 18:16:13 aihong
27  * constructor without StEvent added
28  *
29  * Revision 1.12 2001/03/21 17:54:31 aihong
30  * add processPIDAsFunction()
31  *
32  * Revision 1.11 2000/12/20 16:55:16 aihong
33  * let it survive when no support PIDTable is present
34  *
35  * Revision 1.10 2000/12/18 23:22:58 aihong
36  * big revision. eta bin and centrality bin added
37  *
38  * Revision 1.6 2000/08/16 12:46:07 aihong
39  * bug killed
40  *
41  * Revision 1.5 2000/08/15 23:04:18 aihong
42  * speed it up by looking up table
43  *
44  * Revision 1.4 2000/07/22 22:45:27 aihong
45  * change include path
46  *
47  * Revision 1.3 2000/05/05 19:25:39 aihong
48  * modified ctor
49  *
50  * Revision 1.2 2000/03/09 20:44:56 aihong
51  * add head for Log
52  *
53  **************************************************************************/
54 #ifndef StuProbabilityPidAlgorithm_hh
55 #define StuProbabilityPidAlgorithm_hh
56 
57 
58 #include "TString.h"
59 #include "TVectorD.h"
60 #include "TObjString.h"
61 
62 #include "StEventTypes.h"
63 #include "StParticleTable.hh"
64 #include "StParticleTypes.hh"
65 
66 class StEvent;
67 class TString;
68 class TObjString;
69 class TF1;
70 
71 
73 
74  public:
75 
78 
79  virtual ~StuProbabilityPidAlgorithm();
80 
81 
82 
83  StParticleDefinition* mostLikelihoodParticle();
84  StParticleDefinition* secondLikelihoodParticle();
85  StParticleDefinition* thirdLikelihoodParticle();
86 
87  StParticleDefinition* getParticle(int i);
88 
89 
90  int mostLikelihoodParticleGeantID() const;
91  int secondLikelihoodParticleGeantID() const;
92  int thirdLikelihoodParticleGeantID() const;
93  int getParticleGeantID(int i) const;
94 
95  double getProbability(int i);
96  double mostLikelihoodProbability();
97  double secondLikelihoodProbability();
98  double thirdLikelihoodProbability();
99 
100  double getCentrality(int theMult);
101 
102  double beingPionMinusProb() const { return mPionMinusProb;}
103  double beingElectronProb() const { return mElectronProb; }
104  double beingKaonMinusProb() const { return mKaonMinusProb;}
105  double beingAntiProtonProb() const { return mAntiProtonProb;}
106 
107  double beingPionPlusProb() const { return mPionPlusProb; }
108  double beingPositronProb() const { return mPositronProb; }
109  double beingKaonPlusProb() const { return mKaonPlusProb; }
110  double beingProtonProb() const { return mProtonProb; }
111 
112  bool isExtrap();
113 
115  operator() (const StTrack&, const StSPtrVecTrackPidTraits&);
116 
117  void processPIDAsFunction (double theCent, double theDca, int theCharge, double theRig, double theEta, int theNhits, double theDedx);
118 
119  static void setDedxMethod(StDedxMethod method);
120 
121  static void readParametersFromFile(TString fileName);
122 
123  static bool isPIDTableRead();
124 
125  // static void readParametersFromTable(St_Table* tb);
126  //from data base.
127 
128  private:
129 
130  void fillPIDByLookUpTable(double myCentrality, double myDca, int myCharge, double myRig, double myEta, int myNhits, double myDedx);
131 
132  void fillPIDHypothis();
133 
134 
135 
136  void fill(double prob, int geantId);
137  void fillAsUnknown();
138  void lowRigPID(double rig,double dedx,int theCharge);
139 
140  double getCentrality_P01gl(int theMult);
141  double getCentrality_P03ia_dAu(int theMult);
142  int getCentralityBin(double theCent);
143  int getCalibPosition(double theEta, int theNHits);
144  void setCalibrations(double theEta, int theNhits);
145 
146  StParticleTable* table;
147 
148  int PID[4];
149  double mProb[4];
150 
151  bool mExtrap;
152 
153  StEvent* mEvent;
154 
155  double mPionMinusProb;
156  double mElectronProb;
157  double mKaonMinusProb;
158  double mAntiProtonProb;
159  double mPionPlusProb;
160  double mPositronProb;
161  double mKaonPlusProb;
162  double mProtonProb;
163 
165 
166 
167  static int thisMultBins;
168  static int thisDcaBins;
169  static int thisChargeBins;
170 
171 
172  static int thisPBins;
173  static int thisEtaBins;
174  static int thisNHitsBins;
175 
177 
178  static double thisDedxStart;
179  static double thisDedxEnd;
180  static double thisPStart;
181  static double thisPEnd;
182  static double thisEtaStart;
183  static double thisEtaEnd;
184  static double thisNHitsStart;
185  static double thisNHitsEnd;
186 
187  static bool mPIDTableRead;
188 
189  static StDedxMethod mDedxMethod;
190 
191  static TVectorD* mEAmp;
192  static TVectorD* mECenter;
193  static TVectorD* mESigma;
194 
195  static TVectorD* mPiAmp;
196  static TVectorD* mPiCenter;
197  static TVectorD* mPiSigma;
198 
199  static TVectorD* mKAmp;
200  static TVectorD* mKCenter;
201  static TVectorD* mKSigma;
202 
203  static TVectorD* mPAmp;
204  static TVectorD* mPCenter;
205  static TVectorD* mPSigma;
206 
207 
208  static TVectorD* mEqualyDividableRangeStartSet;
209  static TVectorD* mEqualyDividableRangeEndSet;
210  static TVectorD* mEqualyDividableRangeNBinsSet;
211  static TVectorD* mNoEqualyDividableRangeNBinsSet;
212 
213  static TVectorD* mMultiBinEdgeSet; // % central
214  static TVectorD* mDcaBinEdgeSet; // in centimeter
215 
216 
217  static TVectorD* mBBPrePar; //par[0]
218  static TVectorD* mBBTurnOver; //par[1]
219  static TVectorD* mBBOffSet; //par[2],BetheBolch offset par.
220  static TVectorD* mBBScale; //par[5],BetheBloch scale par.
221  static TVectorD* mBBSaturate; //par[6]
222 
223 
224  static TObjString* mProductionTag; //production tag
225 
226 
227  TF1* myBandBGFcn;
228 
229 };
230 
231 inline int StuProbabilityPidAlgorithm::mostLikelihoodParticleGeantID() const { return PID[0];}
232 inline int StuProbabilityPidAlgorithm::secondLikelihoodParticleGeantID() const { return PID[1];}
233 inline int StuProbabilityPidAlgorithm::thirdLikelihoodParticleGeantID() const { return PID[2];}
234 inline int StuProbabilityPidAlgorithm::getParticleGeantID(int i) const {
235  if (i<4 && i>=0) return PID[i]; else return -1;}
236 
237 #endif
238