#ifndef HPARTICLESTART2HITF_H #define HPARTICLESTART2HITF_H #include "hlocation.h" #include "hreconstructor.h" #include "hitofcalpar.h" #include "TNtuple.h" #include "TFile.h" #include using namespace std; class HCategory; class HParticleStart2HitF : public HReconstructor { private: HCategory* fCatTof; //! pointer to the tof hit data HCategory* fCatTofClu; //! pointer to the tof cluster data HCategory* fCatRpc; //! pointer to the rpc hit data HCategory* fCatRpcClu; //! pointer to the rpc cluster data HCategory* fCatStartCal; //! pointer to the start cal data HCategory* fCatStartHit; //! pointer to the start hit data HCategory* fitofRawCat; //! pointer to the start hit data HCategory* fcandCat; //! pointer to Particle cand category HCategory* fEmcCalCat; //! pointer to Particle cand category HCategory* fEmcClusterCat; //! pointer to Particle cand category HiTofCalPar* fpiTofCalPar; TNtuple *nt1; //! Debug ntuple 1 (original tofs) TNtuple *nt2; //! Debug ntuple 2 (start time for both modules) TNtuple *nt3; //! Debug ntuple 3 (reconstructed start times) TFile *out; //! Output file for debug Bool_t bDebug; //! Flag to store debug ntuples Float_t startTimeOriginal; //! Start time from original HStart2Hit Int_t startFlag; //! flag of reconstruction method (-1,0,1,2) Float_t timeCutR; //! cut right time window to search for new hit Float_t timeCutL; //! cut left time window to search for new hit vector firstCluster; // all strips inside 0.5 ns arround best strip vector secondCluster; // all other strip not in first cluster Float_t fSecondTime; // closest second time Int_t fVersion; //! version 0 : HADES::kApr12 --- HADES::kMar19 , version 1 HADES::kFeb22 Int_t candCounter[18]; //! cound ParticleCands per iTof paddle Float_t findMinimumTime(Int_t numOfMetaHits=3); // find the minimum time-of-flight Float_t findOriginalStartTime(void);// find start time from HStart2Hit category Float_t findStartTime(Float_t tof); // find the proper start time Float_t findStartTimeMaxToT(Float_t tof); // find the proper start time Float_t findStartTime_LGAD(Float_t tof,Float_t oldStartTime); // find the proper start time void correctTof(Float_t corrTime); // modify the HTofHit tof void correctRpc(Float_t corrTime); // modify the HRpcHit tof void correctEmc(Float_t corrTime); // modify the HEmcCal and HEmcCluster tof void correctStart(Float_t corrTime);// modify the HStart2Hit time void correctParticleCand(Float_t t0_corretion); void countParticlesInItofPaddles(); Float_t findStartTime_LGAD_itof_ParticleCand(Float_t oldStartHitTime, Int_t oldStartFlag); Int_t findiTOFIndex_Raw(Int_t sector, Double_t phi,Float_t originalToF, Float_t oldStartTime,Float_t theta); void fillClusterInfo_LGAD(Int_t hitInfoMod0,Int_t hitInforMod1, Float_t expetectedT0, Float_t timeWindow ); void setDebug(Bool_t mode = kTRUE) { bDebug = mode; }; public: HParticleStart2HitF(void); HParticleStart2HitF(const Text_t* name, const Text_t* title, Bool_t skip = kFALSE); ~HParticleStart2HitF(void) {} Bool_t init(void); Int_t execute(void); Bool_t finalize(void); void setTimeCut(Float_t cutL=5,Float_t cutR=15){ timeCutL = cutL; timeCutR = cutR; } ClassDef(HParticleStart2HitF, 0) // Hit finder for START2 detector suing META hits }; #endif /* !HPARTICLESTART2HITF_H */