CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
DstHltInfCnv Class Reference

Concrete converter for the DstHltInf. More...

#include <DstHltInfCnv.h>

+ Inheritance diagram for DstHltInfCnv:

Public Member Functions

virtual ~DstHltInfCnv ()
 
virtual ~DstHltInfCnv ()
 
virtual ~DstHltInfCnv ()
 
- Public Member Functions inherited from RootEventBaseCnv
 RootEventBaseCnv (const CLID &clid, ISvcLocator *svc)
 
virtual ~RootEventBaseCnv ()
 
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.
 
virtual StatusCode DataObjectToTObject (DataObject *dat, RootAddress *addr)=0
 Do the concrete conversion from TDS to ROOT.
 
virtual StatusCode TObjectToDataObject (DataObject *&dat)=0
 Do the concrete conversion from ROOT to TDS.
 
TObject * getReadObject () const
 get the object to be read
 
 RootEventBaseCnv (const CLID &clid, ISvcLocator *svc)
 
virtual ~RootEventBaseCnv ()
 
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.
 
virtual StatusCode DataObjectToTObject (DataObject *dat, RootAddress *addr)=0
 Do the concrete conversion from TDS to ROOT.
 
virtual StatusCode TObjectToDataObject (DataObject *&dat)=0
 Do the concrete conversion from ROOT to TDS.
 
TObject * getReadObject () const
 get the object to be read
 
 RootEventBaseCnv (const CLID &clid, ISvcLocator *svc)
 
virtual ~RootEventBaseCnv ()
 
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.
 
virtual StatusCode DataObjectToTObject (DataObject *dat, RootAddress *addr)=0
 Do the concrete conversion from TDS to ROOT.
 
virtual StatusCode TObjectToDataObject (DataObject *&dat)=0
 Do the concrete conversion from ROOT to TDS.
 
TObject * getReadObject () const
 get the object to be read
 
- Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
 
destinationoperator (const source &) const
 

Static Public Member Functions

static const CLID & classID ()
 
static const CLID & classID ()
 
static const CLID & classID ()
 
- Static Public Member Functions inherited from RootEventBaseCnv
static const unsigned char storageType ()
 Storage type and class ID.
 
static const unsigned char storageType ()
 Storage type and class ID.
 
static const unsigned char storageType ()
 Storage type and class ID.
 

Protected Member Functions

 DstHltInfCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
 DstHltInfCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
 DstHltInfCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
- Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
 
virtual destinationconvert (const source &) const =0
 

Friends

class CnvFactory< DstHltInfCnv >
 

Additional Inherited Members

- Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
 
typedef Ty2 destination
 
typedef Ty1 source
 
typedef Ty2 destination
 
- Protected Attributes inherited from RootEventBaseCnv
RootCnvSvcm_cnvSvc
 
std::vector< RootCnvSvc::Leafm_leaves
 
RootInterfacem_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
 
RootEvtSelectorm_evtsel
 

Detailed Description

Concrete converter for the DstHltInf.

Definition at line 20 of file Event/RootCnvSvc/bak_RootCnvSvc-04-01-14/RootCnvSvc/Hlt/DstHltInfCnv.h.

Constructor & Destructor Documentation

◆ ~DstHltInfCnv() [1/3]

virtual DstHltInfCnv::~DstHltInfCnv ( )
inlinevirtual

◆ DstHltInfCnv() [1/3]

DstHltInfCnv::DstHltInfCnv ( ISvcLocator *  svc)
protected

Definition at line 23 of file bak_RootCnvSvc-04-01-14/src/Hlt/DstHltInfCnv.cxx.

24 : RootEventBaseCnv(classID(), svc),
25 m_old(false)
26{
27 // Here we associate this converter with the /Event path on the TDS.
28 MsgStream log(msgSvc(), "DstHltInfCnv");
29 //log << MSG::DEBUG << "Constructor called for " << objType() << endreq;
30 m_rootBranchname ="m_dstHltInf";
31 //declareObject(EventModel::MC::DstHltInf, objType(), m_rootTreename, m_rootBranchname);
32 m_adresses.push_back(&m_dstHltInf);
33 m_dstHltInf=0;
34}
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

