#include <HltInfCnv.h>
Inheritance diagram for HltInfCnv:
Public Types | |
typedef Ty1 | source |
typedef Ty2 | destination |
Public Member Functions | |
virtual | ~HltInfCnv () |
virtual long | repSvcType () const |
virtual StatusCode | initialize () |
virtual StatusCode | finalize () |
void | declareObject (const std::string &fullPath, const CLID &clid, const std::string &treename, const std::string &branchname) |
Store TDS path to link a particular converter to an object on the TDS. | |
virtual StatusCode | createObj (IOpaqueAddress *addr, DataObject *&dat) |
Convert the persistent object to transient. | |
virtual StatusCode | createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) |
Convert the transient object to the requested representation. | |
virtual StatusCode | fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
Resolve the references of the converted object. | |
virtual StatusCode | fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
Resolve the references of the converted object. | |
TObject * | getReadObject () const |
get the object to be read | |
destination * | operator (const source &) const |
Static Public Member Functions | |
static const CLID & | classID () |
static const unsigned char | storageType () |
Storage type and class ID. | |
Protected Member Functions | |
HltInfCnv (ISvcLocator *svc) | |
virtual StatusCode | DataObjectToTObject (DataObject *obj, RootAddress *addr) |
transformation to root | |
virtual StatusCode | TObjectToDataObject (DataObject *&obj) |
transformation from root | |
virtual destination * | convert (const source &) const =0 |
Protected Attributes | |
RootCnvSvc * | m_cnvSvc |
std::vector< RootCnvSvc::Leaf > | m_leaves |
RootInterface * | m_rootInterface |
pointer to the RootInterface | |
IDataProviderSvc * | m_eds |
pointer to eventdataservice | |
int | m_branchNr |
the branchNr of this converter for writing | |
int | m_branchNrDst |
int | m_branchNrMc |
int | m_branchNrRecon |
int | m_branchNrEvtRec |
int | m_branchNrEvtHeader |
int | m_branchNrEvtNavigator |
TObject * | m_objRead |
the object that was read | |
CLID | CLID_top |
the CLID of the upper converter if any | |
TArrayS * | m_branchNumbers |
array with number of branches for reading | |
std::string | m_rootBranchname |
root branchname (may be concatenated of severals) | |
std::string | m_rootTreename |
each converter knows it's treename | |
std::string | m_currentFileName |
std::vector< void * > | m_adresses |
each converter knows the corresponding adresses | |
RootEvtSelector * | m_evtsel |
Private Attributes | |
THltInf * | m_hltInf |
root object to be read | |
bool | m_old |
old version flag | |
Friends | |
class | CnvFactory< HltInfCnv > |
Definition at line 20 of file HltInfCnv.h.
typedef Ty2 Converter< Ty1, Ty2 >::destination [inherited] |
Definition at line 19 of file Converter.h.
Definition at line 18 of file Converter.h.
virtual HltInfCnv::~HltInfCnv | ( | ) | [inline, virtual] |
HltInfCnv::HltInfCnv | ( | ISvcLocator * | svc | ) | [protected] |
Definition at line 23 of file HltInfCnv.cxx.
References RootEventBaseCnv::m_adresses, m_hltInf, RootEventBaseCnv::m_rootBranchname, and msgSvc().
00024 : RootEventBaseCnv(classID(), svc), 00025 m_old(false) 00026 { 00027 // Here we associate this converter with the /Event path on the TDS. 00028 MsgStream log(msgSvc(), "HltInfCnv"); 00029 //log << MSG::DEBUG << "Constructor called for " << objType() << endreq; 00030 m_rootBranchname ="m_hltInf"; 00031 //declareObject(EventModel::MC::HltInf, objType(), m_rootTreename, m_rootBranchname); 00032 m_adresses.push_back(&m_hltInf); 00033 m_hltInf=0; 00034 }
static const CLID& HltInfCnv::classID | ( | ) | [inline, static] |
Definition at line 25 of file HltInfCnv.h.
References CLID_HltInf.
Referenced by RootCnvSvc::addConverters().
00026 { 00027 return CLID_HltInf; 00028 }
virtual destination* Converter< Ty1, Ty2 >::convert | ( | const source & | ) | const [protected, pure virtual, inherited] |
StatusCode RootEventBaseCnv::createObj | ( | IOpaqueAddress * | addr, | |
DataObject *& | dat | |||
) | [virtual, inherited] |
Convert the persistent object to transient.
Reimplemented in EventCnv.
Definition at line 157 of file RootEventBaseCnv.cxx.
References RootEventBaseCnv::CLID_top, Bes_Common::DEBUG, calibUtil::ERROR, RootInterface::getBranchEntry(), RootAddress::getBranchname(), RootInterface::getCurrentFileName(), RootInterface::getENDFILE(), RootInterface::getEntries(), RootAddress::getEntryNr(), RootAddress::getNrBranches(), RootAddress::getPath(), RootEventBaseCnv::getReadObject(), RootEvtSelector::getRecId(), RootInterface::getSelectFromTag(), RootAddress::getTreename(), Bes_Common::INFO, RootEventBaseCnv::m_adresses, RootEventBaseCnv::m_branchNumbers, RootEventBaseCnv::m_currentFileName, RootEventBaseCnv::m_eds, RootEventBaseCnv::m_evtsel, RootEventBaseCnv::m_objRead, RootEventBaseCnv::m_rootInterface, msgSvc(), RootInterface::setBranchAddress(), RootAddress::setEntryNr(), subSeperate::temp, and RootEventBaseCnv::TObjectToDataObject().
00158 { 00159 // transform ROOT object to TDS object 00160 MsgStream log(msgSvc(), "RootEventBaseCnv"); 00161 log << MSG::DEBUG << "RootEventBaseCnv::createObj with clid " <<addr->clID()<< endreq; 00162 StatusCode sc; 00163 00164 // add 2005-11-29 00165 // log<<MSG::INFO<<"######### RootEventBaseCnv ::createObj begin of createObj: m_branchNumbers "<<m_branchNumbers->GetSize()<<"###############"<<endreq; 00166 00167 RootAddress *raddr=dynamic_cast<RootAddress *>(addr); 00168 if (!raddr) { 00169 log << MSG::ERROR << "Could not downcast to Root address" << endreq; 00170 return StatusCode::FAILURE; 00171 } 00172 00173 static int temp =0; //control the begin of each files 2005-12-01 00174 static int entryN =0; //control the event number of each files 2005-21-01 00175 static int brN =0; //control munber of branch of the tree; 00176 int lastBrn = brN; 00177 //lastBrn = brN; 00178 static int branchN=0; 00179 static bool isSet=true; 00180 00181 static int entryBefore = 0; 00182 static bool addEntryEachFile = true; 00183 00184 00185 if(m_rootInterface->getENDFILE() || (temp >0 && temp < branchN)){ // if the file has get the end:y the go to next file to create a new tree 00186 00187 if(m_rootInterface->getENDFILE() ) { 00188 entryN = 0; 00189 } 00190 00191 temp++; 00192 00193 delete m_branchNumbers; 00194 m_branchNumbers = new TArrayS(0); 00195 00196 if(temp == branchN) { 00197 temp =0; 00198 } 00199 } 00200 00201 if(m_rootInterface->getENDFILE()) addEntryEachFile = true; 00202 // the 2nd method 00203 if(m_evtsel->getRecId() - entryBefore == 0) { // first event in this file 00204 delete m_branchNumbers; 00205 m_branchNumbers = new TArrayS(0); 00206 } 00207 00208 //new method to initialize the branchNumber 00209 if(m_currentFileName=="") m_currentFileName = m_rootInterface->getCurrentFileName(); 00210 if(!(m_currentFileName == m_rootInterface->getCurrentFileName())){ 00211 m_currentFileName = m_rootInterface->getCurrentFileName(); 00212 delete m_branchNumbers; 00213 m_branchNumbers = new TArrayS(0); 00214 } 00215 //---------------------------------------- 00216 00217 if (m_branchNumbers->GetSize()<=0) { 00218 if(isSet) brN++; 00219 int branchNumber; 00220 for (int nb=0;nb<raddr->getNrBranches();nb++) { 00221 sc=m_rootInterface->setBranchAddress(raddr->getTreename().c_str(),raddr->getBranchname(nb).c_str(),m_adresses[nb],branchNumber); 00222 if (!sc.isSuccess()) 00223 { 00224 if(isSet) brN--; //liangyt: if fail to retrieve this branch, this will be not a effective branch. 00225 //entryN++; //liangyt: this is the second method 00226 if(temp>0) temp--; //temp > 0 means recording effective branch number. 00227 return sc; 00228 } 00229 m_branchNumbers->Set(nb+1); 00230 m_branchNumbers->AddAt(branchNumber,nb); 00231 00232 } 00233 } 00234 00236 if(addEntryEachFile&&(m_evtsel->getRecId()>entryBefore)){ // for a new file, add entry for ONLY one time. 00237 entryBefore += m_rootInterface->getEntries(); 00238 addEntryEachFile = false; 00239 } 00240 00241 if(lastBrn == brN && isSet ){ 00242 branchN = brN; 00243 isSet=false; 00244 } 00245 00246 if(isSet==false) log << MSG::INFO <<" 1st method set event as : "<<int(entryN/branchN)<<endreq; 00247 if(isSet==false) raddr->setEntryNr(int(entryN/branchN));//former method, keep it to be backup. 00248 if(m_evtsel) log << MSG::INFO <<" event id = "<<m_evtsel->getRecId()<<endreq; 00249 00250 00251 int eventID = 0; 00252 if(entryBefore > m_evtsel->getRecId()) 00253 eventID = m_evtsel->getRecId() + m_rootInterface->getEntries() - entryBefore; 00254 else if(entryBefore == m_evtsel->getRecId()) eventID = 0; 00255 else log << MSG::ERROR <<"eventId error!!!"<<endreq; 00256 00257 log << MSG::INFO <<" 2nd method set event as : "<<eventID<<endreq; 00258 00259 if(m_evtsel) raddr->setEntryNr(eventID); 00260 00261 //add dengzy 00262 if(m_rootInterface->getSelectFromTag()!=0) 00263 { 00264 if(m_evtsel) 00265 raddr->setEntryNr( m_evtsel->getRecId() ); 00266 }//end of add by dengzy 00267 00268 // read branch 00269 00270 if (m_branchNumbers->GetSize()>0) { 00271 int nbtot=0,nb; 00272 for (int ib=0;ib<m_branchNumbers->GetSize();ib++) { 00273 //sc=m_rootInterface->getBranchEntry(m_branchNumbers->At(ib),raddr->getEntryNr(),nb); 00274 //change to get branch entry with addr(set address for each entry) liangyt 00275 sc=m_rootInterface->getBranchEntry(m_branchNumbers->At(ib),raddr->getEntryNr(),m_adresses[ib],nb); 00276 if (sc.isFailure()) { 00277 log << MSG::ERROR << "Could not read branch " << raddr->getBranchname(nb) << endreq; 00278 return sc; 00279 } 00280 nbtot+=nb; 00281 } 00282 } 00283 00284 else { // get ROOT object 00285 if (CLID_top) { 00286 IConverter *p=conversionSvc()->converter(CLID_top); 00287 RootEventBaseCnv *cnv=dynamic_cast<RootEventBaseCnv *>(p); 00288 if (!cnv) { 00289 log << MSG::ERROR << "Could not downcast to RootEventBaseCnv " << endreq; 00290 return StatusCode::FAILURE; 00291 } 00292 m_objRead=cnv->getReadObject(); 00293 } 00294 } 00295 00296 //do concrete transformation in derived converter 00297 sc = TObjectToDataObject(refpObject); 00298 if (sc.isFailure()) { 00299 log << MSG::ERROR << "Could not transform object" << endreq; 00300 return sc; 00301 } 00302 00303 // verify if we have to register 00304 IRegistry* ent = addr->registry(); 00305 if ( ent == 0) { 00306 sc=m_eds->registerObject(raddr->getPath(),refpObject); 00307 if (sc.isFailure()) { 00308 log << MSG::ERROR << "Could not register object " << raddr->getPath()<<" status "<<sc.getCode()<<endreq; 00309 } 00310 // } 00311 } 00312 00313 entryN++; 00314 return StatusCode::SUCCESS; 00315 }
StatusCode RootEventBaseCnv::createRep | ( | DataObject * | pObject, | |
IOpaqueAddress *& | refpAddress | |||
) | [virtual, inherited] |
Convert the transient object to the requested representation.
Definition at line 78 of file RootEventBaseCnv.cxx.
References RootCnvSvc::createAddress(), RootEventBaseCnv::DataObjectToTObject(), calibUtil::ERROR, RootEventBaseCnv::m_cnvSvc, and msgSvc().
Referenced by TrigDataCnv::DataObjectToTObject(), RecZddChannelCnv::DataObjectToTObject(), RecTofTrackCnv::DataObjectToTObject(), RecMucTrackCnv::DataObjectToTObject(), RecMdcTrackCnv::DataObjectToTObject(), RecMdcKalTrackCnv::DataObjectToTObject(), RecMdcKalHelixSegCnv::DataObjectToTObject(), RecMdcHitCnv::DataObjectToTObject(), RecMdcDedxHitCnv::DataObjectToTObject(), RecMdcDedxCnv::DataObjectToTObject(), RecExtTrackCnv::DataObjectToTObject(), RecEvTimeCnv::DataObjectToTObject(), RecEmcShowerCnv::DataObjectToTObject(), RecEmcHitCnv::DataObjectToTObject(), RecEmcClusterCnv::DataObjectToTObject(), TofMcHitCnv::DataObjectToTObject(), MucMcHitCnv::DataObjectToTObject(), MdcMcHitCnv::DataObjectToTObject(), McParticleCnv::DataObjectToTObject(), EmcMcHitCnv::DataObjectToTObject(), HltRawCnv::DataObjectToTObject(), DataObjectToTObject(), DstHltInfCnv::DataObjectToTObject(), EvtRecVeeVertexCnv::DataObjectToTObject(), EvtRecTrackCnv::DataObjectToTObject(), EvtRecPrimaryVertexCnv::DataObjectToTObject(), EvtRecPi0Cnv::DataObjectToTObject(), EvtRecEventCnv::DataObjectToTObject(), EvtRecEtaToGGCnv::DataObjectToTObject(), EvtRecDTagCnv::DataObjectToTObject(), TofTrackCnv::DataObjectToTObject(), MucTrackCnv::DataObjectToTObject(), MdcTrackCnv::DataObjectToTObject(), MdcKalTrackCnv::DataObjectToTObject(), MdcDedxCnv::DataObjectToTObject(), ExtTrackCnv::DataObjectToTObject(), EmcTrackCnv::DataObjectToTObject(), TofDigiCnv::DataObjectToTObject(), MucDigiCnv::DataObjectToTObject(), MdcDigiCnv::DataObjectToTObject(), LumiDigiCnv::DataObjectToTObject(), and EmcDigiCnv::DataObjectToTObject().
00079 { 00080 // Purpose and Method: Convert the transient object to ROOT 00081 00082 MsgStream log(msgSvc(), "RootEventBaseCnv"); 00083 00084 StatusCode sc= StatusCode::SUCCESS; 00085 // get the corresponding address 00086 RootAddress *rootaddr; 00087 sc=m_cnvSvc->createAddress(obj,addr); 00088 00089 rootaddr = dynamic_cast<RootAddress *>(addr); 00090 00091 if (sc.isFailure() || !rootaddr ) { 00092 log << MSG::ERROR << "Could not create address for clid " <<obj->clID()<<", objname "<<obj->name()<<endreq; 00093 return StatusCode::FAILURE; 00094 } 00095 00096 // do the real conversion in the derived converter 00097 sc = DataObjectToTObject(obj,rootaddr); 00098 00099 delete addr; 00100 addr = NULL; 00101 00102 if (sc.isFailure()) { 00103 log << MSG::ERROR << "Could not transform object" << endreq; 00104 return sc; 00105 } 00106 00107 return StatusCode::SUCCESS; 00108 }
StatusCode HltInfCnv::DataObjectToTObject | ( | DataObject * | obj, | |
RootAddress * | addr | |||
) | [protected, virtual] |
transformation to root
Implements RootEventBaseCnv.
Definition at line 135 of file HltInfCnv.cxx.
References THltEvent::addHltInf(), THltEvent::clearHltInf(), HltID::CON, RootEventBaseCnv::createRep(), Bes_Common::DEBUG, HltID::EMC, calibUtil::ERROR, EventModel::Hlt::Event, DstHltInf::getAlgProcess(), DstHltInf::getCriteriaTable(), HltInf::getDataVec(), DstHltInf::getEventType(), RootCnvSvc::getHltCnv(), THltEvent::getHltInf(), DstHltInf::getNCON(), DstHltInf::getNumber(), DstHltInf::getTotalEnergy(), DstHltInf::getVersion(), HltCnv::getWriteObject(), RootEventBaseCnv::m_cnvSvc, RootEventBaseCnv::m_eds, HltID::MDC, msgSvc(), HltID::MUC, THltInf::setAlgProcess(), THltInf::setConData(), THltInf::setCriteriaTable(), THltInf::setEmcData(), THltInf::setEventType(), THltInf::setMdcData(), THltInf::setMucData(), THltInf::setNCON(), THltInf::setNumber(), THltInf::setTofData(), THltInf::setTotalEnergy(), THltInf::setVersion(), HltID::TOF, and type.
00135 { 00136 00137 MsgStream log(msgSvc(), "HltInfCnv"); 00138 log << MSG::DEBUG << "HltInfCnv::DataObjectToTObject" << endreq; 00139 StatusCode sc=StatusCode::SUCCESS; 00140 00141 HltInf * hltInfCnvTds=dynamic_cast<HltInf*> (obj); 00142 if (!hltInfCnvTds) { 00143 log << MSG::ERROR << "Could not downcast to HltInf" << endreq; 00144 return StatusCode::FAILURE; 00145 } 00146 00147 DataObject *evt; 00148 m_eds->findObject(EventModel::Hlt::Event,evt); 00149 if (evt==NULL) { 00150 log << MSG::ERROR << "Could not get HltInf in TDS " << endreq; 00151 return StatusCode::FAILURE; 00152 } 00153 00154 HltEvent * devtTds=dynamic_cast<HltEvent *> (evt); 00155 if (!devtTds) { 00156 log << MSG::ERROR << "HltInfCnv:Could not downcast to TDS HltInf" << endreq; 00157 } 00158 00159 IOpaqueAddress *addr; 00160 m_cnvSvc->getHltCnv()->createRep(evt,addr); 00161 00162 THltEvent *hltInf=m_cnvSvc->getHltCnv()->getWriteObject(); 00163 00164 const TObject *tHltInf = hltInf->getHltInf(); 00165 if (!tHltInf) return sc; 00166 hltInf->clearHltInf(); 00167 00168 Int_t type = hltInfCnvTds->getEventType(); 00169 Int_t alg = hltInfCnvTds->getAlgProcess(); 00170 Int_t cri = hltInfCnvTds->getCriteriaTable(); 00171 Int_t ver = hltInfCnvTds->getVersion(); 00172 Double_t etot = hltInfCnvTds->getTotalEnergy(); 00173 Int_t nsub = hltInfCnvTds->getNumber(); 00174 Int_t ncon = hltInfCnvTds->getNCON(); 00175 00176 THltInf *hltInfRoot = new THltInf(); 00177 00178 hltInfRoot->setEventType(type); 00179 hltInfRoot->setAlgProcess(alg); 00180 hltInfRoot->setCriteriaTable(cri); 00181 hltInfRoot->setVersion(ver); 00182 hltInfRoot->setTotalEnergy(etot); 00183 hltInfRoot->setNumber(nsub); 00184 hltInfRoot->setNCON(ncon); 00185 00186 00187 std::vector<uint32_t> mdcTds=hltInfCnvTds->getDataVec(HltID::MDC); 00188 std::vector<Int_t> mdcRoot; 00189 std::vector<uint32_t>::iterator it= mdcTds.begin(); 00190 for(;it!=mdcTds.end();it++){ 00191 Int_t data=*it; 00192 mdcRoot.push_back(data); 00193 } 00194 hltInfRoot->setMdcData(mdcRoot); 00195 00196 std::vector<uint32_t> tofTds=hltInfCnvTds->getDataVec(HltID::TOF); 00197 std::vector<Int_t> tofRoot; 00198 for(it= tofTds.begin();it!=tofTds.end();it++){ 00199 Int_t data=*it; 00200 tofRoot.push_back(data); 00201 } 00202 hltInfRoot->setTofData(tofRoot); 00203 00204 std::vector<uint32_t> emcTds=hltInfCnvTds->getDataVec(HltID::EMC); 00205 std::vector<Int_t> emcRoot; 00206 for(it= emcTds.begin();it!=emcTds.end();it++){ 00207 Int_t data=*it; 00208 emcRoot.push_back(data); 00209 } 00210 hltInfRoot->setEmcData(emcRoot); 00211 00212 std::vector<uint32_t> mucTds=hltInfCnvTds->getDataVec(HltID::MUC); 00213 std::vector<Int_t> mucRoot; 00214 for(it= mucTds.begin();it!=mucTds.end();it++){ 00215 Int_t data=*it; 00216 mucRoot.push_back(data); 00217 } 00218 hltInfRoot->setMucData(mucRoot); 00219 00220 std::vector<uint32_t> conTds=hltInfCnvTds->getDataVec(HltID::CON); 00221 std::vector<Int_t> conRoot; 00222 for(it= conTds.begin();it!=conTds.end();it++){ 00223 Int_t data=*it; 00224 conRoot.push_back(data); 00225 } 00226 hltInfRoot->setConData(conRoot); 00227 00228 hltInf->addHltInf(hltInfRoot); 00229 00230 return StatusCode::SUCCESS; 00231 }
void RootEventBaseCnv::declareObject | ( | const std::string & | fullPath, | |
const CLID & | clid, | |||
const std::string & | treename, | |||
const std::string & | branchname | |||
) | [inherited] |
Store TDS path to link a particular converter to an object on the TDS.
Definition at line 150 of file RootEventBaseCnv.cxx.
References RootEventBaseCnv::m_leaves.
Referenced by RecMucRecHitCnv::RecMucRecHitCnv().
00151 { 00152 // Purpose and Method: Save the path on the TDS, treename, pathname in the m_leaves vector, 00153 // corresponding to the DataObject that the converter handles. 00154 m_leaves.push_back(RootCnvSvc::Leaf(path, cl,treename,branchname)); 00155 }
StatusCode RootEventBaseCnv::fillObjRefs | ( | IOpaqueAddress * | pAddress, | |
DataObject * | pObject | |||
) | [virtual, inherited] |
Resolve the references of the converted object.
Definition at line 117 of file RootEventBaseCnv.cxx.
References msgSvc().
00118 { 00119 // Purpose and Method: Resolve the references of the converted object. 00120 // It is expected that derived classes will override this method. 00121 MsgStream log(msgSvc(), "RootEventBaseCnv"); 00122 return StatusCode::SUCCESS; 00123 }
StatusCode RootEventBaseCnv::fillRepRefs | ( | IOpaqueAddress * | pAddress, | |
DataObject * | pObject | |||
) | [virtual, inherited] |
Resolve the references of the converted object.
Definition at line 109 of file RootEventBaseCnv.cxx.
References msgSvc().
00110 { 00111 // Purpose and Method: Resolve the references of the converted object. 00112 // It is expected that derived classes will override this method. 00113 MsgStream log(msgSvc(), "RootEventBaseCnv"); 00114 return StatusCode::SUCCESS; 00115 }
StatusCode RootEventBaseCnv::finalize | ( | ) | [virtual, inherited] |
Definition at line 142 of file RootEventBaseCnv.cxx.
References RootEventBaseCnv::m_cnvSvc.
00142 { 00143 if ( m_cnvSvc ) { 00144 m_cnvSvc->release(); 00145 m_cnvSvc=0; 00146 } 00147 return Converter::finalize(); 00148 }
TObject* RootEventBaseCnv::getReadObject | ( | ) | const [inline, inherited] |
get the object to be read
Definition at line 125 of file RootEventBaseCnv.h.
References RootEventBaseCnv::m_objRead.
Referenced by RootEventBaseCnv::createObj().
00125 { return m_objRead;}
StatusCode RootEventBaseCnv::initialize | ( | ) | [virtual, inherited] |
Reimplemented in DigiCnv, DstCnv, EvtHeaderCnv, EvtNavigatorCnv, EvtRecCnv, HltCnv, McCnv, RecTrackCnv, and TrigCnv.
Definition at line 126 of file RootEventBaseCnv.cxx.
References IID_IRootCnvSvc, and RootEventBaseCnv::m_cnvSvc.
Referenced by TrigCnv::initialize(), RecTrackCnv::initialize(), McCnv::initialize(), HltCnv::initialize(), EvtRecCnv::initialize(), EvtNavigatorCnv::initialize(), EvtHeaderCnv::initialize(), DstCnv::initialize(), and DigiCnv::initialize().
00126 { 00127 00128 StatusCode status = Converter::initialize(); 00129 00130 if ( status.isSuccess() ) { 00131 IService* isvc = 0; 00132 status = serviceLocator()->service("RootCnvSvc", isvc, false); 00133 if ( !status.isSuccess() ) status = serviceLocator()->service("EventCnvSvc", isvc, true); 00134 if ( status.isSuccess() ) { 00135 status = isvc->queryInterface(IID_IRootCnvSvc, (void**)&m_cnvSvc); 00136 } 00137 } 00138 00139 return status; 00140 }
destination* Converter< Ty1, Ty2 >::operator | ( | const source & | ) | const [inline, inherited] |
virtual long RootEventBaseCnv::repSvcType | ( | ) | const [inline, virtual, inherited] |
Definition at line 88 of file RootEventBaseCnv.h.
References ROOT_StorageType.
00088 { 00089 return ROOT_StorageType; 00090 }
static const unsigned char RootEventBaseCnv::storageType | ( | ) | [inline, static, inherited] |
Storage type and class ID.
Definition at line 84 of file RootEventBaseCnv.h.
References ROOT_StorageType.
00084 { 00085 return ROOT_StorageType; 00086 }
StatusCode HltInfCnv::TObjectToDataObject | ( | DataObject *& | obj | ) | [protected, virtual] |
transformation from root
Implements RootEventBaseCnv.
Definition at line 36 of file HltInfCnv.cxx.
References Bes_Common::DEBUG, THltInf::getAlgProcess(), THltInf::getConData(), THltInf::getCriteriaTable(), THltInf::getEmcData(), THltInf::getEventType(), HltID::getID_EMC_MAX(), HltID::getID_MDC_MAX(), HltID::getID_MUC_MAX(), HltID::getID_TOF_MAX(), THltInf::getMdcData(), THltInf::getMucData(), THltInf::getNCON(), THltInf::getNumber(), THltInf::getTofData(), THltInf::getTotalEnergy(), THltInf::getVersion(), m_hltInf, msgSvc(), HltInf::push_con(), HltInf::push_emc(), HltInf::push_mdc(), HltInf::push_muc(), HltInf::push_tof(), DstHltInf::setAlgProcess(), DstHltInf::setCriteriaTable(), DstHltInf::setEventType(), DstHltInf::setNCON(), DstHltInf::setNumber(), DstHltInf::setTotalEnergy(), and DstHltInf::setVersion().
00036 { 00037 // creation of TDS object from root object 00038 00039 MsgStream log(msgSvc(), "HltInfCnv"); 00040 log << MSG::DEBUG << "HltInfCnv::TObjectToDataObject" << endreq; 00041 StatusCode sc=StatusCode::SUCCESS; 00042 00043 // create the TDS location for the trigger data 00044 HltInf* hltInfTds = new HltInf; 00045 refpObject=hltInfTds; 00046 00047 // now convert 00048 if(!m_hltInf) return sc; 00049 00050 int evt = m_hltInf->getEventType(); 00051 int alg = m_hltInf->getAlgProcess(); 00052 int cri = m_hltInf->getCriteriaTable(); 00053 int ver = m_hltInf->getVersion(); 00054 float etot = m_hltInf->getTotalEnergy(); 00055 hltInfTds->setEventType(evt); 00056 hltInfTds->setAlgProcess(alg); 00057 hltInfTds->setCriteriaTable(cri); 00058 hltInfTds->setVersion(ver); 00059 hltInfTds->setTotalEnergy(etot); 00060 00061 try{ 00062 uint32_t nsub= m_hltInf->getNumber(); 00063 uint32_t ncon= m_hltInf->getNCON(); 00064 uint32_t nmdc= nsub &0XFF; 00065 uint32_t ntof=(nsub>>8 )&0XFF; 00066 uint32_t nemc=(nsub>>16)&0XFF; 00067 uint32_t nmuc= nsub>>24; 00068 if(nmuc>HltID::getID_MUC_MAX()+1 || nemc>HltID::getID_EMC_MAX()+1 00069 ||ntof>HltID::getID_TOF_MAX()+1 || nmdc>HltID::getID_MDC_MAX()+1){ 00070 throw exception(); 00071 } 00072 hltInfTds->setNumber(nsub); 00073 hltInfTds->setNCON(ncon); 00074 00075 std::vector<Int_t> mdcRoot=m_hltInf->getMdcData(); 00076 if(mdcRoot.size()!=nmdc) { 00077 throw exception(); 00078 } 00079 std::vector<Int_t>::iterator it=mdcRoot.begin(); 00080 for(;it!=mdcRoot.end();it++){ 00081 uint32_t data=*it; 00082 hltInfTds->push_mdc(data); 00083 } 00084 std::vector<Int_t> tofRoot=m_hltInf->getTofData(); 00085 if(tofRoot.size()!=ntof) { 00086 throw exception(); 00087 } 00088 it=tofRoot.begin(); 00089 for(;it!=tofRoot.end();it++){ 00090 uint32_t data=*it; 00091 hltInfTds->push_tof(data); 00092 } 00093 std::vector<Int_t> emcRoot=m_hltInf->getEmcData(); 00094 if(emcRoot.size()!=nemc) { 00095 throw exception(); 00096 } 00097 it=emcRoot.begin(); 00098 for(;it!=emcRoot.end();it++){ 00099 uint32_t data=*it; 00100 hltInfTds->push_emc(data); 00101 } 00102 std::vector<Int_t> mucRoot=m_hltInf->getMucData(); 00103 if(mucRoot.size()!=nmuc) { 00104 throw exception(); 00105 } 00106 it=mucRoot.begin(); 00107 for(;it!=mucRoot.end();it++){ 00108 uint32_t data=*it; 00109 hltInfTds->push_muc(data); 00110 } 00111 std::vector<Int_t> conRoot=m_hltInf->getConData(); 00112 if(conRoot.size()!=ncon) { 00113 throw exception(); 00114 } 00115 it=conRoot.begin(); 00116 for(;it!=conRoot.end();it++){ 00117 uint32_t data=*it; 00118 hltInfTds->push_con(data); 00119 } 00120 } 00121 catch(...){ 00122 //log << MSG::ERROR << "***********************************************************" << endreq; 00123 //log << MSG::ERROR << "Input ROOT object is older version, please reconstrut again" << endreq; 00124 //log << MSG::ERROR << " or check out old RootCnvSvc! (mailto: fucd@ihep.ac.cn)" << endreq; 00125 //log << MSG::WARNING << "***** Continuing run may cause a little memory leakage ****" << endreq; 00126 //m_old=true; 00127 } 00128 00129 delete m_hltInf; 00130 m_hltInf = 0; 00131 00132 return StatusCode::SUCCESS; 00133 }
friend class CnvFactory< HltInfCnv > [friend] |
Definition at line 22 of file HltInfCnv.h.
CLID RootEventBaseCnv::CLID_top [protected, inherited] |
the CLID of the upper converter if any
Definition at line 61 of file RootEventBaseCnv.h.
Referenced by RootEventBaseCnv::createObj(), and RootEventBaseCnv::RootEventBaseCnv().
std::vector<void *> RootEventBaseCnv::m_adresses [protected, inherited] |
each converter knows the corresponding adresses
Definition at line 73 of file RootEventBaseCnv.h.
Referenced by RootEventBaseCnv::createObj(), DigiCnv::DigiCnv(), DstHltInfCnv::DstHltInfCnv(), EmcDigiCnv::EmcDigiCnv(), EmcMcHitCnv::EmcMcHitCnv(), EmcTrackCnv::EmcTrackCnv(), EvtHeaderCnv::EvtHeaderCnv(), EvtNavigatorCnv::EvtNavigatorCnv(), EvtRecDTagCnv::EvtRecDTagCnv(), EvtRecEtaToGGCnv::EvtRecEtaToGGCnv(), EvtRecEventCnv::EvtRecEventCnv(), EvtRecPi0Cnv::EvtRecPi0Cnv(), EvtRecPrimaryVertexCnv::EvtRecPrimaryVertexCnv(), EvtRecTrackCnv::EvtRecTrackCnv(), EvtRecVeeVertexCnv::EvtRecVeeVertexCnv(), ExtTrackCnv::ExtTrackCnv(), HltInfCnv(), HltRawCnv::HltRawCnv(), LumiDigiCnv::LumiDigiCnv(), McParticleCnv::McParticleCnv(), MdcDedxCnv::MdcDedxCnv(), MdcDigiCnv::MdcDigiCnv(), MdcKalTrackCnv::MdcKalTrackCnv(), MdcMcHitCnv::MdcMcHitCnv(), MdcTrackCnv::MdcTrackCnv(), MucDigiCnv::MucDigiCnv(), MucMcHitCnv::MucMcHitCnv(), MucTrackCnv::MucTrackCnv(), RecBTofCalHitCnv::RecBTofCalHitCnv(), RecEmcClusterCnv::RecEmcClusterCnv(), RecEmcHitCnv::RecEmcHitCnv(), RecEmcShowerCnv::RecEmcShowerCnv(), RecETofCalHitCnv::RecETofCalHitCnv(), RecEvTimeCnv::RecEvTimeCnv(), RecExtTrackCnv::RecExtTrackCnv(), RecMdcDedxCnv::RecMdcDedxCnv(), RecMdcDedxHitCnv::RecMdcDedxHitCnv(), RecMdcHitCnv::RecMdcHitCnv(), RecMdcKalHelixSegCnv::RecMdcKalHelixSegCnv(), RecMdcKalTrackCnv::RecMdcKalTrackCnv(), RecMdcTrackCnv::RecMdcTrackCnv(), RecMucRecHitCnv::RecMucRecHitCnv(), RecMucTrackCnv::RecMucTrackCnv(), RecTofTrackCnv::RecTofTrackCnv(), RecZddChannelCnv::RecZddChannelCnv(), TofDigiCnv::TofDigiCnv(), TofMcHitCnv::TofMcHitCnv(), TofTrackCnv::TofTrackCnv(), and TrigDataCnv::TrigDataCnv().
int RootEventBaseCnv::m_branchNr [protected, inherited] |
the branchNr of this converter for writing
Definition at line 49 of file RootEventBaseCnv.h.
Referenced by TrigCnv::DataObjectToTObject(), HltCnv::DataObjectToTObject(), DigiCnv::DataObjectToTObject(), and RootEventBaseCnv::RootEventBaseCnv().
int RootEventBaseCnv::m_branchNrDst [protected, inherited] |
Definition at line 50 of file RootEventBaseCnv.h.
Referenced by DstCnv::DataObjectToTObject(), and RootEventBaseCnv::RootEventBaseCnv().
int RootEventBaseCnv::m_branchNrEvtHeader [protected, inherited] |
Definition at line 54 of file RootEventBaseCnv.h.
Referenced by EvtHeaderCnv::DataObjectToTObject(), and RootEventBaseCnv::RootEventBaseCnv().
int RootEventBaseCnv::m_branchNrEvtNavigator [protected, inherited] |
Definition at line 55 of file RootEventBaseCnv.h.
Referenced by EvtNavigatorCnv::DataObjectToTObject(), and RootEventBaseCnv::RootEventBaseCnv().
int RootEventBaseCnv::m_branchNrEvtRec [protected, inherited] |
Definition at line 53 of file RootEventBaseCnv.h.
Referenced by EvtRecCnv::DataObjectToTObject(), and RootEventBaseCnv::RootEventBaseCnv().
int RootEventBaseCnv::m_branchNrMc [protected, inherited] |
Definition at line 51 of file RootEventBaseCnv.h.
Referenced by McCnv::DataObjectToTObject(), and RootEventBaseCnv::RootEventBaseCnv().
int RootEventBaseCnv::m_branchNrRecon [protected, inherited] |
Definition at line 52 of file RootEventBaseCnv.h.
Referenced by RecTrackCnv::DataObjectToTObject(), and RootEventBaseCnv::RootEventBaseCnv().
TArrayS* RootEventBaseCnv::m_branchNumbers [protected, inherited] |
array with number of branches for reading
Definition at line 64 of file RootEventBaseCnv.h.
Referenced by RootEventBaseCnv::createObj(), and RootEventBaseCnv::RootEventBaseCnv().
RootCnvSvc* RootEventBaseCnv::m_cnvSvc [protected, inherited] |
Definition at line 39 of file RootEventBaseCnv.h.
Referenced by RootEventBaseCnv::createRep(), TrigDataCnv::DataObjectToTObject(), RecZddChannelCnv::DataObjectToTObject(), RecTofTrackCnv::DataObjectToTObject(), RecMucTrackCnv::DataObjectToTObject(), RecMdcTrackCnv::DataObjectToTObject(), RecMdcKalTrackCnv::DataObjectToTObject(), RecMdcKalHelixSegCnv::DataObjectToTObject(), RecMdcHitCnv::DataObjectToTObject(), RecMdcDedxHitCnv::DataObjectToTObject(), RecMdcDedxCnv::DataObjectToTObject(), RecExtTrackCnv::DataObjectToTObject(), RecEvTimeCnv::DataObjectToTObject(), RecEmcShowerCnv::DataObjectToTObject(), RecEmcHitCnv::DataObjectToTObject(), RecEmcClusterCnv::DataObjectToTObject(), TofMcHitCnv::DataObjectToTObject(), MucMcHitCnv::DataObjectToTObject(), MdcMcHitCnv::DataObjectToTObject(), McParticleCnv::DataObjectToTObject(), EmcMcHitCnv::DataObjectToTObject(), HltRawCnv::DataObjectToTObject(), DataObjectToTObject(), DstHltInfCnv::DataObjectToTObject(), EvtRecVeeVertexCnv::DataObjectToTObject(), EvtRecTrackCnv::DataObjectToTObject(), EvtRecPrimaryVertexCnv::DataObjectToTObject(), EvtRecPi0Cnv::DataObjectToTObject(), EvtRecEventCnv::DataObjectToTObject(), EvtRecEtaToGGCnv::DataObjectToTObject(), EvtRecDTagCnv::DataObjectToTObject(), TofTrackCnv::DataObjectToTObject(), MucTrackCnv::DataObjectToTObject(), MdcTrackCnv::DataObjectToTObject(), MdcKalTrackCnv::DataObjectToTObject(), MdcDedxCnv::DataObjectToTObject(), ExtTrackCnv::DataObjectToTObject(), EmcTrackCnv::DataObjectToTObject(), TofDigiCnv::DataObjectToTObject(), MucDigiCnv::DataObjectToTObject(), MdcDigiCnv::DataObjectToTObject(), LumiDigiCnv::DataObjectToTObject(), EmcDigiCnv::DataObjectToTObject(), RootEventBaseCnv::finalize(), TrigCnv::initialize(), RootEventBaseCnv::initialize(), RecTrackCnv::initialize(), McCnv::initialize(), HltCnv::initialize(), EvtRecCnv::initialize(), EvtNavigatorCnv::initialize(), EvtHeaderCnv::initialize(), DstCnv::initialize(), and DigiCnv::initialize().
std::string RootEventBaseCnv::m_currentFileName [protected, inherited] |
IDataProviderSvc* RootEventBaseCnv::m_eds [protected, inherited] |
pointer to eventdataservice
Definition at line 46 of file RootEventBaseCnv.h.
Referenced by RootEventBaseCnv::createObj(), TrigDataCnv::DataObjectToTObject(), RecZddChannelCnv::DataObjectToTObject(), RecTofTrackCnv::DataObjectToTObject(), RecMucTrackCnv::DataObjectToTObject(), RecMdcTrackCnv::DataObjectToTObject(), RecMdcKalTrackCnv::DataObjectToTObject(), RecMdcKalHelixSegCnv::DataObjectToTObject(), RecMdcHitCnv::DataObjectToTObject(), RecMdcDedxHitCnv::DataObjectToTObject(), RecMdcDedxCnv::DataObjectToTObject(), RecExtTrackCnv::DataObjectToTObject(), RecEvTimeCnv::DataObjectToTObject(), RecEmcShowerCnv::DataObjectToTObject(), RecEmcHitCnv::DataObjectToTObject(), RecEmcClusterCnv::DataObjectToTObject(), TofMcHitCnv::DataObjectToTObject(), MucMcHitCnv::DataObjectToTObject(), MdcMcHitCnv::DataObjectToTObject(), McParticleCnv::DataObjectToTObject(), EmcMcHitCnv::DataObjectToTObject(), HltRawCnv::DataObjectToTObject(), DataObjectToTObject(), DstHltInfCnv::DataObjectToTObject(), EvtRecVeeVertexCnv::DataObjectToTObject(), EvtRecTrackCnv::DataObjectToTObject(), EvtRecPrimaryVertexCnv::DataObjectToTObject(), EvtRecPi0Cnv::DataObjectToTObject(), EvtRecEventCnv::DataObjectToTObject(), EvtRecEtaToGGCnv::DataObjectToTObject(), EvtRecDTagCnv::DataObjectToTObject(), TofTrackCnv::DataObjectToTObject(), MucTrackCnv::DataObjectToTObject(), MdcTrackCnv::DataObjectToTObject(), MdcKalTrackCnv::DataObjectToTObject(), MdcDedxCnv::DataObjectToTObject(), ExtTrackCnv::DataObjectToTObject(), EmcTrackCnv::DataObjectToTObject(), TofDigiCnv::DataObjectToTObject(), MucDigiCnv::DataObjectToTObject(), MdcDigiCnv::DataObjectToTObject(), LumiDigiCnv::DataObjectToTObject(), EmcDigiCnv::DataObjectToTObject(), RootEventBaseCnv::RootEventBaseCnv(), and McCnv::TObjectToDataObject().
RootEvtSelector* RootEventBaseCnv::m_evtsel [protected, inherited] |
Definition at line 75 of file RootEventBaseCnv.h.
Referenced by RootEventBaseCnv::createObj(), and RootEventBaseCnv::RootEventBaseCnv().
THltInf* HltInfCnv::m_hltInf [private] |
root object to be read
Definition at line 44 of file HltInfCnv.h.
Referenced by HltInfCnv(), and TObjectToDataObject().
std::vector<RootCnvSvc::Leaf> RootEventBaseCnv::m_leaves [protected, inherited] |
TObject* RootEventBaseCnv::m_objRead [protected, inherited] |
the object that was read
Definition at line 58 of file RootEventBaseCnv.h.
Referenced by RootEventBaseCnv::createObj(), RootEventBaseCnv::getReadObject(), and RootEventBaseCnv::RootEventBaseCnv().
bool HltInfCnv::m_old [private] |
std::string RootEventBaseCnv::m_rootBranchname [protected, inherited] |
root branchname (may be concatenated of severals)
Definition at line 67 of file RootEventBaseCnv.h.
Referenced by DigiCnv::DigiCnv(), DstCnv::DstCnv(), DstHltInfCnv::DstHltInfCnv(), EmcDigiCnv::EmcDigiCnv(), EmcMcHitCnv::EmcMcHitCnv(), EmcTrackCnv::EmcTrackCnv(), EvtHeaderCnv::EvtHeaderCnv(), EvtNavigatorCnv::EvtNavigatorCnv(), EvtRecCnv::EvtRecCnv(), EvtRecDTagCnv::EvtRecDTagCnv(), EvtRecEtaToGGCnv::EvtRecEtaToGGCnv(), EvtRecEventCnv::EvtRecEventCnv(), EvtRecPi0Cnv::EvtRecPi0Cnv(), EvtRecPrimaryVertexCnv::EvtRecPrimaryVertexCnv(), EvtRecTrackCnv::EvtRecTrackCnv(), EvtRecVeeVertexCnv::EvtRecVeeVertexCnv(), ExtTrackCnv::ExtTrackCnv(), HltInfCnv(), HltRawCnv::HltRawCnv(), LumiDigiCnv::LumiDigiCnv(), McParticleCnv::McParticleCnv(), MdcDedxCnv::MdcDedxCnv(), MdcDigiCnv::MdcDigiCnv(), MdcKalTrackCnv::MdcKalTrackCnv(), MdcMcHitCnv::MdcMcHitCnv(), MdcTrackCnv::MdcTrackCnv(), MucDigiCnv::MucDigiCnv(), MucMcHitCnv::MucMcHitCnv(), MucTrackCnv::MucTrackCnv(), RecBTofCalHitCnv::RecBTofCalHitCnv(), RecEmcClusterCnv::RecEmcClusterCnv(), RecEmcHitCnv::RecEmcHitCnv(), RecEmcShowerCnv::RecEmcShowerCnv(), RecETofCalHitCnv::RecETofCalHitCnv(), RecEvTimeCnv::RecEvTimeCnv(), RecExtTrackCnv::RecExtTrackCnv(), RecMdcDedxCnv::RecMdcDedxCnv(), RecMdcDedxHitCnv::RecMdcDedxHitCnv(), RecMdcHitCnv::RecMdcHitCnv(), RecMdcKalHelixSegCnv::RecMdcKalHelixSegCnv(), RecMdcKalTrackCnv::RecMdcKalTrackCnv(), RecMdcTrackCnv::RecMdcTrackCnv(), RecMucRecHitCnv::RecMucRecHitCnv(), RecMucTrackCnv::RecMucTrackCnv(), RecTrackCnv::RecTrackCnv(), RecZddChannelCnv::RecZddChannelCnv(), TofDigiCnv::TofDigiCnv(), TofMcHitCnv::TofMcHitCnv(), TofTrackCnv::TofTrackCnv(), and TrigDataCnv::TrigDataCnv().
RootInterface* RootEventBaseCnv::m_rootInterface [protected, inherited] |
pointer to the RootInterface
Definition at line 43 of file RootEventBaseCnv.h.
Referenced by RootEventBaseCnv::createObj(), TrigCnv::DataObjectToTObject(), RecTrackCnv::DataObjectToTObject(), McCnv::DataObjectToTObject(), HltCnv::DataObjectToTObject(), EvtRecCnv::DataObjectToTObject(), EvtNavigatorCnv::DataObjectToTObject(), EvtHeaderCnv::DataObjectToTObject(), DstCnv::DataObjectToTObject(), DigiCnv::DataObjectToTObject(), and RootEventBaseCnv::RootEventBaseCnv().
std::string RootEventBaseCnv::m_rootTreename [protected, inherited] |
each converter knows it's treename
Definition at line 69 of file RootEventBaseCnv.h.
Referenced by EmcTrackCnv::EmcTrackCnv(), RecEmcHitCnv::RecEmcHitCnv(), and RecMucRecHitCnv::RecMucRecHitCnv().