BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
HltCnv Class Reference

Concrete converter for the Rec branch. More...

#include <HltCnv.h>

+ Inheritance diagram for HltCnv:

Public Member Functions

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

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

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

Based on the HltCnv of GLAST.

Definition at line 20 of file Event/RootCnvSvc/RootCnvSvc-02-01-12/RootCnvSvc/Hlt/HltCnv.h.

Constructor & Destructor Documentation

◆ ~HltCnv() [1/2]

virtual HltCnv::~HltCnv ( )
inlinevirtual

◆ HltCnv() [1/2]

HltCnv::HltCnv ( ISvcLocator *  svc)
protected

Definition at line 26 of file HltCnv.cxx.

28{
29 // Here we associate this converter with the path on the TDS.
30 //o m_rootBranchname ="m_fromMc";
31 //declareObject(EventModel::Digi::Event, objType(), m_rootTreename, m_rootBranchname);
32 //o m_adresses.push_back(&m_fromMc);
33
34 //m_objWrite=0;
35
36}

◆ ~HltCnv() [2/2]

virtual HltCnv::~HltCnv ( )
inlinevirtual

Definition at line 30 of file InstallArea/include/RootCnvSvc/RootCnvSvc/Hlt/HltCnv.h.

30{ };

◆ HltCnv() [2/2]

HltCnv::HltCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/2]

static const CLID & HltCnv::classID ( )
inlinestatic

Definition at line 25 of file Event/RootCnvSvc/RootCnvSvc-02-01-12/RootCnvSvc/Hlt/HltCnv.h.

26 {
27 return CLID_HltEvent;
28 }
const CLID & CLID_HltEvent
Definition: EventModel.cxx:283

◆ classID() [2/2]

static const CLID & HltCnv::classID ( )
inlinestatic

Definition at line 25 of file InstallArea/include/RootCnvSvc/RootCnvSvc/Hlt/HltCnv.h.

26 {
27 return CLID_HltEvent;
28 }

◆ DataObjectToTObject() [1/2]

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

transformation from TDS object to ROOT

Implements RootEventBaseCnv.

Definition at line 73 of file HltCnv.cxx.

73 {
74 // transforms TDS event to digi event in root format
75 MsgStream log(msgSvc(), "HltCnv");
76 log << MSG::DEBUG << "HltCnv::DataObjectToTObject" << endreq;
77
78 // test if already done for this event
79 //zoujh: if (m_objWrite && (m_objWrite->getRunId()!=0 || m_objWrite->getEventId()!=0)) return StatusCode::SUCCESS;
80 if (m_common.m_hltEvt != NULL) return StatusCode::SUCCESS;
81
82/*
83 SmartDataPtr<Event::EventHeader> evtTds(m_eds, EventModel::EventHeader);
84
85 if (!evtTds) {
86 log << MSG::ERROR << "Failed to retrieve EventHeader in TDS" << endreq;
87 return StatusCode::FAILURE;
88 }
89 */
90 HltEvent * devtTds=dynamic_cast<HltEvent *> (obj);
91 if (!devtTds) {
92 log << MSG::ERROR << "Could not downcast to TDS RecEvent" << endreq;
93 return StatusCode::FAILURE;
94 }
95 m_objWrite = new THltEvent(); //zoujh
96 m_common.m_hltEvt = m_objWrite; //zoujh
97
98 // create branch if not yet done
99 if (m_branchNr<0) {
100 //zoujh: m_objWrite = new THltEvent();
101 StatusCode sc = m_rootInterface->createBranch(rootaddr->getTreename(),"THltEvent",m_objWrite->ClassName(),&m_objWrite,m_branchNr);
102 if (sc.isFailure()) {
103 log << MSG::ERROR << "Could not create branch THltEvent" << endreq;
104 return sc;
105 }
106 }
107
108 //Int_t evtId = evtTds->eventNumber();
109 //Int_t runId = evtTds->runNumber();
110
111 //o Bool_t fromMc = devtTds->fromMc();
112
113#ifdef DEBUG
114 std::cout<<"******************************"<<std::endl;
115 std::cout<<" eveId: "<<evtId<<std::endl;
116 std::cout<<" runId: "<<runId<<std::endl;
117 std::cout<<"******************************"<<std::endl;
118#endif
119
120 //o m_objWrite->initialize(fromMc);
121 m_objWrite->initialize();
122
123 return StatusCode::SUCCESS;
124}
int m_branchNr
the branchNr of this converter for writing
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 THltEvent * m_hltEvt
Provide access to the ROOT event pointers.

◆ DataObjectToTObject() [2/2]

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

transformation from TDS object to ROOT

Implements RootEventBaseCnv.

◆ getWriteObject() [1/2]

static THltEvent * HltCnv::getWriteObject ( )
inlinestatic

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

Definition at line 35 of file Event/RootCnvSvc/RootCnvSvc-02-01-12/RootCnvSvc/Hlt/HltCnv.h.

35{ return m_objWrite;};

Referenced by RootCnvSvc::commitOutput(), DstHltInfCnv::DataObjectToTObject(), HltInfCnv::DataObjectToTObject(), and HltRawCnv::DataObjectToTObject().

◆ getWriteObject() [2/2]

static THltEvent * HltCnv::getWriteObject ( )
inlinestatic

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

Definition at line 35 of file InstallArea/include/RootCnvSvc/RootCnvSvc/Hlt/HltCnv.h.

35{ return m_objWrite;};

◆ initialize() [1/2]

StatusCode HltCnv::initialize ( )
virtual

Reimplemented from RootEventBaseCnv.

Definition at line 38 of file HltCnv.cxx.

38 {
39 MsgStream log(msgSvc(), "HltCnv");
40 log << MSG::DEBUG << "HltCnv::initialize"<< endreq;
41
42 StatusCode status = RootEventBaseCnv::initialize();
43
44 //pass dst converter to the conversion service
45 m_cnvSvc->setHltCnv(this);
46
47 return status;
48
49}
virtual StatusCode initialize()

◆ initialize() [2/2]

virtual StatusCode HltCnv::initialize ( )
virtual

Reimplemented from RootEventBaseCnv.

◆ TObjectToDataObject() [1/2]

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

do the transformation from ROOT to TDS object

Implements RootEventBaseCnv.

Definition at line 51 of file HltCnv.cxx.

51 {
52 // fills the TDS object from the root object
53 StatusCode sc=StatusCode::SUCCESS;
54
55 MsgStream log(msgSvc(), "HltCnv");
56 log << MSG::DEBUG << "TObjectToDataObject" << endreq;
57/*
58 SmartDataPtr<Event::EventHeader> evt(m_eds, EventModel::EventHeader);
59 if (!evt) {
60 log << MSG::ERROR << "Failed to retrieve RecEvent" << endreq;
61 return StatusCode::FAILURE;
62 }
63*/
64 HltEvent * tdsev = new HltEvent();
65 refpObject = tdsev;
66
67 m_fromMc = false; // There is no "THltEvent" branch in MC-dst-files.
68 tdsev->initialize(m_fromMc);
69
70 return sc;
71}

◆ TObjectToDataObject() [2/2]

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

do the transformation from ROOT to TDS object

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< HltCnv >

friend class CnvFactory< HltCnv >
friend

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