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

#include <EvtRecEtaToGGCnv.h>

+ Inheritance diagram for EvtRecEtaToGGCnv:

Public Member Functions

virtual ~EvtRecEtaToGGCnv ()
 
virtual ~EvtRecEtaToGGCnv ()
 
- 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 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.
 

Protected Member Functions

 EvtRecEtaToGGCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
 EvtRecEtaToGGCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
- Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
 
virtual destinationconvert (const source &) const =0
 

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

Constructor & Destructor Documentation

◆ ~EvtRecEtaToGGCnv() [1/2]

virtual EvtRecEtaToGGCnv::~EvtRecEtaToGGCnv ( )
inlinevirtual

◆ EvtRecEtaToGGCnv() [1/2]

EvtRecEtaToGGCnv::EvtRecEtaToGGCnv ( ISvcLocator *  svc)
protected

Definition at line 24 of file EvtRecEtaToGGCnv.cxx.

26{
27 m_rootBranchname = "m_evtRecEtaToGGCol";
28 m_adresses.push_back(&m_evtRecEtaToGGCol);
29 m_evtRecEtaToGGCol = 0;
30}
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

◆ ~EvtRecEtaToGGCnv() [2/2]

virtual EvtRecEtaToGGCnv::~EvtRecEtaToGGCnv ( )
inlinevirtual

◆ EvtRecEtaToGGCnv() [2/2]

EvtRecEtaToGGCnv::EvtRecEtaToGGCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/2]

static const CLID & EvtRecEtaToGGCnv::classID ( )
inlinestatic

Definition at line 19 of file Event/RootCnvSvc/RootCnvSvc-02-01-13/RootCnvSvc/EvtRec/EvtRecEtaToGGCnv.h.

19{ return CLID_EvtRecEtaToGGCol; }
const CLID & CLID_EvtRecEtaToGGCol
Definition: EventModel.cxx:384

◆ classID() [2/2]

static const CLID & EvtRecEtaToGGCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/2]

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 90 of file EvtRecEtaToGGCnv.cxx.

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

◆ DataObjectToTObject() [2/2]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/2]

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 32 of file EvtRecEtaToGGCnv.cxx.

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

◆ TObjectToDataObject() [2/2]

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

transformation from root

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< EvtRecEtaToGGCnv >


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