16#include "TrkReco/TBuilderCurl.h"
17#include "TrackUtil/Lpav.h"
18#include "TrkReco/TMLink.h"
19#include "TrkReco/TTrack.h"
24#include "TrkReco/TMLine.h"
25#include "TrkReco/TRobustLineFitter.h"
29#define DEBUG_CURL_DUMP 0
30#define DEBUG_CURL_GNUPLOT 0
31#define DEBUG_CURL_MC 0
33#if ( DEBUG_CURL_GNUPLOT + DEBUG_CURL_MC )
34# include "TrkReco/TMDCWireHitMC.h"
35# include "TrkReco/TTrackHEP.h"
37# include "MdcTables/MdcTables.h"
41#include "GaudiKernel/Bootstrap.h"
42#include "GaudiKernel/IDataProviderSvc.h"
43#include "GaudiKernel/IInterface.h"
44#include "GaudiKernel/IMessageSvc.h"
45#include "GaudiKernel/ISvcLocator.h"
46#include "GaudiKernel/Kernel.h"
47#include "GaudiKernel/MsgStream.h"
48#include "GaudiKernel/Service.h"
49#include "GaudiKernel/SmartDataPtr.h"
50#include "GaudiKernel/StatusCode.h"
52#if ( DEBUG_CURL_DUMP + DEBUG_CURL_GNUPLOT + DEBUG_CURL_MC )
55static int debugMcFlag = 1;
59 :
TBuilder0(
name ), _fitter(
"TBuilderCurl Fitter" ), m_pmgnIMF( nullptr ) {
67 if (m_param.ON_CORRECTION & 1) _fitter.sag(
true);
68 if (m_param.ON_CORRECTION & 2) _fitter.propagation(
true);
69 if (m_param.ON_CORRECTION & 4) _fitter.tof(
true);
81 m_param.Z_CUT = p.
Z_CUT;
97 if ( m_param.ON_CORRECTION & 1 ) _fitter.sag(
true );
98 if ( m_param.ON_CORRECTION & 2 ) _fitter.propagation(
true );
99 if ( m_param.ON_CORRECTION & 4 ) _fitter.tof(
true );
111void TBuilderCurl::resetHelixFit(
THelixFitter* fit )
const {
114 fit->propagation(
false );
116 fit->freeT0(
false );
174#if ( DEBUG_CURL_DUMP + DEBUG_CURL_GNUPLOT + DEBUG_CURL_MC )
175 Belle_event_Manager& evtMgr = Belle_event_Manager::get_manager();
177 if ( evtMgr.count() != 0 && evtMgr[0].ExpMC() != 2 ) debugMcFlag = 0;
181 unsigned nList = list.length();
184 for (
unsigned i = 0, size = track.
links().length(); i < size; ++i )
186 unsigned superID = ( track.
links() )[i]->wire()->superLayerId();
187 if ( superID == 0 || superID == 1 || superID == 5 || superID == 6 || superID == 7 ||
191 for (
unsigned j = 0; j < nList; ++j )
194 if ( l->
hit()->
wire()->
id() == ( track.
links() )[i]->hit()->wire()->id() )
200 if ( ok == 1 ) list.append( ( ( track.
links() )[i] ) );
203 ( track.
links() )[i]->leftRight( 2 );
205 for (
unsigned i = 0, size = list.length(); i < size; ++i )
207 track.
_links.remove( list[i] );
209 list[i]->leftRight( 2 );
212 if ( list.length() < 2 || list.length() + track.
nLinks() < 5 )
return NULL;
214 unsigned debug_stereo_counter1 = 0;
215 for (
unsigned i = 0; i < track.
links().length(); ++i )
217 unsigned superID = ( track.
links() )[i]->hit()->wire()->superLayerId();
218 if ( superID == 0 || superID == 1 || superID == 5 || superID == 6 || superID == 7 ||
220 ++debug_stereo_counter1;
222 std::cout <<
"(TBuilderCurl)Fitted Track:";
223 std::cout <<
", A# = " << track.
links().length() - debug_stereo_counter1;
224 std::cout <<
", S# = " << debug_stereo_counter1 <<
"(==0)";
225 std::cout <<
", A+S# = " << track.
links().length();
226 std::cout <<
", Cand Stereo Wires # = " << list.length() << std::endl;
227 double debugChg = -1.;
228 if ( track.
charge() > 0. ) debugChg = 1.;
229 if ( debugChg > 0. ) std::cout <<
"(TBuilderCurl) Positive Track" << std::endl;
230 else std::cout <<
"(TBuilderCurl) Negative Track" << std::endl;
238 bool err2D = fitWDD( xc2D, yc2D, r2D, tmpAxialList );
245 setArcZ( track, list );
247 for (
unsigned i = 0, size = list.length(); i < size; ++i )
249 if ( list[i]->arcZ( 0 ).
x() == -999. && list[i]->arcZ( 1 ).
x() == -999. )
250 removeList.append( list[i] );
252 list.remove( removeList );
253 if ( list.length() < 2 || list.length() + track.
nLinks() < 5 )
256 std::cout <<
"(TBuilderCurl) Fail...few wires which can be set Arc-Z # = "
257 << list.length() << std::endl;
262 std::cout <<
"(TBuilderCurl) Cand Stereo Wires which can be set Arc-Z # = " << list.length()
264 plotArcZ( list, 0., 0., 0 );
270 for(
unsigned i = 0, size = list.length(); i < size; ++i){
271 layer[list[i]->wire()->layer()->axialStereoLayerId()].append(*list[i]);
275 for(
int i=0;i<18;++i){
276 if(layer[i].length())
277 std::cout <<
"(TBuilderCurl) Cand Stereo Wires which can be set Arc-Z # = "
279 <<
" on " << i <<
" Layer." << std::endl;
287 double minChi2 = 9999.;
288 double goodA = 9999.;
289 double goodB = 9999.;
290 makeLine( track, list, allStereoList, goodL, minChi2, goodA, goodB, goodP );
291 HepAListDeleteAll( goodP );
294 std::cout <<
"(TBuilderCurl) a = " << goodA <<
", b = " << goodB
295 <<
" (after makeLine-function)" << std::endl;
301 if ( rfitter.
fit( newLine0 ) != 0 )
304 std::cout <<
"(TBuilderCurl) Fail...linefitting...fail." << std::endl;
310 std::cout <<
"(TBuilderCurl) a = " << newLine0.
a() <<
", b = " << newLine0.
b()
311 <<
" (after robustline-fit)" << std::endl;
315 unsigned nGoodL = goodL.length();
316 list.remove( goodL );
318 if ( m_param.CURL_VERSION == 0 )
320 if ( fabs( newLine0.
b() ) < 10. )
322 appendPoints( list, goodL2, newLine0.
a(), newLine0.
b(), track,
323 m_param.Z_DIFF_FOR_LAST_ATTEND );
327 appendPoints( list, goodL2, goodA, goodB, track, m_param.Z_DIFF_FOR_LAST_ATTEND );
333 appendPoints( list, goodL2, newLine0.
a(), newLine0.
b(), track,
334 m_param.Z_DIFF_FOR_LAST_ATTEND );
336 goodL.append( goodL2 );
340 if ( rfitter.
fit( newLine ) != 0 )
343 std::cout <<
"(TBuilderCurl) Fail...appending and re-fitting...fail." << std::endl;
349 std::cout <<
"(TBuilderCurl) a = " << newLine.
a() <<
", b = " << newLine.
b()
350 <<
" (after last-append + re-robustline-fit)" << std::endl;
354 track.TTrackBase::append( good );
355 if ( !check( track ) )
358 std::cout <<
"(TBuilderCurl) Fail...checking wire numbers...fail." << std::endl;
368 double tmpQ = track.
charge() > 0. ? 1. : -1.;
369 tmpA[1] = fmod( atan2( tmpQ * yc2D, tmpQ * xc2D ) + 4. *
M_PI, 2. *
M_PI );
372 tmpA[2] = tmpQ * ( 333.564095 / ( -1000 * ( getPmgnIMF()->getReferField() ) ) ) / r2D;
375 tmpA[0] = xc2D /
cos( tmpA[1] ) - tmpQ * r2D;
392 if ( m_param.CURL_VERSION == 0 )
394 if ( fabs( a[3] ) > 10. && fabs( goodB ) < 10. )
403 if ( fabs( a[3] ) > 50. && fabs( goodB ) < 50. )
407 track.TTrackBase::remove( goodL2 );
411 track._helix->
a( a );
414 std::cout <<
"(TBuilderCurl) Created Line: y = " << newLine.
a() <<
" * x + "
415 << newLine.
b() <<
", size = " << good.length() << std::endl;
416 plotArcZ(
const_cast<AList<TMLink>&
>( good ), newLine.
a(), newLine.
b(), 0 );
430 if ( m_param.ON_CORRECTION & 1 ) _fitter.sag(
true );
431 if ( m_param.ON_CORRECTION & 2 ) _fitter.propagation(
true );
432 if ( m_param.ON_CORRECTION & 4 ) _fitter.tof(
true );
437 int err = _fitter.fit( track );
441 std::cout <<
"(TBuilderCurl) Fail fitting(0)...error code = " << err << std::endl;
445 else if ( fabs( track.
helix().
a()[3] ) > fabs( a[3] ) &&
446 ( fabs( track.
helix().
a()[3] ) > 50. ||
447 fabs( track.
helix().
a()[2] ) > 100. ||
448 fabs( track.
helix().
a()[2] ) < 0.1 ) )
452 if ( m_param.ON_CORRECTION )
454 if ( m_param.ON_CORRECTION & 1 ) _fitter.sag(
true );
455 if ( m_param.ON_CORRECTION & 2 ) _fitter.propagation(
true );
456 if ( m_param.ON_CORRECTION & 4 ) _fitter.tof(
true );
460 track._helix->
a( a );
463 else {
return NULL; }
471 track.
refine( bad, m_param.SELECTOR_MAX_SIGMA * 100. );
472 if ( !check( track ) )
475 std::cout <<
"(TBuilderCurl) Fail checking(1)..." << std::endl;
479 err = _fitter.fit( track );
483 std::cout <<
"(TBuilderCurl) Fail fitting(1)...error code = " << err << std::endl;
487 track.
refine( bad, m_param.SELECTOR_MAX_SIGMA * 10. );
488 if ( !check( track ) )
491 std::cout <<
"(TBuilderCurl) Fail checking(2)..." << std::endl;
495 err = _fitter.fit( track );
499 std::cout <<
"(TBuilderCurl) Fail fitting(2)...error code = " << err << std::endl;
503 track.
refine( bad, m_param.SELECTOR_MAX_SIGMA );
504 if ( !check( track ) )
507 std::cout <<
"(TBuilderCurl) Fail checking(3)..." << std::endl;
511 err = _fitter.fit( track );
515 std::cout <<
"(TBuilderCurl) Fail fitting(3)...error code = " << err << std::endl;
521 for(
int i=0;i<track.
links().length();++i){
522 if(track.
links()[i]->pull() > 36.){
523 std::cout << track.
links()[i]->wire()->id()
524 <<
" :+: " << track.
links()[i]->pull() << std::endl;
527 std::cout <<
"Not Valid For Fit!" << std::endl;
532 track.
refine( bad, m_param.SELECTOR_MAX_SIGMA );
533 if ( !check( track ) )
536 std::cout <<
"(TBuilderCurl) Fail checking(4)..." << std::endl;
540 err = _fitter.fit( track );
544 std::cout <<
"(TBuilderCurl) Fail fitting(4)...error code = " << err << std::endl;
550 for(
int i=0;i<track.
links().length();++i){
551 if(track.
links()[i]->pull() > 36.){
552 std::cout << track.
links()[i]->wire()->id()
553 <<
" :*: " << track.
links()[i]->pull() << std::endl;
556 std::cout <<
"Not Valid For Fit!" << std::endl;
571 std::cout <<
"(TBuilderCurl) Success fitting, but pre-selection...fail." << std::endl;
575 if ( fabs( track.
impact() ) > m_param.SELECTOR_MAX_IMPACT ||
576 track.
pt() < 0.005 ||
577 fabs( track.
pz() ) > m_param.SELECTOR_STRANGE_PZ )
580 std::cout <<
"(TBuilderCurl) Success fitting, but selection...fail." << std::endl;
581 std::cout <<
"(TBuilderCurl) impact = " << track.
impact()
583 std::cout <<
"(TBuilderCurl) pt = " << track.
pt()
585 std::cout <<
"(TBuilderCurl) pz = " << track.
pz()
587 std::cout <<
"(TBuilderCurl) dz = " << track.
helix().
a()[3]
594 if ( fabs( track.
helix().
a()[3] ) > m_param.SELECTOR_REPLACE_DZ &&
595 fabs( a[3] ) < fabs( track.
helix().
a()[3] ) )
596 { track._helix->
a( a ); }
598 std::cout <<
"(TBuilderCurl) Success Build Stereo!!!" << std::endl;
614 AList<TMLink> alayer[5];
615 AList<TMLink> slayer[6];
616 for (
unsigned i = 0, size = track.
nLinks(); i < size; ++i )
618 unsigned id = ( track.
links() )[i]->wire()->superLayerId();
619 if (
id == 2 ) alayer[0].append( ( track.
links() )[i] );
620 else if (
id == 3 ) alayer[1].append( ( track.
links() )[i] );
621 else if (
id == 4 ) alayer[2].append( ( track.
links() )[i] );
622 else if (
id == 9 ) alayer[3].append( ( track.
links() )[i] );
623 else if (
id == 10 ) alayer[4].append( ( track.
links() )[i] );
626 for (
unsigned i = 0, size = list.length(); i < size; ++i )
628 unsigned id = list[i]->wire()->superLayerId();
629 if (
id == 0 ) slayer[0].append( list[i] );
630 else if (
id == 1 ) slayer[1].append( list[i] );
631 else if (
id == 5 ) slayer[2].append( list[i] );
632 else if (
id == 6 ) slayer[3].append( list[i] );
633 else if (
id == 7 ) slayer[4].append( list[i] );
634 else if (
id == 8 ) slayer[5].append( list[i] );
637 std::cout <<
"Stereo = "
638 << slayer[0].length() <<
" "
639 << slayer[1].length() <<
" "
640 << slayer[2].length() <<
" "
641 << slayer[3].length() <<
" "
642 << slayer[4].length() << std::endl;
643 std::cout <<
"Axial = "
644 << alayer[0].length() <<
" "
645 << alayer[1].length() <<
" "
646 << alayer[2].length() <<
" "
647 << alayer[3].length() <<
" "
648 << alayer[4].length() <<
" "
649 << alayer[5].length() << std::endl;
652 if ( slayer[0].length() >= 1 )
654 if ( alayer[0].length() + alayer[1].length() >= 4 )
655 { setArcZ( track, slayer[0], alayer[0], alayer[1], ip ); }
656 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() >= 4 )
657 { setArcZ( track, slayer[0], alayer[0], alayer[1], alayer[2], ip ); }
658 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() +
659 alayer[3].length() >=
661 { setArcZ( track, slayer[0], alayer[0], alayer[1], alayer[2], alayer[3], ip ); }
662 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() +
663 alayer[3].length() + alayer[4].length() >=
665 { setArcZ( track, slayer[0], alayer[0], alayer[1], alayer[2], alayer[3], alayer[4], ip ); }
667 if ( slayer[1].length() >= 1 )
669 if ( alayer[0].length() + alayer[1].length() >= 4 )
670 { setArcZ( track, slayer[1], alayer[0], alayer[1], ip ); }
671 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() >= 4 )
672 { setArcZ( track, slayer[1], alayer[0], alayer[1], alayer[2], ip ); }
673 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() +
674 alayer[3].length() >=
676 { setArcZ( track, slayer[1], alayer[0], alayer[1], alayer[2], alayer[3], ip ); }
677 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() +
678 alayer[3].length() + alayer[4].length() >=
680 { setArcZ( track, slayer[1], alayer[0], alayer[1], alayer[2], alayer[3], alayer[4], ip ); }
682 if ( slayer[2].length() >= 1 )
684 if ( alayer[1].length() + alayer[2].length() >= 4 )
685 { setArcZ( track, slayer[2], alayer[1], alayer[2], ip ); }
686 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() >= 4 )
687 { setArcZ( track, slayer[2], alayer[0], alayer[1], alayer[2], ip ); }
688 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() +
689 alayer[3].length() >=
691 { setArcZ( track, slayer[2], alayer[0], alayer[1], alayer[2], alayer[3], ip ); }
692 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() +
693 alayer[3].length() + alayer[4].length() >=
695 { setArcZ( track, slayer[2], alayer[0], alayer[1], alayer[2], alayer[3], alayer[4], ip ); }
697 if ( slayer[3].length() >= 1 )
699 if ( alayer[1].length() + alayer[2].length() >= 4 )
700 { setArcZ( track, slayer[3], alayer[1], alayer[2], ip ); }
701 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() >= 4 )
702 { setArcZ( track, slayer[3], alayer[0], alayer[1], alayer[2], ip ); }
703 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() +
704 alayer[3].length() >=
706 { setArcZ( track, slayer[3], alayer[0], alayer[1], alayer[2], alayer[3], ip ); }
707 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() +
708 alayer[3].length() + alayer[4].length() >=
710 { setArcZ( track, slayer[3], alayer[0], alayer[1], alayer[2], alayer[3], alayer[4], ip ); }
712 if ( slayer[4].length() >= 1 )
714 if ( alayer[1].length() + alayer[2].length() >= 4 )
715 { setArcZ( track, slayer[4], alayer[1], alayer[2], ip ); }
716 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() >= 4 )
717 { setArcZ( track, slayer[4], alayer[0], alayer[1], alayer[2], ip ); }
718 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() +
719 alayer[3].length() >=
721 { setArcZ( track, slayer[4], alayer[0], alayer[1], alayer[2], alayer[3], ip ); }
722 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() +
723 alayer[3].length() + alayer[4].length() >=
725 { setArcZ( track, slayer[4], alayer[0], alayer[1], alayer[2], alayer[3], alayer[4], ip ); }
727 if ( slayer[5].length() >= 1 )
729 if ( alayer[1].length() + alayer[2].length() >= 4 )
730 { setArcZ( track, slayer[5], alayer[1], alayer[2], ip ); }
731 else if ( alayer[1].length() + alayer[2].length() + alayer[3].length() >= 4 )
732 { setArcZ( track, slayer[5], alayer[1], alayer[2], alayer[3], ip ); }
733 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() +
734 alayer[3].length() >=
736 { setArcZ( track, slayer[5], alayer[0], alayer[1], alayer[2], alayer[3], ip ); }
737 else if ( alayer[0].length() + alayer[1].length() + alayer[2].length() +
738 alayer[3].length() + alayer[4].length() >=
740 { setArcZ( track, slayer[5], alayer[0], alayer[1], alayer[2], alayer[3], alayer[4], ip ); }
748 double b,
TTrack& track,
double z_cut )
const {
749 unsigned size = list.length();
750 if ( size == 0 )
return 0;
751 unsigned counter( 0 );
752 for (
unsigned i = 0; i < size; ++i )
754 for (
unsigned j = 0; j < 4; ++j )
756 if ( j <= 1 && list[i]->arcZ( j ).
x() == -999. )
continue;
757 else if ( j > 1 && list[i]->arcZ( j ).
x() == -999. )
break;
758 double y = a * list[i]->arcZ( j ).x() + b;
759 if ( fabs( y - list[i]->arcZ( j ).y() ) < z_cut )
761 list[i]->position( list[i]->arcZ( j ) );
762 line.append( list[i] );
778 m_a =
m_b = nhits = 0.;
780 unsigned n = points.length();
781 double sum = double(
n );
782 double sumX = 0., sumY = 0., sumX2 = 0., sumXY = 0., sumY2 = 0.;
783 for (
unsigned i = 0; i <
n; i++ )
795 if ( ipC != 0 ) sum += 1.0;
798 double m_det = sum * sumX2 - sumX * sumX;
799 if ( m_det == 0. && sum != 2. ) {
return -1; }
800 else if ( m_det == 0. && sum == 2. )
802 double x0 = points[0]->position().x();
803 double y0 = points[0]->position().y();
804 double x1 = points[1]->position().x();
805 double y1 = points[1]->position().y();
806 if ( x0 == x1 )
return -1;
807 m_a = ( y0 - y1 ) / ( x0 - x1 );
808 m_b = -m_a * x1 + y1;
813 m_a = ( sumXY * sum - sumX * sumY ) / m_det;
814 m_b = ( sumX2 * sumY - sumX * sumXY ) / m_det;
816 for (
unsigned i = 0; i <
n; i++ )
822 double d = y - ( x * m_a +
m_b );
829void TBuilderCurl::fitLine(
AList<TMLink>& tmpLine,
double& min_chi2,
double& good_a,
834 unsigned size = tmpLine.length();
835 TMLine line(tmpLine);
837 double chi2 = line.chi2()/(
static_cast<double>(size-2));
838 if(chi2 < min_chi2 && fabs(line.b()) < m_param.Z_CUT){
843 HepAListDeleteAll(goodPosition);
844 for(
unsigned i=0;i<size;++i)
850 unsigned size = tmpLine.length();
851 double ta, tb, tc, tn;
852 if ( !(
doLineFit( tmpLine, ta, tb, tc, tn, 1 ) ) && tn > 2. )
854 double chi2 = tc / ( tn - 2. );
855 if ( chi2 < min_chi2 && fabs( tb ) < m_param.Z_CUT )
861 HepAListDeleteAll( goodPosition );
862 for (
unsigned i = 0; i < size; ++i )
875unsigned TBuilderCurl::check(
const TTrack& track )
const {
876 unsigned nAhits( 0 ), nShits( 0 );
877 for (
unsigned i = 0, size = track.
nLinks(); i < size; ++i )
880 if ( track.
links()[i]->wire()->stereo() ) ++nShits;
883 if ( nAhits >= 3 && nShits >= 2 )
return 1;
893 list.append( layer1 );
894 list.append( layer2 );
895 int size = list.length();
896 if ( size <= 1 )
return 0;
897 int layerId = list[0]->hit()->wire()->layerId();
899 if ( layerId >= 15 ) maxLocalId = 127;
900 if ( layerId >= 23 ) maxLocalId = 159;
901 if ( layerId >= 32 ) maxLocalId = 207;
902 if ( layerId >= 41 ) maxLocalId = 255;
903 int HId = (int)( 0.8 * ( maxLocalId + 1 ) );
904 int LId = (int)( 0.2 * ( maxLocalId + 1 ) );
907 for (
int i = 0; i > size; ++i )
909 if ( list[i]->hit()->wire()->localId() < LId ) low = 1;
910 else if ( list[i]->hit()->wire()->localId() > HId ) high = 1;
911 if ( low == 1 && high == 1 )
return 1;
919 list.append( layer1 );
920 list.append( layer2 );
921 list.append( layer3 );
922 int size = list.length();
923 if ( size <= 1 )
return 0;
924 int layerId = list[0]->hit()->wire()->layerId();
926 if ( layerId >= 15 ) maxLocalId = 127;
927 if ( layerId >= 23 ) maxLocalId = 159;
928 if ( layerId >= 32 ) maxLocalId = 207;
929 if ( layerId >= 41 ) maxLocalId = 255;
930 int HId = (int)( 0.8 * ( maxLocalId + 1 ) );
931 int LId = (int)( 0.2 * ( maxLocalId + 1 ) );
934 for (
int i = 0; i > size; ++i )
936 if ( list[i]->hit()->wire()->localId() < LId ) low = 1;
937 else if ( list[i]->hit()->wire()->localId() > HId ) high = 1;
938 if ( low == 1 && high == 1 )
return 1;
946 if ( layerId >= 15 ) maxLocalId = 127;
947 if ( layerId >= 23 ) maxLocalId = 159;
948 if ( layerId >= 32 ) maxLocalId = 207;
949 if ( layerId >= 41 ) maxLocalId = 255;
950 return maxLocalId + 1;
955 int n = layer.length();
958 for (
int i = 0; i <
n; ++i )
962 if ( layer[i]->hit()->wire()->localId() >= border ) list.append( layer[i] );
966 if ( layer[i]->hit()->wire()->localId() <= border ) list.append( layer[i] );
974 if ( border * 2 < offset ) border += offset;
975 for (
int i = 0; i <
n; ++i )
977 int lId = layer[i]->hit()->wire()->localId();
978 if ( lId * 2 < offset ) lId += offset;
981 if ( lId >= border ) list.append( layer[i] );
985 if ( lId <= border ) list.append( layer[i] );
991int TBuilderCurl::sortByLocalId(
AList<TMLink>& list )
const {
992 int size = list.length();
993 if ( size <= 1 )
return 0;
994 int layerId = list[0]->hit()->wire()->layerId();
1003 if ( layerId == 0 ) maxLocalId = 39;
1004 else if ( layerId == 1 ) maxLocalId = 43;
1005 else if ( layerId == 2 ) maxLocalId = 47;
1006 else if ( layerId == 3 ) maxLocalId = 55;
1007 else if ( layerId == 4 ) maxLocalId = 63;
1008 else if ( layerId == 5 ) maxLocalId = 71;
1009 else if ( layerId < 8 ) maxLocalId = 79;
1010 else if ( layerId < 24 ) maxLocalId = 159;
1011 else if ( layerId < 28 ) maxLocalId = 175;
1012 else if ( layerId < 32 ) maxLocalId = 207;
1013 else if ( layerId < 43 ) maxLocalId = 239;
1015 for (
int i = 0; i < size; ++i )
1017 if ( list[i]->hit()->wire()->localId() == 0 || list[i]->hit()->wire()->localId() == 1 ||
1018 list[i]->hit()->wire()->localId() == maxLocalId - 1 ||
1019 list[i]->hit()->wire()->localId() == maxLocalId )
1025 if (
flag == 0 )
return 0;
1026 int maxDif = (int)( 0.5 * ( maxLocalId + 1 ) );
1027 AList<TMLink> fList;
1028 AList<TMLink> lList;
1029 for (
int i = 0; i < size; ++i )
1031 if ( list[i]->hit()->wire()->localId() < maxDif ) lList.append( list[i] );
1032 else fList.append( list[i] );
1035 list.append( fList );
1036 list.append( lList );
1037 if ( fList.length() >= 1 && lList.length() >= 1 )
return 1;
1052 double r = fabs( track.
helix().
curv() );
1053 for (
unsigned i = 0, size = list.length(); i < size; ++i )
1056 ( list[i]->hit()->mc()->datcdc()->m_xin + list[i]->hit()->mc()->datcdc()->m_xout ) *
1058 ( list[i]->hit()->mc()->datcdc()->m_yin + list[i]->hit()->mc()->datcdc()->m_yout ) *
1061 double cosdPhi = -center.dot( ( point - center ).
unit() ) / center.mag();
1063 if ( fabs( cosdPhi ) < 1.0 ) { dPhi = acos( cosdPhi ); }
1064 else if ( cosdPhi >= 1.0 ) { dPhi = 0.; }
1065 else { dPhi =
M_PI; }
1068 ( list[i]->hit()->mc()->datcdc()->m_zin + list[i]->hit()->mc()->datcdc()->m_zout ) *
1081 bool err2D = fitWDD( xc2D, yc2D, r2D, track.
links() );
1084 if ( newLine.
fit() != 0 )
return NULL;
1093 double tmpQ = track.
charge() > 0. ? 1. : -1.;
1094 tmpA[1] = fmod( atan2( tmpQ * yc2D, tmpQ * xc2D ) + 4. *
M_PI, 2. *
M_PI );
1097 tmpA[2] = tmpQ * ( 333.564095 / ( -1000 * ( getPmgnIMF()->getReferField() ) ) ) / r2D;
1098 tmpA[0] = xc2D /
cos( tmpA[1] ) - tmpQ * r2D;
1103 track._helix->
a( a );
1105 std::cout << track.
helix().
a()[0] <<
" " << track.
helix().
a()[1] <<
" "
1106 << track.
helix().
a()[2] <<
" " << track.
helix().
a()[3] <<
" "
1107 << track.
helix().
a()[4] << std::endl;
1111 int err = _fitter.fit( track );
1112 if ( err < m_param.ERROR_FOR_HELIX_FIT )
return NULL;
1113 track.
refine( bad, m_param.SELECTOR_MAX_SIGMA * 100. );
1114 err = _fitter.fit( track );
1115 if ( err < m_param.ERROR_FOR_HELIX_FIT )
return NULL;
1116 track.
refine( bad, m_param.SELECTOR_MAX_SIGMA * 10. );
1117 err = _fitter.fit( track );
1118 if ( err < m_param.ERROR_FOR_HELIX_FIT )
return NULL;
1119 track.
refine( bad, m_param.SELECTOR_MAX_SIGMA );
1120 err = _fitter.fit( track );
1121 if ( err < m_param.ERROR_FOR_HELIX_FIT )
return NULL;
1123 std::cout << track.
helix().
a()[0] <<
" " << track.
helix().
a()[1] <<
" "
1124 << track.
helix().
a()[2] <<
" " << track.
helix().
a()[3] <<
" "
1125 << track.
helix().
a()[4] << std::endl;
1130 if ( track.
nLinks() < m_param.SELECTOR_NLINKS )
return NULL;
1131 if ( fabs( track.
impact() ) > m_param.SELECTOR_MAX_IMPACT ||
1132 track.
pt() < m_param.SELECTOR_MIN_PT )
1144void TBuilderCurl::plotArcZ(
AList<TMLink>& tmpLine,
double a,
double b,
1145 const int flag )
const {
1146#if DEBUG_CURL_GNUPLOT
1148 if ( a == 9999. || b == 9999. )
1154 double gmaxX = 0., gminX = 0.;
1155 double gmaxY = 0., gminY = 0.;
1156 FILE * gnuplot, *
data;
1157 if ( (
data = fopen(
"you_can_remove_this.dat",
"w" ) ) != NULL )
1159 for (
int ii = 0; ii < tmpLine.length(); ii++ )
1162 fprintf(
data,
"%lf, %lf\n", tmpLine[ii]->position().
x(), tmpLine[ii]->position().y() );
1164 std::cout <<
" Wire ID = " << tmpLine[ii]->hit()->wire()->id()
1165 <<
" Arc = " << tmpLine[ii]->position().x()
1166 <<
" Z = " << tmpLine[ii]->position().y();
1173 if ( gmaxX < tmpLine[ii]->position().
x() ) gmaxX = tmpLine[ii]->position().x();
1174 if ( gminX > tmpLine[ii]->position().
x() ) gminX = tmpLine[ii]->position().x();
1175 if ( gmaxY < tmpLine[ii]->position().y() ) gmaxY = tmpLine[ii]->position().y();
1176 if ( gminY > tmpLine[ii]->position().y() ) gminY = tmpLine[ii]->position().y();
1180 if ( (
data = fopen(
"you_can_remove_this.dat2",
"w" ) ) != NULL )
1184 for(
int ii=0;ii<tmpLine.length();ii++){
1185 double z = (tmpLine[ii]->hit()->mc()->datcdc()->m_zin+
1186 tmpLine[ii]->hit()->mc()->datcdc()->m_zout)*0.5;
1187 if(tmpLine[ii]->arcZ(0).
x() != -999.){
1189 fprintf(
data,
"%lf, %lf\n",tmpLine[ii]->arcZ(0).
x(),z);
1190 if(gmaxX < tmpLine[ii]->arcZ(0).
x())
1191 gmaxX = tmpLine[ii]->arcZ(0).x();
1192 if(gminX > tmpLine[ii]->arcZ(0).
x())
1193 gminX = tmpLine[ii]->arcZ(0).x();
1204 if ( (
data = fopen(
"you_can_remove_this.dat3",
"w" ) ) != NULL )
1206 for (
int ii = 0; ii < tmpLine.length(); ii++ )
1208 for (
int jj = 0; jj < 4; ++jj )
1210 if ( tmpLine[ii]->arcZ( jj ).
x() != -999. )
1213 fprintf(
data,
"%lf, %lf\n", tmpLine[ii]->arcZ( jj ).
x(),
1214 tmpLine[ii]->arcZ( jj ).y() );
1215 if ( gmaxX < tmpLine[ii]->arcZ( jj ).
x() ) gmaxX = tmpLine[ii]->arcZ( jj ).x();
1216 if ( gminX > tmpLine[ii]->arcZ( jj ).
x() ) gminX = tmpLine[ii]->arcZ( jj ).x();
1217 if ( gmaxY < tmpLine[ii]->arcZ( jj ).y() ) gmaxY = tmpLine[ii]->arcZ( jj ).y();
1218 if ( gminY > tmpLine[ii]->arcZ( jj ).y() ) gminY = tmpLine[ii]->arcZ( jj ).y();
1225 if ( gmaxX < 0. ) gmaxX = 0.;
1226 if ( gminX > 0. ) gminX = 0.;
1227 if ( gmaxY < 0. ) gmaxY = 0.;
1228 if ( gminY > 0. ) gminY = 0.;
1229 if ( nCounter && ( gnuplot = popen(
"gnuplot",
"w" ) ) != NULL )
1231 fprintf( gnuplot,
"set nokey \n" );
1232 fprintf( gnuplot,
"set size 0.721,1.0 \n" );
1233 fprintf( gnuplot,
"set xrange [%f:%f] \n", gminX, gmaxX );
1234 fprintf( gnuplot,
"set yrange [%f:%f] \n", gminY, gmaxY );
1235 if ( a == 0. && b == 0. )
1237 fprintf( gnuplot,
"plot \"you_can_remove_this.dat3\", \"you_can_remove_this.dat\", "
1238 "\"you_can_remove_this.dat2\" \n" );
1243 "plot \"you_can_remove_this.dat3\", \"you_can_remove_this.dat\", "
1244 "\"you_can_remove_this.dat2\", %lf*x+%lf \n",
1269 unsigned maxLocalId = 39;
1270 if ( layerId == 1 ) maxLocalId = 43;
1271 else if ( layerId == 2 ) maxLocalId = 47;
1272 else if ( layerId == 3 ) maxLocalId = 55;
1273 else if ( layerId == 4 ) maxLocalId = 63;
1274 else if ( layerId == 5 ) maxLocalId = 71;
1275 else if ( layerId == 6 || layerId == 7 ) maxLocalId = 79;
1276 else if ( layerId == 20 || layerId == 21 || layerId == 22 || layerId == 23 )
1278 else if ( layerId == 24 || layerId == 25 || layerId == 26 || layerId == 27 )
1280 else if ( layerId == 28 || layerId == 29 || layerId == 30 || layerId == 31 )
1282 else if ( layerId == 32 || layerId == 33 || layerId == 34 || layerId == 35 )
1288unsigned isIsolation(
unsigned localId,
unsigned maxLocalId,
unsigned layerId,
int lr,
1293 findId = maxLocalId;
1294 if ( localId != 0 ) findId = localId - 1;
1296 else if ( lr == -1 )
1299 if ( localId != maxLocalId ) findId = localId + 1;
1302 unsigned isolate = 1;
1303 for (
int i = 0; i < allStereoList.length(); ++i )
1305 if ( allStereoList[i]->wire()->layerId() == layerId &&
1306 allStereoList[i]->wire()->localId() == findId )
1319 if ( hitsOnLayer.length() == 0 || hitsOnLayer.length() > 3 )
return;
1320 twoOnLayer.removeAll();
1321 if ( hitsOnLayer.length() == 1 )
1323 if ( hitsOnLayer[0]->wire()->superLayerId() == 0 )
return;
1324 unsigned maxLocalId =
findMaxLocalId( hitsOnLayer[0]->wire()->layerId() );
1325 unsigned R =
isIsolation( hitsOnLayer[0]->wire()->localId(), maxLocalId,
1326 hitsOnLayer[0]->wire()->layerId(), 1, allStereoList );
1327 unsigned L =
isIsolation( hitsOnLayer[0]->wire()->localId(), maxLocalId,
1328 hitsOnLayer[0]->wire()->layerId(), -1, allStereoList );
1329 if ( R == 1 && L == 0 )
1331 unsigned nextLocalId = hitsOnLayer[0]->wire()->localIdForPlus() + 1;
1332 L =
isIsolation( nextLocalId, maxLocalId, hitsOnLayer[0]->wire()->layerId(), -1,
1336 hitsOnLayer[0]->leftRight( 1 );
1337 hitsOnLayer[0]->position( hitsOnLayer[0]->arcZ( 1 ) );
1338 twoOnLayer.append( hitsOnLayer[0] );
1341 else if ( R == 0 && L == 1 )
1343 unsigned nextLocalId = hitsOnLayer[0]->wire()->localIdForMinus() + 1;
1344 R =
isIsolation( nextLocalId, maxLocalId, hitsOnLayer[0]->wire()->layerId(), 1,
1348 hitsOnLayer[0]->leftRight( 0 );
1349 hitsOnLayer[0]->position( hitsOnLayer[0]->arcZ( 0 ) );
1350 twoOnLayer.append( hitsOnLayer[0] );
1354 if ( hitsOnLayer.length() == 2 )
1356 if ( hitsOnLayer[0]->wire()->localIdForPlus() + 1 == hitsOnLayer[1]->wire()->localId() )
1358 unsigned maxLocalId =
findMaxLocalId( hitsOnLayer[0]->wire()->layerId() );
1359 unsigned R =
isIsolation( hitsOnLayer[0]->wire()->localId(), maxLocalId,
1360 hitsOnLayer[0]->wire()->layerId(), 1, allStereoList );
1361 unsigned L =
isIsolation( hitsOnLayer[1]->wire()->localId(), maxLocalId,
1362 hitsOnLayer[1]->wire()->layerId(), -1, allStereoList );
1363 if ( R == 1 && L == 1 )
1365 hitsOnLayer[0]->leftRight( 1 );
1366 hitsOnLayer[0]->position( hitsOnLayer[0]->arcZ( 1 ) );
1367 hitsOnLayer[1]->leftRight( 0 );
1368 hitsOnLayer[1]->position( hitsOnLayer[1]->arcZ( 0 ) );
1369 twoOnLayer.append( hitsOnLayer[0] );
1370 twoOnLayer.append( hitsOnLayer[1] );
1374 if ( hitsOnLayer.length() == 3 )
1376 if ( hitsOnLayer[0]->wire()->localIdForPlus() + 1 == hitsOnLayer[1]->wire()->localId() &&
1377 hitsOnLayer[1]->wire()->localIdForPlus() + 1 != hitsOnLayer[2]->wire()->localId() )
1379 unsigned maxLocalId =
findMaxLocalId( hitsOnLayer[0]->wire()->layerId() );
1380 unsigned R =
isIsolation( hitsOnLayer[0]->wire()->localId(), maxLocalId,
1381 hitsOnLayer[0]->wire()->layerId(), 1, allStereoList );
1382 unsigned L =
isIsolation( hitsOnLayer[1]->wire()->localId(), maxLocalId,
1383 hitsOnLayer[1]->wire()->layerId(), -1, allStereoList );
1384 if ( R == 1 && L == 1 )
1386 hitsOnLayer[0]->leftRight( 1 );
1387 hitsOnLayer[0]->position( hitsOnLayer[0]->arcZ( 1 ) );
1388 hitsOnLayer[1]->leftRight( 0 );
1389 hitsOnLayer[1]->position( hitsOnLayer[1]->arcZ( 0 ) );
1390 twoOnLayer.append( hitsOnLayer[0] );
1391 twoOnLayer.append( hitsOnLayer[1] );
1394 else if ( hitsOnLayer[0]->wire()->localIdForPlus() + 1 !=
1395 hitsOnLayer[1]->wire()->localId() &&
1396 hitsOnLayer[1]->wire()->localIdForPlus() + 1 ==
1397 hitsOnLayer[2]->wire()->localId() )
1399 unsigned maxLocalId =
findMaxLocalId( hitsOnLayer[1]->wire()->layerId() );
1400 unsigned R =
isIsolation( hitsOnLayer[1]->wire()->localId(), maxLocalId,
1401 hitsOnLayer[1]->wire()->layerId(), 1, allStereoList );
1402 unsigned L =
isIsolation( hitsOnLayer[2]->wire()->localId(), maxLocalId,
1403 hitsOnLayer[2]->wire()->layerId(), -1, allStereoList );
1404 if ( R == 1 && L == 1 )
1406 hitsOnLayer[1]->leftRight( 1 );
1407 hitsOnLayer[1]->position( hitsOnLayer[1]->arcZ( 1 ) );
1408 hitsOnLayer[2]->leftRight( 0 );
1409 hitsOnLayer[2]->position( hitsOnLayer[2]->arcZ( 0 ) );
1410 twoOnLayer.append( hitsOnLayer[1] );
1411 twoOnLayer.append( hitsOnLayer[2] );
1423 for (
unsigned i = 0; i < hitsOnLayer.length(); ++i )
1427 hitsOnLayer[i]->leftRight( 0 );
1428 hitsOnLayer[i]->position( hitsOnLayer[i]->arcZ( 0 ) );
1432 hitsOnLayer[i]->leftRight( 1 );
1433 hitsOnLayer[i]->position( hitsOnLayer[i]->arcZ( 1 ) );
1439 unsigned nHits = hitsOnLayer.length();
1440 if ( nHits == 0 )
return false;
1442 if ( hitsOnLayer[nHits - 1]->leftRight() == 1 )
return false;
1443 for (
unsigned i = 0; i < nHits; ++i )
1445 if ( hitsOnLayer[i]->leftRight() == 0 )
1447 hitsOnLayer[i]->leftRight( 1 );
1448 hitsOnLayer[i]->position( hitsOnLayer[i]->arcZ( 1 ) );
1456 goodWires.removeAll();
1457 for (
int i = 0; i < allWires.length(); ++i )
1459 if ( allWires[i]->position().
x() != -999. ) { goodWires.append( allWires[i] ); }
1463void TBuilderCurl::fitLine2(
const AList<TMLink>& tmpLine,
double& min_chi2,
double& good_a,
1466 AList<TMLink> goodWires;
1468 if ( goodWires.length() >= 3 )
1469 fitLine( goodWires, min_chi2, good_a, good_b, goodLine, goodPosition, overCounter );
1474 if (
abs( LR ) != 1 )
return;
1475 double Q = track.
charge();
1477 if ( Q > 0. && LR == 1 ) isOuter = -1;
1478 else if ( Q < 0. && LR == -1 ) isOuter = -1;
1479 radius = fabs( track.
radius() );
1485 center = wire + ( radius + ( (double)isOuter ) * ( hit.
hit()->drift() ) ) *
1486 ( center - wire ).
unit();
1491 hitsOnLayer.remove( hits );
1492 if ( hitsOnLayer.length() == 0 )
return;
1494 unsigned nHits = hits.length();
1495 if ( nHits == 0 )
return;
1501 if ( hits[nHits - 1]->leftRight() == 1 )
1504 ref = *hits[nHits - 1];
1506 for (
unsigned i = 0; i < nHits; ++i )
1508 if ( hits[i]->leftRight() == 0 )
1519 double Q = track.
charge();
1520 for (
int i = 0; i < hitsOnLayer.length(); ++i )
1523 if ( ( hitsOnLayer[i]->wire()->xyPosition() - center ).mag() - radius < 0. ) isOuter = -1;
1524 if ( Q > 0. && isOuter == 1 )
1526 hitsOnLayer[i]->position( hitsOnLayer[i]->arcZ( 0 ) );
1527 hitsOnLayer[i]->leftRight( 0 );
1529 else if ( Q > 0. && isOuter == -1 )
1531 hitsOnLayer[i]->position( hitsOnLayer[i]->arcZ( 1 ) );
1532 hitsOnLayer[i]->leftRight( 1 );
1534 else if ( Q < 0. && isOuter == 1 )
1536 hitsOnLayer[i]->position( hitsOnLayer[i]->arcZ( 1 ) );
1537 hitsOnLayer[i]->leftRight( 1 );
1539 else if ( Q < 0. && isOuter == -1 )
1541 hitsOnLayer[i]->position( hitsOnLayer[i]->arcZ( 0 ) );
1542 hitsOnLayer[i]->leftRight( 0 );
1549 double& min_chi2,
double& good_a,
double& good_b,
1551 if ( list.length() == 0 )
return;
1553 AList<TMLink> layer[24];
1554 AList<TMLink> layerOrg[24];
1555 for (
unsigned i = 0, size = list.length(); i < size; ++i )
1557 layer[list[i]->wire()->layer()->axialStereoLayerId()].append( *list[i] );
1558 layerOrg[list[i]->wire()->layer()->axialStereoLayerId()].append( *list[i] );
1561 AList<TMLink> fixedWires[6];
1562 AList<TMLink> nonFixedWires[6];
1563 AList<TMLink> allFixedWires;
1564 for (
unsigned i = 0; i < 24; ++i )
1566 if ( layer[i].length() )
1569 sortByLocalId( layer[i] );
1574 layer[i].removeAll();
1575 allFixedWires.append( tmp );
1577 if ( i < 4 ) fixedWires[0].append( tmp );
1578 else if ( i < 8 ) fixedWires[1].append( tmp );
1579 else if ( i < 12 ) fixedWires[2].append( tmp );
1580 else if ( i < 16 ) fixedWires[3].append( tmp );
1581 else if ( i < 20 ) fixedWires[4].append( tmp );
1582 else fixedWires[5].append( tmp );
1586 if ( i < 4 ) nonFixedWires[0].append( layer[i] );
1587 else if ( i < 8 ) nonFixedWires[1].append( layer[i] );
1588 else if ( i < 12 ) nonFixedWires[2].append( layer[i] );
1589 else if ( i < 16 ) nonFixedWires[3].append( layer[i] );
1590 else if ( i < 20 ) nonFixedWires[4].append( layer[i] );
1591 else nonFixedWires[5].append( layer[i] );
1597 std::cout <<
"(TBuilderCurl) 1st fixed & non-fixed wires selection:" << std::endl;
1598 std::cout <<
"(TBuilderCurl) all fixed wires # = " << allFixedWires.length() << std::endl;
1599 std::cout <<
"(TBuilderCurl) fixed wires # = (" << fixedWires[0].length() <<
", "
1600 << fixedWires[1].length() <<
", " << fixedWires[2].length() <<
", "
1601 << fixedWires[3].length() <<
", " << fixedWires[4].length() <<
", "
1602 << fixedWires[5].length() <<
")" << std::endl;
1603 std::cout <<
"(TBuilderCurl) non fixed wires # = (" << nonFixedWires[0].length() <<
", "
1604 << nonFixedWires[1].length() <<
", " << nonFixedWires[2].length() <<
", "
1605 << nonFixedWires[3].length() <<
", " << nonFixedWires[4].length() <<
", "
1606 << nonFixedWires[5].length() <<
")" << std::endl;
1608 for(
unsigned i=0;i<allFixedWires.length();++i)
1609 std::cout << i <<
": LocalID/LayerID = " << allFixedWires[i]->wire()->localId()
1610 <<
"/" << allFixedWires[i]->wire()->layerId()
1611 <<
", LR = " << allFixedWires[i]->leftRight() << std::endl;
1615 int createdLine = 0;
1616 int overCounter = 0;
1617 AList<TMLink> goodWires;
1619 if ( allFixedWires.length() >= 5 )
1622 if ( goodWires.length() >= 5 )
1624 fitLine( goodWires, min_chi2, good_a, good_b, goodLine, goodPosition, overCounter );
1625 if ( fabs( good_b ) < 10. ) createdLine = 1;
1630 if ( createdLine == 0 )
1634 double Q = track.
charge();
1635 unsigned isIncreased = 0;
1636 for (
int sl = 0; sl < 6; ++sl )
1638 if ( fixedWires[sl].length() >= 1 && nonFixedWires[sl].length() >= 1 )
1641 unsigned bestNCorrectLR = 0;
1642 double bestR = 1.e9;
1644 for (
int i = 0; i < fixedWires[sl].length(); ++i )
1646 int LR = fixedWires[sl][i]->leftRight() == 0 ? -1 : 1;
1650 unsigned nCorrectLR = 0;
1651 for (
int j = 0; j < fixedWires[sl].length(); ++j )
1656 if ( ( fixedWires[sl][j]->wire()->xyPosition() - center ).mag() - radius < 0. )
1658 if ( Q > 0. && tmpIsOuter == 1 && fixedWires[sl][j]->leftRight() == 0 )
1660 else if ( Q > 0. && tmpIsOuter == -1 && fixedWires[sl][j]->leftRight() == 1 )
1662 else if ( Q < 0. && tmpIsOuter == 1 && fixedWires[sl][j]->leftRight() == 1 )
1664 else if ( Q < 0. && tmpIsOuter == -1 && fixedWires[sl][j]->leftRight() == 0 )
1668 if ( i == 0 || nCorrectLR > bestNCorrectLR )
1670 bestNCorrectLR = nCorrectLR;
1674 if ( bestNCorrectLR == fixedWires[sl].length() - 1 )
break;
1676 for (
int i = 0; i < nonFixedWires[sl].length(); ++i )
1679 if ( ( nonFixedWires[sl][i]->wire()->xyPosition() - bestC ).mag() - bestR < 0. )
1681 if ( Q > 0. && isOuter == 1 )
1683 nonFixedWires[sl][i]->position( nonFixedWires[sl][i]->arcZ( 0 ) );
1684 nonFixedWires[sl][i]->leftRight( 0 );
1686 else if ( Q > 0. && isOuter == -1 )
1688 nonFixedWires[sl][i]->position( nonFixedWires[sl][i]->arcZ( 1 ) );
1689 nonFixedWires[sl][i]->leftRight( 1 );
1691 else if ( Q < 0. && isOuter == 1 )
1693 nonFixedWires[sl][i]->position( nonFixedWires[sl][i]->arcZ( 1 ) );
1694 nonFixedWires[sl][i]->leftRight( 1 );
1696 else if ( Q < 0. && isOuter == -1 )
1698 nonFixedWires[sl][i]->position( nonFixedWires[sl][i]->arcZ( 0 ) );
1699 nonFixedWires[sl][i]->leftRight( 0 );
1702 allFixedWires.append( nonFixedWires[sl] );
1703 fixedWires[sl].append( nonFixedWires[sl] );
1704 nonFixedWires[sl].removeAll();
1709 std::cout <<
"(TBuilderCurl) 2nd fixed & non-fixed wires selection:" << std::endl;
1710 std::cout <<
"(TBuilderCurl) all fixed wires # = " << allFixedWires.length()
1712 std::cout <<
"(TBuilderCurl) fixed wires # = (" << fixedWires[0].length() <<
", "
1713 << fixedWires[1].length() <<
", " << fixedWires[2].length() <<
", "
1714 << fixedWires[3].length() <<
", " << fixedWires[4].length() <<
", "
1715 << fixedWires[5].length() <<
")" << std::endl;
1716 std::cout <<
"(TBuilderCurl) non fixed wires # = (" << nonFixedWires[0].length() <<
", "
1717 << nonFixedWires[1].length() <<
", " << nonFixedWires[2].length() <<
", "
1718 << nonFixedWires[3].length() <<
", " << nonFixedWires[4].length() <<
", "
1719 << nonFixedWires[5].length() <<
")" << std::endl;
1721 for(
unsigned i=0;i<allFixedWires.length();++i)
1722 std::cout << i <<
": LocalID/LayerID = " << allFixedWires[i]->wire()->localId()
1723 <<
"/" << allFixedWires[i]->wire()->layerId()
1724 <<
", LR = " << allFixedWires[i]->leftRight() << std::endl;
1728 if ( isIncreased == 1 && allFixedWires.length() >= 5 )
1731 if ( goodWires.length() >= 5 )
1733 fitLine( goodWires, min_chi2, good_a, good_b, goodLine, goodPosition, overCounter );
1734 if ( fabs( good_b ) < 10. ) createdLine = 1;
1741 if ( createdLine == 0 )
1744 int maxNonFixedLayerIndex[6] = { -1, -1, -1, -1, -1, -1 };
1745 int maxLength[6] = { 0, 0, 0, 0, 0, 0 };
1746 for (
int l = 0; l < 24; ++l )
1749 if ( l < 4 ) sl = 0;
1750 else if ( l < 8 ) sl = 1;
1751 else if ( l < 12 ) sl = 2;
1752 else if ( l < 16 ) sl = 3;
1753 else if ( l < 20 ) sl = 4;
1754 layer[l].remove( fixedWires[sl] );
1756 if ( layer[l].length() && layer[l].length() > maxLength[sl] )
1758 maxLength[sl] = layer[l].length();
1759 maxNonFixedLayerIndex[sl] = l;
1764 unsigned nonFixedSuperLayerIndex[6] = { 0, 0, 0, 0, 0, 0 };
1765 unsigned isIncreased = 0;
1766 for (
unsigned i = 0; i < 6; ++i )
1768 allFixedWires.append( nonFixedWires[i] );
1769 if ( nonFixedWires[i].length() )
1772 nonFixedSuperLayerIndex[index] = i;
1780 moveLR( layer[maxNonFixedLayerIndex[nonFixedSuperLayerIndex[0]]],
1781 nonFixedWires[nonFixedSuperLayerIndex[0]], track );
1784 setLR( nonFixedWires[nonFixedSuperLayerIndex[1]] );
1786 moveLR( layer[maxNonFixedLayerIndex[nonFixedSuperLayerIndex[1]]],
1787 nonFixedWires[nonFixedSuperLayerIndex[1]], track );
1790 setLR( nonFixedWires[nonFixedSuperLayerIndex[2]] );
1792 moveLR( layer[maxNonFixedLayerIndex[nonFixedSuperLayerIndex[2]]],
1793 nonFixedWires[nonFixedSuperLayerIndex[2]], track );
1796 setLR( nonFixedWires[nonFixedSuperLayerIndex[3]] );
1798 moveLR( layer[maxNonFixedLayerIndex[nonFixedSuperLayerIndex[3]]],
1799 nonFixedWires[nonFixedSuperLayerIndex[3]], track );
1802 setLR( nonFixedWires[nonFixedSuperLayerIndex[4]] );
1804 moveLR( layer[maxNonFixedLayerIndex[nonFixedSuperLayerIndex[4]]],
1805 nonFixedWires[nonFixedSuperLayerIndex[4]], track );
1808 setLR( nonFixedWires[nonFixedSuperLayerIndex[5]] );
1810 moveLR( layer[maxNonFixedLayerIndex[nonFixedSuperLayerIndex[5]]],
1811 nonFixedWires[nonFixedSuperLayerIndex[5]], track );
1812 fitLine2( allFixedWires, min_chi2, good_a, good_b, goodLine,
1813 goodPosition, overCounter );
1814 if ( overCounter > 10000 )
goto kokohe;
1816 layer[maxNonFixedLayerIndex[nonFixedSuperLayerIndex[5]]] ) );
1820 fitLine2( allFixedWires, min_chi2, good_a, good_b, goodLine,
1821 goodPosition, overCounter );
1822 if ( overCounter > 10000 )
goto kokohe;
1825 moveLR( layer[maxNonFixedLayerIndex[nonFixedSuperLayerIndex[4]]] ) );
1829 fitLine2( allFixedWires, min_chi2, good_a, good_b, goodLine,
1830 goodPosition, overCounter );
1831 if ( overCounter > 10000 )
goto kokohe;
1834 moveLR( layer[maxNonFixedLayerIndex[nonFixedSuperLayerIndex[3]]] ) );
1838 fitLine2( allFixedWires, min_chi2, good_a, good_b, goodLine, goodPosition,
1840 if ( overCounter > 10000 )
goto kokohe;
1842 }
while (
moveLR( layer[maxNonFixedLayerIndex[nonFixedSuperLayerIndex[2]]] ) );
1846 fitLine2( allFixedWires, min_chi2, good_a, good_b, goodLine, goodPosition,
1848 if ( overCounter > 10000 )
goto kokohe;
1850 }
while (
moveLR( layer[maxNonFixedLayerIndex[nonFixedSuperLayerIndex[1]]] ) );
1854 fitLine2( allFixedWires, min_chi2, good_a, good_b, goodLine, goodPosition,
1856 if ( overCounter > 10000 )
goto kokohe;
1858 }
while (
moveLR( layer[maxNonFixedLayerIndex[nonFixedSuperLayerIndex[0]]] ) );
1861 else if ( allFixedWires.length() >= 3 )
1863 fitLine2( allFixedWires, min_chi2, good_a, good_b, goodLine, goodPosition, overCounter );
1867 for (
unsigned i = 0, size = goodLine.length(); i < size; ++i )
1868 { goodLine[i]->position( *( goodPosition[i] ) ); }
1870 std::cout <<
"(TBuilderCurl) make a line from All SuperLayers." << std::endl;
1871 plotArcZ( goodLine, good_a, good_b, 0 );
1875bool TBuilderCurl::fitWDD(
double& xc,
double& yc,
double& r,
AList<TMLink>& list )
const {
1876 if ( list.length() <= 3 )
return false;
1879 for (
int i = 0; i < list.length(); ++i )
1881 circle.
add_point( list[i]->wire()->xyPosition().
x(), list[i]->wire()->xyPosition().y(),
1885 if ( circle.
fit() < 0.0 || circle.
kappa() == 0.0 )
return false;
1889 const int maxIte = 2;
1890 for (
int ite = 0; ite < maxIte; ++ite )
1895 for (
int i = 0; i < list.length(); ++i )
1897 double R = sqrt( ( list[i]->wire()->xyPosition().
x() - xc ) *
1898 ( list[i]->wire()->xyPosition().
x() - xc ) +
1899 ( list[i]->wire()->xyPosition().y() - yc ) *
1900 ( list[i]->wire()->xyPosition().y() - yc ) );
1901 if ( R == 0. )
continue;
1903 double dir =
R > r ? -1. : 1.;
1904 double X = xc + ( list[i]->wire()->xyPosition().
x() - xc ) * U *
1905 (
R + dir * list[i]->hit()->drift() );
1906 double Y = yc + ( list[i]->wire()->xyPosition().y() - yc ) * U *
1907 (
R + dir * list[i]->hit()->drift() );
1911 if ( circle2.
fit() < 0.0 || circle2.
kappa() == 0.0 )
return false;
1912 xc = circle2.
center()[0];
1913 yc = circle2.
center()[1];
1920int TBuilderCurl::stereoHit(
double& xc,
double& yc,
double& r,
double&
q,
1922 if ( list.length() == 0 )
return -1;
1926 for (
unsigned i = 0, size = list.length(); i < size; ++i )
1928 TMDCWireHit& h = *
const_cast<TMDCWireHit*
>( list[i]->hit() );
1934 double vmag2 =
v.mag2();
1935 double vmag = sqrt( vmag2 );
1937 for (
unsigned j = 0; j < 4; ++j ) list[i]->arcZ( tmp, j );
1940 if ( vmag == 0. )
continue;
1943 double R[2] = { r + drift, r - drift };
1944 double wv =
w.dot(
v );
1946 d2[0] = vmag2 *
R[0] *
R[0] +
1947 ( wv * wv - vmag2 *
w.mag2() );
1948 d2[1] = vmag2 *
R[1] *
R[1] +
1949 ( wv * wv - vmag2 *
w.mag2() );
1951 if ( d2[0] < 0. && d2[1] < 0. )
continue;
1953 bool ok_inner(
true );
1954 bool ok_outer(
true );
1955 double d[2] = { -1., -1. };
1957 if ( d2[0] >= 0. ) { d[0] = sqrt( d2[0] ); }
1958 else { ok_outer =
false; }
1959 if ( d2[1] >= 0. ) { d[1] = sqrt( d2[1] ); }
1960 else { ok_inner =
false; }
1968 l[0][0] = ( -wv + d[0] ) /
1970 l[1][0] = ( -wv - d[0] ) /
1972 z[0][0] = X.z() + l[0][0] * V.z();
1973 z[1][0] = X.z() + l[1][0] * V.z();
1978 l[0][1] = ( -wv + d[1] ) /
1980 l[1][1] = ( -wv - d[1] ) /
1982 z[0][1] = X.z() + l[0][1] * V.z();
1983 z[1][1] = X.z() + l[1][1] * V.z();
1990 p[0][0] =
x + l[0][0] *
v;
1991 p[1][0] =
x + l[1][0] *
v;
1994 p[0][0] -= drift / pc0.mag() * pc0;
1995 tmp_pc = p[1][0] - center;
1997 p[1][0] -= drift / pc1.mag() * pc1;
2001 p[0][1] =
x + l[0][1] *
v;
2002 p[1][1] =
x + l[1][1] *
v;
2005 p[0][1] += drift / pc0.mag() * pc0;
2006 tmp_pc = p[1][1] - center;
2008 p[1][1] += drift / pc1.mag() * pc1;
2020 ok_xy[0][0] =
false;
2021 ok_xy[1][0] =
false;
2030 ok_xy[0][1] =
false;
2031 ok_xy[1][1] =
false;
2035 if (
q * ( center.x() * p[0][0].y() - center.y() * p[0][0].x() ) < 0. )
2036 ok_xy[0][0] =
false;
2037 if (
q * ( center.x() * p[1][0].y() - center.y() * p[1][0].x() ) < 0. )
2038 ok_xy[1][0] =
false;
2042 if (
q * ( center.x() * p[0][1].y() - center.y() * p[0][1].x() ) < 0. )
2043 ok_xy[0][1] =
false;
2044 if (
q * ( center.x() * p[1][1].y() - center.y() * p[1][1].x() ) < 0. )
2045 ok_xy[1][1] =
false;
2047 if ( !ok_inner && ok_outer && ( !ok_xy[0][0] ) && ( !ok_xy[1][0] ) ) {
continue; }
2048 if ( ok_inner && !ok_outer && ( !ok_xy[0][1] ) && ( !ok_xy[1][1] ) ) {
continue; }
2057 ok_xy[0][0] =
false;
2063 ok_xy[1][0] =
false;
2069 ok_xy[0][1] =
false;
2075 ok_xy[1][1] =
false;
2077 if ( ( !ok_xy[0][0] ) && ( !ok_xy[1][0] ) && ( !ok_xy[0][1] ) && ( !ok_xy[1][1] ) )
2080 double cosdPhi, dPhi;
2082 unsigned indexL = 0;
2083 unsigned indexR = 0;
2090 cosdPhi = -center.dot( ( p[0][0] - center ).
unit() ) / center.mag();
2091 if ( fabs( cosdPhi ) < 1.0 ) { dPhi = acos( cosdPhi ); }
2092 else if ( cosdPhi >= 1.0 ) { dPhi = 0.; }
2093 else { dPhi =
M_PI; }
2100 if ( indexL == 0 ) list[i]->arcZ(
HepPoint3D( r * dPhi, z[0][0], 0. ), 0 );
2101 else list[i]->arcZ(
HepPoint3D( r * dPhi, z[0][0], 0. ), 2 );
2107 if ( indexR == 0 ) list[i]->arcZ(
HepPoint3D( r * dPhi, z[0][0], 0. ), 1 );
2108 else list[i]->arcZ(
HepPoint3D( r * dPhi, z[0][0], 0. ), 3 );
2115 cosdPhi = -center.dot( ( p[1][0] - center ).
unit() ) / center.mag();
2116 if ( fabs( cosdPhi ) < 1.0 ) { dPhi = acos( cosdPhi ); }
2117 else if ( cosdPhi >= 1.0 ) { dPhi = 0.; }
2118 else { dPhi =
M_PI; }
2125 if ( indexL == 0 ) list[i]->arcZ(
HepPoint3D( r * dPhi, z[1][0], 0. ), 0 );
2126 else list[i]->arcZ(
HepPoint3D( r * dPhi, z[1][0], 0. ), 2 );
2132 if ( indexR == 0 ) list[i]->arcZ(
HepPoint3D( r * dPhi, z[1][0], 0. ), 1 );
2133 else list[i]->arcZ(
HepPoint3D( r * dPhi, z[1][0], 0. ), 3 );
2140 cosdPhi = -center.dot( ( p[0][1] - center ).
unit() ) / center.mag();
2141 if ( fabs( cosdPhi ) < 1.0 ) { dPhi = acos( cosdPhi ); }
2142 else if ( cosdPhi >= 1.0 ) { dPhi = 0.; }
2143 else { dPhi =
M_PI; }
2150 if ( indexR == 0 ) list[i]->arcZ(
HepPoint3D( r * dPhi, z[0][1], 0. ), 1 );
2151 else list[i]->arcZ(
HepPoint3D( r * dPhi, z[0][1], 0. ), 3 );
2157 if ( indexL == 0 ) list[i]->arcZ(
HepPoint3D( r * dPhi, z[0][1], 0. ), 0 );
2158 else list[i]->arcZ(
HepPoint3D( r * dPhi, z[0][1], 0. ), 2 );
2165 cosdPhi = -center.dot( ( p[1][1] - center ).
unit() ) / center.mag();
2166 if ( fabs( cosdPhi ) < 1.0 ) { dPhi = acos( cosdPhi ); }
2167 else if ( cosdPhi >= 1.0 ) { dPhi = 0.; }
2168 else { dPhi =
M_PI; }
2175 if ( indexR == 0 ) list[i]->arcZ(
HepPoint3D( r * dPhi, z[1][1], 0. ), 1 );
2176 else list[i]->arcZ(
HepPoint3D( r * dPhi, z[1][1], 0. ), 3 );
2182 if ( indexL == 0 ) list[i]->arcZ(
HepPoint3D( r * dPhi, z[1][1], 0. ), 0 );
2183 else list[i]->arcZ(
HepPoint3D( r * dPhi, z[1][1], 0. ), 2 );
2193 AList<TMLink> tmp = alayer0;
2194 tmp.append( alayer1 );
2196 if ( fitWDD( xc, yc, r, tmp ) )
2199 stereoHit( xc, yc, r,
q, slayer );
2205 unsigned ip )
const {
2206 AList<TMLink> tmp = alayer0;
2207 tmp.append( alayer1 );
2208 tmp.append( alayer2 );
2210 if ( fitWDD( xc, yc, r, tmp ) )
2213 stereoHit( xc, yc, r,
q, slayer );
2220 AList<TMLink> tmp = alayer0;
2221 tmp.append( alayer1 );
2222 tmp.append( alayer2 );
2223 tmp.append( alayer3 );
2225 if ( fitWDD( xc, yc, r, tmp ) )
2228 stereoHit( xc, yc, r,
q, slayer );
2235 unsigned ip )
const {
2236 AList<TMLink> tmp = alayer0;
2237 tmp.append( alayer1 );
2238 tmp.append( alayer2 );
2239 tmp.append( alayer3 );
2240 tmp.append( alayer4 );
2242 if ( fitWDD( xc, yc, r, tmp ) )
2245 stereoHit( xc, yc, r,
q, slayer );
2270 if (
nullptr == m_pmgnIMF )
2272 StatusCode sc = Gaudi::svcLocator()->service(
"MagneticFieldSvc", m_pmgnIMF );
2273 if ( sc.isFailure() )
2274 { std::cout <<
"Unable to open Magnetic field service" << std::endl; }
2279#undef DEBUG_CURL_DUMP
2280#undef DEBUG_CURL_GNUPLOT
HepGeom::Vector3D< double > HepVector3D
HepGeom::Point3D< double > HepPoint3D
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per saves r n generator level $ !Flag for chat level in !Latex Output unit
*********DOUBLE PRECISION m_pi INTEGER m_lenwt !max no of aux weights INTEGER m_phmax !maximum photon multiplicity ISR FSR *DOUBLE COMPLEX m_Pauli4 DOUBLE COMPLEX m_AmpBorn DOUBLE COMPLEX m_AmpBoxy DOUBLE COMPLEX m_AmpBorn1 DOUBLE COMPLEX m_AmpBorn2 DOUBLE COMPLEX m_AmpExpo2p DOUBLE COMPLEX m_Rmat DOUBLE COMPLEX m_BoxGZut !DOUBLE COMPLEX m_F1finPair2 !DOUBLE PRECISION m_Vcut DOUBLE PRECISION m_Alfinv DOUBLE PRECISION m_Lorin1 DOUBLE PRECISION m_Lorin2 DOUBLE PRECISION m_b
double cos(const BesAngle a)
#define WireHitFittingValid
#define WireHitInvalidForFit
int SortByWireId(const void *a, const void *b)
Sorter.
****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_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
HepGeom::Point3D< double > HepPoint3D
int checkBorder(AList< TMLink > &layer0, AList< TMLink > &layer1, AList< TMLink > &layer2)
void selectGoodWires(const AList< TMLink > &allWires, AList< TMLink > &goodWires)
void makeList(AList< TMLink > &layer, AList< TMLink > &list, double q, int border, int checkB, TMLink *layer0)
bool moveLR(AList< TMLink > &hitsOnLayer)
void calVirtualCircle(const TMLink &hit, const TTrack &track, const int LR, HepPoint3D ¢er, double &radius)
unsigned findMaxLocalId(unsigned layerId)
int doLineFit(AList< TMLink > &points, double &m_a, double &m_b, double &chi2, double &nhits, int ipC=1)
unsigned isIsolation(unsigned localId, unsigned maxLocalId, unsigned layerId, int lr, const AList< TMLink > &allStereoList)
void setLR(AList< TMLink > &hitsOnLayer, unsigned LR=0)
int offsetBorder(TMLink *l)
void findTwoHits(AList< TMLink > &twoOnLayer, const AList< TMLink > &hitsOnLayer, const AList< TMLink > &allStereoList)
const HepPoint3D & center(void) const
returns position of helix center(z = 0.);
const HepVector & a(void) const
returns helix parameters.
void add_point(double x, double y, double w=1)
const std::string & name(void) const
returns name.
TBuilder0(const std::string &name)
Constructor.
virtual int fit(TTrackBase &) const
fits a track using a private fitter.
virtual ~TBuilderCurl()
Destructor.
TBuilderCurl(const std::string &name)
Constructor.
TTrack * buildStereo(TTrack &track, const AList< TMLink > &) const
appends stereo hits to a track.
TTrack * buildStereoMC(TTrack &track, const AList< TMLink > &) const
void setParam(const TCurlFinderParameter &)
double SELECTOR_STRANGE_PZ
double SELECTOR_MAX_IMPACT
unsigned SVD_RECONSTRUCTION
double Z_DIFF_FOR_LAST_ATTEND
double SELECTOR_REPLACE_DZ
double SELECTOR_MAX_SIGMA
A class to fit a TTrackBase object to a helix.
A class to represent a track in tracking.
double b(void) const
returns coefficient b.
double a(void) const
returns coefficient a.
float drift(unsigned) const
returns drift distance.
const TMDCWire *const wire(void) const
returns a pointer to a TMDCWire.
unsigned id(void) const
returns id.
unsigned layerId(void) const
returns layer id.
const HepVector3D & direction(void) const
returns direction vector of the wire.
const HepPoint3D & xyPosition(void) const
returns middle position of a wire. z componet is 0.
const HepPoint3D & forwardPosition(void) const
returns position in forward endplate.
const HepPoint3D & backwardPosition(void) const
returns position in backward endplate.
A class to represent a track in tracking.
double a(void) const
returns coefficient a.
double b(void) const
returns coefficient b.
A class to relate TMDCWireHit and TTrack objects.
const TMDCWireHit * hit(void) const
returns a pointer to a hit.
const HepPoint3D & position(void) const
returns position.
const TMDCWire *const wire(void) const
returns a pointer to a wire.
A class to fit a TTrackBase object to a line.
virtual int fit(TTrackBase &) const
virtual int fit(void)
fits itself by a default fitter. Error was happened if return value is not zero.
virtual void refine(AList< TMLink > &list, double maxSigma)
void append(TMLink &)
appends a TMLink.
const AList< TMLink > & links(unsigned mask=0) const
unsigned nLinks(unsigned mask=0) const
returns # of masked TMLinks assigned to this track object.
A class to represent a track in tracking.
const Helix & helix(void) const
returns helix parameter.
int stereoHitForCurl(TMLink &link, AList< HepPoint3D > &arcZList) const
double radius(void) const
returns signed radius.
double impact(void) const
returns signed impact parameter to the origin.
double pt(void) const
returns Pt.
double pz(void) const
returns Pz.
double charge(void) const
returns charge.
complex_t R(double Q2, double M2, double G, double Mp2, double Mm2)