#include <RootCnvSvc.h>
Public Member Functions | |
virtual StatusCode | commitOutput (const std::string &output, bool do_commit) |
Commit pending output (fill the TTrees). | |
virtual StatusCode | commitOutput (const std::string &output, bool do_commit) |
Commit pending output (fill the TTrees). | |
virtual StatusCode | createAddress (std::string path, IOpaqueAddress *&refpAddress) |
virtual StatusCode | createAddress (DataObject *obj, IOpaqueAddress *&refpAddress) |
virtual StatusCode | createAddress (long int svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) |
create address containing ROOT treename, branchname, entry number | |
virtual StatusCode | createAddress (std::string path, IOpaqueAddress *&refpAddress) |
virtual StatusCode | createAddress (DataObject *obj, IOpaqueAddress *&refpAddress) |
virtual StatusCode | createAddress (long int svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) |
create address containing ROOT treename, branchname, entry number | |
virtual StatusCode | declareObject (const Leaf &leaf) |
Associates a path on TDS with a particular converter. | |
virtual StatusCode | declareObject (const Leaf &leaf) |
Associates a path on TDS with a particular converter. | |
virtual StatusCode | finalize () |
virtual StatusCode | finalize () |
DigiCnv * | getDigiCnv () |
DigiCnv * | getDigiCnv () |
DstCnv * | getDstCnv () |
DstCnv * | getDstCnv () |
EventCnv * | getEventCnv () |
EventCnv * | getEventCnv () |
EvtHeaderCnv * | getEvtHeaderCnv () |
EvtHeaderCnv * | getEvtHeaderCnv () |
EvtRecCnv * | getEvtRecCnv () |
EvtRecCnv * | getEvtRecCnv () |
HltCnv * | getHltCnv () |
HltCnv * | getHltCnv () |
McCnv * | getMcCnv () |
McCnv * | getMcCnv () |
RecTrackCnv * | getRecTrackCnv () |
RecTrackCnv * | getRecTrackCnv () |
RootInterface * | getRootInterface () |
RootInterface * | getRootInterface () |
TrigCnv * | getTrigCnv () |
TrigCnv * | getTrigCnv () |
virtual StatusCode | initialize () |
virtual StatusCode | initialize () |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface) |
Override inherited queryInterface due to enhanced interface. | |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface) |
Override inherited queryInterface due to enhanced interface. | |
void | setDigiCnv (DigiCnv *reccnv) |
void | setDigiCnv (DigiCnv *reccnv) |
void | setDstCnv (DstCnv *dstcnv) |
void | setDstCnv (DstCnv *dstcnv) |
void | setEventCnv (EventCnv *eventCnv) |
void | setEventCnv (EventCnv *eventCnv) |
void | setEvtHeaderCnv (EvtHeaderCnv *evtheadercnv) |
void | setEvtHeaderCnv (EvtHeaderCnv *evtheadercnv) |
void | setEvtRecCnv (EvtRecCnv *evtreccnv) |
void | setEvtRecCnv (EvtRecCnv *evtreccnv) |
void | setHltCnv (HltCnv *hltcnv) |
void | setHltCnv (HltCnv *hltcnv) |
void | setMcCnv (McCnv *mccnv) |
void | setMcCnv (McCnv *mccnv) |
void | setRecTrackCnv (RecTrackCnv *rectrackcnv) |
void | setRecTrackCnv (RecTrackCnv *rectrackcnv) |
void | setTrigCnv (TrigCnv *trigcnv) |
void | setTrigCnv (TrigCnv *trigcnv) |
virtual StatusCode | updateServiceState (IOpaqueAddress *pAddress) |
virtual StatusCode | updateServiceState (IOpaqueAddress *pAddress) |
Update state of the service. | |
Protected Member Functions | |
RootCnvSvc (const std::string &name, ISvcLocator *svc) | |
RootCnvSvc (const std::string &name, ISvcLocator *svc) | |
virtual | ~RootCnvSvc () |
virtual | ~RootCnvSvc () |
Private Types | |
typedef std::map< std::string, Leaf * > | LeafMap |
Map with leaf entries. | |
typedef std::map< std::string, Leaf * > | LeafMap |
Map with leaf entries. | |
Private Member Functions | |
StatusCode | addConverters () |
Add converters to the service. | |
StatusCode | addConverters () |
Add converters to the service. | |
StatusCode | initFiles () |
StatusCode | initFiles () |
Private Attributes | |
commonData | m_common |
relational maps to be cleared | |
int | m_dbufSize |
buffer size for digi file | |
DigiCnv * | m_dCnv |
pointers to top converters | |
DigiCnv * | m_dCnv |
pointers to top converters | |
int | m_dcompressionLevel |
compression level for digix file | |
std::vector< std::string > | m_difileName |
digi input filename | |
std::vector< std::string > | m_difileName |
digi input filename | |
std::string | m_dofileName |
digi output filename | |
int | m_dsplitMode |
digi split mode | |
DstCnv * | m_dstCnv |
DstCnv * | m_dstCnv |
std::string | m_dtreeName |
digi treename | |
EventCnv * | m_eventCnv |
EventCnv * | m_eventCnv |
EvtHeaderCnv * | m_evtheaderCnv |
EvtHeaderCnv * | m_evtheaderCnv |
EvtRecCnv * | m_evtRecCnv |
EvtRecCnv * | m_evtRecCnv |
RootEvtSelector * | m_evtsel |
access to the EventSelector | |
RootEvtSelector * | m_evtsel |
access to the EventSelector | |
HltCnv * | m_hltCnv |
HltCnv * | m_hltCnv |
LeafMap | m_leaves |
McCnv * | m_mcCnv |
McCnv * | m_mcCnv |
const int | m_minSplit |
RecTrackCnv * | m_rectrackCnv |
RecTrackCnv * | m_rectrackCnv |
RootInterface * | m_rootInterface |
access to the RootInterface | |
RootInterface * | m_rootInterface |
access to the RootInterface | |
TrigCnv * | m_trigCnv |
TrigCnv * | m_trigCnv |
Friends | |
class | SvcFactory<RootCnvSvc> |
When a component requests an item not yet available on the TDS, the RootcnvSvc is called to find the appropriiate converter to gain access to the data and put it on the TDS. Based on SICb service written by Markus Frank. If an item is mentioned in the jobOptions as one to be written out, it will be converted from TDS to ROOT by the appropriate converter
Based on the RootCnvSvc of GLast.
|
Map with leaf entries.
|
|
Map with leaf entries.
|
|
00099 : ConversionSvc(name, svc, ROOT_StorageType), m_minSplit(1), m_evtsel(0) 00100 { 00101 StatusCode sc; 00102 MsgStream log(msgSvc(), "RootCnvSvc"); 00103 log << MSG::DEBUG << "RootCnvSvc::constructor" << endreq; 00104 00105 IService* isvc = 0; 00106 sc = serviceLocator()->getService ("RootEvtSelector", isvc, false); 00107 if (!sc.isSuccess()) sc = serviceLocator()->getService ("EventSelector", isvc, false); 00108 if (sc.isSuccess()) { 00109 sc = isvc->queryInterface(IID_IRootEvtSelector, (void**)&m_evtsel); 00110 } 00111 if(sc.isFailure()) { 00112 log << MSG::WARNING << "Unable to start event selector service within RootCnvSvc" << endreq; 00113 } 00114 00115 m_rootInterface= RootInterface::Instance(log); 00116 if (!m_rootInterface) log << MSG::ERROR << "Unable to start Root service within RootCnvSvc" << endreq; 00117 00118 00119 00120 //Digi 00121 declareProperty("digiTreeName", m_dtreeName="Event"); //"Rec"->"Event" 00122 00123 declareProperty("digiRootInputFile",m_difileName); 00124 if (m_difileName.size()==0){ 00125 m_difileName.push_back("digi.root"); 00126 } 00127 declareProperty("digiRootOutputFile",m_dofileName = ""); 00128 00129 // Split mode for writing the TTree [0,99] 00130 declareProperty("digiSplitMode", m_dsplitMode=m_minSplit); 00131 // Buffer size for writing ROOT data 00132 declareProperty("digiBufferSize", m_dbufSize=3200000); 00133 // ROOT default compression 00134 declareProperty("digiCompressionLevel", m_dcompressionLevel=1); 00135 00136 }
|
|
00171 { };
|
|
|
|
00171 { };
|
|
Add converters to the service.
|
|
Add converters to the service.
00503 { 00504 MsgStream log(msgSvc(), name()); 00505 declareObject(Leaf(EventModel::Dst::DstMdcDedxCol, MdcDedxCnv::classID(), "Event", "m_mdcDedxCol")); 00506 declareObject(Leaf(EventModel::Dst::Event, DstCnv::classID(), "Event", "")); 00507 declareObject(Leaf(EventModel::Digi::EmcDigiCol, EmcDigiCnv::classID(), "Event", "m_emcDigiCol")); 00508 declareObject(Leaf(EventModel::MC::EmcMcHitCol, EmcMcHitCnv::classID(), "Event", "m_emcMcHitCol")); 00509 declareObject(Leaf(EventModel::Dst::DstEmcShowerCol, EmcTrackCnv::classID(), "Event", "m_emcTrackCol")); 00510 00511 declareObject(Leaf("/Event", EventCnv::classID(), "", "")); 00512 declareObject(Leaf(EventModel::EventHeader, EvtHeaderCnv::classID(), "Event", "m_runId:m_eventId:m_time:m_eventTag:m_flag1:m_flag2")); 00513 declareObject(Leaf(EventModel::Dst::DstExtTrackCol, ExtTrackCnv::classID(), "Event", "m_extTrackCol")); 00514 declareObject(Leaf(EventModel::MC::Event, McCnv::classID(), "Event", "")); 00515 declareObject(Leaf(EventModel::MC::McParticleCol, McParticleCnv::classID(), "Event", "m_mcParticleCol")); 00516 declareObject(Leaf(EventModel::Digi::MdcDigiCol, MdcDigiCnv::classID(), "Event", "m_mdcDigiCol")); 00517 declareObject(Leaf(EventModel::Dst::DstMdcKalTrackCol, MdcKalTrackCnv::classID(), "Event", "m_mdcKalTrackCol")); 00518 declareObject(Leaf(EventModel::MC::MdcMcHitCol, MdcMcHitCnv::classID(), "Event", "m_mdcMcHitCol")); 00519 declareObject(Leaf(EventModel::Dst::DstMdcTrackCol, MdcTrackCnv::classID(), "Event", "m_mdcTrackCol")); 00520 declareObject(Leaf(EventModel::Digi::MucDigiCol, MucDigiCnv::classID(), "Event", "m_mucDigiCol")); 00521 declareObject(Leaf(EventModel::MC::MucMcHitCol, MucMcHitCnv::classID(), "Event", "m_mucMcHitCol")); 00522 declareObject(Leaf(EventModel::Dst::DstMucTrackCol, MucTrackCnv::classID(), "Event", "m_mucTrackCol")); 00523 declareObject(Leaf(EventModel::Digi::Event, DigiCnv::classID(), "Event", "m_fromMc")); 00524 declareObject(Leaf(EventModel::Digi::TofDigiCol, TofDigiCnv::classID(), "Event", "m_tofDigiCol")); 00525 declareObject(Leaf(EventModel::MC::TofMcHitCol, TofMcHitCnv::classID(), "Event", "m_tofMcHitCol")); 00526 declareObject(Leaf(EventModel::Dst::DstTofTrackCol, TofTrackCnv::classID(), "Event", "m_tofTrackCol")); 00527 //declareObject(Leaf("/Event/Digi/LumiDigiCol", LumiDigiCnv::classID(), "Event", "m_lumiDigiCol")); 00528 declareObject(Leaf(EventModel::Digi::LumiDigiCol, LumiDigiCnv::classID(), "Event", "m_lumiDigiCol")); 00529 00530 declareObject(Leaf(EventModel::Trig::Event, TrigCnv::classID(), "Event", "")); 00531 declareObject(Leaf(EventModel::Trig::TrigData, TrigDataCnv::classID(), "Event", "m_trigData")); 00532 00533 declareObject(Leaf(EventModel::Hlt::Event, HltCnv::classID(), "Event", "")); 00534 declareObject(Leaf(EventModel::Hlt::HltRawCol, HltRawCnv::classID(), "Event", "m_hltRawCol")); 00535 declareObject(Leaf(EventModel::Hlt::HltInf, HltInfCnv::classID(), "Event", "m_hltInf")); 00536 declareObject(Leaf(EventModel::Hlt::DstHltInf, DstHltInfCnv::classID(), "Event", "m_dstHltInf")); 00537 00538 declareObject(Leaf(EventModel::Recon::Event, RecTrackCnv::classID(), "Event", "")); 00539 00540 declareObject(Leaf(EventModel::Recon::RecMdcTrackCol, RecMdcTrackCnv::classID(), "Event", "m_recMdcTrackCol")); 00541 declareObject(Leaf(EventModel::Recon::RecMdcHitCol, RecMdcHitCnv::classID(), "Event", "m_recMdcHitCol")); 00542 declareObject(Leaf(EventModel::Recon::RecMdcKalTrackCol, RecMdcKalTrackCnv::classID(),"Event", "m_recMdcKalTrackCol")); 00543 declareObject(Leaf(EventModel::Recon::RecMdcKalHelixSegCol, RecMdcKalHelixSegCnv::classID(),"Event", "m_recMdcKalHelixSegCol")); 00544 declareObject(Leaf(EventModel::Recon::RecMdcDedxCol, RecMdcDedxCnv::classID(),"Event", "m_recMdcDedxCol")); 00545 declareObject(Leaf(EventModel::Recon::RecMdcDedxHitCol, RecMdcDedxHitCnv::classID(),"Event", "m_recMdcDedxHitCol")); 00546 00547 declareObject(Leaf(EventModel::Recon::RecEsTimeCol, RecEvTimeCnv::classID(),"Event", "m_recEvTimeCol")); 00548 declareObject(Leaf(EventModel::Recon::RecTofTrackCol, RecTofTrackCnv::classID(), "Event", "m_recTofTrackCol")); 00549 declareObject(Leaf(EventModel::Recon::RecBTofCalHitCol, RecBTofCalHitCnv::classID(), "Event", "m_recBTofCalHitCol")); 00550 declareObject(Leaf(EventModel::Recon::RecETofCalHitCol, RecETofCalHitCnv::classID(), "Event", "m_recETofCalHitCol")); 00551 declareObject(Leaf(EventModel::Recon::RecEmcHitCol, RecEmcHitCnv::classID(), "Event", "m_recEmcHitCol")); 00552 declareObject(Leaf(EventModel::Recon::RecEmcClusterCol, RecEmcClusterCnv::classID(), "Event", "m_recEmcClusterCol")); 00553 declareObject(Leaf(EventModel::Recon::RecEmcShowerCol, RecEmcShowerCnv::classID(), "Event", "m_recEmcShowerCol")); 00554 declareObject(Leaf(EventModel::Recon::RecMucTrackCol, RecMucTrackCnv::classID(), "Event", "m_recMucTrackCol")); 00555 declareObject(Leaf(EventModel::Recon::MucRecHitCol, RecMucRecHitCnv::classID(), "Event", "m_recMucHitCol")); 00556 declareObject(Leaf(EventModel::Recon::RecExtTrackCol, RecExtTrackCnv::classID(),"Event", "m_recExtTrackCol")); 00557 declareObject(Leaf(EventModel::EvtRec::Event, EvtRecCnv::classID(), "Event", "")); 00558 declareObject(Leaf(EventModel::EvtRec::EvtRecEvent, EvtRecEventCnv::classID(), "Event", "m_evtRecEvent")); 00559 declareObject(Leaf(EventModel::EvtRec::EvtRecTrackCol, EvtRecTrackCnv::classID(), "Event", "m_evtRecTrackCol")); 00560 declareObject(Leaf(EventModel::EvtRec::EvtRecPrimaryVertex, EvtRecPrimaryVertexCnv::classID(), "Event", "m_evtRecPrimaryVertex")); 00561 declareObject(Leaf(EventModel::EvtRec::EvtRecVeeVertexCol, EvtRecVeeVertexCnv::classID(), "Event", "m_evtRecVeeVertexCol")); 00562 declareObject(Leaf(EventModel::EvtRec::EvtRecPi0Col, EvtRecPi0Cnv::classID(), "Event", "m_evtRecPi0Col")); 00563 declareObject(Leaf(EventModel::EvtRec::EvtRecEtaToGGCol, EvtRecEtaToGGCnv::classID(), "Event", "m_evtRecEtaToGGCol")); 00564 declareObject(Leaf(EventModel::EvtRec::EvtRecDTagCol, EvtRecDTagCnv::classID(), "Event", "m_evtRecDTagCol")); 00565 00566 return StatusCode::SUCCESS; 00567 00568 }
|
|
Commit pending output (fill the TTrees).
|
|
Commit pending output (fill the TTrees).
00390 { 00391 00392 00393 00394 MsgStream log( msgSvc(), name() ); 00395 log << MSG::INFO << "RootCnvSvc::commitOutput starts." << endreq; 00396 00397 StatusCode sc=m_rootInterface->fillTrees(); 00398 if (sc.isFailure()) 00399 log << MSG::ERROR << "No Root tree was filled" << endreq; 00400 00401 // objects must be cleared after fill 00402 else{ 00403 TObject* oEvtHeader = m_evtheaderCnv->getWriteObject(); 00404 if (oEvtHeader) oEvtHeader->Clear(); 00405 TObject* o=m_dCnv->getWriteObject(); 00406 if (o) o->Clear(); 00407 TObject* oDst=m_dstCnv->getWriteObject(); 00408 if (oDst) oDst->Clear(); 00409 TObject* oMc=m_mcCnv->getWriteObject(); 00410 if (oMc) oMc->Clear(); 00411 TObject* oRecTrack=m_rectrackCnv->getWriteObject(); 00412 if (oRecTrack) oRecTrack->Clear(); 00413 TObject* oEvtRecEvent = m_evtRecCnv->getWriteObject(); 00414 if (oEvtRecEvent) oEvtRecEvent->Clear(); 00415 TObject* oTrig = m_trigCnv->getWriteObject(); 00416 if(oTrig) oTrig->Clear(); 00417 TObject* oHlt = m_hltCnv->getWriteObject(); 00418 if(oHlt) oHlt->Clear(); 00419 } 00420 m_common.clear(); 00421 00422 return sc; 00423 }
|
|
|
|
|
|
create address containing ROOT treename, branchname, entry number
|
|
00468 { 00469 00470 // create address for this object 00471 MsgStream log(msgSvc(), name()); 00472 00473 StatusCode status; 00474 LeafMap::iterator itm = m_leaves.find(path); 00475 SmartIF<IDataManagerSvc> iaddrReg(IID_IDataManagerSvc, dataProvider()); 00476 if ( itm != m_leaves.end() ) { 00477 Leaf* leaf = (*itm).second; 00478 if ( 0 != leaf ) { 00479 std::string spars[3] ; 00480 spars[0]=path; 00481 spars[1]=leaf->treename; 00482 spars[2]=leaf->branchname; 00483 00484 unsigned long ipars[2] = {0,0}; 00485 if (m_evtsel) ipars[0]=m_evtsel->getRecId(); 00486 status=addressCreator()->createAddress(ROOT_StorageType,leaf->clid,spars,ipars,newAddr); 00487 if ( status.isSuccess() ) { 00488 status = iaddrReg->registerAddress((IRegistry*)0,path, newAddr); 00489 if ( !status.isSuccess() ) { 00490 newAddr->release(); 00491 } 00492 } 00493 return StatusCode::SUCCESS; 00494 } 00495 } 00496 00497 00498 return StatusCode::FAILURE; 00499 }
|
|
00425 { 00426 00427 // create address for this object 00428 MsgStream log(msgSvc(), name()); 00429 00430 00431 log << MSG::INFO << "RootCnvSvc::createAddress"<<endreq; 00432 00433 StatusCode status = INVALID_ADDRESS; 00434 IRegistry* ent = obj->registry(); 00435 00436 if ( 0 != ent ) { 00437 SmartIF<IDataManagerSvc> iaddrReg(IID_IDataManagerSvc, dataProvider()); 00438 std::string path = ent->identifier(); 00439 LeafMap::iterator itm = m_leaves.find(path); 00440 00441 00442 if ( itm != m_leaves.end() ) { 00443 Leaf* leaf = (*itm).second; 00444 if ( 0 != leaf ) { 00445 std::string spars[3] ; 00446 spars[0]=path; 00447 spars[1]=leaf->treename; 00448 spars[2]=leaf->branchname; 00449 00450 00451 unsigned long ipars[2] ={0,0}; 00452 if (m_evtsel) ipars[0]=m_evtsel->getRecId(); 00453 00454 status=addressCreator()->createAddress(ROOT_StorageType,leaf->clid,spars,ipars,newAddr); 00455 if ( status.isSuccess() ) { 00456 status = iaddrReg->registerAddress((IRegistry*)0,path, newAddr); 00457 if ( !status.isSuccess() ) { 00458 newAddr->release(); 00459 } 00460 } 00461 return StatusCode::SUCCESS; 00462 } 00463 } 00464 } 00465 return status; 00466 }
|
|
create address containing ROOT treename, branchname, entry number
00369 { 00370 MsgStream log( msgSvc(), name() ); 00371 00372 if (svc_type != repSvcType() ) { 00373 log << MSG::ERROR << "RootCnvSvc::bad storage type" << svc_type << endreq; 00374 return StatusCode::FAILURE; 00375 } 00376 00377 std::string path = spars[0]; 00378 std::string treename = spars[1]; 00379 std::string branchname = spars[2]; 00380 int entry=ipars[0]; 00381 if (path.size()==0) path="/Event"; 00382 refpAddress = new RootAddress(ROOT_StorageType, 00383 clid, 00384 path,treename,branchname,entry); 00385 return StatusCode::SUCCESS; 00386 }
|
|
Associates a path on TDS with a particular converter.
|
|
Associates a path on TDS with a particular converter.
00289 { 00290 // Purpose and Method: Callback from each of the individual converters that allows 00291 // association of TDS path and converter. 00292 MsgStream log(msgSvc(), name()); 00293 log << MSG::DEBUG << "RootCnvSvc::declareObject " << leaf.path << " classid: " << leaf.clid << endreq; 00294 Leaf* ll = new Leaf(leaf); 00295 std::pair<LeafMap::iterator, bool> p = m_leaves.insert(LeafMap::value_type( leaf.path, ll) ); 00296 if( p.second ) { 00297 return StatusCode::SUCCESS; 00298 } 00299 delete ll; 00300 return StatusCode::FAILURE; 00301 }
|
|
|
|
00190 { 00191 MsgStream log(msgSvc(), name()); 00192 log << MSG::DEBUG << "RootCnvSvc::finalize" << endreq; 00193 00194 ConversionSvc::finalize(); 00195 // log << MSG::INFO<<"this is the end of RootCnvsvc finalize"<<endreq; 00196 for (LeafMap::iterator k = m_leaves.begin(); k != m_leaves.end(); k++ ) { 00197 delete (*k).second; 00198 } 00199 m_leaves.erase(m_leaves.begin(), m_leaves.end()); 00200 00201 return m_rootInterface->finalize(); 00202 }
|
|
00145 {return m_dCnv;}
|
|
00145 {return m_dCnv;}
|
|
00146 {return m_dstCnv;}
|
|
00146 {return m_dstCnv;}
|
|
00165 {return m_eventCnv;}
|
|
00165 {return m_eventCnv;}
|
|
00164 {return m_evtheaderCnv;}
|
|
00164 {return m_evtheaderCnv;}
|
|
00150 { return m_evtRecCnv; } //zoujh
|
|
00150 { return m_evtRecCnv; } //zoujh
|
|
00149 { return m_hltCnv; } //fucd
|
|
00149 { return m_hltCnv; } //fucd
|
|
00147 {return m_mcCnv;}
|
|
00147 {return m_mcCnv;}
|
|
00163 {return m_rectrackCnv;} //*******liangyt
|
|
00163 {return m_rectrackCnv;} //*******liangyt
|
|
00118 {return m_rootInterface;}
|
|
00118 {return m_rootInterface;}
|
|
00148 { return m_trigCnv; } //caogf
|
|
00148 { return m_trigCnv; } //caogf
|
|
|
|
00204 { 00205 MsgStream log(msgSvc(), name()); 00206 log << MSG::DEBUG << "RootCnvSvc::initFiles" << endreq; 00207 StatusCode sc=StatusCode::SUCCESS; 00208 00209 // Use the Job options service to set the Algorithm's parameters 00210 // This will retrieve parameters set in the job options file 00211 setProperties(); 00212 00213 //Read inpout files files from job options 00214 int nSize = m_difileName.size(); 00215 log<<MSG::INFO<<"Root Input files "<<nSize<<endreq; 00216 if(nSize == 0){ 00217 log<<MSG::INFO<<"Unable to find input file"<<endreq; 00218 return StatusCode::FAILURE; 00219 } 00220 00221 for(int i = 0;i<nSize;i++){ 00222 facilities::Util::expandEnvVar(&m_difileName[i]); 00223 std::string s=m_difileName[i]; 00224 std::vector<int> wildcardPos; 00225 for(int pos=0;pos<s.size();pos++) { 00226 pos=s.find_first_of('?',pos); 00227 if(pos!=-1) { 00228 wildcardPos.push_back(pos); 00229 } 00230 else{ 00231 break; 00232 } 00233 } 00234 if(wildcardPos.size()!=0) { 00235 int nEnd=facilities::Util::catchOptionVal(&s)+1; 00236 int maxNo=pow(10.,(int)wildcardPos.size()); 00237 if(nEnd!=0&&nEnd<maxNo) maxNo=nEnd; 00238 int nStart=facilities::Util::catchOptionVal(&s,0,"&(",")"); 00239 int i=1; 00240 if(nStart!=-1) i=nStart; 00241 if(nStart>nEnd) log<<MSG::WARNING<<"file's StartNo>EndNo"<<endreq; 00242 for(;i<maxNo;i++){ 00243 std::vector<int>::iterator it=wildcardPos.end(); 00244 int id=i; 00245 while(it!=wildcardPos.begin()){ 00246 it--; 00247 char c=id%10+48; 00248 id /=10; 00249 s.replace((*it),1,1,c); 00250 } 00251 if(access(s.c_str(),0)!=-1) { 00252 sc = m_rootInterface->addInput(m_dtreeName,s); 00253 if (sc.isFailure()) return sc; 00254 } 00255 } 00256 } 00257 else { 00258 sc = m_rootInterface->addInput(m_dtreeName,m_difileName[i]); 00259 if (sc.isFailure()) return sc; 00260 } 00261 } 00262 00263 //facilities::Util::expandEnvVar(&m_difileName[0]); 00264 //sc = m_rootInterface->addInput(m_dtreeName,m_difileName[0]); 00265 //if (sc.isFailure()) return sc; 00266 00267 00268 //Digi 00269 //facilities::Util::expandEnvVar(&m_difileName); 00270 facilities::Util::expandEnvVar(&m_dofileName); 00271 // sc = m_rootInterface->addInput(m_dtreeName,m_difileName); 00272 // if (sc.isFailure()) return sc; 00273 00274 if (m_dsplitMode<m_minSplit) { 00275 log << MSG::WARNING << "RootCnvSvc::initFiles Recon splitlevel cant be lower than "<<m_minSplit<<", reset" << endreq; 00276 m_dsplitMode=m_minSplit; 00277 } 00278 00279 if( "" != m_dofileName ){ 00280 sc=m_rootInterface->addOutput(m_dtreeName,m_dofileName,m_dsplitMode,m_dbufSize,m_dcompressionLevel); 00281 }else{ 00282 log << MSG::WARNING << "No specified digiRootOutputFile!" << endreq; 00283 } 00284 00285 return sc; 00286 }
|
|
|
|
00138 { 00139 // Purpose and Method: Setup GLAST's Event Converter Service. 00140 // Associate RootCnvSvc with the EventDataSvc 00141 // Associate the list of known converters with this RootCnvSvc 00142 // configure map of leaves 00143 00144 MsgStream log(msgSvc(), name()); 00145 log << MSG::DEBUG << "RootCnvSvc::initialize" << endreq; 00146 StatusCode status = ConversionSvc::initialize(); 00147 if ( status.isSuccess() ) { 00148 // ISvcLocator* svclocator = serviceLocator(); [unused for now] 00149 IDataProviderSvc *pIDP = 0; 00150 // Set event data service 00151 status = service("EventDataSvc", pIDP, true); 00152 if ( status.isSuccess() ) { 00153 status = setDataProvider ( pIDP ); 00154 } 00155 else { 00156 return status; 00157 } 00158 00159 00160 // Add converters to the service 00161 status = addConverters(); 00162 if ( !status.isSuccess() ) { 00163 log << MSG::ERROR << "Unable to add converters to the service" << endreq; 00164 return status; 00165 } 00166 00167 00168 // Now we have to configure the map of leaves 00169 // Which should contain the association of converters with 00170 // paths on the TDS 00171 for (LeafMap::iterator k = m_leaves.begin(); k != m_leaves.end(); k++ ) { 00172 std::string path = (*k).first; 00173 for (LeafMap::iterator j = m_leaves.begin(); j != m_leaves.end(); j++ ) { 00174 std::string path2 = (*j).first; 00175 std::string pp = (*j).first.substr(0, (*j).first.rfind("/")); 00176 if ( path == pp && path != (*j).first ) { 00177 (*k).second->push_back((*j).second); 00178 } 00179 } 00180 } 00181 } 00182 00183 // get properties and tell RootInterface about files 00184 status=initFiles(); 00185 00186 00187 return status; 00188 }
|
|
Override inherited queryInterface due to enhanced interface.
|
|
Override inherited queryInterface due to enhanced interface.
00351 { 00352 00353 if ( IID_IRootCnvSvc == riid ) { 00354 *ppvInterface = (RootCnvSvc*)this; 00355 } 00356 else { 00357 // Interface is not directly availible: try out a base class 00358 return ConversionSvc::queryInterface(riid, ppvInterface); 00359 } 00360 addRef(); 00361 return StatusCode::SUCCESS; 00362 }
|
|
00152 {m_dCnv=reccnv;}
|
|
00152 {m_dCnv=reccnv;}
|
|
00153 {m_dstCnv=dstcnv;}
|
|
00153 {m_dstCnv=dstcnv;}
|
|
00160 {m_eventCnv=eventCnv;}
|
|
00160 {m_eventCnv=eventCnv;}
|
|
00159 {m_evtheaderCnv=evtheadercnv;}
|
|
00159 {m_evtheaderCnv=evtheadercnv;}
|
|
00157 { m_evtRecCnv = evtreccnv; } //zoujh
|
|
00157 { m_evtRecCnv = evtreccnv; } //zoujh
|
|
00156 { m_hltCnv = hltcnv; } //fucd
|
|
00156 { m_hltCnv = hltcnv; } //fucd
|
|
00154 {m_mcCnv=mccnv;}
|
|
00154 {m_mcCnv=mccnv;}
|
|
00158 {m_rectrackCnv=rectrackcnv;}
|
|
00158 {m_rectrackCnv=rectrackcnv;}
|
|
00155 { m_trigCnv = trigcnv; } //caogf
|
|
00155 { m_trigCnv = trigcnv; } //caogf
|
|
|
|
Update state of the service.
00304 { 00305 00306 // not sure about the use of recid or bank... 00307 MsgStream log(msgSvc(), name()); 00308 00309 log << MSG::DEBUG << "RootCnvSvc::updateServiceState" << endreq; 00310 00311 StatusCode status = INVALID_ADDRESS; 00312 IRegistry* ent = pAddress->registry(); 00313 if ( 0 != ent ) { 00314 SmartIF<IDataManagerSvc> iaddrReg(IID_IDataManagerSvc, dataProvider()); 00315 // if ( 0 != iaddrReg ) { 00316 status = StatusCode::SUCCESS; 00317 std::string path = ent->identifier(); 00318 LeafMap::iterator itm = m_leaves.find(path); 00319 if ( itm != m_leaves.end() ) { 00320 Leaf* leaf = (*itm).second; 00321 if ( 0 != leaf ) { 00322 for ( Leaf::iterator il = leaf->begin(); il != leaf->end(); il++ ) { 00323 IOpaqueAddress* newAddr = 0; 00324 unsigned long ipars[2] = {0, 0}; // 00325 if (m_evtsel) ipars[0]=m_evtsel->getRecId(); 00326 00327 std::string spars[3]={(*il)->path,(*il)->treename,(*il)->branchname}; 00328 00329 StatusCode ir =createAddress(ROOT_StorageType, 00330 (*il)->clid, 00331 spars, 00332 ipars, 00333 newAddr); 00334 log << MSG::DEBUG << "RootCnvSvc::updateService " << " ***** " << 00335 (*il)->clid << " ***** " << (*il)->path <<endreq; 00336 00337 if ( ir.isSuccess() ) { 00338 ir = iaddrReg->registerAddress((*il)->path, newAddr); 00339 if ( !ir.isSuccess() ) { 00340 newAddr->release(); 00341 status = ir; 00342 } 00343 } 00344 } 00345 } 00346 } 00347 } 00348 return StatusCode::SUCCESS; 00349 }
|
|
|
|
relational maps to be cleared
|
|
buffer size for digi file
|
|
pointers to top converters
|
|
pointers to top converters
|
|
compression level for digix file
|
|
digi input filename
|
|
digi input filename
|
|
digi output filename
|
|
digi split mode
|
|
|
|
|
|
digi treename
|
|
|
|
|
|
|
|
|
|
|
|
|
|
access to the EventSelector
|
|
access to the EventSelector
|
|
|
|
|
|
|
|
|
|
|
|
properties minimal split required |
|
|
|
|
|
access to the RootInterface
|
|
access to the RootInterface
|
|
|
|
|