BOSS 6.6.4.p03
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 ()
 
- 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 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.
 

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
 
- Protected Member Functions inherited from Converter< Ty1, Ty2 >
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
 
- 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 EvtNavigatorCnv.h.

Constructor & Destructor Documentation

◆ ~EvtNavigatorCnv()

virtual EvtNavigatorCnv::~EvtNavigatorCnv ( )
inlinevirtual

Definition at line 31 of file EvtNavigatorCnv.h.

31{ };

◆ EvtNavigatorCnv()

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}
IMessageSvc * msgSvc()
static const CLID & classID()
Base class for all Root Converters.
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

Member Function Documentation

◆ classID()

static const CLID & EvtNavigatorCnv::classID ( )
inlinestatic

Definition at line 26 of file EvtNavigatorCnv.h.

27 {
29 }
const CLID CLID_EventNavigator

◆ DataObjectToTObject()

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}
IndexMap & getMcMdcMcHitsIdx()
IndexMap & getMcEmcMcHitsIdx()
IndexMap & getMcEmcRecShowersIdx()
IndexMap & getMcMdcTracksIdx()
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 LoadMcEmcMcHits(std::multimap< int, int > &map)
Definition: TEvtNavigator.h:26
void LoadMcMdcMcHits(std::multimap< int, int > &map)
Definition: TEvtNavigator.h:24
void LoadMcEmcRecShowers(std::multimap< int, int > &map)
Definition: TEvtNavigator.h:27
void LoadMcMdcTracks(std::multimap< int, int > &map)
Definition: TEvtNavigator.h:25
static TEvtNavigator * m_EvtNavigator
Definition: commonData.h:114

◆ getWriteObject()

static TEvtNavigator * EvtNavigatorCnv::getWriteObject ( )
inlinestatic

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

Definition at line 37 of file EvtNavigatorCnv.h.

37{ return m_evtNavigatorW;}

Referenced by RootCnvSvc::commitOutput().

◆ initialize()

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)
Definition: RootCnvSvc.h:162
RootCnvSvc * m_cnvSvc
virtual StatusCode initialize()

◆ TObjectToDataObject()

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}
void setMcEmcRecShowersIdx(IndexMap &map)
void setMcMdcMcHitsIdx(IndexMap &map)
void setMcEmcMcHitsIdx(IndexMap &map)
void setMcMdcTracksIdx(IndexMap &map)

Friends And Related Function Documentation

◆ CnvFactory< EvtNavigatorCnv >

friend class CnvFactory< EvtNavigatorCnv >
friend

Definition at line 12 of file EvtNavigatorCnv.h.


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