#include <EventFilter.h>
Public Member Functions | |
EventFilter (const std::string &name, ISvcLocator *pSvcLocator) | |
EventFilter (const std::string &name, ISvcLocator *pSvcLocator) | |
StatusCode | execute () |
StatusCode | execute () |
StatusCode | initialize () |
StatusCode | initialize () |
void | print (HltInf *) |
void | print (HltInf *) |
virtual | ~EventFilter () |
virtual | ~EventFilter () |
Static Public Member Functions | |
const std::string & | getName () |
const std::string & | getName () |
long unsigned | getNEvt () |
long unsigned | getNEvt () |
long unsigned | getNPass () |
long unsigned | getNPass () |
bool | getResult () |
bool | getResult () |
Private Attributes | |
std::vector< std::string > | m_chn |
std::vector< std::string > | m_chn |
bool | m_example |
int | m_outputLevel |
bool | m_trgFlag |
Static Private Attributes | |
bool | m_efResult = false |
long unsigned | m_npass = 0 |
long unsigned | m_nTotalEvent = 0 |
std::string | m_type |
|
00018 : 00019 Algorithm(name, pSvcLocator) { 00020 00021 declareProperty("useTrigger", m_trgFlag =true); 00022 declareProperty("OutputLevel", m_outputLevel = MSG::NIL); 00023 declareProperty("OpenedChannels", m_chn ); 00024 declareProperty("Example", m_example = false); 00025 00026 }
|
|
00028 { 00029 }
|
|
|
|
|
|
|
|
00045 { 00046 00047 MsgStream log(msgSvc(), name()); 00048 00049 uint32_t run=0,event=0; 00050 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader"); 00051 if (!eventHeader) { 00052 log << MSG::FATAL << "Could not find Event Header" << endreq; 00053 return( StatusCode::FAILURE); 00054 } 00055 run=eventHeader->runNumber(); 00056 event=eventHeader->eventNumber(); 00057 log << MSG::INFO << "execute() RunNo=" << run << ", EventNo=" << event << endreq; 00058 00059 m_nTotalEvent++; 00060 00061 m_efResult = false; 00062 setFilterPassed(false); 00063 m_type = "RefuseByEF"; 00064 00065 if(m_trgFlag){ 00066 SmartDataPtr<TrigData> trg(eventSvc(),"/Event/Trig/TrigData"); 00067 if(!trg) { 00068 log << MSG::WARNING << "Could not find Event TrigData" << endreq; 00069 } 00070 else { 00071 bool pass=false; 00072 for(int i=0;i<16;i++){ 00073 if(trg->getTrigChannel(i)) pass=true; 00074 } 00075 if(!pass) { 00076 m_efResult = false; 00077 m_type = "RefuseByTrg"; 00078 return( StatusCode::SUCCESS); 00079 } 00080 } 00081 } 00082 00083 DstHltInf* aHlt; 00084 SmartDataPtr<HltInf> hlt(eventSvc(),"/Event/Hlt/HltInf"); 00085 if(!hlt) { 00086 log << MSG::WARNING << "Could not find Event HltInf (try DstHltInf now)" << endreq; 00087 SmartDataPtr<DstHltInf> hltDst(eventSvc(),"/Event/Hlt/DstHltInf"); 00088 if(!hltDst){ 00089 log << MSG::FATAL << "Could not find Event DstHltInf too ( please re-generate data)" << endreq; 00090 return( StatusCode::FAILURE); 00091 //return( StatusCode::SUCCESS); 00092 } 00093 else{ 00094 aHlt=hltDst; 00095 } 00096 } 00097 else aHlt=hlt; 00098 00099 std::vector<std::string>::iterator it=m_chn.begin(); 00100 m_type = aHlt->getEventName(); 00101 if(aHlt->getEventType()==0) { 00102 log << MSG::WARNING << m_type << endreq; 00103 } 00104 if(log.level()<=MSG::VERBOSE) aHlt->print(); 00105 00106 for(;it!=m_chn.end();it++){ 00107 if(aHlt->isType(*it)) { 00108 m_efResult=true; 00109 setFilterPassed(true); 00110 m_npass++; 00111 log << MSG::INFO << "this event is passed" << endreq; 00112 break; 00113 } 00114 } 00115 log << MSG::INFO << "this event is a " << m_type <<endreq; 00116 00117 if(m_example&&!hlt) { 00118 cout<< "****** Example for getting event filter informatiom ******" << endl; 00119 cout<< "****** Please refer to the code in EventFilter.cxx ******" << endl; 00120 print(hlt); 00121 } 00122 00123 return ( StatusCode::SUCCESS); 00124 }
|
|
00016 { return m_type;};
|
|
00016 { return m_type;};
|
|
00017 { return m_nTotalEvent;};
|
|
00017 { return m_nTotalEvent;};
|
|
00018 { return m_npass;};
|
|
00018 { return m_npass;};
|
|
00019 {return m_efResult;};
|
|
00019 {return m_efResult;};
|
|
|
|
00031 { 00032 00033 MsgStream log(msgSvc(), name()); 00034 log << MSG::INFO << "in initialize()" << endreq; 00035 00036 m_nTotalEvent =0; 00037 m_npass =0; 00038 m_efResult = false; 00039 m_type = "RefuseByEF"; 00040 00041 return StatusCode::SUCCESS; 00042 }
|
|
|
|
00126 { 00127 int nmdc,ntof,nemc,nmuc,ntrk,nshower; 00128 float etot,e1,e2,cose1,cose2,p1,p2,acop,acole,acol; 00129 if(ahlt->getData(Identifier(HltID::NMDC),(uint32_t*)&nmdc)) cout<< "nmdc=" << nmdc <<endl; 00130 if(ahlt->getData(Identifier(HltID::NTOF),(uint32_t*)&ntof)) cout<< "ntof=" << ntof <<endl; 00131 if(ahlt->getData(Identifier(HltID::NEMC),(uint32_t*)&nemc)) cout<< "nemc=" << nemc <<endl; 00132 if(ahlt->getData(Identifier(HltID::NMUC),(uint32_t*)&nmuc)) cout<< "nmuc=" << nmuc <<endl; 00133 if(ahlt->getData(Identifier(HltID::NTRK),(uint32_t*)&ntrk)) cout<< "ntrk=" << ntrk <<endl; 00134 if(ahlt->getData(Identifier(HltID::NSHW),(uint32_t*)&nshower)) cout<< "nshower=" << nshower <<endl; 00135 if(ahlt->getData(Identifier(HltID::ETOT),(uint32_t*)&etot)) cout<< "etot=" << etot <<endl; 00136 if(ahlt->getData(Identifier(HltID::EMAX1),(uint32_t*)&e1)) cout<< "e1=" << e1 <<endl; 00137 if(ahlt->getData(Identifier(HltID::EMAX2),(uint32_t*)&e2)) cout<< "e2=" << e2 <<endl; 00138 if(ahlt->getData(Identifier(HltID::ECOST1),(uint32_t*)&cose1)) cout<< "cose1=" << cose1 <<endl; 00139 if(ahlt->getData(Identifier(HltID::ECOST2),(uint32_t*)&cose2)) cout<< "cose2=" << cose2 <<endl; 00140 if(ahlt->getData(Identifier(HltID::PMAX1),(uint32_t*)&p1)) cout<< "p1=" << p1 <<endl; 00141 if(ahlt->getData(Identifier(HltID::PMAX2),(uint32_t*)&p2)) cout<< "p2=" << p2 <<endl; 00142 if(ahlt->getData(Identifier(HltID::EACOP),(uint32_t*)&acop)) cout<< "acop=" << acop <<endl; 00143 if(ahlt->getData(Identifier(HltID::EACOL),(uint32_t*)&acole)) cout<< "acole=" << acole <<endl; 00144 if(ahlt->getData(Identifier(HltID::ACOL),(uint32_t*)&acol)) cout<< "acol=" << acol <<endl; 00145 return; 00146 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|