289{
290 MsgStream log(
msgSvc(), name());
291 log << MSG::INFO << "in execute()" << endreq;
292
293 vector<double> Curve_Para, Sigma_Para;
294 int vFlag[3];
295
297 {
298 if(i==0) vFlag[0] = (int) dedxcursvc->
getCurve(i);
299 else Curve_Para.push_back( dedxcursvc->
getCurve(i) );
300 }
302 {
303 if(i==0) vFlag[1] = (int) dedxcursvc->
getSigma(i);
304 else Sigma_Para.push_back( dedxcursvc->
getSigma(i) );
305 }
306
307
308 if(vFlag[0] ==1 && Curve_Para.size() != 5)
309 cout<<" size of dedx curve paramters for version 1 is not right!"<<endl;
310 if(vFlag[0] ==2 && Curve_Para.size() != 16)
311 cout<<" size of dedx curve paramters for version 2 is not right!"<<endl;
312
313 if(vFlag[1] ==1 && Sigma_Para.size() != 14)
314 cout<<" size of dedx sigma paramters for version 1 is not right!"<<endl;
315 if(vFlag[1] ==2 && Sigma_Para.size() != 21)
316 cout<<" size of dedx sigma paramters for version 2 is not right!"<<endl;
317 if(vFlag[1] ==3 && Sigma_Para.size() != 18)
318 cout<<" size of dedx sigma paramters for version 3 is not right!"<<endl;
319 if(vFlag[1] ==4 && Sigma_Para.size() != 19)
320 cout<<" size of dedx sigma paramters for version 4 is not right!"<<endl;
321 if(vFlag[1] ==5 && Sigma_Para.size() != 22)
322 cout<<" size of dedx sigma paramters for version 5 is not right!"<<endl;
323
324
325
326 DataObject *aReconEvent;
327 eventSvc()->findObject("/Event/Recon",aReconEvent);
328 if(aReconEvent==
NULL)
329 {
331 StatusCode sc = eventSvc()->registerObject("/Event/Recon",aReconEvent);
332 if(sc!=StatusCode::SUCCESS)
333 {
334 log << MSG::FATAL << "Could not register ReconEvent" <<endreq;
335 return( StatusCode::FAILURE);
336 }
337 }
338
339 SmartIF<IDataManagerSvc> dataManSvc(eventSvc());
340
341 DataObject *aDedxcol;
342 eventSvc()->findObject("/Event/Recon/RecMdcDedxCol",aDedxcol);
344 {
345 dataManSvc->clearSubTree("/Event/Recon/RecMdcDedxCol");
346 eventSvc()->unregisterObject("/Event/Recon/RecMdcDedxCol");
347 }
349 StatusCode dedxsc;
351 if(!dedxsc.isSuccess())
352 {
353 log << MSG::FATAL << " Could not register Mdc dedx collection" <<endreq;
354 return ( StatusCode::FAILURE);
355 }
356
357 DataObject *aDedxhitcol;
358 eventSvc()->findObject("/Event/Recon/RecMdcDedxHitCol",aDedxhitcol);
359 if(aDedxhitcol !=
NULL)
360 {
361 dataManSvc->clearSubTree("/Event/Recon/RecMdcDedxHitCol");
362 eventSvc()->unregisterObject("/Event/Recon/RecMdcDedxHitCol");
363 }
365 StatusCode dedxhitsc;
367 if(!dedxhitsc.isSuccess())
368 {
369 log << MSG::FATAL << " Could not register Mdc dedx collection" <<endreq;
370 return ( StatusCode::FAILURE);
371 }
372
373 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
374 if (!eventHeader)
375 {
376 log << MSG::INFO << "Could not find Event Header" << endreq;
377 return( StatusCode::FAILURE);
378 }
379 int eventNO = eventHeader->eventNumber();
380 int runNO = eventHeader->runNumber();
381 log << MSG::INFO << "now begin the event: runNO= "<<runNO<<" eventNO= "<< eventNO<< endreq;
385 {
387 }
389 int runFlag;
394 else runFlag =4;
395
396
397 if(runNO < 0) vFlag[2]=1;
398 else vFlag[2]=0;
399
400 double tes = -999.0;
401 int esTimeflag = -1;
402 SmartDataPtr<RecEsTimeCol> estimeCol(eventSvc(),"/Event/Recon/RecEsTimeCol");
403 if( ! estimeCol)
404 {
405 log << MSG::WARNING << "Could not find EvTimeCol" << endreq;
406 }
407 else
408 {
409 RecEsTimeCol::iterator iter_evt = estimeCol->begin();
410 for(; iter_evt!=estimeCol->end(); iter_evt++)
411 {
412 tes = (*iter_evt)->getTest();
413 esTimeflag = (*iter_evt)->getStat();
414 }
415 }
416
417
418
420 int ntrk;
421 ex_trks.clear();
422 m_trkalgs.clear();
423 if( !doNewGlobal )
424 {
425 log << MSG::DEBUG << "recalg: "<<recalg<<endreq;
426
427
428 if(recalg ==2 )
429 {
430
431 SmartDataPtr<RecMdcKalTrackCol> newtrkCol(eventSvc(),"/Event/Recon/RecMdcKalTrackCol");
432 if (!newtrkCol)
433 {
434 log << MSG::WARNING << "Could not find RecMdcKalTrackCol" << endreq;
435 return StatusCode::SUCCESS;
436 }
438 ntrk = newtrkCol->size();
439 log << MSG::DEBUG << "track collection size: " << newtrkCol->size() <<endreq;
440
441 RecMdcKalTrackCol::iterator trk = newtrkCol->begin();
442
443 for( ; trk != newtrkCol->end(); trk++)
444 {
446
448
449 if(gothits.size()==0)
450 {
451 m_trkalg=0;
452 int trkid=(*trk)->trackId();
454 }
455 else
456 {
457 m_trkalg=1;
458 if(gothits.size()<2) continue;
459 kaltrackrec(trk, mdcid, tes, runNO, eventNO, runFlag, log );
460 }
461 }
462 }
463
464
465 else if(recalg ==0 )
466 {
467 m_trkalg=0;
468
469
470 SmartDataPtr<RecMdcTrackCol> newtrkCol(eventSvc(),"/Event/Recon/RecMdcTrackCol");
471 if (!newtrkCol)
472 {
473 log << MSG::WARNING << "Could not find RecMdcTrackCol" << endreq;
474 return StatusCode::SUCCESS;
475 }
477 ntrk = newtrkCol->size();
478 log << MSG::DEBUG << "track collection size: " << newtrkCol->size() <<endreq;
479
480 vector<double> phlist;
481 vector<double> phlist_hit;
482 double m_d0E=0,m_phi0E=0,m_cpaE=0,m_z0E=0,phi0=0,
costheta=0,sintheta=0,m_Pt=0,m_P=0;
483 int charge=0,layid=0,localwid=0,w0id=0,wid=0,lr=-2;
484 double adc_raw=0,tdc_raw=0,zhit=0,driftd=0,driftD=0,driftT=0,dd=0,eangle=0;
485 int Nhits=0;
486 double ph=0,ph_hit=0,pathlength=0,rphi_path=0;
487
488 RecMdcTrackCol::iterator trk = newtrkCol->begin();
489 for( ; trk != newtrkCol->end(); trk++)
490 {
492
494 log << MSG::DEBUG <<" %%%%% trk id = "<<trk_ex.trk_id() <<endreq;
495 log << MSG::DEBUG <<" %%%%% initial id = "<<(*trk)->trackId() <<endreq;
496
497 HepVector a = (*trk)->helix();
498 HepSymMatrix tkErrM = (*trk)->err();
499 m_d0E = tkErrM[0][0];
500 m_phi0E = tkErrM[1][1];
501 m_cpaE = tkErrM[2][2];
502 m_z0E = tkErrM[3][3];
503
506 log << MSG::DEBUG <<"MDC Helix 5 parameters: "<<a[0]<<" "<<a[1]<<" "<<a[2]<<" "<<a[3]<<" "<<a[4]<<endreq;
507
508 phi0= a[1];
510
511 sintheta =
sin(M_PI_2-atan(a[4]));
512 m_Pt = 1.0/fabs( a[2] );
513 m_P = m_Pt*sqrt(1 + a[4]*a[4]);
514 charge = ( a[2] > 0 )? 1 : -1;
515
517
518
520 Nhits = gothits.size();
521 log << MSG::DEBUG << "hits size = " <<gothits.size()<<endreq;
522 if(gothits.size()<2)
523 {
524 delete dedxhitrefvec;
525 continue;
526 }
527
528
530 HitRefVec::iterator it_gothit = gothits.begin();
531 for( ; it_gothit != gothits.end(); it_gothit++)
532 {
533 mdcid = (*it_gothit)->getMdcId();
537 wid = w0id + localwid;
538 adc_raw = (*it_gothit)->getAdc();
539 tdc_raw = (*it_gothit)->getTdc();
540 log << MSG::INFO <<"hit layer id " <<layid<< " wire id: " <<localwid<< " adc_raw: " <<adc_raw<<" tdc_raw: "<<tdc_raw<<endreq;
541 zhit = (*it_gothit)->getZhit();
542 lr = (*it_gothit)->getFlagLR();
543 if(lr == 2) cout<<"lr = "<<lr<<endl;
544 if(lr == 0 || lr == 2) driftD = (*it_gothit)->getDriftDistLeft();
545 else driftD = (*it_gothit)->getDriftDistRight();
546
547 driftd =
abs(driftD);
548 dd = (*it_gothit)->getDoca();
549 if(lr == 0 || lr == 2 ) dd = -
abs(dd);
550 if(lr == 1 ) dd =
abs(dd);
551 driftT = (*it_gothit)->getDriftT();
552
553 eangle = (*it_gothit)->getEntra();
554 eangle = eangle/
M_PI;
555 pathlength=exsvc->
PathL( ntpFlag, exhel, layid, localwid, zhit);
556 rphi_path=pathlength * sintheta;
557
558
559 ph=exsvc->
StandardHitCorrec(0,runFlag,ntpFlag,runNO,eventNO,pathlength,wid,layid,adc_raw,dd,eangle,
costheta);
561
562
563
564 if(runNO<=5911 && runNO>=5854 && layid ==14) continue;
565 if(runNO<0)
566 {
567 if (layid<8)
568 {
570 }
571 else if(layid >= 8)
572 {
574 }
575 }
576 else if(runNO>=0)
577 {
578 if(layid <8)
579 {
581 }
582 else if(layid >= 8)
583 {
585 }
586 }
587
588
589 if (ph<0.0||ph==0) continue;
590 else
591 {
592
601
602
603 if(m_rootfile!= "no rootfile")
604 {
605 m_hitNo_wire->Fill(wid);
606 }
607
608
609 if ( ntpFlag ==2 )
610 {
611 m_charge1 = (*trk)->charge();
612 m_t01 = tes;
613 m_driftT = driftT;
614 m_tdc_raw = tdc_raw;
615 m_phraw = adc_raw;
616 m_exraw = ph_hit;
617 m_localwid = localwid;
618 m_wire = wid;
619 m_runNO1 = runNO;
620 m_evtNO1 = eventNO;
621 m_nhit_hit = Nhits;
622 m_doca_in = dd;
623 m_doca_ex = dd;
624 m_driftdist = driftD;
625 m_eangle = eangle;
627 m_pathL = pathlength;
628 m_layer = layid;
629 m_ptrk1 = m_P;
630
631 m_trackId1 = trk_ex.trk_id();
632 StatusCode status2 = m_nt2->write();
633 if ( status2.isFailure() )
634 log << MSG::ERROR << "Cannot fill Ntuple n102" << endreq;
635 }
636 if(layid>3)
637 {
638 phlist.push_back(ph);
639 phlist_hit.push_back(ph_hit);
640 }
641 }
642 dedxhitList->push_back( dedxhit );
643 dedxhitrefvec->push_back( dedxhit );
644 }
645 trk_ex.set_phlist( phlist );
646 trk_ex.set_phlist_hit( phlist_hit );
647 trk_ex.setVecDedxHits( *dedxhitrefvec );
648 ex_trks.push_back(trk_ex );
649 m_trkalgs.push_back(m_trkalg);
650
651 delete dedxhitrefvec;
652 phlist.clear();
653 phlist_hit.clear();
655 }
656 log << MSG::DEBUG << "size in processing: " << ex_trks.size() <<endreq;
657 }
658
659
660 else if(recalg ==1 )
661 {
662 m_trkalg=1;
663
664
665 SmartDataPtr<RecMdcKalTrackCol> newtrkCol(eventSvc(),"/Event/Recon/RecMdcKalTrackCol");
666 if (!newtrkCol)
667 {
668 log << MSG::WARNING << "Could not find RecMdcKalTrackCol" << endreq;
669 return StatusCode::SUCCESS;
670 }
672 ntrk = newtrkCol->size();
673 log << MSG::DEBUG << "track collection size: " << newtrkCol->size() <<endreq;
674
675 vector<double> phlist;
676 vector<double> phlist_hit;
677 double m_d0E=0,m_phi0E=0,m_cpaE=0,m_z0E=0,phi0=0,
costheta=0,sintheta=0,m_Pt=0,m_P=0;
678 int charge=0,layid=0,localwid=0,w0id=0,wid=0,lr=-2;
679 double p_hit=0,adc_raw=0,tdc_raw=0,zhit=0,driftd=0,driftD=0,driftT=0,dd_in=0,dd_ex=0,eangle=0;
680 int Nhits=0;
681 double ph=0,ph_hit=0,pathlength=0,rphi_path=0;
682
683
684 RecMdcKalTrackCol::iterator trk = newtrkCol->begin();
685 for( ; trk != newtrkCol->end(); trk++)
686 {
688
690 log << MSG::DEBUG <<" %%%%% trk id = "<<trk_ex.trk_id() <<endreq;
691 log << MSG::DEBUG <<" %%%%% initial id = "<<(*trk)->trackId() <<endreq;
692
693 HepVector a;
694 HepSymMatrix tkErrM;
695 if(ParticleFlag>-1&&ParticleFlag<5)
696 {
699 tkErrM = dstTrk->
getFError(ParticleFlag);
700 }
701 else
702 {
703 a = (*trk)->getFHelix();
704 tkErrM = (*trk)->getFError();
705 }
706
707 log << MSG::DEBUG <<"FHelix 5 parameters: "<<a[0]<<" "<<a[1] <<" "<<a[2]<<" "<<a[3]<<" "<<a[4]<<endreq;
708
709 m_d0E = tkErrM[0][0];
710 m_phi0E = tkErrM[1][1];
711 m_cpaE = tkErrM[2][2];
712 m_z0E = tkErrM[3][3];
713
714 phi0= a[1];
716
717 sintheta =
sin(M_PI_2-atan(a[4]));
718 m_Pt = 1.0/fabs( a[2] );
719 m_P = m_Pt*sqrt(1 + a[4]*a[4]);
720
721 charge = ( a[2] > 0 )? 1 : -1;
722
724
725
727
728
729 Nhits = gothits.size();
730 log << MSG::DEBUG << "hits size = " <<gothits.size()<<endreq;
731 if(gothits.size()<2)
732 {
733 delete dedxhitrefvec;
734 continue;
735 }
736
737
739 HelixSegRefVec::iterator it_gothit = gothits.begin();
740 for( ; it_gothit != gothits.end(); it_gothit++)
741 {
742 HepVector a_hit_in = (*it_gothit)->getHelixIncl();
743
746
747 p_hit = 1.0/fabs(a_hit_in(3))*sqrt(1+a_hit_in(5)*a_hit_in(5));
748
749
750 mdcid = (*it_gothit)->getMdcId();
754 wid = w0id + localwid;
755 adc_raw = (*it_gothit)->getAdc();
756 tdc_raw = (*it_gothit)->getTdc();
757 log << MSG::INFO <<"hit layer id " <<layid<< " wire id: " <<localwid<< " adc_raw: " <<adc_raw<<" tdc_raw: "<<tdc_raw<<endreq;
758 zhit = (*it_gothit)->getZhit();
759 lr = (*it_gothit)->getFlagLR();
760 if(lr == 2) cout<<"lr = "<<lr<<endl;
761 driftD = (*it_gothit)->getDD();
762 driftd =
abs(driftD);
763 driftT = (*it_gothit)->getDT();
764 dd_in = (*it_gothit)->getDocaIncl();
765 dd_ex = (*it_gothit)->getDocaExcl();
766
767 if(lr==-1 || lr == 2) {dd_in = dd_in; dd_ex = dd_ex;}
768 else if(lr ==1) {dd_in = -dd_in; dd_ex = -dd_ex;}
769
770
771
772 eangle = (*it_gothit)->getEntra();
773 eangle = eangle/
M_PI;
774 pathlength=exsvc->
PathL( ntpFlag, exhel_hit_in, layid, localwid, zhit);
775 rphi_path=pathlength * sintheta;
776
777 ph=exsvc->
StandardHitCorrec(0,runFlag,ntpFlag,runNO,eventNO,pathlength,wid,layid,adc_raw,dd_in,eangle,
costheta);
779
780
781
782 if(runNO<=5911 && runNO>=5854 && layid ==14) continue;
783 if(runNO<0)
784 {
785 if (layid<8)
786 {
788 }
789 else if(layid >= 8)
790 {
792 }
793 }
794 else if(runNO>=0)
795 {
796 if(layid <8)
797 {
799 }
800 else if(layid >= 8)
801 {
803 }
804 }
805
806
807 if (ph<0.0||ph==0) continue;
808 else
809 {
810
819
820
821 if(m_rootfile!= "no rootfile")
822 {
823 m_hitNo_wire->Fill(wid);
824 }
825
826
827 if ( ntpFlag ==2 )
828 {
829 m_charge1 = (*trk)->charge();
830 m_t01 = tes;
831 m_driftT = driftT;
832 m_tdc_raw = tdc_raw;
833 m_phraw = adc_raw;
834 m_exraw = ph_hit;
835 m_localwid = localwid;
836 m_wire = wid;
837 m_runNO1 = runNO;
838 m_evtNO1 = eventNO;
839 m_nhit_hit = Nhits;
840 m_doca_in = dd_in;
841 m_doca_ex = dd_ex;
842 m_driftdist = driftD;
843 m_eangle = eangle;
845 m_pathL = pathlength;
846 m_layer = layid;
847 m_ptrk1 = m_P;
848 m_ptrk_hit = p_hit;
849
850 m_trackId1 = trk_ex.trk_id();
851 StatusCode status2 = m_nt2->write();
852 if ( status2.isFailure() )
853 log << MSG::ERROR << "Cannot fill Ntuple n102" << endreq;
854 }
855 if(layid>3)
856 {
857 phlist.push_back(ph);
858 phlist_hit.push_back(ph_hit);
859 }
860 }
861 dedxhitList->push_back( dedxhit );
862 dedxhitrefvec->push_back( dedxhit );
863 }
864 trk_ex.set_phlist( phlist );
865 trk_ex.set_phlist_hit( phlist_hit );
866 trk_ex.setVecDedxHits( *dedxhitrefvec );
867 ex_trks.push_back(trk_ex );
868 m_trkalgs.push_back(m_trkalg);
869
870 delete dedxhitrefvec;
871 phlist.clear();
872 phlist_hit.clear();
874 }
875 log << MSG::DEBUG << "size in processing: " << ex_trks.size() <<endreq;
876 }
877
878
879
880 if( ntrk != ex_trks.size())
881 log << MSG::DEBUG <<"ntrkCol size: "<<ntrk<<" dedxtrk size: "<<ex_trks.size()<< endreq;
882
883 double poca_x=0,poca_y=0,poca_z=0;
885 int Nhit=0,Nphlisthit=0;
886 int usedhit = 0;
887 double phtm=0,median=0,geometric=0,geometric_trunc=0,harmonic=0,harmonic_trunc=0,transform=0,logtrunc=0;
888
890 float probpid_temp=-0.01,expect_temp=-0.01,sigma_temp=-0.01,chidedx_temp=-0.01;
891
892 double dEdx_meas_hit=0;
893 double dEdx_meas=0,dEdx_meas_esat=0,dEdx_meas_norun=0;
894 int trk_recalg=-1;
895
896 int idedxid = 0;
897 for(std::vector<MdcDedxTrk>::iterator it = ex_trks.begin(); it != ex_trks.end(); it++, idedxid++ )
898 {
899 log << MSG::DEBUG <<"-------------------------------------------------------"<< endreq;
900 log << MSG::DEBUG <<" trk id ="<< it->trk_id()<<" : P ="<<it->P() <<" Pt ="<<it->Pt()<<" : theta ="<<it->theta() <<" : phi ="<<it->phi()<< " : charge = "<<it->charge()<<endreq;
901 log << MSG::DEBUG <<"all hits on track: "<<it->nsample()<<" phlist size: "<<it->get_phlist().size()<<endreq;
902
903 if(it->trk_ptr_kal()!=0)
904 {
905 poca_x = it->trk_ptr_kal()->x();
906 poca_y = it->trk_ptr_kal()->y();
907 poca_z = it->trk_ptr_kal()->z();
908 }
909 else if(it->trk_ptr()!=0)
910 {
911 poca_x = it->trk_ptr()->x();
912 poca_y = it->trk_ptr()->y();
913 poca_z = it->trk_ptr()->z();
914 }
915
916
917 sintheta =
sin(it->theta());
921 Nhit = it->nsample();
922 Nphlisthit = it->get_phlist_hit().size();
923
924
925
926 phtm = it->cal_dedx( truncate );
927
928
929
930
931
932
933
934
935
936 if(m_alg==1) dEdx_meas_hit = it->cal_dedx_bitrunc(truncate, 0, usedhit);
937 else if(m_alg==2) dEdx_meas_hit = it-> cal_dedx_transform(1);
938 else if(m_alg==3) dEdx_meas_hit = it->cal_dedx_log(1.0, 1);
939 else cout<<"-------------Truncate Algorithm Error!!!------------------------"<<endl;
940 if(m_alg==1 && usedhit==0)
941 {
942 cout<<"***************bad extrk with no hits!!!!!******************"<<endl;
943 continue;
944 }
945
946 usedhit = (int)(Nphlisthit*truncate);
947
948
950 dEdx_meas_esat = exsvc->
StandardTrackCorrec(1,runFlag, ntpFlag, runNO, eventNO, dEdx_meas_hit,
cos(it->theta()), tes );
951 dEdx_meas_norun = exsvc->
StandardTrackCorrec(2,runFlag, ntpFlag, runNO, eventNO, dEdx_meas_hit,
cos(it->theta()), tes );
952 log << MSG::INFO << "===================== " << endreq << endreq;
953 log << MSG::DEBUG <<
"dEdx_meas_hit: "<<dEdx_meas_hit<<
" dEdx_meas: "<<
dEdx_meas<<
" dEdx_meas_esat: "<<dEdx_meas_esat<<
" dEdx_meas_norun: "<<dEdx_meas_norun<<
" ptrk: "<<it->P()<<endreq;
954 log << MSG::INFO <<
"ptrk " <<
ptrk <<
" costhe " <<
costheta <<
" runno " << runNO <<
" evtno " << eventNO << endreq;
955
956
957 trk_recalg = m_trkalgs[idedxid];
958
960 it->set_dEdx( landau ,
dEdx_meas, trk_recalg, runFlag, vFlag , tes, Curve_Para, Sigma_Para, ex_calib);
962 probpid_temp=-0.01;
963 expect_temp=-0.01;
964 sigma_temp=-0.01;
965 chidedx_temp=-0.01;
966 for(int i=0;i<5;i++)
967 {
968 if(it->pprob()[i]>probpid_temp)
969 {
971 probpid_temp = it->pprob()[i];
972 expect_temp = it->pexpect()[i];
973 sigma_temp = it->pexp_sigma()[i];
974 chidedx_temp = it->pchi_dedx()[i];
975 }
976 }
977 log<< MSG::INFO<<"expect dE/dx: type: "<<parType_temp<<" probpid: "<<probpid_temp<<" expect: "<<expect_temp<<" sigma: "<<sigma_temp<<" chidedx: "<<chidedx_temp<<endreq;
978
979
980
992 resdedx->
setChi( it->pchi_dedx() );
993
996
997
999
1002
1006
1007
1008 if(ntpFlag ==2)
1009 {
1010 m_phtm=phtm;
1011
1012
1013
1014
1015
1016
1017
1019
1020 m_poca_x = poca_x;
1021 m_poca_y = poca_y;
1022 m_poca_z = poca_z;
1024 m_sintheta=sintheta;
1027 m_runNO = runNO;
1028 m_evtNO = eventNO;
1029
1030 m_t0 = tes;
1031 m_trackId = it->trk_id();
1032 m_recalg = trk_recalg;
1033
1034 m_nhit=Nhit;
1035 m_nphlisthit=Nphlisthit;
1036 m_usedhit=usedhit;
1037 for(int i=0; i<Nphlisthit; i++) m_dEdx_hit[i] = it->get_phlist_hit()[i];
1038
1039 m_parttype = parType_temp;
1040 m_prob = probpid_temp;
1041 m_expect = expect_temp;
1042 m_sigma = sigma_temp;
1043 m_chidedx = chidedx_temp;
1044 m_chidedxe=it->pchi_dedx()[0];
1045 m_chidedxmu=it->pchi_dedx()[1];
1046 m_chidedxpi=it->pchi_dedx()[2];
1047 m_chidedxk=it->pchi_dedx()[3];
1048 m_chidedxp=it->pchi_dedx()[4];
1049 for(int i=0;i<5;i++)
1050 {
1051 m_probpid[i]= it->pprob()[i];
1052 m_expectid[i]= it->pexpect()[i];
1053 m_sigmaid[i]= it->pexp_sigma()[i];
1054 }
1055
1056 StatusCode status = m_nt1->write();
1057 if ( status.isFailure() )
1058 {
1059 log << MSG::ERROR << "Cannot fill Ntuple n103" << endreq;
1060 }
1061 }
1062
1063 log<< MSG::INFO<<"-----------------Summary of this ExTrack----------------"<<endreq
1064 <<
"dEdx_mean: "<<
dEdx_meas<<
" type: "<<parType_temp<<
" probpid: "<<probpid_temp
1065 <<" expect: "<<expect_temp<<" sigma: "<<sigma_temp<<" chidedx: "<<chidedx_temp<<endreq<<endreq;
1066
1067 dedxList->push_back( resdedx );
1068 }
1069 }
1070
1071
1072
1073 SmartDataPtr<RecMdcDedxCol> newexCol(eventSvc(),"/Event/Recon/RecMdcDedxCol");
1074 if (!newexCol)
1075 {
1076 log << MSG::FATAL << "Could not find RecMdcDedxCol" << endreq;
1077 return( StatusCode::SUCCESS);
1078 }
1079 log << MSG::DEBUG << "----------------Begin to check RecMdcDedxCol-----------------"<<endreq;
1080 RecMdcDedxCol::iterator it_dedx = newexCol->begin();
1081 for( ; it_dedx != newexCol->end(); it_dedx++)
1082 {
1083 log << MSG::INFO << "retrieved MDC dE/dx:" << endreq
1084 << "dEdx Id: " << (*it_dedx)->trackId()
1085 << " part Id: " << (*it_dedx)->particleType()
1086 << " measured dEdx: " << (*it_dedx)->probPH()
1087 << " dEdx std: " << (*it_dedx)->normPH() << endreq
1088 << "hits on track: "<<(*it_dedx)->numTotalHits()
1089 << " usedhits: " << (*it_dedx)->numGoodHits() << endreq
1090 << "Electron: expect: " << (*it_dedx)->getDedxExpect(0)
1091 << " sigma: " << (*it_dedx)->getSigmaDedx(0)
1092 << " chi: " << (*it_dedx)->chi(0)
1093 << " prob: " << (*it_dedx)->getPidProb(0) << endreq
1094 << "Muon: expect: " << (*it_dedx)->getDedxExpect(1)
1095 << " sigma: " << (*it_dedx)->getSigmaDedx(1)
1096 << " chi: " << (*it_dedx)->chi(1)
1097 << " prob: " << (*it_dedx)->getPidProb(1) << endreq
1098 << "Pion: expect: " << (*it_dedx)->getDedxExpect(2)
1099 << " sigma: " << (*it_dedx)->getSigmaDedx(2)
1100 << " chi: " << (*it_dedx)->chi(2)
1101 << " prob: " << (*it_dedx)->getPidProb(2) << endreq
1102 << "Kaon: expect: " << (*it_dedx)->getDedxExpect(3)
1103 << " sigma: " << (*it_dedx)->getSigmaDedx(3)
1104 << " chi: " << (*it_dedx)->chi(3)
1105 << " prob: " << (*it_dedx)->getPidProb(3) << endreq
1106 << "Proton: expect: " << (*it_dedx)->getDedxExpect(4)
1107 << " sigma: " << (*it_dedx)->getSigmaDedx(4)
1108 << " chi: " << (*it_dedx)->chi(4)
1109 << " prob: " << (*it_dedx)->getPidProb(4) << endreq;
1110 }
1111 return StatusCode::SUCCESS;
1112}
double sin(const BesAngle a)
double cos(const BesAngle a)
#define Iner_DriftDistCut
ObjectVector< RecMdcDedxHit > RecMdcDedxHitCol
SmartRefVector< RecMdcDedxHit > DedxHitRefVec
ObjectVector< RecMdcDedx > RecMdcDedxCol
SmartRefVector< RecMdcKalHelixSeg > HelixSegRefVec
SmartRefVector< RecMdcHit > HitRefVec
void setTruncAlg(int trunc_alg)
void setStatus(int status)
void setNumGoodHits(int numGoodHits)
void setProbPH(double probPH)
void setNormPH(double normPH)
void setParticleId(int particleId)
void setTrackId(int trackId)
void setNumTotalHits(int numTotalHits)
const HepSymMatrix & getFError(const int pid) const
const HepVector & getFHelix(const int pid) const
virtual double StandardHitCorrec(int calib_rec_Flag, int runFlag, int ntpFlag, int runNO, int evtNO, double pathl, int wid, int layid, double adc, double dd, double eangle, double costheta) const =0
virtual double PathL(int ntpFlag, const Dedx_Helix &hel, int layer, int cellid, double z) const =0
virtual double StandardTrackCorrec(int calib_rec_Flag, int typFlag, int ntpFlag, int runNO, int evtNO, double ex, double costheta, double t0) const =0
virtual const int getSigmaSize()=0
virtual const int getCurveSize()=0
virtual const double getCurve(int i)=0
virtual const double getSigma(int i)=0
virtual const MdcGeoLayer *const Layer(unsigned id)=0
void switchtomdctrack(int trkid, Identifier mdcid, double tes, int RunNO, int eventNO, int runFlag, MsgStream log)
void kaltrackrec(RecMdcKalTrackCol::iterator trk, Identifier mdcid, double tes, int RunNO, int eventNO, int runFlag, MsgStream log)
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
static int wire(const Identifier &id)
void setMdcId(Identifier mdcid)
void setDedx(double dedx)
void setMdcKalHelixSeg(const RecMdcKalHelixSeg *mdcKalHelixSeg)
void setMdcHit(const RecMdcHit *mdcHit)
void setPathLength(double pathlength)
void setMdcTrack(RecMdcTrack *trk)
void setVecDedxHits(const DedxHitRefVec &vecdedxhit)
void setDedxNoRun(double dedx_norun)
void setMdcKalTrack(RecMdcKalTrack *trk)
void setDedxMoment(double dedx_momentum)
void setDedxExpect(double *dedx_exp)
void setSigmaDedx(double *sigma_dedx)
void setDedxEsat(double dedx_esat)
void setDedxHit(double dedx_hit)
void setPidProb(double *pid_prob)
_EXTERN_ std::string RecMdcDedxCol
_EXTERN_ std::string RecMdcDedxHitCol