BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtRecEtaToGGCnv Class Reference

#include <EvtRecEtaToGGCnv.h>

Inheritance diagram for EvtRecEtaToGGCnv:

Public Member Functions

virtual ~EvtRecEtaToGGCnv ()
 EvtRecEtaToGGCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
virtual ~EvtRecEtaToGGCnv ()
 EvtRecEtaToGGCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
virtual ~EvtRecEtaToGGCnv ()
 EvtRecEtaToGGCnv (ISvcLocator *svc)
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
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.
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.
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.
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 const CLID & classID ()
static const CLID & classID ()
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< EvtRecEtaToGGCnv >

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

Constructor & Destructor Documentation

◆ ~EvtRecEtaToGGCnv() [1/3]

virtual EvtRecEtaToGGCnv::~EvtRecEtaToGGCnv ( )
inlinevirtual

◆ EvtRecEtaToGGCnv() [1/3]

EvtRecEtaToGGCnv::EvtRecEtaToGGCnv ( ISvcLocator * svc)

Definition at line 23 of file EvtRecEtaToGGCnv.cxx.

23 : RootEventBaseCnv( classID(), svc ) {
24 m_rootBranchname = "m_evtRecEtaToGGCol";
25 m_adresses.push_back( &m_evtRecEtaToGGCol );
26 m_evtRecEtaToGGCol = 0;
27}
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)
RootEventBaseCnv(const CLID &clid, ISvcLocator *svc)

◆ ~EvtRecEtaToGGCnv() [2/3]

virtual EvtRecEtaToGGCnv::~EvtRecEtaToGGCnv ( )
inlinevirtual

◆ EvtRecEtaToGGCnv() [2/3]

EvtRecEtaToGGCnv::EvtRecEtaToGGCnv ( ISvcLocator * svc)

◆ ~EvtRecEtaToGGCnv() [3/3]

virtual EvtRecEtaToGGCnv::~EvtRecEtaToGGCnv ( )
inlinevirtual

◆ EvtRecEtaToGGCnv() [3/3]

EvtRecEtaToGGCnv::EvtRecEtaToGGCnv ( ISvcLocator * svc)

Member Function Documentation

◆ classID() [1/3]

const CLID & EvtRecEtaToGGCnv::classID ( )
inlinestatic

Definition at line 19 of file Event/RootCnvSvc/include/RootCnvSvc/EvtRec/EvtRecEtaToGGCnv.h.

19{ return CLID_EvtRecEtaToGGCol; }
const CLID & CLID_EvtRecEtaToGGCol

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

◆ classID() [2/3]

const CLID & EvtRecEtaToGGCnv::classID ( )
inlinestatic

◆ classID() [3/3]

const CLID & EvtRecEtaToGGCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/3]

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 86 of file EvtRecEtaToGGCnv.cxx.

