1#include "GaudiKernel/AlgFactory.h"
2#include "GaudiKernel/MsgStream.h"
3#include "GaudiKernel/ISvcLocator.h"
4#include "GaudiKernel/SmartDataPtr.h"
5#include "GaudiKernel/IDataProviderSvc.h"
6#include "GaudiKernel/PropertyMgr.h"
26 MsgStream log(
msgSvc(), name());
27 log << MSG::DEBUG <<
"HltEventMaker: in initialize()" << endreq;
30 return StatusCode::SUCCESS;
34 MsgStream log(
msgSvc(),name());
35 log<<MSG::DEBUG<<
"HltEventMaker: in execute()" <<endreq;
38 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
40 log << MSG::FATAL <<
"Could not find Event Header" << endreq;
41 return StatusCode::FAILURE;
44 int eventId = eventHeader->eventNumber() ;
45 int runId = eventHeader->runNumber();
46 log << MSG::INFO <<
"HltEventMaker: retrieved event: " <<
" Event Number "<< eventId <<
" run: " <<runId << endreq;
50 SmartDataPtr<HltRawCol> hltRawCol(eventSvc(),
"/Event/Hlt/HltRawCol");
52 log << MSG::DEBUG <<
"Could not find HltRawCol!" << endreq;
56 uint32_t type=0,alg=0,cri=0,ver=0;
58 uint32_t nmdc=0xFF,ntof=0xFF,nemc=0xFF,nmuc=0xFF;
60 HltRawCol::iterator
iter = hltRawCol->begin();
61 for (;
iter != hltRawCol->end();
iter++ ) {
63 log << MSG::VERBOSE <<
"EventFilter info id: " << hex <<
id <<
": "
64 << (*iter)->getIntChannel() <<
","<< dec << (*iter)->getFloatChannel() <<endreq;
71 uint32_t pureid=
id&0xFF;
73 uint32_t datanum=(*iter)->getIntChannel();
76 ntof=(datanum&0xFF00)>>8;
77 nemc=(datanum&0xFF0000)>>16;
78 nmuc=(datanum&0xFF000000)>>24;
79 log << MSG::VERBOSE << nmdc <<
", " << ntof <<
", " << nemc <<
", " << nmuc << endreq;
82 aHlt->
push_mdc((*iter)->getIntChannel());
85 aHlt->
push_tof((*iter)->getIntChannel());
88 aHlt->
push_emc((*iter)->getIntChannel());
91 aHlt->
push_muc((*iter)->getIntChannel());
95 else aHlt->
push_con((*iter)->getIntChannel());
98 log<<MSG::DEBUG<<
"type="<<type<<
", alg="<<alg<<
", criteria="<<cri
99 <<
", version="<<ver<<
", energy="<<etot<<endreq;
105 DataObject *aHltInfEvent;
106 eventSvc()->findObject(
"/Event/Hlt/HltInf", aHltInfEvent);
107 if(aHltInfEvent!=NULL) {
108 SmartDataPtr<HltInf> hltInf(eventSvc(),
"/Event/Hlt/HltInf");
109 log<<MSG::DEBUG<<
"old type="<<hltInf->getEventType()<<
", alg="<<hltInf->getAlgProcess()
110 <<
", criteria="<<hltInf->getCriteriaTable()<<
", version="<<hltInf->getVersion()
111 <<
", energy="<<hltInf->getTotalEnergy()<<endreq;
113 sc = eventSvc()->unregisterObject(
"/Event/Hlt/HltInf");
115 log << MSG::INFO <<
"Old HltInf has been unregistered" << endreq;
116 if(sc!=StatusCode::SUCCESS) {
117 log << MSG::FATAL <<
"Could not unregister HltInf" << endreq;
118 return( StatusCode::FAILURE);
122 if(sc!=StatusCode::SUCCESS) {
123 log<<MSG::FATAL<<
"Could not register HltInf" <<endreq;
124 return StatusCode::FAILURE;
127 return StatusCode::SUCCESS;
131 MsgStream log(
msgSvc(), name());
132 log << MSG::DEBUG <<
"==> Finalize HltEventMaker" << endreq;
133 log << MSG::ALWAYS << m_ntot <<
" events are converted." <<endreq;
134 return StatusCode::SUCCESS;
void setAlgProcess(const unsigned int i)
void setCriteriaTable(const unsigned int i)
void setNumber(const unsigned int i)
void setNCON(const unsigned int i)
void setEventType(const unsigned int i)
void setTotalEnergy(const float etot)
void setVersion(const unsigned int i)
HltEventMaker(const std::string &name, ISvcLocator *pSvcLocator)
static bool is_ncon(const Identifier &id)
static bool is_tof_inf(const Identifier &id)
static bool is_version(const Identifier &id)
static bool is_con_inf(const Identifier &id)
static bool is_eventtype(const Identifier &id)
static bool is_algorithm(const Identifier &id)
static bool is_muc_inf(const Identifier &id)
static bool is_criteria(const Identifier &id)
static bool is_emc_inf(const Identifier &id)
static bool is_number(const Identifier &id)
static bool is_mdc_inf(const Identifier &id)
static bool is_energy(const Identifier &id)
virtual void push_muc(uint32_t data)
virtual void push_mdc(uint32_t data)
virtual void push_tof(uint32_t data)
virtual void push_con(uint32_t data)
virtual void push_emc(uint32_t data)
_EXTERN_ std::string HltInf