BOSS 7.0.5
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 ()
 
virtual ~DstCnv ()
 
virtual StatusCode initialize ()
 
- 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
 
- 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 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.
 

Protected Member Functions

 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
 
 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
 
- Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
 
virtual destinationconvert (const source &) const =0
 

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

Based on the DstCnv of GLAST.

Based on the DstCnv of GLAST.

Definition at line 20 of file Event/RootCnvSvc/RootCnvSvc-03-00-06/RootCnvSvc/Dst/DstCnv.h.

Constructor & Destructor Documentation

◆ ~DstCnv() [1/2]

virtual DstCnv::~DstCnv ( )
inlinevirtual

◆ DstCnv() [1/2]

DstCnv::DstCnv ( ISvcLocator *  svc)
protected

Definition at line 32 of file DstCnv.cxx.

34{
35 // Here we associate this converter with the path on the TDS.
37 //declareObject(EventModel::Dst::Event, objType(), m_rootTreename, m_rootBranchname);
38}
std::string m_rootBranchname
root branchname (may be concatenated of severals)

◆ ~DstCnv() [2/2]

virtual DstCnv::~DstCnv ( )
inlinevirtual

Definition at line 30 of file InstallArea/include/RootCnvSvc/RootCnvSvc/Dst/DstCnv.h.

30{ };

◆ DstCnv() [2/2]

DstCnv::DstCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/2]

static const CLID & DstCnv::classID ( )
inlinestatic

Definition at line 25 of file Event/RootCnvSvc/RootCnvSvc-03-00-06/RootCnvSvc/Dst/DstCnv.h.

26 {
27 return CLID_DstEvent;
28 }
const CLID & CLID_DstEvent
Definition: EventModel.cxx:250

◆ classID() [2/2]

static const CLID & DstCnv::classID ( )
inlinestatic

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

26 {
27 return CLID_DstEvent;
28 }

◆ DataObjectToTObject() [1/2]

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

transformation from TDS object to ROOT

Implements RootEventBaseCnv.

Definition at line 76 of file DstCnv.cxx.

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

◆ DataObjectToTObject() [2/2]

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

transformation from TDS object to ROOT

Implements RootEventBaseCnv.

◆ getWriteObject() [1/2]

◆ getWriteObject() [2/2]

static TDstEvent * DstCnv::getWriteObject ( )
inlinestatic

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

Definition at line 36 of file InstallArea/include/RootCnvSvc/RootCnvSvc/Dst/DstCnv.h.

36{ return m_objWrite;}

◆ initialize() [1/2]

StatusCode DstCnv::initialize ( )
virtual

Reimplemented from RootEventBaseCnv.

Definition at line 63 of file DstCnv.cxx.

63 {
64 MsgStream log(msgSvc(), "DstCnv");
65 log << MSG::DEBUG << "DstCnv::initialize"<< endreq;
66
67 StatusCode status = RootEventBaseCnv::initialize();
68
69 //pass dst converter to the conversion service
70 m_cnvSvc->setDstCnv(this);
71
72 return status;
73
74}
virtual StatusCode initialize()

◆ initialize() [2/2]

virtual StatusCode DstCnv::initialize ( )
virtual

Reimplemented from RootEventBaseCnv.

◆ TObjectToDataObject() [1/2]

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

do the transformation from ROOT to TDS object

Implements RootEventBaseCnv.

Definition at line 40 of file DstCnv.cxx.

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

◆ TObjectToDataObject() [2/2]

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

do the transformation from ROOT to TDS object

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< DstCnv >

friend class CnvFactory< DstCnv >
friend

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