1#include "GaudiKernel/MsgStream.h"
3#include "GaudiKernel/SmartDataPtr.h"
13long unsigned EventFilter::m_nTotalEvent =0;
14long unsigned EventFilter::m_npass =0;
15bool EventFilter::m_efResult =
false;
16std::string EventFilter::m_type ;
19 Algorithm(name, pSvcLocator) {
21 declareProperty(
"useTrigger", m_trgFlag =
true);
22 declareProperty(
"OutputLevel", m_outputLevel = MSG::NIL);
23 declareProperty(
"OpenedChannels", m_chn );
24 declareProperty(
"Example", m_example =
false);
33 MsgStream log(
msgSvc(), name());
34 log << MSG::INFO <<
"in initialize()" << endreq;
39 m_type =
"RefuseByEF";
41 return StatusCode::SUCCESS;
47 MsgStream log(
msgSvc(), name());
49 uint32_t run=0,
event=0;
50 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
52 log << MSG::FATAL <<
"Could not find Event Header" << endreq;
53 return( StatusCode::FAILURE);
55 run=eventHeader->runNumber();
56 event=eventHeader->eventNumber();
57 log << MSG::INFO <<
"execute() RunNo=" << run <<
", EventNo=" <<
event << endreq;
62 setFilterPassed(
false);
63 m_type =
"RefuseByEF";
66 SmartDataPtr<TrigData> trg(eventSvc(),
"/Event/Trig/TrigData");
68 log << MSG::WARNING <<
"Could not find Event TrigData" << endreq;
72 for(
int i=0;i<16;i++){
73 if(trg->getTrigChannel(i)) pass=
true;
77 m_type =
"RefuseByTrg";
78 return( StatusCode::SUCCESS);
84 SmartDataPtr<HltInf> hlt(eventSvc(),
"/Event/Hlt/HltInf");
86 log << MSG::WARNING <<
"Could not find Event HltInf (try DstHltInf now)" << endreq;
87 SmartDataPtr<DstHltInf> hltDst(eventSvc(),
"/Event/Hlt/DstHltInf");
89 log << MSG::FATAL <<
"Could not find Event DstHltInf too ( please re-generate data)" << endreq;
90 return( StatusCode::FAILURE);
99 std::vector<std::string>::iterator it=m_chn.begin();
102 log << MSG::WARNING << m_type << endreq;
104 if(log.level()<=MSG::VERBOSE) aHlt->
print();
106 for(;it!=m_chn.end();it++){
109 setFilterPassed(
true);
111 log << MSG::INFO <<
"this event is passed" << endreq;
115 log << MSG::INFO <<
"this event is a " << m_type <<endreq;
117 if(m_example&&!hlt) {
118 cout<<
"****** Example for getting event filter informatiom ******" << endl;
119 cout<<
"****** Please refer to the code in EventFilter.cxx ******" << endl;
123 return ( StatusCode::SUCCESS);
127 int nmdc,ntof,nemc,nmuc,ntrk,nshower;
128 float etot,
e1,
e2,cose1,cose2,p1,p2,acop,acole,acol;
bool isType(string &type) const
virtual void print() const
uint32_t getEventType() const
const string & getEventName() const
EventFilter(const std::string &name, ISvcLocator *pSvcLocator)
virtual bool getData(const Identifier &, uint32_t *)