BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
RecEmcHitCnv Class Reference

#include <RecEmcHitCnv.h>

+ Inheritance diagram for RecEmcHitCnv:

Public Member Functions

virtual ~RecEmcHitCnv ()
 
- 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
 
- Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
 

Static Public Member Functions

static const CLID & classID ()
 
- Static Public Member Functions inherited from RootEventBaseCnv
static const unsigned char storageType ()
 Storage type and class ID.
 

Protected Member Functions

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

Friends

class CnvFactory< RecEmcHitCnv >
 

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 15 of file RecEmcHitCnv.h.

Constructor & Destructor Documentation

◆ ~RecEmcHitCnv()

virtual RecEmcHitCnv::~RecEmcHitCnv ( )
inlinevirtual

Definition at line 25 of file RecEmcHitCnv.h.

25{ };

◆ RecEmcHitCnv()

RecEmcHitCnv::RecEmcHitCnv ( ISvcLocator * svc)
protected

Definition at line 31 of file RecEmcHitCnv.cxx.

33{
34 //cout<<"in RecEmcHitCnv::constructor: hitid= "<<aHit->clID()<<endl;
35
36 // Here we associate this converter with the /Event path on the TDS.
37 MsgStream log(msgSvc(), "RecEmcHitCnv");
38 //log << MSG::DEBUG << "Constructor called for " << objType() << endreq;
39 m_rootTreename ="Rec";
40 m_rootBranchname ="m_recEmcHitCol";
41 //declareObject(EventModel::Recon::RecEmcHitCol, objType(), m_rootTreename, m_rootBranchname);
42 m_adresses.push_back(&m_recEmcHitCol);
43 m_recEmcHitCol=0;
44}
IMessageSvc * msgSvc()
static const CLID & classID()
std::string m_rootTreename
each converter knows it's treename
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)

Member Function Documentation

◆ classID()

static const CLID & RecEmcHitCnv::classID ( )
inlinestatic

Definition at line 20 of file RecEmcHitCnv.h.

21 {
22 return CLID_RecEmcHitCol;
23 }
const CLID & CLID_RecEmcHitCol

◆ DataObjectToTObject()

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 83 of file RecEmcHitCnv.cxx.

83 {
84
85 MsgStream log(msgSvc(), "RecEmcHitCnv");
86 log << MSG::DEBUG << "RecEmcHitCnv::DataObjectToTObject" << endreq;
87 //cout<<"RecEmcHitCnv::DataObjectToTObject"<<endl;
88 StatusCode sc=StatusCode::SUCCESS;
89
90 RecEmcHitCol * emcHitColTds=dynamic_cast<RecEmcHitCol *> (obj);
91 if (!emcHitColTds) {
92 log << MSG::ERROR << "Could not downcast to RecEmcHitCol" << endreq;
93 return StatusCode::FAILURE;
94 }
95
96 DataObject *evt;
97 m_eds->findObject(EventModel::Recon::Event,evt);
98 if (evt==NULL) {
99 log << MSG::ERROR << "Could not get RecEvent in TDS " << endreq;
100 return StatusCode::FAILURE;
101 }
102 ReconEvent * devtTds=dynamic_cast<ReconEvent *> (evt);
103 if (!devtTds) {
104 log << MSG::ERROR << "RecEmcHitCnv:Could not downcast to TDS DstEvent" << endreq;
105 }
106 IOpaqueAddress *addr;
107
108 m_cnvSvc->getRecTrackCnv()->createRep(evt,addr);
110
111 const TObjArray *m_emcHitCol = recEvt->getEmcHitCol();
112 if (!m_emcHitCol) return sc;
113
114 //necessary in case there is I/O at the same time since array is static
115 recEvt->clearEmcHitCol();
116
117 RecEmcHitCol::const_iterator emcHitTds;
118
119 for(emcHitTds = emcHitColTds->begin();
120 emcHitTds != emcHitColTds->end();
121 emcHitTds++) {
122 Int_t cellId = (*emcHitTds)->getCellId();
123 Double_t energy = (*emcHitTds)->getEnergy();
124 Double_t time = (*emcHitTds)->getTime();
125
126 TRecEmcHit *emcHitRoot = new TRecEmcHit();
127 //m_common.m_recEmcHitMap[(*emcHitTds)] = emcHitRoot;
128 emcHitRoot->setCellId(cellId);
129 emcHitRoot->setEnergy(energy);
130 emcHitRoot->setTime(time);
131
132 recEvt->addEmcHit(emcHitRoot);
133 }
134
135 return StatusCode::SUCCESS;
136}
Double_t time
************Class m_ypar INTEGER m_KeyWgt INTEGER m_KeyIHVP INTEGER m_KeyGPS INTEGER m_IsBeamPolarized INTEGER m_EvtGenInterface DOUBLE PRECISION m_Emin DOUBLE PRECISION m_sphot DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_q2 DOUBLE PRECISION m_PolBeam2 DOUBLE PRECISION m_xErrPb *COMMON c_KK2f $ !CMS energy average $ !Spin Polarization vector first beam $ !Spin Polarization vector second beam $ !Beam energy spread[GeV] $ !minimum hadronization energy[GeV] $ !input READ never touch them !$ !debug facility $ !maximum weight $ !inverse alfaQED $ !minimum real photon energy
Definition KK2f.h:50
ObjectVector< RecEmcHit > RecEmcHitCol
Definition RecEmcHit.h:76
#define NULL
static TRecTrackEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
Definition RecTrackCnv.h:36
RecTrackCnv * getRecTrackCnv()
Definition RootCnvSvc.h:173
RootCnvSvc * m_cnvSvc
IDataProviderSvc * m_eds
pointer to eventdataservice
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void setCellId(const Int_t id)
Definition TRecEmcHit.h:22
void setEnergy(const Double_t e)
Definition TRecEmcHit.h:23
void setTime(const Double_t time)
Definition TRecEmcHit.h:24
void addEmcHit(TRecEmcHit *Track)
Add a TkrTrack into the Emc data collection *‍/.
void clearEmcHitCol()
clear the whole array (necessary because of the consts-s) *‍/
const TObjArray * getEmcHitCol() const
retrieve the whole TObjArray of EmcHit Data
_EXTERN_ std::string Event
Definition EventModel.h:84

