45 {
46
47 MsgStream log(
msgSvc(), name());
48
49 uint32_t run=0,event=0;
50 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
51 if (!eventHeader) {
52 log << MSG::FATAL << "Could not find Event Header" << endreq;
53 return( StatusCode::FAILURE);
54 }
55 run=eventHeader->runNumber();
56 event=eventHeader->eventNumber();
57 log << MSG::INFO << "execute() RunNo=" << run << ", EventNo=" << event << endreq;
58
59 m_nTotalEvent++;
60
61 m_efResult = false;
62 setFilterPassed(false);
63 m_type = "RefuseByEF";
64
65 if(m_trgFlag){
66 SmartDataPtr<TrigData> trg(eventSvc(),"/Event/Trig/TrigData");
67 if(!trg) {
68 log << MSG::WARNING << "Could not find Event TrigData" << endreq;
69 }
70 else {
71 bool pass=false;
72 for(int i=0;i<16;i++){
73 if(trg->getTrigChannel(i)) pass=true;
74 }
75 if(!pass) {
76 m_efResult = false;
77 m_type = "RefuseByTrg";
78 return( StatusCode::SUCCESS);
79 }
80 }
81 }
82
84 SmartDataPtr<HltInf> hlt(eventSvc(),"/Event/Hlt/HltInf");
85 if(!hlt) {
86 log << MSG::WARNING << "Could not find Event HltInf (try DstHltInf now)" << endreq;
87 SmartDataPtr<DstHltInf> hltDst(eventSvc(),"/Event/Hlt/DstHltInf");
88 if(!hltDst){
89 log << MSG::FATAL << "Could not find Event DstHltInf too ( please re-generate data)" << endreq;
90 return( StatusCode::FAILURE);
91
92 }
93 else{
94 aHlt=hltDst;
95 }
96 }
97 else aHlt=hlt;
98
99 std::vector<std::string>::iterator it=m_chn.begin();
102 log << MSG::WARNING << m_type << endreq;
103 }
104 if(log.level()<=MSG::VERBOSE) aHlt->
print();
105
106 for(;it!=m_chn.end();it++){
108 m_efResult=true;
109 setFilterPassed(true);
110 m_npass++;
111 log << MSG::INFO << "this event is passed" << endreq;
112 break;
113 }
114 }
115 log << MSG::INFO << "this event is a " << m_type <<endreq;
116
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;
121 }
122
123 return ( StatusCode::SUCCESS);
124}
bool isType(string &type) const
virtual void print() const
uint32_t getEventType() const
const string & getEventName() const