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

#include <RecTrackCnv.h>

+ Inheritance diagram for RecTrackCnv:

Public Member Functions

virtual ~RecTrackCnv ()
 
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 TRecTrackEventgetWriteObject ()
 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

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

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 21 of file RecTrackCnv.h.

Constructor & Destructor Documentation

◆ ~RecTrackCnv()

virtual RecTrackCnv::~RecTrackCnv ( )
inlinevirtual

Definition at line 31 of file RecTrackCnv.h.

31{ };

◆ RecTrackCnv()

RecTrackCnv::RecTrackCnv ( ISvcLocator *  svc)
protected

Definition at line 37 of file RecTrackCnv.cxx.

39{
40
41 // Here we associate this converter with the path on the TDS.
43 //declareObject(EventModel::Recon::Event, objType(), m_rootTreename, m_rootBranchname); //Dst-->Recon liangyt -->Rec
44 //m_objWrite=0;
45}
static const CLID & classID()
Definition: RecTrackCnv.h:26
Base class for all Root Converters.
std::string m_rootBranchname
root branchname (may be concatenated of severals)

Member Function Documentation

◆ classID()

static const CLID & RecTrackCnv::classID ( )
inlinestatic

Definition at line 26 of file RecTrackCnv.h.

27 {
28 return CLID_ReconEvent;
29 }
const CLID & CLID_ReconEvent
Reconstruction.
Definition: EventModel.cxx:293

◆ DataObjectToTObject()

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

transformation from TDS object to ROOT

Implements RootEventBaseCnv.

Definition at line 83 of file RecTrackCnv.cxx.

83 {
84 // transforms TDS event to Dst event in root format
85 MsgStream log(msgSvc(), "RecTrackCnv");
86 log << MSG::DEBUG << "RecTrackCnv::DataObjectToTObject" << endreq;
87
88 // test if already done for this event
89 //zoujh: if (m_objWrite && (m_objWrite->getRunId()!=0 || m_objWrite->getEventId()!=0)) return StatusCode::SUCCESS;
90
91 if (m_common.m_rectrackEvt != NULL) return StatusCode::SUCCESS;
92/*
93 SmartDataPtr<Event::EventHeader> evtTds(m_eds, EventModel::EventHeader);
94
95 if (!evtTds) {
96 log << MSG::ERROR << "Failed to retrieve EventHeader in TDS" << endreq;
97 return StatusCode::FAILURE;
98 }
99*/
100 ReconEvent * devtTds=dynamic_cast<ReconEvent *> (obj);
101 if (!devtTds) {
102 log << MSG::ERROR << "Could not downcast to TDS Event" << endreq;
103 return StatusCode::FAILURE;
104 }
105
106 m_objWrite = new TRecTrackEvent(); //zoujh
107 m_common.m_rectrackEvt = m_objWrite; //zoujh
108
109 // create branch if not yet done
110 if (m_branchNrRecon<0) { ///////////liangyt
111 //zoujh: m_objWrite = new TDstEvent();
112 StatusCode sc = m_rootInterface->createBranch(rootaddr->getTreename(),"TRecEvent",m_objWrite->ClassName(),&m_objWrite,m_branchNrRecon);
113
114
115 if (sc.isFailure()) {
116 cout<<"Could not create branch TRecEvent"<<endl;
117 log << MSG::ERROR << "Could not create branch TRecEvent" << endreq;
118 return sc;
119 }
120 }
121
122 //Int_t evtId = evtTds->eventNumber();
123 //Int_t runId = evtTds->runNumber();
124
125
126 m_objWrite->initialize();
127
128 return StatusCode::SUCCESS;
129}
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 TRecTrackEvent * m_rectrackEvt
Provide access to the ROOT event pointers.
Definition: commonData.h:200

◆ getWriteObject()

◆ initialize()

StatusCode RecTrackCnv::initialize ( )
virtual

Reimplemented from RootEventBaseCnv.

Definition at line 47 of file RecTrackCnv.cxx.

47 {
48 MsgStream log(msgSvc(), "RecTrackCnv");
49 log << MSG::DEBUG << "RecTrackCnv::initialize"<< endreq;
50
51 StatusCode status = RootEventBaseCnv::initialize();
52
53 //pass dst converter to the conversion service
55
56 return status;
57
58}
void setRecTrackCnv(RecTrackCnv *rectrackcnv)
Definition: RootCnvSvc.h:167
RootCnvSvc * m_cnvSvc
virtual StatusCode initialize()

◆ TObjectToDataObject()

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

do the transformation from ROOT to TDS object

Implements RootEventBaseCnv.

Definition at line 60 of file RecTrackCnv.cxx.

60 {
61 // fills the TDS object from the persistent one
62 StatusCode sc=StatusCode::SUCCESS;
63
64 MsgStream log(msgSvc(), "RecTrackCnv");
65 log << MSG::DEBUG << "TObjectToDataObject" << endreq;
66 /*
67 SmartDataPtr<Event::EventHeader> evt(m_eds, EventModel::EventHeader);
68 if (!evt) {
69 log << MSG::ERROR << "Failed to retrieve RecEvent" << endreq;
70 return StatusCode::FAILURE;
71 }
72
73 */
74
75 ReconEvent * tdsev = new ReconEvent();
76 refpObject = tdsev;
77 //sc =m_eds ->registerObject(EventModel::EventHeader, evt);
78
79
80 return sc;
81}

Friends And Related Function Documentation

◆ CnvFactory< RecTrackCnv >

friend class CnvFactory< RecTrackCnv >
friend

Definition at line 10 of file RecTrackCnv.h.


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