BOSS 8.0.0
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 ()
 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
virtual ~HltCnv ()
virtual StatusCode initialize ()
 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
virtual ~HltCnv ()
virtual StatusCode initialize ()
 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
Public Member Functions inherited from RootEventBaseCnv
 RootEventBaseCnv (const CLID &clid, ISvcLocator *svc)
virtual ~RootEventBaseCnv ()
virtual long repSvcType () const
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.
TObject * getReadObject () const
 get the object to be read
 RootEventBaseCnv (const CLID &clid, ISvcLocator *svc)
virtual ~RootEventBaseCnv ()
virtual long repSvcType () const
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.
TObject * getReadObject () const
 get the object to be read
 RootEventBaseCnv (const CLID &clid, ISvcLocator *svc)
virtual ~RootEventBaseCnv ()
virtual long repSvcType () const
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.
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
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 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.
static const unsigned char storageType ()
 Storage type and class ID.

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
typedef Ty1 source
typedef Ty2 destination
Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
virtual destinationconvert (const source &) const =0
virtual destinationconvert (const source &) const =0
Protected Attributes inherited from RootEventBaseCnv
IRootCnvSvcm_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/include/RootCnvSvc/Hlt/HltCnv.h.

Constructor & Destructor Documentation

◆ ~HltCnv() [1/3]

virtual HltCnv::~HltCnv ( )
inlinevirtual

Definition at line 27 of file Event/RootCnvSvc/include/RootCnvSvc/Hlt/HltCnv.h.

27{};

◆ HltCnv() [1/3]

HltCnv::HltCnv ( ISvcLocator * svc)

Definition at line 26 of file HltCnv.cxx.

26 : RootEventBaseCnv( classID(), svc ) {
27 // Here we associate this converter with the path on the TDS.
28 // o m_rootBranchname ="m_fromMc";
29 // declareObject(EventModel::Digi::Event, objType(), m_rootTreename, m_rootBranchname);
30 // o m_adresses.push_back(&m_fromMc);
31
32 // m_objWrite=0;
33}
RootEventBaseCnv(const CLID &clid, ISvcLocator *svc)

◆ ~HltCnv() [2/3]

virtual HltCnv::~HltCnv ( )
inlinevirtual

◆ HltCnv() [2/3]

HltCnv::HltCnv ( ISvcLocator * svc)

◆ ~HltCnv() [3/3]

virtual HltCnv::~HltCnv ( )
inlinevirtual

◆ HltCnv() [3/3]

HltCnv::HltCnv ( ISvcLocator * svc)

Member Function Documentation

◆ classID() [1/3]

const CLID & HltCnv::classID ( )
inlinestatic

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

25{ return CLID_HltEvent; }
const CLID & CLID_HltEvent

Referenced by RootCnvSvc::createConverter(), and HltCnv().

◆ classID() [2/3]

const CLID & HltCnv::classID ( )
inlinestatic

◆ classID() [3/3]

const CLID & HltCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/3]

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

transformation from TDS object to ROOT

Implements RootEventBaseCnv.

Definition at line 69 of file HltCnv.cxx.

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

◆ DataObjectToTObject() [2/3]

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

transformation from TDS object to ROOT

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

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

transformation from TDS object to ROOT

Implements RootEventBaseCnv.

◆ getWriteObject() [1/3]

THltEvent * HltCnv::getWriteObject ( )
inlinestatic

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

Definition at line 32 of file Event/RootCnvSvc/include/RootCnvSvc/Hlt/HltCnv.h.

32{ return m_objWrite; };

◆ getWriteObject() [2/3]

THltEvent * HltCnv::getWriteObject ( )
inlinestatic

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

Definition at line 32 of file InstallArea/x86_64-el9-gcc13-dbg/include/RootCnvSvc/Hlt/HltCnv.h.

32{ return m_objWrite; };

◆ getWriteObject() [3/3]

THltEvent * HltCnv::getWriteObject ( )
inlinestatic

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

Definition at line 32 of file InstallArea/x86_64-el9-gcc13-opt/include/RootCnvSvc/Hlt/HltCnv.h.

32{ return m_objWrite; };

◆ initialize() [1/3]

StatusCode HltCnv::initialize ( )
virtual

Reimplemented from RootEventBaseCnv.

Definition at line 35 of file HltCnv.cxx.

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

◆ initialize() [2/3]

virtual StatusCode HltCnv::initialize ( )
virtual

Reimplemented from RootEventBaseCnv.

◆ initialize() [3/3]

virtual StatusCode HltCnv::initialize ( )
virtual

Reimplemented from RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

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

do the transformation from ROOT to TDS object

Implements RootEventBaseCnv.

Definition at line 47 of file HltCnv.cxx.

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

◆ TObjectToDataObject() [2/3]

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

do the transformation from ROOT to TDS object

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

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

do the transformation from ROOT to TDS object

Implements RootEventBaseCnv.

◆ CnvFactory< HltCnv >

friend class CnvFactory< HltCnv >
friend

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