BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
RecMdcHitCnv Class Reference

#include <RecMdcHitCnv.h>

+ Inheritance diagram for RecMdcHitCnv:

Public Member Functions

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

 RecMdcHitCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
 RecMdcHitCnv (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< RecMdcHitCnv >
 

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

◆ ~RecMdcHitCnv() [1/2]

virtual RecMdcHitCnv::~RecMdcHitCnv ( )
inlinevirtual

◆ RecMdcHitCnv() [1/2]

RecMdcHitCnv::RecMdcHitCnv ( ISvcLocator *  svc)
protected

Definition at line 28 of file RecMdcHitCnv.cxx.

30{
31
32 // Here we associate this converter with the /Event path on the TDS.
33 MsgStream log(msgSvc(), "RecMdcHitCnv");
34 //log << MSG::DEBUG << "Constructor called for " << objType() << endreq;
35 //m_rootTreename ="Rec";
36 m_rootBranchname ="m_recMdcHitCol";
37 //declareObject(EventModel::Recon::RecMdcHitCol, objType(), m_rootTreename, m_rootBranchname);
38 m_adresses.push_back(&m_recMdcHitCol);
39 m_recMdcHitCol=0;
40}
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

◆ ~RecMdcHitCnv() [2/2]

virtual RecMdcHitCnv::~RecMdcHitCnv ( )
inlinevirtual

◆ RecMdcHitCnv() [2/2]

RecMdcHitCnv::RecMdcHitCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/2]

static const CLID & RecMdcHitCnv::classID ( )
inlinestatic

Definition at line 20 of file Event/RootCnvSvc/RootCnvSvc-03-00-06/RootCnvSvc/Rec/RecMdcHitCnv.h.

21 {
22 return CLID_RecMdcHitCol;
23 }
const CLID & CLID_RecMdcHitCol
Definition: EventModel.cxx:299

◆ classID() [2/2]

static const CLID & RecMdcHitCnv::classID ( )
inlinestatic

Definition at line 20 of file InstallArea/include/RootCnvSvc/RootCnvSvc/Rec/RecMdcHitCnv.h.

21 {
22 return CLID_RecMdcHitCol;
23 }

◆ DataObjectToTObject() [1/2]

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 100 of file RecMdcHitCnv.cxx.

100 {
101
102 MsgStream log(msgSvc(), "RecMdcHitCnv");
103 log << MSG::DEBUG << "RecMdcHitCnv::DataObjectToTObject" << endreq;
104
105 RecMdcHitCol * mdcHitColTds=dynamic_cast<RecMdcHitCol *> (obj);
106 if (!mdcHitColTds) {
107 log << MSG::ERROR << "Could not downcast to RecMdcHitCol" << endreq;
108 return StatusCode::FAILURE;
109 }
110
111 DataObject *evt;
112 m_eds->findObject(EventModel::Recon::Event,evt);
113 if (evt==NULL) {
114 log << MSG::ERROR << "Could not get ReconEvent in TDS " << endreq;
115 return StatusCode::FAILURE;
116 }
117
118 ReconEvent * devtTds=dynamic_cast<ReconEvent *> (evt);
119 if (!devtTds) {
120 log << MSG::ERROR << "RecMdcHitCnv:Could not downcast to TDS ReconEvent" << endreq;
121 }
122
123 IOpaqueAddress *addr;
124
125 m_cnvSvc->getRecTrackCnv()->createRep(evt,addr);
127
128 const TObjArray *m_recMdcHitCol = recEvt->getRecMdcHitCol();
129 if (!m_recMdcHitCol) return StatusCode::SUCCESS;
130 recEvt->clearRecMdcHitCol(); //necessary in case there is I/O at the same time since array is static
131
132 RecMdcHitCol::const_iterator recMdcHit;
133 for (recMdcHit = mdcHitColTds->begin(); recMdcHit != mdcHitColTds->end(); recMdcHit++) {
134 Bool_t isGrouped =(*recMdcHit)->isGrouped();
135 Int_t id =(*recMdcHit)->getId();
136 Int_t trackId =(*recMdcHit)->getTrkId();
137 Double_t driftDistLeft =(*recMdcHit)->getDriftDistLeft();
138 Double_t driftDistRight =(*recMdcHit)->getDriftDistRight();
139 Double_t errDriftDistLeft =(*recMdcHit)->getErrDriftDistLeft();
140 Double_t errDriftDistRight =(*recMdcHit)->getErrDriftDistRight();
141 Double_t chisqAdd =(*recMdcHit)->getChisqAdd();
142 Int_t flagLR =(*recMdcHit)->getFlagLR();
143 Int_t stat =(*recMdcHit)->getStat();
144 UInt_t mdcId =(*recMdcHit)->getMdcId().get_value();
145 Double_t tdc =(*recMdcHit)->getTdc();
146 Double_t adc =(*recMdcHit)->getAdc();
147 Double_t driftT =(*recMdcHit)->getDriftT();
148 Double_t doca =(*recMdcHit)->getDoca();
149 Double_t entra =(*recMdcHit)->getEntra();
150 Double_t zhit =(*recMdcHit)->getZhit();
151 Double_t fltLen =(*recMdcHit)->getFltLen();
152
153 TRecMdcHit *recMdcHitRoot = new TRecMdcHit();
154 //m_common.m_recMdcHitMap[(*recMdcHit)] = recMdcHitRoot;
155
156 recMdcHitRoot->setIsGrouped( isGrouped );
157 recMdcHitRoot->setId( id );
158 recMdcHitRoot->setTrkId( trackId );
159 recMdcHitRoot->setDriftDistLeft( driftDistLeft );
160 recMdcHitRoot->setDriftDistRight( driftDistRight );
161 recMdcHitRoot->setErrDriftDistLeft( errDriftDistLeft );
162 recMdcHitRoot->setErrDriftDistRight( errDriftDistRight );
163 log<<MSG::INFO<<" recMdcHitRoot.ddl: "<<recMdcHitRoot->getDriftDistLeft()
164 <<" recMdcHitRoot.erddl: "<<recMdcHitRoot->getErrDriftDistLeft()
165 <<endreq;
166 recMdcHitRoot->setChisqAdd( chisqAdd );
167 recMdcHitRoot->setFlagLR( flagLR );
168 recMdcHitRoot->setStat( stat );
169 recMdcHitRoot->setMdcId( mdcId );
170 recMdcHitRoot->setTdc( tdc );
171 recMdcHitRoot->setAdc( adc );
172 recMdcHitRoot->setDriftT( driftT );
173 recMdcHitRoot->setDoca( doca );
174 recMdcHitRoot->setEntra( entra );
175 recMdcHitRoot->setZhit( zhit );
176 recMdcHitRoot->setFltLen( fltLen );
177
178 recEvt->addRecMdcHit(recMdcHitRoot);
179 }
180 return StatusCode::SUCCESS;
181}
ObjectVector< RecMdcHit > RecMdcHitCol
static TRecTrackEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
IDataProviderSvc * m_eds
pointer to eventdataservice
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void addRecMdcHit(TRecMdcHit *Hit)
Add a Rec Mdc Hit into the Mdc data collection.
void clearRecMdcHitCol()
clear the whole array (necessary because of the consts-s)
const TObjArray * getRecMdcHitCol() const
retrieve the whole TObjArray of RecMdcHit Data

