33 {
34 MsgStream log(
msgSvc(),name());
35 log<<MSG::DEBUG<< "HltEventMaker: in execute()" <<endreq;
36
37
38 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
39 if (!eventHeader) {
40 log << MSG::FATAL << "Could not find Event Header" << endreq;
41 return StatusCode::FAILURE;
42 }
43
44 int eventId = eventHeader->eventNumber() ;
45 int runId = eventHeader->runNumber();
46 log << MSG::INFO << "HltEventMaker: retrieved event: " <<" Event Number "<< eventId << " run: " <<runId << endreq;
47
49
50 SmartDataPtr<HltRawCol> hltRawCol(eventSvc(),"/Event/Hlt/HltRawCol");
51 if (!hltRawCol) {
52 log << MSG::DEBUG << "Could not find HltRawCol!" << endreq;
53
54 }
55 else{
56 uint32_t type=0,alg=0,cri=0,ver=0;
57 float etot=0;
58 uint32_t nmdc=0xFF,ntof=0xFF,nemc=0xFF,nmuc=0xFF;
59
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;
70
71 uint32_t pureid= id&0xFF;
73 uint32_t datanum=(*iter)->getIntChannel();
75 nmdc=datanum&0xFF;
76 ntof=(datanum&0xFF00)>>8;
77 nemc=(datanum&0xFF0000)>>16;
78 nmuc=(datanum&0xFF000000)>>24;
79 log << MSG::VERBOSE << nmdc << ", " << ntof << ", " << nemc << ", " << nmuc << endreq;
80 }
82 aHlt->
push_mdc((*iter)->getIntChannel());
83 }
85 aHlt->
push_tof((*iter)->getIntChannel());
86 }
88 aHlt->
push_emc((*iter)->getIntChannel());
89 }
91 aHlt->
push_muc((*iter)->getIntChannel());
92 }
95 else aHlt->
push_con((*iter)->getIntChannel());
96 }
97 }
98 log<<MSG::DEBUG<<"type="<<type<<", alg="<<alg<<", criteria="<<cri
99 <<", version="<<ver<<", energy="<<etot<<endreq;
100
101 m_ntot++;
102 }
103
104 StatusCode sc;
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;
112
113 sc = eventSvc()->unregisterObject("/Event/Hlt/HltInf");
114 delete aHltInfEvent;
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);
119 }
120 }
122 if(sc!=StatusCode::SUCCESS) {
123 log<<MSG::FATAL<< "Could not register HltInf" <<endreq;
124 return StatusCode::FAILURE;
125 }
126
127 return StatusCode::SUCCESS;
128}
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)
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