BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
DstCnv Class Reference

Concrete converter for the Dst branch. More...

#include <DstCnv.h>

Inheritance diagram for DstCnv:

Public Member Functions

virtual ~DstCnv ()
virtual StatusCode initialize ()
 DstCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation from TDS object to ROOT
virtual StatusCode TObjectToDataObject (DataObject *&refpObject)
 do the transformation from ROOT to TDS object
virtual ~DstCnv ()
virtual StatusCode initialize ()
 DstCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation from TDS object to ROOT
virtual StatusCode TObjectToDataObject (DataObject *&refpObject)
 do the transformation from ROOT to TDS object
virtual ~DstCnv ()
virtual StatusCode initialize ()
 DstCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation from TDS object to ROOT
virtual StatusCode TObjectToDataObject (DataObject *&refpObject)
 do the transformation from ROOT to TDS object
Public Member Functions inherited from RootEventBaseCnv
 RootEventBaseCnv (const CLID &clid, ISvcLocator *svc)
virtual ~RootEventBaseCnv ()
virtual long repSvcType () const
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 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 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 TDstEventgetWriteObject ()
 returns object to be written (maintained here for all DIGI-converters)
static const CLID & classID ()
static TDstEventgetWriteObject ()
 returns object to be written (maintained here for all DIGI-converters)
static const CLID & classID ()
static TDstEventgetWriteObject ()
 returns object to be written (maintained here for all DIGI-converters)
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< DstCnv >

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 Dst branch.

Based on the DstCnv of GLAST.

Definition at line 20 of file Event/RootCnvSvc/include/RootCnvSvc/Dst/DstCnv.h.

Constructor & Destructor Documentation

◆ ~DstCnv() [1/3]

virtual DstCnv::~DstCnv ( )
inlinevirtual

Definition at line 27 of file Event/RootCnvSvc/include/RootCnvSvc/Dst/DstCnv.h.

27{};

◆ DstCnv() [1/3]

DstCnv::DstCnv ( ISvcLocator * svc)

Definition at line 32 of file DstCnv.cxx.

32 : RootEventBaseCnv( classID(), svc ) {
33 // Here we associate this converter with the path on the TDS.
35 // declareObject(EventModel::Dst::Event, objType(), m_rootTreename, m_rootBranchname);
36}
std::string m_rootBranchname
root branchname (may be concatenated of severals)
RootEventBaseCnv(const CLID &clid, ISvcLocator *svc)

◆ ~DstCnv() [2/3]

virtual DstCnv::~DstCnv ( )
inlinevirtual

◆ DstCnv() [2/3]

DstCnv::DstCnv ( ISvcLocator * svc)

◆ ~DstCnv() [3/3]

virtual DstCnv::~DstCnv ( )
inlinevirtual

◆ DstCnv() [3/3]

DstCnv::DstCnv ( ISvcLocator * svc)

Member Function Documentation

◆ classID() [1/3]

const CLID & DstCnv::classID ( )
inlinestatic

Definition at line 25 of file Event/RootCnvSvc/include/RootCnvSvc/Dst/DstCnv.h.

25{ return CLID_DstEvent; }
const CLID & CLID_DstEvent

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

◆ classID() [2/3]

const CLID & DstCnv::classID ( )
inlinestatic

◆ classID() [3/3]

const CLID & DstCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/3]

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

transformation from TDS object to ROOT

Implements RootEventBaseCnv.

Definition at line 71 of file DstCnv.cxx.

