16#include <CLHEP/Vector/ThreeVector.h>
17#include <CLHEP/Geometry/Point3D.h>
34 const int& fittingMethod)
35 : m_VertexPos(xVertex, yVertex, zVertex),
36 m_VertexSigma(0.0, 0.0, 0.0),
37 m_Part(part), m_Seg(seg), m_Orient(orient),
38 m_Chi2(0.0), m_DOF(0),
39 m_MaxHitsPerGap(0), m_LastGap(0), m_TotalHits(0),
42 m_pHits(0), m_fittingMethod(fittingMethod)
50 if (
this != &orig ) {
51 m_VertexPos = orig.m_VertexPos;
52 m_VertexSigma = orig.m_VertexSigma;
53 m_Index = orig.m_Index;
56 m_Orient = orig.m_Orient;
59 m_FitOK = orig.m_FitOK;
60 m_MaxHitsPerGap = orig.m_MaxHitsPerGap;
61 m_LastGap = orig.m_LastGap;
62 m_TotalHits = orig.m_TotalHits;
63 m_HitDistance = orig.m_HitDistance;
64 m_pHits = orig.m_pHits;
65 m_fittingMethod = orig.m_fittingMethod;
73 : m_VertexPos(source.m_VertexPos),
74 m_VertexSigma(source.m_VertexSigma),
75 m_Index(source.m_Index),
76 m_Part(source.m_Part), m_Seg(source.m_Seg), m_Orient(source.m_Orient),
77 m_Chi2(source.m_Chi2), m_DOF(source.m_DOF),
78 m_MaxHitsPerGap(source.m_MaxHitsPerGap),
79 m_LastGap(source.m_LastGap), m_TotalHits(source.m_TotalHits),
80 m_FitOK(source.m_FitOK),
81 m_HitDistance(source.m_HitDistance),
82 m_pHits(source.m_pHits),
83 m_fittingMethod(source.m_fittingMethod)
94 if (index >= 0) m_Index = index;
104 cout <<
"MucRec2DRoad::AttachHit-E1 null hit pointer!" << endl;
108 int gap = hit->
Gap();
111 cout <<
"MucRec2DRoad::AttachHit-W3 bad gap number = " << gap
118 for (
int i = 0; i < (int)m_pHits.size(); i++) {
119 if (m_pHits[i] == hit)
return;
121 m_pHits.push_back(hit);
131 float a, sa, b, sb, chi;
149 cout <<
"MucRec2DRoad::AttachHit-E1 null hit pointer!" << endl;
153 int gap = hit->
Gap();
156 cout <<
"MucRec2DRoad::AttachHit-W3 bad gap number = " << gap
163 for (
int i = 0; i < (int)m_pHits.size(); i++) {
164 if (m_pHits[i] == hit)
return;
166 m_pHits.push_back(hit);
182 m_MaxNSkippedGaps = numGaps;
191 float& sigmaIntercept,
201 vector<MucRecHit*>::const_iterator iHit;
208 for (
int i = 0; i < m_pHits.size(); i++) {
211 for(
int j = 0; j < m_pHits.size(); j++){
214 if(m_pHits[i]->Part() == m_pHits[j]->Part() &&
215 m_pHits[i]->Seg() == m_pHits[j]->Seg() &&
216 m_pHits[i]->Gap() == m_pHits[j]->Gap() )
218 int deltaStrip = fabs(m_pHits[i]->Strip()- m_pHits[j]->Strip());
222 cout<<
"deltaStrip == 0 ? check it"<<endl;
225 weight[i] *= (deltaStrip+1) * (deltaStrip+1);
232 for (iHit = m_pHits.begin(); iHit != m_pHits.end(); iHit++) {
252 Hep3Vector center = (*iHit)->GetCenterPos();
253 Hep3Vector sigma = (*iHit)->GetCenterSigma();
257 if ( m_Orient == 0) {
258 px[npoints] = center.z();
259 py[npoints] = sqrt(center.x()*center.x()
260 + center.y()*center.y());
261 if(m_Seg==2) py[npoints] = center.y();
263 pw[npoints] = 4.0 * 1.0/(sigma.y()*sigma.y()) /
weight[npoints];
266 px[npoints] = center.x();
267 py[npoints] = center.y();
268 pw[npoints] = 4.0 * 1.0/(sigma.x()*sigma.x()) /
weight[npoints];
272 if ( m_Orient == 0) {
273 px[npoints] = center.z();
274 py[npoints] = center.y();
275 pw[npoints] = 4.0 * 1.0/(sigma.y()*sigma.y()) /
weight[npoints];
278 px[npoints] = center.z();
279 py[npoints] = center.x();
280 pw[npoints] = 4.0 * 1.0/(sigma.x()*sigma.x()) /
weight[npoints];
288 { cout<<
"MucRec2DRoad: to many hits in this track, ignore it!"<<endl;
322if (ndof < 0)
return -1;
326 if ( m_Orient == 0) {
327 px[npoints] = m_VertexPos.z();
328 py[npoints] = sqrt(m_VertexPos.x()*m_VertexPos.x()
329 + m_VertexPos.y()*m_VertexPos.y());
330 if(m_Seg==2) py[npoints] = m_VertexPos.y();
333 px[npoints] = m_VertexPos.x();
334 py[npoints] = m_VertexPos.y();
338 if ( m_Orient == 0) {
339 px[npoints] = m_VertexPos.z();
340 py[npoints] = m_VertexPos.y();
343 px[npoints] = m_VertexPos.z();
344 py[npoints] = m_VertexPos.x();
358 int status = fit.
LineFit(px, py, pw, npoints,
359 &slope, &intercept, &chisq,
360 &sigmaSlope, &sigmaIntercept);
363 float tempslope, tempintercept,tempchisq, tempsigmaslope, sigmaPos;
364 int status4 = fit.
LineFit(px, py, pw,m_Part,m_Seg,m_Orient, npoints,
365 &tempslope, &tempintercept, &tempchisq,
366 &tempsigmaslope, &sigmaPos);
369 float quad_a, quad_b, quad_c, sigmaquad_a, sigmaquad_b, sigmaquad_c, chisq_quad;
370 int whichhalf, status2;
372 if(m_fittingMethod == 2){
373 status2 = quadfit.
QuadFit(px, py, pw, npoints,
374 &quad_a, &quad_b, &quad_c, &whichhalf, &chisq_quad,
375 &sigmaquad_a, &sigmaquad_b, &sigmaquad_c);
380 if (slope > 1.0e10 || slope < -1.0e10) {
381 if (m_Seg > 4) slope *= -1.0;
384 m_SimpleSlope = slope;
385 m_SimpleSlopeSigma = sigmaSlope;
386 m_SimpleIntercept = intercept;
387 m_SimpleInterceptSigma = sigmaIntercept;
388 m_SimplePosSigma = sigmaPos;
389 m_SimpleChi2 = chisq;
391 m_SimpleFitOK = (status == 0) && (chisq < 1000.0);
392 m_QuadFitOK = (status2 == 1);
394 m_SimpleQuad_a = quad_a;
395 m_SimpleQuad_b = quad_b;
396 m_SimpleQuad_c = quad_c;
397 m_SimpleQuad_whichhalf = whichhalf;
398 m_SimpleQuad_aSigma = sigmaquad_a;
399 m_SimpleQuad_bSigma = sigmaquad_b;
400 m_SimpleQuad_cSigma = sigmaquad_c;
414 float& sigmaIntercept,
426 vector<MucRecHit*>::const_iterator iHit;
429 for(
int i = 0; i< m_pHits.size(); i++) {
434 for (iHit = m_pHits.begin(); iHit != m_pHits.end(); iHit++) {
436 if( (*iHit)->Gap()==currentgap )
continue;
438 Hep3Vector center = (*iHit)->GetCenterPos();
439 Hep3Vector sigma = (*iHit)->GetCenterSigma();
443 if ( m_Orient == 0) {
444 px[npoints] = center.z();
445 py[npoints] = sqrt(center.x()*center.x()
446 + center.y()*center.y());
447 if(m_Seg==2) py[npoints] = center.y();
449 pw[npoints] = 1.0/(sigma.y()*sigma.y())/pw2[npoints]/pw2[npoints];
452 px[npoints] = center.x();
453 py[npoints] = center.y();
454 pw[npoints] = 1.0/(sigma.x()*sigma.x())/pw2[npoints]/pw2[npoints];
458 if ( m_Orient == 0) {
459 px[npoints] = center.z();
460 py[npoints] = center.y();
461 pw[npoints] = 1.0/(sigma.y()*sigma.y())/pw2[npoints]/pw2[npoints];
464 px[npoints] = center.z();
465 py[npoints] = center.x();
466 pw[npoints] = 1.0/(sigma.x()*sigma.x())/pw2[npoints]/pw2[npoints];
475 { cout<<
"MucRec2DRoad: to many hits in this track, ignore it!"<<endl;
482 if (ndof < 0)
return -1;
486 if ( m_Orient == 0) {
487 px[npoints] = m_VertexPos.z();
488 py[npoints] = sqrt(m_VertexPos.x()*m_VertexPos.x()
489 + m_VertexPos.y()*m_VertexPos.y());
490 if(m_Seg==2) py[npoints] = m_VertexPos.y();
493 px[npoints] = m_VertexPos.x();
494 py[npoints] = m_VertexPos.y();
498 if ( m_Orient == 0) {
499 px[npoints] = m_VertexPos.z();
500 py[npoints] = m_VertexPos.y();
503 px[npoints] = m_VertexPos.z();
504 py[npoints] = m_VertexPos.x();
519int status = fit.
LineFit(px, py, pw, npoints,
520 &slope, &intercept, &chisq,
521 &sigmaSlope, &sigmaIntercept);
524float quad_a, quad_b, quad_c, sigmaquad_a, sigmaquad_b, sigmaquad_c, chisq_quad;
525int whichhalf, status2;
527if(m_fittingMethod == 2){
528 status2 = quadfit.
QuadFit(px, py, pw, npoints,
529 &quad_a, &quad_b, &quad_c, &whichhalf, &chisq_quad,
530 &sigmaquad_a, &sigmaquad_b, &sigmaquad_c);
535if (slope > 1.0e10 || slope < -1.0e10) {
536 if (m_Seg > 4) slope *= -1.0;
540 m_SimpleSlope = slope;
541 m_SimpleSlopeSigma = sigmaSlope;
542 m_SimpleIntercept = intercept;
543 m_SimpleInterceptSigma = sigmaIntercept;
545 m_SimpleChi2 = chisq;
547 m_SimpleFitOK = (status == 0) && (chisq < 1000.0);
548 m_QuadFitOK = (status2 == 1);
550 m_SimpleQuad_a = quad_a;
551 m_SimpleQuad_b = quad_b;
552 m_SimpleQuad_c = quad_c;
553 m_SimpleQuad_whichhalf = whichhalf;
554 m_SimpleQuad_aSigma = sigmaquad_a;
555 m_SimpleQuad_bSigma = sigmaquad_b;
556 m_SimpleQuad_cSigma = sigmaquad_c;
573 float& slope,
float& intercept,
574 float& sigmaSlope,
float& sigmaIntercept,
575 float& chisq,
int& ndof)
580 if (!m_SimpleFitOK) {
582 float a, sa, b, sb, chi;
614 vector<MucRecHit*>::const_iterator iHit;
622 for (iHit = m_pHits.begin(); iHit != m_pHits.end(); iHit++) {
625 Hep3Vector center = (*iHit)->GetCenterPos();
626 Hep3Vector sigma = (*iHit)->GetCenterSigma();
629 if ( m_Orient == 0) {
630 px[npoints] = center.z();
631 dx = px[npoints] - z;
632 py[npoints] = sqrt(center.x()*center.x()
633 + center.y()*center.y());
634 if(m_Seg==2) py[npoints] = center.y();
635 dy = py[npoints] - sqrt(
x*
x + y*y);
638 px[npoints] = center.x();
639 dx = px[npoints] -
x;
640 py[npoints] = center.y();
641 dy = py[npoints] - y;
645 if ( m_Orient == 0) {
646 px[npoints] = center.z();
647 dx = px[npoints] - z;
648 py[npoints] = center.y();
649 dy = py[npoints] - y;
652 px[npoints] = center.z();
653 dx = px[npoints] - z;
654 py[npoints] = center.x();
655 dy = py[npoints] -
x;
659 dr = sqrt(dx*dx + dy*dy);
671 { cout<<
"MucRec2DRoad: to many hits in this track, ignore it!"<<endl;
682 if ( m_Orient == 0) {
683 px[npoints] = m_VertexPos.z();
684 py[npoints] = sqrt(m_VertexPos.x()*m_VertexPos.x()
685 + m_VertexPos.y()*m_VertexPos.y());
686 if(m_Seg==2) py[npoints] = m_VertexPos.y();
689 px[npoints] = m_VertexPos.x();
690 py[npoints] = m_VertexPos.y();
694 if ( m_Orient == 0) {
695 px[npoints] = m_VertexPos.z();
696 py[npoints] = m_VertexPos.y();
699 px[npoints] = m_VertexPos.z();
700 py[npoints] = m_VertexPos.x();
714 status = fit.
LineFit(px, py, pw, npoints,
715 &slope, &intercept, &chisq,
716 &sigmaSlope, &sigmaIntercept);
730 float& x,
float& y,
float& z,
float& x2,
float& y2,
float& z2)
732 float sigmaX, sigmaY, sigmaZ;
734 x = 0.0; sigmaX = 0.0; x2 = 0.0;
735 y = 0.0; sigmaY = 0.0; y2 = 0.0;
736 z = 0.0; sigmaZ = 0.0; z2 = 0.0;
739 cout <<
"MucRec2DRoad::Project-E1 invalid gap = " << gap << endl;
744 float x0, y0, z0, sigmaX0, sigmaY0, sigmaZ0;
745 float phi = m_Seg*0.25*
kPi;
751 m_SimpleSlope*
cos(phi), m_SimpleSlope*
sin(phi), 1.0,
752 m_SimpleIntercept*
cos(phi),m_SimpleIntercept*
sin(phi), 0.0,
753 m_SimpleSlopeSigma, 0.0, 0.0,
754 m_SimpleInterceptSigma, 0.0, 0.0,
756 sigmaX0, sigmaY0, sigmaZ0);
758 if(m_SimpleSlope>10000){
760 m_SimpleSlope*
cos(phi), m_SimpleSlope*
sin(phi), 1.0,
761 0.0, 0.0, m_SimpleIntercept,
762 m_SimpleSlopeSigma, 0.0, 0.0,
763 m_SimpleInterceptSigma, 0.0, 0.0,
765 sigmaX0, sigmaY0, sigmaZ0);
772 1.0, m_SimpleSlope, 0.0,
773 0.0, m_SimpleIntercept, 0.0,
774 0.0, m_SimpleSlopeSigma, 0.0,
775 0.0, m_SimpleInterceptSigma, 0.0,
777 sigmaX0, sigmaY0, sigmaZ0);
785 m_SimpleSlope, m_SimpleSlope, 1.0,
786 0.0, m_SimpleIntercept, 0.0,
787 0.0, m_SimpleSlopeSigma, 0.0,
788 0.0, m_SimpleInterceptSigma, 0.0,
790 sigmaX0, sigmaY0, sigmaZ0);
794 m_SimpleSlope, m_SimpleSlope, 1.0,
795 m_SimpleIntercept, 0.0, 0.0,
796 m_SimpleSlopeSigma, 0.0, 0.0,
797 m_SimpleInterceptSigma, 0.0, 0.0,
799 sigmaX0, sigmaY0, sigmaZ0);
811 float a,b,sa,sb,chi2;
814 int status =
Fit(x0, y0, z0, a, b, sa, sb, chi2, ndof);
830 a*
cos(phi), a*
sin(phi), 1.0,
832 b*
cos(phi), b*
sin(phi), 0.0,
836 sigmaX, sigmaY, sigmaZ);
840 a*
cos(phi), a*
sin(phi), 1.0,
847 sigmaX, sigmaY, sigmaZ);
858 sigmaX, sigmaY, sigmaZ);
860 if(m_fittingMethod == 2 && m_QuadFitOK ){
862 float sa, sb, sc, chi2x;
int ydof;
int whichhalf;
866 10E30, 0.0, m_SimpleIntercept, 0.0,
869 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
871 sigmaX, sigmaY, sigmaZ);
886 sigmaX, sigmaY, sigmaZ);
895 sigmaX, sigmaY, sigmaZ);
950 vector<int> firedGap;
951 for ( gap = 0; gap < ngap; gap++) {
952 firedGap.push_back(0);
955 vector<MucRecHit*>::const_iterator iHit;
956 for (iHit = m_pHits.begin(); iHit != m_pHits.end(); iHit++) {
958 gap = (*iHit)->Gap();
963 for ( gap = 0; gap < ngap; gap++) {
964 count += firedGap[gap];
975 cout <<
"MucRec2DRoad::GetHitsPerGap-E1 invalid gap = " << gap << endl;
979 vector<MucRecHit*>::const_iterator iHit;
982 for (iHit = m_pHits.begin(); iHit != m_pHits.end(); iHit++) {
985 cout <<
"MucRec2DRoad::GetHitsPerGap()-E2 null hit pointer !" << endl;
989 if( gap == (*iHit)->Gap() ) hitsInGap += 1;
1001 cout <<
"MucRec2DRoad::HasHitInGap-E2 invalid gap = " << gap << endl;
1006 vector<MucRecHit*>::const_iterator iHit;
1008 for (iHit = m_pHits.begin(); iHit != m_pHits.end(); iHit++) {
1010 if ( (*iHit)->Gap() == gap ) {
1028 vector<MucRecHit*>::const_iterator iHit1;
1029 vector<MucRecHit*>::const_iterator iHit2;
1032 for( iHit1 = m_pHits.begin(); iHit1 != m_pHits.end(); iHit1++){
1033 for( iHit2 = road2->m_pHits.begin();
1034 iHit2 != road2->m_pHits.end(); iHit2++){
1038 if ( (hit1 != 0) && (hit2 != 0) ) {
1065 if ( (!m_SimpleFitOK) || (m_SimpleDOF < 0) ) {
1068 else if (m_SimpleDOF == 0) {
1072 return (m_SimpleChi2 / m_SimpleDOF);
1079 float& sigmaSlope,
float& sigmaIntercept,
1080 float& chisq,
int& ndof)
const
1082 slope = m_SimpleSlope;
1083 intercept = m_SimpleIntercept;
1084 sigmaSlope = m_SimpleSlopeSigma;
1085 sigmaIntercept = m_SimpleInterceptSigma;
1086 chisq = m_SimpleChi2;
1096 possigma = m_SimplePosSigma;
1104 float& sigmaa,
float& sigmab,
float& sigmac,
1105 float& chisq,
int& ndof)
const
1110 whichhalf = m_SimpleQuad_whichhalf;
1112 sigmaa = m_SimpleQuad_aSigma;
1113 sigmab = m_SimpleQuad_bSigma;
1114 sigmac = m_SimpleQuad_cSigma;
1116 chisq = m_SimpleChi2;
1129 cout <<
"MucRec2DRoad::Hit-E1 invalid gap = " << gap << endl;
1133 vector<MucRecHit*>::const_iterator iHit;
1135 for (iHit = m_pHits.begin(); iHit != m_pHits.end(); iHit++) {
1137 if ( (*iHit)->Gap() == gap) {
1153 cout <<
"MucRec2DRoad::GetHitDistance-E1 null hit pointer!" << endl;
1157 int gap = hit->
Gap();
1159 cout <<
"MucRec2DRoad::HitDistance-W2 bad gap number = " << gap << endl;
1165 cout <<
"MucRec2DRoad::GetHitDistance-W3 "
1166 <<
" hit has wrong orientation = "
1179 float delta, delta1,delta2;
1186 Project(gap, x0, y0, z0, x2, y2, z2);
1191 if(x0==y0&&x0==z0&&x0==0) {x0+=-9999;y0+=-9999;z0+=-9999;}
1192 if(x2==y2&&x2==z2&&x2==0) {x2+=-9999;y2+=-9999;z2+=-9999;}
1202 if ( m_Part == 0 ) {
1203 if ( m_Orient == 0 ) {
1204 delta1 = fabs( sl.y() - rl.y() );
1205 delta2= fabs( s_2l.y() - rl.y() );
1208 delta1 = fabs( sl.x() - rl.x() );
1209 delta2= fabs( s_2l.x() - rl.x() );
1213 if ( m_Orient == 0 ) {
1214 delta1 = fabs( sl.y() - rl.y() );
1215 delta2= fabs( s_2l.y() - rl.y() );
1218 delta1 = fabs( sl.x() - rl.x() );
1219 delta2= fabs( s_2l.x() - rl.x() );
1228 if(delta1 < delta2)
return delta1;
1237 cout <<
"MucRec2DRoad::GetSearchWindowSize-E1 invalid gap = " << gap << endl;
1248 float x1, y1, z1, x2, y2, z2, dx, dy, dr;
1249 float sigmaX, sigmaY, sigmaZ;
1252 if (m_Orient == 0) {
1254 1.0, m_SimpleSlope, 0.0,
1255 0.0, m_SimpleIntercept, 0.0,
1256 0.0, m_SimpleSlopeSigma, 0.0,
1257 0.0, m_SimpleInterceptSigma, 0.0,
1259 sigmaX, sigmaY, sigmaZ);
1261 1.0, m_SimpleSlope, 0.0,
1262 0.0, m_SimpleIntercept, 0.0,
1263 0.0, m_SimpleSlopeSigma, 0.0,
1264 0.0, m_SimpleInterceptSigma, 0.0,
1266 sigmaX, sigmaY, sigmaZ);
1268 dy = sqrt(x2*x2 + y2*y2) - sqrt(x1*x1 + y1*y1);
1272 m_SimpleSlope, 0.0, 1.0,
1273 m_SimpleIntercept, 0.0, 0.0,
1274 m_SimpleSlopeSigma, 0.0, 0.0,
1275 m_SimpleInterceptSigma, 0.0, 0.0,
1277 sigmaX, sigmaY, sigmaZ);
1279 m_SimpleSlope, 0.0, 1.0,
1280 m_SimpleIntercept, 0.0, 0.0,
1281 m_SimpleSlopeSigma, 0.0, 0.0,
1282 m_SimpleInterceptSigma, 0.0, 0.0,
1284 sigmaX, sigmaY, sigmaZ);
1290 if (m_Orient == 0) {
1292 0.0, m_SimpleSlope, 1.0,
1293 0.0, m_SimpleIntercept, 0.0,
1294 0.0, m_SimpleSlopeSigma, 0.0,
1295 0.0, m_SimpleInterceptSigma, 0.0,
1297 sigmaX, sigmaY, sigmaZ);
1299 0.0, m_SimpleSlope, 1.0,
1300 0.0, m_SimpleIntercept, 0.0,
1301 0.0, m_SimpleSlopeSigma, 0.0,
1302 0.0, m_SimpleInterceptSigma, 0.0,
1304 sigmaX, sigmaY, sigmaZ);
1310 m_SimpleSlope, 0.0, 1.0,
1311 m_SimpleIntercept, 0.0, 0.0,
1312 m_SimpleSlopeSigma, 0.0, 0.0,
1313 m_SimpleInterceptSigma, 0.0, 0.0,
1315 sigmaX, sigmaY, sigmaZ);
1317 m_SimpleSlope, 0.0, 1.0,
1318 m_SimpleIntercept, 0.0, 0.0,
1319 m_SimpleSlopeSigma, 0.0, 0.0,
1320 m_SimpleInterceptSigma, 0.0, 0.0,
1322 sigmaX, sigmaY, sigmaZ);
1328 dr = sqrt(dx*dx + dy*dy);
1335MucRec2DRoad::CountHits()
1337 m_MaxHitsPerGap = 0;
1341 vector<MucRecHit*>::const_iterator iHit;
1343 vector<int> HitsPerGap;
1344 for (
int gap = 0; gap < ngap; gap++) {
1345 HitsPerGap.push_back(0);
1349 for (iHit = m_pHits.begin(); iHit != m_pHits.end(); iHit++) {
1351 cout <<
"MucRec2DRoad::CountHits()-E1 null hit pointer !" << endl;
1355 int gap = (*iHit)->Gap();
1381 for (
int gap = 0; gap < StopGap; gap++) {
1382 m_TotalHits += HitsPerGap[gap];
1383 if(m_MaxHitsPerGap < HitsPerGap[gap]) m_MaxHitsPerGap = HitsPerGap[gap];
1384 if(HitsPerGap[gap] > 0) m_LastGap = gap;
1393 vector<MucRecHit*>::const_iterator iHit;
1394 bool HitExist =
false;
1401 for ( iHit = m_pHits.begin(); iHit != m_pHits.end(); iHit++ ) {
1403 if ( (*iHit)->GetID() ==
id ) HitExist =
true;
1405 if (HitExist)
break;
1415 vector<Identifier> idCon;
1417 vector<MucRecHit*>::const_iterator iHit;
1418 for ( iHit = m_pHits.begin(); iHit != m_pHits.end(); iHit++) {
1421 idCon.push_back(
id);
1446 vector<MucRecHit*>::const_iterator iHit;
1447 for ( iHit = m_pHits.begin(); iHit != m_pHits.end(); iHit++) {
1450 (*iHit)->GetStrip()->GetCenterPos(xl, yl, zl);
1452 HepPoint3D vg = (*iHit)->GetGap()->TransformToGlobal(vl);
1454 cout <<
" orient " << m_Orient
1455 <<
" part " << (*iHit)->Part()
1456 <<
" seg " << (*iHit)->Seg()
1457 <<
" gap " << (*iHit)->Gap()
1458 <<
" strip " << (*iHit)->Strip()
1459 <<
" pos (" << vg.x() <<
", " << vg.y() <<
", " << vg.z() <<
")"
double sin(const BesAngle a)
double cos(const BesAngle a)
HepGeom::Point3D< double > HepPoint3D
*********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 double muckInfinity
HepPoint3D TransformToGap(const HepPoint3D gPoint) const
Transform a point from global coordinate to gap coordinate.
static MucGeoGeneral * Instance()
Get a pointer to the single instance of MucGeoGeneral.
void FindIntersection(const int part, const int seg, const int gap, const float vx, const float vy, const float vz, const float x0, const float y0, const float z0, const float sigmaVx, const float sigmaVy, const float sigmaVz, const float sigmaX0, const float sigmaY0, const float sigmaZ0, float &x, float &y, float &z, float &sigmaX, float &sigmaY, float &sigmaZ)
static value_type getGapMax()
static value_type getGapNum(int part)
~MucRec2DRoad()
Destructor.
int Fit(const float &x, const float &y, const float &z, float &slope, float &intercept, float &sigmaSlope, float &sigmaIntercept, float &chisq, int &ndof)
Fit (with weights) the hit center to a straight line.
vector< Identifier > GetHitsID() const
Get indices of all hits in the road.
int GetNGapsWithHits() const
How many gaps provide hits attached to this road?
bool HasHitInGap(const int &gap) const
Does this road contain any hits in the given gap?
void PrintHitsInfo() const
Print Hits Infomation.
int GetTotalHits() const
How many hits in all does this road contain?
int GetHitsPerGap(const int &gap) const
How many hits per gap does this road contain?
float GetReducedChiSquare() const
Chi-square parameter (per degree of freedom) of the trajectory fit.
void SetIndex(const int &index)
Set the index for this road.
void Project(const int &gap, float &x, float &y, float &z, float &x2, float &y2, float &z2)
Where does the trajectory of this road intersect a specific gap?
void GetVertexPos(float &x, float &y, float &z) const
Position of the vertex point.
void GetPosSigma(float &possigma) const
float WindowFunc(const float &chisq, const float &distance) const
MucRec2DRoad & operator=(const MucRec2DRoad &orig)
Assignment constructor.
float GetSearchWindowSize(const int &gap) const
Determine the size of the search window in the given gap.
float GetIntercept() const
Intercept of trajectory.
void AttachHit(MucRecHit *hit)
Attach the given hit to this road.
MucRec2DRoad(const int &part=0, const int &seg=0, const int &orient=0, const float &xVertex=0.0, const float &yVertex=0.0, const float &zVertex=0.0, const int &fittingMethod=0)
Constructor.
int GetMaxHitsPerGap() const
How many hits were attached in the gap with the most attached hits?
int GetLastGap() const
Which gap is the last one with hits attached to this road?
void AttachHitNoFit(MucRecHit *hit)
Attach the given hit to this road, but not fit this road.
float GetSlope() const
Slope of trajectory.
bool HasHit(MucRecHit *hit) const
Does the hit exist in the road .
int GetNSharedHits(const MucRec2DRoad *road) const
How many hits do two roads share?
void SetMaxNSkippedGaps(const int &nGaps)
int GetPart() const
In which part was this road found?
int SimpleFit(float &slope, float &intercept, float &sigmaSlope, float &sigmaIntercept, float &chisq, int &ndof)
Calculate the best-fit straight line with "simple" weights.
float GetHitDistance(const MucRecHit *hit)
Distance to a hit.
int GetDegreesOfFreedom() const
How many degrees of freedom in the trajectory fit?
int GetIndex() const
A unique identifier for this road in the current event.
void GetSimpleFitParams(float &slope, float &intercept, float &sigmaSlope, float &sigmaIntercept, float &chisq, int &ndof) const
Get the parameters from the simple fit.
vector< MucRecHit * > GetHits() const
float WeightFunc(const float &chisq, const float &distance) const
int GetSeg() const
In which segment was this road found?
int GetOrient() const
In which orientation was this road found?
MucRecHit * GetHit(const int &gap) const
Get a pointer to the first found hit attached in a particular gap.
int SimpleFitNoCurrentGap(int currentgap, float &slope, float &intercept, float &sigmaSlope, float &sigmaIntercept, float &chisq, int &ndof)
Calculate the best-fit straight line with "simple" weights. not use current gap!!!
MucGeoGap * GetGap() const
Get geometry data for the gap containing this hit.
Hep3Vector GetCenterPos() const
Get Center position of the strip (global coords).
Identifier GetID() const
Get soft identifier of this hit.
int LineFit(float x[], float y[], float w[], int n, float *a, float *b, float *chisq, float *siga, float *sigb)
int QuadFit(float x[], float y[], float w[], int n, float *a, float *b, float *c, int *half, float *chisq, float *siga, float *sigb, float *sigc)