BOSS 8.0.0
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 ()
 DstHltInfCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
virtual ~DstHltInfCnv ()
 DstHltInfCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
virtual ~DstHltInfCnv ()
 DstHltInfCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
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.
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.
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.
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
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.

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
typedef Ty1 source
typedef Ty2 destination
Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
virtual destinationconvert (const source &) const =0
virtual destinationconvert (const source &) const =0
Protected Attributes inherited from RootEventBaseCnv
IRootCnvSvcm_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/include/RootCnvSvc/Hlt/DstHltInfCnv.h.

Constructor & Destructor Documentation

◆ ~DstHltInfCnv() [1/3]

virtual DstHltInfCnv::~DstHltInfCnv ( )
inlinevirtual

◆ DstHltInfCnv() [1/3]

DstHltInfCnv::DstHltInfCnv ( ISvcLocator * svc)

Definition at line 22 of file DstHltInfCnv.cxx.

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

◆ ~DstHltInfCnv() [2/3]

virtual DstHltInfCnv::~DstHltInfCnv ( )
inlinevirtual

◆ DstHltInfCnv() [2/3]

DstHltInfCnv::DstHltInfCnv ( ISvcLocator * svc)

◆ ~DstHltInfCnv() [3/3]

virtual DstHltInfCnv::~DstHltInfCnv ( )
inlinevirtual

◆ DstHltInfCnv() [3/3]

DstHltInfCnv::DstHltInfCnv ( ISvcLocator * svc)

Member Function Documentation

◆ classID() [1/3]

const CLID & DstHltInfCnv::classID ( )
inlinestatic

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

25{ return CLID_DstHltInf; }
const CLID & CLID_DstHltInf

Referenced by RootCnvSvc::createConverter(), and DstHltInfCnv().

◆ classID() [2/3]

const CLID & DstHltInfCnv::classID ( )
inlinestatic

◆ classID() [3/3]

const CLID & DstHltInfCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/3]

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 87 of file DstHltInfCnv.cxx.

87 {
88
89 MsgStream log( msgSvc(), "DstHltInfCnv" );
90 log << MSG::DEBUG << "DstHltInfCnv::DataObjectToTObject" << endmsg;
91 StatusCode sc = StatusCode::SUCCESS;
92
93 DstHltInf* dstHltInfCnvTds = dynamic_cast<DstHltInf*>( obj );
94 if ( !dstHltInfCnvTds )
95 {
96 log << MSG::ERROR << "Could not downcast to DstHltInf" << endmsg;
97 return StatusCode::FAILURE;
98 }
99
100 DataObject* evt;
101 m_eds->findObject( EventModel::Hlt::Event, evt );
102 if ( evt == NULL )
103 {
104 log << MSG::ERROR << "Could not get DstHltInf in TDS " << endmsg;
105 return StatusCode::FAILURE;
106 }
107
108 HltEvent* devtTds = dynamic_cast<HltEvent*>( evt );
109 if ( !devtTds )
110 { log << MSG::ERROR << "DstHltInfCnv:Could not downcast to TDS DstHltInf" << endmsg; }
111
112 IOpaqueAddress* addr;
113 m_cnvSvc->getHltCnv()->createRep( evt, addr );
114
115 THltEvent* hltInf = m_cnvSvc->getHltCnv()->getWriteObject();
116
117 const TObject* tHltInf = hltInf->getDstHltInf();
118 if ( !tHltInf ) return sc;
119 hltInf->clearDstHltInf();
120
121 Int_t typ = dstHltInfCnvTds->getEventType();
122 Int_t alg = dstHltInfCnvTds->getAlgProcess();
123 Int_t cri = dstHltInfCnvTds->getCriteriaTable();
124 Int_t ver = dstHltInfCnvTds->getVersion();
125 Double_t etot = dstHltInfCnvTds->getTotalEnergy();
126 Int_t nsub = dstHltInfCnvTds->getNumber();
127 Int_t ncon = dstHltInfCnvTds->getNCON();
128
129 TDstHltInf* dstHltInfRoot = new TDstHltInf();
130
131 dstHltInfRoot->setEventType( typ );
132 dstHltInfRoot->setAlgProcess( alg );
133 dstHltInfRoot->setCriteriaTable( cri );
134 dstHltInfRoot->setVersion( ver );
135 dstHltInfRoot->setTotalEnergy( etot );
136 dstHltInfRoot->setNumber( nsub );
137 dstHltInfRoot->setNCON( ncon );
138
139 hltInf->addDstHltInf( dstHltInfRoot );
140
141 return StatusCode::SUCCESS;
142}
Double_t etot
IDataProviderSvc * m_eds
pointer to eventdataservice
void addDstHltInf(TDstHltInf *dstHltInf)
Definition THltEvent.cxx:62
const TDstHltInf * getDstHltInf() const
Definition THltEvent.cxx:63

◆ DataObjectToTObject() [2/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 33 of file DstHltInfCnv.cxx.

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

◆ TObjectToDataObject() [2/3]

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

transformation from root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

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

transformation from root

Implements RootEventBaseCnv.

◆ CnvFactory< DstHltInfCnv >

friend class CnvFactory< DstHltInfCnv >
friend

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