#ifndef HITOFDIGITIZER_H #define HITOFDIGITIZER_H #include "hreconstructor.h" #include "hlocation.h" #include "hitofdigitpar.h" #include "hitofgeompar.h" // ITOFNPMT,ITOFMAXCELL #include "hspecgeompar.h" #include "TObjArray.h" #include #include #include #include using namespace std; class HIterator; class HCategory; class HLinearCategory; class HGeantTof; typedef struct { Int_t s; Int_t c; Int_t numTrack; // geant track num Int_t numFirstTrack; // geant track num entered first in iTOF Float_t geaTof; // geant Tof Float_t geaEloss; // geant energy loss Float_t geaX; // x coordinate of geant hit Float_t geaY; // y coordinate of geant hit Float_t distPMT; // calculated dist from geant hit to PMT Float_t distPMTAll[ITOFNPMT]; // calculated dist from geant hit to PMT for all PMTs Float_t propTime; // time of propagation for distPMT Float_t resSmear; // resolution smearing Float_t tdcTime; // final time at the tdc : geaTof + propTime + resSmear - startTime Float_t startTime; // start time Float_t eloss; // final eloss at the tdc void clear(){ s = 0; c = 0; numTrack = 0; numFirstTrack = 0; geaTof = 0; geaEloss = 0; geaX = 0; geaY = 0; distPMT = 0; for(Int_t i = 0 ; i < ITOFNPMT; i++) distPMTAll[i] = 10000; propTime = 0; resSmear = 0; tdcTime = 0; startTime = 0; eloss = 0; }; void print(){ cout<<"s " < vmeasurements; void clear(){ vmeasurements.clear(); } } cellhits; class HiTofDigitizer : public HReconstructor { private: HLocation fLoc; //! Location for new object HCategory* fGeantCat; //! Pointer to HGeant data category HCategory* fCalCat; //! Pointer to Cal data category HCategory* fStartHitCat; //! Pointer to StartHit data category HLinearCategory* fGeantKineCat;//! Pointer to GeantKine data category HIterator* iterGeant; //! Iterator over HGeantTof category HIterator* iterCal; //! Iterator over HiTofCalSim category HiTofDigitPar* piTofDigitPar; //! Digit parameters HiTofGeomPar* piTofGeomPar; //! Geometry parameters HSpecGeomPar* pSpecGeomPar; //! Geometry parameters Spectrometer (sector trans) Float_t fstartTimeSmearing; //! implementing StartHit resolution cellhits fcellhits[6][ITOFMAXCELL];//! temporary array //-------------------------------------------------------------------------- Int_t storeFirstTrack; //! flag: // 0 = realistic (secondaries included) // 1 primary particle is stored // 2 (default) the track number entering the tof in SAME SECTOR is stored , not the // secondaries created in TOF itself (delta electrons etc) // 3 as 2 but condition on SAME CELL static HiTofDigitizer* piTofDigi;//! pointer to this Int_t findFirstHitIniTof(HGeantTof* pOld,HGeantTof** pNew); void fillArray(void); void fillOutput(void); Float_t calcDistToPMT(Float_t distPMT[],Int_t s,Int_t cell,Float_t geaX,Float_t geaY); static Bool_t sortTime(tofmeasurement&, tofmeasurement&); public: HiTofDigitizer(const Text_t* name = "iTofDigitizer",const Text_t* title = "iTofDigitizer"); ~HiTofDigitizer(void); Bool_t init(void); Bool_t reinit(void); Bool_t finalize(void); Int_t execute(void); void setStoreFirstTrack(Int_t flag) { storeFirstTrack = flag; } static HiTofDigitizer* getiTofDigtizer(){ return piTofDigi; } ClassDef(HiTofDigitizer,0) // Digitizer for iTOF HGeant hits }; #endif