#include <CalibParamAlg.h>
Inheritance diagram for CalibParamAlg:
Public Member Functions | |
CalibParamAlg (const std::string &name, ISvcLocator *pSvcLocator) | |
virtual | ~CalibParamAlg () |
virtual StatusCode | initialize () |
virtual StatusCode | execute () |
virtual StatusCode | finalize () |
virtual StatusCode | sysExecute () |
void | put (IDataProviderSvc *svc, DataObject *object, const std::string &address, const bool useRootInTES=true) const |
void | put (DataObject *object, const std::string &address, const bool useRootInTES=true) const |
Gaudi::Utils::GetData< TYPE >::return_type | get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
Gaudi::Utils::GetData< TYPE >::return_type | get (const std::string &location, const bool useRootInTES=true) const |
TYPE * | getDet (IDataProviderSvc *svc, const std::string &location) const |
TYPE * | getDet (const std::string &location) const |
bool | exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
bool | exist (const std::string &location, const bool useRootInTES=true) const |
bool | existDet (IDataProviderSvc *svc, const std::string &location) const |
bool | existDet (const std::string &location) const |
TYPE * | getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
TYPE * | getOrCreate (const std::string &location, const bool useRootInTES=true) const |
bool | registerContext () const |
INTupleSvc * | evtColSvc () const |
IAlgContextSvc * | contextSvc () const |
TOOL * | tool (const std::string &type, const std::string &name, const IInterface *parent=0, bool create=true) const |
TOOL * | tool (const std::string &type, const IInterface *parent=0, bool create=true) const |
SERVICE * | svc (const std::string &name, const bool create=true) const |
IUpdateManagerSvc * | updMgrSvc () const |
IDataProviderSvc * | fastContainersSvc () const |
StatusCode | Error (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const |
StatusCode | Warning (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const |
StatusCode | Print (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const MSG::Level lev=MSG::INFO) const |
StatusCode | Assert (const bool ok, const std::string &message="", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
StatusCode | Assert (const bool ok, const char *message, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
StatusCode | Exception (const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
StatusCode | Exception (const std::string &msg, const std::exception &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
StatusCode | Exception (const std::string &msg="no message", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
MsgStream & | msgStream (const MSG::Level level) const |
MsgStream & | always () const |
MsgStream & | fatal () const |
MsgStream & | err () const |
MsgStream & | error () const |
MsgStream & | warning () const |
MsgStream & | info () const |
MsgStream & | debug () const |
MsgStream & | verbose () const |
MsgStream & | msg () const |
const Statistics & | counters () const |
StatEntity & | counter (const std::string &tag) const |
MSG::Level | msgLevel () const |
bool | msgLevel (const MSG::Level level) const |
void | resetMsgStream () const |
bool | typePrint () const |
bool | propsPrint () const |
bool | statPrint () const |
bool | errorsPrint () const |
long | printStat (const MSG::Level level=MSG::ALWAYS) const |
long | printErrors (const MSG::Level level=MSG::ALWAYS) const |
long | printProps (const MSG::Level level=MSG::ALWAYS) const |
void | registerCondition (const std::string &condition, StatusCode(CallerClass::*mf)()=NULL) |
void | registerCondition (const std::string &condition, CondType *&condPtrDest, StatusCode(CallerClass::*mf)()=NULL) |
void | registerCondition (char *condition, StatusCode(CallerClass::*mf)()=NULL) |
void | registerCondition (TargetClass *condition, StatusCode(CallerClass::*mf)()=NULL) |
StatusCode | runUpdate () |
TransientFastContainer< T > * | getFastContainer (const std::string &location, typename TransientFastContainer< T >::size_type initial=0) |
StatusCode | release (const IInterface *interface) const |
unsigned long | release () |
const std::string & | context () const |
const std::string & | rootInTES () const |
double | globalTimeOffset () const |
virtual StatusCode | sysStart () |
virtual StatusCode | sysInitialize () |
virtual StatusCode | sysReinitialize () |
virtual StatusCode | sysRestart () |
virtual StatusCode | sysStop () |
virtual StatusCode | sysFinalize () |
virtual StatusCode | sysBeginRun () |
virtual StatusCode | sysEndRun () |
virtual const std::string & | name () const |
virtual const std::string & | version () const |
virtual StatusCode | configure () |
virtual StatusCode | terminate () |
virtual StatusCode | start () |
virtual StatusCode | stop () |
virtual StatusCode | reinitialize () |
virtual StatusCode | restart () |
virtual bool | isExecuted () const |
virtual void | setExecuted (bool state) |
virtual void | resetExecuted () |
virtual StatusCode | beginRun () |
virtual StatusCode | endRun () |
virtual Gaudi::StateMachine::State | FSMState () const |
virtual Gaudi::StateMachine::State | targetFSMState () const |
virtual bool | isEnabled () const |
virtual bool | filterPassed () const |
virtual void | setFilterPassed (bool state) |
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const |
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const |
void | setOutputLevel (int level) |
IAuditorSvc * | auditorSvc () const |
IChronoStatSvc * | chronoSvc () const |
IChronoStatSvc * | chronoStatService () const |
IDataProviderSvc * | detSvc () const |
IDataProviderSvc * | detDataService () const |
IConversionSvc * | detCnvSvc () const |
IConversionSvc * | detDataCnvService () const |
IDataProviderSvc * | eventSvc () const |
IDataProviderSvc * | evtSvc () const |
IDataProviderSvc * | eventDataService () const |
IConversionSvc * | eventCnvSvc () const |
IConversionSvc * | eventDataCnvService () const |
IHistogramSvc * | histoSvc () const |
IHistogramSvc * | histogramDataService () const |
IMessageSvc * | msgSvc () const |
IMessageSvc * | messageService () const |
INTupleSvc * | ntupleSvc () const |
INTupleSvc * | ntupleService () const |
IRndmGenSvc * | randSvc () const |
IToolSvc * | toolSvc () const |
IExceptionSvc * | exceptionSvc () const |
ISvcLocator * | serviceLocator () const |
ISvcLocator * | svcLoc () const |
StatusCode | createSubAlgorithm (const std::string &type, const std::string &name, Algorithm *&pSubAlg) |
std::vector< Algorithm * > * | subAlgorithms () const |
virtual StatusCode | setProperty (const Property &p) |
virtual StatusCode | setProperty (const std::string &s) |
virtual StatusCode | setProperty (const std::string &n, const std::string &v) |
StatusCode | setProperty (const std::string &name, const TYPE &value) |
virtual StatusCode | getProperty (Property *p) const |
virtual const Property & | getProperty (const std::string &name) const |
virtual StatusCode | getProperty (const std::string &n, std::string &v) const |
virtual const std::vector< Property * > & | getProperties () const |
StatusCode | setProperties () |
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const |
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const |
IMonitorSvc * | monitorSvc () const |
void | declareInfo (const std::string &name, const T &var, const std::string &desc) const |
void | declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const |
unsigned long | addRef () |
StatusCode | queryInterface (const InterfaceID &riid, void **) |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
Public Attributes | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
Protected Types | |
typedef std::map< std::string, StatEntity > | Statistics |
typedef std::map< std::string, unsigned int > | Counter |
typedef std::vector< IAlgTool * > | AlgTools |
typedef std::pair< IInterface *, std::string > | ServiceEntry |
typedef std::vector< ServiceEntry > | Services |
Protected Member Functions | |
StatusCode | releaseTool (const IAlgTool *tool) const |
StatusCode | releaseSvc (const IInterface *svc) const |
bool | isInitialized () const |
bool | isFinalized () const |
int | outputLevel () const |
IntegerProperty & | outputLevelProperty () |
void | initOutputLevel (Property &prop) |
Static Protected Attributes | |
static const bool | IgnoreRootInTES |
static const bool | UseRootInTES |
Private Attributes | |
std::string | m_readoutLocation |
Property ReadoutLocation - location in TES where the input ReadoutHeader is to be found. | |
std::vector< std::string > | m_pmtToolNames |
std::vector< std::string > | m_rpcToolNames |
std::vector< IPmtCalibParamTool * > | m_pmtTools |
std::vector< IRpcCalibParamTool * > | m_rpcTools |
bool | m_useFloatFeePedes |
std::string | m_floatFeePedesSvcName |
IFloatingFeePedestalSvc * | m_floatFeePedesSvc |
TimeStamp | m_beginTime |
TimeStamp | m_endTime |
Definition at line 21 of file CalibParamAlg.h.
CalibParamAlg::CalibParamAlg | ( | const std::string & | name, | |
ISvcLocator * | pSvcLocator | |||
) |
Definition at line 15 of file CalibParamAlg.cc.
00016 : GaudiAlgorithm(name,pSvcLocator) 00017 , m_pmtTools(0) 00018 , m_rpcTools(0) 00019 { 00020 declareProperty("ReadoutLocation", 00021 m_readoutLocation=DayaBay::ReadoutHeaderLocation::Default, 00022 "Location in the TES where the input ReadoutHeader is to be found."); 00023 declareProperty("PmtTools",m_pmtToolNames, 00024 "Names of the PMT calibration tools"); 00025 declareProperty("RpcTools",m_rpcToolNames, 00026 "Names of the RPC calibration tools"); 00027 declareProperty("UseFloatFeePedes",m_useFloatFeePedes=false, 00028 "Use FloatFeePedes or not? In case of false, it will use CalibSvc."); 00029 declareProperty("FloatingFeePedestalSvcName",m_floatFeePedesSvcName="FloatingFeePedestalSvc", 00030 "Name of service to access floating FEE channel baselines"); 00031 }
CalibParamAlg::~CalibParamAlg | ( | ) | [virtual] |
StatusCode CalibParamAlg::initialize | ( | ) | [virtual] |
Reimplemented from GaudiAlgorithm.
Definition at line 37 of file CalibParamAlg.cc.
00038 { 00039 StatusCode sc = this->GaudiAlgorithm::initialize(); 00040 if( sc != StatusCode::SUCCESS ) return sc; 00041 00042 { 00043 // Get PMT Calibration tools 00044 std::vector<std::string>::iterator toolIter, toolEnd=m_pmtToolNames.end(); 00045 for(toolIter=m_pmtToolNames.begin(); toolIter != toolEnd; toolIter++){ 00046 std::string toolName = *toolIter; 00047 IPmtCalibParamTool* calibTool = 0; 00048 try { 00049 calibTool = tool<IPmtCalibParamTool>(toolName); 00050 } 00051 catch(const GaudiException& exg) { 00052 fatal() << "Failed to get pmt calib tool: \"" << toolName << "\"" 00053 << endreq; 00054 return StatusCode::FAILURE; 00055 } 00056 m_pmtTools.push_back(calibTool); 00057 info () << "Added pmt calib tool " << toolName << endreq; 00058 } 00059 } 00060 00061 { 00062 // Get RPC Calibration tools 00063 std::vector<std::string>::iterator toolIter, toolEnd=m_rpcToolNames.end(); 00064 for(toolIter=m_rpcToolNames.begin(); toolIter != toolEnd; toolIter++){ 00065 std::string toolName = *toolIter; 00066 IRpcCalibParamTool* calibTool = 0; 00067 try { 00068 calibTool = tool<IRpcCalibParamTool>(toolName); 00069 } 00070 catch(const GaudiException& exg) { 00071 fatal() << "Failed to get rpc calib tool: \"" << toolName << "\"" 00072 << endreq; 00073 return StatusCode::FAILURE; 00074 } 00075 m_rpcTools.push_back(calibTool); 00076 info () << "Added rpc calib tool " << toolName << endreq; 00077 } 00078 } 00079 00080 if(m_useFloatFeePedes){ 00081 // Get floating fee pedestal service 00082 m_floatFeePedesSvc = svc<IFloatingFeePedestalSvc>(m_floatFeePedesSvcName,true); 00083 if(!m_floatFeePedesSvc){ 00084 error() << "Failed to access FloatingFeePedestalSvc: " << m_floatFeePedesSvcName << endreq; 00085 return StatusCode::FAILURE; 00086 } 00087 } 00088 00089 return StatusCode::SUCCESS; 00090 }
StatusCode CalibParamAlg::execute | ( | ) | [virtual] |
Reimplemented from GaudiAlgorithm.
Definition at line 92 of file CalibParamAlg.cc.
00093 { 00094 debug() << "calling execute()" << endreq; 00095 // Get input header 00096 DayaBay::ReadoutHeader* readoutHeader = 00097 get<DayaBay::ReadoutHeader>(m_readoutLocation); 00098 00099 if(m_useFloatFeePedes){ 00100 // Drop a readoutHeader for pedestal calculation 00101 StatusCode sc = m_floatFeePedesSvc->cumulate( readoutHeader ); 00102 if( sc.isFailure() ) { 00103 return sc; 00104 } 00105 } 00106 00107 TimeStamp trigTime = readoutHeader->timeStamp(); 00108 static bool first=true; 00109 if(first) { 00110 m_beginTime = trigTime; 00111 first = false; 00112 } 00113 m_endTime = trigTime; 00114 00115 DayaBay::Detector det(readoutHeader->context().GetSite(), 00116 readoutHeader->context().GetDetId()); 00117 debug() << "Got readout from " << det.detName() <<" id= " 00118 << det.siteDetPackedData() <<endreq; 00119 00120 if(det.isAD() || det.isWaterShield()){ 00121 // Loop over each PMT calibration tool 00122 std::vector<IPmtCalibParamTool*>::iterator toolIter, 00123 toolEnd=m_pmtTools.end(); 00124 for(toolIter=m_pmtTools.begin(); toolIter != toolEnd; toolIter++){ 00125 IPmtCalibParamTool* calibTool = *toolIter; 00126 StatusCode sc = calibTool->process(*readoutHeader); 00127 if( sc != StatusCode::SUCCESS ) return sc; 00128 } 00129 00130 }else if(det.detectorId() == DetectorId::kRPC){ 00131 // Process RPC readout 00132 debug() << "Processing RPC readout" <<endreq; 00133 // Loop over each RPC calibration tool 00134 std::vector<IRpcCalibParamTool*>::iterator toolIter, 00135 toolEnd=m_rpcTools.end(); 00136 for(toolIter=m_rpcTools.begin(); toolIter != toolEnd; toolIter++){ 00137 IRpcCalibParamTool* calibTool = *toolIter; 00138 StatusCode sc = calibTool->process(*readoutHeader); 00139 if( sc != StatusCode::SUCCESS ) return sc; 00140 } 00141 00142 }else{ 00143 error() << "Unknown detector " << det << endreq; 00144 info() << "I am ignoring for now! " << endreq;//tmp 00145 //return StatusCode::FAILURE;//tmp !! quick fix by jpochoa, temporary! See track ticket #737 00146 return StatusCode::SUCCESS;//tmp 00147 } 00148 00149 return StatusCode::SUCCESS; 00150 }
StatusCode CalibParamAlg::finalize | ( | ) | [virtual] |
Reimplemented from GaudiAlgorithm.
Definition at line 152 of file CalibParamAlg.cc.
00153 { 00154 // Run calibration calculations for each tool 00155 { 00156 // Loop over each PMT calibration tool, calling calibrate() 00157 std::vector<IPmtCalibParamTool*>::iterator toolIter, 00158 toolEnd=m_pmtTools.end(); 00159 for(toolIter=m_pmtTools.begin(); toolIter != toolEnd; toolIter++){ 00160 IPmtCalibParamTool* calibTool = *toolIter; 00161 StatusCode sc = calibTool->calibrate(); 00162 if( sc != StatusCode::SUCCESS ) return sc; 00163 } 00164 } 00165 00166 { 00167 // Loop over each RPC calibration tool, calling calibrate() 00168 std::vector<IRpcCalibParamTool*>::iterator toolIter, 00169 toolEnd=m_rpcTools.end(); 00170 for(toolIter=m_rpcTools.begin(); toolIter != toolEnd; toolIter++){ 00171 IRpcCalibParamTool* calibTool = *toolIter; 00172 StatusCode sc = calibTool->calibrate(); 00173 if( sc != StatusCode::SUCCESS ) return sc; 00174 } 00175 } 00176 00177 info()<<"First trigger time: "<<m_beginTime.GetSec()<<" sec "<<m_beginTime.GetNanoSec()<<" nanoSec"<<endreq; 00178 info()<<"Last trigger time: "<<m_endTime.GetSec()<<" sec "<<m_endTime.GetNanoSec()<<" nanoSec"<<endreq; 00179 00180 return this->GaudiAlgorithm::finalize(); 00181 }
std::string CalibParamAlg::m_readoutLocation [private] |
Property ReadoutLocation - location in TES where the input ReadoutHeader is to be found.
Default is DayaBay::ReadoutHeader::Default
Definition at line 39 of file CalibParamAlg.h.
std::vector<std::string> CalibParamAlg::m_pmtToolNames [private] |
Definition at line 42 of file CalibParamAlg.h.
std::vector<std::string> CalibParamAlg::m_rpcToolNames [private] |
Definition at line 44 of file CalibParamAlg.h.
std::vector<IPmtCalibParamTool*> CalibParamAlg::m_pmtTools [private] |
Definition at line 47 of file CalibParamAlg.h.
std::vector<IRpcCalibParamTool*> CalibParamAlg::m_rpcTools [private] |
Definition at line 49 of file CalibParamAlg.h.
bool CalibParamAlg::m_useFloatFeePedes [private] |
Definition at line 52 of file CalibParamAlg.h.
std::string CalibParamAlg::m_floatFeePedesSvcName [private] |
Definition at line 54 of file CalibParamAlg.h.
Definition at line 57 of file CalibParamAlg.h.
TimeStamp CalibParamAlg::m_beginTime [private] |
Definition at line 60 of file CalibParamAlg.h.
TimeStamp CalibParamAlg::m_endTime [private] |
Definition at line 61 of file CalibParamAlg.h.