◆ ~DstHltInfCnv() [2/3]

virtual DstHltInfCnv::~DstHltInfCnv ( )
inlinevirtual

◆ DstHltInfCnv() [2/3]

DstHltInfCnv::DstHltInfCnv ( ISvcLocator *  svc)
protected

◆ ~DstHltInfCnv() [3/3]

virtual DstHltInfCnv::~DstHltInfCnv ( )
inlinevirtual

◆ DstHltInfCnv() [3/3]

DstHltInfCnv::DstHltInfCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/3]

static const CLID & DstHltInfCnv::classID ( )
inlinestatic

Definition at line 25 of file Event/RootCnvSvc/bak_RootCnvSvc-04-01-14/RootCnvSvc/Hlt/DstHltInfCnv.h.

26 {
27 return CLID_DstHltInf;
28 }
const CLID & CLID_DstHltInf
Definition: EventModel.cxx:331

◆ classID() [2/3]

static const CLID & DstHltInfCnv::classID ( )
inlinestatic

◆ classID() [3/3]

static const CLID & DstHltInfCnv::classID ( )
inlinestatic

Definition at line 25 of file InstallArea/include/RootCnvSvc/RootCnvSvc/Hlt/DstHltInfCnv.h.

26 {
27 return CLID_DstHltInf;
28 }

◆ DataObjectToTObject() [1/3]

StatusCode DstHltInfCnv::DataObjectToTObject ( DataObject *  obj,
RootAddress addr 
)
protectedvirtual

transformation to root

Implements RootEventBaseCnv.

Definition at line 92 of file bak_RootCnvSvc-04-01-14/src/Hlt/DstHltInfCnv.cxx.

92 {
93
94 MsgStream log(msgSvc(), "DstHltInfCnv");
95 log << MSG::DEBUG << "DstHltInfCnv::DataObjectToTObject" << endreq;
96 StatusCode sc=StatusCode::SUCCESS;
97
98 DstHltInf * dstHltInfCnvTds=dynamic_cast<DstHltInf*> (obj);
99 if (!dstHltInfCnvTds) {
100 log << MSG::ERROR << "Could not downcast to DstHltInf" << endreq;
101 return StatusCode::FAILURE;
102 }
103
104 DataObject *evt;
105 m_eds->findObject(EventModel::Hlt::Event,evt);
106 if (evt==NULL) {
107 log << MSG::ERROR << "Could not get DstHltInf in TDS " << endreq;
108 return StatusCode::FAILURE;
109 }
110
111 HltEvent* devtTds=dynamic_cast<HltEvent *> (evt);
112 if (!devtTds) {
113 log << MSG::ERROR << "DstHltInfCnv:Could not downcast to TDS DstHltInf" << endreq;
114 }
115
116 IOpaqueAddress *addr;
117 m_cnvSvc->getHltCnv()->createRep(evt,addr);
118
120
121 const TObject *tHltInf = hltInf->getDstHltInf();
122 if (!tHltInf) return sc;
123 hltInf->clearDstHltInf();
124
125 Int_t typ = dstHltInfCnvTds->getEventType();
126 Int_t alg = dstHltInfCnvTds->getAlgProcess();
127 Int_t cri = dstHltInfCnvTds->getCriteriaTable();
128 Int_t ver = dstHltInfCnvTds->getVersion();
129 Double_t etot = dstHltInfCnvTds->getTotalEnergy();
130 Int_t nsub = dstHltInfCnvTds->getNumber();
131 Int_t ncon = dstHltInfCnvTds->getNCON();
132
133 TDstHltInf *dstHltInfRoot = new TDstHltInf();
134
135 dstHltInfRoot->setEventType(typ);
136 dstHltInfRoot->setAlgProcess(alg);
137 dstHltInfRoot->setCriteriaTable(cri);
138 dstHltInfRoot->setVersion(ver);
139 dstHltInfRoot->setTotalEnergy(etot);
140 dstHltInfRoot->setNumber(nsub);
141 dstHltInfRoot->setNCON(ncon);
142
143 hltInf->addDstHltInf(dstHltInfRoot);
144
145 return StatusCode::SUCCESS;
146}
Double_t etot
static THltEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void addDstHltInf(TDstHltInf *dstHltInf)
const TDstHltInf * getDstHltInf() const

