BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtNavigatorCnv Class Reference

Concrete converter for the EvtNavigator branch. More...

#include <EvtNavigatorCnv.h>

+ Inheritance diagram for EvtNavigatorCnv:

Public Member Functions

virtual ~EvtNavigatorCnv ()
 
virtual StatusCode initialize ()
 
virtual ~EvtNavigatorCnv ()
 
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 TEvtNavigatorgetWriteObject ()
 returns object to be written (maintained here for all DIGI-converters)
 
static const CLID & classID ()
 
static TEvtNavigatorgetWriteObject ()
 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

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

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

Definition at line 21 of file Event/RootCnvSvc/RootCnvSvc-02-01-11/RootCnvSvc/EvtNavigatorCnv.h.

Constructor & Destructor Documentation

◆ ~EvtNavigatorCnv() [1/2]

virtual EvtNavigatorCnv::~EvtNavigatorCnv ( )
inlinevirtual

◆ EvtNavigatorCnv() [1/2]

EvtNavigatorCnv::EvtNavigatorCnv ( ISvcLocator *  svc)
protected

Definition at line 32 of file EvtNavigatorCnv.cxx.

34{
35 // Here we associate this converter with the path on the TDS.
36 MsgStream log(msgSvc(), "EvtNavigatorCnv");
37 m_rootBranchname = "m_mcMdcMcHits:m_mcMdcTracks:m_mcEmcMcHits:m_mcEmcRecShowers";
38 m_adresses.push_back(&m_mcMdcMcHits);
39 m_adresses.push_back(&m_mcMdcTracks);
40 m_adresses.push_back(&m_mcEmcMcHits);
41 m_adresses.push_back(&m_mcEmcRecShowers);
42
43 m_evtNavigatorR = 0;
44 m_evtNavigatorW = 0;
45}
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

◆ ~EvtNavigatorCnv() [2/2]

virtual EvtNavigatorCnv::~EvtNavigatorCnv ( )
inlinevirtual

◆ EvtNavigatorCnv() [2/2]

EvtNavigatorCnv::EvtNavigatorCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/2]

static const CLID & EvtNavigatorCnv::classID ( )
inlinestatic

Definition at line 26 of file Event/RootCnvSvc/RootCnvSvc-02-01-11/RootCnvSvc/EvtNavigatorCnv.h.

27 {
29 }
const CLID CLID_EventNavigator

◆ classID() [2/2]

static const CLID & EvtNavigatorCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/2]

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

transformation from TDS object to ROOT

Implements RootEventBaseCnv.

Definition at line 77 of file EvtNavigatorCnv.cxx.

77 {
78 // transforms TDS event to Dst event in root format
79 MsgStream log(msgSvc(), "EvtNavigatorCnv");
80
81 EventNavigator * evtNaviTds=dynamic_cast<EventNavigator *> (obj);
82 if (!evtNaviTds) {
83 log << MSG::ERROR << "Could not downcast to TDS EventNavigator" << endreq;
84 return StatusCode::FAILURE;
85 }
86
87 m_evtNavigatorW = new TEvtNavigator();
88 m_common.m_EvtNavigator = m_evtNavigatorW;
89
90 m_evtNavigatorW->LoadMcMdcTracks(evtNaviTds->getMcMdcTracksIdx());
91 if(evtNaviTds->getMcMdcTracksIdx().empty())
92 m_evtNavigatorW->LoadMcMdcMcHits(evtNaviTds->getMcMdcMcHitsIdx());
93 m_evtNavigatorW->LoadMcEmcRecShowers(evtNaviTds->getMcEmcRecShowersIdx());
94 if(evtNaviTds->getMcEmcRecShowersIdx().empty())
95 m_evtNavigatorW->LoadMcEmcMcHits(evtNaviTds->getMcEmcMcHitsIdx());
96
97 // create branch if not yet done
99 StatusCode sc = m_rootInterface->createBranch(rootaddr->getTreename(),"EventNavigator",m_evtNavigatorW->ClassName(),&m_evtNavigatorW,m_branchNrEvtNavigator);
100 if (sc.isFailure()) {
101 delete m_evtNavigatorW;
102 log << MSG::ERROR << "Could not create branch TEvtNavigator in " << rootaddr->getTreename() << endreq;
103 return StatusCode::SUCCESS;
104 //return sc;
105 }
106 }
107
108 return StatusCode::SUCCESS;
109}
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

◆ DataObjectToTObject() [2/2]

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

transformation from TDS object to ROOT

Implements RootEventBaseCnv.

◆ getWriteObject() [1/2]

static TEvtNavigator * EvtNavigatorCnv::getWriteObject ( )
inlinestatic

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

Definition at line 37 of file Event/RootCnvSvc/RootCnvSvc-02-01-11/RootCnvSvc/EvtNavigatorCnv.h.

37{ return m_evtNavigatorW;}

Referenced by RootCnvSvc::commitOutput().

◆ getWriteObject() [2/2]

static TEvtNavigator * EvtNavigatorCnv::getWriteObject ( )
inlinestatic

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

Definition at line 37 of file InstallArea/include/RootCnvSvc/RootCnvSvc/EvtNavigatorCnv.h.

37{ return m_evtNavigatorW;}

◆ initialize() [1/2]

StatusCode EvtNavigatorCnv::initialize ( )
virtual

Reimplemented from RootEventBaseCnv.

Definition at line 68 of file EvtNavigatorCnv.cxx.

68 {
69
70 StatusCode status = RootEventBaseCnv::initialize();
72
73 return status;
74
75}
void setEvtNavigatorCnv(EvtNavigatorCnv *evtnavigatorcnv)
virtual StatusCode initialize()

◆ initialize() [2/2]

virtual StatusCode EvtNavigatorCnv::initialize ( )
virtual

Reimplemented from RootEventBaseCnv.

◆ TObjectToDataObject() [1/2]

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

do the transformation from ROOT to TDS object

Implements RootEventBaseCnv.

Definition at line 47 of file EvtNavigatorCnv.cxx.

47 {
48 // fills the TDS object from the persistent one
49 StatusCode sc=StatusCode::SUCCESS;
50
51 MsgStream log(msgSvc(), "EvtNavigatorCnv");
52
54 refpObject = evt;
55
56 // fill DataObject
57 evt->setMcMdcMcHitsIdx(m_mcMdcMcHits);
58 evt->setMcMdcTracksIdx(m_mcMdcTracks);
59 evt->setMcEmcMcHitsIdx(m_mcEmcMcHits);
60 evt->setMcEmcRecShowersIdx(m_mcEmcRecShowers);
61
62 delete m_evtNavigatorR;
63 m_evtNavigatorR = 0;
64
65 return sc;
66}

◆ TObjectToDataObject() [2/2]

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

do the transformation from ROOT to TDS object

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< EvtNavigatorCnv >


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