3#include "GaudiKernel/MsgStream.h"
4#include "GaudiKernel/AlgFactory.h"
5#include "GaudiKernel/ISvcLocator.h"
6#include "GaudiKernel/SmartDataPtr.h"
7#include "GaudiKernel/IDataProviderSvc.h"
8#include "GaudiKernel/PropertyMgr.h"
24 Algorithm(name, pSvcLocator)
34 MsgStream log(
msgSvc(), name());
35 log << MSG::INFO <<
"in initialize()" << endreq;
39 return StatusCode::SUCCESS;
45 MsgStream log(
msgSvc(), name());
46 log << MSG::INFO <<
"in execute()" << endreq;
50 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
52 log << MSG::FATAL <<
"Could not find Event Header" << endreq;
53 return( StatusCode::FAILURE);
56 int eventId = eventHeader->eventNumber() ;
57 int runId = eventHeader->runNumber();
58 log << MSG::INFO <<
"DstHltMaker: retrieved event: " <<
" Event Number "<< eventId <<
" run: " <<runId << endreq;
60 StatusCode sc = StatusCode::SUCCESS ;
68 SmartDataPtr<HltInf> recHltInf(eventSvc(),
"/Event/Hlt/HltInf");
71 log << MSG::DEBUG <<
"Could not find HltInf" << endreq;
77 dstHltInf->
setVersion(recHltInf->getVersion());
79 dstHltInf->
setNumber(recHltInf->getNumber());
80 dstHltInf->
setNCON(recHltInf->getNCON());
83 DataObject *aDstHltInfEvent;
84 eventSvc()->findObject(
"/Event/Hlt/DstHltInf", aDstHltInfEvent);
85 if(aDstHltInfEvent!=
NULL) {
86 SmartDataPtr<DstHltInf> hltInf(eventSvc(),
"/Event/Hlt/DstHltInf");
87 log<<MSG::DEBUG<<
"old type="<<hltInf->getEventType()<<
", alg="<<hltInf->getAlgProcess()
88 <<
", criteria="<<hltInf->getCriteriaTable()<<
", version="<<hltInf->getVersion()
89 <<
", energy="<<hltInf->getTotalEnergy()<<endreq;
91 sc = eventSvc()->unregisterObject(
"/Event/Hlt/DstHltInf");
92 delete aDstHltInfEvent;
93 log << MSG::INFO <<
"Old DstHltInf has been unregistered" << endreq;
94 if(sc!=StatusCode::SUCCESS) {
95 log << MSG::FATAL <<
"Could not unregister DstHltInf" << endreq;
96 return( StatusCode::FAILURE);
101 log << MSG::DEBUG <<
"Event No."<<eventId<<
" = "
114 MsgStream log(
msgSvc(), name());
115 log << MSG::DEBUG <<
"==> Finalize DstHltMaker" << endreq;
116 log << MSG::ALWAYS << m_ntot <<
" events are converted." <<endreq;
118 return StatusCode::SUCCESS;
void setAlgProcess(const unsigned int i)
void setCriteriaTable(const unsigned int i)
float getTotalEnergy() const
uint32_t getCriteriaTable() const
void setNumber(const unsigned int i)
void setNCON(const unsigned int i)
uint32_t getVersion() const
uint32_t getEventType() const
uint32_t getAlgProcess() const
void setEventType(const unsigned int i)
void setTotalEnergy(const float etot)
void setVersion(const unsigned int i)
DstHltMaker(const std::string &name, ISvcLocator *pSvcLocator)
_EXTERN_ std::string DstHltInf