BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtRecCnv Class Reference

#include <EvtRecCnv.h>

+ Inheritance diagram for EvtRecCnv:

Public Member Functions

virtual ~EvtRecCnv ()
 
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
 
- Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
 

Static Public Member Functions

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

Protected Member Functions

 EvtRecCnv (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
 

Friends

class CnvFactory< EvtRecCnv >
 

Additional Inherited Members

- Public Types inherited from Converter< Ty1, Ty2 >
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

Definition at line 15 of file EvtRecCnv.h.

Constructor & Destructor Documentation

◆ ~EvtRecCnv()

virtual EvtRecCnv::~EvtRecCnv ( )
inlinevirtual

Definition at line 22 of file EvtRecCnv.h.

22{}

◆ EvtRecCnv()

EvtRecCnv::EvtRecCnv ( ISvcLocator *  svc)
protected

Definition at line 12 of file EvtRecCnv.cxx.

14{
16}
static const CLID & classID()
Definition: EvtRecCnv.h:20
Base class for all Root Converters.
std::string m_rootBranchname
root branchname (may be concatenated of severals)

Member Function Documentation

◆ classID()

static const CLID & EvtRecCnv::classID ( )
inlinestatic

Definition at line 20 of file EvtRecCnv.h.

20{ return CLID_EvtRecObject; }
const CLID & CLID_EvtRecObject
! Global link and reconstruction
Definition: EventModel.cxx:371

◆ DataObjectToTObject()

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 37 of file EvtRecCnv.cxx.

37 {
38
39 MsgStream log(msgSvc(), "EvtRecCnv");
40 log << MSG::DEBUG << "EvtRecCnv::DataObjectToTObject" << endreq;
41
42 if ( m_common.m_evtRecObject != NULL ) return StatusCode::SUCCESS;
43
44 EvtRecObject* evtRecObject = dynamic_cast<EvtRecObject*> (obj);
45 if ( ! evtRecObject ) {
46 log << MSG::ERROR << "Could not downcast to EvtRecObject" << endreq;
47 return StatusCode::FAILURE;
48 }
49
50 m_objWrite = new TEvtRecObject();
51 m_common.m_evtRecObject = m_objWrite;
52
53 // create branch if not yet done
54 if ( m_branchNrEvtRec < 0 ) {
55 StatusCode sc = m_rootInterface->createBranch(rootaddr->getTreename(),"TEvtRecObject",m_objWrite->ClassName(),&m_objWrite,m_branchNrEvtRec);
56
57 if ( sc.isFailure() ) {
58 cout<<"Could not create branch TEvtRecObject"<<endl;
59 log << MSG::ERROR << "Could not create branch TEvtRecObject" << endreq;
60 return sc;
61 }
62 }
63
64 m_objWrite->initialize();
65
66 return StatusCode::SUCCESS;
67}
IMessageSvc * msgSvc()
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
static TEvtRecObject * m_evtRecObject
Definition: commonData.h:266

◆ getWriteObject()

◆ initialize()

StatusCode EvtRecCnv::initialize ( )
virtual

Reimplemented from RootEventBaseCnv.

Definition at line 18 of file EvtRecCnv.cxx.

18 {
19 StatusCode status = RootEventBaseCnv::initialize();
20
22
23 return status;
24}
void setEvtRecCnv(EvtRecCnv *evtreccnv)
Definition: RootCnvSvc.h:166
RootCnvSvc * m_cnvSvc
virtual StatusCode initialize()

◆ TObjectToDataObject()

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 26 of file EvtRecCnv.cxx.

26 {
27 MsgStream log(msgSvc(), "EvtRecCnv");
28 log << MSG::DEBUG << "EvtRecCnv::TObjectToDataObject" << endreq;
29
30 // create the TDS location for the EvtRecObject
31 EvtRecObject* evtRecObject = new EvtRecObject;
32 refpObject = evtRecObject;
33
34 return StatusCode::SUCCESS;
35}

Friends And Related Function Documentation

◆ CnvFactory< EvtRecCnv >

friend class CnvFactory< EvtRecCnv >
friend

Definition at line 10 of file EvtRecCnv.h.


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