◆ TObjectToDataObject()

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 46 of file RecEmcHitCnv.cxx.

46 {
47
48 // creation of TDS object from root object
49 MsgStream log(msgSvc(), "RecEmcHitCnv");
50 log << MSG::DEBUG << "RecEmcHitCnv::TObjectToDataObject" << endreq;
51 //cout<<"RecEmcHitCnv::TObjectToDataObject"<<endl;
52 StatusCode sc=StatusCode::SUCCESS;
53
54 // create the TDS location for the RecEmcHit Collection
55 RecEmcHitCol* emcHitTdsCol = new RecEmcHitCol;
56 refpObject=emcHitTdsCol;
57
58 // now convert
59 if (!m_recEmcHitCol) return sc;
60 TIter emcHitIter(m_recEmcHitCol);
61 TRecEmcHit *emcHitRoot = 0;
62 while ((emcHitRoot = (TRecEmcHit*)emcHitIter.Next())) {
63 RecEmcID cellId(emcHitRoot->cellId());
64 double energy = emcHitRoot->energy();
65 double time = emcHitRoot->time();
66
67 //cout<<"cellId="<<cellId<<"\tenergy="<<energy<<"\ttime="<<time<<endl;
68
69 RecEmcHit *emcHitTds = new RecEmcHit();
70 m_common.m_rootRecEmcHitMap[emcHitRoot] = emcHitTds;
71
72 emcHitTds->Assign(cellId,energy,time);
73
74 emcHitTdsCol->push_back(emcHitTds);
75 }
76
77 delete m_recEmcHitCol;
78 m_recEmcHitCol = 0;
79
80 return StatusCode::SUCCESS;
81}
void Assign(const RecEmcID &CellId, const RecEmcEnergy &Energy, const RecEmcTime &Time)
Definition RecEmcHit.cxx:99
Double_t energy() const
Definition TRecEmcHit.h:18
Int_t cellId() const
Definition TRecEmcHit.h:17
Double_t time() const
Definition TRecEmcHit.h:19
static std::map< const TObject *, const RecEmcHit * > m_rootRecEmcHitMap
Definition commonData.h:216

Friends And Related Symbol Documentation

◆ CnvFactory< RecEmcHitCnv >

friend class CnvFactory< RecEmcHitCnv >
friend

Definition at line 9 of file RecEmcHitCnv.h.


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