#ifndef OACALIBCALIBAPPLYBASE_ICALIBAPPLYEVENTFUNCTION_HXX #define OACALIBCALIBAPPLYBASE_ICALIBAPPLYEVENTFUNCTION_HXX #include "IVEventFunction.hxx" #include "EoaCalibRecon.hxx" /// A base class to apply calibration constants to IDigits to create IHits /// /// It is assumeed that a derived concrete class is specified for each sub-detector (CDC, ECAL, etc). /// The purpose of this class is to make the calib. apply code structure simple and easy /// and this is called by the CalibApplyGlobal's event loop function for each event. class ICalibApplyEventFunction : public IVEventFunction { public: ICalibApplyEventFunction (const Char_t* name = ""); virtual ~ICalibApplyEventFunction (); /// Return trace name for all calib. apply packages for debugging. const Char_t* GetFullName() { return Form("CalibApply%s", GetName()); } /// Print the usage of CommonOptions for the calib. apply packages. static void UsageOfCommonOptions(); protected: /// Apply calibration to IDigits /// /// Any optional configuration should be done in BeginOfEvent(), /// SetOption(), or the constructor. /// @return the error code that indicates some error happened when != 0. virtual int ApplyCalibration(COMET::ICOMETEvent& event); /// Process an event with sequential for a /// This is called by the CalibApplyGlobal's event loop /// /// Nobody can over-ride, Developer is expected to implement the separated classes, /// BeginOfEvent(), ApplyCalibration(), and EndOfEvent(). /// @return the error code that indicates some error happened when != 0. int ProcessCore(COMET::ICOMETEvent& event); /// Add IHitSelection to ICOMETEvent's /hits/ directory void AddHitSelection(COMET::IHitSelection* hits, COMET::ICOMETEvent& event) { event.Get("hits")->push_back(hits); } private: /// Only function specific option whose argument string is common among all /// the derived recon event functions. bool SetCommonOption(TString option, TString value = ""); }; #endif