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