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"
7#include "HoughTransAlg/Hough.h"
8#include "EventModel/EventHeader.h"
9#include "EvTimeEvent/RecEsTime.h"
10#include "McTruth/McParticle.h"
11#include "HepPDT/ParticleDataTable.hh"
12#include "MdcTrkRecon/MdcTrackParams.h"
13#include "MdcRecoUtil/Pdt.h"
14#include "Identifier/Identifier.h"
15#include "Identifier/CgemID.h"
16#include "Identifier/MdcID.h"
17#include "MdcGeom/MdcDetector.h"
18#include "MdcData/MdcRecoHitOnTrack.h"
19#include "CgemData/CgemHitOnTrack.h"
20#include "TrkBase/TrkRep.h"
21#include "TrkBase/TrkDifTraj.h"
22#include "TrkBase/TrkExchangePar.h"
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);
65 declareProperty(
"pdtFile", m_pdtFile =
"pdt.table");
68 declareProperty(
"nBinTheta", m_nBinTheta=100 );
69 declareProperty(
"nBinRho", m_nBinRho=50 );
70 declareProperty(
"rhoRange", m_rhoRange = 0.1);
71 declareProperty(
"ExtPeak_theta",m_ExtPeak_theta= 4);
72 declareProperty(
"ExtPeak_rho", m_ExtPeak_rho= 4);
73 declareProperty(
"shareHitRate", m_shareHitRate = 0.7);
75 declareProperty(
"nBinTanl", m_nBinTanl = 100);
76 declareProperty(
"nBinDz", m_nBinDz = 100);
77 declareProperty(
"ExtPeak_tanl", m_ExtPeak_tanl = 1);
78 declareProperty(
"ExtPeak_dz", m_ExtPeak_dz = 1);
79 declareProperty(
"filter", m_filter= 0);
80 declareProperty(
"eventFile", m_evtFile=
"EventList.txt");
81 declareProperty(
"fitFlag", m_fitFlag= 3);
82 declareProperty(
"storeFlag",
storeFlag=1);
83 declareProperty(
"checkHits", m_checkHits=1);
84 declareProperty(
"Layer",
Layer=20);
87 declareProperty(
"printFlag",
printFlag=0);
88 declareProperty(
"removeNOuterHits", m_removeNOuterHits = 0);
96 MsgStream log(
msgSvc(), name());
97 log << MSG::INFO <<
"HoughFinder::initialize()" << endreq;
102 sc = service (
"RawDataProviderSvc", irawDataProviderSvc);
104 if ( sc.isFailure() ){
105 log << MSG::ERROR << name()<<
" Could not load RawDataProviderSvc!" << endreq;
106 return StatusCode::FAILURE;
112 sc = service (
"MdcGeomSvc", imdcGeomSvc);
113 m_mdcGeomSvc =
dynamic_cast<MdcGeomSvc*
> (imdcGeomSvc);
114 if ( sc.isFailure() ){
115 log << MSG::ERROR <<
"Could not load MdcGeoSvc!" << endreq;
116 return StatusCode::FAILURE;
121 sc = service (
"MdcCalibFunSvc", imdcCalibSvc);
123 if ( sc.isFailure() ){
124 log << MSG::ERROR <<
"Could not load MdcCalibFunSvc!" << endreq;
125 return StatusCode::FAILURE;
131 sc = service (
"CgemGeomSvc", icgemGeomSvc);
132 m_cgemGeomSvc =
dynamic_cast<CgemGeomSvc*
> (icgemGeomSvc);
133 if ( sc.isFailure() ){
134 log << MSG::ERROR <<
"Could not load CgemGeomSvc!" << endreq;
135 return StatusCode::FAILURE;
140 sc = service (
"CgemCalibFunSvc", icgemCalibSvc);
142 if ( sc.isFailure() ){
143 log << MSG::ERROR <<
"Could not load CgemCalibFunSvc!" << endreq;
144 return StatusCode::FAILURE;
150 sc = service (
"MagneticFieldSvc",m_pIMF);
151 if( sc.isFailure() ) {
152 log << MSG::ERROR <<
"Unable to open Magnetic field service"<<endreq;
153 return StatusCode::FAILURE;
155 m_bfield =
new BField(m_pIMF);
189 m_roughRhoThetaMap=TH2D(
"roughRhoThetaMap",
"roughRhoThetaMap",m_nBinTheta,0.,
M_PI, m_nBinRho, -1.*m_rhoRange, m_rhoRange);
193 m_roughTanlDzMap = TH2D(
"roughTanlDzMap",
"roughTanlDzMap",m_nBinTanl,-1.*m_tanlRange,m_tanlRange,m_nBinDz,-1.*m_dzRange,m_dzRange);
196 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};
197 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};
198 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};
199 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 };
200 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};
201 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 };
202 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};
203 m_cut1_cgem =
new TGraph(nPt, rho, cut1_Cgem_99);
204 m_cut2_cgem =
new TGraph(nPt, rho, cut2_Cgem_99);
205 m_cut1_ODC1 =
new TGraph(nPt, rho, cut1_ODC1_99);
206 m_cut2_ODC1 =
new TGraph(nPt, rho, cut2_ODC1_99);
207 m_cut1_ODC2 =
new TGraph(nPt, rho, cut1_ODC2_99);
208 m_cut2_ODC2 =
new TGraph(nPt, rho, cut2_ODC2_99);
211 int s(0),l(0),npt(0);
212 double momenta[100] = {0};
213 double cuts[2][43][100] = {0};
214 string cutFilePath = getenv(
"HOUGHTRANSALGROOT");
215 cutFilePath +=
"/share/cut.txt";
216 ifstream fin(cutFilePath.c_str(), ios::in);
217 cout<<
"cutfiledir:"<<cutFilePath.c_str()<<endl;
220 cout <<
"Error in " << __FILE__<<endl;
221 bool firstline(
true);
223 while(std::getline(fin, strcom)){
226 >> momenta[0] >> momenta[1] >> momenta[2] >> momenta[3] >> momenta[4] >> momenta[5] >> momenta[6] >> momenta[7] >> momenta[8] >> momenta[9]
227 >> momenta[10] >> momenta[11] >> momenta[12] >> momenta[13] >> momenta[14] >> momenta[15] >> momenta[16] >> momenta[17] >> momenta[18] >> momenta[19]
228 >> momenta[20] >> momenta[21] >> momenta[22] >> momenta[23] >> momenta[24] >> momenta[25] >> momenta[26] >> momenta[27] >> momenta[28] >> momenta[29]
229 >> momenta[30] >> momenta[31] >> momenta[32] >> momenta[33] >> momenta[34] >> momenta[35] >> momenta[36] >> momenta[37] >> momenta[38] >> momenta[39]
230 >> momenta[40] >> momenta[41] >> momenta[42] >> momenta[43] >> momenta[44] >> momenta[45] >> momenta[46] >> momenta[47] >> momenta[48] >> momenta[49]
231 >> momenta[50] >> momenta[51] >> momenta[52] >> momenta[53] >> momenta[54] >> momenta[55] >> momenta[56] >> momenta[57] >> momenta[58] >> momenta[59]
232 >> momenta[60] >> momenta[61] >> momenta[62] >> momenta[63] >> momenta[64] >> momenta[65] >> momenta[66] >> momenta[67] >> momenta[68] >> momenta[69]
233 >> momenta[70] >> momenta[71] >> momenta[72] >> momenta[73] >> momenta[74] >> momenta[75] >> momenta[76] >> momenta[77] >> momenta[78] >> momenta[79]
234 >> momenta[80] >> momenta[81] >> momenta[82] >> momenta[83] >> momenta[84] >> momenta[85] >> momenta[86] >> momenta[87] >> momenta[88] >> momenta[89]
235 >> momenta[90] >> momenta[91] >> momenta[92] >> momenta[93] >> momenta[94] >> momenta[95] >> momenta[96] >> momenta[97] >> momenta[98] >> momenta[99]
241 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]
242 >> 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]
243 >> 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]
244 >> 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]
245 >> 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]
246 >> 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]
247 >> 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]
248 >> 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]
249 >> 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]
250 >> 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]
252 if(fin.peek()<0)
break;
254 for(
int is=0;is<=1;is++){
255 for(
int il=0;il<43;il++){
256 TGraph*
gr =
new TGraph();
259 for(
int ipt=0;ipt<npt;ipt++){
261 if(fabs(cuts[is][il][ipt])<1e-6)
continue;
263 gr->SetPoint(point,momenta[ipt]/1000.,cuts[is][il][ipt]);
273 if ( sc.isFailure() ){
274 log << MSG::FATAL <<
"Could not book Tuple !" << endreq;
275 return StatusCode::FAILURE;
278 return StatusCode::SUCCESS;
283 MsgStream log(
msgSvc(), name());
284 log << MSG::INFO <<
"HoughFinder::execute()" << endreq;
290 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
292 log << MSG::ERROR <<
"Could not find Event Header" << endreq;
293 return StatusCode::FAILURE;
295 m_run = eventHeader->runNumber();
296 m_event = eventHeader->eventNumber();
297 m_totEvtProcessed++;
if(m_totEvtProcessed%100==0) cout<<
"HoughFinder: "<<m_totEvtProcessed<<
" events processed."<<endl;
301 SmartDataPtr<RecEsTimeCol> evTimeCol(eventSvc(),
"/Event/Recon/RecEsTimeCol");
303 log << MSG::ERROR <<
"Could not retrieve RecEsTimeCol" << endreq;
304 return StatusCode::FAILURE;
307 RecEsTimeCol::iterator iter_evt = evTimeCol->begin();
308 if (iter_evt != evTimeCol->end()){
309 m_bunchT0 = (*iter_evt)->getTest()*1.e-9;
319 lowPt_Evt.open(m_evtFile.c_str());
322 while( lowPt_Evt >> evtNum) {
323 evtlist.push_back(evtNum);
325 vector<int>::iterator iter_evt = find(evtlist.begin(),evtlist.end(),m_event);
326 if(iter_evt == evtlist.end()){
327 setFilterPassed(
false);
328 return StatusCode::SUCCESS;
331 setFilterPassed(
true);
341 cout<<
"===================================================================================================="<<endl;
342 cout<<
"run:"<<m_run<<
" , event: "<<m_event<<endl;
353 if(m_run<0&&m_mcTruth){
356if(
printFlag)cout<<
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ McParticle @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"<<endl;
358if(
printFlag)cout<<
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ McParticle @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"<<endl;
375if(
printFlag)cout<<
"################################################## HoughTrack ##################################################"<<endl;
378if(
printFlag)cout<<
"################################################## HoughTrack ##################################################"<<endl;
384 if(m_fillNTuple)dumpHit();
385 if(m_fillNTuple==1)dumpHoughTrack();
386 if(m_fillNTuple==1)dumpHoughEvent();
387 if(m_fillNTuple==2)dumpTdsTrack();
388 if(m_fillNTuple==2)dumpTdsEvent();
391if(
printFlag)cout<<
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ TdsTrack $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"<<endl;
393if(
printFlag)cout<<
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ TdsTrack $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"<<endl;
398if(
printFlag)cout<<
"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& HoughHit &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"<<endl;
400if(
printFlag)cout<<
"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& HoughHit &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"<<endl;
410 if(m_debug)cout<<endl;
412 return StatusCode::SUCCESS;
417 MsgStream log(
msgSvc(), name());
418 log << MSG::INFO <<
"HoughFinder::finalize()" << endreq;
419 return StatusCode::SUCCESS;
424 return fabs(trk1.
pt())>fabs(trk2.
pt());
429 MsgStream log(
msgSvc(), name());
431 if(!(m_mdcHitCol.empty())) m_mdcHitCol.clear();
432 if(!(m_houghHitList.empty())) m_houghHitList.clear();
433 if(!(m_XHoughHitList.empty())) m_XHoughHitList.clear();
434 if(!(m_VHoughHitList.empty())) m_VHoughHitList.clear();
438 SmartDataPtr<RecCgemClusterCol> recCgemClusterCol(eventSvc(),
"/Event/Recon/RecCgemClusterCol");
439 if(!recCgemClusterCol){
440 log << MSG::ERROR <<
"Could not retrieve RecCgemClusterCol" << endreq;
442 RecCgemClusterCol::iterator cgemClusterIter = recCgemClusterCol->begin();
443 for (;cgemClusterIter != recCgemClusterCol->end(); cgemClusterIter++,nHit++){
446 HoughHit hit(recCgemCluster, m_bunchT0, nHit);
447 m_houghHitList.push_back(hit);
453 uint32_t getDigiFlag = 0;
459 MdcDigiVec::iterator mdcDigiIter = mdcDigiVec.begin();
460 for (;mdcDigiIter != mdcDigiVec.end(); mdcDigiIter++,nHit++){
461 const MdcDigi* mdcDigi = (*mdcDigiIter);
462 HoughHit hit(mdcDigi, m_bunchT0, nHit);
467 m_mdcHitCol.push_back(mdcHit);
468 m_houghHitList.push_back(hit);
472 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end();hitIt++){
473 int flag=hitIt->getFlag();
475 if(flag==0)m_XHoughHitList.push_back(&(*hitIt));
476 if(flag==2)m_VHoughHitList.push_back(&(*hitIt));
479 if(flag==0)m_XHoughHitList.push_back(&(*hitIt));
480 else m_VHoughHitList.push_back(&(*hitIt));
495 MsgStream log(
msgSvc(), name());
497 if(!(m_mcHitCol.empty()))m_mcHitCol.clear();
501 SmartDataPtr<CgemMcHitCol> cgemMcHitCol(eventSvc(),
"/Event/MC/CgemMcHitCol");
503 log << MSG::ERROR <<
"Could not retrieve CgemMcHitCol" << endreq;
505 CgemMcHitCol::iterator cgemMcHitIt = cgemMcHitCol->begin();
506 for(;cgemMcHitIt != cgemMcHitCol->end();cgemMcHitIt++,nMcHit++){
507 const CgemMcHit* cgemMcHit = (*cgemMcHitIt);
508 HoughHit hit(cgemMcHit,m_bunchT0,nMcHit);
509 m_mcHitCol.push_back(hit);
510 HoughHit* phit = &(*m_mcHitCol.rbegin());
513 vector<int> xFireStripID;
514 vector<int> vFireStripID;
516 TArrayI identifier = phit->
getCgemMcHit()->GetIdentifier();
517 for(
int ii = 0; ii < identifier.GetSize(); ii++){
531 sort(xFireStripID.begin(),xFireStripID.end());
532 sort(vFireStripID.begin(),vFireStripID.end());
540 bool findX(
false), findV(
false);
543 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end();hitIt++){
547 if(!(recCgemCluster->
getflag()==0||recCgemCluster->
getflag()==1))
continue;
551 findX = recCgemCluster->
getflag() == 0
552 && xFireStripID.size() > 0
556 xCluster = recCgemCluster;
557 hitIt->setPairHit(phit);
561 findV = recCgemCluster->
getflag() == 1
562 && vFireStripID.size() > 0
566 vCluster = recCgemCluster;
567 hitIt->setPairHit(phit);
575 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end();hitIt++){
579 if(recCgemCluster->
getflag()==0||recCgemCluster->
getflag()==1)
continue;
588 hitIt->setPairHit(phit);
592 else if(findX&&!findV){
597 else if(!findX&&findV){
607 SmartDataPtr<MdcMcHitCol> mdcMcHitCol(eventSvc(),
"/Event/MC/MdcMcHitCol");
609 log << MSG::ERROR <<
"Could not retrieve MdcMcHitCol" << endreq;
611 MdcMcHitCol::iterator mdcMcHitIt = mdcMcHitCol->begin();
612 for(;mdcMcHitIt != mdcMcHitCol->end();mdcMcHitIt++,nMcHit++){
613 const MdcMcHit* mdcMcHit = (*mdcMcHitIt);
614 HoughHit hit(mdcMcHit,m_bunchT0,nMcHit);
615 m_mcHitCol.push_back(hit);
616 HoughHit* phit = &(*m_mcHitCol.rbegin());
617 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end();hitIt++){
619 const MdcDigi* mdcDigi = hitIt->getDigi();
623 hitIt->setPairHit(phit);
629 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end();hitIt++){
630 for(
HitVector_Iterator mcHitIt = m_mcHitCol.begin(); mcHitIt != m_mcHitCol.end();mcHitIt++){
631 if(hitIt->getLayer()!=mcHitIt->getLayer())
continue;
633 if(mcHitIt->getCgemCluster()==NULL)
continue;
634 int recClusterID(-1);
636 int recFlag = hitIt->getCgemCluster()->getflag();
637 int mcFlag = mcHitIt->getCgemCluster()->getflag();;
639 recClusterID = hitIt->getCgemCluster()->getclusterid();
640 mcClusterID = mcHitIt->getCgemCluster()->getclusterid();
643 if(recFlag==1&&mcFlag==2){
644 recClusterID = hitIt->getCgemCluster()->getclusterid();
645 mcClusterID = mcHitIt->getCgemCluster()->getclusterflage();
648 if(recFlag==0&&mcFlag==2){
649 recClusterID = hitIt->getCgemCluster()->getclusterid();
650 mcClusterID = mcHitIt->getCgemCluster()->getclusterflagb();
653 if(recFlag==2&&mcFlag==1){
654 recClusterID = hitIt->getCgemCluster()->getclusterflage();
655 mcClusterID = mcHitIt->getCgemCluster()->getclusterid();
658 if(recFlag==2&&mcFlag==0){
659 recClusterID = hitIt->getCgemCluster()->getclusterflagb();
660 mcClusterID = mcHitIt->getCgemCluster()->getclusterid();
663 if(recClusterID==mcClusterID){
664 hitIt->setPairHit(&(*mcHitIt));
665 hitIt->setCgemMcHit(mcHitIt->getCgemMcHit());
683 if(mcHitIt->getDigi()==NULL)
continue;
685 if(hitIt->getDigi()->identify() == mcHitIt->getDigi()->identify())
687 hitIt->setPairHit(&(*mcHitIt));
688 hitIt->setMdcMcHit(mcHitIt->getMdcMcHit());
712 const int maxCell[43] = {40,44,48,56, 64,72,80,80,
713 76,76,88,88, 100,100,112,112, 128,128,140,140,
714 160,160,160,160, 176,176,176,176, 208,208,208,208, 240,240,240,240,
715 256,256,256,256, 288,288,288 };
716 m_mcTrackCol.clear();
717 MsgStream log(
msgSvc(), name());
718 SmartDataPtr<McParticleCol> mcParticleCol(eventSvc(),
"/Event/MC/McParticleCol");
719 if (!mcParticleCol) {
720 log << MSG::ERROR <<
"Could not find McParticle" << endreq;
722 bool psipDecay(
false);
723 McParticleCol::iterator iter_mc = mcParticleCol->begin();
724 for (;iter_mc != mcParticleCol->end(); iter_mc++){
725 int trackIndex = (*iter_mc)->trackIndex();
726 int pid = (*iter_mc)->particleProperty();
727 bool primaryParticle = (*iter_mc)->primaryParticle();
728 bool leafParticle = (*iter_mc)->leafParticle();
729 bool decayFromGenerator = (*iter_mc)->decayFromGenerator();
730 bool decayInFlight = (*iter_mc)->decayInFlight();
731 HepLorentzVector initialPosition = (*iter_mc)->initialPosition();
732 HepLorentzVector initialFourMomentum = (*iter_mc)->initialFourMomentum();
735 unsigned int statusFlags = (*iter_mc)->statusFlags();
749 IPartPropSvc* p_PartPropSvc;
750 static const bool CREATEIFNOTTHERE(
true);
751 StatusCode PartPropStatus = service(
"PartPropSvc", p_PartPropSvc, CREATEIFNOTTHERE);
752 if (!PartPropStatus.isSuccess() || 0 == p_PartPropSvc) {
753 log << MSG::ERROR <<
"Could not initialize Particle Properties Service" << endreq;
755 HepPDT::ParticleDataTable* p_particleTable = p_PartPropSvc->PDT();
756 if( p_particleTable->particle(pid) ){
757 name = p_particleTable->particle(pid)->name();
758 charge = p_particleTable->particle(pid)->charge();
759 }
else if( p_particleTable->particle(-pid) ){
760 name =
"anti " + p_particleTable->particle(-pid)->name();
761 charge = (-1)*p_particleTable->particle(-pid)->charge();
776 HoughTrack track(charge,initialPosition.v(),initialFourMomentum.v(),trackIndex);
782 vector<HoughHit*> hotList;
783 vector<HoughHit>& hitList = m_mcHitCol;
785 vector<int> trkID = hitIt->getTrkID();
790 hotList.push_back(&(*hitIt));
793 if(hitIt->getFlag()==0)track.
addHitPnt(&(*hitIt));
795 hotList.push_back(&(*hitIt));
800 if(nHot>0)m_mcTrackCol.push_back(track);
803 bool classifyHotByHotLayer(
false);
804 bool classifyHotByTrackCenter(
true);
805 if(classifyHotByHotLayer){
810 vector<HoughHit*> hitOnLayer;
812 for(vector<HoughHit*>::iterator hitIt = hotList.begin(); hitIt != hotList.end(); hitIt++){
816 hitOnLayer.push_back(*hitIt);
817 lastLayerHit = *hitIt;
818 lastHitLayer = (*hitIt)->
getLayer();
822 if((*hitIt)->getLayer()==lastHitLayer){
823 hitOnLayer.push_back(*hitIt);
824 lastHitLayer = (*hitIt)->getLayer();
826 if(deltaLayer*((*hitIt)->getLayer()-lastHitLayer)>=0){
827 for(vector<HoughHit*>::iterator
iter = hitOnLayer.begin();
iter != hitOnLayer.end();
iter++){
828 (*iter)->setHalfCircle(halfCircle);
829 lastLayerHit = *
iter;
836 for(vector<HoughHit*>::iterator
iter = hitOnLayer.begin();
iter != hitOnLayer.end();
iter++){
837 deltaWire = fabs((*iter)->getWire()-lastLayerHit->
getWire());
838 if(deltaWire>(maxCell[(*iter)->getLayer()])/2) deltaWire = maxCell[(*iter)->getLayer()] - deltaWire;
839 if(deltaWire>maxWireGap){
840 maxWireGap = deltaWire;
841 turnPoint =
iter - hitOnLayer.begin();
843 lastLayerHit = *
iter;
845 deltaWire = fabs((*hitIt)->getWire()-lastLayerHit->
getWire());
846 if(deltaWire>(maxCell[(*hitIt)->getLayer()])/2) deltaWire = maxCell[(*hitIt)->getLayer()] - deltaWire;
847 if(deltaWire>maxWireGap){
848 maxWireGap = deltaWire;
849 turnPoint = hitOnLayer.size();
853 for(vector<HoughHit*>::iterator
iter = hitOnLayer.begin();
iter != hitOnLayer.end();
iter++){
854 int shift =
iter-hitOnLayer.begin();
855 if(shift<turnPoint)(*iter)->setHalfCircle(halfCircle-1);
856 else (*iter)->setHalfCircle(halfCircle);
859 for(vector<HoughHit*>::iterator
iter = hitOnLayer.begin();
iter != hitOnLayer.end();
iter++){
860 int shift =
iter-hitOnLayer.begin();
861 if(shift<hitOnLayer.size()/2)(*iter)->setHalfCircle(halfCircle-1);
862 else (*iter)->setHalfCircle(halfCircle);
867 hitOnLayer.push_back(*hitIt);
868 lastHitLayer = (*hitIt)->getLayer();
869 deltaLayer = (*hitIt)->getLayer()-lastHitLayer;
878 if(classifyHotByTrackCenter){
879 int cgemHalf(0), mdcHalf(0);
880 int cgemSign(0), mdcSign(0);
881 int half(0), sign(0);
882 for(vector<HoughHit*>::iterator hitIt = hotList.begin(); hitIt != hotList.end(); hitIt++){
900 (*hitIt)->setHalfCircle(half);
903 if(hotList.size()>0){
908 for(vector<HoughHit*>::iterator hotIt = hotList.begin(); hotIt != hotList.end();hotIt++){
915 if(
printFlag)
if(hotList.size())cout<<endl;
917 sort(m_mcTrackCol.begin(),m_mcTrackCol.end(),
largerPt);
919 for(vector<HoughTrack>::iterator trkIter=m_mcTrackCol.begin();trkIter!=m_mcTrackCol.end();trkIter++){
923 return m_mcTrackCol.size();
928 int nBin = hitMap->GetXaxis()->GetNbins();
929 double xMin = hitMap->GetXaxis()->GetXmin();
930 double xMax = hitMap->GetXaxis()->GetXmax();
931 double yMin = hitMap->GetYaxis()->GetXmin();
932 double yMax = hitMap->GetYaxis()->GetXmax();
933 double dx = (xMax-xMin)/(nBin*vote)>1e-6?(xMax-xMin)/(nBin*vote):1e-6;
934 double x = xMin + dx/2;
942 double denominator = xHit*xHit+yHit*yHit-rHit*rHit;
945 double X1 = 2*xHit/denominator;
946 double Y1 = 2*yHit/denominator;
947 double X2 = 2*xHit/denominator;
948 double Y2 = 2*yHit/denominator;
949 double R = 2*rHit/denominator;
956 double hitOnCircle1 = charge*slope1*y1;
957 double hitOnCircle2 = charge*slope2*y2;
960 cut = yMin<y1 && y1<yMax;
961 cut =
cut && hitOnCircle1 <=0;
967 cut = yMin<y2 && y2<yMax;
968 cut =
cut && hitOnCircle2 <= 0;
979 vector<HoughHit::S_Z> sz = hit->
getSZ();
980 vector<HoughHit::S_Z>::iterator
iter = sz.begin();
982 double S =
iter->first;
983 double Z =
iter->second;
991 cut = yMin<y && y<yMax;
1005 int nBin = hitMap->GetXaxis()->GetNbins();
1006 double xMin = hitMap->GetXaxis()->GetXmin();
1007 double xMax = hitMap->GetXaxis()->GetXmax();
1008 double yMin = hitMap->GetYaxis()->GetXmin();
1009 double yMax = hitMap->GetYaxis()->GetXmax();
1010 double dx = (xMax-xMin)/(nBin*vote)>1e-6?(xMax-xMin)/(nBin*vote):1e-6;
1011 double x = xMin + dx/2;
1016 bool firstHalf = trkCandi->
judgeHalf(hit)==1;
1017 if(!firstHalf)
return 0;
1021 double denominator = xHit*xHit+yHit*yHit-rHit*rHit;
1024 double X1 = 2*xHit/denominator;
1025 double Y1 = 2*yHit/denominator;
1026 double X2 = 2*xHit/denominator;
1027 double Y2 = 2*yHit/denominator;
1028 double R = 2*rHit/denominator;
1035 double hitOnCircle1 = charge*slope1*y1;
1036 double hitOnCircle2 = charge*slope2*y2;
1039 cut = yMin<y1 && y1<yMax;
1046 cut = yMin<y2 && y2<yMax;
1065 vector<HoughHit::S_Z> sz = hit->
getSZ();
1066 vector<HoughHit::S_Z>::iterator
iter = sz.begin();
1068 double S =
iter->first;
1069 double Z =
iter->second;
1071 double y = -S*
x + Z;
1074 cut = yMin<y && y<yMax;
1089 int nHitsFilled = 0;
1090 std::vector<HoughHit*>::iterator
iter = hitList.begin();
1091 for(;
iter!= hitList.end();
iter++)
1093 int used = (*iter)->getUse();
1107 if(nPoint>0) nHitsFilled++;
1601 if(trackVector.size()==0)
return 0;
1602 std::sort(trackVector.begin(),trackVector.end(),
moreHot);
1604 vector<HoughTrack>::iterator trkIT1 = trackVector.end();
1611 if(trkIT1==trackVector.begin()) loop=
false;
1612 if((trkIT1)->getFlag() == 1)
continue;
1613 trkIT1->dropRedundentCgemXHits();
1615 int nHits = trkIT1->getVecHitPnt().size();
1617 (trkIT1)->setFlag(1);
1618 trkIT1->releaseSelHits();
1621 int nShared = trkIT1->getNHitsShared();
1624 if(nShared>m_shareHitRate*nHits){
1626 trkIT1->releaseSelHits();
1646 std::sort(trackVector.begin(),trackVector.end(),
moreHot);
1647 for(vector<HoughTrack>::iterator trkIT1 = trackVector.begin(); trkIT1!=trackVector.end(); trkIT1++){
1648 if((trkIT1)->getFlag() == 1)
continue;
1649 int charge = (trkIT1)->getCharge();
1650 double dr = (trkIT1)->dr();
1651 double phi0 = (trkIT1)->phi0();
1652 double kappa = (trkIT1)->kappa();
1653 double dz = (trkIT1)->dz();
1654 double tanl = (trkIT1)->tanl();
1655 for(vector<HoughTrack>::iterator trkIT2 = trkIT1+1; trkIT2!=trackVector.end();trkIT2++){
1656 if((trkIT2)->getFlag() == 1)
continue;
1657 bool sameTrack(
false);
1658 dDr = fabs(dr - (trkIT2)->dr());
1659 dPhi0 = fabs(phi0 - (trkIT2)->phi0());
1660 if((trkIT2)->getCharge() == charge){
1661 dKappa = fabs(kappa - (trkIT2)->kappa());
1662 dTanl = fabs(tanl - (trkIT2)->tanl());
1664 dKappa = fabs(fabs(kappa) - fabs((trkIT2)->kappa()));
1665 dTanl = fabs(fabs(tanl) - fabs((trkIT2)->tanl()));
1667 double r = fabs(dz)<fabs((trkIT2)->dz())?(trkIT1)->radius():(trkIT2)->radius();
1668 double k = dz<fabs((trkIT2)->dz())?tanl:(trkIT2)->tanl();
1669 dDz = fabs(dz - (trkIT2)->dz());
1670 int nCircle = fabs(dDz)/(2*
M_PI*r*k);
1671 dDz = fabs(dDz - nCircle*(2*
M_PI*r*k));
1672 if(dDz>
M_PI*r*k)dDz = fabs(dDz - 2*
M_PI*r*k);
1673 sameTrack = sameTrack&&(dDr<m_drCut);
1674 sameTrack = sameTrack&&(dPhi0<m_phi0Cut);
1675 sameTrack = sameTrack&&(dKappa<m_kappaCut);
1676 sameTrack = sameTrack&&(dDz<m_dzCut);
1677 sameTrack = sameTrack&&(dTanl<m_tanlCut);
1682 (trkIT2)->setFlag(1);
1750 MsgStream log(
msgSvc(), name());
1752 IDataProviderSvc* eventSvc = NULL;
1753 Gaudi::svcLocator()->service(
"EventDataSvc", eventSvc);
1755 log << MSG::INFO <<
"makeTds:event Svc has been found" << endreq;
1757 log << MSG::FATAL <<
"makeTds:Could not find eventSvc" << endreq;
1758 return StatusCode::FAILURE;
1761 IDataManagerSvc *dataManSvc =
dynamic_cast<IDataManagerSvc*
>(eventSvc);;
1766 DataObject *aRecMdcTrackCol;
1767 eventSvc->findObject(
"/Event/Recon/RecMdcTrackCol",aRecMdcTrackCol);
1768 if(aRecMdcTrackCol != NULL) {
1769 dataManSvc->clearSubTree(
"/Event/Recon/RecMdcTrackCol");
1770 eventSvc->unregisterObject(
"/Event/Recon/RecMdcTrackCol");
1773 sc = eventSvc->registerObject(
"/Event/Recon/RecMdcTrackCol", recMdcTrackCol);
1774 if(sc.isFailure()) {
1775 log << MSG::FATAL <<
" Could not register RecMdcTrack collection" <<endreq;
1776 return StatusCode::FAILURE;
1778 log << MSG::INFO <<
"RecMdcTrackCol registered successfully!" <<endreq;
1783 DataObject *aRecMdcHitCol;
1784 eventSvc->findObject(
"/Event/Recon/RecMdcHitCol",aRecMdcHitCol);
1785 if(aRecMdcHitCol != NULL) {
1786 dataManSvc->clearSubTree(
"/Event/Recon/RecMdcHitCol");
1787 eventSvc->unregisterObject(
"/Event/Recon/RecMdcHitCol");
1790 sc = eventSvc->registerObject(
"/Event/Recon/RecMdcHitCol", recMdcHitCol);
1791 if(sc.isFailure()) {
1792 log << MSG::FATAL <<
" Could not register RecMdcHit collection" <<endreq;
1793 return StatusCode::FAILURE;
1795 log << MSG::INFO <<
"RecMdcHitCol registered successfully!" <<endreq;
1798 return StatusCode::SUCCESS;
1810 vector<MdcTrack*> mdcTrackVector;
1811 for(vector<HoughTrack>::iterator trkIT = trackVector.begin();trkIT!=trackVector.end();trkIT++){
1812 if((trkIT)->getFlag() == 1)
continue;
1813 if((trkIT)->getFlag() == -1)
continue;
1814 if((trkIT)->getFlag() == -2)
continue;
1817 mdcTrackList.append(mdcTrack);
1818 mdcTrackVector.push_back(mdcTrack);
1823 if(nDeleted>0)cout<<
"nDeleted "<<nDeleted<<endl;
1826 for(
int l=0;l<mdcTrackList.length();l++){
1827 mdcTrackList[l]->storeTrack(trkID,recMdcTrackCol,recMdcHitCol,4);
1831 vector<MdcTrack*>::iterator
iter = mdcTrackVector.begin();
1832 for(;
iter!=mdcTrackVector.end();
iter++){
1846 sort(trackVector.begin(),trackVector.end(),
largerPt);
1848 for(vector<HoughTrack>::iterator trkIT = trackVector.begin();trkIT!=trackVector.end();trkIT++){
1849 if((trkIT)->getFlag() == 1)
continue;
1850 if((trkIT)->getFlag() == -1)
continue;
1851 if((trkIT)->getFlag() == -2)
continue;
1852 if(trkIT->getTrkRecoTrk()==NULL)
continue;
1854 const TrkFit* fitresult = trkIT->getTrkRecoTrk()->fitResult();
1856 if (fitresult == 0)
continue;
1863 const TrkHitList* aList = trkIT->getTrkRecoTrk()->hits();
1865 const BField& theField = trkIT->getTrkRecoTrk()->bField();
1866 double Bz = theField.
bFieldZ();
1883 nHits = aList->
nHit();
1890 double chisq = fitresult->
chisq();
1891 int nDof = fitresult->
nDof();
1893 double fltLenPoca = 0.0;
1896 double phi0 = helix.
phi0();
1897 double tanDip = helix.
tanDip();
1899 double d0 = helix.
d0();
1910 helixPar[1] = tphi0;
1912 double pxy = fitresult->
pt();
1913 if (pxy == 0.) helixPar[2] = 9999.;
1914 else helixPar[2] =
q/fabs(pxy);
1915 if(pxy>9999.) helixPar[2] = 0.00001;
1917 helixPar[3] = helix.
z0();
1919 helixPar[4] = tanDip;
1922 HepSymMatrix mS(helix.
params().num_row(),0);
1925 mS[2][2]=-333.567/Bz;
1928 HepSymMatrix mVy = helix.
covariance().similarity(mS);
1929 double errorMat[15];
1931 for (
int ie = 0 ; ie < 5 ; ie ++){
1932 for (
int je = ie ; je < 5 ; je ++) {
1933 errorMat[k] = mVy[ie][je];
1938 px = pxy * (-
sin(helixPar[1]));
1939 py = pxy *
cos(helixPar[1]);
1940 pz = pxy * helixPar[4];
1941 p = sqrt(pxy*pxy + pz*pz);
1943 double theta = acos(pz/p);
1944 double phi = atan2(py,px);
1948 recMdcTrack->
setPxy(pxy);
1949 recMdcTrack->
setPx(px);
1950 recMdcTrack->
setPy(py);
1951 recMdcTrack->
setPz(pz);
1952 recMdcTrack->
setP(p);
1954 recMdcTrack->
setPhi(phi);
1956 recMdcTrack->
setX(poca.x());
1957 recMdcTrack->
setY(poca.y());
1958 recMdcTrack->
setZ(poca.z());
1959 recMdcTrack->
setR(sqrt(poca.x()*poca.x() + poca.y()*poca.y()));
1973 vector<int> vecHits;
1974 map<int,int> clusterFitStat;
1984 if(maxLayer < layerId)maxLayer = layerId;
1988 int maxLayerId = -1;
1989 int minLayerId = 43;
1990 double fiTerm = 999.;
1993 for (;hot!=aList->
end();hot++){
2001 recMdcHit->
setId(hitId);
2013 double hotWireAmbig = recoHot->
wireAmbig();
2014 double driftDist = fabs(recoHot->
drift());
2015 double sigma = recoHot->
hitRms();
2016 double doca = fabs(recoHot->
dcaToWire());
2018 if ( hotWireAmbig == 1){
2021 }
else if( hotWireAmbig == -1){
2023 }
else if( hotWireAmbig == 0){
2038 double res=999.,rese=999.;
2039 if (recoHot->
resid(res,rese,
false)){
2053 double fltLen = recoHot->
fltLen();
2065 if(layerId>(maxLayer - m_removeNOuterHits))
continue;
2068 if (layerId >= maxLayerId){
2069 maxLayerId = layerId;
2070 fiTermHot = recoHot;
2072 if (layerId < minLayerId){
2073 minLayerId = layerId;
2085 hitList->push_back(recMdcHit);
2086 SmartRef<RecMdcHit> refHit(recMdcHit);
2087 hitRefVec.push_back(refHit);
2096 clusterFitStat[clusterid] = stat;
2099 clusterRefVec.push_back(recCgemCluster);
2102 std::sort(clusterRefVec.begin(),clusterRefVec.end(),
sortCluster);
2104 if (fiTermHot!=NULL){
2105 fiTerm=(1./sqrt(1.+tanDip*tanDip))*fiTermHot->
fltLen()*helix.
omega();
2120 trackList->push_back(recMdcTrack);
2326 return trackList->size();
2332 cout<<
"========== truth =========="<<endl;
2337 cout<<
"========== Digi =========="<<endl;
2338 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end();hitIt++)
2404int HoughFinder::searchCircle()
2406 bool tryCgemLeftOnly=
false;
2412 m_roughRhoThetaMap.Reset();
2416 nXhitsLeft =
fillHistogram(m_XHoughHitList,&m_roughRhoThetaMap,charge,vote);
2419 if(!tryCgemLeftOnly) {
2421 tryCgemLeftOnly=
true;
2422 if(nCgemHitsLeft>=3) {
2431 double x_peak(0.), y_peak(0.);
2432 double x_weight(0.), y_weight(0.);
2433 getWeightedPeak(m_roughRhoThetaMap, x_peak, y_peak, x_weight, y_weight);
2440 double x_min=x_peak-0.5*m_ExtPeak_theta*
M_PI/m_nBinTheta;
2441 double x_max=x_peak+0.5*m_ExtPeak_theta*
M_PI/m_nBinTheta;
2442 double y_min=y_peak-0.5*m_ExtPeak_rho*0.2/m_nBinRho;
2443 double y_max=y_peak+0.5*m_ExtPeak_rho*0.2/m_nBinRho;
2446 int nFineBin_Theta = nFineBinTheta(y_peak);
2447 int nFineBin_Rho = nFineBinRho(y_peak);
2450 int trkFoundThisTry = 0;
2453 for(charge=-1; charge<2; charge+=2)
2459 int trkID = m_houghTrackList.size();
2460 double binTheta(0.), binRho(0.);
2461 HoughTrack track(charge, x_peak, y_peak, binTheta, binRho, trkID);
2464 m_fineRhoThetaMap.Reset();
2465 m_fineRhoThetaMap.SetBins(nFineBin_Theta,x_min,x_max,nFineBin_Rho,y_min,y_max);
2469 if(fabs(y_weight)<0.02)
2472 nHitFilled =
fillHistogram(m_XHoughHitList,&m_fineRhoThetaMap,0,vote);
2477 nHitFilled =
fillHistogram(m_XHoughHitList,&m_fineRhoThetaMap,charge,vote);
2484 double theta_peak, rho_peak, theta_weight, rho_weight;
2485 getWeightedPeak(m_fineRhoThetaMap, theta_peak, rho_peak, theta_weight, rho_weight);
2488 track.update(theta_weight,rho_weight);
2496 track.resetNhitHalf();
2498 if(fabs(y_weight)<0.02) {
2499 track.findXHot(m_XHoughHitList,0);
2501 if(track.getNhitUnusedFirstHalf()<track.getNhitUnusedSecondHalf())
2513 nXsel = track.findXHot(m_XHoughHitList, charge);
2516 NHitTried = track.getNTried();
2518 if(track.isAGoodCircle()) {
2523 if(m_fitFlag>0)
TrkErrCode trkErrCode = track.fitCircle(m_mdcDetector,m_trkContextEv,m_bunchT0);
2528 int nXsel_new = track.findXHot(m_XHoughHitList, charge);
2530 NHitTried = track.getNTried();
2537 if(track.isAGoodCircle()) {
2538 track.markUsedHot(1);
2540 m_houghTrackList.push_back(track);
2549 track.markUsedHot(-1);
2555 track.markUsedHot(-1);
2561 if(!tryCgemLeftOnly) {
2563 tryCgemLeftOnly=
true;
2565 if(nCgemHitsLeft>=3) {
2578void HoughFinder::getWeightedPeak(TH2D& h,
double& x_peak,
double& y_peak,
double& x_weight,
double& y_weight,
int x_ext,
int y_ext)
2580 int ix_max, iy_max, iz_max;
2581 h.GetMaximumBin(ix_max, iy_max, iz_max);
2582 int nx=h.GetXaxis()->GetNbins();
2583 int ny=h.GetYaxis()->GetNbins();
2586 if(ix_max==0&&iy_max==0) {
2588 for(
int i=0; i<nx; i++)
2591 for(
int j=0; j<ny; j++)
2593 double n_tmp = h.GetBinContent(i,j);
2599 x_peak=h.GetXaxis()->GetBinCenter(ix_max);
2600 y_peak=h.GetYaxis()->GetBinCenter(iy_max);
2601 x_weight=0.; y_weight=0.;
2603 if(x_ext>=0&&y_ext>=0) {
2604 for(
int i1=ix_max-x_ext; i1<=ix_max+x_ext; i1++)
2606 double x_tmp = h.GetXaxis()->GetBinCenter(i1);
2611 for(
int i2=iy_max-y_ext; i2<=iy_max+y_ext; i2++)
2613 double n_tmp = h.GetBinContent(i1_tmp,i2);
2614 if(i2<1||i2>ny) n_tmp=0.;
2615 if(i1<1||i1>nx) n_tmp=0.;
2617 double y_tmp = h.GetYaxis()->GetBinCenter(i2);
2618 x_weight+=x_tmp*n_tmp;
2619 y_weight+=y_tmp*n_tmp;
2623 x_weight=x_weight/
weight;
2624 y_weight=y_weight/
weight;
2633int HoughFinder::nFineBinTheta(
double rho)
2635 double rho_rough = fabs(rho);
2636 double k_theta = (600.-1200.)/0.0335;
2637 int nThetaFine = int(k_theta*rho_rough+1200);
2638 if(nThetaFine<500) nThetaFine=500;
2641 nThetaFine=ceil(1.0*nThetaFine/m_nBinTheta*m_ExtPeak_theta);
2645int HoughFinder::nFineBinRho(
double rho)
2647 double rho_rough = fabs(rho);
2649 if(rho_rough<0.0198)
2651 double k1_rho = (850.-1200.)/0.0198;
2652 nRhoFine=int(k1_rho*rho_rough+1200);
2654 else if(rho_rough<0.03)
2656 double k2_rho = (300.-850.)/(0.03-0.0198);
2657 nRhoFine=int(k2_rho*(rho_rough-0.0198)+850.);
2661 double k3_rho = (100.-300.)/(0.056-0.03);
2662 nRhoFine=int(k3_rho*(rho_rough-0.03)+300.);
2663 if(nRhoFine<50) nRhoFine=50;
2666 nRhoFine=ceil(1.0*nRhoFine/m_nBinRho*m_ExtPeak_rho);
2671void HoughFinder::XhitCutWindow(
double rho,
int ilayer,
double charge,
double& cut1,
double &cut2)
2674 if(rho>0.07) rho=0.07;
2675 TGraph* g_cut1, *g_cut2;
2680 else if(ilayer<=19) {
2684 else if(ilayer<=42) {
2689 cut1=g_cut1->Eval(rho);
2690 cut2=g_cut2->Eval(rho);
2697 double cut=max(fabs(cut1),fabs(cut2));
2715 trackVector.clear();
2721 vector<MdcHit*>::iterator imdcHit = m_mdcHitCol.begin();
2722 for(;imdcHit != m_mdcHitCol.end();imdcHit++){
2726 for(vector<HoughTrack>::iterator trkIT = m_houghTrackList.begin();trkIT!=m_houghTrackList.end();trkIT++){
2727 trkIT->clearMemory();
2737 vector<HoughHit*>::iterator
iter = hitPntList.begin();
2738 for(;
iter!=hitPntList.end();
iter++)
2742 int useOld = (*iter)->getUse();
2743 int iLayer = (*iter)->getLayer();
2745 if(useOld==-1||useOld==0) {
2751 if(useOld==0) (*iter)->setUse(-1);
2760 vector<HoughHit*>::iterator itHit = hitList.begin();
2761 for(; itHit!=hitList.end(); itHit++)
2765 vector<int> trkIdList = (*itHit)->getTrkID();
2766 int nTrkSharing = trkIdList.size();
2771 int trkId_minDelD=-1;
2772 double minResid = 99.0;
2774 vector<double> vecRes = (*itHit)->getVecResid();
2775 int nTrk = vecRes.size();
2777 for(
int i=0; i<nTrk; i++)
2780 if(minResid>fabs(vecRes[i])) {
2781 minResid=fabs(vecRes[i]);
2782 trkId_minDelD=trkIdList[i];
2787 for(
int i=0; i<nTrk; i++)
2789 if(trkIdList[i]!=trkId_minDelD) {
2790 (*itHit)->dropTrkID(trkIdList[i]);
2791 vector<HoughTrack>::iterator itTrk =
getHoughTrkIt(m_houghTrackList,trkIdList[i]);
2792 if(itTrk!=m_houghTrackList.end()) itTrk->dropHitPnt(&(*(*itHit)));
2795 trkIdList = (*itHit)->getTrkID();
2796 nTrkSharing = trkIdList.size();
2805 vector<HoughTrack>::iterator it = houghTrkList.begin();
2806 for(; it!=houghTrkList.end(); it++)
2808 if(it->getTrkID()==trkId)
break;
2814int HoughFinder::associateVHits()
2820 for(vector<HoughTrack>::iterator trkIT = m_houghTrackList.begin(); trkIT!=m_houghTrackList.end(); trkIT++){
2824 if(trkIT->getFlag()!=0)
continue;
2826 m_roughTanlDzMap.Reset();
2829 nXVhit =
fillHistogram(m_VHoughHitList,&m_roughTanlDzMap,0,vote,&(*trkIT));
2831 double x_peak(0.), y_peak(0.);
2832 double x_weight(0.), y_weight(0.);
2833 getWeightedPeak(m_roughTanlDzMap, x_peak, y_peak, x_weight, y_weight);
2848 trkIT->setTanl(x_weight);
2849 trkIT->setDz(y_weight);
2850 trkIT->updateHelix();
2852 int charge = trkIT->getCharge();
2863 double dr = trkIT->dr();
2864 double phi0 = trkIT->phi0();
2865 double kappa = trkIT->kappa();
2866 double dz = trkIT->dz();
2867 double tanl = trkIT->tanl();
2868 int nHot = trkIT->findVHot(m_VHoughHitList,charge,l);
2869 trkIT->dropRedundentCgemVHits();
2872 vector<HoughHit*> hot = trkIT->getHotList();
2879 if(m_fitFlag>1) trkErrCode = trkIT->fitHelix(m_mdcDetector,m_bfield,m_bunchT0,hot,l);
2882 bool isFitDivergency(
false);
2883 isFitDivergency = isFitDivergency||fabs(trkIT->dr() -dr )>999.;
2884 isFitDivergency = isFitDivergency||fabs(trkIT->phi0() -phi0 )>999.;
2885 isFitDivergency = isFitDivergency||fabs(trkIT->kappa() -kappa)>999.;
2886 isFitDivergency = isFitDivergency||fabs(trkIT->dz() -dz )>999.;
2887 isFitDivergency = isFitDivergency||fabs(trkIT->tanl() -tanl )>999.;
2888 if(isFitDivergency){
2898 if(m_mcTruth)findMcTrack(&(*trkIT));
2902 if(l>m_maxFireLayer)
break;
2906 if(trkIT->getFlag()!=0)
continue;
2910 double dr = trkIT->dr();
2911 double phi0 = trkIT->phi0();
2912 double kappa = trkIT->kappa();
2913 double dz = trkIT->dz();
2914 double tanl = trkIT->tanl();
2916 int nHot = trkIT->findVHot(m_VHoughHitList,charge,l);
2917 trkIT->dropRedundentCgemVHits();
2918 vector<HoughHit*> hot = trkIT->getHotList();
2919 TrkErrCode trkErrCode = trkIT->fitHelix(m_mdcDetector,m_trkContextEv,m_bunchT0,m_mdcHitCol,hot);
2921 bool isFitDivergency(
false);
2922 isFitDivergency = isFitDivergency||fabs(trkIT->dr() -dr )>999.;
2923 isFitDivergency = isFitDivergency||fabs(trkIT->phi0() -phi0 )>999.;
2924 isFitDivergency = isFitDivergency||fabs(trkIT->kappa() -kappa)>999.;
2925 isFitDivergency = isFitDivergency||fabs(trkIT->dz() -dz )>999.;
2926 isFitDivergency = isFitDivergency||fabs(trkIT->tanl() -tanl )>999.;
2927 if(isFitDivergency){
2937 if(m_mcTruth)findMcTrack(&(*trkIT));
2952void HoughFinder::findMcTrack(
HoughTrack* track)
2954 TH1I trkID(
"track index",
"",100,0,100);
2955 vector<HoughHit*> hotList = track->
getHotList();
2956 for(vector<HoughHit*>::iterator hotIt = hotList.begin(); hotIt != hotList.end(); hotIt++){
2957 if((*hotIt)->getPairHit()!=NULL)trkID.Fill(((*hotIt)->getPairHit()->getTrkID())[0]);
2959 int trkid = trkID.GetMaximumBin()-1;
2960 for(vector<HoughTrack>::iterator trkIter = m_mcTrackCol.begin();trkIter!=m_mcTrackCol.end();trkIter++){
2961 if(trkIter->getTrkID()==trkid){
2962 if(m_run<0&&m_mcTruth)track->
setMcTrack(&(*trkIter));
2968int HoughFinder::nFineBinTanl(
double tanl)
2972int HoughFinder::nFineBinDz(
double tanl)
2976void HoughFinder::XVhitCutWindow(
double tanl,
int ilayer,
double charge,
double& cut1,
double &cut2)
2982 MsgStream log(
msgSvc(), name());
2984 NTuplePtr nt1(
ntupleSvc(),
"mdcHoughFinder/hit");
2988 ntuple_hit=
ntupleSvc()->book(
"mdcHoughFinder/hit", CLID_ColumnWiseTuple,
"hit");
2990 ntuple_hit->addItem(
"hit_run", m_hit_run);
2991 ntuple_hit->addItem(
"hit_event", m_hit_event);
2993 ntuple_hit->addItem(
"hit_nhit", m_hit_nhit, 0, 10000);
2994 ntuple_hit->addItem(
"hit_hitID", m_hit_nhit, m_hit_hitID);
2995 ntuple_hit->addItem(
"hit_hitType", m_hit_nhit, m_hit_hitType);
2996 ntuple_hit->addItem(
"hit_layer", m_hit_nhit, m_hit_layer);
2997 ntuple_hit->addItem(
"hit_wire", m_hit_nhit, m_hit_wire);
2998 ntuple_hit->addItem(
"hit_flag", m_hit_nhit, m_hit_flag);
2999 ntuple_hit->addItem(
"hit_halfCircle", m_hit_nhit, m_hit_halfCircle);
3000 ntuple_hit->addItem(
"hit_x", m_hit_nhit, m_hit_x);
3001 ntuple_hit->addItem(
"hit_y", m_hit_nhit, m_hit_y);
3002 ntuple_hit->addItem(
"hit_z", m_hit_nhit, m_hit_z);
3003 ntuple_hit->addItem(
"hit_drift", m_hit_nhit, m_hit_drift);
3005 ntuple_hit->addItem(
"mcHit_hitID", m_hit_nhit, m_mcHit_hitID);
3006 ntuple_hit->addItem(
"mcHit_hitType", m_hit_nhit, m_mcHit_hitType);
3007 ntuple_hit->addItem(
"mcHit_layer", m_hit_nhit, m_mcHit_layer);
3008 ntuple_hit->addItem(
"mcHit_wire", m_hit_nhit, m_mcHit_wire);
3009 ntuple_hit->addItem(
"mcHit_flag", m_hit_nhit, m_mcHit_flag);
3010 ntuple_hit->addItem(
"mcHit_halfCircle", m_hit_nhit, m_mcHit_halfCircle);
3011 ntuple_hit->addItem(
"mcHit_x", m_hit_nhit, m_mcHit_x);
3012 ntuple_hit->addItem(
"mcHit_y", m_hit_nhit, m_mcHit_y);
3013 ntuple_hit->addItem(
"mcHit_z", m_hit_nhit, m_mcHit_z);
3014 ntuple_hit->addItem(
"mcHit_drift", m_hit_nhit, m_mcHit_drift);
3015 }
else { log << MSG::ERROR <<
"Cannot book tuple mdcHoughFinder/hit" <<endmsg;
3016 return StatusCode::FAILURE;
3020 NTuplePtr nt2(
ntupleSvc(),
"mdcHoughFinder/track");
3024 ntuple_track =
ntupleSvc()->book(
"mdcHoughFinder/track", CLID_ColumnWiseTuple,
"track");
3026 ntuple_track->addItem(
"trk_run", m_trk_run);
3027 ntuple_track->addItem(
"trk_event", m_trk_event);
3028 ntuple_track->addItem(
"trk_nTrack", m_trk_nTrack);
3029 ntuple_track->addItem(
"trk_trackID", m_trk_trackID);
3030 ntuple_track->addItem(
"trk_charge", m_trk_charge);
3031 ntuple_track->addItem(
"trk_flag", m_trk_flag);
3032 ntuple_track->addItem(
"trk_angle", m_trk_angle);
3033 ntuple_track->addItem(
"trk_rho", m_trk_rho);
3034 ntuple_track->addItem(
"trk_dAngle", m_trk_dAngle);
3035 ntuple_track->addItem(
"trk_dRho", m_trk_dRho);
3036 ntuple_track->addItem(
"trk_dTanl", m_trk_dTanl);
3037 ntuple_track->addItem(
"trk_dDz", m_trk_dDz);
3038 ntuple_track->addItem(
"trk_Xc", m_trk_Xc);
3039 ntuple_track->addItem(
"trk_Yc", m_trk_Yc);
3040 ntuple_track->addItem(
"trk_R", m_trk_R);
3041 ntuple_track->addItem(
"trk_dr", m_trk_dr);
3042 ntuple_track->addItem(
"trk_phi0", m_trk_phi0);
3043 ntuple_track->addItem(
"trk_kappa", m_trk_kappa);
3044 ntuple_track->addItem(
"trk_dz", m_trk_dz);
3045 ntuple_track->addItem(
"trk_tanl", m_trk_tanl);
3046 ntuple_track->addItem(
"trk_pxy", m_trk_pxy);
3047 ntuple_track->addItem(
"trk_px", m_trk_px);
3048 ntuple_track->addItem(
"trk_py", m_trk_py);
3049 ntuple_track->addItem(
"trk_pz", m_trk_pz);
3050 ntuple_track->addItem(
"trk_p", m_trk_p);
3051 ntuple_track->addItem(
"trk_phi", m_trk_phi);
3052 ntuple_track->addItem(
"trk_theta", m_trk_theta);
3053 ntuple_track->addItem(
"trk_cosTheta", m_trk_cosTheta);
3054 ntuple_track->addItem(
"trk_vx", m_trk_vx);
3055 ntuple_track->addItem(
"trk_vy", m_trk_vy);
3056 ntuple_track->addItem(
"trk_vz", m_trk_vz);
3057 ntuple_track->addItem(
"trk_vr", m_trk_vr);
3058 ntuple_track->addItem(
"trk_chi2", m_trk_chi2);
3059 ntuple_track->addItem(
"trk_fiTerm", m_trk_fiTerm);
3060 ntuple_track->addItem(
"trk_nhit", m_trk_nhit);
3061 ntuple_track->addItem(
"trk_ncluster", m_trk_ncluster);
3062 ntuple_track->addItem(
"trk_stat", m_trk_stat);
3063 ntuple_track->addItem(
"trk_ndof", m_trk_ndof);
3064 ntuple_track->addItem(
"trk_nster", m_trk_nster);
3065 ntuple_track->addItem(
"trk_nlayer", m_trk_nlayer);
3066 ntuple_track->addItem(
"trk_firstLayer", m_trk_firstLayer);
3067 ntuple_track->addItem(
"trk_lastLayer", m_trk_lastLayer);
3068 ntuple_track->addItem(
"trk_nCgemXClusters", m_trk_nCgemXClusters);
3069 ntuple_track->addItem(
"trk_nCgemVClusters", m_trk_nCgemVClusters);
3071 ntuple_track->addItem(
"trk_nHot", m_trk_nHot, 0, 10000);
3072 ntuple_track->addItem(
"hot_hitID", m_trk_nHot, m_hot_hitID);
3073 ntuple_track->addItem(
"hot_hitType", m_trk_nHot, m_hot_hitType);
3074 ntuple_track->addItem(
"hot_layer", m_trk_nHot, m_hot_layer);
3075 ntuple_track->addItem(
"hot_wire", m_trk_nHot, m_hot_wire);
3076 ntuple_track->addItem(
"hot_flag", m_trk_nHot, m_hot_flag);
3077 ntuple_track->addItem(
"hot_halfCircle", m_trk_nHot, m_hot_halfCircle);
3078 ntuple_track->addItem(
"hot_x", m_trk_nHot, m_hot_x);
3079 ntuple_track->addItem(
"hot_y", m_trk_nHot, m_hot_y);
3080 ntuple_track->addItem(
"hot_z", m_trk_nHot, m_hot_z);
3081 ntuple_track->addItem(
"hot_drift", m_trk_nHot, m_hot_drift);
3082 ntuple_track->addItem(
"hot_residual", m_trk_nHot, m_hot_residual);
3084 ntuple_track->addItem(
"mcHot_hitID", m_trk_nHot, m_mcHot_hitID);
3085 ntuple_track->addItem(
"mcHot_hitType", m_trk_nHot, m_mcHot_hitType);
3086 ntuple_track->addItem(
"mcHot_layer", m_trk_nHot, m_mcHot_layer);
3087 ntuple_track->addItem(
"mcHot_wire", m_trk_nHot, m_mcHot_wire);
3088 ntuple_track->addItem(
"mcHot_flag", m_trk_nHot, m_mcHot_flag);
3089 ntuple_track->addItem(
"mcHot_halfCircle", m_trk_nHot, m_mcHot_halfCircle);
3090 ntuple_track->addItem(
"mcHot_x", m_trk_nHot, m_mcHot_x);
3091 ntuple_track->addItem(
"mcHot_y", m_trk_nHot, m_mcHot_y);
3092 ntuple_track->addItem(
"mcHot_z", m_trk_nHot, m_mcHot_z);
3093 ntuple_track->addItem(
"mcHot_drift", m_trk_nHot, m_mcHot_drift);
3095 ntuple_track->addItem(
"mcTrk_trackID", m_mcTrk_trackID);
3096 ntuple_track->addItem(
"mcTrk_charge", m_mcTrk_charge);
3097 ntuple_track->addItem(
"mcTrk_flag", m_mcTrk_flag);
3098 ntuple_track->addItem(
"mcTrk_angle", m_mcTrk_angle);
3099 ntuple_track->addItem(
"mcTrk_rho", m_mcTrk_rho);
3100 ntuple_track->addItem(
"mcTrk_dAngle", m_mcTrk_dAngle);
3101 ntuple_track->addItem(
"mcTrk_dRho", m_mcTrk_dRho);
3102 ntuple_track->addItem(
"mcTrk_dTanl", m_mcTrk_dTanl);
3103 ntuple_track->addItem(
"mcTrk_dDz", m_mcTrk_dDz);
3104 ntuple_track->addItem(
"mcTrk_Xc", m_mcTrk_Xc);
3105 ntuple_track->addItem(
"mcTrk_Yc", m_mcTrk_Yc);
3106 ntuple_track->addItem(
"mcTrk_R", m_mcTrk_R);
3107 ntuple_track->addItem(
"mcTrk_dr", m_mcTrk_dr);
3108 ntuple_track->addItem(
"mcTrk_phi0", m_mcTrk_phi0);
3109 ntuple_track->addItem(
"mcTrk_kappa", m_mcTrk_kappa);
3110 ntuple_track->addItem(
"mcTrk_dz", m_mcTrk_dz);
3111 ntuple_track->addItem(
"mcTrk_tanl", m_mcTrk_tanl);
3112 ntuple_track->addItem(
"mcTrk_pxy", m_mcTrk_pxy);
3113 ntuple_track->addItem(
"mcTrk_px", m_mcTrk_px);
3114 ntuple_track->addItem(
"mcTrk_py", m_mcTrk_py);
3115 ntuple_track->addItem(
"mcTrk_pz", m_mcTrk_pz);
3116 ntuple_track->addItem(
"mcTrk_p", m_mcTrk_p);
3117 ntuple_track->addItem(
"mcTrk_phi", m_mcTrk_phi);
3118 ntuple_track->addItem(
"mcTrk_theta", m_mcTrk_theta);
3119 ntuple_track->addItem(
"mcTrk_cosTheta", m_mcTrk_cosTheta);
3120 ntuple_track->addItem(
"mcTrk_vx", m_mcTrk_vx);
3121 ntuple_track->addItem(
"mcTrk_vy", m_mcTrk_vy);
3122 ntuple_track->addItem(
"mcTrk_vz", m_mcTrk_vz);
3123 ntuple_track->addItem(
"mcTrk_vr", m_mcTrk_vr);
3124 ntuple_track->addItem(
"mcTrk_chi2", m_mcTrk_chi2);
3125 ntuple_track->addItem(
"mcTrk_fiTerm", m_mcTrk_fiTerm);
3126 ntuple_track->addItem(
"mcTrk_nhit", m_mcTrk_nhit);
3127 ntuple_track->addItem(
"mcTrk_ncluster", m_mcTrk_ncluster);
3128 ntuple_track->addItem(
"mcTrk_stat", m_mcTrk_stat);
3129 ntuple_track->addItem(
"mcTrk_ndof", m_mcTrk_ndof);
3130 ntuple_track->addItem(
"mcTrk_nster", m_mcTrk_nster);
3131 ntuple_track->addItem(
"mcTrk_nlayer", m_mcTrk_nlayer);
3132 ntuple_track->addItem(
"mcTrk_firstLayer", m_mcTrk_firstLayer);
3133 ntuple_track->addItem(
"mcTrk_lastLayer", m_mcTrk_lastLayer);
3134 ntuple_track->addItem(
"mcTrk_nCgemXClusters", m_mcTrk_nCgemXClusters);
3135 ntuple_track->addItem(
"mcTrk_nCgemVClusters", m_mcTrk_nCgemVClusters);
3137 ntuple_track->addItem(
"mcTrk_nHot", m_mcTrk_nHot, 0, 10000);
3138 ntuple_track->addItem(
"mcTrkHot_hitID", m_mcTrk_nHot, m_mcTrkHot_hitID);
3139 ntuple_track->addItem(
"mcTrkHot_hitType", m_mcTrk_nHot, m_mcTrkHot_hitType);
3140 ntuple_track->addItem(
"mcTrkHot_layer", m_mcTrk_nHot, m_mcTrkHot_layer);
3141 ntuple_track->addItem(
"mcTrkHot_wire", m_mcTrk_nHot, m_mcTrkHot_wire);
3142 ntuple_track->addItem(
"mcTrkHot_flag", m_mcTrk_nHot, m_mcTrkHot_flag);
3143 ntuple_track->addItem(
"mcTrkHot_halfCircle", m_mcTrk_nHot, m_mcTrkHot_halfCircle);
3144 ntuple_track->addItem(
"mcTrkHot_x", m_mcTrk_nHot, m_mcTrkHot_x);
3145 ntuple_track->addItem(
"mcTrkHot_y", m_mcTrk_nHot, m_mcTrkHot_y);
3146 ntuple_track->addItem(
"mcTrkHot_z", m_mcTrk_nHot, m_mcTrkHot_z);
3147 ntuple_track->addItem(
"mcTrkHot_drift", m_mcTrk_nHot, m_mcTrkHot_drift);
3149 log << MSG::ERROR <<
"Cannot book tuple mdcHoughFinder/track" <<endmsg;
3150 return StatusCode::FAILURE;
3154 NTuplePtr nt3(
ntupleSvc(),
"mdcHoughFinder/event");
3158 ntuple_event =
ntupleSvc()->book(
"mdcHoughFinder/event", CLID_ColumnWiseTuple,
"event");
3160 ntuple_event->addItem(
"evt_run", m_evt_run);
3161 ntuple_event->addItem(
"evt_event", m_evt_event);
3162 ntuple_event->addItem(
"evt_nXCluster", m_evt_nXCluster);
3163 ntuple_event->addItem(
"evt_nVCluster", m_evt_nVCluster);
3164 ntuple_event->addItem(
"evt_nXVCluster", m_evt_nXVCluster);
3165 ntuple_event->addItem(
"evt_nCgemCluster", m_evt_nCGEMCluster);
3166 ntuple_event->addItem(
"evt_nAxialHit", m_evt_nAxialHit);
3167 ntuple_event->addItem(
"evt_nStereoHit", m_evt_nStereoHit);
3168 ntuple_event->addItem(
"evt_nODCHit", m_evt_nODCHit);
3169 ntuple_event->addItem(
"evt_nHit", m_evt_nHit);
3171 ntuple_event->addItem(
"evt_nTrack", m_evt_nTrack, 0, 100);
3172 ntuple_event->addItem(
"evtTrk_trackID", m_evt_nTrack, m_evtTrk_trackID);
3173 ntuple_event->addItem(
"evtTrk_charge", m_evt_nTrack, m_evtTrk_charge);
3174 ntuple_event->addItem(
"evtTrk_flag", m_evt_nTrack, m_evtTrk_flag);
3175 ntuple_event->addItem(
"evtTrk_angle", m_evt_nTrack, m_evtTrk_angle);
3176 ntuple_event->addItem(
"evtTrk_rho", m_evt_nTrack, m_evtTrk_rho);
3177 ntuple_event->addItem(
"evtTrk_dAngle", m_evt_nTrack, m_evtTrk_dAngle);
3178 ntuple_event->addItem(
"evtTrk_dRho", m_evt_nTrack, m_evtTrk_dRho);
3179 ntuple_event->addItem(
"evtTrk_dTanl", m_evt_nTrack, m_evtTrk_dTanl);
3180 ntuple_event->addItem(
"evtTrk_dDz", m_evt_nTrack, m_evtTrk_dDz);
3181 ntuple_event->addItem(
"evtTrk_Xc", m_evt_nTrack, m_evtTrk_Xc);
3182 ntuple_event->addItem(
"evtTrk_Yc", m_evt_nTrack, m_evtTrk_Yc);
3183 ntuple_event->addItem(
"evtTrk_R", m_evt_nTrack, m_evtTrk_R);
3184 ntuple_event->addItem(
"evtTrk_dr", m_evt_nTrack, m_evtTrk_dr);
3185 ntuple_event->addItem(
"evtTrk_phi0", m_evt_nTrack, m_evtTrk_phi0);
3186 ntuple_event->addItem(
"evtTrk_kappa", m_evt_nTrack, m_evtTrk_kappa);
3187 ntuple_event->addItem(
"evtTrk_dz", m_evt_nTrack, m_evtTrk_dz);
3188 ntuple_event->addItem(
"evtTrk_tanl", m_evt_nTrack, m_evtTrk_tanl);
3189 ntuple_event->addItem(
"evtTrk_pxy", m_evt_nTrack, m_evtTrk_pxy);
3190 ntuple_event->addItem(
"evtTrk_px", m_evt_nTrack, m_evtTrk_px);
3191 ntuple_event->addItem(
"evtTrk_py", m_evt_nTrack, m_evtTrk_py);
3192 ntuple_event->addItem(
"evtTrk_pz", m_evt_nTrack, m_evtTrk_pz);
3193 ntuple_event->addItem(
"evtTrk_p", m_evt_nTrack, m_evtTrk_p);
3194 ntuple_event->addItem(
"evtTrk_phi", m_evt_nTrack, m_evtTrk_phi);
3195 ntuple_event->addItem(
"evtTrk_theta", m_evt_nTrack, m_evtTrk_theta);
3196 ntuple_event->addItem(
"evtTrk_cosTheta", m_evt_nTrack, m_evtTrk_cosTheta);
3197 ntuple_event->addItem(
"evtTrk_vx", m_evt_nTrack, m_evtTrk_vx);
3198 ntuple_event->addItem(
"evtTrk_vy", m_evt_nTrack, m_evtTrk_vy);
3199 ntuple_event->addItem(
"evtTrk_vz", m_evt_nTrack, m_evtTrk_vz);
3200 ntuple_event->addItem(
"evtTrk_vr", m_evt_nTrack, m_evtTrk_vr);
3201 ntuple_event->addItem(
"evtTrk_chi2", m_evt_nTrack, m_evtTrk_chi2);
3202 ntuple_event->addItem(
"evtTrk_fiTerm", m_evt_nTrack, m_evtTrk_fiTerm);
3203 ntuple_event->addItem(
"evtTrk_nhit", m_evt_nTrack, m_evtTrk_nhit);
3204 ntuple_event->addItem(
"evtTrk_ncluster", m_evt_nTrack, m_evtTrk_ncluster);
3205 ntuple_event->addItem(
"evtTrk_stat", m_evt_nTrack, m_evtTrk_stat);
3206 ntuple_event->addItem(
"evtTrk_ndof", m_evt_nTrack, m_evtTrk_ndof);
3207 ntuple_event->addItem(
"evtTrk_nster", m_evt_nTrack, m_evtTrk_nster);
3208 ntuple_event->addItem(
"evtTrk_nlayer", m_evt_nTrack, m_evtTrk_nlayer);
3209 ntuple_event->addItem(
"evtTrk_firstLayer", m_evt_nTrack, m_evtTrk_firstLayer);
3210 ntuple_event->addItem(
"evtTrk_lastLayer", m_evt_nTrack, m_evtTrk_lastLayer);
3211 ntuple_event->addItem(
"evtTrk_nCgemXClusters", m_evt_nTrack, m_evtTrk_nCgemXClusters);
3212 ntuple_event->addItem(
"evtTrk_nCgemVClusters", m_evt_nTrack, m_evtTrk_nCgemVClusters);
3214 ntuple_event->addItem(
"mcEvtTrk_trackID", m_evt_nTrack, m_mcEvtTrk_trackID);
3215 ntuple_event->addItem(
"mcEvtTrk_charge", m_evt_nTrack, m_mcEvtTrk_charge);
3216 ntuple_event->addItem(
"mcEvtTrk_flag", m_evt_nTrack, m_mcEvtTrk_flag);
3217 ntuple_event->addItem(
"mcEvtTrk_angle", m_evt_nTrack, m_mcEvtTrk_angle);
3218 ntuple_event->addItem(
"mcEvtTrk_rho", m_evt_nTrack, m_mcEvtTrk_rho);
3219 ntuple_event->addItem(
"mcEvtTrk_dAngle", m_evt_nTrack, m_mcEvtTrk_dAngle);
3220 ntuple_event->addItem(
"mcEvtTrk_dRho", m_evt_nTrack, m_mcEvtTrk_dRho);
3221 ntuple_event->addItem(
"mcEvtTrk_dTanl", m_evt_nTrack, m_mcEvtTrk_dTanl);
3222 ntuple_event->addItem(
"mcEvtTrk_dDz", m_evt_nTrack, m_mcEvtTrk_dDz);
3223 ntuple_event->addItem(
"mcEvtTrk_Xc", m_evt_nTrack, m_mcEvtTrk_Xc);
3224 ntuple_event->addItem(
"mcEvtTrk_Yc", m_evt_nTrack, m_mcEvtTrk_Yc);
3225 ntuple_event->addItem(
"mcEvtTrk_R", m_evt_nTrack, m_mcEvtTrk_R);
3226 ntuple_event->addItem(
"mcEvtTrk_dr", m_evt_nTrack, m_mcEvtTrk_dr);
3227 ntuple_event->addItem(
"mcEvtTrk_phi0", m_evt_nTrack, m_mcEvtTrk_phi0);
3228 ntuple_event->addItem(
"mcEvtTrk_kappa", m_evt_nTrack, m_mcEvtTrk_kappa);
3229 ntuple_event->addItem(
"mcEvtTrk_dz", m_evt_nTrack, m_mcEvtTrk_dz);
3230 ntuple_event->addItem(
"mcEvtTrk_tanl", m_evt_nTrack, m_mcEvtTrk_tanl);
3231 ntuple_event->addItem(
"mcEvtTrk_pxy", m_evt_nTrack, m_mcEvtTrk_pxy);
3232 ntuple_event->addItem(
"mcEvtTrk_px", m_evt_nTrack, m_mcEvtTrk_px);
3233 ntuple_event->addItem(
"mcEvtTrk_py", m_evt_nTrack, m_mcEvtTrk_py);
3234 ntuple_event->addItem(
"mcEvtTrk_pz", m_evt_nTrack, m_mcEvtTrk_pz);
3235 ntuple_event->addItem(
"mcEvtTrk_p", m_evt_nTrack, m_mcEvtTrk_p);
3236 ntuple_event->addItem(
"mcEvtTrk_phi", m_evt_nTrack, m_mcEvtTrk_phi);
3237 ntuple_event->addItem(
"mcEvtTrk_theta", m_evt_nTrack, m_mcEvtTrk_theta);
3238 ntuple_event->addItem(
"mcEvtTrk_cosTheta", m_evt_nTrack, m_mcEvtTrk_cosTheta);
3239 ntuple_event->addItem(
"mcEvtTrk_vx", m_evt_nTrack, m_mcEvtTrk_vx);
3240 ntuple_event->addItem(
"mcEvtTrk_vy", m_evt_nTrack, m_mcEvtTrk_vy);
3241 ntuple_event->addItem(
"mcEvtTrk_vz", m_evt_nTrack, m_mcEvtTrk_vz);
3242 ntuple_event->addItem(
"mcEvtTrk_vr", m_evt_nTrack, m_mcEvtTrk_vr);
3243 ntuple_event->addItem(
"mcEvtTrk_chi2", m_evt_nTrack, m_mcEvtTrk_chi2);
3244 ntuple_event->addItem(
"mcEvtTrk_fiTerm", m_evt_nTrack, m_mcEvtTrk_fiTerm);
3245 ntuple_event->addItem(
"mcEvtTrk_nhit", m_evt_nTrack, m_mcEvtTrk_nhit);
3246 ntuple_event->addItem(
"mcEvtTrk_ncluster", m_evt_nTrack, m_mcEvtTrk_ncluster);
3247 ntuple_event->addItem(
"mcEvtTrk_stat", m_evt_nTrack, m_mcEvtTrk_stat);
3248 ntuple_event->addItem(
"mcEvtTrk_ndof", m_evt_nTrack, m_mcEvtTrk_ndof);
3249 ntuple_event->addItem(
"mcEvtTrk_nster", m_evt_nTrack, m_mcEvtTrk_nster);
3250 ntuple_event->addItem(
"mcEvtTrk_nlayer", m_evt_nTrack, m_mcEvtTrk_nlayer);
3251 ntuple_event->addItem(
"mcEvtTrk_firstLayer", m_evt_nTrack, m_mcEvtTrk_firstLayer);
3252 ntuple_event->addItem(
"mcEvtTrk_lastLayer", m_evt_nTrack, m_mcEvtTrk_lastLayer);
3253 ntuple_event->addItem(
"mcEvtTrk_nCgemXClusters", m_evt_nTrack, m_mcEvtTrk_nCgemXClusters);
3254 ntuple_event->addItem(
"mcEvtTrk_nCgemVClusters", m_evt_nTrack, m_mcEvtTrk_nCgemVClusters);
3256 log << MSG::ERROR <<
"Cannot book tuple mdcHoughFinder/event" <<endmsg;
3257 return StatusCode::FAILURE;
3260 return StatusCode::SUCCESS;
3263int HoughFinder::dumpHit()
3266 m_hit_event = m_event;
3267 m_hit_nhit = m_houghHitList.size();
3269 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end(); hitIt++){
3270 m_hit_hitID[i] = hitIt->getHitID();
3271 m_hit_hitType[i] = hitIt->getHitType();
3272 m_hit_layer[i] = hitIt->getLayer();
3273 m_hit_wire[i] = hitIt->getWire();
3274 m_hit_flag[i] = hitIt->getFlag();
3275 m_hit_halfCircle[i] = hitIt->getHalfCircle();
3276 m_hit_x[i] = hitIt->getHitPosition().x();
3277 m_hit_y[i] = hitIt->getHitPosition().y();
3278 m_hit_z[i] = hitIt->getHitPosition().z();
3279 m_hit_drift[i] = hitIt->getDriftDist();
3281 if(hitIt->getPairHit()!=NULL){
3282 m_mcHit_hitID[i] = hitIt->getPairHit()->getHitID();
3283 m_mcHit_hitType[i] = hitIt->getPairHit()->getHitType();
3284 m_mcHit_layer[i] = hitIt->getPairHit()->getLayer();
3285 m_mcHit_wire[i] = hitIt->getPairHit()->getWire();
3286 m_mcHit_flag[i] = hitIt->getPairHit()->getFlag();
3287 m_mcHit_halfCircle[i] = hitIt->getPairHit()->getHalfCircle();
3288 m_mcHit_x[i] = hitIt->getPairHit()->getHitPosition().x();
3289 m_mcHit_y[i] = hitIt->getPairHit()->getHitPosition().y();
3290 m_mcHit_z[i] = hitIt->getPairHit()->getHitPosition().z();
3291 m_mcHit_drift[i] = hitIt->getPairHit()->getDriftDist();
3295 ntuple_hit->write();
3296 return m_houghHitList.size();
3299int HoughFinder::dumpHoughTrack()
3301 if(m_houghTrackList.size()==0)
return 0;
3303 m_trk_event = m_event;
3304 m_trk_nTrack = m_houghTrackList.size();
3305 HepPoint3D positionOntrack(999,999,999), positionOnDetector(999,999,999);
3306 for(vector<HoughTrack>::iterator trkIt = m_houghTrackList.begin(); trkIt != m_houghTrackList.end(); trkIt++){
3307 m_trk_trackID = trkIt->getTrkID();
3308 m_trk_charge = trkIt->getCharge();
3309 m_trk_flag = trkIt->getFlag();
3310 m_trk_angle = trkIt->getAngle();
3311 m_trk_rho = trkIt->getRho();
3312 m_trk_dAngle = trkIt->getDAngle();
3313 m_trk_dRho = trkIt->getDRho();
3314 m_trk_dTanl = trkIt->getDTanl();
3315 m_trk_dDz = trkIt->getDDz();
3316 m_trk_Xc = trkIt->center().x();
3317 m_trk_Yc = trkIt->center().y();
3318 m_trk_R = trkIt->radius();
3319 m_trk_dr = trkIt->dr();
3320 m_trk_phi0 = trkIt->phi0();
3321 m_trk_kappa = trkIt->kappa();
3322 m_trk_dz = trkIt->dz();
3323 m_trk_tanl = trkIt->tanl();
3324 m_trk_pxy = trkIt->pt();
3325 m_trk_px = trkIt->momentum(0).x();
3326 m_trk_py = trkIt->momentum(0).y();
3327 m_trk_pz = trkIt->momentum(0).z();
3328 m_trk_p = trkIt->momentum(0).mag();
3329 m_trk_phi = trkIt->direction(0).phi();
3330 m_trk_theta = trkIt->direction(0).theta();
3331 m_trk_cosTheta =
cos(trkIt->direction(0).theta());
3332 m_trk_vx = trkIt->x(0).x();
3333 m_trk_vy = trkIt->x(0).y();
3334 m_trk_vz = trkIt->x(0).z();
3335 m_trk_vr = trkIt->x(0).perp();
3336 m_trk_chi2 = trkIt->getChi2();
3350 vector<HoughHit*> hotList = trkIt->getHotList();
3351 m_trk_nHot = hotList.size();
3353 for(vector<HoughHit*>::iterator hotIt = hotList.begin(); hotIt != hotList.end(); hotIt++){
3354 m_hot_hitID[i] = (*hotIt)->getHitID();
3355 m_hot_hitType[i] = (*hotIt)->getHitType();
3356 m_hot_layer[i] = (*hotIt)->getLayer();
3357 m_hot_wire[i] = (*hotIt)->getWire();
3358 m_hot_flag[i] = (*hotIt)->getFlag();
3359 m_hot_halfCircle[i] = (*hotIt)->getHalfCircle();
3360 m_hot_x[i] = (*hotIt)->getHitPosition().x();
3361 m_hot_y[i] = (*hotIt)->getHitPosition().y();
3362 m_hot_z[i] = (*hotIt)->getHitPosition().z();
3363 m_hot_drift[i] = (*hotIt)->getDriftDist();
3364 m_hot_residual[i] = (*hotIt)->residual(&(*trkIt),positionOntrack, positionOnDetector);
3366 if((*hotIt)->getPairHit()!=NULL){
3367 m_mcHot_hitID[i] = (*hotIt)->getPairHit()->getHitID();
3368 m_mcHot_hitType[i] = (*hotIt)->getPairHit()->getHitType();
3369 m_mcHot_layer[i] = (*hotIt)->getPairHit()->getLayer();
3370 m_mcHot_wire[i] = (*hotIt)->getPairHit()->getWire();
3371 m_mcHot_flag[i] = (*hotIt)->getPairHit()->getFlag();
3372 m_mcHot_halfCircle[i] = (*hotIt)->getPairHit()->getHalfCircle();
3373 m_mcHot_x[i] = (*hotIt)->getPairHit()->getHitPosition().x();
3374 m_mcHot_y[i] = (*hotIt)->getPairHit()->getHitPosition().y();
3375 m_mcHot_z[i] = (*hotIt)->getPairHit()->getHitPosition().z();
3376 m_mcHot_drift[i] = (*hotIt)->getPairHit()->getDriftDist();
3381 if(trkIt->getMcTrack()!=NULL){
3382 m_mcTrk_trackID = trkIt->getMcTrack()->getTrkID();
3383 m_mcTrk_charge = trkIt->getMcTrack()->getCharge();
3384 m_mcTrk_flag = trkIt->getMcTrack()->getFlag();
3385 m_mcTrk_angle = trkIt->getMcTrack()->getAngle();
3386 m_mcTrk_rho = trkIt->getMcTrack()->getRho();
3387 m_mcTrk_dAngle = trkIt->getMcTrack()->getDAngle();
3388 m_mcTrk_dRho = trkIt->getMcTrack()->getDRho();
3389 m_mcTrk_dTanl = trkIt->getMcTrack()->getDTanl();
3390 m_mcTrk_dDz = trkIt->getMcTrack()->getDDz();
3391 m_mcTrk_Xc = trkIt->getMcTrack()->center().x();
3392 m_mcTrk_Yc = trkIt->getMcTrack()->center().y();
3393 m_mcTrk_R = trkIt->getMcTrack()->radius();
3394 m_mcTrk_dr = trkIt->getMcTrack()->dr();
3395 m_mcTrk_phi0 = trkIt->getMcTrack()->phi0();
3396 m_mcTrk_kappa = trkIt->getMcTrack()->kappa();
3397 m_mcTrk_dz = trkIt->getMcTrack()->dz();
3398 m_mcTrk_tanl = trkIt->getMcTrack()->tanl();
3399 m_mcTrk_pxy = trkIt->getMcTrack()->pt();
3400 m_mcTrk_px = trkIt->getMcTrack()->momentum(0).x();
3401 m_mcTrk_py = trkIt->getMcTrack()->momentum(0).y();
3402 m_mcTrk_pz = trkIt->getMcTrack()->momentum(0).z();
3403 m_mcTrk_p = trkIt->getMcTrack()->momentum(0).mag();
3404 m_mcTrk_phi = trkIt->getMcTrack()->direction(0).phi();
3405 m_mcTrk_theta = trkIt->getMcTrack()->direction(0).theta();
3406 m_mcTrk_cosTheta =
cos(trkIt->getMcTrack()->direction(0).theta());
3407 m_mcTrk_vx = trkIt->getMcTrack()->x(0).x();
3408 m_mcTrk_vy = trkIt->getMcTrack()->x(0).y();
3409 m_mcTrk_vz = trkIt->getMcTrack()->x(0).z();
3410 m_mcTrk_vr = trkIt->getMcTrack()->x(0).perp();
3424 vector<HoughHit*> mcHotList = trkIt->getMcTrack()->getHotList();
3425 m_mcTrk_nHot = mcHotList.size();
3427 for(vector<HoughHit*>::iterator mcHotIt = mcHotList.begin(); mcHotIt != mcHotList.end(); mcHotIt++){
3428 m_mcTrkHot_hitID[j] = (*mcHotIt)->getHitID();
3429 m_mcTrkHot_hitType[j] = (*mcHotIt)->getHitType();
3430 m_mcTrkHot_layer[j] = (*mcHotIt)->getLayer();
3431 m_mcTrkHot_wire[j] = (*mcHotIt)->getWire();
3432 m_mcTrkHot_flag[j] = (*mcHotIt)->getFlag();
3433 m_mcTrkHot_halfCircle[j] = (*mcHotIt)->getHalfCircle();
3434 m_mcTrkHot_x[j] = (*mcHotIt)->getHitPosition().x();
3435 m_mcTrkHot_y[j] = (*mcHotIt)->getHitPosition().y();
3436 m_mcTrkHot_z[j] = (*mcHotIt)->getHitPosition().z();
3437 m_mcTrkHot_drift[j] = (*mcHotIt)->getDriftDist();
3441 ntuple_track->write();
3443 return m_houghTrackList.size();
3446int HoughFinder::dumpHoughEvent()
3448 if(m_houghTrackList.size()==0)
return 0;
3450 m_evt_event = m_event;
3451 m_evt_nTrack = m_houghTrackList.size();
3453 for(vector<HoughTrack>::iterator trkIt = m_houghTrackList.begin(); trkIt != m_houghTrackList.end(); trkIt++){
3455 m_evtTrk_trackID[i] = trkIt->getTrkID();
3456 m_evtTrk_charge[i] = trkIt->getCharge();
3457 m_evtTrk_flag[i] = trkIt->getFlag();
3458 m_evtTrk_angle[i] = trkIt->getAngle();
3459 m_evtTrk_rho[i] = trkIt->getRho();
3460 m_evtTrk_dAngle[i] = trkIt->getDAngle();
3461 m_evtTrk_dRho[i] = trkIt->getDRho();
3462 m_evtTrk_dTanl[i] = trkIt->getDTanl();
3463 m_evtTrk_dDz[i] = trkIt->getDDz();
3464 m_evtTrk_Xc[i] = trkIt->center().x();
3465 m_evtTrk_Yc[i] = trkIt->center().y();
3466 m_evtTrk_R[i] = trkIt->radius();
3467 m_evtTrk_dr[i] = trkIt->dr();
3468 m_evtTrk_phi0[i] = trkIt->phi0();
3469 m_evtTrk_kappa[i] = trkIt->kappa();
3470 m_evtTrk_dz[i] = trkIt->dz();
3471 m_evtTrk_tanl[i] = trkIt->tanl();
3472 m_evtTrk_pxy[i] = trkIt->pt();
3473 m_evtTrk_px[i] = trkIt->momentum(0).x();
3474 m_evtTrk_py[i] = trkIt->momentum(0).y();
3475 m_evtTrk_pz[i] = trkIt->momentum(0).z();
3476 m_evtTrk_p[i] = trkIt->momentum(0).mag();
3477 m_evtTrk_phi[i] = trkIt->direction(0).phi();
3478 m_evtTrk_theta[i] = trkIt->direction(0).theta();
3479 m_evtTrk_cosTheta[i] =
cos(trkIt->direction(0).theta());
3480 m_evtTrk_vx[i] = trkIt->x(0).x();
3481 m_evtTrk_vy[i] = trkIt->x(0).y();
3482 m_evtTrk_vz[i] = trkIt->x(0).z();
3483 m_evtTrk_vr[i] = trkIt->x(0).perp();
3497 if(trkIt->getMcTrack()!=NULL){
3498 m_mcEvtTrk_trackID[i] = trkIt->getMcTrack()->getTrkID();
3499 m_mcEvtTrk_charge[i] = trkIt->getMcTrack()->getCharge();
3500 m_mcEvtTrk_flag[i] = trkIt->getMcTrack()->getFlag();
3501 m_mcEvtTrk_angle[i] = trkIt->getMcTrack()->getAngle();
3502 m_mcEvtTrk_rho[i] = trkIt->getMcTrack()->getRho();
3503 m_mcEvtTrk_dAngle[i] = trkIt->getMcTrack()->getDAngle();
3504 m_mcEvtTrk_dRho[i] = trkIt->getMcTrack()->getDRho();
3505 m_mcEvtTrk_dTanl[i] = trkIt->getMcTrack()->getDTanl();
3506 m_mcEvtTrk_dDz[i] = trkIt->getMcTrack()->getDDz();
3507 m_mcEvtTrk_Xc[i] = trkIt->getMcTrack()->center().x();
3508 m_mcEvtTrk_Yc[i] = trkIt->getMcTrack()->center().y();
3509 m_mcEvtTrk_R[i] = trkIt->getMcTrack()->radius();
3510 m_mcEvtTrk_dr[i] = trkIt->getMcTrack()->dr();
3511 m_mcEvtTrk_phi0[i] = trkIt->getMcTrack()->phi0();
3512 m_mcEvtTrk_kappa[i] = trkIt->getMcTrack()->kappa();
3513 m_mcEvtTrk_dz[i] = trkIt->getMcTrack()->dz();
3514 m_mcEvtTrk_tanl[i] = trkIt->getMcTrack()->tanl();
3515 m_mcEvtTrk_pxy[i] = trkIt->getMcTrack()->pt();
3516 m_mcEvtTrk_px[i] = trkIt->getMcTrack()->momentum(0).x();
3517 m_mcEvtTrk_py[i] = trkIt->getMcTrack()->momentum(0).y();
3518 m_mcEvtTrk_pz[i] = trkIt->getMcTrack()->momentum(0).z();
3519 m_mcEvtTrk_p[i] = trkIt->getMcTrack()->momentum(0).mag();
3520 m_mcEvtTrk_phi[i] = trkIt->getMcTrack()->direction(0).phi();
3521 m_mcEvtTrk_theta[i] = trkIt->getMcTrack()->direction(0).theta();
3522 m_mcEvtTrk_cosTheta[i] =
cos(trkIt->getMcTrack()->direction(0).theta());
3523 m_mcEvtTrk_vx[i] = trkIt->getMcTrack()->x(0).x();
3524 m_mcEvtTrk_vy[i] = trkIt->getMcTrack()->x(0).y();
3525 m_mcEvtTrk_vz[i] = trkIt->getMcTrack()->x(0).z();
3526 m_mcEvtTrk_vr[i] = trkIt->getMcTrack()->x(0).perp();
3542 ntuple_event->write();
3543 return m_houghTrackList.size();
3546int HoughFinder::dumpTdsTrack()
3548 SmartDataPtr<RecMdcTrackCol> recMdcTrackCol(eventSvc(),
"/Event/Recon/RecMdcTrackCol");
3549 if(!recMdcTrackCol)
return 0;
3551 m_evt_event = m_event;
3552 m_evt_nTrack = recMdcTrackCol->size();
3553 for(RecMdcTrackCol::iterator
iter = recMdcTrackCol->begin();
iter!=recMdcTrackCol->end();
iter++){
3554 m_trk_trackID = (*iter)->trackId() ;
3555 m_trk_charge = (*iter)->charge() ;
3566 m_trk_dr = (*iter)->helix(0) ;
3567 m_trk_phi0 = (*iter)->helix(1) ;
3568 m_trk_kappa = (*iter)->helix(2) ;
3569 m_trk_dz = (*iter)->helix(3) ;
3570 m_trk_tanl = (*iter)->helix(4) ;
3571 m_trk_pxy = (*iter)->pxy() ;
3572 m_trk_px = (*iter)->px() ;
3573 m_trk_py = (*iter)->py() ;
3574 m_trk_pz = (*iter)->pz() ;
3575 m_trk_p = (*iter)->p() ;
3576 m_trk_phi = (*iter)->theta() ;
3577 m_trk_theta = (*iter)->phi() ;
3578 m_trk_cosTheta =
cos((*iter)->theta()) ;
3579 m_trk_vx = (*iter)->x() ;
3580 m_trk_vy = (*iter)->y() ;
3581 m_trk_vz = (*iter)->z() ;
3582 m_trk_vr = (*iter)->r() ;
3583 m_trk_chi2 = (*iter)->chi2() ;
3584 m_trk_fiTerm = (*iter)->getFiTerm() ;
3585 m_trk_nhit = (*iter)->getNhits() ;
3586 m_trk_ncluster = (*iter)->getNcluster() ;
3587 m_trk_stat = (*iter)->stat() ;
3588 m_trk_ndof = (*iter)->ndof() ;
3589 m_trk_nster = (*iter)->nster() ;
3590 m_trk_nlayer = (*iter)->nlayer() ;
3591 m_trk_firstLayer = (*iter)->firstLayer() ;
3592 m_trk_lastLayer = (*iter)->lastLayer() ;
3593 m_trk_nCgemXClusters = (*iter)->nCgemXCluster();
3594 m_trk_nCgemVClusters = (*iter)->nCgemVCluster();
3596 HitRefVec hitRefVec = (*iter)->getVecHits();
3597 HitRefVec::iterator hotIt = hitRefVec.begin();
3599 ClusterRefVec::iterator clusterIt = clusterRefVec.begin();
3600 m_trk_nHot = clusterRefVec.size() + hitRefVec.size();
3602 for(clusterIt=clusterRefVec.begin();clusterIt!=clusterRefVec.end();clusterIt++){
3603 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end(); hitIt++){
3605 if((*clusterIt)->getclusterid()==(hitIt)->getCgemCluster()->getclusterid()){
3606 m_hot_hitID[i] = (hitIt)->getHitID();
3607 m_hot_hitType[i] = (hitIt)->getHitType();
3608 m_hot_layer[i] = (hitIt)->getLayer();
3609 m_hot_wire[i] = (hitIt)->getWire();
3610 m_hot_flag[i] = (hitIt)->getFlag();
3611 m_hot_halfCircle[i] = (hitIt)->getHalfCircle();
3612 m_hot_x[i] = (hitIt)->getHitPosition().x();
3613 m_hot_y[i] = (hitIt)->getHitPosition().y();
3614 m_hot_z[i] = (hitIt)->getHitPosition().z();
3615 m_hot_drift[i] = (hitIt)->getDriftDist();
3616 m_hot_residual[i] = -999;
3618 if((hitIt)->getPairHit()!=NULL){
3619 m_mcHot_hitID[i] = (hitIt)->getPairHit()->getHitID();
3620 m_mcHot_hitType[i] = (hitIt)->getPairHit()->getHitType();
3621 m_mcHot_layer[i] = (hitIt)->getPairHit()->getLayer();
3622 m_mcHot_wire[i] = (hitIt)->getPairHit()->getWire();
3623 m_mcHot_flag[i] = (hitIt)->getPairHit()->getFlag();
3624 m_mcHot_halfCircle[i] = (hitIt)->getPairHit()->getHalfCircle();
3625 m_mcHot_x[i] = (hitIt)->getPairHit()->getHitPosition().x();
3626 m_mcHot_y[i] = (hitIt)->getPairHit()->getHitPosition().y();
3627 m_mcHot_z[i] = (hitIt)->getPairHit()->getHitPosition().z();
3628 m_mcHot_drift[i] = (hitIt)->getPairHit()->getDriftDist();
3634 for(hotIt=hitRefVec.begin();hotIt!=hitRefVec.end();hotIt++){
3637 for(
HitVector_Iterator hitIt = m_houghHitList.begin(); hitIt != m_houghHitList.end(); hitIt++){
3639 if(layer == (hitIt)->getLayer() && wire == (hitIt)->getWire()){
3640 m_hot_hitID[i] = (hitIt)->getHitID();
3641 m_hot_hitType[i] = (hitIt)->getHitType();
3642 m_hot_layer[i] = (hitIt)->getLayer();
3643 m_hot_wire[i] = (hitIt)->getWire();
3644 m_hot_flag[i] = (hitIt)->getFlag();
3645 m_hot_halfCircle[i] = (hitIt)->getHalfCircle();
3646 m_hot_x[i] = (hitIt)->getHitPosition().x();
3647 m_hot_y[i] = (hitIt)->getHitPosition().y();
3648 m_hot_z[i] = (hitIt)->getHitPosition().z();
3649 m_hot_drift[i] = (hitIt)->getDriftDist();
3650 m_hot_residual[i] = 999;
3652 if((hitIt)->getPairHit()!=NULL){
3653 m_mcHot_hitID[i] = (hitIt)->getPairHit()->getHitID();
3654 m_mcHot_hitType[i] = (hitIt)->getPairHit()->getHitType();
3655 m_mcHot_layer[i] = (hitIt)->getPairHit()->getLayer();
3656 m_mcHot_wire[i] = (hitIt)->getPairHit()->getWire();
3657 m_mcHot_flag[i] = (hitIt)->getPairHit()->getFlag();
3658 m_mcHot_halfCircle[i] = (hitIt)->getPairHit()->getHalfCircle();
3659 m_mcHot_x[i] = (hitIt)->getPairHit()->getHitPosition().x();
3660 m_mcHot_y[i] = (hitIt)->getPairHit()->getHitPosition().y();
3661 m_mcHot_z[i] = (hitIt)->getPairHit()->getHitPosition().z();
3662 m_mcHot_drift[i] = (hitIt)->getPairHit()->getDriftDist();
3669 int maxSameHitNumber(0);
3670 vector<HoughTrack>::iterator sameTrkIt = m_mcTrackCol.end();
3671 vector<HoughTrack>::iterator trkIter = m_mcTrackCol.begin();
3672 for(;trkIter!=m_mcTrackCol.end();trkIter++){
3673 int sameHitNumber(0);
3674 vector<HoughHit*> hitList = trkIter->getHotList();
3675 for(vector<HoughHit*>::iterator mchotIt = hitList.begin(); mchotIt != hitList.end();mchotIt++){
3677 for(clusterIt=clusterRefVec.begin();clusterIt!=clusterRefVec.end();clusterIt++){
3678 if((*clusterIt)->getclusterid()==(*mchotIt)->getCgemCluster()->getclusterid()){
3683 for(hotIt=hitRefVec.begin();hotIt!=hitRefVec.end();hotIt++){
3686 if(layer == (*mchotIt)->getLayer() && wire == (*mchotIt)->getWire()){
3692 if(sameHitNumber>maxSameHitNumber){
3693 maxSameHitNumber = sameHitNumber;
3694 sameTrkIt = trkIter;
3699 if(sameTrkIt!=m_mcTrackCol.end()){
3700 m_mcTrk_trackID = sameTrkIt->getTrkID();
3701 m_mcTrk_charge = sameTrkIt->getCharge();
3702 m_mcTrk_flag = sameTrkIt->getFlag();
3703 m_mcTrk_angle = sameTrkIt->getAngle();
3704 m_mcTrk_rho = sameTrkIt->getRho();
3705 m_mcTrk_dAngle = sameTrkIt->getDAngle();
3706 m_mcTrk_dRho = sameTrkIt->getDRho();
3707 m_mcTrk_dTanl = sameTrkIt->getDTanl();
3708 m_mcTrk_dDz = sameTrkIt->getDDz();
3709 m_mcTrk_Xc = sameTrkIt->center().x();
3710 m_mcTrk_Yc = sameTrkIt->center().y();
3711 m_mcTrk_R = sameTrkIt->radius();
3712 m_mcTrk_dr = sameTrkIt->dr();
3713 m_mcTrk_phi0 = sameTrkIt->phi0();
3714 m_mcTrk_kappa = sameTrkIt->kappa();
3715 m_mcTrk_dz = sameTrkIt->dz();
3716 m_mcTrk_tanl = sameTrkIt->tanl();
3717 m_mcTrk_pxy = sameTrkIt->pt();
3718 m_mcTrk_px = sameTrkIt->momentum(0).x();
3719 m_mcTrk_py = sameTrkIt->momentum(0).y();
3720 m_mcTrk_pz = sameTrkIt->momentum(0).z();
3721 m_mcTrk_p = sameTrkIt->momentum(0).mag();
3722 m_mcTrk_phi = sameTrkIt->direction(0).phi();
3723 m_mcTrk_theta = sameTrkIt->direction(0).theta();
3724 m_mcTrk_cosTheta =
cos(sameTrkIt->direction(0).theta());
3725 m_mcTrk_vx = sameTrkIt->x(0).x();
3726 m_mcTrk_vy = sameTrkIt->x(0).y();
3727 m_mcTrk_vz = sameTrkIt->x(0).z();
3728 m_mcTrk_vr = sameTrkIt->x(0).perp();
3741 vector<HoughHit*> mcHotList = sameTrkIt->getHotList();
3743 for(vector<HoughHit*>::iterator mcHotIt = mcHotList.begin(); mcHotIt != mcHotList.end(); mcHotIt++){
3744 m_mcTrkHot_hitID[j] = (*mcHotIt)->getHitID();
3745 m_mcTrkHot_hitType[j] = (*mcHotIt)->getHitType();
3746 m_mcTrkHot_layer[j] = (*mcHotIt)->getLayer();
3747 m_mcTrkHot_wire[j] = (*mcHotIt)->getWire();
3748 m_mcTrkHot_flag[j] = (*mcHotIt)->getFlag();
3749 m_mcTrkHot_halfCircle[j] = (*mcHotIt)->getHalfCircle();
3750 m_mcTrkHot_x[j] = (*mcHotIt)->getHitPosition().x();
3751 m_mcTrkHot_y[j] = (*mcHotIt)->getHitPosition().y();
3752 m_mcTrkHot_z[j] = (*mcHotIt)->getHitPosition().z();
3753 m_mcTrkHot_drift[j] = (*mcHotIt)->getDriftDist();
3757 ntuple_track->write();
3759 return recMdcTrackCol->size();
3762int HoughFinder::dumpTdsEvent()
3764 SmartDataPtr<RecMdcTrackCol> recMdcTrackCol(eventSvc(),
"/Event/Recon/RecMdcTrackCol");
3765 if(!recMdcTrackCol)
return 0;
3767 m_evt_event = m_event;
3768 m_evt_nTrack = recMdcTrackCol->size();
3770 for(RecMdcTrackCol::iterator
iter = recMdcTrackCol->begin();
iter!=recMdcTrackCol->end();
iter++){
3771 m_evtTrk_trackID[i] = (*iter)->trackId() ;
3772 m_evtTrk_charge[i] = (*iter)->charge() ;
3783 m_evtTrk_dr[i] = (*iter)->helix(0) ;
3784 m_evtTrk_phi0[i] = (*iter)->helix(1) ;
3785 m_evtTrk_kappa[i] = (*iter)->helix(2) ;
3786 m_evtTrk_dz[i] = (*iter)->helix(3) ;
3787 m_evtTrk_tanl[i] = (*iter)->helix(4) ;
3788 m_evtTrk_pxy[i] = (*iter)->pxy() ;
3789 m_evtTrk_px[i] = (*iter)->px() ;
3790 m_evtTrk_py[i] = (*iter)->py() ;
3791 m_evtTrk_pz[i] = (*iter)->pz() ;
3792 m_evtTrk_p[i] = (*iter)->p() ;
3793 m_evtTrk_phi[i] = (*iter)->theta() ;
3794 m_evtTrk_theta[i] = (*iter)->phi() ;
3795 m_evtTrk_cosTheta[i] =
cos((*iter)->theta()) ;
3796 m_evtTrk_vx[i] = (*iter)->x() ;
3797 m_evtTrk_vy[i] = (*iter)->y() ;
3798 m_evtTrk_vz[i] = (*iter)->z() ;
3799 m_evtTrk_vr[i] = (*iter)->r() ;
3800 m_evtTrk_chi2[i] = (*iter)->chi2() ;
3801 m_evtTrk_fiTerm[i] = (*iter)->getFiTerm() ;
3802 m_evtTrk_nhit[i] = (*iter)->getNhits() ;
3803 m_evtTrk_ncluster[i] = (*iter)->getNcluster() ;
3804 m_evtTrk_stat[i] = (*iter)->stat() ;
3805 m_evtTrk_ndof[i] = (*iter)->ndof() ;
3806 m_evtTrk_nster[i] = (*iter)->nster() ;
3807 m_evtTrk_nlayer[i] = (*iter)->nlayer() ;
3808 m_evtTrk_firstLayer[i] = (*iter)->firstLayer() ;
3809 m_evtTrk_lastLayer[i] = (*iter)->lastLayer() ;
3810 m_evtTrk_nCgemXClusters[i] = (*iter)->nCgemXCluster();
3811 m_evtTrk_nCgemVClusters[i] = (*iter)->nCgemVCluster();
3813 HitRefVec hitRefVec = (*iter)->getVecHits();
3814 HitRefVec::iterator hitIt = hitRefVec.begin();
3816 ClusterRefVec::iterator clusterIt = clusterRefVec.begin();
3818 int maxSameHitNumber(0);
3819 vector<HoughTrack>::iterator sameTrkIt = m_mcTrackCol.end();
3820 vector<HoughTrack>::iterator trkIter = m_mcTrackCol.begin();
3821 for(;trkIter!=m_mcTrackCol.end();trkIter++){
3822 int sameHitNumber(0);
3823 vector<HoughHit*> hitList = trkIter->getHotList();
3824 for(vector<HoughHit*>::iterator hotIt = hitList.begin(); hotIt != hitList.end();hotIt++){
3826 for(;clusterIt!=clusterRefVec.end();clusterIt++){
3827 if((*clusterIt)->getclusterid()==(*hotIt)->getCgemCluster()->getclusterid()){
3832 for(;hitIt!=hitRefVec.end();hitIt++){
3835 if(layer == (*hotIt)->getLayer() && wire == (*hotIt)->getWire()){
3841 if(sameHitNumber>maxSameHitNumber){
3842 maxSameHitNumber = sameHitNumber;
3843 sameTrkIt = trkIter;
3848 if(sameTrkIt!=m_mcTrackCol.end()){
3849 m_mcEvtTrk_trackID[i] = sameTrkIt->getTrkID();
3850 m_mcEvtTrk_charge[i] = sameTrkIt->getCharge();
3851 m_mcEvtTrk_flag[i] = sameTrkIt->getFlag();
3852 m_mcEvtTrk_angle[i] = sameTrkIt->getAngle();
3853 m_mcEvtTrk_rho[i] = sameTrkIt->getRho();
3854 m_mcEvtTrk_dAngle[i] = sameTrkIt->getDAngle();
3855 m_mcEvtTrk_dRho[i] = sameTrkIt->getDRho();
3856 m_mcEvtTrk_dTanl[i] = sameTrkIt->getDTanl();
3857 m_mcEvtTrk_dDz[i] = sameTrkIt->getDDz();
3858 m_mcEvtTrk_Xc[i] = sameTrkIt->center().x();
3859 m_mcEvtTrk_Yc[i] = sameTrkIt->center().y();
3860 m_mcEvtTrk_R[i] = sameTrkIt->radius();
3861 m_mcEvtTrk_dr[i] = sameTrkIt->dr();
3862 m_mcEvtTrk_phi0[i] = sameTrkIt->phi0();
3863 m_mcEvtTrk_kappa[i] = sameTrkIt->kappa();
3864 m_mcEvtTrk_dz[i] = sameTrkIt->dz();
3865 m_mcEvtTrk_tanl[i] = sameTrkIt->tanl();
3866 m_mcEvtTrk_pxy[i] = sameTrkIt->pt();
3867 m_mcEvtTrk_px[i] = sameTrkIt->momentum(0).x();
3868 m_mcEvtTrk_py[i] = sameTrkIt->momentum(0).y();
3869 m_mcEvtTrk_pz[i] = sameTrkIt->momentum(0).z();
3870 m_mcEvtTrk_p[i] = sameTrkIt->momentum(0).mag();
3871 m_mcEvtTrk_phi[i] = sameTrkIt->direction(0).phi();
3872 m_mcEvtTrk_theta[i] = sameTrkIt->direction(0).theta();
3873 m_mcEvtTrk_cosTheta[i] =
cos(sameTrkIt->direction(0).theta());
3874 m_mcEvtTrk_vx[i] = sameTrkIt->x(0).x();
3875 m_mcEvtTrk_vy[i] = sameTrkIt->x(0).y();
3876 m_mcEvtTrk_vz[i] = sameTrkIt->x(0).z();
3877 m_mcEvtTrk_vr[i] = sameTrkIt->x(0).perp();
3893 ntuple_event->write();
3894 return recMdcTrackCol->size();
3899 SmartDataPtr<RecMdcTrackCol> recMdcTrackCol(eventSvc(),
"/Event/Recon/RecMdcTrackCol");
3900 if(!recMdcTrackCol)
return 0;
3901 for(RecMdcTrackCol::iterator
iter = recMdcTrackCol->begin();
iter!=recMdcTrackCol->end();
iter++){
3902 double dr = (*iter)->helix(0) ;
3903 double phi0 = (*iter)->helix(1) ;
3904 double kappa = (*iter)->helix(2) ;
3905 double dz = (*iter)->helix(3) ;
3906 double tanl = (*iter)->helix(4) ;
3907 cout<<setw(12)<<
"dr:" <<setw(15)<<dr
3908 <<setw(12)<<
"phi0:" <<setw(15)<<phi0
3909 <<setw(12)<<
"kappa:" <<setw(15)<<kappa
3910 <<setw(12)<<
"dz:" <<setw(15)<<dz
3911 <<setw(12)<<
"tanl:" <<setw(15)<<tanl
3915 ClusterRefVec::iterator clusterIt = clusterRefVec.begin();
3916 for(clusterIt=clusterRefVec.begin();clusterIt!=clusterRefVec.end();clusterIt++){
3920 HitRefVec hitRefVec = (*iter)->getVecHits();
3921 HitRefVec::iterator hotIt = hitRefVec.begin();
3923 cout<<
"("<<
"l "<<
","<<
" w "<<
") "
3941 for(hotIt=hitRefVec.begin();hotIt!=hitRefVec.end();hotIt++){
3944 cout<<
"("<<setw( 2)<<layer<<
","<<setw( 3)<<wire<<
") "
3945 <<setw( 3)<<(*hotIt)->getStat()
3946 <<setw( 3)<<(*hotIt)->getFlagLR()
3947 <<setw(12)<<(*hotIt)->getDriftDistLeft()
3948 <<setw(12)<<(*hotIt)->getDriftDistRight()
3949 <<setw(12)<<(*hotIt)->getErrDriftDistLeft()
3950 <<setw(12)<<(*hotIt)->getErrDriftDistRight()
3951 <<setw(12)<<(*hotIt)->getChisqAdd()
3954 <<setw(10)<<(*hotIt)->getDriftT()
3955 <<setw(12)<<(*hotIt)->getDoca()
3956 <<setw(12)<<(*hotIt)->getEntra()
3957 <<setw(10)<<(*hotIt)->getZhit()
3958 <<setw(8 )<<(*hotIt)->getFltLen()
3963 return recMdcTrackCol->size();
bool sortCluster(const RecCgemCluster *clusterA, const RecCgemCluster *clusterB)
std::vector< MdcDigi * > MdcDigiVec
bool moreHot(HoughTrack trk1, HoughTrack trk2)
bool largerPt(HoughTrack trk1, HoughTrack trk2)
bool sortCluster(const RecCgemCluster *clusterA, const RecCgemCluster *clusterB)
vector< HoughHit >::iterator HitVector_Iterator
double sin(const BesAngle a)
double cos(const BesAngle a)
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
*********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
const RecCgemCluster * baseHit() const
static int strip(const Identifier &id)
static int sheet(const Identifier &id)
static bool is_xstrip(const Identifier &id)
void setFirstLayer(const int id)
void setPxy(const double pxy)
void setTrackId(const int trackId)
void setPy(const double py)
void setZ(const double z)
void setNster(const int ns)
void setX(const double x)
void setError(double err[15])
void setNdof(const int ndof)
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 setLastLayer(const int id)
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)
const HepPoint3D & pivot(void) const
returns pivot position.
int activeUnusedCgemHitsOnly(vector< HoughHit * > &hitPntList)
int checkTrack(vector< HoughTrack > &trackVector)
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 checkSharedHits(vector< HoughHit * > &hitList)
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)
double getDriftDist() const
void setMdcHit(MdcHit *mdcHit)
void setDigi(const MdcDigi *mdcDigi)
const MdcMcHit * getMdcMcHit() const
HepPoint3D getHitPosition() 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)
int calculateZ_S(HoughHit *hit)
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)
void setErrDriftDistLeft(double erddl)
void setDriftDistLeft(double ddl)
void setDoca(double doca)
void setChisqAdd(double pChisq)
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)
void setNcluster(int ncluster)
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