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 #ifndef __StEmbeddingQAUtilities_h__
00035 #define __StEmbeddingQAUtilities_h__
00036
00037 class StParticleDefinition ;
00038 class TH1 ;
00039 #include <map>
00040 #include <vector>
00041 #include "TString.h"
00042 #include "StMiniMcEvent/StMiniMcEvent.h"
00043
00044
00045 namespace StEmbeddingQAConst
00046 {
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 enum {
00060 mNEmbedding = 5,
00061 mNReal = 2,
00062 mNCategory = mNEmbedding + mNReal
00063 };
00064 }
00065
00066
00067 class StEmbeddingQAUtilities {
00068 public:
00070 static StEmbeddingQAUtilities* instance();
00071
00073 virtual ~StEmbeddingQAUtilities();
00074
00075
00076 Category getCategory(const UInt_t id) const ;
00077 TString getCategoryName(const UInt_t id) const ;
00078 TString getCategoryTitle(const UInt_t id) const ;
00079 Int_t getCategoryId(const TString name) const ;
00080
00081
00082
00083 Bool_t isMc(const TString name) const ;
00084 Bool_t isMatched(const TString name) const ;
00085 Bool_t isGhost(const TString name) const ;
00086 Bool_t isContaminated(const TString name) const ;
00087 Bool_t isMatchedGlobal(const TString name) const ;
00088 Bool_t isPrimary(const TString name) const ;
00089 Bool_t isGlobal(const TString name) const ;
00090 Bool_t isEmbedding(const TString name) const ;
00091 Bool_t isReal(const TString name) const ;
00092
00093
00094 Bool_t isElectron(const Int_t geantid) const ;
00095 Bool_t isPositron(const Int_t geantid) const ;
00096 Bool_t isPiPlus(const Int_t geantid) const ;
00097 Bool_t isPiMinus(const Int_t geantid) const ;
00098 Bool_t isKPlus(const Int_t geantid) const ;
00099 Bool_t isKMinus(const Int_t geantid) const ;
00100 Bool_t isProton(const Int_t geantid) const ;
00101 Bool_t isPBar(const Int_t geantid) const ;
00102 Bool_t isElectrons(const Int_t geantid) const ;
00103 Bool_t isPions(const Int_t geantid) const ;
00104 Bool_t isKaons(const Int_t geantid) const ;
00105 Bool_t isProtons(const Int_t geantid) const ;
00106 Bool_t isEPiKP(const Int_t geantid) const ;
00107 Bool_t isGamma(const Int_t geantid) const ;
00108
00109
00110 void setStyle() const ;
00111 void setStyle(TH1* h) const ;
00112
00113
00114 Int_t getRunId(const Int_t runnumber, const Int_t year) const ;
00115 Int_t getRunNumber(const Int_t runid, const Int_t year) const ;
00116
00118 StParticleDefinition* getParticleDefinition(const UInt_t geantid) const ;
00119
00121 Bool_t isGeantIdOk(const UInt_t geantid) const ;
00122
00124 Int_t getGeantId(const UInt_t geantid) const ;
00125
00127 Float_t getPtMinCut() const ;
00128 Float_t getPtMaxCut() const ;
00129 Float_t getEtaCut() const ;
00130 Short_t getNHitCut() const ;
00131 Float_t getNHitToNPossCut() const ;
00132 Float_t getDcaCut() const ;
00133 Double_t getNSigmaCut() const ;
00134 Float_t getRapidityCut() const ;
00135 Float_t getZVertexCut() const ;
00136 Int_t getRefMultMinCut() const ;
00137 Int_t getRefMultMaxCut() const ;
00138 std::vector<UInt_t> getTriggerIdCut() const ;
00139
00141 Float_t setPtMinCut(const Float_t val) ;
00142 Float_t setPtMaxCut(const Float_t val) ;
00143 Float_t setEtaCut(const Float_t val) ;
00144 Short_t setNHitCut(const Short_t val) ;
00145 Float_t setNHitToNPossCut(const Float_t val) ;
00146 Float_t setDcaCut(const Float_t val) ;
00147 Double_t setNSigmaCut(const Double_t val) ;
00148 Float_t setRapidityCut(const Float_t val) ;
00149 Float_t setZVertexCut(const Float_t val) ;
00150 Int_t setRefMultMinCut(const Int_t val) ;
00151 Int_t setRefMultMaxCut(const Int_t val) ;
00152 void addTriggerIdCut(const UInt_t val) ;
00153
00155 Bool_t isPtOk(const Float_t pt) const ;
00156 Bool_t isEtaOk(const Float_t eta) const ;
00157 Bool_t isNHitsFitOk(const Float_t nHitsFit) const ;
00158 Bool_t isNHitToNPossOk(const Float_t ratio) const ;
00159 Bool_t isDcaOk(const Float_t dca) const ;
00160 Bool_t isNSigmaOk(const Float_t nsigma) const ;
00161 Bool_t isRapidityOk(const Float_t y) const ;
00162 Bool_t isZVertexOk(const Float_t vz) const ;
00163 Bool_t isRefMultOk(const Int_t refMult) const ;
00164 Bool_t isTriggerOk(const UInt_t trigger) const ;
00165
00167 void PrintCuts() const ;
00168
00169 private:
00171 StEmbeddingQAUtilities();
00172
00174 static StEmbeddingQAUtilities* mInstance ;
00175
00177 Bool_t CompareString(const TString s0, const TString s1, const Bool_t isExact=kFALSE) const ;
00178
00179
00180 Category mCategory[StEmbeddingQAConst::mNEmbedding] ;
00181 TString mCategoryName[StEmbeddingQAConst::mNCategory] ;
00182 TString mCategoryTitle[StEmbeddingQAConst::mNCategory] ;
00183 std::map<const TString, const UInt_t> mCategoryId ;
00184
00185
00186
00187
00188
00189 Float_t mPtMinCut ;
00190 Float_t mPtMaxCut ;
00191 Float_t mEtaCut ;
00192 Short_t mNHitCut ;
00193 Float_t mNHitToNPossCut ;
00194 Float_t mDcaCut ;
00195 Double_t mNSigmaCut ;
00196 Float_t mRapidityCut ;
00197 Float_t mZVertexCut ;
00198 Int_t mRefMultMinCut ;
00199 Int_t mRefMultMaxCut ;
00200 std::vector<UInt_t> mTriggerIdCut ;
00201
00202
00203
00204 Int_t getYearNumber(const Int_t year) const ;
00205
00207
00208 UInt_t convertGeantId(const UInt_t geantid) const ;
00209
00210 ClassDef(StEmbeddingQAUtilities, 1)
00211 };
00212
00213
00214 inline Int_t StEmbeddingQAUtilities::getYearNumber(const Int_t year) const { return (year - 1999) * 1000000 ; }
00215
00216
00217 inline Int_t StEmbeddingQAUtilities::getRunId(const Int_t runnumber, const Int_t year) const
00218 {
00219 return runnumber + getYearNumber(year) ;
00220 }
00221
00222
00223 inline Int_t StEmbeddingQAUtilities::getRunNumber(const Int_t runid, const Int_t year) const
00224 {
00225 return runid - getYearNumber(year) ;
00226 }
00227
00228 #endif
00229
00230