#ifndef __HPARTICLEPID_H__ #define __HPARTICLEPID_H__ #include "hparticletool.h" #include "TObject.h" #include #include #include using namespace std; class HVirtualCand; class HParticleCand; class HParticleCandSim; class momCut { public: Float_t min; Float_t max; Int_t id; momCut(Int_t Id=2, Float_t Min=0,Float_t Max=3000){ id = Id; min = Min; max = Max; } void setCut(Int_t Id=2, Float_t Min=0,Float_t Max=3000){ id = Id; min = Min; max = Max; } Bool_t eval(Float_t mom){ return (mom > min && mom < max) ? kTRUE: kFALSE; } }; typedef struct { Int_t id; Bool_t is; Float_t deltaTime; Float_t sigmaTime; Float_t normTime; Float_t deltadEdx; Float_t sigmadEdx; Float_t normdEdx; Float_t norm; void clear() { id = -1; is = kFALSE; deltaTime = 999.; sigmaTime = 0.1; normTime = 9999.; deltadEdx = 999.; sigmadEdx = 0.1; normdEdx = 9999.; norm = 9999.; } } pidvalues; class HParticlePID : public TObject { typedef struct { map sys[2]; // set of momentum cuts per system } sysList; vector vparticle; // all known ids map mIdToIndex; // map id to index in vector vector vcutList; // list of sets of momentum cuts Float_t nsigma ; // n sigma selection for HParticleTool::isParticleBeta() Float_t rkchi2cut; // n sigma selection for HParticleTool::isParticleBeta() TString beamtime; // default apr12 :string for beam time selection of HParticleTool::isParticleBeta() void createPIDS(); public: HParticlePID(TString beam = "apr12"); ~HParticlePID(); void setNSigma(Float_t nsig) { nsigma = nsig; } void setBeamTime(TString beam) { beamtime = beam;} void setRKChi2Cut(Float_t cut) { rkchi2cut = cut; } Float_t getNSigma() { return nsigma; } TString getBeamTime() { return beamtime;} Float_t getRKChi2Cut() { return rkchi2cut; } UInt_t getNVersions() { return vcutList.size(); } void resetPIDS(); Bool_t addPID(Int_t id,Float_t min0,Float_t max0,Float_t min1,Float_t max1,UInt_t version = 0); Int_t checkPIDS(HParticleCand* pCand,vector& vValues, UInt_t version = 0); void print(); ClassDef(HParticlePID,0) }; #endif //__HPARTICLEPID_H__