BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
RecMdcDedxCnv Class Reference

#include <RecMdcDedxCnv.h>

+ Inheritance diagram for RecMdcDedxCnv:

Public Member Functions

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

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

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

◆ ~RecMdcDedxCnv() [1/2]

virtual RecMdcDedxCnv::~RecMdcDedxCnv ( )
inlinevirtual

◆ RecMdcDedxCnv() [1/2]

RecMdcDedxCnv::RecMdcDedxCnv ( ISvcLocator *  svc)
protected

Definition at line 30 of file RecMdcDedxCnv.cxx.

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

◆ ~RecMdcDedxCnv() [2/2]

virtual RecMdcDedxCnv::~RecMdcDedxCnv ( )
inlinevirtual

◆ RecMdcDedxCnv() [2/2]

RecMdcDedxCnv::RecMdcDedxCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/2]

static const CLID & RecMdcDedxCnv::classID ( )
inlinestatic

Definition at line 20 of file Event/RootCnvSvc/RootCnvSvc-02-01-12/RootCnvSvc/Rec/RecMdcDedxCnv.h.

21 {
22 return CLID_RecMdcDedxCol;
23 }
const CLID & CLID_RecMdcDedxCol
Definition: EventModel.cxx:305

◆ classID() [2/2]

static const CLID & RecMdcDedxCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/2]

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 247 of file RecMdcDedxCnv.cxx.

247 {
248 MsgStream log(msgSvc(), "RecMdcDedxCnv");
249 log << MSG::DEBUG << "RecMdcDedxCnv::DataObjectToTObject" << endreq;
250 StatusCode sc=StatusCode::SUCCESS;
251
252 RecMdcDedxCol * recMdcDedxCol=dynamic_cast<RecMdcDedxCol *> (obj);
253 if (!recMdcDedxCol) {
254 log << MSG::ERROR << "Could not downcast to RecMdcDedxCol" << endreq;
255 return StatusCode::FAILURE;
256 }
257
258 DataObject *evt;
259 m_eds->findObject(EventModel::Recon::Event,evt);
260 if (evt==NULL) {
261 log << MSG::ERROR << "Could not get RecEvent in TDS " << endreq;
262 return StatusCode::FAILURE;
263 }
264 ReconEvent * devtTds=dynamic_cast<ReconEvent *> (evt);
265 if (!devtTds) {
266 log << MSG::ERROR << "RecMdcDedxCnv:Could not downcast to TDS RecEvent" << endreq;
267 }
268
269 IOpaqueAddress *addr;
270 m_cnvSvc->getRecTrackCnv()->createRep(evt,addr);
272
273 const TObjArray *m_recMdcDedxCol = recEvt->getRecMdcDedxCol();
274 if (!m_recMdcDedxCol) return sc;
275 recEvt->clearRecMdcDedxCol(); //necessary in case there is I/O at the same time since array is static
276
277 //******************** get according mdcTrack and MdcKalmanTrack of MdcDedx ****************
278
279 RecMdcTrackCol::iterator recMdcTrackColbegin, recMdcTrackColend;
280 RecMdcKalTrackCol::iterator recMdcKalTrackColbegin, recMdcKalTrackColend;
281
282 IDataProviderSvc* dataSvc = 0;
283 sc = serviceLocator()->getService("EventDataSvc",
284 IDataProviderSvc::interfaceID(), (IInterface*&)dataSvc);
285 if ( sc.isFailure() ) {
286 log << MSG::FATAL << "Could not get EventDataSvc in RecMdcDedxCnv" << endreq;
287 return sc;
288 }
289 SmartDataPtr<RecMdcTrackCol> recMdcTrackCol(dataSvc, EventModel::Recon::RecMdcTrackCol);
290 if (!recMdcTrackCol) {
291 log << MSG::ERROR << "Could not downcast to RecMdcTrackCol" << endreq;
292 return StatusCode::FAILURE;
293 }
294 else {
295 recMdcTrackColbegin = recMdcTrackCol->begin();
296 recMdcTrackColend = recMdcTrackCol->end();
297 }
298
299 SmartDataPtr<RecMdcKalTrackCol> recMdcKalTrackCol(dataSvc, EventModel::Recon::RecMdcKalTrackCol);
300 if (!recMdcKalTrackCol) {
301 log << MSG::ERROR << "Could not downcast to RecMdcKalTrackCol" << endreq;
302 return StatusCode::FAILURE;
303 }
304 else {
305 recMdcKalTrackColbegin = recMdcKalTrackCol->begin();
306 recMdcKalTrackColend = recMdcKalTrackCol->end();
307 }
308 //******************************************************************************
309
310 RecMdcDedxCol::const_iterator recMdcDedx;
311
312 for (recMdcDedx = recMdcDedxCol->begin(); recMdcDedx != recMdcDedxCol->end(); recMdcDedx++) {
313 Int_t trackId = (*recMdcDedx)->trackId();
314 Int_t particleId = (*recMdcDedx)->particleId();
315 Int_t status = (*recMdcDedx)->status();
316 Int_t truncAlg = (*recMdcDedx)->truncAlg();
317 // Double_t pb[5];
318 // for (Int_t i = 0; i < 5; i++)
319 // pb[i] = (*dedxTds)->prob(i);
320 Double_t dedxHit = (*recMdcDedx)->getDedxHit();
321 Double_t dedxEsat = (*recMdcDedx)->getDedxEsat();
322 Double_t dedxNoRun = (*recMdcDedx)->getDedxNoRun();
323 Double_t dedxMoment = (*recMdcDedx)->getDedxMoment();
324
325
326 Double_t chiE = (*recMdcDedx)->chi(0);
327 Double_t chiMu = (*recMdcDedx)->chi(1);
328 Double_t chiPi = (*recMdcDedx)->chi(2);
329 Double_t chiK = (*recMdcDedx)->chi(3);
330 Double_t chiP = (*recMdcDedx)->chi(4);
331
332 Int_t numGoodHits = (*recMdcDedx)->numGoodHits();
333 Int_t numTotalHits = (*recMdcDedx)->numTotalHits();
334
335 Double_t probPH = (*recMdcDedx)->probPH();
336 Double_t normPH = (*recMdcDedx)->normPH();
337 Double_t errorPH = (*recMdcDedx)->errorPH();
338 Double_t twentyPH = (*recMdcDedx)->twentyPH();
339 //Double_t fracErrPH = (*dedxTds)-> fracErrPH();
340 //Double_t minIronPH = (*dedxTds)->minIronPH();
341 //Double_t corrPH = (*dedxTds)->corrPH();
342 double dedxExpect[5],sigmaDedx[5],pidProb[5],chi[5];
343 for (int i=0; i<5; i++){
344 chi[i] = (*recMdcDedx)->chi(i);
345 dedxExpect[i] = (*recMdcDedx)->getDedxExpect(i);
346 sigmaDedx[i] = (*recMdcDedx)->getSigmaDedx(i);
347 pidProb[i] = (*recMdcDedx)->getPidProb(i);
348 }
349
350 log << MSG::DEBUG<<"DataObjectToTObject: check Reconstrunction of dE/dx::"<<" trackId: "<<trackId<<" particleId: "<<particleId<<" status: "<<status<<" truncAlg: "<<truncAlg<<" chiPi: "<<chiPi<<" numTotalHits: "<<numTotalHits<<" probPH: "<<probPH<<" errorPH: "<<errorPH<<" dedxExpect[2]: "<<dedxExpect[2]<<endreq;
351
352
353 TRecMdcDedx *recMdcDedxRoot = new TRecMdcDedx();
354 //m_common.m_recMdcDedxMap[(*recMdcDedx)] = recMdcDedxRoot;
355 //std::cout<<"check write to Reconstrunction root particle Id is "<<dedxRoot->particleId()<<endl;
356 recMdcDedxRoot->setTrackId(trackId);
357 recMdcDedxRoot->setParticleId(particleId);
358 recMdcDedxRoot->setStatus (status);
359 recMdcDedxRoot->setTruncAlg(truncAlg);
360
361 //dedxRoot->setProb(pb);
362 recMdcDedxRoot->setChiE(chiE);
363 recMdcDedxRoot->setChiMu(chiMu);
364 recMdcDedxRoot->setChiPi(chiPi);
365 recMdcDedxRoot->setChiK(chiK);
366 recMdcDedxRoot->setChiP(chiP);
367
368 recMdcDedxRoot->setNumGoodHits( numGoodHits);
369 recMdcDedxRoot->setNumTotalHits( numTotalHits);
370
371 recMdcDedxRoot->setProbPH(probPH);
372 recMdcDedxRoot->setNormPH(normPH);
373 recMdcDedxRoot->setErrorPH(errorPH);
374 recMdcDedxRoot->setTwentyPH(twentyPH);
375 // for (int i=0; i<5; i++){
376 recMdcDedxRoot->setChi(chi);
377 recMdcDedxRoot->setDedxExpect(dedxExpect);
378 recMdcDedxRoot->setSigmaDedx(sigmaDedx);
379 recMdcDedxRoot->setPidProb(pidProb);
380
381 recMdcDedxRoot->setDedxHit(dedxHit);
382 recMdcDedxRoot->setDedxEsat(dedxEsat);
383 recMdcDedxRoot->setDedxNoRun(dedxNoRun);
384 recMdcDedxRoot->setDedxMoment(dedxMoment);
385 //}
386
387 if ( (*recMdcDedx)->isMdcTrackValid() ) {
388 RecMdcTrackCol::iterator it = find(recMdcTrackColbegin, recMdcTrackColend, (*recMdcDedx)->getMdcTrack());
389 recMdcDedxRoot->setMdcTrackId( it - recMdcTrackColbegin );
390 }
391 else {
392 recMdcDedxRoot->setMdcTrackId( -1 );
393 }
394
395 if ( (*recMdcDedx)->isMdcKalTrackValid() ) {
396 RecMdcKalTrackCol::iterator it = find(recMdcKalTrackColbegin, recMdcKalTrackColend, (*recMdcDedx)->getMdcKalTrack());
397 recMdcDedxRoot->setMdcKalTrackId( it - recMdcKalTrackColbegin );
398 }
399 else {
400 recMdcDedxRoot->setMdcKalTrackId( -1 );
401 }
402
403 log << MSG::INFO<<"check Reconstrunction root"<<" particle Id is : "<<particleId
404 <<"track id is : "<<trackId
405 <<" and status is : "<<status<<endreq;
406
407 // dedxRoot->setFracErrPH(fracErrPH);
408 //dedxRoot->setMinIronPH(minIronPH);
409 //dedxRoot->setCorrPH(corrPH);
410 recEvt->addRecMdcDedx(recMdcDedxRoot);
411 }
412
413 return StatusCode::SUCCESS;
414}
ObjectVector< RecMdcDedx > RecMdcDedxCol
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 addRecMdcDedx(TRecMdcDedx *Track)
Add a Dedx into the TOF Data collection.
const TObjArray * getRecMdcDedxCol() const
retrieve the whole TObjArray of Dedx Data

◆ DataObjectToTObject() [2/2]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/2]

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 44 of file RecMdcDedxCnv.cxx.

44 {
45 // creation of TDS object from root object
46 MsgStream log(msgSvc(), "RecMdcDedxCnv");
47 log << MSG::DEBUG << "RecMdcDedxCnv::TObjectToDataObject" << endreq;
48 StatusCode sc=StatusCode::SUCCESS;
49
50 // create the TDS location for the Dedx Collection
51 RecMdcDedxCol* recMdcDedxCol = new RecMdcDedxCol;
52 refpObject=recMdcDedxCol;
53
54 if (!m_recMdcDedxCol) return sc;
55
56 //*******************Dst to Rec convert in case of no Rec data in TDS****************************
57 IDataProviderSvc* dataSvc = 0;
58 sc = serviceLocator()->getService("EventDataSvc",
59 IDataProviderSvc::interfaceID(), (IInterface*&)dataSvc);
60 if ( sc.isFailure() ) {
61 log << MSG::FATAL << "Could not get EventDataSvc in RecMdcDedxCnv" << endreq;
62 return sc;
63 }
64
65 //----------get hit smartRefVector--------
66 SmartDataPtr<RecMdcDedxHitCol> recMdcDedxHitCol(dataSvc,"/Event/Recon/RecMdcDedxHitCol");
67 if (!recMdcDedxHitCol) {
68 log << MSG::FATAL << "Could not find RecMdcDedxHitCol" << endreq;
69 return( StatusCode::FAILURE);
70 }
71
72
73 int trackID;
74 // Retrieve Mdc Track
75 SmartDataPtr<RecMdcTrackCol> mdcTrackCol(dataSvc, EventModel::Recon::RecMdcTrackCol);
76 if(!mdcTrackCol)
77 {
78 log << MSG::INFO << "Could not find RecMdcTrackCol" << endreq;
79 SmartDataPtr<DstMdcTrackCol> dstMdcTrackCol(dataSvc,"/Event/Dst/DstMdcTrackCol");
80 if (!dstMdcTrackCol) {
81 log << MSG::INFO << "Could not find DstMdcTrackCol" << endreq;
82 }
83 else {
84 RecMdcTrackCol* mdcTrackCol = new RecMdcTrackCol();
85 DstMdcTrackCol::iterator iter_mdc = dstMdcTrackCol->begin();
86 trackID = 0;
87 for (;iter_mdc != dstMdcTrackCol->end(); iter_mdc++, trackID++) {
88 RecMdcTrack* recMdcTrack = new RecMdcTrack();
89 *recMdcTrack = **iter_mdc;
90 (*mdcTrackCol).push_back(recMdcTrack);
91 log << MSG::INFO
92 << " Mdc Track ID = " << trackID
93 << " Mdc Track Nster = " << (*iter_mdc)->nster()
94 << endreq;
95 }
96 sc = dataSvc->registerObject(EventModel::Recon::RecMdcTrackCol,mdcTrackCol);
97 }
98 }
99
100 // Retrieve MdcKal track
101 SmartDataPtr<RecMdcKalTrackCol> mdcKalTrackCol(dataSvc, EventModel::Recon::RecMdcKalTrackCol);
102 if (!mdcKalTrackCol) {
103 log << MSG::INFO << "Could not find RecMdcKalTrackCol" << endreq;
104 SmartDataPtr<DstMdcKalTrackCol> dstMdcKalTrackCol(dataSvc,"/Event/Dst/DstMdcKalTrackCol");
105 if(!dstMdcKalTrackCol) {
106 log << MSG::INFO << "Could not find DstMdcKalTrackCol" << endreq;
107 }
108 else {
109 RecMdcKalTrackCol* mdcKalTrackCol = new RecMdcKalTrackCol();
110 DstMdcKalTrackCol::iterator iter_mdc = dstMdcKalTrackCol->begin();
111 trackID = 0;
112 for (;iter_mdc != dstMdcKalTrackCol->end(); iter_mdc++, trackID++) {
113 RecMdcKalTrack* recMdcKalTrack = new RecMdcKalTrack();
114 *recMdcKalTrack = **iter_mdc;
115 (*mdcKalTrackCol).push_back(recMdcKalTrack);
116 log << MSG::INFO
117 << " MdcKalTrack ID = " << trackID
118 << " MdcKalTrack Nster = " << (*iter_mdc)->nster()
119 << " MdcKalTrack poca = " << (*iter_mdc)->poca()
120 << endreq;
121 }
122 sc = dataSvc->registerObject(EventModel::Recon::RecMdcKalTrackCol, mdcKalTrackCol);
123 }
124 }
125
126
127 //**********************************************************************
128 // now convert
129 TIter dedxIter(m_recMdcDedxCol);
130 TRecMdcDedx *recMdcDedxRoot = 0;
131 while ((recMdcDedxRoot = (TRecMdcDedx*)dedxIter.Next())) {
132 double dedxHit = recMdcDedxRoot->dedxHit();
133 double dedxEsat = recMdcDedxRoot->dedxEsat();
134 double dedxNoRun = recMdcDedxRoot->dedxNoRun();
135 double dedxMoment = recMdcDedxRoot->dedxMoment();
136
137 int trackId = recMdcDedxRoot->trackId();
138 int particleId = recMdcDedxRoot->particleId();
139 int status = recMdcDedxRoot->status();
140 int truncAlg = recMdcDedxRoot->truncAlg();
141 // double pb[5];
142 // for ( int i = 0; i < 5; i++)
143 // pb[i] = dedxRoot->prob(i);
144
145 // double numSigmaE = dedxRoot->numSigmaE();
146 // double numSigmaMu = dedxRoot->numSigmaMu();
147 // double numSigmaPi = dedxRoot->numSigmaPi();
148 // double numSigmaK = dedxRoot->numSigmaK();
149 // double numSigmaP = dedxRoot->numSigmaP();
150 double chi[5];
151 chi[0] = recMdcDedxRoot->chiE();
152 chi[1] = recMdcDedxRoot->chiMu();
153 chi[2] = recMdcDedxRoot->chiPi();
154 chi[3] = recMdcDedxRoot->chiK();
155 chi[4] = recMdcDedxRoot->chiP();
156 int numGoodHits = recMdcDedxRoot->numGoodHits();
157 int numTotalHits = recMdcDedxRoot->numTotalHits();
158
159 double probPH = recMdcDedxRoot->probPH();
160 double normPH = recMdcDedxRoot->normPH();
161 double errorPH = recMdcDedxRoot->errorPH();
162 double twentyPH = recMdcDedxRoot->twentyPH();
163 double dedxExpect[5],sigmaDedx[5],pidProb[5];
164
165 for (int i=0; i<5; i++){
166 dedxExpect[i] = recMdcDedxRoot->dedxExpect(i);
167 sigmaDedx[i] = recMdcDedxRoot->sigmaDedx(i);
168 pidProb[i] = recMdcDedxRoot->pidProb(i);}
169
170 log << MSG::DEBUG<<"TObjectToDataObject: check Reconstrunction of dE/dx root::"<<" trackId: "<<trackId<<" particleId: "<<particleId<<" status: "<<status<<" truncAlg: "<<truncAlg<<" chi[2]: "<<chi[2]<<" numTotalHits: "<<numTotalHits<<" probPH: "<<probPH<<" errorPH: "<<errorPH<<" dedxExpect[2]: "<<dedxExpect[2]<<endreq;
171
172 RecMdcDedx *recMdcDedx = new RecMdcDedx();
173 m_common.m_rootRecMdcDedxMap[recMdcDedxRoot] = recMdcDedx;
174
175 recMdcDedx->setTrackId(trackId);
176 recMdcDedx->setParticleId(particleId);
177 recMdcDedx->setStatus (status);
178 recMdcDedx->setTruncAlg(truncAlg);
179 // dedxTds->setProb(pb);
180 // dedxTds->setNumSigmaE(numSigmaE);
181 // dedxTds->setNumSigmaMu(numSigmaMu);
182 // dedxTds->setNumSigmaPi(numSigmaPi);
183 // dedxTds->setNumSigmaK(numSigmaK);
184 // dedxTds->setNumSigmaP(numSigmaP);
185 recMdcDedx->setChi(chi);
186 recMdcDedx->setNumGoodHits( numGoodHits);
187 recMdcDedx->setNumTotalHits( numTotalHits);
188
189 recMdcDedx->setProbPH(probPH);
190 recMdcDedx->setNormPH(normPH);
191 recMdcDedx->setErrorPH(errorPH);
192 recMdcDedx->setTwentyPH(twentyPH);
193 //for (int i=0; i<5; i++){
194 recMdcDedx->setDedxExpect(dedxExpect);
195 recMdcDedx->setSigmaDedx(sigmaDedx);
196 recMdcDedx->setPidProb(pidProb);
197
198 recMdcDedx->setDedxHit(dedxHit);
199 recMdcDedx->setDedxEsat(dedxEsat);
200 recMdcDedx->setDedxNoRun(dedxNoRun);
201 recMdcDedx->setDedxMoment(dedxMoment);
202 //}
203
204 DedxHitRefVec theDedxHitRefVec;
205 RecMdcDedxHitCol::iterator iter = recMdcDedxHitCol->begin();
206 for (;iter != recMdcDedxHitCol->end(); iter++){
207 if((*iter)->getTrkId() == trackId){
208 SmartRef<RecMdcDedxHit> refDedxHit(*iter);
209 theDedxHitRefVec.push_back(refDedxHit);
210 }
211 }
212 recMdcDedx->setVecDedxHits(theDedxHitRefVec);
213 int nhits = recMdcDedx->getVecDedxHits().size();
214 //std::cout<<" mdc hits: "<<nhits<< std::endl;
215 for(int ii=0; ii <nhits ; ii++){
216 Identifier id(recMdcDedx->getVecDedxHits()[ii]->getMdcId());
217 int layer = MdcID::layer(id);
218 int wire = MdcID::wire(id);
219 //cout<<"layer: "<<layer<<" wire: "<<wire<<endl;
220 }
221
222 int mdcTrackId = recMdcDedxRoot->mdcTrackId();
223 //std::cout << __FILE__ << __LINE__ << " size: " << mdcTrackCol->size() << " id: " << mdcTrackId << std::endl;
224 if ( mdcTrackId >= 0 ) {
225 recMdcDedx->setMdcTrack(
226 dynamic_cast<RecMdcTrack*>(mdcTrackCol->containedObject(mdcTrackId)));
227 }
228 int mdcKalTrackId = recMdcDedxRoot->mdcKalTrackId();
229 //std::cout << __FILE__ << __LINE__ << " size: " << mdcKalTrackCol->size() << " id: " << mdcKalTrackId<< std::endl;
230 if ( mdcKalTrackId >= 0 ) {
231 recMdcDedx->setMdcKalTrack(
232 dynamic_cast<RecMdcKalTrack*>(mdcKalTrackCol->containedObject(mdcKalTrackId)));
233 }
234
235 recMdcDedxCol->push_back(recMdcDedx);
236 //delete dedxTds;
237 // dedxTds = NULL;
238 }
239 //m_dedxCol->Delete();
240 delete m_recMdcDedxCol;
241 m_recMdcDedxCol = 0;
242
243 return StatusCode::SUCCESS;
244}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
SmartRefVector< RecMdcDedxHit > DedxHitRefVec
ObjectVector< RecMdcKalTrack > RecMdcKalTrackCol
ObjectVector< RecMdcTrack > RecMdcTrackCol
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
Definition: MdcID.cxx:49
static int wire(const Identifier &id)
Definition: MdcID.cxx:54
void setVecDedxHits(const DedxHitRefVec &vecdedxhit)
static std::map< const TObject *, const RecMdcDedx * > m_rootRecMdcDedxMap

◆ TObjectToDataObject() [2/2]

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

transformation from root

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< RecMdcDedxCnv >


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