1#include "MdcHoughFinder/Hough.h"
2#include "GaudiKernel/MsgStream.h"
3#include "GaudiKernel/AlgFactory.h"
4#include "GaudiKernel/ISvcLocator.h"
5#include "GaudiKernel/SmartDataPtr.h"
6#include "GaudiKernel/IDataProviderSvc.h"
7#include "GaudiKernel/IPartPropSvc.h"
8#include "GaudiKernel/PropertyMgr.h"
9#include "GaudiKernel/IService.h"
10#include "GaudiKernel/NTuple.h"
11#include "GaudiKernel/INTupleSvc.h"
12#include "EventModel/EventHeader.h"
13#include "MdcRawEvent/MdcDigi.h"
14#include "Identifier/Identifier.h"
15#include "Identifier/MdcID.h"
20#include "EvTimeEvent/RecEsTime.h"
21#include "MdcGeom/EntranceAngle.h"
22#include "RawEvent/RawDataUtil.h"
23#include "MdcData/MdcHit.h"
25#include "McTruth/DecayMode.h"
26#include "McTruth/McParticle.h"
27#include "TrackUtil/Helix.h"
28#include "MdcRecoUtil/Pdt.h"
30#include "TrkBase/TrkFit.h"
31#include "TrkBase/TrkHitList.h"
32#include "TrkBase/TrkExchangePar.h"
33#include "TrkFitter/TrkHelixMaker.h"
34#include "TrkFitter/TrkCircleMaker.h"
35#include "TrkFitter/TrkLineMaker.h"
36#include "TrkFitter/TrkHelixFitter.h"
37#include "MdcxReco/Mdcxprobab.h"
38#include "MdcData/MdcRecoHitOnTrack.h"
39#include "MdcPrintSvc/IMdcPrintSvc.h"
41#include "MdcHoughFinder/HoughTrackList.h"
42#include "MdcHoughFinder/HoughTrack.h"
45#include "EvTimeEvent/RecEsTime.h"
47#include "McTruth/MdcMcHit.h"
48#include "TrkBase/TrkFit.h"
49#include "TrkBase/TrkHitList.h"
50#include "TrkBase/TrkExchangePar.h"
51#include "TrkFitter/TrkHelixMaker.h"
52#include "TrkFitter/TrkCircleMaker.h"
53#include "TrkFitter/TrkLineMaker.h"
54#include "TrkFitter/TrkHelixFitter.h"
55#include "MdcPrintSvc/IMdcPrintSvc.h"
56#include "MdcGeom/EntranceAngle.h"
57#include "TrackUtil/Helix.h"
58#include "GaudiKernel/IPartPropSvc.h"
59#include "MdcRecoUtil/Pdt.h"
60#include "RawEvent/RawDataUtil.h"
61#include "MdcData/MdcHit.h"
62#include "MdcTrkRecon/MdcMap.h"
67#include "BesTimerSvc/IBesTimerSvc.h"
68#include "BesTimerSvc/BesTimerSvc.h"
69#include "BesTimerSvc/BesTimer.h"
77 Algorithm(name, pSvcLocator)
80 declareProperty(
"debug", m_debug = 0);
81 declareProperty(
"debugMap", m_debugMap = 0);
82 declareProperty(
"debug2D", m_debug2D = 0);
83 declareProperty(
"debugTrack", m_debugTrack = 0);
84 declareProperty(
"debugPeak", m_debugPeak = 0);
85 declareProperty(
"debugStereo", m_debugStereo= 0);
86 declareProperty(
"debugZs", m_debugZs= 0);
87 declareProperty(
"debug3D", m_debug3D= 0);
88 declareProperty(
"debugArbHit", m_debugArbHit= 0);
89 declareProperty(
"hist", m_hist = 0);
90 declareProperty(
"filter", m_filter= 0);
92 declareProperty(
"keepBadTdc", m_keepBadTdc = 0);
93 declareProperty(
"dropHot", m_dropHot= 0);
94 declareProperty(
"keepUnmatch", m_keepUnmatch = 0);
96 declareProperty(
"combineTracking",m_combineTracking =
false);
97 declareProperty(
"removeBadTrack", m_removeBadTrack = 0);
98 declareProperty(
"dropTrkDrCut", m_dropTrkDrCut= 1.);
99 declareProperty(
"dropTrkDzCut", m_dropTrkDzCut= 10.);
100 declareProperty(
"dropTrkPtCut", m_dropTrkPtCut= 0.12);
101 declareProperty(
"dropTrkChi2Cut", m_dropTrkChi2Cut = 10000.);
103 declareProperty(
"inputType", m_inputType = 0);
105 declareProperty(
"mapCharge", m_mapCharge= -1);
106 declareProperty(
"useHalf", m_useHalf= 0);
107 declareProperty(
"mapHitStyle", m_mapHit= 0);
108 declareProperty(
"nbinTheta", m_nBinTheta = 100);
109 declareProperty(
"nbinRho", m_nBinRho = 100);
110 declareProperty(
"rhoRange", m_rhoRange = 0.1);
111 declareProperty(
"peakWidth", m_peakWidth= 3);
112 declareProperty(
"peakHigh", m_peakHigh= 1);
113 declareProperty(
"hitPro", m_hitPro= 0.4);
115 declareProperty(
"recpos", m_recpos= 1);
116 declareProperty(
"recneg", m_recneg= 1);
117 declareProperty(
"combineSelf", m_combine= 1);
118 declareProperty(
"z0CutCompareHough", m_z0Cut_compareHough= 10);
121 declareProperty(
"n1", m_npart= 100);
122 declareProperty(
"n2", m_n2= 30);
124 declareProperty(
"d1", m_d1= 0.2);
125 declareProperty(
"d2", m_d2= 0.2);
127 declareProperty(
"pdtFile", m_pdtFile =
"pdt.table");
128 declareProperty(
"eventFile", m_evtFile=
"EventList");
130 declareProperty(
"cgem", m_cgem=
true);
131 declareProperty(
"skipMDCIT", m_skipMDCIT=
true);
132 declareProperty(
"globalfit", m_globalfit=
true);
133 declareProperty(
"zsRecMethod", m_recMethod=1);
134 declareProperty(
"factor2D", m_factor2D=5.0);
135 declareProperty(
"factor3D", m_factor3D=5.0);
136 declareProperty(
"cut2D", m_cut_2D);
137 declareProperty(
"cut3D", m_cut_3D);
138 declareProperty(
"maxGapLength", m_maxGapLength=99);
139 declareProperty(
"nHitDeleted", m_nHitDeleted=99);
140 declareProperty(
"nPoint3D", m_nPoint3D=5);
141 declareProperty(
"nPoint2D", m_nPoint2D=5);
142 declareProperty(
"nRMS", m_nRMS=3);
143 declareProperty(
"fillMap", m_fillMap=1);
144 declareProperty(
"printflag", m_printflag=0);
154 return StatusCode::SUCCESS;
160 MsgStream log(
msgSvc(), name());
161 log << MSG::INFO <<
"in initialize()" << endreq;
166 IPartPropSvc* p_PartPropSvc;
167 static const bool CREATEIFNOTTHERE(
true);
168 sc = service(
"PartPropSvc", p_PartPropSvc, CREATEIFNOTTHERE);
169 if (!sc.isSuccess() || 0 == p_PartPropSvc) {
170 log << MSG::ERROR <<
" Could not initialize PartPropSvc" << endreq;
173 m_particleTable = p_PartPropSvc->PDT();
177 sc = service (
"RawDataProviderSvc", irawDataProviderSvc);
179 if ( sc.isFailure() ){
180 log << MSG::FATAL << name()<<
" Could not load RawDataProviderSvc!" << endreq;
181 return StatusCode::FAILURE;
186 sc = service (
"MdcGeomSvc", imdcGeomSvc);
187 m_mdcGeomSvc =
dynamic_cast<MdcGeomSvc*
> (imdcGeomSvc);
188 if ( sc.isFailure() ){
189 log << MSG::FATAL <<
"Could not load MdcGeoSvc!" << endreq;
190 return StatusCode::FAILURE;
196 sc = service (
"CgemGeomSvc", icgemGeomSvc);
197 m_cgemGeomSvc =
dynamic_cast<CgemGeomSvc*
> (icgemGeomSvc);
198 if ( sc.isFailure() ){
199 log << MSG::FATAL <<
"Could not load CgemGeomSvc!" << endreq;
200 return StatusCode::FAILURE;
206 sc = service (
"CgemCalibFunSvc", icgemCalibSvc);
208 if ( sc.isFailure() ){
209 log << MSG::FATAL <<
"Could not load CgemCalibFunSvc!" << endreq;
210 return StatusCode::FAILURE;
216 sc = service (
"MagneticFieldSvc",m_pIMF);
217 if(sc!=StatusCode::SUCCESS) {
218 log << MSG::ERROR <<
"Unable to open Magnetic field service"<<endreq;
220 m_bfield =
new BField(m_pIMF);
221 log << MSG::INFO <<
"field z = "<<m_bfield->
bFieldNominal()<< endreq;
229 sc = service (
"MdcCalibFunSvc", imdcCalibSvc);
231 if ( sc.isFailure() ){
232 log << MSG::FATAL <<
"Could not load MdcCalibFunSvc!" << endreq;
233 return StatusCode::FAILURE;
238 sc = service (
"MdcPrintSvc", imdcPrintSvc);
239 m_mdcPrintSvc =
dynamic_cast<MdcPrintSvc*
> (imdcPrintSvc);
240 if ( sc.isFailure() ){
241 log << MSG::FATAL <<
"Could not load MdcPrintSvc!" << endreq;
242 return StatusCode::FAILURE;
246 sc = service(
"BesTimerSvc", m_timersvc);
247 if( sc.isFailure() ) {
248 log << MSG::WARNING <<
" Unable to locate BesTimerSvc" << endreq;
249 return StatusCode::FAILURE;
251 m_timer_all = m_timersvc->
addItem(
"Execution");
252 m_timer_all->
propName(
"nExecution");
299 if ( sc.isFailure() ){
300 log << MSG::FATAL <<
"Could not book Tuple !" << endreq;
301 return StatusCode::FAILURE;
303 return StatusCode::SUCCESS;
309 MsgStream log(
msgSvc(), name());
310 log << MSG::INFO <<
"in execute()" << endreq;
314 m_timer_all->
start();
317 SmartDataPtr<RecEsTimeCol> evTimeCol(eventSvc(),
"/Event/Recon/RecEsTimeCol");
321 log << MSG::WARNING<<
"Could not retrieve RecEsTimeCol" << endreq;
322 return StatusCode::SUCCESS;
324 RecEsTimeCol::iterator iter_evt = evTimeCol->begin();
325 if (iter_evt != evTimeCol->end()){
326 m_bunchT0 = (*iter_evt)->getTest()*1.e-9;
332 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
334 log << MSG::FATAL <<
"Could not find Event Header" << endreq;
335 return StatusCode::FAILURE;
339 SmartDataPtr<RecCgemClusterCol> recCgemClusterCol(eventSvc(),
"/Event/Recon/RecCgemClusterCol");
341 if (!recCgemClusterCol){
342 log << MSG::WARNING <<
"Could not retrieve Cgem cluster list" << endreq;
343 return StatusCode::FAILURE;
347 m_event=eventHeader->eventNumber();
348 m_run=eventHeader->runNumber();
349 if(m_debug>0) cout<<
"begin evt "<<eventHeader->eventNumber()<<endl;
350 if(m_event%1000==0) cout <<
" run No: "<< m_run <<
" event No: " << m_event << endl;
355 vector<RecMdcTrack*> vec_trackPatTds;
356 int nTdsTk = storeTracks(trackList_tds,hitList_tds,vec_trackPatTds);
359 RecMdcTrackCol::iterator iteritrk_pattsf = vec_trackPatTds.begin();
360 for(;iteritrk_pattsf!=vec_trackPatTds.end();iteritrk_pattsf++){
361 cout<<
"in PATTSF LOST: "<<(*iteritrk_pattsf)->helix(0)<<
" "<<(*iteritrk_pattsf)->helix(1)<<
" "<<(*iteritrk_pattsf)->helix(2)<<
" "<<(*iteritrk_pattsf)->helix(3)<<
" "<<(*iteritrk_pattsf)->helix(4)<<
" chi2 "<<(*iteritrk_pattsf)->chi2()<<endl;
367 if(m_debugArbHit>0 ) m_par.
lPrint=8;
378 lowPt_Evt.open(m_evtFile.c_str());
381 while( lowPt_Evt >> evtNum) {
382 evtlist.push_back(evtNum);
384 vector<int>::iterator iter_evt = find(evtlist.begin(),evtlist.end(),m_event);
385 if( iter_evt == evtlist.end() ) { setFilterPassed(
false);
return StatusCode::SUCCESS; }
386 else setFilterPassed(
true);
389 if(m_printflag==1)cout<<
"Begin Event ============================================================================================================== "<<eventHeader->eventNumber()<<endl;
391 if(m_inputType == -1) GetMcInfo();
394 if(m_debug>0) cout<<
"step1 : prepare digi "<<endl;
398 bool debugTruth =
false;
399 if(m_inputType == -1) debugTruth=
true;
400 if(m_debug>0) cout<<
"step2 : hits-> hough hit list "<<endl;
406 if( houghHitList.
nHit() < 10 || houghHitList.
nHit()>500 )
return StatusCode::SUCCESS;
408 if(m_hist) dumpHoughHitList(houghHitList);
409 if(m_debug>0) houghHitList.
printAll();
411 vector<MdcHit*> mdcHitCol_neg;
412 vector<MdcHit*> mdcHitCol_pos;
413 MdcDigiVec::iterator
iter = mdcDigiVec.begin();
414 for (;
iter != mdcDigiVec.end();
iter++) {
416 if(
HoughHit(digi).driftTime()>1000 ||
HoughHit(digi).driftTime()<=0 )
continue;
419 mdcHitCol_neg.push_back(mdcHit);
420 mdcHitCol_pos.push_back(mdcHit_pos);
423 HoughMap *m_map =
new HoughMap(-1,houghHitList,m_mapHit,m_nBinTheta,m_nBinRho,-1.*m_rhoRange,m_rhoRange,m_peakWidth,m_peakHigh,m_hitPro);
431 if(m_debug>0) cout<<
"step3 : neg track list "<<endl;
432 vector<HoughTrack*> vec_track_neg;
433 vector<HoughTrack*> vec_track2D_neg;
438 vector< vector<int> > stat_2d(2,vector<int>(trackList_size,0) );
439 vector< vector<int> > stat_3d(2,vector<int>(trackList_size,0) );
442 if(m_printflag==1)cout<<
"----------------------------------------------------------------------------------------------------"<<endl;
443 if(m_printflag==1)cout<<
" suppose charge negetive,ntracks: "<<trackList_size<<endl;
444 for(
int itrack=0;itrack<trackList_size;itrack++){
445 if(m_debug>0) cout<<
"begin track: "<<itrack<<endl;
446 if(m_printflag==1)cout<<endl;
447 if(m_printflag==1)cout<<
"begin track: "<<itrack<<endl;
449 if(m_debug>0) cout<<
" suppose charge -1 "<<endl;
457 if(m_printflag==1)cout<<
"---before 2D fitting---"<<endl;
459 stat_2d[0][itrack] = track_neg.
fit2D(m_bunchT0);
461 if(m_debug>0) cout<<
" charge -1 stat2d "<<stat_2d[0][itrack]<<
" "<<track_charge_2d<<endl;
463 if( stat_2d[0][itrack] == 0 || track_charge_2d ==0 ){
464 if( stat_2d[0][itrack] == 0 && m_printflag==1)cout<<
"==============================> 2D fit fail"<<endl;
465 if(track_charge_2d ==0 && m_printflag==1)cout<<
"==============================> 2D charge wrong"<<endl;
469 if(m_hist==2)dumpHoughTrack(track_neg,itrack,trackList_size);
470 if(m_hist==2)dumpHitOnTrack(track_neg);
480 if(m_debug>0) cout<<
" nhitstereo -1 "<<nHit3d<<
" "<<track_charge_3d<<endl;
482 if( nHit3d <3 || track_charge_3d==0 ){
483 if(nHit3d <3 && m_printflag==1)cout<<
"==============================> stereo hit <3"<<endl;
484 if(track_charge_3d==0 && m_printflag==1)cout<<
"==============================> 3D charge wrong"<<endl;
489 if( npair==0 ) stat_3d[0][itrack] = track_neg.
fit3D();
493 if(m_debug>0) cout<<
" charge -1 stat3d "<<stat_3d[0][itrack]<<
" "<<endl;
495 if( stat_3d[0][itrack]==0 ){
496 if(m_printflag==1)cout<<
"==============================> 3D fit fail"<<endl;
499 vec_track_neg.push_back( &track_neg );
501 if(m_hist==3)dumpHoughTrack(track_neg,itrack,trackList_size);
502 if(m_hist==3)dumpHitOnTrack(track_neg);
507 std::sort ( vec_track_neg.begin(),vec_track_neg.end(),
more_pt);
509 if(m_printflag==1)cout<<
"tracks before fitting: "<<trackList_neg.
getTrackNum()<<endl<<
"tracks after fittng: "<<vec_track_neg.size()<<endl;
511 vector<MdcTrack*> vec_MdcTrack_neg;
512 for(
unsigned int i =0;i<vec_track_neg.size();i++){
514 vec_MdcTrack_neg.push_back(mdcTrack);
515 if(m_debug>0) cout<<
"trackneg: "<<i<<
" pt "<<vec_track_neg[i]->getPt3D()<<endl;
516 if(m_debug>0) vec_track_neg[i]->print();
517 if(m_printflag==1)vec_track_neg[i]->getTrk()->printAll(std::cout);
519 if(m_debug>0) cout<<
"step4 : judge neg track list "<<endl;
520 int nDeleted = judgeHit(mdcTrackList_neg,vec_MdcTrack_neg);
521 if(m_printflag==1)cout<<
"tracks before judge hits: "<<vec_MdcTrack_neg.size()<<endl;
523 if(m_printflag==1)cout<<
"tracks after judge hits: "<<mdcTrackList_neg.length()<<endl;
524 if(m_printflag==1)printTrack(mdcTrackList_neg);
526 if(m_debug>0 && nDeleted>0)cout<<nDeleted<<
" tracks have been deleted by MdcTrackList.arbitrateHits()"<<endl;
527 if(m_debug>0) cout<<
"finish - charge "<<endl;
529 storeTracks(trackList_tds, hitList_tds, trackList_neg);
535 HoughMap *m_map2 =
new HoughMap(1,houghHitList,m_mapHit,m_nBinTheta,m_nBinRho,-1.*m_rhoRange,m_rhoRange,m_peakWidth,m_peakHigh,m_hitPro);
536 if(m_debug>0) cout<<
"step5 : pos track list "<<endl;
537 vector<HoughTrack*> vec_track_pos;
542 vector< vector<int> > stat_2d2(2,vector<int>(tracklist_size2,0) );
543 vector< vector<int> > stat_3d2(2,vector<int>(tracklist_size2,0) );
546 if(m_printflag==1)cout<<endl<<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
547 if(m_printflag==1)cout<<
" suppose charge positive,ntracks: "<<tracklist_size2<<endl;
548 for(
int itrack=0;itrack<tracklist_size2;itrack++){
549 if(m_printflag==1)cout<<endl;
550 if(m_printflag==1)cout<<
"begin track: "<<itrack<<endl;
552 if(m_debug>0) cout<<
" suppose charge +1 "<<endl;
561 if(m_printflag==1)cout<<
"---before 2D fitting---"<<endl;
563 stat_2d2[0][itrack] = track_pos.
fit2D(m_bunchT0);
565 if(m_debug>0) cout<<
" charge +1 stat2d "<<stat_2d2[0][itrack]<<
" "<<track_charge_2d<<endl;
566 if( stat_2d2[0][itrack] == 0 || track_charge_2d==0 ){
567 if( stat_2d2[0][itrack] == 0 && m_printflag==1)cout<<
"==============================> 2D fit fail"<<endl;
568 if(track_charge_2d ==0 && m_printflag==1)cout<<
"==============================> 2D charge wrong"<<endl;
579 if(m_debug>0) cout<<
" nhitstereo +1 "<<nHit3d<<
" "<<track_charge_3d<<endl;
581 if(nHit3d <3 && m_printflag==1)cout<<
"==============================> stereo hit <3"<<endl;
582 if(track_charge_3d==0 && m_printflag==1)cout<<
"==============================> 3D charge wrong"<<endl;
586 if( npair==0 ) stat_3d2[0][itrack] = track_pos.
fit3D();
587 else stat_3d2[0][itrack] = track_pos.
fit3D_inner();
591 if(m_debug>0) cout<<
" charge +1 stat3d "<<stat_3d2[0][itrack]<<
" "<<endl;
592 if( stat_3d2[0][itrack]==0 ){
593 if(m_printflag==1)cout<<
"==============================> 3D fit fail"<<endl;
596 vec_track_pos.push_back( &track_pos );
604 std::sort ( vec_track_pos.begin(),vec_track_pos.end(),
more_pt);
608 if(m_printflag==1)cout<<
"tracks before fitting: "<<tracklist_pos.
getTrackNum()<<endl<<
"tracks after fittng: "<<vec_track_pos.size()<<endl;
609 vector<MdcTrack*> vec_MdcTrack_pos;
610 for(
unsigned int i =0;i<vec_track_pos.size();i++){
612 vec_MdcTrack_pos.push_back(mdcTrack);
613 if(m_debug>0) cout<<
"trackpos : "<<i<<
" pt "<<vec_track_pos[i]->getPt3D()<<endl;
614 if(m_debug>0) vec_track_pos[i]->print();
615 if(m_printflag==1)vec_track_pos[i]->getTrk()->printAll(std::cout);
617 if(m_debug>0) cout<<
"step6 : judge pos track list "<<endl;
618 int nDeleted = judgeHit(mdcTrackList_pos,vec_MdcTrack_pos);
619 if(m_printflag==1)cout<<
"tracks before judge hits: "<<vec_MdcTrack_pos.size()<<endl;
621 if(m_printflag==1)cout<<
"tracks after judge hits: "<<mdcTrackList_pos.length()<<endl;
622 if(m_printflag==1)printTrack(mdcTrackList_pos);
624 if(m_debug>0 && nDeleted>0)cout<<nDeleted<<
" tracks have been deleted by MdcTrackList.arbitrateHits()"<<endl;
627 storeTracks(trackList_tds, hitList_tds, tracklist_pos);
634 if(m_printflag==1)cout<<endl<<
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
635 if(m_printflag==1)cout<<endl<<
"-/+tracks before merge: "<<mdcTrackList_neg.length()<<
" "<<mdcTrackList_pos.length()<<endl;
636 if(m_printflag==1)printTrack(mdcTrackList_neg);
637 if(m_printflag==1)printTrack(mdcTrackList_pos);
639 compareHough(mdcTrackList_neg);
640 compareHough(mdcTrackList_pos);
642 if(m_printflag==1)cout<<endl<<
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
643 if(m_printflag==1)cout<<
"-/+tracks after merge: "<<mdcTrackList_neg.length()<<
" "<<mdcTrackList_pos.length()<<endl;
644 if(m_printflag==1)printTrack(mdcTrackList_neg);
645 if(m_printflag==1)printTrack(mdcTrackList_pos);
646 if( mdcTrackList_neg.length()!=0 && mdcTrackList_pos.length()!=0 ) judgeChargeTrack(mdcTrackList_neg,mdcTrackList_pos);
647 if(m_printflag==1)cout<<endl<<
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
648 if(m_printflag==1)cout<<
"tracks after -/+ judge: "<<mdcTrackList_neg.length()<<
" "<<mdcTrackList_pos.length()<<endl;
649 if(m_printflag==1)printTrack(mdcTrackList_neg);
650 if(m_printflag==1)printTrack(mdcTrackList_pos);
654 mdcTrackList_neg+=mdcTrackList_pos;
660 if(m_printflag==1)cout<<endl<<
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
661 if(m_printflag==1 && nDeleted>0)cout<<nDeleted<<
" tracks have been deleted by MdcTrackList.arbitrateHits()"<<endl;
662 if(m_printflag==1)cout<<
"event:"<<eventHeader->eventNumber()<<
" "<<
"total tracks: "<<mdcTrackList_neg.length()<<endl<<endl;
663 if(m_printflag==1)printTrack(mdcTrackList_neg);
666 if(m_combineTracking) nTdsTk = comparePatTsf(mdcTrackList_neg,trackList_tds);
669 if(m_debug>0) cout<<
"step8 : store tds "<<endl;
670 if(m_debug>0) cout<<
"store tds "<<endl;
672 for(
unsigned int i =0;i<mdcTrackList_neg.length();i++){
673 if(m_debug>0) cout<<
"- charge size i : "<<i<<
" "<<mdcTrackList_neg.length()<<endl;
675 mdcTrackList_neg[i]->storeTrack(tkId, trackList_tds, hitList_tds, tkStat);
677 delete mdcTrackList_neg[i];
683 double t_teventTime = m_timer_all->
elapsed();
688 if(m_hist==1)dumpHoughTrack(trackList_tds);
689 if(m_hist==1)dumpHitOnTrack(trackList_tds);
691 if(m_hist)ntuple_hit->write();
692 if(m_hist)ntuple_trk->write();
695 if(m_debug>0) cout<<
"after delete map "<<endl;
696 for(
int ihit=0;ihit<mdcHitCol_neg.size();ihit++){
697 delete mdcHitCol_neg[ihit];
698 delete mdcHitCol_pos[ihit];
701 if(m_debug>0) cout<<
"after delete hit"<<endl;
703 if(m_debug>0) cout<<
"end event "<<endl;
705 return StatusCode::SUCCESS;
710 MsgStream log(
msgSvc(), name());
712 log << MSG::INFO<<
"in finalize()" << endreq;
714 return StatusCode::SUCCESS;
717int MdcHoughFinder::GetMcInfo(){
718 MsgStream log(
msgSvc(), name());
720 SmartDataPtr<McParticleCol> mcParticleCol(eventSvc(),
"/Event/MC/McParticleCol");
721 if (!mcParticleCol) {
722 log << MSG::ERROR <<
"Could not find McParticle" << endreq;
723 return StatusCode::FAILURE;
727 g_tkParTruth.clear();
731 int t_pidTruth = -999;
733 McParticleCol::iterator iter_mc = mcParticleCol->begin();
734 for (;iter_mc != mcParticleCol->end(); iter_mc++ ) {
742 t_pidTruth = (*iter_mc)->particleProperty();
744 if((*iter_mc)->primaryParticle())
continue;
745 if(!(*iter_mc)->decayFromGenerator())
continue;
746 if(!((*iter_mc)->particleProperty() == 211 || (*iter_mc)->particleProperty() == -211 || (*iter_mc)->particleProperty() == 11 ||(*iter_mc)->particleProperty() == -11))
continue;
750 int pid = t_pidTruth;
752 log << MSG::WARNING <<
"Wrong particle id" <<endreq;
755 IPartPropSvc* p_PartPropSvc;
756 static const bool CREATEIFNOTTHERE(
true);
757 StatusCode PartPropStatus = service(
"PartPropSvc", p_PartPropSvc, CREATEIFNOTTHERE);
758 if (!PartPropStatus.isSuccess() || 0 == p_PartPropSvc) {
759 std::cout<<
" Could not initialize Particle Properties Service" << std::endl;
761 HepPDT::ParticleDataTable* p_particleTable = p_PartPropSvc->PDT();
762 if( p_particleTable->particle(pid) ){
763 name = p_particleTable->particle(pid)->name();
764 t_qTruth = p_particleTable->particle(pid)->charge();
765 }
else if( p_particleTable->particle(-pid) ){
766 name =
"anti " + p_particleTable->particle(-pid)->name();
767 t_qTruth = (-1)*p_particleTable->particle(-pid)->charge();
774 if(m_debug>1) std::cout<<__FILE__<<
" "<<__LINE__<<
" new helix with pos "<<(*iter_mc)->initialPosition().v()<<
" mom "<<(*iter_mc)->initialFourMomentum().v()<<
" q "<<t_qTruth<<std::endl;
775 Helix mchelix =
Helix((*iter_mc)->initialPosition().v(), (*iter_mc)->initialFourMomentum().v(), t_qTruth);
778 m_helix =
new Helix((*iter_mc)->initialPosition().v(), (*iter_mc)->initialFourMomentum().v(), t_qTruth);
782 int mcTkId = (*iter_mc)->trackIndex();
784 pair<int, const HepVector> p(mcTkId,mchelix.
a());
785 g_tkParTruth.insert(p);
789 else {rho =-1.*t_qTruth/fabs(mchelix.
radius()) ; theta = mchelix.
phi0();}
794 t_tanl=mchelix.
tanl();
812 double phi0 = mchelix.
phi0()+
M_PI/2;
817 cout<<
" charge "<<t_qTruth<<endl;
818 double rho = fabs(mchelix.
kappa()/333.567);
819 double theta = atan2((mchelix.
dr()-(333.567/mchelix.
kappa()))*
sin(mchelix.
phi0()),(mchelix.
dr()-(333.567/mchelix.
kappa()))*
cos(mchelix.
phi0()));
820 if(theta<0){theta+=
M_PI;rho=-rho;}
821 cout<<
"(Xc, Yc, R):"<<
"("<<(mchelix.
dr()-(333.567/mchelix.
kappa()))*
cos(mchelix.
phi0())<<
", "<<(mchelix.
dr()-(333.567/mchelix.
kappa()))*
sin(mchelix.
phi0())<<
", "<<(-333.567/mchelix.
kappa())<<
") (theta,rho):"<<
"("<<theta<<
", "<<rho<<
") ,pt="<<1./mchelix.
kappa()<<endl;
822 cout<<
"truth barbar: "<<setw(15)<<-mchelix.
dr()<<setw(15)<<phi0<<setw(15)<<mchelix.
kappa()/333.567<<setw(15)<<mchelix.
dz()<<setw(15)<<mchelix.
tanl()<<endl;
823 cout<<
"truth besIII: "<<setw(15)<<mchelix.
dr()<<setw(15)<<mchelix.
phi0()<<setw(15)<<mchelix.
kappa()<<setw(15)<<mchelix.
dz()<<setw(15)<<mchelix.
tanl()<<endl;
827 t_omega = mchelix.
kappa()/333.567;
840 g_firstHit.set(0,0,0);
841 SmartDataPtr<MdcMcHitCol> mdcMcHitCol(eventSvc(),
"/Event/MC/MdcMcHitCol");
844 MdcMcHitCol::iterator iter_mchit = mdcMcHitCol->begin();
845 for (;iter_mchit != mdcMcHitCol->end(); iter_mchit++) {
846 const Identifier id= (*iter_mchit)->identify();
850 if((*iter_mchit)->getTrackIndex()==0) {
851 g_firstHit.setX((*iter_mchit)->getPositionX()/10.);
852 g_firstHit.setY((*iter_mchit)->getPositionY()/10.);
853 g_firstHit.setZ((*iter_mchit)->getPositionZ()/10.);
858 std::cout<<__FILE__<<
" Could not get MdcMcHitCol "<<std::endl;
859 return StatusCode::FAILURE;
863 return StatusCode::SUCCESS;
868 uint32_t getDigiFlag = 0;
877void MdcHoughFinder::dumpHoughHitList(
const HoughHitList& houghhitlist){
881 m_hit_nhit = houghhitlist.
nHit();
882 std::vector<HoughHit>::const_iterator
iter = houghhitlist.
getList().begin();
903void MdcHoughFinder::dumpHitOnTrack(
HoughTrack& houghTrack){
908 m_hot_nhot = recHitVec.size();
909 std::vector<HoughRecHit>::const_iterator
iter = recHitVec.begin();
910 for(
int iHit=0;
iter!= recHitVec.end();
iter++,iHit++){
936 if(m_hist)ntuple_hot->write();
938void MdcHoughFinder::dumpHitOnTrack(
RecMdcTrackCol* trackList_tds){
941 RecMdcTrackCol::iterator
iter = trackList_tds->begin();
942 for(;
iter!=trackList_tds->end();
iter++){
943 m_hot_trk = (*iter)->trackId();
944 m_hot_nhot = ((*iter)->getVecHits()).size()+(*iter)->getNcluster();
948 ClusterRefVec::iterator itCluster = clusterRefVec.begin();
949 for( ; itCluster != clusterRefVec.end(); itCluster++,iHit++){
950 int layer = (*itCluster)->getlayerid();
951 int wire = (*itCluster)->getsheetid();
952 m_hot_hitid[iHit] = (*itCluster)->getclusterid();
953 m_hot_layer[iHit] = layer;
954 m_hot_wire[iHit] = wire;
957 m_hot_z[iHit] = (*itCluster)->getRecZ();
966 m_hot_drift[iHit] = 0;
967 m_hot_flag[iHit] = (*itCluster)->getflag();
968 m_hot_deltaD[iHit]= 0;
969 m_hot_truth_x[iHit] = 0;
970 m_hot_truth_y[iHit] = 0;
971 m_hot_truth_z[iHit] = 0;
972 m_hot_truth_drift[iHit] = 0;
973 m_hot_truth_ambig[iHit] = 0;
976 HitRefVec vechits = (*iter)->getVecHits();
977 HitRefVec::iterator itHit = vechits.begin();
978 for(; itHit != vechits.end(); itHit++,iHit++){
979 const Identifier mdcid = (*itHit)->getMdcId();
982 m_hot_hitid[iHit] = (*itHit)->getId();
983 m_hot_layer[iHit] = layer;
984 m_hot_wire[iHit] = wire;
987 m_hot_z[iHit] = (*itHit)->getZhit();
996 m_hot_drift[iHit] = 0;
997 m_hot_flag[iHit] = (*itHit)->getStat();
998 m_hot_deltaD[iHit]= 0;
999 m_hot_truth_x[iHit] = 0;
1000 m_hot_truth_y[iHit] = 0;
1001 m_hot_truth_z[iHit] = 0;
1002 m_hot_truth_drift[iHit] = 0;
1003 m_hot_truth_ambig[iHit] = 0;
1005 if(m_hist)ntuple_hot->write();
1008void MdcHoughFinder::dumpHoughTrack(
RecMdcTrackCol* trackList_tds){
1010 m_trk_evt = m_event;
1011 m_trk_ntrk = trackList_tds->size();
1012 m_trk_size = trackList_tds->size();
1013 double alpha = -333.567;
1014 RecMdcTrackCol::iterator
iter = trackList_tds->begin();
1015 for(
int itrack=0;
iter!=trackList_tds->end();
iter++,itrack++){
1016 m_trk_trackId[itrack] = (*iter)->trackId() ;
1017 m_trk_charge[itrack] = (*iter)->charge() ;
1018 m_trk_dr[itrack] = (*iter)->helix(0) ;
1019 m_trk_phi0[itrack] = (*iter)->helix(1) ;
1020 m_trk_kappa[itrack] = (*iter)->helix(2) ;
1021 m_trk_dz[itrack] = (*iter)->helix(3) ;
1022 m_trk_tanl[itrack] = (*iter)->helix(4) ;
1023 m_trk_pxy[itrack] = (*iter)->pxy() ;
1024 m_trk_px[itrack] = (*iter)->px() ;
1025 m_trk_py[itrack] = (*iter)->py() ;
1026 m_trk_pz[itrack] = (*iter)->pz() ;
1027 m_trk_p[itrack] = (*iter)->p() ;
1028 m_trk_theta[itrack] = (*iter)->theta() ;
1029 m_trk_phi[itrack] = (*iter)->phi() ;
1030 m_trk_x[itrack] = (*iter)->x() ;
1031 m_trk_y[itrack] = (*iter)->y() ;
1032 m_trk_z[itrack] = (*iter)->z() ;
1033 m_trk_r[itrack] = (*iter)->r() ;
1034 m_trk_chi2[itrack] = (*iter)->chi2() ;
1035 m_trk_fiTerm[itrack] = (*iter)->getFiTerm() ;
1037 m_trk_nhit[itrack] = (*iter)->getNhits() ;
1038 m_trk_ncluster[itrack] = (*iter)->getNcluster() ;
1039 m_trk_stat[itrack] = (*iter)->stat() ;
1040 m_trk_ndof[itrack] = (*iter)->ndof() ;
1041 m_trk_nster[itrack] = (*iter)-> nster() ;
1042 m_trk_nlayer[itrack] = (*iter)->nlayer() ;
1043 m_trk_firstLayer[itrack] = (*iter)->firstLayer() ;
1044 m_trk_lastLayer[itrack] = (*iter)->lastLayer() ;
1047 m_trk_nhop[itrack] = 0 ;
1048 m_trk_nhot[itrack] = 0 ;
1049 m_trk_Xc[itrack] = (*iter)->x() + ( (*iter)->helix(0) +
alpha/(*iter)->helix(2) )*
cos((*iter)->helix(1));
1050 m_trk_Yc[itrack] = (*iter)->y() + ( (*iter)->helix(0) +
alpha/(*iter)->helix(2) )*
sin((*iter)->helix(1));
1051 m_trk_R[itrack] = fabs(
alpha/(*iter)->helix(2));
1053 m_trk_truth_charge[itrack] = t_q;
1054 m_trk_truth_dr[itrack] = m_helix->
dr();
1055 m_trk_truth_phi0[itrack] = m_helix->
phi0();
1056 m_trk_truth_kappa[itrack] = m_helix->
kappa();
1057 m_trk_truth_dz[itrack] = m_helix->
dz();
1058 m_trk_truth_tanl[itrack] = m_helix->
tanl();
1059 m_trk_truth_pxy[itrack] = m_helix->
pt();
1060 m_trk_truth_px[itrack] = m_helix->
momentum(0.).x();
1061 m_trk_truth_py[itrack] = m_helix->
momentum(0.).y();
1062 m_trk_truth_pz[itrack] = m_helix->
momentum(0.).z();
1063 m_trk_truth_p[itrack] = m_helix->
momentum(0.).mag();
1064 m_trk_truth_theta[itrack] = acos(m_helix->
momentum(0.).z()/m_helix->
momentum(0.).mag());
1065 m_trk_truth_phi[itrack] = atan2(m_helix->
momentum(0.).y(),m_helix->
momentum(0.).x());
1066 m_trk_truth_x[itrack] = m_helix->
pivot().x();
1067 m_trk_truth_y[itrack] = m_helix->
pivot().y();
1068 m_trk_truth_z[itrack] = m_helix->
pivot().z();
1069 m_trk_truth_r[itrack] = sqrt(m_helix->
pivot().x()*m_helix->
pivot().x()+m_helix->
pivot().y()*m_helix->
pivot().y());
1070 m_trk_truth_cosTheta[itrack] = m_helix->
cosTheta();
1076 m_trk_truth_R[itrack] = fabs(
alpha/m_helix->
kappa());
1087 m_trk_truth_charge[itrack] = t_q;
1088 m_trk_truth_dr[itrack] = m_helix->
dr();
1089 m_trk_truth_phi0[itrack] = m_helix->
phi0();
1090 m_trk_truth_kappa[itrack] = m_helix->
kappa();
1091 m_trk_truth_dz[itrack] = m_helix->
dz();
1092 m_trk_truth_tanl[itrack] = m_helix->
tanl();
1093 m_trk_truth_pxy[itrack] = m_helix->
pt();
1094 m_trk_truth_px[itrack] = m_helix->
momentum(0.).x();
1095 m_trk_truth_py[itrack] = m_helix->
momentum(0.).y();
1096 m_trk_truth_pz[itrack] = m_helix->
momentum(0.).z();
1097 m_trk_truth_p[itrack] = m_helix->
momentum(0.).mag();
1098 m_trk_truth_theta[itrack] = acos(m_helix->
momentum(0.).z()/m_helix->
momentum(0.).mag());
1099 m_trk_truth_phi[itrack] = atan2(m_helix->
momentum(0.).y(),m_helix->
momentum(0.).x());
1100 m_trk_truth_x[itrack] = m_helix->
pivot().x();
1101 m_trk_truth_y[itrack] = m_helix->
pivot().y();
1102 m_trk_truth_z[itrack] = m_helix->
pivot().z();
1103 m_trk_truth_r[itrack] = sqrt(m_helix->
pivot().x()*m_helix->
pivot().x()+m_helix->
pivot().y()*m_helix->
pivot().y());
1104 m_trk_truth_cosTheta[itrack] = m_helix->
cosTheta();
1110 m_trk_truth_R[itrack] = fabs(
alpha/m_helix->
kappa());
1113void MdcHoughFinder::dumpHoughTrack(
HoughTrack& houghTrack,
int itrack,
int ntrack){
1114 double alpha = -333.567;
1115 HepVector barbar(5,0);
1116 double d0 = houghTrack.
getD0();
1117 double phi0 = houghTrack.
getPhi0();
1118 double omega = houghTrack.
getOmega();
1119 double z0 = houghTrack.
getZ0();
1120 double tanl = houghTrack.
getTanl();
1129 m_trk_evt = m_event;
1130 m_trk_ntrk = ntrack;
1131 m_trk_size = ntrack;
1132 m_trk_trackId[itrack] = houghTrack.
getTrkid();
1133 m_trk_charge[itrack] = houghTrack.
getCharge();
1134 m_trk_dr[itrack] =
bes(1);
1135 m_trk_phi0[itrack] =
bes(2);
1136 m_trk_kappa[itrack] =
bes(3);
1137 m_trk_dz[itrack] =
bes(4);
1138 m_trk_tanl[itrack] =
bes(5);
1141 m_trk_nhot[itrack] = houghTrack.
getHitNumA(0);
1142 m_trk_Xc[itrack] = houghTrack.
getCirX();
1143 m_trk_Yc[itrack] = houghTrack.
getCirY();
1144 m_trk_R[itrack] = houghTrack.
getCirR();
1146 m_trk_truth_charge[itrack] = t_q;
1147 m_trk_truth_dr[itrack] = m_helix->
dr();
1148 m_trk_truth_phi0[itrack] = m_helix->
phi0();
1149 m_trk_truth_kappa[itrack] = m_helix->
kappa();
1150 m_trk_truth_dz[itrack] = m_helix->
dz();
1151 m_trk_truth_tanl[itrack] = m_helix->
tanl();
1152 m_trk_truth_pxy[itrack] = m_helix->
pt();
1153 m_trk_truth_px[itrack] = m_helix->
momentum(0.).x();
1154 m_trk_truth_py[itrack] = m_helix->
momentum(0.).y();
1155 m_trk_truth_pz[itrack] = m_helix->
momentum(0.).z();
1156 m_trk_truth_p[itrack] = m_helix->
momentum(0.).mag();
1157 m_trk_truth_theta[itrack] = acos(m_helix->
momentum(0.).z()/m_helix->
momentum(0.).mag());
1158 m_trk_truth_phi[itrack] = atan2(m_helix->
momentum(0.).y(),m_helix->
momentum(0.).x());
1159 m_trk_truth_x[itrack] = m_helix->
pivot().x();
1160 m_trk_truth_y[itrack] = m_helix->
pivot().y();
1161 m_trk_truth_z[itrack] = m_helix->
pivot().z();
1162 m_trk_truth_r[itrack] = sqrt(m_helix->
pivot().x()*m_helix->
pivot().x()+m_helix->
pivot().y()*m_helix->
pivot().y());
1163 m_trk_truth_cosTheta[itrack] = m_helix->
cosTheta();
1169 m_trk_truth_R[itrack] = fabs(
alpha/m_helix->
kappa());
1175 double phi0 = a(2)-
M_PI/2;
1177 while(phi0<0)phi0+=2*
M_PI;
1178 double kappa = a(3)*333.567;
1192 double phi0 = a(2)+
M_PI/2;
1195 double omega = a(3)/333.567;
1198 HepVector barbar(5,0);
1259int MdcHoughFinder::storeTracks(
RecMdcTrackCol*& trackList_tds ,
RecMdcHitCol*& hitList_tds,vector<RecMdcTrack*>& vec_trackPatTds){
1260 MsgStream log(
msgSvc(), name());
1263 DataObject *aTrackCol;
1264 DataObject *aRecHitCol;
1265 SmartIF<IDataManagerSvc> dataManSvc(eventSvc());
1266 if(!m_combineTracking){
1267 eventSvc()->findObject(
"/Event/Recon/RecMdcTrackCol",aTrackCol);
1268 if(aTrackCol != NULL) {
1269 dataManSvc->clearSubTree(
"/Event/Recon/RecMdcTrackCol");
1270 eventSvc()->unregisterObject(
"/Event/Recon/RecMdcTrackCol");
1272 eventSvc()->findObject(
"/Event/Recon/RecMdcHitCol",aRecHitCol);
1273 if(aRecHitCol != NULL) {
1274 dataManSvc->clearSubTree(
"/Event/Recon/RecMdcHitCol");
1275 eventSvc()->unregisterObject(
"/Event/Recon/RecMdcHitCol");
1280 eventSvc()->findObject(
"/Event/Recon/RecMdcTrackCol",aTrackCol);
1286 if(!sc.isSuccess()) {
1287 log << MSG::FATAL <<
" Could not register RecMdcTrack collection" <<endreq;
1288 return StatusCode::FAILURE;
1292 eventSvc()->findObject(
"/Event/Recon/RecMdcHitCol",aRecHitCol);
1294 hitList_tds =
dynamic_cast<RecMdcHitCol*
> (aRecHitCol);
1298 if(!sc.isSuccess()) {
1299 log << MSG::FATAL <<
" Could not register RecMdcHit collection" <<endreq;
1300 return StatusCode::FAILURE;
1304 if(m_removeBadTrack && m_combineTracking) {
1305 if( m_debug>0 ) cout<<
"PATTSF collect "<<trackList_tds->size()<<
" track. "<<endl;
1306 if(trackList_tds->size()!=0){
1307 RecMdcTrackCol::iterator iter_pat = trackList_tds->begin();
1308 for(;iter_pat!=trackList_tds->end();iter_pat++){
1309 double d0=(*iter_pat)->helix(0);
1310 double kap = (*iter_pat)->helix(2);
1311 double pt = 0.00001;
1312 if(fabs(kap)>0.00001) pt = fabs(1./kap);
1313 double dz=(*iter_pat)->helix(3);
1314 double chi2=(*iter_pat)->chi2();
1315 if( m_debug>0) cout<<
"d0: "<<d0<<
" z0: "<<dz<<
" pt "<<pt<<
" chi2 "<<chi2<<endl;
1317 if( pt<=m_dropTrkPtCut ){
1318 vec_trackPatTds.push_back(*iter_pat);
1320 HitRefVec rechits = (*iter_pat)->getVecHits();
1321 HitRefVec::iterator hotIter = rechits.begin();
1322 while (hotIter!=rechits.end()) {
1326 if(m_debug>0) cout <<
"remove hit " << (*hotIter)->getId()<<
"("<<layer<<
","<<wire<<
")"<<endl;
1327 hitList_tds->remove(*hotIter);
1335 if( m_debug>0 ) cout<<
"after delete trackcol size : "<<trackList_tds->size()<<endl;
1338 if(m_debug>0) cout<<
" PATTSF find 0 track. "<<endl;
1342 int nTdsTk=trackList_tds->size();
1347 cout<<
"length in clearMem "<<list1.length()<<
" "<<list2.length()<<endl;
1352 for(
unsigned int j=0;j<list1.length();j++){
1353 cout<<
"-i j "<<i<<
" "<<j<<
" "<<
vectrk_for_clean[i]<<
" "<<&(list1[j]->track())<<endl;
1354 if(
vectrk_for_clean[i] == &(list1[j]->track()) ) {sametrk=1;cout<<
"not delete new trk "<<endl;}
1357 for(
unsigned int k=0;k<list2.length();k++){
1358 cout<<
"+i k "<<i<<
" "<<k<<
" "<<
vectrk_for_clean[i]<<
" "<<&(list2[k]->track())<<endl;
1359 if(
vectrk_for_clean[i] == &(list2[k]->track()) ) {sametrk=1;cout<<
"not delete new trk "<<endl;}
1363 cout<<
"delete i "<<i<<endl;
1372 if(m_debug>0) cout<<
"in judgeChargeTrack"<<endl;
1373 if(m_debug>0) cout<<
"ntrack length neg : "<<list1.length()<<endl;
1374 if(m_debug>0) cout<<
"ntrack length pos : "<<list2.length()<<endl;
1375 double R_cut = 81.0;
1376 for(
int itrack1=0; itrack1<list1.
nTrack(); itrack1++){
1377 MdcTrack* track_1 = list1[itrack1];
1379 double d0_1 = par1.
d0();
1380 double phi0_1 = par1.
phi0();
1381 double omega_1 = par1.
omega();
1382 double cr=fabs(1./par1.
omega());
1384 double cy= -1.*
cos(par1.
phi0()) *(par1.
d0()+1/par1.
omega()) * -1;
1385 double z0_1 = par1.
z0();
1386 if(d0_1+2.0*cr>R_cut)
continue;
1387 for(
int itrack2=0; itrack2<list2.
nTrack(); itrack2++){
1388 MdcTrack* track_2 = list2[itrack2];
1390 double d0_2 = par2.
d0();
1391 double phi0_2 = par2.
phi0();
1392 double omega_2 = par2.
omega();
1393 double cR=fabs(1./par2.
omega());
1395 double cY= -1.*
cos(par2.
phi0()) *(par2.
d0()+1/par2.
omega()) * -1;
1396 double z0_2= par2.
z0();
1397 if(d0_2+2.0*cR>R_cut)
continue;
1398 double bestDiff = 1.0e+20;
1399 if(fabs(cr)*(1.-0.25) <= fabs(cR) && fabs(cR) <= fabs(cr)*(1.+0.25)){
1400 if(fabs(cx-cX) <= fabs(cr)*(0.25)&& fabs(cy-cY) <= fabs(cr)*(0.25) ){
1401 double diff = fabs((fabs(cr)-fabs(cR))*(cx-cX)*(cy-cY));
1402 if(diff < bestDiff){
1408 if(bestDiff != 1.0e20) {
1410 cout<<
"There is ambiguous +- charge in the track list "<<endl;
1411 cout<<
"z0_1 : "<<z0_1<<
" z0_2 : "<<z0_2<<endl;
1414 if( fabs(z0_1) >= fabs(z0_2) ){
1420 if( fabs(z0_1) < fabs(z0_2) ){
1427 if(bestDiff == 1.0e20) {
if(m_debug>0) cout<<
" no (+-) track in hough"<<endl; }
1432void MdcHoughFinder::compareHough(
MdcTrackList& mdcTrackList){
1433 if(m_debug>0) cout<<
"in compareHough "<<endl;
1434 if(m_debug>0) cout<<
"ntrack : "<<mdcTrackList.length()<<endl;
1435 for(
int itrack=0; itrack<mdcTrackList.length(); itrack++){
1436 MdcTrack* track = mdcTrackList[itrack];
1439 double pt = (1./par.
omega())/333.567;
1440 if(m_debug>0) cout<<
"i Track : "<<itrack<<
" nHit: "<<nhit<<
" pt: "<<pt<<endl;
1444 for(
int itrack1=0; itrack1<mdcTrackList.length(); itrack1++){
1445 MdcTrack* track_1 = mdcTrackList[itrack1];
1448 double d0_1 = par1.
d0();
1449 double phi0_1 = par1.
phi0();
1450 double omega_1 = par1.
omega();
1451 double z0_1= par1.
z0();
1452 double cr=fabs(1./par1.
omega());
1454 double cy= -1.*
cos(par1.
phi0()) *(par1.
d0()+1/par1.
omega()) * -1;
1455 if(m_debug>0) cout<<
"circle 1 : "<<cr<<
","<<cx<<
","<<cy<<endl;
1457 for(
int itrack2=itrack1+1; itrack2<mdcTrackList.length(); itrack2++){
1458 MdcTrack* track_2 = mdcTrackList[itrack2];
1461 double d0_2 = par2.
d0();
1462 double phi0_2 = par2.
phi0();
1463 double omega_2 = par2.
omega();
1464 double z0_2= par2.
z0();
1465 double cR=fabs(1./par2.
omega());
1467 double cY= -1.*
cos(par2.
phi0()) *(par2.
d0()+1/par2.
omega()) * -1;
1468 if(m_debug>0) cout<<
"circle 2 : "<<cR<<
","<<cX<<
","<<cY<<endl;
1470 double bestDiff = 1.0e+20;
1471 if(fabs(cr)*(1.-0.25) <= fabs(cR) && fabs(cR) <= fabs(cr)*(1.+0.25)){
1472 if(fabs(cx-cX) <= fabs(cr)*(0.25)&& fabs(cy-cY) <= fabs(cr)*(0.25) ){
1473 double diff = fabs((fabs(cr)-fabs(cR))*(cx-cX)*(cy-cY));
1474 if(diff < bestDiff){
1480 double zdiff = z0_1-z0_2;
1481 if(bestDiff != 1.0e20 && fabs(zdiff)<25.){
1482 if(m_debug>0) cout<<
"z0_1 : "<<z0_1<<
" z0_2 : "<<z0_2<<endl;
1484 if( nhit1<nhit2 && (fabs(z0_1)>fabs(z0_2) && fabs(z0_1)>m_z0Cut_compareHough) ){
1485 if(m_debug>0) cout<<
"remove track1 "<<1./par1.
omega()/333.567<<endl;
1487 mdcTrackList.
remove( track_1 );
1493 if(m_debug>0) cout<<
"remove track2 "<<1./par2.
omega()/333.567<<endl;
1495 mdcTrackList.
remove( track_2 );
1499 if(bestDiff == 1.0e20) {
if(m_debug>0) cout<<
" no same track in hough"<<endl; }
1512 for(
int itrack1=0; itrack1<mdcTrackList.length(); itrack1++){
1513 MdcTrack* track_1 = mdcTrackList[itrack1];
1516 double d0_1 = par1.
d0();
1517 double phi0_1 = par1.
phi0();
1518 double omega_1 = par1.
omega();
1519 double z0_1= par1.
z0();
1520 double cr=fabs(1./par1.
omega());
1522 double cy= -1.*
cos(par1.
phi0()) *(par1.
d0()+1/par1.
omega()) * -1;
1525 double bestDiff = 1.0e+20;
1526 double ptDiff = 0.0;
1528 vector<double> a0,a1,a2,a3,a4;
1529 RecMdcTrackCol::iterator iterBest;
1530 RecMdcTrackCol::iterator iteritrk = trackList_tds->begin();
1532 for(;iteritrk!=trackList_tds->end();iteritrk++){
1533 if(m_debug>0) cout<<
"being pattsf trk "<<itrk<<endl;
1534 double pt=(*iteritrk)->pxy();
1535 a0.push_back( (*iteritrk)->helix(0) );
1536 a1.push_back( (*iteritrk)->helix(1) );
1537 a2.push_back( (*iteritrk)->helix(2) );
1538 a3.push_back( (*iteritrk)->helix(3) );
1539 a4.push_back( (*iteritrk)->helix(4) );
1540 cR=(-333.567)/a2[itrk];
1541 cX=(cR+a0[itrk])*
cos(a1[itrk]);
1542 cY=(cR+a0[itrk])*
sin(a1[itrk]);
1545 cout<<
" compare PATTSF and HOUGH "<<endl;
1546 cout<<
" fabs(cX) "<< fabs(cX)<<
"fabs(cx) "<<fabs(cx)<<endl;
1547 cout<<
" fabs(cY) "<< fabs(cY)<<
"fabs(cy) "<<fabs(cy)<<endl;
1548 cout<<
" fabs(cR) "<< fabs(cR)<<
"fabs(cr) "<<fabs(cr)<<endl;
1549 cout<<
" fabs(cx-cX) "<< fabs(cx-cX)<<
"fabs(cy-cY) "<<fabs(cy-cY)<<
" fabs(cr-cR) "<< fabs(cr-cR)<<endl;
1552 if(fabs(cr)*(1.-0.25) <= fabs(cR) && fabs(cR) <= fabs(cr)*(1.+0.25)){
1553 if(fabs(cx-cX) <= fabs(cr)*(0.25)&& fabs(cy-cY) <= fabs(cr)*(0.25) ){
1554 double diff = fabs((fabs(cr)-fabs(cR))*(cx-cX)*(cy-cY));
1555 if(m_debug>0) cout<<
" diff "<<diff<<
" pt "<<pt<<endl;
1556 if( fabs(pt) > ptDiff){
1570 if(bestDiff != 1.0e20) {
1571 if(m_debug>0) cout<<
" same track pattsf & hough , then compare nhit. "<<endl;
1572 double d0_pattsf =(*iterBest)->helix(0);
1573 double z0_pattsf =(*iterBest)->helix(3);
1574 double d0_hough = d0_1;
1575 double z0_hough = z0_1;
1576 int use_pattsf(1),use_hough(1);
1577 if( fabs(d0_pattsf)>m_dropTrkDrCut || fabs(z0_pattsf)>m_dropTrkDzCut ) use_pattsf=0;
1578 if( fabs(d0_hough)>m_dropTrkDrCut || fabs(z0_hough)>m_dropTrkDzCut ) use_hough=0;
1579 if( use_pattsf==0 && use_hough==1 ) {
1580 trackList_tds->remove(*iterBest);
1581 if(m_debug>0) cout<<
" use houghTrack, vertex pattsf wrong"<<endl;
1583 if( use_pattsf==1 && use_hough==0 ) {
1584 mdcTrackList.
remove( track_1 );
1586 if(m_debug>0) cout<<
" use pattsfTrack, vertex hough wrong"<<endl;
1588 if( (use_pattsf==0 && use_hough==0) || (use_pattsf==1 && use_hough==1) ){
1589 int nhit_pattsf=( (*iterBest)->ndof()+5 );
1590 int nhit_hough = nhit1;
1591 if(m_debug>0) cout<<
" nhit "<<nhit_pattsf<<
" "<<nhit_hough<<endl;
1592 if( nhit_pattsf>nhit_hough ) {
1593 mdcTrackList.
remove( track_1 );
1595 if(m_debug>0) cout<<
" use pattsfTrack "<<endl;
1598 trackList_tds->remove(*iterBest);
1599 if(m_debug>0) cout<<
" use houghTrack "<<endl;
1614 if(bestDiff == 1.0e20) {
if(m_debug>0) cout<<
" no same track in pattsf"<<endl; }
1619 if(trackList_tds->size()!=0){
1621 RecMdcTrackCol::iterator iter_pat = trackList_tds->begin();
1622 for(;iter_pat!=trackList_tds->end();iter_pat++,digi++){
1623 (*iter_pat)->setTrackId(digi);
1627 return trackList_tds->size();
1630int MdcHoughFinder::judgeHit(
MdcTrackList& list,vector<MdcTrack*>& trackCol){
1631 if(m_debug>0) cout<<
"in judgHit: "<<endl;
1632 for(
unsigned int i =0;i<trackCol.size();i++){
1635 list.append(trackCol[i]);
1637 if(m_cgem || m_skipMDCIT)list.
setNoInner(
true);
1647 int tracklist_size = houghTrackList.
getTrackNum();
1648 for(
int itrack=0;itrack<tracklist_size;itrack++){
1654 int nHits = recHitVec.size();
1657 double phi0 = houghTrack.
getPhi0();
1658 double tanDip = houghTrack.
getTanl();
1659 double d0 = houghTrack.
getD0();
1665 helixPar[1] = tphi0;
1666 helixPar[2] = houghTrack.
getOmega()*333.567;
1667 helixPar[3] = houghTrack.
getZ0();
1668 helixPar[4] = tanDip;
1677 for (
int i=0;i<nHits;i++){
1678 if(recHitVec[i].getflag()!=0 )
continue;
1679 if(recHitVec[i].getDetectorType()==
MDC){
1681 Identifier mdcId = recHitVec[i].digi()->identify();
1683 double fltLen = recHitVec[i].getRet().second/(1./sqrt(1+tanDip*tanDip));
1686 recMdcHit->
setTdc(recHitVec[i].digi()->getTimeChannel());
1687 recMdcHit->
setAdc(recHitVec[i].digi()->getChargeChannel());
1688 if(recHitVec[i].getDetectorType()!=0)nSt++;
1689 hitList->push_back(recMdcHit);
1690 SmartRef<RecMdcHit> refHit(recMdcHit);
1691 hitRefVec.push_back(refHit);
1692 }
else if(recHitVec[i].getDetectorType()==
CGEM && recHitVec[i].getSlayerType()==2){
1693 clusterRefVec.push_back(recHitVec[i].getCluster());
1696 std::sort(clusterRefVec.begin(),clusterRefVec.end(),
sortCluster);
1701 trackList->push_back(recMdcTrack);
1706void MdcHoughFinder::printTrack(vector<MdcTrack*> vec_MdcTrack)
1709 for(
unsigned int i =0;i<vec_MdcTrack.size();i++){
1710 cout<<
"trackID:"<<vec_MdcTrack[i]->track().id()<<
" ";
1711 vec_MdcTrack[i]->track().printAll(cout);
1716void MdcHoughFinder::printTrack(
MdcTrackList& mdcTrackList)
1719 for(
unsigned int i =0;i<mdcTrackList.length();i++){
1720 cout<<
"trackID:"<<mdcTrackList[i]->track().id()<<
" "
1721 <<(mdcTrackList[i]->track().fitResult()->pt())*(mdcTrackList[i]->track().fitResult()->charge())<<endl;
1722 mdcTrackList[i]->track().printAll(cout);
1728 MsgStream log(
msgSvc(), name());
1730 NTuplePtr nt1(
ntupleSvc(),
"mdcHoughFinder/hit");
1734 ntuple_hit=
ntupleSvc()->book(
"mdcHoughFinder/hit", CLID_ColumnWiseTuple,
"hit");
1736 ntuple_hit->addItem(
"hit_run", m_hit_run);
1737 ntuple_hit->addItem(
"hit_evt", m_hit_evt);
1738 ntuple_hit->addItem(
"hit_nhit", m_hit_nhit, 0, 10000);
1739 ntuple_hit->addItem(
"hit_hitid", m_hit_nhit, m_hit_hitid);
1740 ntuple_hit->addItem(
"hit_layer", m_hit_nhit, m_hit_layer);
1741 ntuple_hit->addItem(
"hit_wire", m_hit_nhit, m_hit_wire);
1742 ntuple_hit->addItem(
"hit_x", m_hit_nhit, m_hit_x);
1743 ntuple_hit->addItem(
"hit_y", m_hit_nhit, m_hit_y);
1744 ntuple_hit->addItem(
"hit_z", m_hit_nhit, m_hit_z);
1745 ntuple_hit->addItem(
"hit_driftdist", m_hit_nhit, m_hit_driftdist);
1746 ntuple_hit->addItem(
"hit_drifttime", m_hit_nhit, m_hit_drifttime);
1747 ntuple_hit->addItem(
"hit_flag", m_hit_nhit, m_hit_flag);
1748 ntuple_hit->addItem(
"hit_truth_x", m_hit_nhit, m_hit_truth_x);
1749 ntuple_hit->addItem(
"hit_truth_y", m_hit_nhit, m_hit_truth_y);
1750 ntuple_hit->addItem(
"hit_truth_z", m_hit_nhit, m_hit_truth_z);
1751 ntuple_hit->addItem(
"hit_truth_drift", m_hit_nhit, m_hit_truth_drift);
1752 ntuple_hit->addItem(
"hit_truth_ambig", m_hit_nhit, m_hit_truth_ambig);
1753 }
else { log << MSG::ERROR <<
"Cannot book tuple mdcHoughFinder/hit" <<endmsg;
1754 return StatusCode::FAILURE;
1758 NTuplePtr nt2(
ntupleSvc(),
"mdcHoughFinder/hot");
1762 ntuple_hot =
ntupleSvc()->book(
"mdcHoughFinder/hot", CLID_ColumnWiseTuple,
"hot");
1764 ntuple_hot->addItem(
"hot_run", m_hot_run);
1765 ntuple_hot->addItem(
"hot_evt", m_hot_evt);
1766 ntuple_hot->addItem(
"hot_trk", m_hot_trk);
1767 ntuple_hot->addItem(
"hot_nhot", m_hot_nhot, 0, 1000 );
1768 ntuple_hot->addItem(
"hot_hitid", m_hot_nhot, m_hot_hitid);
1769 ntuple_hot->addItem(
"hot_layer", m_hot_nhot, m_hot_layer);
1770 ntuple_hot->addItem(
"hot_wire", m_hot_nhot, m_hot_wire);
1771 ntuple_hot->addItem(
"hot_x", m_hot_nhot, m_hot_x);
1772 ntuple_hot->addItem(
"hot_y", m_hot_nhot, m_hot_y);
1773 ntuple_hot->addItem(
"hot_z", m_hot_nhot, m_hot_z);
1774 ntuple_hot->addItem(
"hot_x0", m_hot_nhot, m_hot_x0);
1775 ntuple_hot->addItem(
"hot_y0", m_hot_nhot, m_hot_y0);
1776 ntuple_hot->addItem(
"hot_z0", m_hot_nhot, m_hot_z0);
1777 ntuple_hot->addItem(
"hot_s0", m_hot_nhot, m_hot_s0);
1778 ntuple_hot->addItem(
"hot_x1", m_hot_nhot, m_hot_x1);
1779 ntuple_hot->addItem(
"hot_y1", m_hot_nhot, m_hot_y1);
1780 ntuple_hot->addItem(
"hot_z1", m_hot_nhot, m_hot_z1);
1781 ntuple_hot->addItem(
"hot_s1", m_hot_nhot, m_hot_s1);
1782 ntuple_hot->addItem(
"hot_drift", m_hot_nhot, m_hot_drift);
1783 ntuple_hot->addItem(
"hot_flag", m_hot_nhot, m_hot_flag);
1784 ntuple_hot->addItem(
"hot_deltaD", m_hot_nhot, m_hot_deltaD);
1785 ntuple_hot->addItem(
"hot_truth_x", m_hot_nhot, m_hot_truth_x);
1786 ntuple_hot->addItem(
"hot_truth_y", m_hot_nhot, m_hot_truth_y);
1787 ntuple_hot->addItem(
"hot_truth_z", m_hot_nhot, m_hot_truth_z);
1788 ntuple_hot->addItem(
"hot_truth_drift", m_hot_nhot, m_hot_truth_drift);
1789 ntuple_hot->addItem(
"hot_truth_ambig", m_hot_nhot, m_hot_truth_ambig);
1791 }
else { log << MSG::ERROR <<
"Cannot book tuple mdcHoughFinder/hot" <<endmsg;
1792 return StatusCode::FAILURE;
1796 NTuplePtr nt3(
ntupleSvc(),
"mdcHoughFinder/trk");
1800 ntuple_trk =
ntupleSvc()->book(
"mdcHoughFinder/trk", CLID_ColumnWiseTuple,
"trk");
1802 ntuple_trk->addItem(
"trk_run", m_trk_run);
1803 ntuple_trk->addItem(
"trk_evt", m_trk_evt);
1804 ntuple_trk->addItem(
"trk_ntrk", m_trk_ntrk);
1805 ntuple_trk->addItem(
"trk_size", m_trk_size, 0, 100);
1806 ntuple_trk->addItem(
"trk_trackId", m_trk_size, m_trk_trackId);
1807 ntuple_trk->addItem(
"trk_charge", m_trk_size, m_trk_charge);
1808 ntuple_trk->addItem(
"trk_dr", m_trk_size, m_trk_dr);
1809 ntuple_trk->addItem(
"trk_phi0", m_trk_size, m_trk_phi0);
1810 ntuple_trk->addItem(
"trk_kappa", m_trk_size, m_trk_kappa);
1811 ntuple_trk->addItem(
"trk_dz", m_trk_size, m_trk_dz);
1812 ntuple_trk->addItem(
"trk_tanl", m_trk_size, m_trk_tanl);
1813 ntuple_trk->addItem(
"trk_pxy", m_trk_size, m_trk_pxy);
1814 ntuple_trk->addItem(
"trk_px", m_trk_size, m_trk_px);
1815 ntuple_trk->addItem(
"trk_py", m_trk_size, m_trk_py);
1816 ntuple_trk->addItem(
"trk_pz", m_trk_size, m_trk_pz);
1817 ntuple_trk->addItem(
"trk_p", m_trk_size, m_trk_p);
1818 ntuple_trk->addItem(
"trk_theta", m_trk_size, m_trk_theta);
1819 ntuple_trk->addItem(
"trk_phi", m_trk_size, m_trk_phi);
1820 ntuple_trk->addItem(
"trk_x", m_trk_size, m_trk_x);
1821 ntuple_trk->addItem(
"trk_y", m_trk_size, m_trk_y);
1822 ntuple_trk->addItem(
"trk_z", m_trk_size, m_trk_z);
1823 ntuple_trk->addItem(
"trk_r", m_trk_size, m_trk_r);
1824 ntuple_trk->addItem(
"trk_chi2", m_trk_size, m_trk_chi2);
1825 ntuple_trk->addItem(
"trk_fiTerm", m_trk_size, m_trk_fiTerm);
1826 ntuple_trk->addItem(
"trk_matchChi2", m_trk_size, m_trk_matchChi2);
1827 ntuple_trk->addItem(
"trk_nhit", m_trk_size, m_trk_nhit);
1828 ntuple_trk->addItem(
"trk_ncluster", m_trk_size, m_trk_ncluster);
1829 ntuple_trk->addItem(
"trk_stat", m_trk_size, m_trk_stat);
1830 ntuple_trk->addItem(
"trk_ndof", m_trk_size, m_trk_ndof);
1831 ntuple_trk->addItem(
"trk_nster", m_trk_size, m_trk_nster);
1832 ntuple_trk->addItem(
"trk_nlayer", m_trk_size, m_trk_nlayer);
1833 ntuple_trk->addItem(
"trk_firstLayer", m_trk_size, m_trk_firstLayer);
1834 ntuple_trk->addItem(
"trk_lastLayer", m_trk_size, m_trk_lastLayer);
1835 ntuple_trk->addItem(
"trk_nCgemXClusters", m_trk_size, m_trk_nCgemXClusters);
1836 ntuple_trk->addItem(
"trk_nCgemVClusters", m_trk_size, m_trk_nCgemVClusters);
1837 ntuple_trk->addItem(
"trk_nhop", m_trk_size, m_trk_nhop);
1838 ntuple_trk->addItem(
"trk_nhot", m_trk_size, m_trk_nhot);
1839 ntuple_trk->addItem(
"trk_Xc", m_trk_size, m_trk_Xc);
1840 ntuple_trk->addItem(
"trk_Yc", m_trk_size, m_trk_Yc);
1841 ntuple_trk->addItem(
"trk_R", m_trk_size, m_trk_R);
1843 ntuple_trk->addItem(
"trk_truth_charge", m_trk_size, m_trk_truth_charge);
1844 ntuple_trk->addItem(
"trk_truth_dr", m_trk_size, m_trk_truth_dr);
1845 ntuple_trk->addItem(
"trk_truth_phi0", m_trk_size, m_trk_truth_phi0);
1846 ntuple_trk->addItem(
"trk_truth_kappa", m_trk_size, m_trk_truth_kappa);
1847 ntuple_trk->addItem(
"trk_truth_dz", m_trk_size, m_trk_truth_dz);
1848 ntuple_trk->addItem(
"trk_truth_tanl", m_trk_size, m_trk_truth_tanl);
1849 ntuple_trk->addItem(
"trk_truth_pxy", m_trk_size, m_trk_truth_pxy);
1850 ntuple_trk->addItem(
"trk_truth_px", m_trk_size, m_trk_truth_px);
1851 ntuple_trk->addItem(
"trk_truth_py", m_trk_size, m_trk_truth_py);
1852 ntuple_trk->addItem(
"trk_truth_pz", m_trk_size, m_trk_truth_pz);
1853 ntuple_trk->addItem(
"trk_truth_p", m_trk_size, m_trk_truth_p);
1854 ntuple_trk->addItem(
"trk_truth_theta", m_trk_size, m_trk_truth_theta);
1855 ntuple_trk->addItem(
"trk_truth_phi", m_trk_size, m_trk_truth_phi);
1856 ntuple_trk->addItem(
"trk_truth_x", m_trk_size, m_trk_truth_x);
1857 ntuple_trk->addItem(
"trk_truth_y", m_trk_size, m_trk_truth_y);
1858 ntuple_trk->addItem(
"trk_truth_z", m_trk_size, m_trk_truth_z);
1859 ntuple_trk->addItem(
"trk_truth_r", m_trk_size, m_trk_truth_r);
1860 ntuple_trk->addItem(
"trk_truth_cosTheta", m_trk_size, m_trk_truth_cosTheta);
1861 ntuple_trk->addItem(
"trk_truth_Xc", m_trk_size, m_trk_truth_Xc);
1862 ntuple_trk->addItem(
"trk_truth_Yc", m_trk_size, m_trk_truth_Yc);
1863 ntuple_trk->addItem(
"trk_truth_R", m_trk_size, m_trk_truth_R);
1865 }
else { log << MSG::ERROR <<
"Cannot book tuple mdcHoughFinder/trk" <<endmsg;
1866 return StatusCode::FAILURE;
1869 return StatusCode::SUCCESS;
bool sortCluster(const RecCgemCluster *clusterA, const RecCgemCluster *clusterB)
std::vector< MdcDigi * > MdcDigiVec
HepGeom::Point3D< double > HepPoint3D
double sin(const BesAngle a)
double cos(const BesAngle a)
std::vector< HoughRecHit > recHitCol
vector< TrkRecoTrk * > vectrk_for_clean
ObjectVector< RecMdcHit > RecMdcHitCol
SmartRefVector< RecCgemCluster > ClusterRefVec
ObjectVector< RecMdcTrack > RecMdcTrackCol
SmartRefVector< RecMdcHit > HitRefVec
****INTEGER imax DOUBLE PRECISION m_pi *DOUBLE PRECISION m_amfin DOUBLE PRECISION m_Chfin DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_sinw2 DOUBLE PRECISION m_GFermi DOUBLE PRECISION m_MfinMin DOUBLE PRECISION m_ta2 INTEGER m_out INTEGER m_KeyFSR INTEGER m_KeyQCD *COMMON c_Semalib $ !copy of input $ !CMS energy $ !beam mass $ !final mass $ !beam charge $ !final charge $ !smallest final mass $ !Z mass $ !Z width $ !EW mixing angle $ !Gmu Fermi $ alphaQED at q
bool more_pt(const HoughTrack *tracka, const HoughTrack *trackb)
HepVector bes2barbar(HepVector a)
HepVector barbar2bes(HepVector a)
bool sortCluster(const RecCgemCluster *clusterA, const RecCgemCluster *clusterB)
bool more_pt(const HoughTrack *tracka, const HoughTrack *trackb)
HepVector barbar2bes(HepVector a)
double bFieldNominal() const
void propName(std::string name)
float elapsed(void) const
void setTrackId(const int trackId)
void setNster(const int ns)
void setStat(const int stat)
void setHelix(double helix[5])
void setCharge(const int charge)
double cosTheta(void) const
Hep3Vector momentum(double dPhi=0.) const
returns momentum vector after rotating angle dPhi in phi direction.
double radius(void) const
returns radious of helix.
double dr(void) const
returns an element of parameters.
const HepVector & a(void) const
returns helix parameters.
const HepPoint3D & pivot(void) const
returns pivot position.
static void setContext(TrkContextEv *context)
static void setGeomSvc(const CgemGeomSvc *cgemGeomSvc)
static void setCalib(const MdcCalibFunSvc *mdcCalibFunSvc)
static void setContext(TrkContextEv *context)
static void setCalib(const MdcCalibFunSvc *mdcCalibFunSvc)
static void setGeomSvc(const CgemGeomSvc *cgemGeomSvc)
int addTruthInfo(std::map< int, const HepVector > mcTkPars)
const std::vector< HoughHit > & getList() const
int addCgemClusterList(RecCgemClusterCol *cgemClusterVec)
int getSlayerType() const
static void setMdcGeomSvc(MdcGeomSvc *mdcGeomSvc)
double getDriftDist() const
HepPoint3D getLeftPoint() const
HepPoint3D getRightPoint() const
static void setMdcCalibFunSvc(MdcCalibFunSvc *mdcCalibFunSvc)
double getDriftDistTruth() const
HepPoint3D getMidPoint() const
double getDriftTime() const
static void setCgemGeomSvc(CgemGeomSvc *cgemGeomSvc)
void setBunchTime(double bunchTime)
static vector< double > m_cut_deltaD
double getsAmb(int i) const
HoughTrack & getTrack(int i)
double getPt_least() const
void setHoughHitList(vector< HoughHit > vec_hit)
void setMcPar(std::map< int, const HepVector > mcTkPars)
recHitCol & getHoughHitList()
int getHitNumA(int) const
void setbunchTime(double t)
int fit2D(double bunchtime)
void setMdcHit(const vector< MdcHit * > *mdchit)
void setCharge(int charge)
HoughPeak getCenterPeak() const
static vector< double > m_cut_deltaZ
static void setmethod(int m)
virtual BesTimer * addItem(const std::string &name)=0
static MdcDetector * instance()
MdcHoughFinder(const std::string &name, ISvcLocator *pSvcLocator)
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
static int wire(const Identifier &id)
void printRecMdcTrackCol() const
void setNoInner(bool noInnerFlag)
void remove(MdcTrack *atrack)
static void readMCppTable(std::string filenm)
MdcDigiVec & getMdcDigiVec(uint32_t control=0)
int getlayerid(void) const
void setMdcId(Identifier mdcid)
void setFltLen(double fltLen)
void setVecClusters(ClusterRefVec vecclusters)
void setVecHits(HitRefVec vechits)
void setNcluster(int ncluster)
virtual TrkExchangePar helix(double fltL) const =0
virtual int nHit(TrkEnums::TrkViewInfo view=TrkEnums::bothView) const =0
const TrkFit * fitResult() const
_EXTERN_ std::string RecMdcTrackCol
_EXTERN_ std::string RecMdcHitCol