71 {
72 // transforms TDS event to Dst event in root format
73 MsgStream log( msgSvc(), "DstCnv" );
74 log << MSG::DEBUG << "DstCnv::DataObjectToTObject" << endmsg;
75
76 // test if already done for this event
77 // zoujh: if (m_objWrite && (m_objWrite->getRunId()!=0 || m_objWrite->getEventId()!=0))
78 // return StatusCode::SUCCESS;
79 if ( m_common.m_dstEvt != NULL ) return StatusCode::SUCCESS;
80
81 /*
82 SmartDataPtr<Event::EventHeader> evtTds(m_eds, EventModel::EventHeader);
83
84 if (!evtTds) {
85 log << MSG::ERROR << "Failed to retrieve EventHeader in TDS" << endmsg;
86 return StatusCode::FAILURE;
87 }
88 */
89 DstEvent* devtTds = dynamic_cast<DstEvent*>( obj );
90 if ( !devtTds )
91 {
92 log << MSG::ERROR << "Could not downcast to TDS DstEvent" << endmsg;
93 return StatusCode::FAILURE;
94 }
95
96 m_objWrite = new TDstEvent(); // zoujh
97 m_common.m_dstEvt = m_objWrite; // zoujh
98
99 // create branch if not yet done
100 if ( m_branchNrDst < 0 )
101 {
102 // zoujh: m_objWrite = new TDstEvent();
103 StatusCode sc =
104 m_rootInterface->createBranch( rootaddr->getTreename(), "TDstEvent",
105 m_objWrite->ClassName(), &m_objWrite, m_branchNrDst );
106 if ( sc.isFailure() )
107 {
108 log << MSG::ERROR << "Could not create branch TDstEvent" << endmsg;
109 return sc;
110 }
111 }
112
113 // Int_t evtId = evtTds->eventNumber();
114 // Int_t runId = evtTds->runNumber();
115
116 m_objWrite->initialize();
117
118 return StatusCode::SUCCESS;
119}
IMessageSvc * msgSvc()
RootInterface * m_rootInterface
pointer to the RootInterface

◆ DataObjectToTObject() [2/3]

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

transformation from TDS object to ROOT

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

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

transformation from TDS object to ROOT

Implements RootEventBaseCnv.

◆ getWriteObject() [1/3]

TDstEvent * DstCnv::getWriteObject ( )
inlinestatic

returns object to be written (maintained here for all DIGI-converters)

Definition at line 32 of file Event/RootCnvSvc/include/RootCnvSvc/Dst/DstCnv.h.

32{ return m_objWrite; }

◆ getWriteObject() [2/3]

TDstEvent * DstCnv::getWriteObject ( )
inlinestatic

returns object to be written (maintained here for all DIGI-converters)

Definition at line 32 of file InstallArea/x86_64-el9-gcc13-dbg/include/RootCnvSvc/Dst/DstCnv.h.

32{ return m_objWrite; }

◆ getWriteObject() [3/3]

TDstEvent * DstCnv::getWriteObject ( )
inlinestatic

returns object to be written (maintained here for all DIGI-converters)

Definition at line 32 of file InstallArea/x86_64-el9-gcc13-opt/include/RootCnvSvc/Dst/DstCnv.h.

32{ return m_objWrite; }

◆ initialize() [1/3]

StatusCode DstCnv::initialize ( )
virtual

Reimplemented from RootEventBaseCnv.

Definition at line 59 of file DstCnv.cxx.

59 {
60 MsgStream log( msgSvc(), "DstCnv" );
61 log << MSG::DEBUG << "DstCnv::initialize" << endmsg;
62
63 StatusCode status = RootEventBaseCnv::initialize();
64
65 // pass dst converter to the conversion service
66 m_cnvSvc->setDstCnv( this );
67
68 return status;
69}
virtual StatusCode initialize()

◆ initialize() [2/3]

virtual StatusCode DstCnv::initialize ( )
virtual

Reimplemented from RootEventBaseCnv.

◆ initialize() [3/3]

virtual StatusCode DstCnv::initialize ( )
virtual

Reimplemented from RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

StatusCode DstCnv::TObjectToDataObject ( DataObject *& refpObject)
virtual

do the transformation from ROOT to TDS object

Implements RootEventBaseCnv.

Definition at line 38 of file DstCnv.cxx.

38 {
39 // fills the TDS object from the persistent one
40 StatusCode sc = StatusCode::SUCCESS;
41
42 MsgStream log( msgSvc(), "DstCnv" );
43 log << MSG::DEBUG << "TObjectToDataObject" << endmsg;
44 /*
45 SmartDataPtr<Event::EventHeader> evt(m_eds, EventModel::EventHeader);
46 if (!evt) {
47 log << MSG::ERROR << "Failed to retrieve RecEvent" << endmsg;
48 return StatusCode::FAILURE;
49 }
50
51 */
52
53 DstEvent* tdsev = new DstEvent();
54 refpObject = tdsev;
55
56 return sc;
57}

◆ TObjectToDataObject() [2/3]

virtual StatusCode DstCnv::TObjectToDataObject ( DataObject *& refpObject)
virtual

do the transformation from ROOT to TDS object

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

virtual StatusCode DstCnv::TObjectToDataObject ( DataObject *& refpObject)
virtual

do the transformation from ROOT to TDS object

Implements RootEventBaseCnv.

◆ CnvFactory< DstCnv >

friend class CnvFactory< DstCnv >
friend

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