◆ DataObjectToTObject() [2/3]

virtual StatusCode DstHltInfCnv::DataObjectToTObject ( DataObject *  obj,
RootAddress addr 
)
protectedvirtual

transformation to root

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

virtual StatusCode DstHltInfCnv::DataObjectToTObject ( DataObject *  obj,
RootAddress addr 
)
protectedvirtual

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

StatusCode DstHltInfCnv::TObjectToDataObject ( DataObject *&  obj)
protectedvirtual

transformation from root

Implements RootEventBaseCnv.

Definition at line 36 of file bak_RootCnvSvc-04-01-14/src/Hlt/DstHltInfCnv.cxx.

36 {
37 // creation of TDS object from root object
38
39 MsgStream log(msgSvc(), "DstHltInfCnv");
40 log << MSG::DEBUG << "DstHltInfCnv::TObjectToDataObject" << endreq;
41 StatusCode sc=StatusCode::SUCCESS;
42
43 // create the TDS location for the trigger data
44 DstHltInf* dstHltInfTds = new DstHltInf;
45 refpObject=dstHltInfTds;
46
47 // now convert
48 if(!m_dstHltInf) return sc;
49
50 int evt = m_dstHltInf->getEventType();
51 int alg = m_dstHltInf->getAlgProcess();
52 int cri = m_dstHltInf->getCriteriaTable();
53 int ver = m_dstHltInf->getVersion();
54 float etot = m_dstHltInf->getTotalEnergy();
55
56 dstHltInfTds->setEventType(evt);
57 dstHltInfTds->setAlgProcess(alg);
58 dstHltInfTds->setCriteriaTable(cri);
59 dstHltInfTds->setVersion(ver);
60 dstHltInfTds->setTotalEnergy(etot);
61
62 try{
63 uint32_t nsub= m_dstHltInf->getNumber();
64 uint32_t ncon= m_dstHltInf->getNCON();
65 uint32_t nmdc= nsub &0XFF;
66 uint32_t ntof=(nsub>>8 )&0XFF;
67 uint32_t nemc=(nsub>>16)&0XFF;
68 uint32_t nmuc=(nsub>>24)&0XFF;
69 uint32_t ncgem= nsub>>32;
70 if(nmuc>HltID::getID_MUC_MAX()+1 || nemc>HltID::getID_EMC_MAX()+1
71 ||ntof>HltID::getID_TOF_MAX()+1 || nmdc>HltID::getID_MDC_MAX()+1
72 || ncgem>HltID::getID_CGEM_MAX()+1){
73 throw exception();
74 }
75 dstHltInfTds->setNumber(nsub);
76 dstHltInfTds->setNCON(ncon);
77 }
78 catch(...){
79 //log << MSG::ERROR << "***********************************************************" << endreq;
80 //log << MSG::ERROR << "Input ROOT object is older version, please reconstrut again" << endreq;
81 //log << MSG::ERROR << " or check out old RootCnvSvc! (mailto: [email protected])" << endreq;
82 //log << MSG::WARNING << "***** Continuing run may cause a little memory leakage ****" << endreq;
83 //m_old=true;
84 }
85
86 delete m_dstHltInf;
87 m_dstHltInf = 0;
88
89 return StatusCode::SUCCESS;
90}

◆ TObjectToDataObject() [2/3]

virtual StatusCode DstHltInfCnv::TObjectToDataObject ( DataObject *&  obj)
protectedvirtual

transformation from root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

virtual StatusCode DstHltInfCnv::TObjectToDataObject ( DataObject *&  obj)
protectedvirtual

transformation from root

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< DstHltInfCnv >


The documentation for this class was generated from the following files: