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

#include <RecMdcDedxCnv.h>

+ Inheritance diagram for RecMdcDedxCnv:

Public Member Functions

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

 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
 

Friends

class CnvFactory< RecMdcDedxCnv >
 

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 RecMdcDedxCnv.h.

Constructor & Destructor Documentation

◆ ~RecMdcDedxCnv()

virtual RecMdcDedxCnv::~RecMdcDedxCnv ( )
inlinevirtual

Definition at line 25 of file RecMdcDedxCnv.h.

25{ };

◆ RecMdcDedxCnv()

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}
IMessageSvc * msgSvc()
static const CLID & classID()
Definition: RecMdcDedxCnv.h:20
Base class for all Root Converters.
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

Member Function Documentation

◆ classID()

static const CLID & RecMdcDedxCnv::classID ( )
inlinestatic

Definition at line 20 of file RecMdcDedxCnv.h.

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

◆ DataObjectToTObject()

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
Definition: RecMdcDedx.h:132
static TRecTrackEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
Definition: RecTrackCnv.h:36
RecTrackCnv * getRecTrackCnv()
Definition: RootCnvSvc.h:166
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 setNumTotalHits(const Int_t numTotalHits)
Definition: TRecMdcDedx.h:70
void setProbPH(const Double_t probPH)
Definition: TRecMdcDedx.h:72
void setPidProb(double *pid_prob)
Definition: TRecMdcDedx.h:89
void setChi(double *chi)
Definition: TRecMdcDedx.h:77
void setDedxHit(const Double_t dedx_hit)
Definition: TRecMdcDedx.h:51
void setTruncAlg(const Int_t trunc_alg)
Definition: TRecMdcDedx.h:61
void setSigmaDedx(double *sigma_dedx)
Definition: TRecMdcDedx.h:85
void setParticleId(const Int_t particleId)
Definition: TRecMdcDedx.h:59
void setMdcTrackId(const int mdcTrackId)
Definition: TRecMdcDedx.h:56
void setTwentyPH(const Double_t twentyPH)
Definition: TRecMdcDedx.h:75
void setDedxMoment(const Double_t dedx_momentum)
Definition: TRecMdcDedx.h:54
void setChiE(const Double_t chiE)
Definition: TRecMdcDedx.h:63
void setDedxEsat(const Double_t dedx_esat)
Definition: TRecMdcDedx.h:52
void setErrorPH(const Double_t errorPH)
Definition: TRecMdcDedx.h:74
void setMdcKalTrackId(const int mdcKalTrackId)
Definition: TRecMdcDedx.h:57
void setStatus(const Int_t status)
Definition: TRecMdcDedx.h:60
void setChiPi(const Double_t chiPi)
Definition: TRecMdcDedx.h:65
void setTrackId(const Int_t trackId)
Definition: TRecMdcDedx.h:58
void setNormPH(const Double_t normPH)
Definition: TRecMdcDedx.h:73
void setChiP(const Double_t chiP)
Definition: TRecMdcDedx.h:67
void setDedxNoRun(const Double_t dedx_norun)
Definition: TRecMdcDedx.h:53
void setDedxExpect(double *dedx_exp)
Definition: TRecMdcDedx.h:81
void setChiMu(const Double_t chiMu)
Definition: TRecMdcDedx.h:64
void setChiK(const Double_t chiK)
Definition: TRecMdcDedx.h:66
void setNumGoodHits(const Int_t numGoodHits)
Definition: TRecMdcDedx.h:69
void clearRecMdcDedxCol()
clear the whole array
void addRecMdcDedx(TRecMdcDedx *Track)
Add a Dedx into the TOF Data collection.
const TObjArray * getRecMdcDedxCol() const
retrieve the whole TObjArray of Dedx Data
_EXTERN_ std::string RecMdcTrackCol
Definition: EventModel.h:82
_EXTERN_ std::string Event
Definition: EventModel.h:80
_EXTERN_ std::string RecMdcKalTrackCol
Definition: EventModel.h:86

