#ifndef TkProfile_h #define TkProfile_h 1 #include "marlin/Processor.h" #include "lcio.h" #include #include "TSystem.h" #include "TFile.h" #include "TH1.h" #include "TH2.h" #include "TTree.h" #include "TProfile.h" #include "TProfile2D.h" #include "TF1.h" #include "EVENT/SimCalorimeterHit.h" #include // Old scheme #define oldSHIFT_M 0 #define oldSHIFT_S 3 #define oldSHIFT_I 6 #define oldSHIFT_J 15 #define oldSHIFT_K 24 #define oldSHIFT_2 30 #define oldSHIFT_1 31 #define oldMASK_M (unsigned int) 0x00000007 #define oldMASK_S (unsigned int) 0x00000038 #define oldMASK_I (unsigned int) 0x00007FC0 #define oldMASK_J (unsigned int) 0x00FF8000 #define oldMASK_K (unsigned int) 0x3F000000 #define oldMASK_2 (unsigned int) 0x40000000 #define oldMASK_1 (unsigned int) 0x80000000 //New scheme #define newSHIFT_S 0 //Stave = 3 bits #define newSHIFT_M 3 //Module = 3 bits #define newSHIFT_K 6 //Layer = 6 bits #define newSHIFT_I 12 //Cell X index = 16 bits #define newSHIFT_Z 28 //Guard-ring zone = 3 bits #define newSHIFT_1 31 //Sign = 1 bit #define newSHIFT_J 0 //Cell Z index = 16 bits #define newSHIFT_P 16 //Provision = 15 bits #define newSHIFT_2 31 //Sign = 1 bit #define newMASK_S (unsigned int) 0x00000007 #define newMASK_M (unsigned int) 0x00000038 #define newMASK_K (unsigned int) 0x00000FC0 #define newMASK_I (unsigned int) 0x0FFFF000 #define newMASK_Z (unsigned int) 0x70000000 #define newMASK_1 (unsigned int) 0x80000000 #define newMASK_J (unsigned int) 0x0000FFFF #define newMASK_P (unsigned int) 0x7FFF0000 #define newMASK_2 (unsigned int) 0x80000000 using namespace lcio ; using namespace marlin ; /** Based on example processor for marlin. */ class TkProfile : public Processor { public: virtual Processor* newProcessor() { return new TkProfile ; } TkProfile() ; /** Called at the begin of the job before anything is read. * Use to initialize the processor, e.g. book histograms. */ virtual void init() ; /** Called for every run. */ virtual void processRunHeader( LCRunHeader* run ) ; /** Called for every event - the working horse. */ virtual void processEvent( LCEvent * evt ) ; virtual void loadHits( LCEvent * evt ) ; virtual void findImpactPoint( LCEvent * evt ) ; virtual void check( LCEvent * evt ) ; virtual void hcalPlot( LCEvent * evt ) ; /** Called after data processing for clean up. */ virtual void end() ; private: // the root file TFile* hfile ; // some histograms TH1F* h421; TH1F* h422; TH1F* h431; TH1F* h432; TH1F* h1431; TH1F* h1432; TH2F* h433; TH2F* h434; TH2F* h437; TH2F* h438; TProfile* h441; TProfile* h442; TProfile* h443; TProfile* h444; TProfile* h445; TProfile* h446; TH1F* h447; TH1F* h448; TH1F* h449; TH1F* h451; TH1F* h452; TH1F* h453; TH1F* h454; TH2F* h455; TH2F* h456; TH1F* h457; TH1F* h458; TH1F* h481; TH1F* h482; TH2F* h483; TH2F* h484; TH1F* h485; TH1F* h486; TProfile* h487; TProfile* h488; float Gain[19][19][31]; float Noise[19][19][31]; float Emap[19][19][31]; float Emin[19][19][31]; int hitIndex[19][19][31]; bool Isol[19][19][31]; int nWafer[3][3][31]; int nWaferEdge[3][3][31]; int nWaferEdge2[3][3][31]; float Epad[30][36]; float SEpad[30][36]; float SEpad2[30][36][36]; int Npad[30][36]; float SNpad[30][36]; float SNpad2[30][36][36]; int nEdge; int Nhits; int Nhcal; int Ntcmt; float Emip[10000]; float X[10000]; float Y[10000]; float Z[10000]; int IJK[10000]; float Etow[18][18]; int Itow[18][18]; float Eclu[50]; float Iclu[50]; float Jclu[50]; int Nclu; bool isMC ; float MIP; float emax; float Eveto; float ERawMin; float ERawMax; float EAhcMax; int Cerenkov; float Chi2Max; float TmaxMax; float Eraw; float Ehcal; float Etcmt; float Eraw2; float Eguard; float Eguard1; float Eguard2; float Eguard3; float xav; float yav; float zav; float Iav; float Jav; float Kav; float Zav; float XavH; float YavH; float slopex; float slopey; float Xbar; float Ybar; float Zbar; float Xmin; float Xmax; float Ymin; float Ymax; float Xrms; float Yrms; float rms18[4]; float chi2; float EcalSmear; float EcalMIP; float HcalMIP; float TcmtMIP; float EcalThresh; float HcalThresh; float TcmtThresh; float Ehit; float Rhit; float rrr; float phi; float xyz[3]; float xyzImpact[3]; float xyzAngle[2]; float xyzChisq[2]; float xyzNhit[2]; float xyzPosErr[2]; float Zlayer[30]; float Xlayer[30]; float Ylayer[30]; float Elayer[100]; bool HCAL; bool MIPset; int Piece; int WI; int WJ; int LayerMax; int HcalLayerMax; int GapMin; int GapMax; int WJMin; int I; int J; int K; int Index; int cellID; int cellID1; int GRZone; float Xoff; float Yoff; float Zoff; float LintLayer[100]; float X0Layer[100]; float LintTot[100]; float X0Tot[100]; FILE * pFile; protected: /** Input collection name. */ std::string _MCcolName ; std::string _EcalHitsColName ; std::string _HcalHitsColName ; std::string _TcmtHitsColName ; int _nRun ; int _nEvt ; int _beamEnergyMeV; } ; #endif