BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
MucTrackCnv Class Reference

#include <MucTrackCnv.h>

+ Inheritance diagram for MucTrackCnv:

Public Member Functions

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

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

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

◆ ~MucTrackCnv() [1/2]

virtual MucTrackCnv::~MucTrackCnv ( )
inlinevirtual

◆ MucTrackCnv() [1/2]

MucTrackCnv::MucTrackCnv ( ISvcLocator *  svc)
protected

Definition at line 30 of file MucTrackCnv.cxx.

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

◆ ~MucTrackCnv() [2/2]

virtual MucTrackCnv::~MucTrackCnv ( )
inlinevirtual

◆ MucTrackCnv() [2/2]

MucTrackCnv::MucTrackCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/2]

static const CLID & MucTrackCnv::classID ( )
inlinestatic

Definition at line 20 of file Event/RootCnvSvc/RootCnvSvc-02-01-11/RootCnvSvc/Dst/MucTrackCnv.h.

21 {
22 return CLID_DstMucTrackCol;
23 }
const CLID & CLID_DstMucTrackCol
Definition: EventModel.cxx:268

◆ classID() [2/2]

static const CLID & MucTrackCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/2]

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 156 of file MucTrackCnv.cxx.

156 {
157
158 MsgStream log(msgSvc(), "MucTrackCnv");
159 log << MSG::DEBUG << "MucTrackCnv::DataObjectToTObject" << endreq;
160 StatusCode sc=StatusCode::SUCCESS;
161
162 DstMucTrackCol * mucTrackColTds=dynamic_cast<DstMucTrackCol *> (obj);
163 if (!mucTrackColTds) {
164 log << MSG::ERROR << "Could not downcast to MucTrackCol" << endreq;
165 return StatusCode::FAILURE;
166 }
167
168 DataObject *evt;
169 m_eds->findObject(EventModel::Dst::Event,evt);
170 if (evt==NULL) {
171 log << MSG::ERROR << "Could not get DstEvent in TDS " << endreq;
172 return StatusCode::FAILURE;
173 }
174 DstEvent * devtTds=dynamic_cast<DstEvent *> (evt);
175 if (!devtTds) {
176 log << MSG::ERROR << "MucTrackCnv:Could not downcast to TDS DigiEvent" << endreq;
177 }
178 IOpaqueAddress *addr;
179
180 m_cnvSvc->getDstCnv()->createRep(evt,addr);
182
183 const TObjArray *m_mucTrackCol = recEvt->getMucTrackCol();
184 if (!m_mucTrackCol) return sc;
185 recEvt->clearMucTrackCol(); //necessary in case there is I/O at the same time since array is static
186 DstMucTrackCol::const_iterator mucTrackTds;
187
188 for (mucTrackTds = mucTrackColTds->begin(); mucTrackTds != mucTrackColTds->end(); mucTrackTds++) {
189 Int_t trackId = (*mucTrackTds)->trackId();
190 Int_t id = (*mucTrackTds)-> id();
191 Int_t st = (*mucTrackTds)->status();
192 Int_t type = (*mucTrackTds)->type();
193
194 Int_t startPart = (*mucTrackTds)->startPart();
195 Int_t endPart = (*mucTrackTds)->endPart();
196 Int_t brLastLayer = (*mucTrackTds)->brLastLayer();
197 Int_t ecLastLayer = (*mucTrackTds)->ecLastLayer();
198 Int_t numHits = (*mucTrackTds)->numHits();
199 Int_t numLayers = (*mucTrackTds)->numLayers();
200 Int_t maxHitsInLayer = (*mucTrackTds)->maxHitsInLayer();
201
202 Double_t depth = (*mucTrackTds)->depth();
203 Double_t chi2 = (*mucTrackTds)->chi2();
204 Int_t dof = (*mucTrackTds)->dof();
205 Double_t rms = (*mucTrackTds)->rms();
206
207 Double_t xPos = (*mucTrackTds)->xPos() ;
208 Double_t yPos = (*mucTrackTds)->yPos() ;
209 Double_t zPos = (*mucTrackTds)->zPos() ;
210
211 Double_t xPosSigma = (*mucTrackTds)->xPosSigma() ;
212 Double_t yPosSigma = (*mucTrackTds)->yPosSigma() ;
213 Double_t zPosSigma = (*mucTrackTds)->zPosSigma() ;
214
215 Double_t px = (*mucTrackTds)->px() ;
216 Double_t py = (*mucTrackTds)->py() ;
217 Double_t pz = (*mucTrackTds)->pz() ;
218
219 Double_t distance = (*mucTrackTds)->distance();
220 Double_t deltaphi = (*mucTrackTds)->deltaPhi();
221 //added by LI Chunhua
222 Double_t krechi2 = (*mucTrackTds)->kalRechi2();
223 Int_t kdof = (*mucTrackTds)->kaldof();
224 Double_t kdepth = (*mucTrackTds)->kaldepth();
225 Int_t kbrlay = (*mucTrackTds)->kalbrLastLayer();
226 Int_t keclay = (*mucTrackTds)->kalecLastLayer();
227 //*********************
228
229 //vector<Int_t> vecHits = (*mucTrackTds)->vecHits();
230
231 TMucTrack *mucTrackRoot = new TMucTrack();
232 //m_common.m_mucTrackMap[(*mucTrackTds)] = mucTrackRoot;
233
234 mucTrackRoot->setTrackId( trackId );
235 mucTrackRoot->setId( id );
236 mucTrackRoot->setStatus( st );
237 mucTrackRoot->setType( type );
238
239 mucTrackRoot->setStartPart( startPart );
240 mucTrackRoot->setEndPart( endPart );
241 mucTrackRoot->setBrLastLayer( brLastLayer );
242 mucTrackRoot->setEcLastLayer( ecLastLayer );
243 mucTrackRoot->setNumHits( numHits );
244 mucTrackRoot->setNumLayers( numLayers );
245 mucTrackRoot->setMaxHitsInLayer( maxHitsInLayer );
246
247 mucTrackRoot->setDepth( depth );
248 mucTrackRoot->setChi2( chi2 );
249 mucTrackRoot->setDof( dof );
250 mucTrackRoot->setRms( rms );
251
252 mucTrackRoot->setXPos( xPos );
253 mucTrackRoot->setYPos( yPos );
254 mucTrackRoot->setZPos( zPos );
255
256 mucTrackRoot->setXPosSigma( xPosSigma );
257 mucTrackRoot->setYPosSigma( yPosSigma );
258 mucTrackRoot->setZPosSigma( zPosSigma );
259
260 mucTrackRoot->setPx( px );
261 mucTrackRoot->setPy( py );
262 mucTrackRoot->setPz( pz );
263
264 mucTrackRoot->setDistance(distance);
265 mucTrackRoot->setDeltaPhi(deltaphi);
266 //added by LI Chunhua 2013/02/01
267 mucTrackRoot->setkalRechi2(krechi2);
268 mucTrackRoot->setkalDof(kdof);
269 mucTrackRoot->setkalDepth(kdepth);
270 mucTrackRoot->setkalbrLastLayer(kbrlay);
271 mucTrackRoot->setkalecLastLayer(keclay);
272 //******************
273 //mucTrackRoot->setVecHits(vecHits);
274
275 recEvt->addMucTrack(mucTrackRoot);
276 }
277
278 return StatusCode::SUCCESS;
279}
ObjectVector< DstMucTrack > DstMucTrackCol
static TDstEvent * 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 addMucTrack(TMucTrack *Track)
Add a MucTrack into the TOF Data collection.
Definition: TDstEvent.cxx:152
const TObjArray * getMucTrackCol() const
retrieve the whole TObjArray of MucTrack Data