◆ TObjectToDataObject()

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
Definition: RecMdcDedx.h:27
ObjectVector< RecMdcKalTrack > RecMdcKalTrackCol
ObjectVector< RecMdcTrack > RecMdcTrackCol
Definition: RecMdcTrack.h:79
void setChi(double *chi)
Definition: DstMdcDedx.h:77
void setTruncAlg(int trunc_alg)
Definition: DstMdcDedx.h:75
void setStatus(int status)
Definition: DstMdcDedx.h:74
void setTwentyPH(double twentyPH)
Definition: DstMdcDedx.h:86
void setNumGoodHits(int numGoodHits)
Definition: DstMdcDedx.h:81
void setProbPH(double probPH)
Definition: DstMdcDedx.h:83
void setNormPH(double normPH)
Definition: DstMdcDedx.h:84
void setParticleId(int particleId)
Definition: DstMdcDedx.h:73
void setTrackId(int trackId)
Definition: DstMdcDedx.h:72
void setNumTotalHits(int numTotalHits)
Definition: DstMdcDedx.h:82
void setErrorPH(double errorPH)
Definition: DstMdcDedx.h:85
const int nster() const
const int nster() const
Definition: DstMdcTrack.h:68
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 setMdcTrack(RecMdcTrack *trk)
Definition: RecMdcDedx.h:107
DedxHitRefVec getVecDedxHits() const
Definition: RecMdcDedx.h:61
void setVecDedxHits(const DedxHitRefVec &vecdedxhit)
Definition: RecMdcDedx.h:76
void setDedxNoRun(double dedx_norun)
Definition: RecMdcDedx.h:80
void setMdcKalTrack(RecMdcKalTrack *trk)
Definition: RecMdcDedx.h:108
void setDedxMoment(double dedx_momentum)
Definition: RecMdcDedx.h:81
void setDedxExpect(double *dedx_exp)
Definition: RecMdcDedx.h:90
void setSigmaDedx(double *sigma_dedx)
Definition: RecMdcDedx.h:94
void setDedxEsat(double dedx_esat)
Definition: RecMdcDedx.h:79
void setDedxHit(double dedx_hit)
Definition: RecMdcDedx.h:78
void setPidProb(double *pid_prob)
Definition: RecMdcDedx.h:98
Double_t chiP() const
Definition: TRecMdcDedx.h:31
Double_t normPH() const
Definition: TRecMdcDedx.h:37
Double_t dedxExpect(int pid) const
Definition: TRecMdcDedx.h:41
Double_t chiPi() const
Definition: TRecMdcDedx.h:29
Double_t dedxMoment() const
Definition: TRecMdcDedx.h:48
Double_t dedxHit() const
Definition: TRecMdcDedx.h:45
Int_t truncAlg() const
Definition: TRecMdcDedx.h:24
Double_t sigmaDedx(int pid) const
Definition: TRecMdcDedx.h:42
Double_t pidProb(int pid) const
Definition: TRecMdcDedx.h:43
Int_t numGoodHits() const
Definition: TRecMdcDedx.h:33
Double_t errorPH() const
Definition: TRecMdcDedx.h:38
Double_t chiK() const
Definition: TRecMdcDedx.h:30
Int_t mdcKalTrackId() const
Definition: TRecMdcDedx.h:20
Int_t particleId() const
Definition: TRecMdcDedx.h:22
Double_t probPH() const
Definition: TRecMdcDedx.h:36
Int_t trackId() const
Definition: TRecMdcDedx.h:21
Int_t status() const
Definition: TRecMdcDedx.h:23
Int_t mdcTrackId() const
Definition: TRecMdcDedx.h:19
Int_t numTotalHits() const
Definition: TRecMdcDedx.h:34
Double_t dedxEsat() const
Definition: TRecMdcDedx.h:46
Double_t chiE() const
Definition: TRecMdcDedx.h:27
Double_t dedxNoRun() const
Definition: TRecMdcDedx.h:47
Double_t twentyPH() const
Definition: TRecMdcDedx.h:39
Double_t chiMu() const
Definition: TRecMdcDedx.h:28
static std::map< const TObject *, const RecMdcDedx * > m_rootRecMdcDedxMap
Definition: commonData.h:227

Friends And Related Function Documentation

◆ CnvFactory< RecMdcDedxCnv >

friend class CnvFactory< RecMdcDedxCnv >
friend

Definition at line 9 of file RecMdcDedxCnv.h.


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