46 MsgStream log(
msgSvc(), name() );
48 log << MSG::INFO <<
"in initialize()" << endmsg;
50 SmartIF<IJobOptionsSvc> iSvc( serviceLocator()->service(
"JobOptionsSvc" ) );
54 const std::vector<const Property*>* ps = 0;
55 if ( iSvc->getProperties(
"RootCnvSvc" ) != 0 ) ps = iSvc->getProperties(
"RootCnvSvc" );
56 if ( iSvc->getProperties(
"EventCnvSvc" ) != 0 ) ps = iSvc->getProperties(
"EventCnvSvc" );
57 if ( iSvc->getProperties(
"WriteDst" ) != 0 ) ps = iSvc->getProperties(
"WriteDst" );
61 for (
int i = 0; i < ps->size(); i++ )
63 if ( ( *ps )[i]->name() ==
"digiRootOutputFile" )
66 m_dstOutput = ( *ps )[i]->toString();
67 std::cout <<
"read from JobOptionSvc, dstOutput: " << m_dstOutput << std::endl;
74 log << MSG::INFO <<
"RootInteface TotalFileNum: " << m_rootInterface->getTotalFileNum()
76 std::cout <<
"getTotalFileNum: " << m_rootInterface->getTotalFileNum() << std::endl;
78 if ( m_rootInterface->getTotalFileNum() > 0 )
80 if ( m_rootInterface->getTotalFileNum() != m_outputTagFile.size() )
82 std::cout <<
"the input file num != output file number, please check your jobOptions"
92 return StatusCode::SUCCESS;
98 MsgStream log(
msgSvc(), name() );
99 log << MSG::INFO <<
"in execute()" << endmsg;
102 if ( m_dstOutput !=
"" )
106 std::cout <<
"TagWriterAlg: write tag during reconstruction" << std::endl;
107 m_dstFile = m_dstOutput;
108 std::cout <<
"dst file: " << m_dstFile << std::endl;
115 if ( m_dstFile != m_rootInterface->getCurrentFileName() )
117 std::cout <<
"TagWriterAlg, current file: " << m_rootInterface->getCurrentFileName()
120 m_dstFile = m_rootInterface->getCurrentFileName();
131 log << MSG::INFO <<
"open ROOT output TAG file: " << m_outputTagFile[m_fileNum]
140 log << MSG::INFO <<
"writing TAG information to ROOT TAG file" << endmsg;
144 return StatusCode::SUCCESS;
149 MsgStream log(
msgSvc(), name() );
150 log << MSG::INFO <<
"reading event data from DST" << endmsg;
152 SmartDataPtr<Event::EventHeader> eventHeader( eventSvc(),
"/Event/EventHeader" );
155 log << MSG::FATAL <<
"Could not find EventHeader." << endmsg;
156 return StatusCode::FAILURE;
159 m_runNo = eventHeader->runNumber();
160 m_eventId = eventHeader->eventNumber();
161 log << MSG::DEBUG <<
"run, evtnum = " << m_runNo <<
" , " << m_eventId << endmsg;
166 log << MSG::FATAL <<
"Could not find EvtRecEvent." << endmsg;
167 return StatusCode::FAILURE;
169 log << MSG::DEBUG <<
"ncharg, nneu, tottks = " << evtRecEvent->totalCharged() <<
" , "
170 << evtRecEvent->totalNeutral() <<
" , " << evtRecEvent->totalTracks() << endmsg;
171 m_totalCharged = evtRecEvent->totalCharged();
172 m_totalNeutral = evtRecEvent->totalNeutral();
173 m_totalTrks = evtRecEvent->totalTracks();
174 return StatusCode::SUCCESS;