◆ DataObjectToTObject() [2/2]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/2]

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 42 of file RecMdcHitCnv.cxx.

42 {
43 // creation of TDS object from root object
44 MsgStream log(msgSvc(), "RecMdcHitCnv");
45 log << MSG::DEBUG << "RecMdcHitCnv::TObjectToDataObject" << endreq;
46
47 // create the TDS location for the RecMdcHit Collection
48 RecMdcHitCol* recMdcHitCol = new RecMdcHitCol;
49 refpObject = recMdcHitCol;
50
51 // now convert
52 if (!m_recMdcHitCol) return StatusCode::SUCCESS;
53 TIter mdcHitIter(m_recMdcHitCol);
54 TRecMdcHit *recMdcHitRoot = 0;
55 while ((recMdcHitRoot = (TRecMdcHit*)mdcHitIter.Next())) {
56 int id = recMdcHitRoot->getId();
57 int trackId = recMdcHitRoot->getTrkId();
58 double driftDistLeft = recMdcHitRoot->getDriftDistLeft();
59 double driftDistRight = recMdcHitRoot->getDriftDistRight();
60 double errDriftDistLeft = recMdcHitRoot->getErrDriftDistLeft();
61 double errDriftDistRight = recMdcHitRoot->getErrDriftDistRight();
62 double chisqAdd = recMdcHitRoot->getChisqAdd();
63 int flagLR = recMdcHitRoot->getFlagLR();
64 int stat = recMdcHitRoot->getStat();
65 long int mdcId(recMdcHitRoot->getMdcId());
66 double tdc = recMdcHitRoot->getTdc();
67 double adc = recMdcHitRoot->getAdc();
68 double driftT = recMdcHitRoot->getDriftT();
69 double doca = recMdcHitRoot->getDoca();
70 double entra = recMdcHitRoot->getEntra();
71 double zhit = recMdcHitRoot->getZhit();
72 double fltLen = recMdcHitRoot->getFltLen();
73
74 RecMdcHit *recMdcHit= new RecMdcHit();
75 m_common.m_rootRecMdcHitMap[recMdcHitRoot] = recMdcHit;
76
77 recMdcHit->setId( id );
78 recMdcHit->setTrkId( trackId );
79 recMdcHit->setDriftDistLeft( driftDistLeft );
80 recMdcHit->setDriftDistRight( driftDistRight );
81 recMdcHit->setErrDriftDistLeft( errDriftDistLeft );
82 recMdcHit->setErrDriftDistRight( errDriftDistRight );
83 recMdcHit->setChisqAdd( chisqAdd );
84 recMdcHit->setFlagLR( flagLR );
85 recMdcHit->setStat( stat );
86 recMdcHit->setMdcId( Identifier(mdcId) );
87 recMdcHit->setTdc( tdc );
88 recMdcHit->setAdc( adc );
89 recMdcHit->setDriftT( driftT );
90 recMdcHit->setDoca( doca );
91 recMdcHit->setEntra( entra );
92 recMdcHit->setZhit( zhit );
93 recMdcHit->setFltLen( fltLen );
94
95 recMdcHitCol->push_back(recMdcHit);
96 }
97 return StatusCode::SUCCESS;
98}
static std::map< const TObject *, const RecMdcHit * > m_rootRecMdcHitMap

◆ TObjectToDataObject() [2/2]

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

transformation from root

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< RecMdcHitCnv >


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