247 {
248 MsgStream log(
msgSvc(),
"RecMdcDedxCnv");
249 log << MSG::DEBUG << "RecMdcDedxCnv::DataObjectToTObject" << endreq;
250 StatusCode sc=StatusCode::SUCCESS;
251
253 if (!recMdcDedxCol) {
254 log << MSG::ERROR << "Could not downcast to RecMdcDedxCol" << endreq;
255 return StatusCode::FAILURE;
256 }
257
258 DataObject *evt;
261 log << MSG::ERROR << "Could not get RecEvent in TDS " << endreq;
262 return StatusCode::FAILURE;
263 }
265 if (!devtTds) {
266 log << MSG::ERROR << "RecMdcDedxCnv:Could not downcast to TDS RecEvent" << endreq;
267 }
268
269 IOpaqueAddress *addr;
272
274 if (!m_recMdcDedxCol) return sc;
276
277
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 }
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
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
318
319
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
340
341
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
354
355
360
361
367
370
375
376 recMdcDedxRoot->
setChi(chi);
380
385
386
387 if ( (*recMdcDedx)->isMdcTrackValid() ) {
388 RecMdcTrackCol::iterator it = find(recMdcTrackColbegin, recMdcTrackColend, (*recMdcDedx)->getMdcTrack());
390 }
391 else {
393 }
394
395 if ( (*recMdcDedx)->isMdcKalTrackValid() ) {
396 RecMdcKalTrackCol::iterator it = find(recMdcKalTrackColbegin, recMdcKalTrackColend, (*recMdcDedx)->getMdcKalTrack());
398 }
399 else {
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
408
409
411 }
412
413 return StatusCode::SUCCESS;
414}
ObjectVector< RecMdcDedx > RecMdcDedxCol
static TRecTrackEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
RecTrackCnv * getRecTrackCnv()
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)
void setProbPH(const Double_t probPH)
void setPidProb(double *pid_prob)
void setDedxHit(const Double_t dedx_hit)
void setTruncAlg(const Int_t trunc_alg)
void setSigmaDedx(double *sigma_dedx)
void setParticleId(const Int_t particleId)
void setMdcTrackId(const int mdcTrackId)
void setTwentyPH(const Double_t twentyPH)
void setDedxMoment(const Double_t dedx_momentum)
void setChiE(const Double_t chiE)
void setDedxEsat(const Double_t dedx_esat)
void setErrorPH(const Double_t errorPH)
void setMdcKalTrackId(const int mdcKalTrackId)
void setStatus(const Int_t status)
void setChiPi(const Double_t chiPi)
void setTrackId(const Int_t trackId)
void setNormPH(const Double_t normPH)
void setChiP(const Double_t chiP)
void setDedxNoRun(const Double_t dedx_norun)
void setDedxExpect(double *dedx_exp)
void setChiMu(const Double_t chiMu)
void setChiK(const Double_t chiK)
void setNumGoodHits(const Int_t numGoodHits)
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
_EXTERN_ std::string Event
_EXTERN_ std::string RecMdcKalTrackCol