86 {
87 MsgStream log( msgSvc(), "EvtRecEtaToGGCnv" );
88 log << MSG::DEBUG << "EvtRecEtaToGGCnv::DataObjectToTObject" << endmsg;
89
90 EvtRecEtaToGGCol* evtRecEtaToGGCol = dynamic_cast<EvtRecEtaToGGCol*>( obj );
91 if ( !evtRecEtaToGGCol )
92 {
93 log << MSG::ERROR << "Could not downcast to EvtRecEtaToGGCol" << endmsg;
94 return StatusCode::FAILURE;
95 }
96
97 DataObject* evt;
98 m_eds->findObject( EventModel::EvtRec::Event, evt );
99 if ( evt == NULL )
100 {
101 log << MSG::ERROR << "Could not get EvtRecObject in TDS" << endmsg;
102 return StatusCode::FAILURE;
103 }
104 EvtRecObject* devtTds = dynamic_cast<EvtRecObject*>( evt );
105 if ( !devtTds )
106 {
107 log << MSG::ERROR << "EvtRecEtaToGGCnv: Could not downcast to TDS EvtRecObject" << endmsg;
108 }
109
110 IOpaqueAddress* addr;
111 m_cnvSvc->getEvtRecCnv()->createRep( evt, addr );
112 TEvtRecObject* recEvt = m_cnvSvc->getEvtRecCnv()->getWriteObject();
113
114 const TObjArray* m_evtRecEtaToGGCol = recEvt->getEvtRecEtaToGGCol();
115 if ( !m_evtRecEtaToGGCol ) return StatusCode::SUCCESS;
116
117 IDataProviderSvc* dataSvc = 0;
118 StatusCode sc = serviceLocator()->getService(
119 "EventDataSvc", IDataProviderSvc::interfaceID(), (IInterface*&)dataSvc );
120 if ( sc.isFailure() )
121 {
122 log << MSG::FATAL << "Could not get EventDataSvc in EvtRecEtaToGGCnv" << endmsg;
123 return sc;
124 }
125
126 EvtRecTrackCol::iterator evtRecTrackColbegin, evtRecTrackColend;
127
128 SmartDataPtr<EvtRecTrackCol> evtRecTrackCol( dataSvc, EventModel::EvtRec::EvtRecTrackCol );
129 if ( !evtRecTrackCol ) { log << MSG::INFO << "Could not find EvtRecTrackCol" << endmsg; }
130 else
131 {
132 evtRecTrackColbegin = evtRecTrackCol->begin();
133 evtRecTrackColend = evtRecTrackCol->end();
134 }
135
136 // convert
137 recEvt->clearEvtRecEtaToGGCol();
138 EvtRecEtaToGGCol::const_iterator evtRecEtaToGG = evtRecEtaToGGCol->begin();
139
140 for ( ; evtRecEtaToGG != evtRecEtaToGGCol->end(); evtRecEtaToGG++ )
141 {
142 EvtRecEtaToGG* ptr = *evtRecEtaToGG;
143 TEvtRecEtaToGG* evtRecEtaToGGRoot = new TEvtRecEtaToGG();
144
145 // set ...
146 evtRecEtaToGGRoot->setUnconMass( ptr->unconMass() );
147 evtRecEtaToGGRoot->setChisq( ptr->chisq() );
148
149 HepLorentzVector hiP4 = ptr->hiPfit();
150 HepLorentzVector loP4 = ptr->loPfit();
151 evtRecEtaToGGRoot->setHiPxfit( hiP4.x() );
152 evtRecEtaToGGRoot->setHiPyfit( hiP4.y() );
153 evtRecEtaToGGRoot->setHiPzfit( hiP4.z() );
154 evtRecEtaToGGRoot->setHiPefit( hiP4.t() );
155
156 evtRecEtaToGGRoot->setLoPxfit( loP4.x() );
157 evtRecEtaToGGRoot->setLoPyfit( loP4.y() );
158 evtRecEtaToGGRoot->setLoPzfit( loP4.z() );
159 evtRecEtaToGGRoot->setLoPefit( loP4.t() );
160
161 // assert(evtRecTrackColbegin != evtRecTrackColend);
162 EvtRecTrackCol::iterator it =
163 find( evtRecTrackColbegin, evtRecTrackColend, ptr->hiEnGamma() );
164 // assert(it != evtRecTrackColend);
165 evtRecEtaToGGRoot->setHiEnGamma( it - evtRecTrackColbegin );
166
167 // assert(evtRecTrackColbegin != evtRecTrackColend);
168 it = find( evtRecTrackColbegin, evtRecTrackColend, ptr->loEnGamma() );
169 // assert(it != evtRecTrackColend);
170 evtRecEtaToGGRoot->setLoEnGamma( it - evtRecTrackColbegin );
171
172 recEvt->addEvtRecEtaToGG( evtRecEtaToGGRoot );
173 }
174
175 return StatusCode::SUCCESS;
176}
ObjectVector< EvtRecEtaToGG > EvtRecEtaToGGCol
IMessageSvc * msgSvc()
IDataProviderSvc * m_eds
pointer to eventdataservice
void addEvtRecEtaToGG(TEvtRecEtaToGG *eta)