◆ DataObjectToTObject() [2/2]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/2]

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 42 of file MucTrackCnv.cxx.

42 {
43 // creation of TDS object from root object
44
45 MsgStream log(msgSvc(), "MucTrackCnv");
46 log << MSG::DEBUG << "MucTrackCnv::TObjectToDataObject" << endreq;
47 StatusCode sc=StatusCode::SUCCESS;
48
49 // create the TDS location for the MucTrack Collection
50 DstMucTrackCol* mucTrackTdsCol = new DstMucTrackCol;
51 refpObject=mucTrackTdsCol;
52
53
54 // now convert
55 if (!m_mucTrackCol) return sc;
56 TIter mucTrackIter(m_mucTrackCol);
57 TMucTrack *mucTrackRoot = 0;
58 while ((mucTrackRoot = (TMucTrack*)mucTrackIter.Next())) {
59
60 int trackId = mucTrackRoot->trackId();
61 int id = mucTrackRoot-> id();
62 int st = mucTrackRoot->status();
63 int type = mucTrackRoot->type();
64
65 int startPart = mucTrackRoot->startPart();
66 int endPart = mucTrackRoot->endPart();
67 int brLastLayer = mucTrackRoot->brLastLayer();
68 int ecLastLayer = mucTrackRoot->ecLastLayer();
69 int numHits = mucTrackRoot->numHits();
70 int numLayers = mucTrackRoot->numLayers();
71 int maxHitsInLayer = mucTrackRoot->maxHitsInLayer();
72
73 double depth = mucTrackRoot->depth();
74 double chi2 = mucTrackRoot->chi2();
75 int dof = mucTrackRoot->dof();
76 double rms = mucTrackRoot->rms();
77
78 double xPos = mucTrackRoot->xPos() ;
79 double yPos = mucTrackRoot->yPos() ;
80 double zPos = mucTrackRoot->zPos() ;
81
82 double xPosSigma = mucTrackRoot->xPosSigma() ;
83 double yPosSigma = mucTrackRoot->yPosSigma() ;
84 double zPosSigma = mucTrackRoot->zPosSigma() ;
85
86 double px = mucTrackRoot->px() ;
87 double py = mucTrackRoot->py() ;
88 double pz = mucTrackRoot->pz() ;
89
90 double distance = mucTrackRoot->distance();
91 double deltaphi = mucTrackRoot->deltaPhi();
92 //vector<int> vecHits = mucTrackRoot->vecHits();
93 //added by LI Chunhua
94 double krechi2 = mucTrackRoot->kalRechi2();
95 int kdof = mucTrackRoot->kaldof();
96 double kdepth = mucTrackRoot->kaldepth();
97 int kbrlay = mucTrackRoot->kalbrLastLayer();
98 int keclay = mucTrackRoot->kalecLastLayer();
99 //*********************
100
101 DstMucTrack *mucTrackTds = new DstMucTrack();
102 m_common.m_rootMucTrackMap[mucTrackRoot] = mucTrackTds;
103
104 mucTrackTds->setTrackId( trackId );
105 mucTrackTds->setId( id );
106 mucTrackTds->setStatus( st );
107 mucTrackTds->setType( type );
108
109 mucTrackTds->setStartPart( startPart );
110 mucTrackTds->setEndPart( endPart );
111 mucTrackTds->setBrLastLayer( brLastLayer );
112 mucTrackTds->setEcLastLayer( ecLastLayer );
113 mucTrackTds->setNumHits( numHits );
114 mucTrackTds->setNumLayers( numLayers );
115 mucTrackTds->setMaxHitsInLayer( maxHitsInLayer );
116
117 mucTrackTds->setDepth( depth );
118 mucTrackTds->setChi2( chi2 );
119 mucTrackTds->setDof( dof );
120 mucTrackTds->setRms( rms );
121
122 mucTrackTds->setXPos( xPos );
123 mucTrackTds->setYPos( yPos );
124 mucTrackTds->setZPos( zPos );
125
126 mucTrackTds->setXPosSigma( xPosSigma );
127 mucTrackTds->setYPosSigma( yPosSigma );
128 mucTrackTds->setZPosSigma( zPosSigma );
129
130 mucTrackTds->setPx( px );
131 mucTrackTds->setPy( py );
132 mucTrackTds->setPz( pz );
133
134 mucTrackTds->setDistance(distance);
135 mucTrackTds->setDeltaPhi(deltaphi);
136
137 //mucTrackTds->setVecHits(vecHits);
138 //added by LI Chunhua 2013/02/01
139 mucTrackTds->setkalRechi2(krechi2);
140 mucTrackTds->setkalDof(kdof);
141 mucTrackTds->setkalDepth(kdepth);
142 mucTrackTds->setkalbrLastLayer(kbrlay);
143 mucTrackTds->setkalecLastLayer(keclay);
144 //******************
145 mucTrackTdsCol->push_back(mucTrackTds);
146 //delete mucTrackTds; // wensp add 2005/12/31
147 // mucTrackTds = NULL;
148 }
149
150 // m_mucTrackCol->Delete(); // wensp add 2005/12/30
151 delete m_mucTrackCol;
152 m_mucTrackCol = 0;
153 return StatusCode::SUCCESS;
154}
static std::map< const TObject *, const DstMucTrack * > m_rootMucTrackMap

◆ TObjectToDataObject() [2/2]

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

transformation from root

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< MucTrackCnv >


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