00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #ifndef StuProbabilityPidAlgorithm_hh
00055 #define StuProbabilityPidAlgorithm_hh
00056
00057
00058 #include "TString.h"
00059 #include "TVectorD.h"
00060 #include "TObjString.h"
00061
00062 #include "StEventTypes.h"
00063 #include "StParticleTable.hh"
00064 #include "StParticleTypes.hh"
00065
00066 class StEvent;
00067 class TString;
00068 class TObjString;
00069 class TF1;
00070
00071
00072 class StuProbabilityPidAlgorithm : public StPidAlgorithm {
00073
00074 public:
00075
00076 StuProbabilityPidAlgorithm(StEvent& ev);
00077 StuProbabilityPidAlgorithm();
00078
00079 virtual ~StuProbabilityPidAlgorithm();
00080
00081
00082
00083 StParticleDefinition* mostLikelihoodParticle();
00084 StParticleDefinition* secondLikelihoodParticle();
00085 StParticleDefinition* thirdLikelihoodParticle();
00086
00087 StParticleDefinition* getParticle(int i);
00088
00089
00090 int mostLikelihoodParticleGeantID() const;
00091 int secondLikelihoodParticleGeantID() const;
00092 int thirdLikelihoodParticleGeantID() const;
00093 int getParticleGeantID(int i) const;
00094
00095 double getProbability(int i);
00096 double mostLikelihoodProbability();
00097 double secondLikelihoodProbability();
00098 double thirdLikelihoodProbability();
00099
00100 double getCentrality(int theMult);
00101
00102 double beingPionMinusProb() const { return mPionMinusProb;}
00103 double beingElectronProb() const { return mElectronProb; }
00104 double beingKaonMinusProb() const { return mKaonMinusProb;}
00105 double beingAntiProtonProb() const { return mAntiProtonProb;}
00106
00107 double beingPionPlusProb() const { return mPionPlusProb; }
00108 double beingPositronProb() const { return mPositronProb; }
00109 double beingKaonPlusProb() const { return mKaonPlusProb; }
00110 double beingProtonProb() const { return mProtonProb; }
00111
00112 bool isExtrap();
00113
00114 StParticleDefinition*
00115 operator() (const StTrack&, const StSPtrVecTrackPidTraits&);
00116
00117 void processPIDAsFunction (double theCent, double theDca, int theCharge, double theRig, double theEta, int theNhits, double theDedx);
00118
00119 static void setDedxMethod(StDedxMethod method);
00120
00121 static void readParametersFromFile(TString fileName);
00122
00123 static bool isPIDTableRead();
00124
00125
00126
00127
00128 private:
00129
00130 void fillPIDByLookUpTable(double myCentrality, double myDca, int myCharge, double myRig, double myEta, int myNhits, double myDedx);
00131
00132 void fillPIDHypothis();
00133
00134
00135
00136 void fill(double prob, int geantId);
00137 void fillAsUnknown();
00138 void lowRigPID(double rig,double dedx,int theCharge);
00139
00140 double getCentrality_P01gl(int theMult);
00141 double getCentrality_P03ia_dAu(int theMult);
00142 int getCentralityBin(double theCent);
00143 int getCalibPosition(double theEta, int theNHits);
00144 void setCalibrations(double theEta, int theNhits);
00145
00146 StParticleTable* table;
00147
00148 int PID[4];
00149 double mProb[4];
00150
00151 bool mExtrap;
00152
00153 StEvent* mEvent;
00154
00155 double mPionMinusProb;
00156 double mElectronProb;
00157 double mKaonMinusProb;
00158 double mAntiProtonProb;
00159 double mPionPlusProb;
00160 double mPositronProb;
00161 double mKaonPlusProb;
00162 double mProtonProb;
00163
00165
00166
00167 static int thisMultBins;
00168 static int thisDcaBins;
00169 static int thisChargeBins;
00170
00171
00172 static int thisPBins;
00173 static int thisEtaBins;
00174 static int thisNHitsBins;
00175
00177
00178 static double thisDedxStart;
00179 static double thisDedxEnd;
00180 static double thisPStart;
00181 static double thisPEnd;
00182 static double thisEtaStart;
00183 static double thisEtaEnd;
00184 static double thisNHitsStart;
00185 static double thisNHitsEnd;
00186
00187 static bool mPIDTableRead;
00188
00189 static StDedxMethod mDedxMethod;
00190
00191 static TVectorD* mEAmp;
00192 static TVectorD* mECenter;
00193 static TVectorD* mESigma;
00194
00195 static TVectorD* mPiAmp;
00196 static TVectorD* mPiCenter;
00197 static TVectorD* mPiSigma;
00198
00199 static TVectorD* mKAmp;
00200 static TVectorD* mKCenter;
00201 static TVectorD* mKSigma;
00202
00203 static TVectorD* mPAmp;
00204 static TVectorD* mPCenter;
00205 static TVectorD* mPSigma;
00206
00207
00208 static TVectorD* mEqualyDividableRangeStartSet;
00209 static TVectorD* mEqualyDividableRangeEndSet;
00210 static TVectorD* mEqualyDividableRangeNBinsSet;
00211 static TVectorD* mNoEqualyDividableRangeNBinsSet;
00212
00213 static TVectorD* mMultiBinEdgeSet;
00214 static TVectorD* mDcaBinEdgeSet;
00215
00216
00217 static TVectorD* mBBPrePar;
00218 static TVectorD* mBBTurnOver;
00219 static TVectorD* mBBOffSet;
00220 static TVectorD* mBBScale;
00221 static TVectorD* mBBSaturate;
00222
00223
00224 static TObjString* mProductionTag;
00225
00226
00227 TF1* myBandBGFcn;
00228
00229 };
00230
00231 inline int StuProbabilityPidAlgorithm::mostLikelihoodParticleGeantID() const { return PID[0];}
00232 inline int StuProbabilityPidAlgorithm::secondLikelihoodParticleGeantID() const { return PID[1];}
00233 inline int StuProbabilityPidAlgorithm::thirdLikelihoodParticleGeantID() const { return PID[2];}
00234 inline int StuProbabilityPidAlgorithm::getParticleGeantID(int i) const {
00235 if (i<4 && i>=0) return PID[i]; else return -1;}
00236
00237 #endif
00238