#include <DTagSkim.h>
Public Member Functions | |
DTagSkim (const std::string &name, ISvcLocator *pSvcLocator) | |
DTagSkim (const std::string &name, ISvcLocator *pSvcLocator) | |
StatusCode | execute () |
StatusCode | execute () |
StatusCode | finalize () |
StatusCode | finalize () |
StatusCode | initialize () |
StatusCode | initialize () |
Private Attributes | |
bool | m_ifwritedst |
bool | m_ifwriterec |
Algorithm * | m_subalg1 |
Algorithm * | m_subalg1 |
Algorithm * | m_subalg2 |
Algorithm * | m_subalg2 |
|
00043 : 00044 Algorithm(name, pSvcLocator) { 00045 //Declare the properties 00046 declareProperty("WriteDst", m_ifwritedst=true); 00047 declareProperty("WriteRec", m_ifwriterec=false); 00048 }
|
|
|
|
|
|
00086 { 00087 MsgStream log(msgSvc(), name()); 00088 log << MSG::INFO << "in execute()" << endreq; 00089 00090 00091 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader"); 00092 if(!eventHeader) 00093 { 00094 cout<<" eventHeader "<<endl; 00095 return StatusCode::FAILURE; 00096 } 00097 00098 int run=eventHeader->runNumber(); 00099 int event=eventHeader->eventNumber(); 00100 00101 00102 SmartDataPtr<EvtRecEvent> evtRecEvent(eventSvc(), EventModel::EvtRec::EvtRecEvent); 00103 if(!evtRecEvent ) { 00104 cout<<" evtRecEvent "<<endl; 00105 return StatusCode::FAILURE; 00106 } 00107 00108 00109 log << MSG::DEBUG <<"ncharg, nneu, tottks = " 00110 << evtRecEvent->totalCharged() << " , " 00111 << evtRecEvent->totalNeutral() << " , " 00112 << evtRecEvent->totalTracks() <<endreq; 00113 SmartDataPtr<EvtRecTrackCol> evtRecTrkCol(eventSvc(), EventModel::EvtRec::EvtRecTrackCol); 00114 if(!evtRecTrkCol){ 00115 cout<<" evtRecTrkCol "<<endl; 00116 return StatusCode::FAILURE; 00117 } 00118 00119 if(evtRecEvent->totalTracks()!=evtRecTrkCol->size()) return StatusCode::SUCCESS; 00120 00121 00122 SmartDataPtr<EvtRecDTagCol> evtRecDTagCol(eventSvc(), EventModel::EvtRec::EvtRecDTagCol); 00123 if ( ! evtRecDTagCol ) { 00124 log << MSG::FATAL << "Could not find EvtRecDTagCol" << endreq; 00125 return StatusCode::FAILURE; 00126 } 00127 00128 00129 if(evtRecDTagCol->size()==0){ 00130 //cout<<"no D candidates found in this event"<<endl; 00131 return StatusCode::SUCCESS; 00132 } 00133 //else{ 00134 //cout<<"there are D candidates found in this event"<<endl; 00135 //} 00136 00137 // -------- Write to root file 00138 if(m_ifwritedst) m_subalg1->execute(); 00139 if(m_ifwriterec) m_subalg2->execute(); 00140 00141 00142 return StatusCode::SUCCESS; 00143 00144 }
|
|
|
|
00147 { 00148 00149 MsgStream log(msgSvc(), name()); 00150 log << MSG::INFO << "in finalize()" << endmsg; 00151 00152 00153 return StatusCode::SUCCESS; 00154 }
|
|
|
|
00051 { 00052 MsgStream log(msgSvc(), name()); 00053 00054 log << MSG::INFO << "in initialize()" << endmsg; 00055 StatusCode sc; 00056 00057 log << MSG::INFO << "creating sub-algorithms...." << endreq; 00058 00059 00060 sc = createSubAlgorithm( "EventWriter", "WriteDst", m_subalg1); 00061 if( sc.isFailure() ) { 00062 log << MSG::ERROR << "Error creating Sub-Algorithm WriteDst" <<endreq; 00063 return sc; 00064 } else { 00065 log << MSG::INFO << "Success creating Sub-Algorithm WriteDst" <<endreq; 00066 } 00067 00068 00069 00070 sc = createSubAlgorithm( "EventWriter", "WriteRec", m_subalg2); 00071 if( sc.isFailure() ) { 00072 log << MSG::ERROR << "Error creating Sub-Algorithm WriteRec" <<endreq; 00073 return sc; 00074 } else { 00075 log << MSG::INFO << "Success creating Sub-Algorithm WriteRec" <<endreq; 00076 } 00077 00078 00079 00080 log << MSG::INFO << "successfully return from initialize()" <<endmsg; 00081 return StatusCode::SUCCESS; 00082 00083 }
|
|
|
|
|
|
|
|
|
|
|
|
|