#ifndef HRPCDIGITIZER_H #define HRPCDIGITIZER_H #include "hreconstructor.h" #include "hlocation.h" #include #include using namespace std; class HIterator; class HCategory; class HRpcGeomCellPar; class HRpcDigiPar; class HRpcDigitizer : public HReconstructor { private: //--------------------------------------------------------------- // define some helper strutures typedef struct gaptrack { // stores all needed infos per gap Float_t gtime; // GEANT time (used for sorting) Float_t time ; // smeared time Float_t charge; // charge Int_t track; // GEANT track number at the box Int_t trackDgtr; // GEANT track number at the gap Int_t ref; // index in category for hit at box Int_t refDgtr; // index in category for hit at gap Bool_t isAtBox; // kTRUE if track is at box void reset(){ // put initial values. charge = 0.; gtime = 10000.; time = 10000.; track = -1; trackDgtr= -1; ref = -1; refDgtr = -1; isAtBox = kFALSE; } Bool_t static cmpTime(gaptrack* a, gaptrack* b) { // sort by time in increasing order return a->gtime < b->gtime; } } gaptrack; typedef struct { // collection of all gaptracks per cell Short_t linIndex; // linear index in working array (= sector * maxCol * maxCell + column * maxCell + cell ) Short_t sec; // sector Short_t col; // column Short_t cell; // cell vector right;// gaptracks stored according to right side of the cell vector left; // gaptracks stored according to left side of the cell void reset(){ // put initial values. deletes right/left vector linIndex= -1; sec = -1; col = -1; cell = -1; for(UInt_t i=0;i right side) if(isRight) std::sort(right.begin(),right.end(),gaptrack::cmpTime); else std::sort(left .begin(),left .end(),gaptrack::cmpTime); } Float_t getSumCharge(Bool_t isRight){ // get the sum of charge in all gaps (isRight=kTRUE -> right side) Float_t chrg = 0.; if(isRight) {for(UInt_t i=0;icharge; } return chrg;} else {for(UInt_t i=0;icharge; } return chrg;} } Float_t getSmallestTof(Bool_t isRight){// get the smallest digizied TOF of all gaps (isRight=kTRUE -> right side) Float_t time = 10000.; if(isRight) {for(UInt_t i=0;itime < time) time = right[i]->time; } return time;} else {for(UInt_t i=0;itime < time) time = left [i]->time; } return time;} } } rpcdat; //--------------------------------------------------------------- HLocation fLoc; //! Location for new object HCategory* fGeantRpcCat; //! Pointer to Rpc Geant data category HCategory* fCalCat; //! Pointer to Cal data category HCategory* fKineCat; //! Pointer to Kine data category HRpcGeomCellPar* fGeomCellPar; //! Geometrical parameters HRpcDigiPar* fDigiPar; //! Digitization parameters HIterator* iterGeantRpc; //! Iterator over catRpcGeantRaw category HIterator* iterRpcCal; //! Iterator over HRpcCalSim category Int_t maxCol ; //! Int_t maxCell ; //! vector rpcobjects; //! temporary working array void clearObjects(); Int_t findMother(Int_t Ref_initial); void initVars(); Bool_t initParContainer(); public: HRpcDigitizer(void); HRpcDigitizer(const Text_t* name,const Text_t* title); ~HRpcDigitizer(void); Bool_t init (void); Bool_t finalize(void) {return kTRUE;} Int_t execute (void); ClassDef(HRpcDigitizer,0) //Digitizer of RPC data. }; #endif