/** * \file CaloEnergy.h * \authors Emiliano Mocchiutti & Giovanna Jerse */ #ifndef caloenergy_h #define caloenergy_h #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /** * */ class CaloEnergy : public TObject { private: // PamLevel2 *L2; Bool_t debug; ///< debug flag // // needed to avoid reprocessing the same event over and over to obtain the variables // UInt_t OBT; ///< CPU OBT UInt_t PKT; ///< CPU packet number UInt_t atime; ///< event absolute time TString sntr; ///< string containing the list of section the user want to process UInt_t AOBT; ///< CPU OBT UInt_t APKT; ///< CPU packet number UInt_t aatime;///< event absolute time TString asntr;///< string containing the list of section the user want to process // Float_t fM; ///< margin in the strip direction Float_t fM1; ///< margin along the strip reading direction Int_t fPl; ///< number of dE/dx measurements over the maximum that are used to find the energy Float_t fConv_rxe; ///< MIP - energy conversion factor for section XE Float_t fConv_rxo; ///< MIP - energy conversion factor for section XO Float_t fConv_rye; ///< MIP - energy conversion factor for section YE Float_t fConv_ryo; ///< MIP - energy conversion factor for section YO Bool_t fLong; ///< if true use the integral of the longitudinal profile to measure the energy (NOT IMPLEMENTED YET), default FALSE // Float_t fEnergyxe; ///< Energy as measured by section XE Float_t fEnergyxo; ///< Energy as measured by section XO Float_t fEnergyye; ///< Energy as measured by section YE Float_t fEnergyyo; ///< Energy as measured by section YO Float_t fEnergy; ///< Energy as measured by the average of the used section in "Independent mode" or energy as measured by the used section in "Coherent mode" Float_t fCount; ///< Number of sections inside the acceptance (only the section given by the user are checked) Int_t fMax_planexe; ///< plane of maximum energy release (independent mode) or last plane used for energy measurement (coherent mode) for section XE Int_t fMax_planexo; ///< plane of maximum energy release (independent mode) or last plane used for energy measurement (coherent mode) for section XO Int_t fMax_planeyo; ///< plane of maximum energy release (independent mode) or last plane used for energy measurement (coherent mode) for section YO Int_t fMax_planeye; ///< plane of maximum energy release (independent mode) or last plane used for energy measurement (coherent mode) for section YE Float_t fMax_plane; ///< average max plane [0,11] (independent mode) or last plane for energy measurement [0,43] (coherent mode) // Float_t fXOen_maxplane; ///< total energy [MIP] used for energy determination as given by section XO Float_t fYOen_maxplane; ///< total energy [MIP] used for energy determination as given by section YO Float_t fXEen_maxplane; ///< total energy [MIP] used for energy determination as given by section XE Float_t fYEen_maxplane; ///< total energy [MIP] used for energy determination as given by section YE // Float_t xe1; ///< position of strip 1 section XE Float_t xe2; ///< position of strip 32 section XE Float_t xe3; ///< position of strip 33 section XE Float_t xe4; ///< position of strip 64 section XE Float_t xe5; ///< position of strip 65 section XE Float_t xe6; ///< position of strip 96 section XE // Float_t z1; Float_t yo1; ///< position of strip 1 section YO Float_t yo2; ///< position of strip 32 section YO Float_t yo3; ///< position of strip 33 section YO Float_t yo4; ///< position of strip 64 section YO Float_t yo5; ///< position of strip 65 section YO Float_t yo6; ///< position of strip 96 section YO // Float_t z2; Float_t xo1; ///< position of strip 1 section XO Float_t xo2; ///< position of strip 32 section XO Float_t xo3; ///< position of strip 33 section XO Float_t xo4; ///< position of strip 64 section XO Float_t xo5; ///< position of strip 65 section XO Float_t xo6; ///< position of strip 96 section XO // Float_t z3; Float_t ye1; ///< position of strip 1 section YE Float_t ye2; ///< position of strip 32 section YE Float_t ye3; ///< position of strip 33 section YE Float_t ye4; ///< position of strip 64 section YE Float_t ye5; ///< position of strip 65 section YE Float_t ye6; ///< position of strip 96 section YE // Float_t z4; Float_t trk_z[22][2]; ///< Z position of calorimeter planes Float_t en; ///< energy [mip] for decodeestrip Int_t view; ///< view for decodeestrip Int_t plane; ///< plane for decodeestrip Int_t strip; ///< strip for decodeestrip Int_t fRad; ///< Radius [strip] of the cylinder used to integrate the energy along the track, if negative radius is inf (the whole plane is used). Default: -1 Int_t fNumSec; ///< Number of sections given by the user Float_t energyxe; ///< 11 planes detected energy [MIP] for section XE Float_t energyyo; ///< 11 planes detected energy [MIP] for section YO Float_t energyxo; ///< 11 planes detected energy [MIP] for section XO Float_t energyye; ///< 11 planes detected energy [MIP] for section YE Float_t en_xep[11]; ///< detected energy [MIP] for each plane of section XE Float_t en_yop[11]; ///< detected energy [MIP] for each plane of section YO Float_t en_xop[11]; ///< detected energy [MIP] for each plane of section XO Float_t en_yep[11]; ///< detected energy [MIP] for each plane of section YE Float_t enstrip[2][22][96]; ///< detected energy [MIP] for each strip of calorimeter // Bool_t fXosel; ///< true if event is contained in section XO Bool_t fXesel; ///< true if event is contained in section XE Bool_t fYosel; ///< true if event is contained in section YO Bool_t fYesel; ///< true if event is contained in section YE Bool_t fSel; ///< true if event is contained in at least one of the given section (independet mode) or in all the given section (coherent mode) Bool_t fPartsel; ///< true if the event is contained only up to the last plane used for energy determination (can be used in conjunction with fXXmin) Int_t fXeout; ///< last plane [0,11] for which the trajectory is contained in section XE Int_t fYeout; ///< last plane [0,11] for which the trajectory is contained in section YE Int_t fXoout; ///< last plane [0,11] for which the trajectory is contained in section XO Int_t fYoout; ///< last plane [0,11] for which the trajectory is contained in section YO Int_t fXomin; ///< last plane [0,11] for which the trajectory MUST be contained in section XO. Default 1000 means all the planes, if less than 10 events can be only partially contained in a section (NB: THIS INTRODUCE AN ENERGY DEPENDENT SELECTION CONTAINMENT EFFICIENCY) Int_t fXemin; ///< last plane [0,11] for which the trajectory MUST be contained in section XE. Default 1000 means all the planes, if less than 10 events can be only partially contained in a section (NB: THIS INTRODUCE AN ENERGY DEPENDENT SELECTION CONTAINMENT EFFICIENCY) Int_t fYomin; ///< last plane [0,11] for which the trajectory MUST be contained in section YO. Default 1000 means all the planes, if less than 10 events can be only partially contained in a section (NB: THIS INTRODUCE AN ENERGY DEPENDENT SELECTION CONTAINMENT EFFICIENCY) Int_t fYemin; ///< last plane [0,11] for which the trajectory MUST be contained in section YE. Default 1000 means all the planes, if less than 10 events can be only partially contained in a section (NB: THIS INTRODUCE AN ENERGY DEPENDENT SELECTION CONTAINMENT EFFICIENCY) // Bool_t fSimu; ///< true if we are using simulated data, default false Bool_t indep; ///< flag to switch between INDEPENDENT or COHERENT mode, default false - COHERENT mode selected // CaloPreSampler *cp; ///< pointer to calopresampler object (object constructed only when invoking method UseCaloPreSampler() , default: use level2 data). // void DefineGeometry(); ///< called by constructors to fill geometrical variables (like xe1 etc). void Set(); ///< called by contructors to define default variables public: // CaloEnergy(); ///< default constructor (does nothing) CaloEnergy(PamLevel2 *L2); ///< constructor CaloEnergy(PamLevel2 *L2, Bool_t simulation); ///< constructor ~CaloEnergy(){ Delete(); }; ///< default destructor // void SetDebug(Bool_t d){ debug=d; }; ///< set the debug flag (verbose print-out on STDOUT), default is false // void Clear(); ///< clear varibles void Clear(Option_t *option){Clear();}; ///< compatibility with TObject void Delete(); ///< delete object void Delete(Option_t *option){Delete();}; ///< compatibility with TObject // void Process(); ///< Process the event void Process(TString section); ///< Process the event for section "section" void Print(); ///< Print variables on STDOUT void Print(Option_t *option){Print();}; ///< compatibility with TObject // Bool_t IsInsideAcceptance(TString section); ///< returns true if event is inside acceptance of the given sections (all if coherent mode, at least one in independent mode) Bool_t IsInsideReducedAcceptance(){return fPartsel;}; ///< returns true if the event is inside acceptance only up to the last used plane (see fXomin etc) // Bool_t IsInsideXE(){return(IsInsideAcceptance("XE"));}; Bool_t InsideXEcheck(){return fXesel;}; Bool_t IsInsideXO(){return(IsInsideAcceptance("XO"));}; Bool_t InsideXOcheck(){return fXosel;}; Bool_t IsInsideYE(){return(IsInsideAcceptance("YE"));}; Bool_t InsideYEcheck(){return fYesel;}; Bool_t IsInsideYO(){return(IsInsideAcceptance("YO"));}; Bool_t InsideYOcheck(){return fYosel;}; // Float_t GetEnergy(){ Process(); return fEnergy;}; ///< returns the energy [GV] determined for this event Float_t GetEnergy(TString section){ Process(section); return fEnergy;}; ///< returns the energy [GV] determined for this event Float_t GetCount(){ return fCount;}; ///< returns the number of section inside acceptance for this event (equal to the number of given section in coherent mode) // Float_t GetMaxplane(){ return fMax_plane;}; ///< returns the average max plane [0,11] (independent mode) or last plane for energy measurement [0,43] (coherent mode) // Float_t GetMaxEnergy(){ return((fXEen_maxplane+fYOen_maxplane+fYEen_maxplane+fXOen_maxplane));}; ///< returns the total energy [MIP] before conversion Float_t GetMaxEnergy(TString section); ///< returns the total energy [MIP] before conversion for section "section" Int_t GetMaxplane(TString section); ///< returns the plane of maximum (independent mode) or the last used plane (coherent mode) for section "section" // void UseLongitudinalFitEnergy(){ fPl = 0; fLong = true;}; ///< use or not the longitudinal fit to determine the energy (NOT IMPLEMENTED YET) void UseMeasuredEnergyUpToMax(){ fLong = false;}; ///< use the measured energy to determine the maximum (default) // void SetMargin(Float_t margin){fM = margin + 0.096; fM1 = margin - 0.122 - 0.096; if ( fM1 < 0. ) fM1 = 0.;}; ///< set the margin from the border of the silicon sensor (not from the first strip), set the same margin for both the directions void SetMarginStripDirection(Float_t margin){fM = margin + 0.096;}; ///< set the margin from the border of the silicon sensor (not from the first strip) in the strip direction void SetMarginStripReading(Float_t margin){fM1 = margin -0.122 - 0.096;}; ///< set the margin from the border of the silicon sensor (not from the first strip) in the strip reading direction void SetRadius(Int_t strip){fRad = strip;}; ///< set the radius of the cylinder void SetMaxPlaneOffset(Int_t noplanes){fPl = noplanes;}; ///< set the number of dE/dx measurements to be used after the maximum // void SetMinimumContainment(Int_t plane); ///< set the last plane [0,11] for which the trajectory MUST be contained in all the sections. Default 1000 means all the planes, if less than 10 events can be only partially contained in a section (NB: THIS INTRODUCE AN ENERGY DEPENDENT SELECTION CONTAINMENT EFFICIENCY) void SetMinimumContainment(TString section, Int_t plane); ///< set the last plane [0,11] for which the trajectory MUST be contained in section "section". Default 1000 means all the planes, if less than 10 events can be only partially contained in a section (NB: THIS INTRODUCE AN ENERGY DEPENDENT SELECTION CONTAINMENT EFFICIENCY) Int_t GetMinimumContainment(TString section); ///< get the last plane [0,11] for which the trajectory MUST be contained in section "section". // void SetConversionFactor(Float_t conv_r); ///< Set the MIP-GV conversion factor for all the four sections. void SetConversionFactor(TString section, Float_t conv_r); ///< Set the MIP-GV conversion factor for section "section". Float_t GetConversionFactor(TString section); ///< Get the MIP-GV conversion factor for section "section". // void IndependentMode(){ indep = true; }; ///< Set the independent mode void CoherentMode(){ indep = false; }; ///< Set the coherent mode // void UseCaloPreSampler(); ///< use pre-sampler routine to refit the track (level2 default fitting could be wrong, in this case we force "shower fitting" in the DV library). CaloPreSampler* GetCaloPreSampler(){return cp;}; ///< Get pre-sampler object. // ClassDef(CaloEnergy,1); }; #endif