#ifndef _CALDATAMAKER_HH_ #define _CALDATAMAKER_HH_ //////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Component: CalDataMaker.hh // Purpose: This is the class that makes the CalData object i.e. the // C++ object that represents the Run1 TOWE bank. // CalDataMaker knows how to make D to E conversions for the // calorimeter. It gets calibration constants // from the calibration database and uses them to convert D banks // into E "objects". // // Created: 06/06/99 Pierre Savard, based on CalBankMaker class by // Pasha Murat, Jodi Lamoureux. // History: 09/09/99 Pierre Savard: Accomodate new EDM // 06/21/03 Willis Sakumoto: standardize LER corrections // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// #include #include #include #include // ROOT Headers #include "TROOT.h" // CdfEdm2 Headers #include "StorableBanks/StorableBank.hh" #include "StorableBanks/ConstGrandBankIterI2s1.hh" #include "StorableBanks/GrandBankIterI2s1.hh" #include "Edm/EventRecord.hh" #include "Edm/GenericConstHandle.hh" #include "Edm/ConstHandle.hh" #include "Edm/Handle.hh" #include "CalorGeometry/TowerGeometry.hh" #include "CalorObjects/CalData.hh" #include "CalorObjects/Calib.hh" #include "CalorObjects/CalThresholds.hh" #include "CalorGeometry/CalConstants.hh" #include "CalorGeometry/CalParameters.hh" class AbsEvent; #include // namespace calor { class CalDataMaker { public: // // Memory management // CalDataMaker(); // constructors ~CalDataMaker(); // destructor // compiler generated default copy c'tor void initJob(); // init Run routine: // Load the calibration constants. void initRun(bool verbose); void initRun(bool verbose, bool accDB); void initRun(bool verbose, bool accDB, bool offScl); // event init and end routines. void initEvent(AbsEvent* Event); void initEvent(CalData* caldata); void endEvent(AbsEvent* Event, bool verbose); void endEvent(AbsEvent* Event, int skcut, float etmin, bool verbose); // convert calorimeter D banks to CalData. int makeCalData(AbsEvent *anEvent, bool verbose, bool threshold,bool plugGain, bool useMPALumiCalib); int makeCalData(AbsEvent *anEvent, bool verbose, bool threshold,bool plugGain); int makeCalData(AbsEvent *anEvent, bool verbose, bool threshold); int writeCalData(AbsEvent *anEvent, bool verbose); int makeDBanks(AbsEvent *anEvent, bool verbose); // method to add simulation energy to CalData void addSimEnergy(AbsEvent* anEvent,TowerKey& key, Detector tag, float energy0, float energy1); // // Testing // // // Manipulation and acces // Handle& contents() ; bool dbInitialized() const; // // Printing // // friend std::ostream& operator<<(std::ostream& os, const CalDataMaker& s); protected: void destroy() { } private: Handle _calData; Calib _calib; bool _dbInitialized; float cemCal[TENETA][TENPHI]; // Offline LERs WKS:21Jun03 float pemCal[TENETA][TENPHI]; float pprCal[TENETA][TENPHI]; float chaCal[TENETA][TENPHI]; float phaCal[TENETA][TENPHI]; float whaCal[TENETA][TENPHI]; }; // } // namespace calor inline Handle& CalDataMaker::contents() {return _calData;} inline bool CalDataMaker::dbInitialized() const {return _dbInitialized;} #endif // _CALDATAMAKER_HH_