◆ DataObjectToTObject() [2/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

StatusCode EvtRecEtaToGGCnv::TObjectToDataObject ( DataObject *& obj)
virtual

transformation from root

Implements RootEventBaseCnv.

Definition at line 29 of file EvtRecEtaToGGCnv.cxx.

29 {
30 // creation of TDS object from root object
31 MsgStream log( msgSvc(), "EvtRecEtaToGGCnv" );
32 log << MSG::DEBUG << "EvtRecEtaToGGCnv::TObjectToDataObject" << endmsg;
33
34 // create the TDS location for the EvtRecEtaToGG Collection
35 EvtRecEtaToGGCol* evtRecEtaToGGCol = new EvtRecEtaToGGCol;
36 refpObject = evtRecEtaToGGCol;
37
38 if ( !m_evtRecEtaToGGCol ) return StatusCode::SUCCESS;
39
40 IDataProviderSvc* dataSvc = 0;
41 StatusCode sc = serviceLocator()->getService(
42 "EventDataSvc", IDataProviderSvc::interfaceID(), (IInterface*&)dataSvc );
43 if ( sc.isFailure() )
44 {
45 log << MSG::FATAL << "Could not get EventDataSvc in EvtRecEtaToGGCnv" << endmsg;
46 return sc;
47 }
48
49 SmartDataPtr<EvtRecTrackCol> evtRecTrackCol( dataSvc, EventModel::EvtRec::EvtRecTrackCol );
50 if ( !evtRecTrackCol ) { log << MSG::INFO << "Could not find EvtRecTrackCol" << endmsg; }
51
52 // convert
53 TIter evtRecEtaToGGIter( m_evtRecEtaToGGCol );
54 TEvtRecEtaToGG* evtRecEtaToGGRoot = 0;
55 while ( ( evtRecEtaToGGRoot = (TEvtRecEtaToGG*)evtRecEtaToGGIter.Next() ) )
56 {
57 EvtRecEtaToGG* evtRecEtaToGG = new EvtRecEtaToGG();
58 m_common.m_rootEvtRecEtaToGGMap[evtRecEtaToGGRoot] = evtRecEtaToGG;
59
60 // set ....
61 evtRecEtaToGG->setUnconMass( evtRecEtaToGGRoot->unconMass() );
62 evtRecEtaToGG->setChisq( evtRecEtaToGGRoot->chisq() );
63
64 HepLorentzVector hiP4( evtRecEtaToGGRoot->hiPxfit(), evtRecEtaToGGRoot->hiPyfit(),
65 evtRecEtaToGGRoot->hiPzfit(), evtRecEtaToGGRoot->hiPefit() );
66 HepLorentzVector loP4( evtRecEtaToGGRoot->loPxfit(), evtRecEtaToGGRoot->loPyfit(),
67 evtRecEtaToGGRoot->loPzfit(), evtRecEtaToGGRoot->loPefit() );
68 evtRecEtaToGG->setHiPfit( hiP4 );
69 evtRecEtaToGG->setLoPfit( loP4 );
70
71 int hiEnGammatrk = evtRecEtaToGGRoot->hiEnGamma();
72 int loEnGammatrk = evtRecEtaToGGRoot->loEnGamma();
73 evtRecEtaToGG->setHiEnGamma(
74 dynamic_cast<EvtRecTrack*>( evtRecTrackCol->containedObject( hiEnGammatrk ) ) );
75 evtRecEtaToGG->setLoEnGamma(
76 dynamic_cast<EvtRecTrack*>( evtRecTrackCol->containedObject( loEnGammatrk ) ) );
77
78 evtRecEtaToGGCol->push_back( evtRecEtaToGG );
79 }
80
81 delete m_evtRecEtaToGGCol;
82 m_evtRecEtaToGGCol = 0;
83 return StatusCode::SUCCESS;
84}
void setHiPfit(const HepLorentzVector &hiPfit)
void setLoPfit(const HepLorentzVector &loPfit)

◆ TObjectToDataObject() [2/3]

virtual StatusCode EvtRecEtaToGGCnv::TObjectToDataObject ( DataObject *& obj)
virtual

transformation from root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

virtual StatusCode EvtRecEtaToGGCnv::TObjectToDataObject ( DataObject *& obj)
virtual

transformation from root

Implements RootEventBaseCnv.

◆ CnvFactory< EvtRecEtaToGGCnv >


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