1#include "GaudiKernel/SmartDataPtr.h"
2#include "GaudiKernel/Bootstrap.h"
3#include "GaudiKernel/IDataManagerSvc.h"
4#include "GaudiKernel/IDataProviderSvc.h"
5#include "GaudiKernel/IPartPropSvc.h"
11#include "HepPDT/ParticleDataTable.hh"
33 declareProperty(
"debug", m_debug = 0);
34 declareProperty(
"cgem", m_cgem = 1);
35 declareProperty(
"mcTruth", m_mcTruth = 0);
36 declareProperty(
"fillNTuple", m_fillNTuple= 0);
37 declareProperty(
"trackCharge", m_trackCharge = 0);
38 declareProperty(
"findPeakMethod",m_findPeakMethod=0);
61 declareProperty(
"keepBadTdc", m_keepBadTdc = 0);
62 declareProperty(
"dropHot", m_dropHot = 0);
63 declareProperty(
"keepUnmatch", m_keepUnmatch = 0);
64 declareProperty(
"driftTimeUpLimit", m_driftTimeUpLimit = 1500);
66 declareProperty(
"pdtFile", m_pdtFile =
"pdt.table");
69 declareProperty(
"nBinTheta", m_nBinTheta=100 );
70 declareProperty(
"nBinRho", m_nBinRho=50 );
71 declareProperty(
"rhoRange", m_rhoRange = 0.1);
72 declareProperty(
"ExtPeak_theta",m_ExtPeak_theta= 4);
73 declareProperty(
"ExtPeak_rho", m_ExtPeak_rho= 4);
74 declareProperty(
"shareHitRate", m_shareHitRate = 0.7);
76 declareProperty(
"nBinTanl", m_nBinTanl = 100);
77 declareProperty(
"nBinDz", m_nBinDz = 100);
78 declareProperty(
"ExtPeak_tanl", m_ExtPeak_tanl = 1);
79 declareProperty(
"ExtPeak_dz", m_ExtPeak_dz = 1);
80 declareProperty(
"filter", m_filter= 0);
81 declareProperty(
"eventFile", m_evtFile=
"EventList.txt");
82 declareProperty(
"fitFlag", m_fitFlag= 3);
83 declareProperty(
"storeFlag",
storeFlag=1);
84 declareProperty(
"checkHits", m_checkHits=1);
85 declareProperty(
"Layer",
Layer=20);
88 declareProperty(
"printFlag",
printFlag=0);
89 declareProperty(
"removeNOuterHits", m_removeNOuterHits = 0);
92 declareProperty(
"drCut_combine", m_drCut=2.0);
93 declareProperty(
"phi0Cut_combine", m_phi0Cut=0.2);
94 declareProperty(
"kappaCut_combine",m_kappaCut=1.5);
95 declareProperty(
"dzCut_combine", m_dzCut=5.0);
96 declareProperty(
"tanlCut_combine", m_tanlCut=0.5);
99 declareProperty(
"chi2CutHits", m_chi2CutHits=10);
107 MsgStream log(
msgSvc(), name());
108 log << MSG::INFO <<
"HoughFinder::initialize()" << endreq;
113 sc = service (
"RawDataProviderSvc", irawDataProviderSvc);
115 if ( sc.isFailure() ){
116 log << MSG::ERROR << name()<<
" Could not load RawDataProviderSvc!" << endreq;
117 return StatusCode::FAILURE;
123 sc = service (
"MdcGeomSvc", imdcGeomSvc);
124 m_mdcGeomSvc =
dynamic_cast<MdcGeomSvc*
> (imdcGeomSvc);
125 if ( sc.isFailure() ){
126 log << MSG::ERROR <<
"Could not load MdcGeoSvc!" << endreq;
127 return StatusCode::FAILURE;
132 sc = service (
"MdcCalibFunSvc", imdcCalibSvc);
134 if ( sc.isFailure() ){
135 log << MSG::ERROR <<
"Could not load MdcCalibFunSvc!" << endreq;
136 return StatusCode::FAILURE;
142 sc = service (
"CgemGeomSvc", icgemGeomSvc);
143 m_cgemGeomSvc =
dynamic_cast<CgemGeomSvc*
> (icgemGeomSvc);
144 if ( sc.isFailure() ){
145 log << MSG::ERROR <<
"Could not load CgemGeomSvc!" << endreq;
146 return StatusCode::FAILURE;
151 sc = service (
"CgemCalibFunSvc", icgemCalibSvc);
153 if ( sc.isFailure() ){
154 log << MSG::ERROR <<
"Could not load CgemCalibFunSvc!" << endreq;
155 return StatusCode::FAILURE;
161 sc = service (
"MagneticFieldSvc",m_pIMF);
162 if( sc.isFailure() ) {
163 log << MSG::ERROR <<
"Unable to open Magnetic field service"<<endreq;
164 return StatusCode::FAILURE;
166 m_bfield =
new BField(m_pIMF);
200 m_roughRhoThetaMap=TH2D(
"roughRhoThetaMap",
"roughRhoThetaMap",m_nBinTheta,0.,
M_PI, m_nBinRho, -1.*m_rhoRange, m_rhoRange);
204 m_roughTanlDzMap = TH2D(
"roughTanlDzMap",
"roughTanlDzMap",m_nBinTanl,-1.*m_tanlRange,m_tanlRange,m_nBinDz,-1.*m_dzRange,m_dzRange);
207 double rho[nPt] = {0.07, 0.056,0.045,0.038,0.0335,0.03,0.0198,0.0148,0.0074,0.00376,0.00303,0.00157};
208 double cut1_Cgem_99[12]={-2.14,-1.36, -0.6 , -0.46, -0.35, -0.59, -0.32, -0.26, -0.22, -0.21, -0.21, -0.211};
209 double cut2_Cgem_99[12]={ 0.5 , 1.77, 1.99, 1.94, 1.99, 1.9 , 0.31, 0.27, 0.24, 0.23, 0.23, 0.222};
210 double cut1_ODC1_99[12]={-1.28,-0.71, -0.58, -0.62, -0.64, -0.68, -0.18, -0.14, -0.11, -0.1 , -0.1 , -0.11 };
211 double cut2_ODC1_99[12]={ 0.9 , 0.74, 0.42, 0.37, 0.32, 0.37, 0.28, 0.25, 0.24, 0.24, 0.24, 0.23};
212 double cut1_ODC2_99[12]={ -2.14, -1.25, -1.28, -0.86, -0.47, -0.78, -0.36, -0.44, -0.61, -0.67, -0.64, -0.82 };
213 double cut2_ODC2_99[12]={ -1.35, 0.55 , 0.53 , 0.83 , 0.85 , 0.83 , 0.38 , 0.55 , 0.49 , 0.46 , 0.49 , 0.4};
214 m_cut1_cgem =
new TGraph(nPt, rho, cut1_Cgem_99);
215 m_cut2_cgem =
new TGraph(nPt, rho, cut2_Cgem_99);
216 m_cut1_ODC1 =
new TGraph(nPt, rho, cut1_ODC1_99);
217 m_cut2_ODC1 =
new TGraph(nPt, rho, cut2_ODC1_99);
218 m_cut1_ODC2 =
new TGraph(nPt, rho, cut1_ODC2_99);
219 m_cut2_ODC2 =
new TGraph(nPt, rho, cut2_ODC2_99);
222 int s(0),l(0),npt(0);
223 double momenta[100] = {0};
224 double cuts[2][43][100] = {0};
225 string cutFilePath = getenv(
"HOUGHTRANSALGROOT");
226 cutFilePath +=
"/share/cut.txt";
227 ifstream fin(cutFilePath.c_str(), ios::in);
231 cout <<
"Error in " << __FILE__<<
" when opening "<<cutFilePath.c_str()<<endl;
232 bool firstline(
true);
234 while(std::getline(fin, strcom)){
237 >> momenta[0] >> momenta[1] >> momenta[2] >> momenta[3] >> momenta[4] >> momenta[5] >> momenta[6] >> momenta[7] >> momenta[8] >> momenta[9]
238 >> momenta[10] >> momenta[11] >> momenta[12] >> momenta[13] >> momenta[14] >> momenta[15] >> momenta[16] >> momenta[17] >> momenta[18] >> momenta[19]
239 >> momenta[20] >> momenta[21] >> momenta[22] >> momenta[23] >> momenta[24] >> momenta[25] >> momenta[26] >> momenta[27] >> momenta[28] >> momenta[29]
240 >> momenta[30] >> momenta[31] >> momenta[32] >> momenta[33] >> momenta[34] >> momenta[35] >> momenta[36] >> momenta[37] >> momenta[38] >> momenta[39]
241 >> momenta[40] >> momenta[41] >> momenta[42] >> momenta[43] >> momenta[44] >> momenta[45] >> momenta[46] >> momenta[47] >> momenta[48] >> momenta[49]
242 >> momenta[50] >> momenta[51] >> momenta[52] >> momenta[53] >> momenta[54] >> momenta[55] >> momenta[56] >> momenta[57] >> momenta[58] >> momenta[59]
243 >> momenta[60] >> momenta[61] >> momenta[62] >> momenta[63] >> momenta[64] >> momenta[65] >> momenta[66] >> momenta[67] >> momenta[68] >> momenta[69]
244 >> momenta[70] >> momenta[71] >> momenta[72] >> momenta[73] >> momenta[74] >> momenta[75] >> momenta[76] >> momenta[77] >> momenta[78] >> momenta[79]
245 >> momenta[80] >> momenta[81] >> momenta[82] >> momenta[83] >> momenta[84] >> momenta[85] >> momenta[86] >> momenta[87] >> momenta[88] >> momenta[89]
246 >> momenta[90] >> momenta[91] >> momenta[92] >> momenta[93] >> momenta[94] >> momenta[95] >> momenta[96] >> momenta[97] >> momenta[98] >> momenta[99]
252 fin >> cuts[
s][l][0] >> cuts[
s][l][1] >> cuts[
s][l][2] >> cuts[
s][l][3] >> cuts[
s][l][4] >> cuts[
s][l][5] >> cuts[
s][l][6] >> cuts[
s][l][7] >> cuts[
s][l][8] >> cuts[
s][l][9]
253 >> cuts[
s][l][10] >> cuts[
s][l][11] >> cuts[
s][l][12] >> cuts[
s][l][13] >> cuts[
s][l][14] >> cuts[
s][l][15] >> cuts[
s][l][16] >> cuts[
s][l][17] >> cuts[
s][l][18] >> cuts[
s][l][19]
254 >> cuts[
s][l][20] >> cuts[
s][l][21] >> cuts[
s][l][22] >> cuts[
s][l][23] >> cuts[
s][l][24] >> cuts[
s][l][25] >> cuts[
s][l][26] >> cuts[
s][l][27] >> cuts[
s][l][28] >> cuts[
s][l][29]
255 >> cuts[
s][l][30] >> cuts[
s][l][31] >> cuts[
s][l][32] >> cuts[
s][l][33] >> cuts[
s][l][34] >> cuts[
s][l][35] >> cuts[
s][l][36] >> cuts[
s][l][37] >> cuts[
s][l][38] >> cuts[
s][l][39]
256 >> cuts[
s][l][40] >> cuts[
s][l][41] >> cuts[
s][l][42] >> cuts[
s][l][43] >> cuts[
s][l][44] >> cuts[
s][l][45] >> cuts[
s][l][46] >> cuts[
s][l][47] >> cuts[
s][l][48] >> cuts[
s][l][49]
257 >> cuts[
s][l][50] >> cuts[
s][l][51] >> cuts[
s][l][52] >> cuts[
s][l][53] >> cuts[
s][l][54] >> cuts[
s][l][55] >> cuts[
s][l][56] >> cuts[
s][l][57] >> cuts[
s][l][58] >> cuts[
s][l][59]
258 >> cuts[
s][l][60] >> cuts[
s][l][61] >> cuts[
s][l][62] >> cuts[
s][l][63] >> cuts[
s][l][64] >> cuts[
s][l][65] >> cuts[
s][l][66] >> cuts[
s][l][67] >> cuts[
s][l][68] >> cuts[
s][l][69]
259 >> cuts[
s][l][70] >> cuts[
s][l][71] >> cuts[
s][l][72] >> cuts[
s][l][73] >> cuts[
s][l][74] >> cuts[
s][l][75] >> cuts[
s][l][76] >> cuts[
s][l][77] >> cuts[
s][l][78] >> cuts[
s][l][79]
260 >> cuts[
s][l][80] >> cuts[
s][l][81] >> cuts[
s][l][82] >> cuts[
s][l][83] >> cuts[
s][l][84] >> cuts[
s][l][85] >> cuts[
s][l][86] >> cuts[
s][l][87] >> cuts[
s][l][88] >> cuts[
s][l][89]
261 >> cuts[
s][l][90] >> cuts[
s][l][91] >> cuts[
s][l][92] >> cuts[
s][l][93] >> cuts[
s][l][94] >> cuts[
s][l][95] >> cuts[
s][l][96] >> cuts[
s][l][97] >> cuts[
s][l][98] >> cuts[
s][l][99]
263 if(fin.peek()<0)
break;
265 for(
int is=0;is<=1;is++){
266 for(
int il=0;il<43;il++){
267 TGraph*
gr =
new TGraph();
270 for(
int ipt=0;ipt<npt;ipt++){
272 if(fabs(cuts[is][il][ipt])<1e-6)
continue;
274 gr->SetPoint(point,momenta[ipt]/1000.,cuts[is][il][ipt]);
284 if ( sc.isFailure() ){
285 log << MSG::FATAL <<
"Could not book Tuple !" << endreq;
286 return StatusCode::FAILURE;
292 return StatusCode::SUCCESS;
297 MsgStream log(
msgSvc(), name());
298 log << MSG::INFO <<
"HoughFinder::execute()" << endreq;
304 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
306 log << MSG::ERROR <<
"Could not find Event Header" << endreq;
307 return StatusCode::FAILURE;
309 m_run = eventHeader->runNumber();
310 m_event = eventHeader->eventNumber();
315 SmartDataPtr<RecEsTimeCol> evTimeCol(eventSvc(),
"/Event/Recon/RecEsTimeCol");
317 log << MSG::ERROR <<
"Could not retrieve RecEsTimeCol" << endreq;
318 return StatusCode::FAILURE;
321 RecEsTimeCol::iterator iter_evt = evTimeCol->begin();
322 if (iter_evt != evTimeCol->end()){
323 m_bunchT0 = (*iter_evt)->getTest()*1.e-9;
334 lowPt_Evt.open(m_evtFile.c_str());
337 while( lowPt_Evt >> evtNum) {
338 evtlist.push_back(evtNum);
340 vector<int>::iterator iter_evt = find(evtlist.begin(),evtlist.end(),m_event);
341 if(iter_evt == evtlist.end()){
342 setFilterPassed(
false);
343 return StatusCode::SUCCESS;
346 setFilterPassed(
true);
357 cout<<
"===================================================================================================="<<endl;
358 cout<<
"run:"<<m_run<<
" , event: "<<m_event<<endl;
369 if(m_run<0&&m_mcTruth){
372 if(
printFlag)cout<<
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ McParticle @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"<<endl;
374 if(
printFlag)cout<<
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ McParticle @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"<<endl;
392 if(
printFlag)cout<<
"################################################## HoughTrack ##################################################"<<endl;
398 if(
printFlag)cout<<
"################################################## HoughTrack ##################################################"<<endl;
404 if(m_fillNTuple)dumpHit();
405 if(m_fillNTuple==1)dumpHoughTrack();
406 if(m_fillNTuple==1)dumpHoughEvent();
407 if(m_fillNTuple==2)dumpTdsTrack();
408 if(m_fillNTuple==2)dumpTdsEvent();
411 if(
printFlag)cout<<
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ TdsTrack $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"<<endl;
413 if(
printFlag)cout<<
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ TdsTrack $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"<<endl;
418 if(
printFlag)cout<<
"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& HoughHit &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"<<endl;
420 if(
printFlag)cout<<
"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& HoughHit &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"<<endl;
430 if(m_debug)cout<<endl;
432 return StatusCode::SUCCESS;
437 MsgStream log(
msgSvc(), name());
438 log << MSG::INFO <<
"HoughFinder::finalize()" << endreq;
439 return StatusCode::SUCCESS;
444 return fabs(trk1.
pt())>fabs(trk2.
pt());
449 MsgStream log(
msgSvc(), name());
451 if(!(m_mdcHitCol.empty())) m_mdcHitCol.clear();
452 if(!(m_houghHitList.empty())) m_houghHitList.clear();
453 if(!(m_XHoughHitList.empty())) m_XHoughHitList.clear();
454 if(!(m_VHoughHitList.empty())) m_VHoughHitList.clear();
458 SmartDataPtr<RecCgemClusterCol> recCgemClusterCol(eventSvc(),
"/Event/Recon/RecCgemClusterCol");
459 if(!recCgemClusterCol){
460 log << MSG::ERROR <<
"Could not retrieve RecCgemClusterCol" << endreq;
462 RecCgemClusterCol::iterator cgemClusterIter = recCgemClusterCol->begin();
463 m_recCgemClusterColBegin=cgemClusterIter;
464 for (;cgemClusterIter != recCgemClusterCol->end(); cgemClusterIter++,nHit++){
467 HoughHit hit(recCgemCluster, m_bunchT0, nHit);
468 m_houghHitList.push_back(hit);
474 uint32_t getDigiFlag = 0;
480 MdcDigiVec::iterator mdcDigiIter = mdcDigiVec.begin();
481 for (;mdcDigiIter != mdcDigiVec.end(); mdcDigiIter++,nHit++){
482 const MdcDigi* mdcDigi = (*mdcDigiIter);
483 HoughHit hit(mdcDigi, m_bunchT0, nHit);
484 if(fabs(hit.
driftTime())>m_driftTimeUpLimit)
continue;
488 m_mdcHitCol.push_back(mdcHit);
489 m_houghHitList.push_back(hit);
493 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end();hitIt++){
494 int flag=hitIt->getFlag();
496 if(flag==0)m_XHoughHitList.push_back(&(*hitIt));
497 if(flag==2)m_VHoughHitList.push_back(&(*hitIt));
500 if(flag==0)m_XHoughHitList.push_back(&(*hitIt));
501 else m_VHoughHitList.push_back(&(*hitIt));
516 MsgStream log(
msgSvc(), name());
518 if(!(m_mcHitCol.empty()))m_mcHitCol.clear();
522 SmartDataPtr<CgemMcHitCol> cgemMcHitCol(eventSvc(),
"/Event/MC/CgemMcHitCol");
524 log << MSG::ERROR <<
"Could not retrieve CgemMcHitCol" << endreq;
526 CgemMcHitCol::iterator cgemMcHitIt = cgemMcHitCol->begin();
527 for(;cgemMcHitIt != cgemMcHitCol->end();cgemMcHitIt++,nMcHit++){
528 const CgemMcHit* cgemMcHit = (*cgemMcHitIt);
529 HoughHit hit(cgemMcHit,m_bunchT0,nMcHit);
530 m_mcHitCol.push_back(hit);
531 HoughHit* phit = &(*m_mcHitCol.rbegin());
534 vector<int> xFireStripID;
535 vector<int> vFireStripID;
538 for(
int ii = 0; ii < identifier.GetSize(); ii++){
552 sort(xFireStripID.begin(),xFireStripID.end());
553 sort(vFireStripID.begin(),vFireStripID.end());
561 bool findX(
false), findV(
false);
564 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end();hitIt++){
568 if(!(recCgemCluster->
getflag()==0||recCgemCluster->
getflag()==1))
continue;
572 findX = recCgemCluster->
getflag() == 0
573 && xFireStripID.size() > 0
577 xCluster = recCgemCluster;
578 hitIt->setPairHit(phit);
582 findV = recCgemCluster->
getflag() == 1
583 && vFireStripID.size() > 0
587 vCluster = recCgemCluster;
588 hitIt->setPairHit(phit);
596 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end();hitIt++){
600 if(recCgemCluster->
getflag()==0||recCgemCluster->
getflag()==1)
continue;
609 hitIt->setPairHit(phit);
613 else if(findX&&!findV){
618 else if(!findX&&findV){
628 SmartDataPtr<MdcMcHitCol> mdcMcHitCol(eventSvc(),
"/Event/MC/MdcMcHitCol");
630 log << MSG::ERROR <<
"Could not retrieve MdcMcHitCol" << endreq;
632 MdcMcHitCol::iterator mdcMcHitIt = mdcMcHitCol->begin();
633 for(;mdcMcHitIt != mdcMcHitCol->end();mdcMcHitIt++,nMcHit++){
634 const MdcMcHit* mdcMcHit = (*mdcMcHitIt);
635 HoughHit hit(mdcMcHit,m_bunchT0,nMcHit);
636 m_mcHitCol.push_back(hit);
637 HoughHit* phit = &(*m_mcHitCol.rbegin());
638 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end();hitIt++){
640 const MdcDigi* mdcDigi = hitIt->getDigi();
644 hitIt->setPairHit(phit);
650 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end();hitIt++){
651 for(
HitVector_Iterator mcHitIt = m_mcHitCol.begin(); mcHitIt != m_mcHitCol.end();mcHitIt++){
652 if(hitIt->getLayer()!=mcHitIt->getLayer())
continue;
654 if(mcHitIt->getCgemCluster()==NULL)
continue;
655 int recClusterID(-1);
657 int recFlag = hitIt->getCgemCluster()->getflag();
658 int mcFlag = mcHitIt->getCgemCluster()->getflag();;
660 recClusterID = hitIt->getCgemCluster()->getclusterid();
661 mcClusterID = mcHitIt->getCgemCluster()->getclusterid();
664 if(recFlag==1&&mcFlag==2){
665 recClusterID = hitIt->getCgemCluster()->getclusterid();
666 mcClusterID = mcHitIt->getCgemCluster()->getclusterflage();
669 if(recFlag==0&&mcFlag==2){
670 recClusterID = hitIt->getCgemCluster()->getclusterid();
671 mcClusterID = mcHitIt->getCgemCluster()->getclusterflagb();
674 if(recFlag==2&&mcFlag==1){
675 recClusterID = hitIt->getCgemCluster()->getclusterflage();
676 mcClusterID = mcHitIt->getCgemCluster()->getclusterid();
679 if(recFlag==2&&mcFlag==0){
680 recClusterID = hitIt->getCgemCluster()->getclusterflagb();
681 mcClusterID = mcHitIt->getCgemCluster()->getclusterid();
684 if(recClusterID==mcClusterID){
685 hitIt->setPairHit(&(*mcHitIt));
686 hitIt->setCgemMcHit(mcHitIt->getCgemMcHit());
704 if(mcHitIt->getDigi()==NULL)
continue;
706 if(hitIt->getDigi()->identify() == mcHitIt->getDigi()->identify())
708 hitIt->setPairHit(&(*mcHitIt));
709 hitIt->setMdcMcHit(mcHitIt->getMdcMcHit());
733 const int maxCell[43] = {40,44,48,56, 64,72,80,80,
734 76,76,88,88, 100,100,112,112, 128,128,140,140,
735 160,160,160,160, 176,176,176,176, 208,208,208,208, 240,240,240,240,
736 256,256,256,256, 288,288,288 };
737 m_mcTrackCol.clear();
738 MsgStream log(
msgSvc(), name());
739 SmartDataPtr<McParticleCol> mcParticleCol(eventSvc(),
"/Event/MC/McParticleCol");
740 if (!mcParticleCol) {
741 log << MSG::ERROR <<
"Could not find McParticle" << endreq;
743 bool psipDecay(
false);
744 McParticleCol::iterator iter_mc = mcParticleCol->begin();
745 for (;iter_mc != mcParticleCol->end(); iter_mc++){
746 int trackIndex = (*iter_mc)->trackIndex();
747 int pid = (*iter_mc)->particleProperty();
748 bool primaryParticle = (*iter_mc)->primaryParticle();
749 bool leafParticle = (*iter_mc)->leafParticle();
750 bool decayFromGenerator = (*iter_mc)->decayFromGenerator();
751 bool decayInFlight = (*iter_mc)->decayInFlight();
752 HepLorentzVector initialPosition = (*iter_mc)->initialPosition();
753 HepLorentzVector initialFourMomentum = (*iter_mc)->initialFourMomentum();
756 unsigned int statusFlags = (*iter_mc)->statusFlags();
770 IPartPropSvc* p_PartPropSvc;
771 static const bool CREATEIFNOTTHERE(
true);
772 StatusCode PartPropStatus = service(
"PartPropSvc", p_PartPropSvc, CREATEIFNOTTHERE);
773 if (!PartPropStatus.isSuccess() || 0 == p_PartPropSvc) {
774 log << MSG::ERROR <<
"Could not initialize Particle Properties Service" << endreq;
776 HepPDT::ParticleDataTable* p_particleTable = p_PartPropSvc->PDT();
777 if( p_particleTable->particle(pid) ){
778 name = p_particleTable->particle(pid)->name();
779 charge = p_particleTable->particle(pid)->charge();
780 }
else if( p_particleTable->particle(-pid) ){
781 name =
"anti " + p_particleTable->particle(-pid)->name();
782 charge = (-1)*p_particleTable->particle(-pid)->charge();
797 HoughTrack track(charge,initialPosition.v(),initialFourMomentum.v(),trackIndex);
803 vector<HoughHit*> hotList;
804 vector<HoughHit>& hitList = m_mcHitCol;
806 vector<int> trkID = hitIt->getTrkID();
811 hotList.push_back(&(*hitIt));
814 if(hitIt->getFlag()==0)track.
addHitPnt(&(*hitIt));
816 hotList.push_back(&(*hitIt));
821 if(nHot>0)m_mcTrackCol.push_back(track);
824 bool classifyHotByHotLayer(
false);
825 bool classifyHotByTrackCenter(
true);
826 if(classifyHotByHotLayer){
831 vector<HoughHit*> hitOnLayer;
833 for(vector<HoughHit*>::iterator hitIt = hotList.begin(); hitIt != hotList.end(); hitIt++){
837 hitOnLayer.push_back(*hitIt);
838 lastLayerHit = *hitIt;
839 lastHitLayer = (*hitIt)->
getLayer();
843 if((*hitIt)->getLayer()==lastHitLayer){
844 hitOnLayer.push_back(*hitIt);
845 lastHitLayer = (*hitIt)->getLayer();
847 if(deltaLayer*((*hitIt)->getLayer()-lastHitLayer)>=0){
848 for(vector<HoughHit*>::iterator
iter = hitOnLayer.begin();
iter != hitOnLayer.end();
iter++){
849 (*iter)->setHalfCircle(halfCircle);
850 lastLayerHit = *
iter;
857 for(vector<HoughHit*>::iterator
iter = hitOnLayer.begin();
iter != hitOnLayer.end();
iter++){
858 deltaWire = fabs((*iter)->getWire()-lastLayerHit->
getWire());
859 if(deltaWire>(maxCell[(*iter)->getLayer()])/2) deltaWire = maxCell[(*iter)->getLayer()] - deltaWire;
860 if(deltaWire>maxWireGap){
861 maxWireGap = deltaWire;
862 turnPoint =
iter - hitOnLayer.begin();
864 lastLayerHit = *
iter;
866 deltaWire = fabs((*hitIt)->getWire()-lastLayerHit->
getWire());
867 if(deltaWire>(maxCell[(*hitIt)->getLayer()])/2) deltaWire = maxCell[(*hitIt)->getLayer()] - deltaWire;
868 if(deltaWire>maxWireGap){
869 maxWireGap = deltaWire;
870 turnPoint = hitOnLayer.size();
874 for(vector<HoughHit*>::iterator
iter = hitOnLayer.begin();
iter != hitOnLayer.end();
iter++){
875 int shift =
iter-hitOnLayer.begin();
876 if(shift<turnPoint)(*iter)->setHalfCircle(halfCircle-1);
877 else (*iter)->setHalfCircle(halfCircle);
880 for(vector<HoughHit*>::iterator
iter = hitOnLayer.begin();
iter != hitOnLayer.end();
iter++){
881 int shift =
iter-hitOnLayer.begin();
882 if(shift<hitOnLayer.size()/2)(*iter)->setHalfCircle(halfCircle-1);
883 else (*iter)->setHalfCircle(halfCircle);
888 hitOnLayer.push_back(*hitIt);
889 lastHitLayer = (*hitIt)->getLayer();
890 deltaLayer = (*hitIt)->getLayer()-lastHitLayer;
899 if(classifyHotByTrackCenter){
900 int cgemHalf(0), mdcHalf(0);
901 int cgemSign(0), mdcSign(0);
902 int half(0), sign(0);
903 for(vector<HoughHit*>::iterator hitIt = hotList.begin(); hitIt != hotList.end(); hitIt++){
921 (*hitIt)->setHalfCircle(half);
924 if(hotList.size()>0){
929 for(vector<HoughHit*>::iterator hotIt = hotList.begin(); hotIt != hotList.end();hotIt++){
936 if(
printFlag)
if(hotList.size())cout<<endl;
938 sort(m_mcTrackCol.begin(),m_mcTrackCol.end(),
largerPt);
940 for(vector<HoughTrack>::iterator trkIter=m_mcTrackCol.begin();trkIter!=m_mcTrackCol.end();trkIter++){
944 return m_mcTrackCol.size();
949 int nBin = hitMap->GetXaxis()->GetNbins();
950 double xMin = hitMap->GetXaxis()->GetXmin();
951 double xMax = hitMap->GetXaxis()->GetXmax();
952 double yMin = hitMap->GetYaxis()->GetXmin();
953 double yMax = hitMap->GetYaxis()->GetXmax();
954 double dx = (xMax-xMin)/(nBin*vote)>1e-6?(xMax-xMin)/(nBin*vote):1e-6;
955 double x = xMin + dx/2;
963 double denominator = xHit*xHit+yHit*yHit-rHit*rHit;
966 double X1 = 2*xHit/denominator;
967 double Y1 = 2*yHit/denominator;
968 double X2 = 2*xHit/denominator;
969 double Y2 = 2*yHit/denominator;
970 double R = 2*rHit/denominator;
977 double hitOnCircle1 = charge*slope1*y1;
978 double hitOnCircle2 = charge*slope2*y2;
981 cut = yMin<y1 && y1<yMax;
982 cut =
cut && hitOnCircle1 <=0;
988 cut = yMin<y2 && y2<yMax;
989 cut =
cut && hitOnCircle2 <= 0;
1000 vector<HoughHit::S_Z> sz = hit->
getSZ();
1001 vector<HoughHit::S_Z>::iterator
iter = sz.begin();
1003 double S =
iter->first;
1004 double Z =
iter->second;
1012 cut = yMin<y && y<yMax;
1025 int charge =
trkCandi->getCharge();
1026 int nBin = hitMap->GetXaxis()->GetNbins();
1027 double xMin = hitMap->GetXaxis()->GetXmin();
1028 double xMax = hitMap->GetXaxis()->GetXmax();
1029 double yMin = hitMap->GetYaxis()->GetXmin();
1030 double yMax = hitMap->GetYaxis()->GetXmax();
1031 double dx = (xMax-xMin)/(nBin*vote)>1e-6?(xMax-xMin)/(nBin*vote):1e-6;
1032 double x = xMin + dx/2;
1038 bool firstHalf =
trkCandi->judgeHalf(hit)==1;
1039 if(!firstHalf)
return 0;
1043 double denominator = xHit*xHit+yHit*yHit-rHit*rHit;
1046 double X1 = 2*xHit/denominator;
1047 double Y1 = 2*yHit/denominator;
1048 double X2 = 2*xHit/denominator;
1049 double Y2 = 2*yHit/denominator;
1050 double R = 2*rHit/denominator;
1057 double hitOnCircle1 = charge*slope1*y1;
1058 double hitOnCircle2 = charge*slope2*y2;
1061 cut = yMin<y1 && y1<yMax;
1068 cut = yMin<y2 && y2<yMax;
1082 int nTangency =
trkCandi->calculateZ_S(hit);
1089 vector<HoughHit::S_Z> sz = hit->
getSZ();
1090 vector<HoughHit::S_Z>::iterator
iter = sz.begin();
1093 double S =
iter->first;
1094 double Z =
iter->second;
1097 double y = -S*
x + Z;
1100 cut = yMin<y && y<yMax;
1116 int nHitsFilled = 0;
1117 m_VHoughHitListOnSZmap.clear();
1118 std::vector<HoughHit*>::iterator
iter = hitList.begin();
1119 for(;
iter!= hitList.end();
iter++)
1121 int used = (*iter)->getUse();
1137 m_VHoughHitListOnSZmap.push_back(*
iter);
1633 if(trackVector.size()==0)
return 0;
1634 std::sort(trackVector.begin(),trackVector.end(),
moreHot);
1636 vector<HoughTrack>::iterator trkIT1 = trackVector.end();
1643 if(trkIT1==trackVector.begin()) loop=
false;
1644 if((trkIT1)->getFlag() == 1)
continue;
1645 trkIT1->dropRedundentCgemXHits();
1647 int nHits = trkIT1->getVecHitPnt().size();
1649 (trkIT1)->setFlag(1);
1650 trkIT1->releaseSelHits();
1652 cout<<
"too less hits ("<<nHits<<
") in track "<<(trkIT1)->getTrkID()<<endl;
1656 int nShared = trkIT1->getNHitsShared();
1659 if(nShared>m_shareHitRate*nHits){
1661 trkIT1->releaseSelHits();
1664 cout<<
"too many shared hits ("<<nShared<<
"/"<<nHits
1665 <<
") in track "<<(trkIT1)->getTrkID()
1685 std::sort(trackVector.begin(),trackVector.end(),
moreHot);
1686 for(vector<HoughTrack>::iterator trkIT1 = trackVector.begin(); trkIT1!=trackVector.end(); trkIT1++){
1687 if((trkIT1)->getFlag() == 1)
continue;
1688 int charge = (trkIT1)->getCharge();
1689 double dr = (trkIT1)->dr();
1690 double phi0 = (trkIT1)->phi0();
1691 double kappa = (trkIT1)->kappa();
1692 double dz = (trkIT1)->dz();
1693 double tanl = (trkIT1)->tanl();
1694 for(vector<HoughTrack>::iterator trkIT2 = trkIT1+1; trkIT2!=trackVector.end();trkIT2++){
1695 if((trkIT2)->getFlag() == 1)
continue;
1696 bool sameTrack(
false);
1697 dDr = fabs(dr - (trkIT2)->dr());
1698 dPhi0 = fabs(phi0 - (trkIT2)->phi0());
1699 if((trkIT2)->getCharge() == charge){
1700 dKappa = fabs(kappa - (trkIT2)->kappa());
1701 dTanl = fabs(tanl - (trkIT2)->tanl());
1703 dKappa = fabs(fabs(kappa) - fabs((trkIT2)->kappa()));
1704 dTanl = fabs(fabs(tanl) - fabs((trkIT2)->tanl()));
1706 double r = fabs(dz)<fabs((trkIT2)->dz())?(trkIT1)->radius():(trkIT2)->radius();
1707 double k = dz<fabs((trkIT2)->dz())?tanl:(trkIT2)->tanl();
1708 dDz = fabs(dz - (trkIT2)->dz());
1709 int nCircle = fabs(dDz)/(2*
M_PI*r*k);
1710 dDz = fabs(dDz - nCircle*(2*
M_PI*r*k));
1711 if(dDz>
M_PI*r*k)dDz = fabs(dDz - 2*
M_PI*r*k);
1712 if(dPhi0<m_phi0Cut&&dKappa<m_kappaCut&&dTanl<m_tanlCut) sameTrack=
true;
1722 (trkIT2)->setFlag(1);
1724 cout<<
"dDr, dPhi0, dKappa, dDz, dTanl "
1731 cout<<
"similar track "<<trkIT2->getTrkID()<<
" is removed from hough track list"<<endl;
1739 if(m_debug) cout<<
"checkTrack(): "<<nDelete<<
" similar tracks are removed from hough track list"<<endl;
1804 MsgStream log(
msgSvc(), name());
1806 IDataProviderSvc* eventSvc = NULL;
1807 Gaudi::svcLocator()->service(
"EventDataSvc", eventSvc);
1809 log << MSG::INFO <<
"makeTds:event Svc has been found" << endreq;
1811 log << MSG::FATAL <<
"makeTds:Could not find eventSvc" << endreq;
1812 return StatusCode::FAILURE;
1815 IDataManagerSvc *dataManSvc =
dynamic_cast<IDataManagerSvc*
>(eventSvc);;
1820 DataObject *aRecMdcTrackCol;
1821 eventSvc->findObject(
"/Event/Recon/RecMdcTrackCol",aRecMdcTrackCol);
1822 if(aRecMdcTrackCol != NULL) {
1823 dataManSvc->clearSubTree(
"/Event/Recon/RecMdcTrackCol");
1824 eventSvc->unregisterObject(
"/Event/Recon/RecMdcTrackCol");
1827 sc = eventSvc->registerObject(
"/Event/Recon/RecMdcTrackCol", recMdcTrackCol);
1828 if(sc.isFailure()) {
1829 log << MSG::FATAL <<
" Could not register RecMdcTrack collection" <<endreq;
1830 return StatusCode::FAILURE;
1832 log << MSG::INFO <<
"RecMdcTrackCol registered successfully!" <<endreq;
1837 DataObject *aRecMdcHitCol;
1838 eventSvc->findObject(
"/Event/Recon/RecMdcHitCol",aRecMdcHitCol);
1839 if(aRecMdcHitCol != NULL) {
1840 dataManSvc->clearSubTree(
"/Event/Recon/RecMdcHitCol");
1841 eventSvc->unregisterObject(
"/Event/Recon/RecMdcHitCol");
1844 sc = eventSvc->registerObject(
"/Event/Recon/RecMdcHitCol", recMdcHitCol);
1845 if(sc.isFailure()) {
1846 log << MSG::FATAL <<
" Could not register RecMdcHit collection" <<endreq;
1847 return StatusCode::FAILURE;
1849 log << MSG::INFO <<
"RecMdcHitCol registered successfully!" <<endreq;
1852 return StatusCode::SUCCESS;
1864 vector<MdcTrack*> mdcTrackVector;
1865 for(vector<HoughTrack>::iterator trkIT = trackVector.begin();trkIT!=trackVector.end();trkIT++){
1866 if((trkIT)->getFlag() == 1)
continue;
1867 if((trkIT)->getFlag() == -1)
continue;
1868 if((trkIT)->getFlag() == -2)
continue;
1871 mdcTrackList.append(mdcTrack);
1872 mdcTrackVector.push_back(mdcTrack);
1877 if(nDeleted>0)cout<<
"nDeleted "<<nDeleted<<endl;
1880 for(
int l=0;l<mdcTrackList.length();l++){
1881 mdcTrackList[l]->storeTrack(trkID,recMdcTrackCol,recMdcHitCol,4);
1885 vector<MdcTrack*>::iterator
iter = mdcTrackVector.begin();
1886 for(;
iter!=mdcTrackVector.end();
iter++){
1901 if(debug) cout<<
"N Rectrack: "<<trackVector.size()<<endl;
1902 sort(trackVector.begin(),trackVector.end(),
largerPt);
1904 for(vector<HoughTrack>::iterator trkIT = trackVector.begin(); trkIT!=trackVector.end(); trkIT++)
1907 if(debug) cout<<
"trk flag: "<<(trkIT)->getFlag()<<endl;
1912 if((trkIT)->getFlag()!=0)
continue;
1916 cout<<
"the following track will be saved: "<<endl;
1926 helixPar[0]=trkIT->getDr();
1927 helixPar[1]=trkIT->getPhi0();
1928 helixPar[2]=trkIT->getKappa();
1929 helixPar[3]=trkIT->getDz();
1930 helixPar[4]=trkIT->getTanl();
1933 int q = trkIT->getCharge();
1934 double pxy = trkIT->pt();
1935 double px = trkIT->momentum(0).x();
1936 double py = trkIT->momentum(0).y();
1937 double pz = trkIT->momentum(0).z();
1938 double p = trkIT->momentum(0).mag();
1939 double theta = trkIT->direction(0).theta();
1940 double phi = trkIT->direction(0).phi();
1943 double r = poca.perp();
1944 HepSymMatrix Ea = trkIT->Ea();
1946 double errorMat[15];
1948 for (
int ie = 0 ; ie < 5 ; ie ++){
1949 for (
int je = ie ; je < 5 ; je ++){
1950 errorMat[k] = Ea[ie][je];
1956 a(1) =trkIT->getDr();
1957 a(2) =trkIT->getPhi0();
1958 a(3) =trkIT->getKappa();
1959 a(4) =trkIT->getDz();
1960 a(5) =trkIT->getTanl();
1963 double chisq = trkIT->getChi2();
1965 recMdcTrack->
setPxy(pxy);
1966 recMdcTrack->
setPx(px);
1967 recMdcTrack->
setPy(py);
1968 recMdcTrack->
setPz(pz);
1969 recMdcTrack->
setP(p);
1971 recMdcTrack->
setPhi(phi);
1973 recMdcTrack->
setX(poca.x());
1974 recMdcTrack->
setY(poca.y());
1975 recMdcTrack->
setZ(poca.z());
1976 recMdcTrack->
setR(sqrt(poca.x()*poca.x() + poca.y()*poca.y()));
1992 map<int,int> clusterFitStat;
1994 int maxLayerId = -1;
1995 int minLayerId = 43;
1996 double fiTerm = 999.;
2000 vector<HoughHit*> hotList = trkIT->getHotList(2);
2001 for(vector<HoughHit*>::iterator hotIt = hotList.begin(); hotIt != hotList.end();hotIt++)
2105 clusterFitStat[clusterid] = stat;
2106 clusterRefVec.push_back(recCgemCluster);
2107 if(debug) cout<<
" cluster "<<clusterid<<
" kept! "<<endl;
2122 vector<RecMdcHit>* RecMdcHitVecPnt = trkIT->getRecMdcHitVec();
2123 int nMdcHits=RecMdcHitVecPnt->size();
2125 vector<RecMdcHit>::iterator iter_recMdcHit = RecMdcHitVecPnt->begin();
2126 for(; iter_recMdcHit!=RecMdcHitVecPnt->end(); iter_recMdcHit++)
2135 recMdcHit->
setId(hitId);
2138 hitList->push_back(recMdcHit);
2139 SmartRef<RecMdcHit> refHit(recMdcHit);
2140 hitRefVec.push_back(refHit);
2146 if(debug) cout<<
" hit at layer "<<layer<<
" wire "<<wire<<
" kept! "<<endl;
2147 if(layer>maxLayerId)
2153 if(layer<minLayerId)
2159 if(debug) cout<<
"track "<<trackId<<
", "<<nMdcHitsKept<<
"/"<<nMdcHits<<
" hits kept"<<endl;
2162 if (fiTermHot!=NULL){
2165 fiTerm = trkIT->flightArc(point)/trkIT->radius();
2167 if(fltLen>0) fiTerm=-fltLen*
sin(theta)/trkIT->radius();
2172 std::sort(clusterRefVec.begin(),clusterRefVec.end(),
sortCluster);
2174 trackList->push_back(recMdcTrack);
2177 return trackList->size();
2185 if(debug) cout<<
"N Rectrack: "<<trackVector.size()<<endl;
2186 sort(trackVector.begin(),trackVector.end(),
largerPt);
2188 for(vector<HoughTrack>::iterator trkIT = trackVector.begin();trkIT!=trackVector.end();trkIT++){
2189 if(debug) cout<<
"trk flag: "<<(trkIT)->getFlag()<<endl;
2190 if((trkIT)->getFlag() == 1)
continue;
2191 if((trkIT)->getFlag() == -1)
continue;
2192 if((trkIT)->getFlag() == -2)
continue;
2193 if(trkIT->getTrkRecoTrk()==NULL)
2195 if(debug) cout<<
"trk getTrkRecoTrk NULL!"<<endl;
2199 const TrkFit* fitresult = trkIT->getTrkRecoTrk()->fitResult();
2203 if(debug) cout<<
"no fit result!"<<endl;
2208 cout<<
"the following track will be saved: "<<endl;
2217 const TrkHitList* aList = trkIT->getTrkRecoTrk()->hits();
2219 const BField& theField = trkIT->getTrkRecoTrk()->bField();
2220 double Bz = theField.
bFieldZ();
2237 nHits = aList->
nHit();
2244 double chisq = fitresult->
chisq();
2245 int nDof = fitresult->
nDof();
2250 double fltLenPoca = 0.0;
2253 double phi0 = helix.
phi0();
2254 double tanDip = helix.
tanDip();
2256 double d0 = helix.
d0();
2267 helixPar[1] = tphi0;
2269 double pxy = fitresult->
pt();
2270 if (pxy == 0.) helixPar[2] = 9999.;
2271 else helixPar[2] =
q/fabs(pxy);
2272 if(pxy>9999.) helixPar[2] = 0.00001;
2274 helixPar[3] = helix.
z0();
2276 helixPar[4] = tanDip;
2279 HepSymMatrix mS(helix.
params().num_row(),0);
2282 mS[2][2]=-333.567/Bz;
2285 HepSymMatrix mVy = helix.
covariance().similarity(mS);
2286 double errorMat[15];
2288 for (
int ie = 0 ; ie < 5 ; ie ++){
2289 for (
int je = ie ; je < 5 ; je ++) {
2290 errorMat[k] = mVy[ie][je];
2295 px = pxy * (-
sin(helixPar[1]));
2296 py = pxy *
cos(helixPar[1]);
2297 pz = pxy * helixPar[4];
2298 p = sqrt(pxy*pxy + pz*pz);
2300 double theta = acos(pz/p);
2301 double phi = atan2(py,px);
2305 recMdcTrack->
setPxy(pxy);
2306 recMdcTrack->
setPx(px);
2307 recMdcTrack->
setPy(py);
2308 recMdcTrack->
setPz(pz);
2309 recMdcTrack->
setP(p);
2311 recMdcTrack->
setPhi(phi);
2313 recMdcTrack->
setX(poca.x());
2314 recMdcTrack->
setY(poca.y());
2315 recMdcTrack->
setZ(poca.z());
2316 recMdcTrack->
setR(sqrt(poca.x()*poca.x() + poca.y()*poca.y()));
2330 vector<int> vecHits;
2331 map<int,int> clusterFitStat;
2341 if(maxLayer < layerId)maxLayer = layerId;
2345 int maxLayerId = -1;
2346 int minLayerId = 43;
2347 double fiTerm = 999.;
2350 for (;hot!=aList->
end();hot++){
2355 if(!(recoHot->
isActive()))
continue;
2357 if(layerId>(maxLayer - m_removeNOuterHits))
continue;
2361 recMdcHit->
setId(hitId);
2373 double hotWireAmbig = recoHot->
wireAmbig();
2374 double driftDist = fabs(recoHot->
drift());
2375 double sigma = recoHot->
hitRms();
2376 double doca = fabs(recoHot->
dcaToWire());
2378 if ( hotWireAmbig == 1){
2381 }
else if( hotWireAmbig == -1){
2383 }
else if( hotWireAmbig == 0){
2398 double res=999.,rese=999.;
2399 if (recoHot->
resid(res,rese,
false)){
2413 double fltLen = recoHot->
fltLen();
2426 if (layerId >= maxLayerId){
2427 maxLayerId = layerId;
2428 fiTermHot = recoHot;
2430 if (layerId < minLayerId){
2431 minLayerId = layerId;
2443 hitList->push_back(recMdcHit);
2444 SmartRef<RecMdcHit> refHit(recMdcHit);
2445 hitRefVec.push_back(refHit);
2453 if(stat==0)
continue;
2455 clusterFitStat[clusterid] = stat;
2458 clusterRefVec.push_back(recCgemCluster);
2461 std::sort(clusterRefVec.begin(),clusterRefVec.end(),
sortCluster);
2463 if (fiTermHot!=NULL){
2464 fiTerm=(1./sqrt(1.+tanDip*tanDip))*fiTermHot->
fltLen()*helix.
omega();
2482 trackList->push_back(recMdcTrack);
2688return trackList->size();
2694 cout<<
"========== truth =========="<<endl;
2699 cout<<
"========== Digi =========="<<endl;
2700 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end();hitIt++)
2766int HoughFinder::searchCircle()
2770 cout<<
"***************************************"<<endl;
2771 cout<<
"start circle search : "<<endl;
2773 bool tryCgemLeftOnly=
false;
2779 m_roughRhoThetaMap.Reset();
2783 nXhitsLeft =
fillHistogram(m_XHoughHitList,&m_roughRhoThetaMap,charge,vote);
2785 cout<<
"------------------------------------------------------------------------------------ "<<endl;
2786 cout<<
"nXhitsLeft = "<<nXhitsLeft<<endl;
2790 if(!tryCgemLeftOnly) {
2792 tryCgemLeftOnly=
true;
2793 if(nCgemHitsLeft>=3) {
2794 if(m_debug) cout<<
"Now try CGEM left only"<<endl;
2802 double x_peak(0.), y_peak(0.);
2803 double x_weight(0.), y_weight(0.);
2804 getWeightedPeak(m_roughRhoThetaMap, x_peak, y_peak, x_weight, y_weight);
2805 if(m_debug) cout<<
"rough x_weight, y_weight = "<<x_weight<<
", "<<y_weight<<endl;
2811 double x_min=x_peak-0.5*m_ExtPeak_theta*
M_PI/m_nBinTheta;
2812 double x_max=x_peak+0.5*m_ExtPeak_theta*
M_PI/m_nBinTheta;
2813 double y_min=y_peak-0.5*m_ExtPeak_rho*0.2/m_nBinRho;
2814 double y_max=y_peak+0.5*m_ExtPeak_rho*0.2/m_nBinRho;
2817 int nFineBin_Theta = nFineBinTheta(y_peak);
2818 int nFineBin_Rho = nFineBinRho(y_peak);
2819 if(m_debug) cout<<
"nThetaFine, nRhoFine = "<<nFineBin_Theta<<
", "<<nFineBin_Rho<<endl;
2821 int trkFoundThisTry = 0;
2824 for(charge=-1; charge<2; charge+=2)
2827 if(m_debug) cout<<
"/******** Try iCharge = "<<charge<<
" **********/"<<endl;
2830 int trkID = m_houghTrackList.size();
2831 double binTheta(0.), binRho(0.);
2832 HoughTrack track(charge, x_peak, y_peak, binTheta, binRho, trkID);
2833 if(m_debug) cout<<
"center = "<<track.center()<<endl;
2835 m_fineRhoThetaMap.Reset();
2836 m_fineRhoThetaMap.SetBins(nFineBin_Theta,x_min,x_max,nFineBin_Rho,y_min,y_max);
2840 if(fabs(y_weight)<0.02)
2843 nHitFilled =
fillHistogram(m_XHoughHitList,&m_fineRhoThetaMap,0,vote);
2848 nHitFilled =
fillHistogram(m_XHoughHitList,&m_fineRhoThetaMap,charge,vote);
2851 if(m_debug) cout<<
"nHitFilled<3 -> continue"<<endl;
2855 double theta_peak, rho_peak, theta_weight, rho_weight;
2856 getWeightedPeak(m_fineRhoThetaMap, theta_peak, rho_peak, theta_weight, rho_weight);
2859 track.update(theta_weight,rho_weight);
2867 track.resetNhitHalf();
2869 if(fabs(y_weight)<0.02)
2871 track.findXHot(m_XHoughHitList,0);
2873 if(track.getNhitUnusedFirstHalf()<track.getNhitUnusedSecondHalf())
2875 if(m_debug) cout<<
"--- the second half has more hits, try next charge: "<<endl;
2883 if(m_debug) cout<<
" --- the first half has more hits, go ahead: "<<endl;
2886 nXsel = track.findXHot(m_XHoughHitList, charge);
2888 NHitTried = track.getNTried();
2889 if(m_debug) cout<<
"sel "<<nXsel<<
" hits, "<<NHitTried<<
" new hits tried"<<endl;
2898 int fitFlag_circle = 0;
2907 fitFlag_circle = track.fitCircle(&myDotsHelixFitter,m_bunchT0*1e9);
2909 if(fitFlag_circle==0)
2911 HepVector a_circle_fit = myDotsHelixFitter.
getHelix();
2912 track.updateCirclePar(a_circle_fit[0], a_circle_fit[1], a_circle_fit[2]);
2914 int nXsel_new = track.findXHot(m_XHoughHitList, charge);
2916 cout<<
" sel "<<nXsel_new<<
" hits after fitCircle"<<endl;
2919 NHitTried = track.getNTried();
2930 if(track.isAGoodCircle())
2932 track.markUsedHot(1);
2934 m_houghTrackList.push_back(track);
2935 if(m_debug) cout<<
"save this circle trk"<<endl;
2950 if(m_debug) cout<<
"drop this circle trk"<<endl;
2952 track.markUsedHot(-1);
2958 if(m_debug) cout<<
"no new hits tried in this try"<<endl;
2959 if(!tryCgemLeftOnly) {
2961 tryCgemLeftOnly=
true;
2962 if(m_debug) cout<<
"check nCgemHitsLeft="<<nCgemHitsLeft<<endl;
2963 if(nCgemHitsLeft>=3) {
2968 if(m_debug) cout<<
"stop circle trk finding "<<endl;
2977void HoughFinder::getWeightedPeak(TH2D& h,
double& x_peak,
double& y_peak,
double& x_weight,
double& y_weight,
int x_ext,
int y_ext)
2979 int ix_max, iy_max, iz_max;
2980 h.GetMaximumBin(ix_max, iy_max, iz_max);
2981 int nx=h.GetXaxis()->GetNbins();
2982 int ny=h.GetYaxis()->GetNbins();
2985 if(ix_max==0&&iy_max==0) {
2987 for(
int i=0; i<nx; i++)
2990 for(
int j=0; j<ny; j++)
2992 double n_tmp = h.GetBinContent(i,j);
2998 x_peak=h.GetXaxis()->GetBinCenter(ix_max);
2999 y_peak=h.GetYaxis()->GetBinCenter(iy_max);
3000 x_weight=0.; y_weight=0.;
3002 if(x_ext>=0&&y_ext>=0) {
3003 for(
int i1=ix_max-x_ext; i1<=ix_max+x_ext; i1++)
3005 double x_tmp = h.GetXaxis()->GetBinCenter(i1);
3010 for(
int i2=iy_max-y_ext; i2<=iy_max+y_ext; i2++)
3012 double n_tmp = h.GetBinContent(i1_tmp,i2);
3013 if(i2<1||i2>ny) n_tmp=0.;
3014 if(i1<1||i1>nx) n_tmp=0.;
3016 double y_tmp = h.GetYaxis()->GetBinCenter(i2);
3017 x_weight+=x_tmp*n_tmp;
3018 y_weight+=y_tmp*n_tmp;
3022 x_weight=x_weight/
weight;
3023 y_weight=y_weight/
weight;
3032int HoughFinder::nFineBinTheta(
double rho)
3034 double rho_rough = fabs(rho);
3035 double k_theta = (600.-1200.)/0.0335;
3036 int nThetaFine = int(k_theta*rho_rough+1200);
3037 if(nThetaFine<500) nThetaFine=500;
3040 nThetaFine=ceil(1.0*nThetaFine/m_nBinTheta*m_ExtPeak_theta);
3044int HoughFinder::nFineBinRho(
double rho)
3046 double rho_rough = fabs(rho);
3048 if(rho_rough<0.0198)
3050 double k1_rho = (850.-1200.)/0.0198;
3051 nRhoFine=int(k1_rho*rho_rough+1200);
3053 else if(rho_rough<0.03)
3055 double k2_rho = (300.-850.)/(0.03-0.0198);
3056 nRhoFine=int(k2_rho*(rho_rough-0.0198)+850.);
3060 double k3_rho = (100.-300.)/(0.056-0.03);
3061 nRhoFine=int(k3_rho*(rho_rough-0.03)+300.);
3062 if(nRhoFine<50) nRhoFine=50;
3065 nRhoFine=ceil(1.0*nRhoFine/m_nBinRho*m_ExtPeak_rho);
3070void HoughFinder::XhitCutWindow(
double rho,
int ilayer,
double charge,
double& cut1,
double &cut2)
3073 if(rho>0.07) rho=0.07;
3074 TGraph* g_cut1, *g_cut2;
3079 else if(ilayer<=19) {
3083 else if(ilayer<=42) {
3088 cut1=g_cut1->Eval(rho);
3089 cut2=g_cut2->Eval(rho);
3096 double cut=max(fabs(cut1),fabs(cut2));
3114 trackVector.clear();
3120 vector<MdcHit*>::iterator imdcHit = m_mdcHitCol.begin();
3121 for(;imdcHit != m_mdcHitCol.end();imdcHit++){
3125 for(vector<HoughTrack>::iterator trkIT = m_houghTrackList.begin();trkIT!=m_houghTrackList.end();trkIT++){
3126 trkIT->clearMemory();
3136 vector<HoughHit*>::iterator
iter = hitPntList.begin();
3137 for(;
iter!=hitPntList.end();
iter++)
3141 int useOld = (*iter)->getUse();
3142 int iLayer = (*iter)->getLayer();
3144 if(useOld==-1||useOld==0) {
3150 if(useOld==0) (*iter)->setUse(-1);
3159 vector<HoughHit*>::iterator itHit = hitList.begin();
3160 for(; itHit!=hitList.end(); itHit++)
3164 vector<int> trkIdList = (*itHit)->getTrkID();
3165 int nTrkSharing = trkIdList.size();
3170 int trkId_minDelD=-1;
3171 double minResid = 99.0;
3173 vector<double> vecRes = (*itHit)->getVecResid();
3174 int nTrk = vecRes.size();
3176 for(
int i=0; i<nTrk; i++)
3179 if(minResid>fabs(vecRes[i])) {
3180 minResid=fabs(vecRes[i]);
3181 trkId_minDelD=trkIdList[i];
3186 for(
int i=0; i<nTrk; i++)
3188 if(trkIdList[i]!=trkId_minDelD) {
3189 (*itHit)->dropTrkID(trkIdList[i]);
3190 vector<HoughTrack>::iterator itTrk =
getHoughTrkIt(m_houghTrackList,trkIdList[i]);
3191 if(itTrk!=m_houghTrackList.end()) itTrk->dropHitPnt(&(*(*itHit)));
3194 trkIdList = (*itHit)->getTrkID();
3195 nTrkSharing = trkIdList.size();
3204 vector<HoughTrack>::iterator it = houghTrkList.begin();
3205 for(; it!=houghTrkList.end(); it++)
3207 if(it->getTrkID()==trkId)
break;
3213int HoughFinder::associateVHits()
3220 cout<<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
3221 cout<<
" start V hits association: "<<endl;
3224 for(vector<HoughTrack>::iterator trkIT = m_houghTrackList.begin(); trkIT!=m_houghTrackList.end(); trkIT++)
3229 if(trkIT->getFlag()!=0)
continue;
3231 m_roughTanlDzMap.Reset();
3234 nXVhit =
fillHistogram(m_VHoughHitList,&m_roughTanlDzMap,0,vote,&(*trkIT));
3236 cout<<nXVhit<<
" nXVhits filled in the sz Hough map"<<endl;
3243 double x_peak(0.), y_peak(0.);
3244 double x_weight(0.), y_weight(0.);
3245 getWeightedPeak(m_roughTanlDzMap, x_peak, y_peak, x_weight, y_weight);
3259 trkIT->setTanl(x_weight);
3260 trkIT->setDz(y_weight);
3261 trkIT->updateHelix();
3263 int charge = trkIT->getCharge();
3391 int helixFitFlag(0);
3395 for(
int j=0; j<2; j++)
3397 double cutFactor=1.0;
3398 if(nXVhit<4) cutFactor=3;
3399 int nHot = trkIT->findVHot(m_VHoughHitListOnSZmap,charge,l,cutFactor);
3400 trkIT->dropRedundentCgemVHits();
3401 helixFitFlag = trkIT->fitHelix(&myDotsHelixFitter,m_bunchT0*1e9,m_recCgemClusterColBegin);
3404 trkIT->updateHelix();
3416 trkIT->setFlag(helixFitFlag);
3422 trkIT->setRecMdcHitVec(aRecMdcHitVec);
3445void HoughFinder::findMcTrack(
HoughTrack* track)
3447 TH1I trkID(
"track index",
"",100,0,100);
3448 vector<HoughHit*> hotList = track->
getHotList();
3449 for(vector<HoughHit*>::iterator hotIt = hotList.begin(); hotIt != hotList.end(); hotIt++){
3450 if((*hotIt)->getPairHit()!=NULL)trkID.Fill(((*hotIt)->getPairHit()->getTrkID())[0]);
3452 int trkid = trkID.GetMaximumBin()-1;
3453 for(vector<HoughTrack>::iterator trkIter = m_mcTrackCol.begin();trkIter!=m_mcTrackCol.end();trkIter++){
3454 if(trkIter->getTrkID()==trkid){
3455 if(m_run<0&&m_mcTruth)track->
setMcTrack(&(*trkIter));
3461int HoughFinder::nFineBinTanl(
double tanl)
3465int HoughFinder::nFineBinDz(
double tanl)
3469void HoughFinder::XVhitCutWindow(
double tanl,
int ilayer,
double charge,
double& cut1,
double &cut2)
3475 MsgStream log(
msgSvc(), name());
3477 NTuplePtr nt1(
ntupleSvc(),
"mdcHoughFinder/hit");
3481 ntuple_hit=
ntupleSvc()->book(
"mdcHoughFinder/hit", CLID_ColumnWiseTuple,
"hit");
3483 ntuple_hit->addItem(
"hit_run", m_hit_run);
3484 ntuple_hit->addItem(
"hit_event", m_hit_event);
3486 ntuple_hit->addItem(
"hit_nhit", m_hit_nhit, 0, 10000);
3487 ntuple_hit->addItem(
"hit_hitID", m_hit_nhit, m_hit_hitID);
3488 ntuple_hit->addItem(
"hit_hitType", m_hit_nhit, m_hit_hitType);
3489 ntuple_hit->addItem(
"hit_layer", m_hit_nhit, m_hit_layer);
3490 ntuple_hit->addItem(
"hit_wire", m_hit_nhit, m_hit_wire);
3491 ntuple_hit->addItem(
"hit_flag", m_hit_nhit, m_hit_flag);
3492 ntuple_hit->addItem(
"hit_halfCircle", m_hit_nhit, m_hit_halfCircle);
3493 ntuple_hit->addItem(
"hit_x", m_hit_nhit, m_hit_x);
3494 ntuple_hit->addItem(
"hit_y", m_hit_nhit, m_hit_y);
3495 ntuple_hit->addItem(
"hit_z", m_hit_nhit, m_hit_z);
3496 ntuple_hit->addItem(
"hit_drift", m_hit_nhit, m_hit_drift);
3498 ntuple_hit->addItem(
"mcHit_hitID", m_hit_nhit, m_mcHit_hitID);
3499 ntuple_hit->addItem(
"mcHit_hitType", m_hit_nhit, m_mcHit_hitType);
3500 ntuple_hit->addItem(
"mcHit_layer", m_hit_nhit, m_mcHit_layer);
3501 ntuple_hit->addItem(
"mcHit_wire", m_hit_nhit, m_mcHit_wire);
3502 ntuple_hit->addItem(
"mcHit_flag", m_hit_nhit, m_mcHit_flag);
3503 ntuple_hit->addItem(
"mcHit_halfCircle", m_hit_nhit, m_mcHit_halfCircle);
3504 ntuple_hit->addItem(
"mcHit_x", m_hit_nhit, m_mcHit_x);
3505 ntuple_hit->addItem(
"mcHit_y", m_hit_nhit, m_mcHit_y);
3506 ntuple_hit->addItem(
"mcHit_z", m_hit_nhit, m_mcHit_z);
3507 ntuple_hit->addItem(
"mcHit_drift", m_hit_nhit, m_mcHit_drift);
3508 }
else { log << MSG::ERROR <<
"Cannot book tuple mdcHoughFinder/hit" <<endmsg;
3509 return StatusCode::FAILURE;
3513 NTuplePtr nt2(
ntupleSvc(),
"mdcHoughFinder/track");
3517 ntuple_track =
ntupleSvc()->book(
"mdcHoughFinder/track", CLID_ColumnWiseTuple,
"track");
3519 ntuple_track->addItem(
"trk_run", m_trk_run);
3520 ntuple_track->addItem(
"trk_event", m_trk_event);
3521 ntuple_track->addItem(
"trk_nTrack", m_trk_nTrack);
3522 ntuple_track->addItem(
"trk_trackID", m_trk_trackID);
3523 ntuple_track->addItem(
"trk_charge", m_trk_charge);
3524 ntuple_track->addItem(
"trk_flag", m_trk_flag);
3525 ntuple_track->addItem(
"trk_angle", m_trk_angle);
3526 ntuple_track->addItem(
"trk_rho", m_trk_rho);
3527 ntuple_track->addItem(
"trk_dAngle", m_trk_dAngle);
3528 ntuple_track->addItem(
"trk_dRho", m_trk_dRho);
3529 ntuple_track->addItem(
"trk_dTanl", m_trk_dTanl);
3530 ntuple_track->addItem(
"trk_dDz", m_trk_dDz);
3531 ntuple_track->addItem(
"trk_Xc", m_trk_Xc);
3532 ntuple_track->addItem(
"trk_Yc", m_trk_Yc);
3533 ntuple_track->addItem(
"trk_R", m_trk_R);
3534 ntuple_track->addItem(
"trk_dr", m_trk_dr);
3535 ntuple_track->addItem(
"trk_phi0", m_trk_phi0);
3536 ntuple_track->addItem(
"trk_kappa", m_trk_kappa);
3537 ntuple_track->addItem(
"trk_dz", m_trk_dz);
3538 ntuple_track->addItem(
"trk_tanl", m_trk_tanl);
3539 ntuple_track->addItem(
"trk_pxy", m_trk_pxy);
3540 ntuple_track->addItem(
"trk_px", m_trk_px);
3541 ntuple_track->addItem(
"trk_py", m_trk_py);
3542 ntuple_track->addItem(
"trk_pz", m_trk_pz);
3543 ntuple_track->addItem(
"trk_p", m_trk_p);
3544 ntuple_track->addItem(
"trk_phi", m_trk_phi);
3545 ntuple_track->addItem(
"trk_theta", m_trk_theta);
3546 ntuple_track->addItem(
"trk_cosTheta", m_trk_cosTheta);
3547 ntuple_track->addItem(
"trk_vx", m_trk_vx);
3548 ntuple_track->addItem(
"trk_vy", m_trk_vy);
3549 ntuple_track->addItem(
"trk_vz", m_trk_vz);
3550 ntuple_track->addItem(
"trk_vr", m_trk_vr);
3551 ntuple_track->addItem(
"trk_chi2", m_trk_chi2);
3552 ntuple_track->addItem(
"trk_fiTerm", m_trk_fiTerm);
3553 ntuple_track->addItem(
"trk_nhit", m_trk_nhit);
3554 ntuple_track->addItem(
"trk_ncluster", m_trk_ncluster);
3555 ntuple_track->addItem(
"trk_stat", m_trk_stat);
3556 ntuple_track->addItem(
"trk_ndof", m_trk_ndof);
3557 ntuple_track->addItem(
"trk_nster", m_trk_nster);
3558 ntuple_track->addItem(
"trk_nlayer", m_trk_nlayer);
3559 ntuple_track->addItem(
"trk_firstLayer", m_trk_firstLayer);
3560 ntuple_track->addItem(
"trk_lastLayer", m_trk_lastLayer);
3561 ntuple_track->addItem(
"trk_nCgemXClusters", m_trk_nCgemXClusters);
3562 ntuple_track->addItem(
"trk_nCgemVClusters", m_trk_nCgemVClusters);
3564 ntuple_track->addItem(
"trk_nHot", m_trk_nHot, 0, 10000);
3565 ntuple_track->addItem(
"hot_hitID", m_trk_nHot, m_hot_hitID);
3566 ntuple_track->addItem(
"hot_hitType", m_trk_nHot, m_hot_hitType);
3567 ntuple_track->addItem(
"hot_layer", m_trk_nHot, m_hot_layer);
3568 ntuple_track->addItem(
"hot_wire", m_trk_nHot, m_hot_wire);
3569 ntuple_track->addItem(
"hot_flag", m_trk_nHot, m_hot_flag);
3570 ntuple_track->addItem(
"hot_halfCircle", m_trk_nHot, m_hot_halfCircle);
3571 ntuple_track->addItem(
"hot_x", m_trk_nHot, m_hot_x);
3572 ntuple_track->addItem(
"hot_y", m_trk_nHot, m_hot_y);
3573 ntuple_track->addItem(
"hot_z", m_trk_nHot, m_hot_z);
3574 ntuple_track->addItem(
"hot_drift", m_trk_nHot, m_hot_drift);
3575 ntuple_track->addItem(
"hot_residual", m_trk_nHot, m_hot_residual);
3577 ntuple_track->addItem(
"mcHot_hitID", m_trk_nHot, m_mcHot_hitID);
3578 ntuple_track->addItem(
"mcHot_hitType", m_trk_nHot, m_mcHot_hitType);
3579 ntuple_track->addItem(
"mcHot_layer", m_trk_nHot, m_mcHot_layer);
3580 ntuple_track->addItem(
"mcHot_wire", m_trk_nHot, m_mcHot_wire);
3581 ntuple_track->addItem(
"mcHot_flag", m_trk_nHot, m_mcHot_flag);
3582 ntuple_track->addItem(
"mcHot_halfCircle", m_trk_nHot, m_mcHot_halfCircle);
3583 ntuple_track->addItem(
"mcHot_x", m_trk_nHot, m_mcHot_x);
3584 ntuple_track->addItem(
"mcHot_y", m_trk_nHot, m_mcHot_y);
3585 ntuple_track->addItem(
"mcHot_z", m_trk_nHot, m_mcHot_z);
3586 ntuple_track->addItem(
"mcHot_drift", m_trk_nHot, m_mcHot_drift);
3588 ntuple_track->addItem(
"mcTrk_trackID", m_mcTrk_trackID);
3589 ntuple_track->addItem(
"mcTrk_charge", m_mcTrk_charge);
3590 ntuple_track->addItem(
"mcTrk_flag", m_mcTrk_flag);
3591 ntuple_track->addItem(
"mcTrk_angle", m_mcTrk_angle);
3592 ntuple_track->addItem(
"mcTrk_rho", m_mcTrk_rho);
3593 ntuple_track->addItem(
"mcTrk_dAngle", m_mcTrk_dAngle);
3594 ntuple_track->addItem(
"mcTrk_dRho", m_mcTrk_dRho);
3595 ntuple_track->addItem(
"mcTrk_dTanl", m_mcTrk_dTanl);
3596 ntuple_track->addItem(
"mcTrk_dDz", m_mcTrk_dDz);
3597 ntuple_track->addItem(
"mcTrk_Xc", m_mcTrk_Xc);
3598 ntuple_track->addItem(
"mcTrk_Yc", m_mcTrk_Yc);
3599 ntuple_track->addItem(
"mcTrk_R", m_mcTrk_R);
3600 ntuple_track->addItem(
"mcTrk_dr", m_mcTrk_dr);
3601 ntuple_track->addItem(
"mcTrk_phi0", m_mcTrk_phi0);
3602 ntuple_track->addItem(
"mcTrk_kappa", m_mcTrk_kappa);
3603 ntuple_track->addItem(
"mcTrk_dz", m_mcTrk_dz);
3604 ntuple_track->addItem(
"mcTrk_tanl", m_mcTrk_tanl);
3605 ntuple_track->addItem(
"mcTrk_pxy", m_mcTrk_pxy);
3606 ntuple_track->addItem(
"mcTrk_px", m_mcTrk_px);
3607 ntuple_track->addItem(
"mcTrk_py", m_mcTrk_py);
3608 ntuple_track->addItem(
"mcTrk_pz", m_mcTrk_pz);
3609 ntuple_track->addItem(
"mcTrk_p", m_mcTrk_p);
3610 ntuple_track->addItem(
"mcTrk_phi", m_mcTrk_phi);
3611 ntuple_track->addItem(
"mcTrk_theta", m_mcTrk_theta);
3612 ntuple_track->addItem(
"mcTrk_cosTheta", m_mcTrk_cosTheta);
3613 ntuple_track->addItem(
"mcTrk_vx", m_mcTrk_vx);
3614 ntuple_track->addItem(
"mcTrk_vy", m_mcTrk_vy);
3615 ntuple_track->addItem(
"mcTrk_vz", m_mcTrk_vz);
3616 ntuple_track->addItem(
"mcTrk_vr", m_mcTrk_vr);
3617 ntuple_track->addItem(
"mcTrk_chi2", m_mcTrk_chi2);
3618 ntuple_track->addItem(
"mcTrk_fiTerm", m_mcTrk_fiTerm);
3619 ntuple_track->addItem(
"mcTrk_nhit", m_mcTrk_nhit);
3620 ntuple_track->addItem(
"mcTrk_ncluster", m_mcTrk_ncluster);
3621 ntuple_track->addItem(
"mcTrk_stat", m_mcTrk_stat);
3622 ntuple_track->addItem(
"mcTrk_ndof", m_mcTrk_ndof);
3623 ntuple_track->addItem(
"mcTrk_nster", m_mcTrk_nster);
3624 ntuple_track->addItem(
"mcTrk_nlayer", m_mcTrk_nlayer);
3625 ntuple_track->addItem(
"mcTrk_firstLayer", m_mcTrk_firstLayer);
3626 ntuple_track->addItem(
"mcTrk_lastLayer", m_mcTrk_lastLayer);
3627 ntuple_track->addItem(
"mcTrk_nCgemXClusters", m_mcTrk_nCgemXClusters);
3628 ntuple_track->addItem(
"mcTrk_nCgemVClusters", m_mcTrk_nCgemVClusters);
3630 ntuple_track->addItem(
"mcTrk_nHot", m_mcTrk_nHot, 0, 10000);
3631 ntuple_track->addItem(
"mcTrkHot_hitID", m_mcTrk_nHot, m_mcTrkHot_hitID);
3632 ntuple_track->addItem(
"mcTrkHot_hitType", m_mcTrk_nHot, m_mcTrkHot_hitType);
3633 ntuple_track->addItem(
"mcTrkHot_layer", m_mcTrk_nHot, m_mcTrkHot_layer);
3634 ntuple_track->addItem(
"mcTrkHot_wire", m_mcTrk_nHot, m_mcTrkHot_wire);
3635 ntuple_track->addItem(
"mcTrkHot_flag", m_mcTrk_nHot, m_mcTrkHot_flag);
3636 ntuple_track->addItem(
"mcTrkHot_halfCircle", m_mcTrk_nHot, m_mcTrkHot_halfCircle);
3637 ntuple_track->addItem(
"mcTrkHot_x", m_mcTrk_nHot, m_mcTrkHot_x);
3638 ntuple_track->addItem(
"mcTrkHot_y", m_mcTrk_nHot, m_mcTrkHot_y);
3639 ntuple_track->addItem(
"mcTrkHot_z", m_mcTrk_nHot, m_mcTrkHot_z);
3640 ntuple_track->addItem(
"mcTrkHot_drift", m_mcTrk_nHot, m_mcTrkHot_drift);
3642 log << MSG::ERROR <<
"Cannot book tuple mdcHoughFinder/track" <<endmsg;
3643 return StatusCode::FAILURE;
3647 NTuplePtr nt3(
ntupleSvc(),
"mdcHoughFinder/event");
3651 ntuple_event =
ntupleSvc()->book(
"mdcHoughFinder/event", CLID_ColumnWiseTuple,
"event");
3653 ntuple_event->addItem(
"evt_run", m_evt_run);
3654 ntuple_event->addItem(
"evt_event", m_evt_event);
3655 ntuple_event->addItem(
"evt_nXCluster", m_evt_nXCluster);
3656 ntuple_event->addItem(
"evt_nVCluster", m_evt_nVCluster);
3657 ntuple_event->addItem(
"evt_nXVCluster", m_evt_nXVCluster);
3658 ntuple_event->addItem(
"evt_nCgemCluster", m_evt_nCGEMCluster);
3659 ntuple_event->addItem(
"evt_nAxialHit", m_evt_nAxialHit);
3660 ntuple_event->addItem(
"evt_nStereoHit", m_evt_nStereoHit);
3661 ntuple_event->addItem(
"evt_nODCHit", m_evt_nODCHit);
3662 ntuple_event->addItem(
"evt_nHit", m_evt_nHit);
3664 ntuple_event->addItem(
"evt_nTrack", m_evt_nTrack, 0, 100);
3665 ntuple_event->addItem(
"evtTrk_trackID", m_evt_nTrack, m_evtTrk_trackID);
3666 ntuple_event->addItem(
"evtTrk_charge", m_evt_nTrack, m_evtTrk_charge);
3667 ntuple_event->addItem(
"evtTrk_flag", m_evt_nTrack, m_evtTrk_flag);
3668 ntuple_event->addItem(
"evtTrk_angle", m_evt_nTrack, m_evtTrk_angle);
3669 ntuple_event->addItem(
"evtTrk_rho", m_evt_nTrack, m_evtTrk_rho);
3670 ntuple_event->addItem(
"evtTrk_dAngle", m_evt_nTrack, m_evtTrk_dAngle);
3671 ntuple_event->addItem(
"evtTrk_dRho", m_evt_nTrack, m_evtTrk_dRho);
3672 ntuple_event->addItem(
"evtTrk_dTanl", m_evt_nTrack, m_evtTrk_dTanl);
3673 ntuple_event->addItem(
"evtTrk_dDz", m_evt_nTrack, m_evtTrk_dDz);
3674 ntuple_event->addItem(
"evtTrk_Xc", m_evt_nTrack, m_evtTrk_Xc);
3675 ntuple_event->addItem(
"evtTrk_Yc", m_evt_nTrack, m_evtTrk_Yc);
3676 ntuple_event->addItem(
"evtTrk_R", m_evt_nTrack, m_evtTrk_R);
3677 ntuple_event->addItem(
"evtTrk_dr", m_evt_nTrack, m_evtTrk_dr);
3678 ntuple_event->addItem(
"evtTrk_phi0", m_evt_nTrack, m_evtTrk_phi0);
3679 ntuple_event->addItem(
"evtTrk_kappa", m_evt_nTrack, m_evtTrk_kappa);
3680 ntuple_event->addItem(
"evtTrk_dz", m_evt_nTrack, m_evtTrk_dz);
3681 ntuple_event->addItem(
"evtTrk_tanl", m_evt_nTrack, m_evtTrk_tanl);
3682 ntuple_event->addItem(
"evtTrk_pxy", m_evt_nTrack, m_evtTrk_pxy);
3683 ntuple_event->addItem(
"evtTrk_px", m_evt_nTrack, m_evtTrk_px);
3684 ntuple_event->addItem(
"evtTrk_py", m_evt_nTrack, m_evtTrk_py);
3685 ntuple_event->addItem(
"evtTrk_pz", m_evt_nTrack, m_evtTrk_pz);
3686 ntuple_event->addItem(
"evtTrk_p", m_evt_nTrack, m_evtTrk_p);
3687 ntuple_event->addItem(
"evtTrk_phi", m_evt_nTrack, m_evtTrk_phi);
3688 ntuple_event->addItem(
"evtTrk_theta", m_evt_nTrack, m_evtTrk_theta);
3689 ntuple_event->addItem(
"evtTrk_cosTheta", m_evt_nTrack, m_evtTrk_cosTheta);
3690 ntuple_event->addItem(
"evtTrk_vx", m_evt_nTrack, m_evtTrk_vx);
3691 ntuple_event->addItem(
"evtTrk_vy", m_evt_nTrack, m_evtTrk_vy);
3692 ntuple_event->addItem(
"evtTrk_vz", m_evt_nTrack, m_evtTrk_vz);
3693 ntuple_event->addItem(
"evtTrk_vr", m_evt_nTrack, m_evtTrk_vr);
3694 ntuple_event->addItem(
"evtTrk_chi2", m_evt_nTrack, m_evtTrk_chi2);
3695 ntuple_event->addItem(
"evtTrk_fiTerm", m_evt_nTrack, m_evtTrk_fiTerm);
3696 ntuple_event->addItem(
"evtTrk_nhit", m_evt_nTrack, m_evtTrk_nhit);
3697 ntuple_event->addItem(
"evtTrk_ncluster", m_evt_nTrack, m_evtTrk_ncluster);
3698 ntuple_event->addItem(
"evtTrk_stat", m_evt_nTrack, m_evtTrk_stat);
3699 ntuple_event->addItem(
"evtTrk_ndof", m_evt_nTrack, m_evtTrk_ndof);
3700 ntuple_event->addItem(
"evtTrk_nster", m_evt_nTrack, m_evtTrk_nster);
3701 ntuple_event->addItem(
"evtTrk_nlayer", m_evt_nTrack, m_evtTrk_nlayer);
3702 ntuple_event->addItem(
"evtTrk_firstLayer", m_evt_nTrack, m_evtTrk_firstLayer);
3703 ntuple_event->addItem(
"evtTrk_lastLayer", m_evt_nTrack, m_evtTrk_lastLayer);
3704 ntuple_event->addItem(
"evtTrk_nCgemXClusters", m_evt_nTrack, m_evtTrk_nCgemXClusters);
3705 ntuple_event->addItem(
"evtTrk_nCgemVClusters", m_evt_nTrack, m_evtTrk_nCgemVClusters);
3707 ntuple_event->addItem(
"mcEvtTrk_trackID", m_evt_nTrack, m_mcEvtTrk_trackID);
3708 ntuple_event->addItem(
"mcEvtTrk_charge", m_evt_nTrack, m_mcEvtTrk_charge);
3709 ntuple_event->addItem(
"mcEvtTrk_flag", m_evt_nTrack, m_mcEvtTrk_flag);
3710 ntuple_event->addItem(
"mcEvtTrk_angle", m_evt_nTrack, m_mcEvtTrk_angle);
3711 ntuple_event->addItem(
"mcEvtTrk_rho", m_evt_nTrack, m_mcEvtTrk_rho);
3712 ntuple_event->addItem(
"mcEvtTrk_dAngle", m_evt_nTrack, m_mcEvtTrk_dAngle);
3713 ntuple_event->addItem(
"mcEvtTrk_dRho", m_evt_nTrack, m_mcEvtTrk_dRho);
3714 ntuple_event->addItem(
"mcEvtTrk_dTanl", m_evt_nTrack, m_mcEvtTrk_dTanl);
3715 ntuple_event->addItem(
"mcEvtTrk_dDz", m_evt_nTrack, m_mcEvtTrk_dDz);
3716 ntuple_event->addItem(
"mcEvtTrk_Xc", m_evt_nTrack, m_mcEvtTrk_Xc);
3717 ntuple_event->addItem(
"mcEvtTrk_Yc", m_evt_nTrack, m_mcEvtTrk_Yc);
3718 ntuple_event->addItem(
"mcEvtTrk_R", m_evt_nTrack, m_mcEvtTrk_R);
3719 ntuple_event->addItem(
"mcEvtTrk_dr", m_evt_nTrack, m_mcEvtTrk_dr);
3720 ntuple_event->addItem(
"mcEvtTrk_phi0", m_evt_nTrack, m_mcEvtTrk_phi0);
3721 ntuple_event->addItem(
"mcEvtTrk_kappa", m_evt_nTrack, m_mcEvtTrk_kappa);
3722 ntuple_event->addItem(
"mcEvtTrk_dz", m_evt_nTrack, m_mcEvtTrk_dz);
3723 ntuple_event->addItem(
"mcEvtTrk_tanl", m_evt_nTrack, m_mcEvtTrk_tanl);
3724 ntuple_event->addItem(
"mcEvtTrk_pxy", m_evt_nTrack, m_mcEvtTrk_pxy);
3725 ntuple_event->addItem(
"mcEvtTrk_px", m_evt_nTrack, m_mcEvtTrk_px);
3726 ntuple_event->addItem(
"mcEvtTrk_py", m_evt_nTrack, m_mcEvtTrk_py);
3727 ntuple_event->addItem(
"mcEvtTrk_pz", m_evt_nTrack, m_mcEvtTrk_pz);
3728 ntuple_event->addItem(
"mcEvtTrk_p", m_evt_nTrack, m_mcEvtTrk_p);
3729 ntuple_event->addItem(
"mcEvtTrk_phi", m_evt_nTrack, m_mcEvtTrk_phi);
3730 ntuple_event->addItem(
"mcEvtTrk_theta", m_evt_nTrack, m_mcEvtTrk_theta);
3731 ntuple_event->addItem(
"mcEvtTrk_cosTheta", m_evt_nTrack, m_mcEvtTrk_cosTheta);
3732 ntuple_event->addItem(
"mcEvtTrk_vx", m_evt_nTrack, m_mcEvtTrk_vx);
3733 ntuple_event->addItem(
"mcEvtTrk_vy", m_evt_nTrack, m_mcEvtTrk_vy);
3734 ntuple_event->addItem(
"mcEvtTrk_vz", m_evt_nTrack, m_mcEvtTrk_vz);
3735 ntuple_event->addItem(
"mcEvtTrk_vr", m_evt_nTrack, m_mcEvtTrk_vr);
3736 ntuple_event->addItem(
"mcEvtTrk_chi2", m_evt_nTrack, m_mcEvtTrk_chi2);
3737 ntuple_event->addItem(
"mcEvtTrk_fiTerm", m_evt_nTrack, m_mcEvtTrk_fiTerm);
3738 ntuple_event->addItem(
"mcEvtTrk_nhit", m_evt_nTrack, m_mcEvtTrk_nhit);
3739 ntuple_event->addItem(
"mcEvtTrk_ncluster", m_evt_nTrack, m_mcEvtTrk_ncluster);
3740 ntuple_event->addItem(
"mcEvtTrk_stat", m_evt_nTrack, m_mcEvtTrk_stat);
3741 ntuple_event->addItem(
"mcEvtTrk_ndof", m_evt_nTrack, m_mcEvtTrk_ndof);
3742 ntuple_event->addItem(
"mcEvtTrk_nster", m_evt_nTrack, m_mcEvtTrk_nster);
3743 ntuple_event->addItem(
"mcEvtTrk_nlayer", m_evt_nTrack, m_mcEvtTrk_nlayer);
3744 ntuple_event->addItem(
"mcEvtTrk_firstLayer", m_evt_nTrack, m_mcEvtTrk_firstLayer);
3745 ntuple_event->addItem(
"mcEvtTrk_lastLayer", m_evt_nTrack, m_mcEvtTrk_lastLayer);
3746 ntuple_event->addItem(
"mcEvtTrk_nCgemXClusters", m_evt_nTrack, m_mcEvtTrk_nCgemXClusters);
3747 ntuple_event->addItem(
"mcEvtTrk_nCgemVClusters", m_evt_nTrack, m_mcEvtTrk_nCgemVClusters);
3749 log << MSG::ERROR <<
"Cannot book tuple mdcHoughFinder/event" <<endmsg;
3750 return StatusCode::FAILURE;
3753 return StatusCode::SUCCESS;
3756int HoughFinder::dumpHit()
3759 m_hit_event = m_event;
3760 m_hit_nhit = m_houghHitList.size();
3762 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end(); hitIt++){
3763 m_hit_hitID[i] = hitIt->getHitID();
3764 m_hit_hitType[i] = hitIt->getHitType();
3765 m_hit_layer[i] = hitIt->getLayer();
3766 m_hit_wire[i] = hitIt->getWire();
3767 m_hit_flag[i] = hitIt->getFlag();
3768 m_hit_halfCircle[i] = hitIt->getHalfCircle();
3769 m_hit_x[i] = hitIt->getHitPosition().x();
3770 m_hit_y[i] = hitIt->getHitPosition().y();
3771 m_hit_z[i] = hitIt->getHitPosition().z();
3772 m_hit_drift[i] = hitIt->getDriftDist();
3774 if(hitIt->getPairHit()!=NULL){
3775 m_mcHit_hitID[i] = hitIt->getPairHit()->getHitID();
3776 m_mcHit_hitType[i] = hitIt->getPairHit()->getHitType();
3777 m_mcHit_layer[i] = hitIt->getPairHit()->getLayer();
3778 m_mcHit_wire[i] = hitIt->getPairHit()->getWire();
3779 m_mcHit_flag[i] = hitIt->getPairHit()->getFlag();
3780 m_mcHit_halfCircle[i] = hitIt->getPairHit()->getHalfCircle();
3781 m_mcHit_x[i] = hitIt->getPairHit()->getHitPosition().x();
3782 m_mcHit_y[i] = hitIt->getPairHit()->getHitPosition().y();
3783 m_mcHit_z[i] = hitIt->getPairHit()->getHitPosition().z();
3784 m_mcHit_drift[i] = hitIt->getPairHit()->getDriftDist();
3788 ntuple_hit->write();
3789 return m_houghHitList.size();
3792int HoughFinder::dumpHoughTrack()
3794 if(m_houghTrackList.size()==0)
return 0;
3796 m_trk_event = m_event;
3797 m_trk_nTrack = m_houghTrackList.size();
3798 HepPoint3D positionOntrack(999,999,999), positionOnDetector(999,999,999);
3799 for(vector<HoughTrack>::iterator trkIt = m_houghTrackList.begin(); trkIt != m_houghTrackList.end(); trkIt++){
3800 m_trk_trackID = trkIt->getTrkID();
3801 m_trk_charge = trkIt->getCharge();
3802 m_trk_flag = trkIt->getFlag();
3803 m_trk_angle = trkIt->getAngle();
3804 m_trk_rho = trkIt->getRho();
3805 m_trk_dAngle = trkIt->getDAngle();
3806 m_trk_dRho = trkIt->getDRho();
3807 m_trk_dTanl = trkIt->getDTanl();
3808 m_trk_dDz = trkIt->getDDz();
3809 m_trk_Xc = trkIt->center().x();
3810 m_trk_Yc = trkIt->center().y();
3811 m_trk_R = trkIt->radius();
3812 m_trk_dr = trkIt->dr();
3813 m_trk_phi0 = trkIt->phi0();
3814 m_trk_kappa = trkIt->kappa();
3815 m_trk_dz = trkIt->dz();
3816 m_trk_tanl = trkIt->tanl();
3817 m_trk_pxy = trkIt->pt();
3818 m_trk_px = trkIt->momentum(0).x();
3819 m_trk_py = trkIt->momentum(0).y();
3820 m_trk_pz = trkIt->momentum(0).z();
3821 m_trk_p = trkIt->momentum(0).mag();
3822 m_trk_phi = trkIt->direction(0).phi();
3823 m_trk_theta = trkIt->direction(0).theta();
3824 m_trk_cosTheta =
cos(trkIt->direction(0).theta());
3825 m_trk_vx = trkIt->x(0).x();
3826 m_trk_vy = trkIt->x(0).y();
3827 m_trk_vz = trkIt->x(0).z();
3828 m_trk_vr = trkIt->x(0).perp();
3829 m_trk_chi2 = trkIt->getChi2();
3843 vector<HoughHit*> hotList = trkIt->getHotList();
3844 m_trk_nHot = hotList.size();
3846 for(vector<HoughHit*>::iterator hotIt = hotList.begin(); hotIt != hotList.end(); hotIt++){
3847 m_hot_hitID[i] = (*hotIt)->getHitID();
3848 m_hot_hitType[i] = (*hotIt)->getHitType();
3849 m_hot_layer[i] = (*hotIt)->getLayer();
3850 m_hot_wire[i] = (*hotIt)->getWire();
3851 m_hot_flag[i] = (*hotIt)->getFlag();
3852 m_hot_halfCircle[i] = (*hotIt)->getHalfCircle();
3853 m_hot_x[i] = (*hotIt)->getHitPosition().x();
3854 m_hot_y[i] = (*hotIt)->getHitPosition().y();
3855 m_hot_z[i] = (*hotIt)->getHitPosition().z();
3856 m_hot_drift[i] = (*hotIt)->getDriftDist();
3857 m_hot_residual[i] = (*hotIt)->residual(&(*trkIt),positionOntrack, positionOnDetector);
3859 if((*hotIt)->getPairHit()!=NULL){
3860 m_mcHot_hitID[i] = (*hotIt)->getPairHit()->getHitID();
3861 m_mcHot_hitType[i] = (*hotIt)->getPairHit()->getHitType();
3862 m_mcHot_layer[i] = (*hotIt)->getPairHit()->getLayer();
3863 m_mcHot_wire[i] = (*hotIt)->getPairHit()->getWire();
3864 m_mcHot_flag[i] = (*hotIt)->getPairHit()->getFlag();
3865 m_mcHot_halfCircle[i] = (*hotIt)->getPairHit()->getHalfCircle();
3866 m_mcHot_x[i] = (*hotIt)->getPairHit()->getHitPosition().x();
3867 m_mcHot_y[i] = (*hotIt)->getPairHit()->getHitPosition().y();
3868 m_mcHot_z[i] = (*hotIt)->getPairHit()->getHitPosition().z();
3869 m_mcHot_drift[i] = (*hotIt)->getPairHit()->getDriftDist();
3874 if(trkIt->getMcTrack()!=NULL){
3875 m_mcTrk_trackID = trkIt->getMcTrack()->getTrkID();
3876 m_mcTrk_charge = trkIt->getMcTrack()->getCharge();
3877 m_mcTrk_flag = trkIt->getMcTrack()->getFlag();
3878 m_mcTrk_angle = trkIt->getMcTrack()->getAngle();
3879 m_mcTrk_rho = trkIt->getMcTrack()->getRho();
3880 m_mcTrk_dAngle = trkIt->getMcTrack()->getDAngle();
3881 m_mcTrk_dRho = trkIt->getMcTrack()->getDRho();
3882 m_mcTrk_dTanl = trkIt->getMcTrack()->getDTanl();
3883 m_mcTrk_dDz = trkIt->getMcTrack()->getDDz();
3884 m_mcTrk_Xc = trkIt->getMcTrack()->center().x();
3885 m_mcTrk_Yc = trkIt->getMcTrack()->center().y();
3886 m_mcTrk_R = trkIt->getMcTrack()->radius();
3887 m_mcTrk_dr = trkIt->getMcTrack()->dr();
3888 m_mcTrk_phi0 = trkIt->getMcTrack()->phi0();
3889 m_mcTrk_kappa = trkIt->getMcTrack()->kappa();
3890 m_mcTrk_dz = trkIt->getMcTrack()->dz();
3891 m_mcTrk_tanl = trkIt->getMcTrack()->tanl();
3892 m_mcTrk_pxy = trkIt->getMcTrack()->pt();
3893 m_mcTrk_px = trkIt->getMcTrack()->momentum(0).x();
3894 m_mcTrk_py = trkIt->getMcTrack()->momentum(0).y();
3895 m_mcTrk_pz = trkIt->getMcTrack()->momentum(0).z();
3896 m_mcTrk_p = trkIt->getMcTrack()->momentum(0).mag();
3897 m_mcTrk_phi = trkIt->getMcTrack()->direction(0).phi();
3898 m_mcTrk_theta = trkIt->getMcTrack()->direction(0).theta();
3899 m_mcTrk_cosTheta =
cos(trkIt->getMcTrack()->direction(0).theta());
3900 m_mcTrk_vx = trkIt->getMcTrack()->x(0).x();
3901 m_mcTrk_vy = trkIt->getMcTrack()->x(0).y();
3902 m_mcTrk_vz = trkIt->getMcTrack()->x(0).z();
3903 m_mcTrk_vr = trkIt->getMcTrack()->x(0).perp();
3917 vector<HoughHit*> mcHotList = trkIt->getMcTrack()->getHotList();
3918 m_mcTrk_nHot = mcHotList.size();
3920 for(vector<HoughHit*>::iterator mcHotIt = mcHotList.begin(); mcHotIt != mcHotList.end(); mcHotIt++){
3921 m_mcTrkHot_hitID[j] = (*mcHotIt)->getHitID();
3922 m_mcTrkHot_hitType[j] = (*mcHotIt)->getHitType();
3923 m_mcTrkHot_layer[j] = (*mcHotIt)->getLayer();
3924 m_mcTrkHot_wire[j] = (*mcHotIt)->getWire();
3925 m_mcTrkHot_flag[j] = (*mcHotIt)->getFlag();
3926 m_mcTrkHot_halfCircle[j] = (*mcHotIt)->getHalfCircle();
3927 m_mcTrkHot_x[j] = (*mcHotIt)->getHitPosition().x();
3928 m_mcTrkHot_y[j] = (*mcHotIt)->getHitPosition().y();
3929 m_mcTrkHot_z[j] = (*mcHotIt)->getHitPosition().z();
3930 m_mcTrkHot_drift[j] = (*mcHotIt)->getDriftDist();
3934 ntuple_track->write();
3936 return m_houghTrackList.size();
3939int HoughFinder::dumpHoughEvent()
3941 if(m_houghTrackList.size()==0)
return 0;
3943 m_evt_event = m_event;
3944 m_evt_nTrack = m_houghTrackList.size();
3946 for(vector<HoughTrack>::iterator trkIt = m_houghTrackList.begin(); trkIt != m_houghTrackList.end(); trkIt++){
3948 m_evtTrk_trackID[i] = trkIt->getTrkID();
3949 m_evtTrk_charge[i] = trkIt->getCharge();
3950 m_evtTrk_flag[i] = trkIt->getFlag();
3951 m_evtTrk_angle[i] = trkIt->getAngle();
3952 m_evtTrk_rho[i] = trkIt->getRho();
3953 m_evtTrk_dAngle[i] = trkIt->getDAngle();
3954 m_evtTrk_dRho[i] = trkIt->getDRho();
3955 m_evtTrk_dTanl[i] = trkIt->getDTanl();
3956 m_evtTrk_dDz[i] = trkIt->getDDz();
3957 m_evtTrk_Xc[i] = trkIt->center().x();
3958 m_evtTrk_Yc[i] = trkIt->center().y();
3959 m_evtTrk_R[i] = trkIt->radius();
3960 m_evtTrk_dr[i] = trkIt->dr();
3961 m_evtTrk_phi0[i] = trkIt->phi0();
3962 m_evtTrk_kappa[i] = trkIt->kappa();
3963 m_evtTrk_dz[i] = trkIt->dz();
3964 m_evtTrk_tanl[i] = trkIt->tanl();
3965 m_evtTrk_pxy[i] = trkIt->pt();
3966 m_evtTrk_px[i] = trkIt->momentum(0).x();
3967 m_evtTrk_py[i] = trkIt->momentum(0).y();
3968 m_evtTrk_pz[i] = trkIt->momentum(0).z();
3969 m_evtTrk_p[i] = trkIt->momentum(0).mag();
3970 m_evtTrk_phi[i] = trkIt->direction(0).phi();
3971 m_evtTrk_theta[i] = trkIt->direction(0).theta();
3972 m_evtTrk_cosTheta[i] =
cos(trkIt->direction(0).theta());
3973 m_evtTrk_vx[i] = trkIt->x(0).x();
3974 m_evtTrk_vy[i] = trkIt->x(0).y();
3975 m_evtTrk_vz[i] = trkIt->x(0).z();
3976 m_evtTrk_vr[i] = trkIt->x(0).perp();
3990 if(trkIt->getMcTrack()!=NULL){
3991 m_mcEvtTrk_trackID[i] = trkIt->getMcTrack()->getTrkID();
3992 m_mcEvtTrk_charge[i] = trkIt->getMcTrack()->getCharge();
3993 m_mcEvtTrk_flag[i] = trkIt->getMcTrack()->getFlag();
3994 m_mcEvtTrk_angle[i] = trkIt->getMcTrack()->getAngle();
3995 m_mcEvtTrk_rho[i] = trkIt->getMcTrack()->getRho();
3996 m_mcEvtTrk_dAngle[i] = trkIt->getMcTrack()->getDAngle();
3997 m_mcEvtTrk_dRho[i] = trkIt->getMcTrack()->getDRho();
3998 m_mcEvtTrk_dTanl[i] = trkIt->getMcTrack()->getDTanl();
3999 m_mcEvtTrk_dDz[i] = trkIt->getMcTrack()->getDDz();
4000 m_mcEvtTrk_Xc[i] = trkIt->getMcTrack()->center().x();
4001 m_mcEvtTrk_Yc[i] = trkIt->getMcTrack()->center().y();
4002 m_mcEvtTrk_R[i] = trkIt->getMcTrack()->radius();
4003 m_mcEvtTrk_dr[i] = trkIt->getMcTrack()->dr();
4004 m_mcEvtTrk_phi0[i] = trkIt->getMcTrack()->phi0();
4005 m_mcEvtTrk_kappa[i] = trkIt->getMcTrack()->kappa();
4006 m_mcEvtTrk_dz[i] = trkIt->getMcTrack()->dz();
4007 m_mcEvtTrk_tanl[i] = trkIt->getMcTrack()->tanl();
4008 m_mcEvtTrk_pxy[i] = trkIt->getMcTrack()->pt();
4009 m_mcEvtTrk_px[i] = trkIt->getMcTrack()->momentum(0).x();
4010 m_mcEvtTrk_py[i] = trkIt->getMcTrack()->momentum(0).y();
4011 m_mcEvtTrk_pz[i] = trkIt->getMcTrack()->momentum(0).z();
4012 m_mcEvtTrk_p[i] = trkIt->getMcTrack()->momentum(0).mag();
4013 m_mcEvtTrk_phi[i] = trkIt->getMcTrack()->direction(0).phi();
4014 m_mcEvtTrk_theta[i] = trkIt->getMcTrack()->direction(0).theta();
4015 m_mcEvtTrk_cosTheta[i] =
cos(trkIt->getMcTrack()->direction(0).theta());
4016 m_mcEvtTrk_vx[i] = trkIt->getMcTrack()->x(0).x();
4017 m_mcEvtTrk_vy[i] = trkIt->getMcTrack()->x(0).y();
4018 m_mcEvtTrk_vz[i] = trkIt->getMcTrack()->x(0).z();
4019 m_mcEvtTrk_vr[i] = trkIt->getMcTrack()->x(0).perp();
4035 ntuple_event->write();
4036 return m_houghTrackList.size();
4039int HoughFinder::dumpTdsTrack()
4041 SmartDataPtr<RecMdcTrackCol> recMdcTrackCol(eventSvc(),
"/Event/Recon/RecMdcTrackCol");
4042 if(!recMdcTrackCol)
return 0;
4044 m_evt_event = m_event;
4045 m_evt_nTrack = recMdcTrackCol->size();
4046 for(RecMdcTrackCol::iterator
iter = recMdcTrackCol->begin();
iter!=recMdcTrackCol->end();
iter++){
4047 m_trk_trackID = (*iter)->trackId() ;
4048 m_trk_charge = (*iter)->charge() ;
4059 m_trk_dr = (*iter)->helix(0) ;
4060 m_trk_phi0 = (*iter)->helix(1) ;
4061 m_trk_kappa = (*iter)->helix(2) ;
4062 m_trk_dz = (*iter)->helix(3) ;
4063 m_trk_tanl = (*iter)->helix(4) ;
4064 m_trk_pxy = (*iter)->pxy() ;
4065 m_trk_px = (*iter)->px() ;
4066 m_trk_py = (*iter)->py() ;
4067 m_trk_pz = (*iter)->pz() ;
4068 m_trk_p = (*iter)->p() ;
4069 m_trk_phi = (*iter)->theta() ;
4070 m_trk_theta = (*iter)->phi() ;
4071 m_trk_cosTheta =
cos((*iter)->theta()) ;
4072 m_trk_vx = (*iter)->x() ;
4073 m_trk_vy = (*iter)->y() ;
4074 m_trk_vz = (*iter)->z() ;
4075 m_trk_vr = (*iter)->r() ;
4076 m_trk_chi2 = (*iter)->chi2() ;
4077 m_trk_fiTerm = (*iter)->getFiTerm() ;
4078 m_trk_nhit = (*iter)->getNhits() ;
4079 m_trk_ncluster = (*iter)->getNcluster() ;
4080 m_trk_stat = (*iter)->stat() ;
4081 m_trk_ndof = (*iter)->ndof() ;
4082 m_trk_nster = (*iter)->nster() ;
4083 m_trk_nlayer = (*iter)->nlayer() ;
4084 m_trk_firstLayer = (*iter)->firstLayer() ;
4085 m_trk_lastLayer = (*iter)->lastLayer() ;
4086 m_trk_nCgemXClusters = (*iter)->nCgemXCluster();
4087 m_trk_nCgemVClusters = (*iter)->nCgemVCluster();
4089 HitRefVec hitRefVec = (*iter)->getVecHits();
4090 HitRefVec::iterator hotIt = hitRefVec.begin();
4092 ClusterRefVec::iterator clusterIt = clusterRefVec.begin();
4093 m_trk_nHot = clusterRefVec.size() + hitRefVec.size();
4095 for(clusterIt=clusterRefVec.begin();clusterIt!=clusterRefVec.end();clusterIt++){
4096 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end(); hitIt++){
4098 if((*clusterIt)->getclusterid()==(hitIt)->getCgemCluster()->getclusterid()){
4099 m_hot_hitID[i] = (hitIt)->getHitID();
4100 m_hot_hitType[i] = (hitIt)->getHitType();
4101 m_hot_layer[i] = (hitIt)->getLayer();
4102 m_hot_wire[i] = (hitIt)->getWire();
4103 m_hot_flag[i] = (hitIt)->getFlag();
4104 m_hot_halfCircle[i] = (hitIt)->getHalfCircle();
4105 m_hot_x[i] = (hitIt)->getHitPosition().x();
4106 m_hot_y[i] = (hitIt)->getHitPosition().y();
4107 m_hot_z[i] = (hitIt)->getHitPosition().z();
4108 m_hot_drift[i] = (hitIt)->getDriftDist();
4109 m_hot_residual[i] = -999;
4111 if((hitIt)->getPairHit()!=NULL){
4112 m_mcHot_hitID[i] = (hitIt)->getPairHit()->getHitID();
4113 m_mcHot_hitType[i] = (hitIt)->getPairHit()->getHitType();
4114 m_mcHot_layer[i] = (hitIt)->getPairHit()->getLayer();
4115 m_mcHot_wire[i] = (hitIt)->getPairHit()->getWire();
4116 m_mcHot_flag[i] = (hitIt)->getPairHit()->getFlag();
4117 m_mcHot_halfCircle[i] = (hitIt)->getPairHit()->getHalfCircle();
4118 m_mcHot_x[i] = (hitIt)->getPairHit()->getHitPosition().x();
4119 m_mcHot_y[i] = (hitIt)->getPairHit()->getHitPosition().y();
4120 m_mcHot_z[i] = (hitIt)->getPairHit()->getHitPosition().z();
4121 m_mcHot_drift[i] = (hitIt)->getPairHit()->getDriftDist();
4127 for(hotIt=hitRefVec.begin();hotIt!=hitRefVec.end();hotIt++){
4130 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end(); hitIt++){
4132 if(layer == (hitIt)->getLayer() && wire == (hitIt)->getWire()){
4133 m_hot_hitID[i] = (hitIt)->getHitID();
4134 m_hot_hitType[i] = (hitIt)->getHitType();
4135 m_hot_layer[i] = (hitIt)->getLayer();
4136 m_hot_wire[i] = (hitIt)->getWire();
4137 m_hot_flag[i] = (hitIt)->getFlag();
4138 m_hot_halfCircle[i] = (hitIt)->getHalfCircle();
4139 m_hot_x[i] = (hitIt)->getHitPosition().x();
4140 m_hot_y[i] = (hitIt)->getHitPosition().y();
4141 m_hot_z[i] = (hitIt)->getHitPosition().z();
4142 m_hot_drift[i] = (hitIt)->getDriftDist();
4143 m_hot_residual[i] = 999;
4145 if((hitIt)->getPairHit()!=NULL){
4146 m_mcHot_hitID[i] = (hitIt)->getPairHit()->getHitID();
4147 m_mcHot_hitType[i] = (hitIt)->getPairHit()->getHitType();
4148 m_mcHot_layer[i] = (hitIt)->getPairHit()->getLayer();
4149 m_mcHot_wire[i] = (hitIt)->getPairHit()->getWire();
4150 m_mcHot_flag[i] = (hitIt)->getPairHit()->getFlag();
4151 m_mcHot_halfCircle[i] = (hitIt)->getPairHit()->getHalfCircle();
4152 m_mcHot_x[i] = (hitIt)->getPairHit()->getHitPosition().x();
4153 m_mcHot_y[i] = (hitIt)->getPairHit()->getHitPosition().y();
4154 m_mcHot_z[i] = (hitIt)->getPairHit()->getHitPosition().z();
4155 m_mcHot_drift[i] = (hitIt)->getPairHit()->getDriftDist();
4162 int maxSameHitNumber(0);
4163 vector<HoughTrack>::iterator sameTrkIt = m_mcTrackCol.end();
4164 vector<HoughTrack>::iterator trkIter = m_mcTrackCol.begin();
4165 for(;trkIter!=m_mcTrackCol.end();trkIter++){
4166 int sameHitNumber(0);
4167 vector<HoughHit*> hitList = trkIter->getHotList();
4168 for(vector<HoughHit*>::iterator mchotIt = hitList.begin(); mchotIt != hitList.end();mchotIt++){
4170 for(clusterIt=clusterRefVec.begin();clusterIt!=clusterRefVec.end();clusterIt++){
4171 if((*clusterIt)->getclusterid()==(*mchotIt)->getCgemCluster()->getclusterid()){
4176 for(hotIt=hitRefVec.begin();hotIt!=hitRefVec.end();hotIt++){
4179 if(layer == (*mchotIt)->getLayer() && wire == (*mchotIt)->getWire()){
4185 if(sameHitNumber>maxSameHitNumber){
4186 maxSameHitNumber = sameHitNumber;
4187 sameTrkIt = trkIter;
4192 if(sameTrkIt!=m_mcTrackCol.end()){
4193 m_mcTrk_trackID = sameTrkIt->getTrkID();
4194 m_mcTrk_charge = sameTrkIt->getCharge();
4195 m_mcTrk_flag = sameTrkIt->getFlag();
4196 m_mcTrk_angle = sameTrkIt->getAngle();
4197 m_mcTrk_rho = sameTrkIt->getRho();
4198 m_mcTrk_dAngle = sameTrkIt->getDAngle();
4199 m_mcTrk_dRho = sameTrkIt->getDRho();
4200 m_mcTrk_dTanl = sameTrkIt->getDTanl();
4201 m_mcTrk_dDz = sameTrkIt->getDDz();
4202 m_mcTrk_Xc = sameTrkIt->center().x();
4203 m_mcTrk_Yc = sameTrkIt->center().y();
4204 m_mcTrk_R = sameTrkIt->radius();
4205 m_mcTrk_dr = sameTrkIt->dr();
4206 m_mcTrk_phi0 = sameTrkIt->phi0();
4207 m_mcTrk_kappa = sameTrkIt->kappa();
4208 m_mcTrk_dz = sameTrkIt->dz();
4209 m_mcTrk_tanl = sameTrkIt->tanl();
4210 m_mcTrk_pxy = sameTrkIt->pt();
4211 m_mcTrk_px = sameTrkIt->momentum(0).x();
4212 m_mcTrk_py = sameTrkIt->momentum(0).y();
4213 m_mcTrk_pz = sameTrkIt->momentum(0).z();
4214 m_mcTrk_p = sameTrkIt->momentum(0).mag();
4215 m_mcTrk_phi = sameTrkIt->direction(0).phi();
4216 m_mcTrk_theta = sameTrkIt->direction(0).theta();
4217 m_mcTrk_cosTheta =
cos(sameTrkIt->direction(0).theta());
4218 m_mcTrk_vx = sameTrkIt->x(0).x();
4219 m_mcTrk_vy = sameTrkIt->x(0).y();
4220 m_mcTrk_vz = sameTrkIt->x(0).z();
4221 m_mcTrk_vr = sameTrkIt->x(0).perp();
4234 vector<HoughHit*> mcHotList = sameTrkIt->getHotList();
4236 for(vector<HoughHit*>::iterator mcHotIt = mcHotList.begin(); mcHotIt != mcHotList.end(); mcHotIt++){
4237 m_mcTrkHot_hitID[j] = (*mcHotIt)->getHitID();
4238 m_mcTrkHot_hitType[j] = (*mcHotIt)->getHitType();
4239 m_mcTrkHot_layer[j] = (*mcHotIt)->getLayer();
4240 m_mcTrkHot_wire[j] = (*mcHotIt)->getWire();
4241 m_mcTrkHot_flag[j] = (*mcHotIt)->getFlag();
4242 m_mcTrkHot_halfCircle[j] = (*mcHotIt)->getHalfCircle();
4243 m_mcTrkHot_x[j] = (*mcHotIt)->getHitPosition().x();
4244 m_mcTrkHot_y[j] = (*mcHotIt)->getHitPosition().y();
4245 m_mcTrkHot_z[j] = (*mcHotIt)->getHitPosition().z();
4246 m_mcTrkHot_drift[j] = (*mcHotIt)->getDriftDist();
4250 ntuple_track->write();
4252 return recMdcTrackCol->size();
4255int HoughFinder::dumpTdsEvent()
4257 SmartDataPtr<RecMdcTrackCol> recMdcTrackCol(eventSvc(),
"/Event/Recon/RecMdcTrackCol");
4258 if(!recMdcTrackCol)
return 0;
4260 m_evt_event = m_event;
4261 m_evt_nTrack = recMdcTrackCol->size();
4263 for(RecMdcTrackCol::iterator
iter = recMdcTrackCol->begin();
iter!=recMdcTrackCol->end();
iter++){
4264 m_evtTrk_trackID[i] = (*iter)->trackId() ;
4265 m_evtTrk_charge[i] = (*iter)->charge() ;
4276 m_evtTrk_dr[i] = (*iter)->helix(0) ;
4277 m_evtTrk_phi0[i] = (*iter)->helix(1) ;
4278 m_evtTrk_kappa[i] = (*iter)->helix(2) ;
4279 m_evtTrk_dz[i] = (*iter)->helix(3) ;
4280 m_evtTrk_tanl[i] = (*iter)->helix(4) ;
4281 m_evtTrk_pxy[i] = (*iter)->pxy() ;
4282 m_evtTrk_px[i] = (*iter)->px() ;
4283 m_evtTrk_py[i] = (*iter)->py() ;
4284 m_evtTrk_pz[i] = (*iter)->pz() ;
4285 m_evtTrk_p[i] = (*iter)->p() ;
4286 m_evtTrk_phi[i] = (*iter)->theta() ;
4287 m_evtTrk_theta[i] = (*iter)->phi() ;
4288 m_evtTrk_cosTheta[i] =
cos((*iter)->theta()) ;
4289 m_evtTrk_vx[i] = (*iter)->x() ;
4290 m_evtTrk_vy[i] = (*iter)->y() ;
4291 m_evtTrk_vz[i] = (*iter)->z() ;
4292 m_evtTrk_vr[i] = (*iter)->r() ;
4293 m_evtTrk_chi2[i] = (*iter)->chi2() ;
4294 m_evtTrk_fiTerm[i] = (*iter)->getFiTerm() ;
4295 m_evtTrk_nhit[i] = (*iter)->getNhits() ;
4296 m_evtTrk_ncluster[i] = (*iter)->getNcluster() ;
4297 m_evtTrk_stat[i] = (*iter)->stat() ;
4298 m_evtTrk_ndof[i] = (*iter)->ndof() ;
4299 m_evtTrk_nster[i] = (*iter)->nster() ;
4300 m_evtTrk_nlayer[i] = (*iter)->nlayer() ;
4301 m_evtTrk_firstLayer[i] = (*iter)->firstLayer() ;
4302 m_evtTrk_lastLayer[i] = (*iter)->lastLayer() ;
4303 m_evtTrk_nCgemXClusters[i] = (*iter)->nCgemXCluster();
4304 m_evtTrk_nCgemVClusters[i] = (*iter)->nCgemVCluster();
4306 HitRefVec hitRefVec = (*iter)->getVecHits();
4307 HitRefVec::iterator hitIt = hitRefVec.begin();
4309 ClusterRefVec::iterator clusterIt = clusterRefVec.begin();
4311 int maxSameHitNumber(0);
4312 vector<HoughTrack>::iterator sameTrkIt = m_mcTrackCol.end();
4313 vector<HoughTrack>::iterator trkIter = m_mcTrackCol.begin();
4314 for(;trkIter!=m_mcTrackCol.end();trkIter++){
4315 int sameHitNumber(0);
4316 vector<HoughHit*> hitList = trkIter->getHotList();
4317 for(vector<HoughHit*>::iterator hotIt = hitList.begin(); hotIt != hitList.end();hotIt++){
4319 for(;clusterIt!=clusterRefVec.end();clusterIt++){
4320 if((*clusterIt)->getclusterid()==(*hotIt)->getCgemCluster()->getclusterid()){
4325 for(;hitIt!=hitRefVec.end();hitIt++){
4328 if(layer == (*hotIt)->getLayer() && wire == (*hotIt)->getWire()){
4334 if(sameHitNumber>maxSameHitNumber){
4335 maxSameHitNumber = sameHitNumber;
4336 sameTrkIt = trkIter;
4341 if(sameTrkIt!=m_mcTrackCol.end()){
4342 m_mcEvtTrk_trackID[i] = sameTrkIt->getTrkID();
4343 m_mcEvtTrk_charge[i] = sameTrkIt->getCharge();
4344 m_mcEvtTrk_flag[i] = sameTrkIt->getFlag();
4345 m_mcEvtTrk_angle[i] = sameTrkIt->getAngle();
4346 m_mcEvtTrk_rho[i] = sameTrkIt->getRho();
4347 m_mcEvtTrk_dAngle[i] = sameTrkIt->getDAngle();
4348 m_mcEvtTrk_dRho[i] = sameTrkIt->getDRho();
4349 m_mcEvtTrk_dTanl[i] = sameTrkIt->getDTanl();
4350 m_mcEvtTrk_dDz[i] = sameTrkIt->getDDz();
4351 m_mcEvtTrk_Xc[i] = sameTrkIt->center().x();
4352 m_mcEvtTrk_Yc[i] = sameTrkIt->center().y();
4353 m_mcEvtTrk_R[i] = sameTrkIt->radius();
4354 m_mcEvtTrk_dr[i] = sameTrkIt->dr();
4355 m_mcEvtTrk_phi0[i] = sameTrkIt->phi0();
4356 m_mcEvtTrk_kappa[i] = sameTrkIt->kappa();
4357 m_mcEvtTrk_dz[i] = sameTrkIt->dz();
4358 m_mcEvtTrk_tanl[i] = sameTrkIt->tanl();
4359 m_mcEvtTrk_pxy[i] = sameTrkIt->pt();
4360 m_mcEvtTrk_px[i] = sameTrkIt->momentum(0).x();
4361 m_mcEvtTrk_py[i] = sameTrkIt->momentum(0).y();
4362 m_mcEvtTrk_pz[i] = sameTrkIt->momentum(0).z();
4363 m_mcEvtTrk_p[i] = sameTrkIt->momentum(0).mag();
4364 m_mcEvtTrk_phi[i] = sameTrkIt->direction(0).phi();
4365 m_mcEvtTrk_theta[i] = sameTrkIt->direction(0).theta();
4366 m_mcEvtTrk_cosTheta[i] =
cos(sameTrkIt->direction(0).theta());
4367 m_mcEvtTrk_vx[i] = sameTrkIt->x(0).x();
4368 m_mcEvtTrk_vy[i] = sameTrkIt->x(0).y();
4369 m_mcEvtTrk_vz[i] = sameTrkIt->x(0).z();
4370 m_mcEvtTrk_vr[i] = sameTrkIt->x(0).perp();
4386 ntuple_event->write();
4387 return recMdcTrackCol->size();
4392 SmartDataPtr<RecMdcTrackCol> recMdcTrackCol(eventSvc(),
"/Event/Recon/RecMdcTrackCol");
4393 if(!recMdcTrackCol)
return 0;
4394 for(RecMdcTrackCol::iterator
iter = recMdcTrackCol->begin();
iter!=recMdcTrackCol->end();
iter++){
4395 double dr = (*iter)->helix(0) ;
4396 double phi0 = (*iter)->helix(1) ;
4397 double kappa = (*iter)->helix(2) ;
4398 double dz = (*iter)->helix(3) ;
4399 double tanl = (*iter)->helix(4) ;
4400 cout<<setw(12)<<
"dr:" <<setw(15)<<dr
4401 <<setw(12)<<
"phi0:" <<setw(15)<<phi0
4402 <<setw(12)<<
"kappa:" <<setw(15)<<kappa
4403 <<setw(12)<<
"dz:" <<setw(15)<<dz
4404 <<setw(12)<<
"tanl:" <<setw(15)<<tanl
4408 ClusterRefVec::iterator clusterIt = clusterRefVec.begin();
4409 for(clusterIt=clusterRefVec.begin();clusterIt!=clusterRefVec.end();clusterIt++){
4413 HitRefVec hitRefVec = (*iter)->getVecHits();
4414 HitRefVec::iterator hotIt = hitRefVec.begin();
4416 cout<<
"("<<
"l "<<
","<<
" w "<<
") "
4434 for(hotIt=hitRefVec.begin();hotIt!=hitRefVec.end();hotIt++){
4437 cout<<
"("<<setw( 2)<<layer<<
","<<setw( 3)<<wire<<
") "
4438 <<setw( 3)<<(*hotIt)->getStat()
4439 <<setw( 3)<<(*hotIt)->getFlagLR()
4440 <<setw(12)<<(*hotIt)->getDriftDistLeft()
4441 <<setw(12)<<(*hotIt)->getDriftDistRight()
4442 <<setw(12)<<(*hotIt)->getErrDriftDistLeft()
4443 <<setw(12)<<(*hotIt)->getErrDriftDistRight()
4444 <<setw(12)<<(*hotIt)->getChisqAdd()
4447 <<setw(10)<<(*hotIt)->getDriftT()
4448 <<setw(12)<<(*hotIt)->getDoca()
4449 <<setw(12)<<(*hotIt)->getEntra()
4450 <<setw(10)<<(*hotIt)->getZhit()
4451 <<setw(8 )<<(*hotIt)->getFltLen()
4456 return recMdcTrackCol->size();
double sin(const BesAngle a)
double cos(const BesAngle a)
bool sortCluster(const RecCgemCluster *clusterA, const RecCgemCluster *clusterB)
vector< HoughHit >::iterator HitVector_Iterator
bool moreHot(HoughTrack trk1, HoughTrack trk2)
bool largerPt(HoughTrack trk1, HoughTrack trk2)
bool sortCluster(const RecCgemCluster *clusterA, const RecCgemCluster *clusterB)
****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
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared cut
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared dimensionless $ !dummy photon IR regulator $ !crude photon multiplicity enhancement factor *EVENT $ !MC crude volume of PhhSpace *Sfactors $ !YFS formfactor IR part only $ !YFS formfactor non IR finite part $ !mass weight
std::vector< MdcDigi * > MdcDigiVec
ObjectVector< RecMdcHit > RecMdcHitCol
SmartRefVector< RecCgemCluster > ClusterRefVec
ObjectVector< RecMdcTrack > RecMdcTrackCol
SmartRefVector< RecMdcHit > HitRefVec
const RecCgemCluster * baseHit() const
static int strip(const Identifier &id)
static int sheet(const Identifier &id)
static bool is_xstrip(const Identifier &id)
vector< RecMdcHit > makeRecMdcHitVec(int sel=1)
void setPxy(const double pxy)
void setTrackId(const int trackId)
void setPy(const double py)
void setZ(const double z)
void setX(const double x)
void setError(double err[15])
void setTheta(const double theta)
void setStat(const int stat)
void setP(const double p)
void setHelix(double helix[5])
void setPoca(double poca[3])
void setR(const double r)
void setCharge(const int charge)
void setY(const double y)
void setChi2(const double chi)
void setPhi(const double phi)
void setPz(const double pz)
void setPx(const double px)
TArrayI GetIdentifier() const
Identifier identify() const
const HepPoint3D & pivot(void) const
returns pivot position.
int activeUnusedCgemHitsOnly(vector< HoughHit * > &hitPntList)
int checkTrack(vector< HoughTrack > &trackVector)
int storeRecTracks(RecMdcTrackCol *trackList, RecMdcHitCol *hitList, vector< HoughTrack > &trackVector)
void solveSharedHits(vector< HoughHit * > &hitList)
int storeTrack(vector< HoughTrack > &trackVector, RecMdcTrackCol *&recMdcTrackCol, RecMdcHitCol *&recMdcHitCol)
int storeTracks(RecMdcTrackCol *trackList, RecMdcHitCol *hitList, vector< HoughTrack > &trackVector)
vector< HoughTrack >::iterator getHoughTrkIt(vector< HoughTrack > &houghTrkList, int trkId)
void clearTrack(vector< HoughTrack > &trackVector)
HoughFinder(const std::string &name, ISvcLocator *pSvcLocator)
int checkHot(vector< HoughTrack > &trackVector)
int fillHistogram(HoughHit *hit, TH2D *hitMap, int charge, int vote)
StatusCode registerTrack(RecMdcTrackCol *&trackList_tds, RecMdcHitCol *&hitList_tds)
void setCgemCluster(const RecCgemCluster *cgemCluster)
vector< S_Z > getSZ() const
static void setMdcGeomSvc(MdcGeomSvc *mdcGeomSvc)
const RecCgemCluster * getCgemCluster() const
double getDriftDist() const
void setMdcHit(MdcHit *mdcHit)
void setDigi(const MdcDigi *mdcDigi)
const MdcMcHit * getMdcMcHit() const
HepPoint3D getHitPosition() const
HitType getHitType() const
const CgemMcHit * getCgemMcHit() const
void setPairHit(HoughHit *pairHit)
static void setMdcCalibFunSvc(MdcCalibFunSvc *mdcCalibFunSvc)
static void setCgemCalibFunSvc(CgemCalibFunSvc *cgemCalibFunSvc)
static void setCgemGeomSvc(CgemGeomSvc *cgemGeomSvc)
static void setMdcDetector(const MdcDetector *mdcDetector)
static int m_useCgemInGlobalFit
void addVecStereoHitPnt(HoughHit *aHitPnt)
int judgeHalf(HoughHit *hit)
void setMcTrack(HoughTrack *mcTrack)
vector< HoughHit * > getHotList(int type=2)
static TGraph * m_cut[2][43]
void addHitPnt(HoughHit *aHitPnt)
value_type get_value() const
double entranceAngle() const
const MdcLayer * layer() const
const MdcDigi * digi() const
unsigned layernumber() const
unsigned wirenumber() const
unsigned adcIndex() const
double driftTime(double tof, double z) const
unsigned tdcIndex() const
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
static int wire(const Identifier &id)
const MdcHit * mdcHit() const
void setNoInner(bool noInnerFlag)
static void readMCppTable(std::string filenm)
MdcDigiVec & getMdcDigiVec(uint32_t control=0)
virtual Identifier identify() const
int getclusterid(void) const
int getlayerid(void) const
int getclusterflagb(void) const
int getclusterflage(void) const
void setMdcId(Identifier mdcid)
void setErrDriftDistRight(double erddr)
void setFltLen(double fltLen)
const double getChisqAdd(void) const
void setErrDriftDistLeft(double erddl)
void setDriftDistLeft(double ddl)
const Identifier getMdcId(void) const
void setDoca(double doca)
void setChisqAdd(double pChisq)
const double getFltLen(void) const
void setZhit(double zhit)
void setDriftT(double driftT)
void setDriftDistRight(double ddr)
void setEntra(double entra)
void setVecClusters(ClusterRefVec vecclusters)
void setPivot(const HepPoint3D &pivot)
void setVecHits(HitRefVec vechits)
void setFiTerm(double fiterm)
virtual void getInfo(double fltLen, HepPoint3D &pos, Hep3Vector &direction) const =0
virtual void print(std::ostream &ostr) const =0
virtual double pt(double fltL=0.) const =0
virtual double chisq() const =0
virtual int charge() const =0
virtual int nDof() const =0
virtual const TrkDifTraj & traj() const =0
virtual HepPoint3D position(double fltL) const =0
const HepVector & params() const
const HepSymMatrix & covariance() const
virtual TrkExchangePar helix(double fltL) const =0
hot_iterator begin() const
double resid(bool exclude=false) const
const TrkRep * getParentRep() const
TrkErrCode getFitStuff(HepVector &derivs, double &deltaChi) const
virtual double arrivalTime(double fltL) const