6 #ifdef CATRACKER_DISPLAY
28 #include "Riostream.h"
32 #include "TApplication.h"
38 class PndCADisplay::PndCADisplayTmpHit
43 int ID()
const {
return fHitID; }
44 double S()
const {
return fS; }
45 double Z()
const {
return fZ; }
47 void SetID(
int v ) { fHitID =
v; }
48 void SetS(
double v ) { fS =
v; }
49 void SetZ(
double v ) {
fZ =
v; }
51 static bool CompareHitDS(
const PndCADisplayTmpHit &
a,
52 const PndCADisplayTmpHit &
b ) {
53 return ( a.fS < b.fS );
56 static bool CompareHitZ(
const PndCADisplayTmpHit &a,
57 const PndCADisplayTmpHit &b ) {
58 return ( a.fZ < b.fZ );
71 PndCADisplay &PndCADisplay::Instance()
74 static PndCADisplay gPndCADisplay;
79 PndCADisplay::PndCADisplay() :
81 fYX( 0 ), fZX( 0 ), fZR( 0 ),
82 fFwdMvdCanvas(NULL), fFwdMvdZX(NULL), fFwdMvdZR(NULL),
83 fAsk( 1 ), fGB( 0 ), fPerf( 0 ),
84 fZMin( -100 ), fZMax( 100 ), fYMin( -210 ), fYMax( 210 ),
85 fRInnerMin( 50. ), fRInnerMax( 133.3 ), fROuterMin( 50 ), fROuterMax( 50 ), fTPCZMin( -60. ), fTPCZMax( 60 ),
86 fArc(), fLine(), fPLine(), fMarker(),
fBox(), fCrown(), fLatex(), fArrow(), fDrawOnlyRef( 0 )
88 fPerf = &( PndCAPerformance::Instance() );
93 PndCADisplay::~PndCADisplay()
105 static bool firstCall = 1;
107 if ( !gApplication )
new TApplication(
"myapp", 0, 0 );
110 gStyle->SetCanvasBorderMode( 0 );
111 gStyle->SetCanvasBorderSize( 1 );
112 gStyle->SetCanvasColor( 0 );
114 fCanvas =
new TCanvas(
"CA",
"CA Display", scale*1280*1.5, scale*645 );
115 fFwdMvdCanvas =
new TCanvas(
"CAMvdFwd",
"CAMvdFwd Display", scale*1280*1.5, scale*645 );
116 fCanvas->Divide( 3, 1 );
117 fFwdMvdCanvas->Divide( 3, 1 );
118 fZX =
static_cast<TPad *
>( fCanvas->GetPrimitive(
"CA_2" ) );
119 fZR =
static_cast<TPad *
>( fCanvas->GetPrimitive(
"CA_3" ) );
121 fCanvas =
new TCanvas(
"CA",
"CA Display", scale*1280*2, scale*645*2 );
122 fFwdMvdCanvas =
new TCanvas(
"CAMvdFwd",
"CAMvdFwd Display", scale*1280*2, scale*645*2 );
124 fCanvas->Divide( 2, 1 );
125 fFwdMvdCanvas->Divide( 2, 1 );
126 fZX =
static_cast<TPad *
>( fCanvas->GetPrimitive(
"CA_2" ) );
127 fFwdMvdZX =
static_cast<TPad *
>( fFwdMvdCanvas->GetPrimitive(
"CAMvdFwd_2" ) );
129 fFwdMvdZY =
static_cast<TPad *
>( fFwdMvdCanvas->GetPrimitive(
"CAMvdFwd_1" ) );
131 fYX =
static_cast<TPad *
>( fCanvas->GetPrimitive(
"CA_1" ) );
133 fFwdMvdZY->SetCanvas( fFwdMvdCanvas );
134 fFwdMvdZY->SetTitle(
"ZY" );
135 fFwdMvdZX->SetCanvas( fFwdMvdCanvas );
136 fFwdMvdZX->SetTitle(
"ZX" );
138 fYX->SetCanvas( fCanvas );
139 fYX->SetTitle(
"YX" );
140 fZX->SetCanvas( fCanvas );
141 fZX->SetTitle(
"ZX" );
146 fZR->SetCanvas( fCanvas );
147 fZR->SetTitle(
"ZR" );
151 fMarker = TMarker( 0.0, 0.0, 20 );
153 fFwdMvdZX->Range( -10, -120, 50, 120 );
154 fFwdMvdZY->Range( -10, -120, 50, 120 );
177 void PndCADisplay::ClearView()
191 void PndCADisplay::Ask()
197 std::cout <<
"ask> ";
199 std::cin.get( symbol );
202 }
while ( symbol !=
'\n' );
214 void PndCADisplay::DrawFwdMvd()
216 const int stColor = kBlack;
219 const int NDisks = 8;
220 vector <double> disk_zcenter;
221 disk_zcenter.resize(6);
223 disk_zcenter[0] = 2.2; disk_zcenter[1] = 4.2; disk_zcenter[2] = 7.2;
224 disk_zcenter[3] = 10.2;
226 disk_zcenter[4] = 15.625; disk_zcenter[5] = 21.375;
230 vector <double> disk_front_begin;
231 disk_front_begin.resize(NDisks);
232 disk_front_begin[0] = 1.97; disk_front_begin[1] = 3.97; disk_front_begin[2] = 6.97;
233 disk_front_begin[3] = 9.97; disk_front_begin[4] = 14.77; disk_front_begin[5] = 21.77;
235 disk_front_begin[6] = 16.0; disk_front_begin[7] = 20.47;
236 vector <double> disk_front_end;
237 disk_front_end.resize(NDisks);
238 disk_front_end[0] = 1.99; disk_front_end[1] = 3.99; disk_front_end[2] = 6.99;
239 disk_front_end[3] = 9.99; disk_front_end[4] = 14.79; disk_front_end[5] = 21.79;
241 disk_front_end[6] = 16.03; disk_front_end[7] = 20.50;
243 vector <double> disk_rear_begin;
244 disk_rear_begin.resize(NDisks);
245 disk_rear_begin[0] = 2.41; disk_rear_begin[1] = 4.41; disk_rear_begin[2] = 7.41;
246 disk_rear_begin[3] = 10.41; disk_rear_begin[4] = 15.21; disk_rear_begin[5] = 22.21;
248 disk_rear_begin[6] = 16.50; disk_rear_begin[7] = 20.97;
249 vector <double> disk_rear_end;
250 disk_rear_end.resize(NDisks);
251 disk_rear_end[0] = 2.43; disk_rear_end[1] = 4.43; disk_rear_end[2] = 7.43;
252 disk_rear_end[3] = 10.43; disk_rear_end[4] = 15.23; disk_rear_end[5] = 22.23;
254 disk_rear_end[6] = 16.53; disk_rear_end[7] = 21.00;
255 vector <double> disk_Rmax;
256 disk_Rmax.resize(NDisks);
257 disk_Rmax[0] = 3.656; disk_Rmax[1] = 3.656; disk_Rmax[2] = 7.396;
258 disk_Rmax[3] = 7.396; disk_Rmax[4] = 7.396; disk_Rmax[5] = 7.396;
260 disk_Rmax[6] = 13.115; disk_Rmax[7] = 13.115;
262 vector <double> disk_Rmin;
263 disk_Rmin.resize(NDisks);
264 disk_Rmin[0] = 1.170; disk_Rmin[1] = 1.170; disk_Rmin[2] = 1.170;
265 disk_Rmin[3] = 1.170; disk_Rmin[4] = 1.170; disk_Rmin[5] = 1.170;
267 disk_Rmin[6] = 7.433; disk_Rmin[7] = 7.433;
272 TBox *disk =
new TBox();
273 disk->SetFillColor(stColor);
275 TBox *spacebtwLayres =
new TBox();
276 spacebtwLayres->SetFillColor(kCyan-10);
279 for (
int ista = 0; ista < NDisks; ista++)
281 disk->DrawBox(2*disk_front_begin[ista], -2*disk_Rmax[ista], 2*disk_front_end[ista], 2*disk_Rmax[ista]);
282 disk->DrawBox(2*disk_rear_begin[ista], -2*disk_Rmax[ista], 2*disk_rear_end[ista], 2*disk_Rmax[ista]);
284 disk->SetFillColor(kWhite);
285 disk->DrawBox(2*disk_front_begin[ista], -2*disk_Rmin[ista], 2*disk_front_end[ista], 2*disk_Rmin[ista]);
286 disk->DrawBox(2*disk_rear_begin[ista], -2*disk_Rmin[ista], 2*disk_rear_end[ista], 2*disk_Rmin[ista]);
287 disk->SetFillColor(stColor);
289 if (ista==6 || ista==7) {
290 spacebtwLayres->SetFillColor(kGreen-10);
291 spacebtwLayres->DrawBox(2*(disk_front_end[ista]+0.01), -2*disk_Rmax[ista],2*(disk_rear_begin[ista]-0.01),2*disk_Rmax[ista]);
292 spacebtwLayres->SetFillColor(kMagenta-10);
294 {spacebtwLayres->DrawBox(2*(disk_rear_end[ista-2]+0.01), -2*disk_Rmax[ista],2*(disk_front_begin[ista]-0.01),2*disk_Rmax[ista]);}
296 {spacebtwLayres->DrawBox(2*(disk_rear_end[ista]+0.01), -2*disk_Rmax[ista],2*(disk_front_begin[ista-2]-0.01),2*disk_Rmax[ista]);}
297 spacebtwLayres->SetFillColor(kCyan-10);}
298 else {spacebtwLayres->DrawBox(2*(disk_front_end[ista]+0.01), -2*disk_Rmax[ista],2*(disk_rear_begin[ista]-0.01),2*disk_Rmax[ista]);}
302 for (
unsigned int itr=0; itr<disk_zcenter.size(); itr++)
304 fMarker.SetMarkerColor( kGreen+3 );
305 fMarker.SetMarkerSize( .9 );
306 fMarker.DrawMarker( 2*disk_zcenter[itr], 0 );
309 ZX.SetFillStyle( 0 );
312 ZX.SetLineColor(kGray);
313 ZX.DrawBox(-9, -119, 47, 119 );
316 TlZX.SetTextSize(0.03);
317 TlZX.SetTextAlign(22);
318 TlZX.DrawLatex( 47*0.95, 118*0.95,
"ZX" );
321 for (
int ista = 0; ista < NDisks; ista++)
323 disk->DrawBox(2*disk_front_begin[ista], -2*disk_Rmax[ista], 2*disk_front_end[ista], 2*disk_Rmax[ista]);
324 disk->DrawBox(2*disk_rear_begin[ista], -2*disk_Rmax[ista], 2*disk_rear_end[ista], 2*disk_Rmax[ista]);
326 disk->SetFillColor(kWhite);
327 disk->DrawBox(2*disk_front_begin[ista], -2*disk_Rmin[ista], 2*disk_front_end[ista], 2*disk_Rmin[ista]);
328 disk->DrawBox(2*disk_rear_begin[ista], -2*disk_Rmin[ista], 2*disk_rear_end[ista], 2*disk_Rmin[ista]);
329 disk->SetFillColor(stColor);
331 if (ista==6 || ista==7) {
332 spacebtwLayres->SetFillColor(kGreen-10);
333 spacebtwLayres->DrawBox(2*(disk_front_end[ista]+0.001), -2*disk_Rmax[ista],2*(disk_rear_begin[ista]-0.001),2*disk_Rmax[ista]);
334 spacebtwLayres->SetFillColor(kMagenta-10);
336 {spacebtwLayres->DrawBox(2*(disk_rear_end[ista-2]+0.01), -2*disk_Rmax[ista],2*(disk_front_begin[ista]-0.01),2*disk_Rmax[ista]);}
338 {spacebtwLayres->DrawBox(2*(disk_rear_end[ista]+0.01), -2*disk_Rmax[ista],2*(disk_front_begin[ista-2]-0.01),2*disk_Rmax[ista]);}
339 spacebtwLayres->SetFillColor(kCyan-10);}
340 else {spacebtwLayres->DrawBox(2*(disk_front_end[ista]+0.001), -2*disk_Rmax[ista],2*(disk_rear_begin[ista]-0.001),2*disk_Rmax[ista]);}
343 for (
unsigned int itr=0; itr<disk_zcenter.size(); itr++)
345 fMarker.SetMarkerColor( kGreen+3 );
346 fMarker.SetMarkerSize( .9 );
347 fMarker.DrawMarker( 2*disk_zcenter[itr], 0 );
350 ZY.SetFillStyle( 0 );
353 ZY.SetLineColor(kGray);
354 ZY.DrawBox(-9, -119, 47, 119 );
357 TlZY.SetTextSize(0.03);
358 TlZY.SetTextAlign(22);
359 TlZY.DrawLatex( 47*0.95, 118*0.95,
"ZY" );
363 void PndCADisplay::DrawTPC()
366 const int detColor = kGray+1;
372 const int color = detColor;
373 const float width = .1;
376 const float RMax = 40.827;
380 l.SetLineColor( color );
381 l.SetLineWidth( width );
384 const float x0L = 16.1;
385 const float a = x0L/
sqrt(3.
f/4.
f);
387 x[7] = {0,x0L,x0L,0,-x0L,-x0L,0},
388 y[7] = {-
a,-a/2,a/2,
a,a/2,-a/2,-a};
390 for (
int i = 0;
i < 6;
i++ ) {
392 l.DrawLine( x[
i],
y[i], c*x[i], c*
y[i] );
399 pl.SetLineColor( color );
400 pl.SetLineWidth( width );
403 const float x0L = 16.1;
404 const float a = x0L/
sqrt(3.
f/4.
f);
406 x[7] = {0,x0L,x0L,0,-x0L,-x0L},
407 y[7] = {-
a,-a/2,a/2,
a,a/2,-a/2,-a};
408 pl.DrawPolyLine( 7, x,
y );
411 pl.SetLineStyle( 9 );
414 const float x0L = 23.3;
415 const float a = x0L/
sqrt(3.
f/4.
f);
417 x[7] = {0,x0L,x0L,0,-x0L,-x0L},
418 y[7] = {-
a,-a/2,a/2,
a,a/2,-a/2,-a};
419 pl.DrawPolyLine( 7, x,
y );
424 const float x0L = 31.7;
425 const float a = x0L/
sqrt(3.
f/4.
f);
427 x[7] = {0,x0L,x0L,0,-x0L,-x0L},
428 y[7] = {-
a,-a/2,a/2,
a,a/2,-a/2,-a};
429 pl.DrawPolyLine( 7, x,
y );
443 fArc.SetLineColor( color );
444 fArc.SetFillStyle( 0 );
446 fArc.SetLineWidth(width);
459 fArc.DrawArc( 0, 0, 2.408 );
460 fArc.DrawArc( 0, 0, 4.969 );
461 fArc.DrawArc( 0, 0, 9.210 );
462 fArc.DrawArc( 0, 0, 12.529 );
463 fArc.DrawArc( 0, 0, RMax );
467 Tl.SetTextSize(0.03);
469 Tl.DrawLatex( -fROuterMax, fROuterMax,
"XY" );
478 ZX.SetFillStyle( 0 );
480 ZX.SetLineWidth(width);
481 ZX.SetLineColor(color);
487 ZX.DrawBox(-39.8/10, -28.58/10, 9.8/10, 28.58/10);
488 ZX.DrawBox(-79.8/10, -52.82/10, 57.8/10, 52.82/10);
489 ZX.DrawBox(-133.8/10, -96.86/10, 139.0/10, 96.86/10);
490 ZX.DrawBox(-169.2/10, -129.24/10, 139.0/10, 129.24/10);
491 ZX.DrawBox(fZMin,-fROuterMax,fZMax,fROuterMax);
494 Tl.SetTextSize(0.03);
496 Tl.DrawLatex( fZMin*0.93, fROuterMax*0.95,
"ZY" );
505 ZX.SetFillStyle( 0 );
507 ZX.SetLineWidth(width);
508 ZX.SetLineColor(color);
521 ZX.DrawBox(-550./10, -420./10, (1100.0-150.0)/10, 420./10);
523 Tl.SetTextSize(0.03);
525 Tl.DrawLatex( fZMin*0.93, fROuterMax*0.975,
"ZR" );
552 void PndCADisplay::DrawArc(
float x,
float y,
float r,
int Start, Size_t width )
554 fArc.SetLineWidth( width );
555 fArc.SetLineColor( 2 + Start);
558 fArc.DrawArc( x, y, r );
561 void PndCADisplay::DrawPoint(
float x,
float y,
float z,
int Start, Size_t width )
563 fMarker.SetMarkerSize( width );
564 fMarker.SetMarkerColor( 2 + Start);
567 fMarker.DrawMarker( x, y );
569 fMarker.DrawMarker( z, y );
572 void PndCADisplay::DrawGBPoint(
float x,
float y,
float z,
int Start, Size_t width )
575 fMarker.SetMarkerSize( width );
576 fMarker.SetMarkerColor( Start);
579 fMarker.DrawMarker( x, y );
581 fMarker.DrawMarker( z, y );
585 fMarker.DrawMarker( z,
sqrt(y*y+x*x) );
589 void PndCADisplay::DrawGBPoint(
float x,
float y,
float z,
float angle,
int Start, Size_t width )
592 fMarker.SetMarkerSize( width );
593 fMarker.SetMarkerColor( Start);
596 fArrow.SetFillColor( Start );
597 fArrow.SetLineColor( Start );
598 fArrow.SetLineWidth( 1*width );
609 fMarker.DrawMarker( x, y );
613 fMarker.DrawMarker( z, y );
617 fMarker.DrawMarker( z,
sqrt(y*y+x*x) );
621 void PndCADisplay::DrawGBLine(
float x,
float y,
float z,
float x2,
float y2,
float z2,
int Start, Size_t width,
int projection )
623 fLine.SetLineWidth( width );
624 fLine.SetLineColor( Start);
626 if ( projection == -1 || projection == 0 ) {
628 fLine.DrawLine( x, y, x2, y2 );
630 if ( projection == -1 || projection == 1 ) {
632 fLine.DrawLine( z, y, z2, y2 );
635 fLine.DrawLine( z,
sqrt(x*x+y*y), z2,
sqrt(x2*x2+y2*y2) );
640 int PndCADisplay::GetColor(
int i )
const
643 const Color_t kMyColor[9] = { kGreen, kBlue, kYellow, kCyan, kOrange,
644 kSpring, kTeal, kAzure, kViolet
647 if ( i == 0 )
return kBlack;
648 return kMyColor[( i-1 )%9];
651 int PndCADisplay::GetColorZ(
double z )
const
654 const Color_t kMyColor[11] = { kGreen, kBlue, kYellow, kMagenta, kCyan,
655 kOrange, kSpring, kTeal, kAzure, kViolet, kPink
658 double zz = ( z - fZMin ) / ( fZMax - fZMin );
659 int iz = ( int ) ( zz * 11 );
660 if ( iz < 0 ) iz = 0;
661 if ( iz > 10 ) iz = 10;
665 int PndCADisplay::GetColorY(
double y )
const
668 const Color_t kMyColor[11] = { kGreen, kBlue, kYellow, kMagenta, kCyan,
669 kOrange, kSpring, kTeal, kAzure, kViolet, kPink
672 double yy = ( y - fYMin ) / ( fYMax - fYMin );
673 int iy = ( int ) ( yy * 11 );
674 if ( iy < 0 ) iy = 0;
675 if ( iy > 10 ) iy = 10;
679 int PndCADisplay::GetColorK(
double k )
const
682 const Color_t kMyColor[11] = { kRed, kBlue, kYellow, kMagenta, kCyan,
683 kOrange, kSpring, kTeal, kAzure, kViolet, kPink
685 const double kCLight = 0.000299792458;
686 const double kBz = 5;
688 if (
TMath::Abs( kBz ) > 1.e-4 ) k2QPt = 1. / ( kBz * kCLight );
689 double qPt = k * k2QPt;
693 double yy = ( pt - 0.1 ) / ( 1. - 0.1 );
694 int iy = ( int ) ( yy * 11 );
695 if ( iy < 0 ) iy = 0;
696 if ( iy > 10 ) iy = 10;
700 void PndCADisplay::DrawGBHit(
const PndCAGBTracker &tracker,
int iHit,
int color, Size_t width )
707 int lab = fPerf->HitLabel( h.
ID() ).fLab[0];
708 color = GetColor( lab + 1 );
711 if ( mc.
P() >= 1. ) color = kRed;
712 else if ( fDrawOnlyRef )
return;
714 }
else color = GetColorZ( h.
Z() );
716 if ( width > 0 )fMarker.SetMarkerSize( width );
717 else fMarker.SetMarkerSize( .3 );
718 fMarker.SetMarkerColor( color );
722 fMarker.DrawMarker( vx, vy );
724 fMarker.DrawMarker( h.
Z(), vy );
727 void PndCADisplay::DrawGBHits(
const PndCAGBTracker &tracker,
int color, Size_t width,
int hitsType)
731 if ( !fPerf )
return;
732 if ( width < 0 ) width = .6;
734 for (
int iHit = 0; iHit < tracker.
NHits(); iHit++ ) {
739 int imc = fPerf->HitLabel( h.
ID() ).fLab[0];
740 const PndCAMCTrack *mc = ( imc >= 0 ) ? &( fPerf->MCTrack( imc ) ) : 0;
741 if ( fDrawOnlyRef && ( !mc || ( mc->
P() < 1 ) ) )
continue;
745 if (h.
Z() >= 0) col = kBlue;
746 if (h.
Z() < 0) col = 8;
749 col = GetColor( imc + 1 ) ;
753 if (h.
Angle()==-1234) {fMarker.SetMarkerColor( kOrange );}
754 else {fMarker.SetMarkerColor( col );}
755 fMarker.SetMarkerSize( width );
778 fMarker.DrawMarker( h.
Z(), vy );
782 fMarker.DrawMarker( h.
Z(),
sqrt(vx*vx+vy*vy) );
787 el.SetLineWidth( width );
788 el.SetLineColor( col );
789 el.SetFillStyle( 0 );
793 const double kSS = 1.5;
797 const double C00 = h.
C(0,0);
798 const double C01 = h.
C(0,1);
799 const double C11 = h.
C(1,1);
800 const double b = - (C00+C11);
801 const double det =
sqrt(b*b - 4*(C00*C11 - C01*C01));
802 const double e1 = (- b + det)*0.5, e2 = (- b - det)*0.5;
804 if (abs(C00 - C11) > 1e-7) {
805 a = 0.5*atan(2*C01/(C00-C11));
815 fMarker.DrawMarker( h.
XW(), h.
YW() );
824 double r2Min = 10e10, xSaved = 0, ySaved = 0, zSaved = 0;
825 for (
int itr = 0; itr < fGB->NTracks(); itr++ ) {
838 if (!rotated || !transported)
continue;
840 float p1 = p.
Y(),
p2 = p.
Z();
846 const double beta =
b;
847 const double betaLast = M_PI_2 +
b;
848 const double zL =
p2, yL =
p1;
849 const double z = x2, y = x1;
851 const double ctbL = tan( - betaLast);
852 const double ctb = tan( - beta);
854 double zM = ((zL*ctbL - yL) - (z*ctb - y))/(ctbL - ctb);
855 double yM = y + (zM -
z)*ctb;
857 double r2 = (yM - yL)*(yM - yL) + (zM - zL)*(zM - zL);
859 if (r2 > r2Min)
continue;
863 cout << r2Min <<
" " << xSaved <<
" " << ySaved << endl;
864 el.DrawEllipse( xSaved, ySaved, h.
R(), h.
R(), 0, 360, h.
Angle()*180/
TMath::Pi() );
865 fMarker.DrawMarker( xSaved, ySaved );
915 void PndCADisplay::HitToGlobal(
const PndCAHit& h,
float& x,
float& y,
float &z )
920 void PndCADisplay::HitToGlobal(
const PndCAHitV& h,
int iV,
float& x,
float& y,
float &z )
925 bool operator<(
const TVector3& a,
const TVector3& b) {
927 return a.X() < b.X();
930 return a.Y() < b.Y();
932 return a.Z() < b.Z();
937 for(
int iS = 0, iColor = 0; iS < all.
NStations(); ++iS, iColor++ ) {
938 if ( iColor == kYellow )
940 if ( iColor == kWhite )
943 map<TVector3,int> nSameHits;
945 for(
unsigned int i = 0; i < s.size(); ++
i ) {
950 HitToGlobal( h, gx, gy, gz );
952 DrawGBPoint( gx, gy, gz, iColor, 0.1 );
954 TVector3
v(gx, gy, gz);
955 if ( nSameHits.count(
v) > 0 )
960 TLatex* Tl =
new TLatex();
961 Tl->SetTextSize(0.002);
962 Tl->SetTextAlign(22);
970 str += fPerf->HitLabel( fGB->Hits()[h.
Id()].ID() ).fLab[0];
972 str += fPerf->HitLabel( fGB->Hits()[h.
Id()].ID() ).fLab[1];
974 str += fPerf->HitLabel( fGB->Hits()[h.
Id()].ID() ).fLab[2];
976 Tl->DrawLatex( gx, gy, str);
980 for (std::map<TVector3,int>::iterator it=nSameHits.begin(); it!=nSameHits.end(); ++it) {
981 TLatex* Tl =
new TLatex();
982 Tl->SetTextSize(0.002);
983 Tl->SetTextAlign(22);
987 Tl->DrawLatex( it->first.X(), it->first.Y(), text );
994 void PndCADisplay::DrawGBPoints() {
999 static double r[NSta];
1000 static double zRange[NSta][2];
1001 static double yRange[NSta][2];
1002 static double xRange[NSta][2][2];
1004 static double rMax[NSta];
1005 static double x0LRange[NSta][2];
1007 static bool first_call =
true;
1009 for(
int i = 0; i < NSta; i++ ) {
1012 zRange[
i][0] = 1e10;
1013 zRange[
i][1] = -1e10;
1014 yRange[
i][0] = 1e10;
1015 yRange[
i][1] = -1e10;
1016 xRange[
i][0][0] = 1e10;
1017 xRange[
i][0][1] = -1e10;
1018 xRange[
i][1][0] = 1e10;
1019 xRange[
i][1][1] = -1e10;
1021 x0LRange[
i][0] = 1e10;
1022 x0LRange[
i][1] = -1e10;
1028 const vector<PndCALocalMCPoint>& mcPs = *(fPerf->GetMCPoints());
1029 for(
unsigned int i = 0; i < mcPs.size(); ++
i ) {
1030 PndCALocalMCPoint mcPoint = mcPs[
i];
1031 double mcX0 = mcPoint.X();
1032 double mcY0 = mcPoint.Y();
1033 double mcZ = mcPoint.Z();
1035 PndCADisplay::Instance().DrawGBPoint((
float)mcX0, (
float)mcY0, (
float)mcZ, kRed, (Size_t).2);
1045 const int iS = mcPoint.IRow();
1046 if ( iS >= NSta || iS < 0 )
continue;
1048 const double rCurr =
sqrt(mcX0*mcX0 + mcY0*mcY0);
1049 r[iS] +=
sqrt(mcX0*mcX0 + mcY0*mcY0);
1050 zRange[iS][0] =
std::min( zRange[iS][0], mcZ );
1051 zRange[iS][1] =
std::max( zRange[iS][1], mcZ );
1052 yRange[iS][0] =
std::min( yRange[iS][0], mcY0 );
1053 yRange[iS][1] =
std::max( yRange[iS][1], mcY0 );
1055 xRange[iS][0][0] =
std::min( xRange[iS][0][0], mcX0 );
1056 xRange[iS][0][1] =
std::max( xRange[iS][0][1], mcX0 );
1058 xRange[iS][1][0] =
std::min( xRange[iS][1][0], mcX0 );
1059 xRange[iS][1][1] =
std::max( xRange[iS][1][1], mcX0 );
1061 rMax[iS] =
std::max( rMax[iS], rCurr );
1064 double A = atan( abs(mcY0/mcX0) );
1066 if ( mcY0 >= 0 && mcX0 >= 0 ) A = pi2 - A;
1067 if ( mcY0 < 0 && mcX0 >= 0 ) A = pi2 + A;
1068 if ( mcY0 < 0 && mcX0 < 0 ) A = 3*pi2 - A;
1069 if ( mcY0 >= 0 && mcX0 < 0 ) A = 3*pi2 + A;
1070 A = floor(A/pi2*6)*pi2*2/3.f;
1075 cout << iS <<
" " << mcX0 <<
" "<< x0 <<
" " << A <<
" " << mcPoint.Angle() << endl;
1076 x0LRange[iS][0] =
std::min( x0LRange[iS][0], abs(x0) );
1077 x0LRange[iS][1] =
std::max( x0LRange[iS][1], abs(x0) );
1082 for(
int i = 0; i < NSta; i++ )
1083 cout << i <<
" station: "
1084 <<
" x- = [" << xRange[i][0][0] <<
"," << xRange[i][0][1] <<
"]"
1085 <<
" x+ = [" << xRange[i][1][0] <<
"," << xRange[i][1][1] <<
"]"
1086 <<
" y = [" << yRange[i][0] <<
"," << yRange[i][1] <<
"]"
1087 <<
" z = [" << zRange[i][0] <<
"," << zRange[i][1] <<
"]" << endl
1088 <<
" r = " << r[i]/N[i]
1089 <<
" rMax = " << rMax[i]
1090 <<
" x0Local = [" << x0LRange[i][0] <<
"," << x0LRange[i][1] <<
"]" << endl;
1094 void PndCADisplay::DrawPVHisto(
const vector<float>& pvHist,
const PndCAParam& param) {
1095 const unsigned int N = pvHist.size();
1096 const float maxZ = param.
MaxZ();
1098 for(
unsigned int i = 0; i < N; ++
i ) {
1099 max = ( max < pvHist[
i] ) ? pvHist[i] : max;
1102 for(
unsigned int i = 0; i < N; ++
i ) {
1103 float z = (2.f*i/N-1)*maxZ;
1104 float dr = pvHist[
i]/max*maxZ;
1107 fLine.SetLineColor( kBlue );
1108 fLine.SetLineWidth(0);
1109 fLine.DrawLine( z, 0, z, -dr );
1113 void PndCADisplay::DrawGBNPlets(
const PndCANPletsV& all) {
1183 void PndCADisplay::DrawGBTracks(
const PndCATracks& all) {
1184 for(
unsigned int i = 0; i < all.size(); ++
i ) {
1186 const unsigned int NTHits = t.
NHits();
1188 for(
unsigned int iH=1; iH < NTHits; iH++) {
1191 float gx0, gy0, gz0, gx1, gy1, gz1;
1192 HitToGlobal( hitP, gx0, gy0, gz0 );
1193 HitToGlobal( hit, gx1, gy1, gz1 );
1194 DrawGBLine( gx0, gy0, gz0, gx1, gy1, gz1, kRed, 0.1 );
1200 int PndCADisplay::GetTrackMC(
const PndCADisplayTmpHit *vHits,
int NHits )
1208 int *lb =
new int[NHits*3];
1211 for (
int ihit = 0; ihit < NHits; ihit++ ) {
1213 const PndCAPerformance::PndCAHitLabel &l = fPerf->HitLabel( h.
ID() );
1214 if ( l.fLab[0] >= 0 ) lb[nla++] = l.fLab[0];
1215 if ( l.fLab[1] >= 0 ) lb[nla++] = l.fLab[1];
1216 if ( l.fLab[2] >= 0 ) lb[nla++] = l.fLab[2];
1219 sort( lb, lb + nla );
1220 int labmax = -1, labcur = -1, lmax = 0, lcurr = 0, nh = 0;
1222 for (
int i = 0; i < nla; i++ ) {
1223 if ( lb[i] != labcur ) {
1224 if ( 0 && i > 0 && lb[i-1] >= 0 ) {
1226 std::cout << lb[i-1] <<
": nhits=" << nh <<
", pdg=" << mc.
PDG() <<
", Pt=" << mc.
Pt() <<
", P=" << mc.
P()
1227 <<
", par=" << mc.
Par()[0] <<
" " << mc.
Par()[1] <<
" " << mc.
Par()[2]
1228 <<
" " << mc.
Par()[3] <<
" " << mc.
Par()[4] <<
" " << mc.
Par()[5] <<
" " << mc.
Par()[6] << std::endl;
1232 if ( labcur >= 0 && lmax < lcurr ) {
1242 if ( 0 && nla - 1 > 0 && lb[nla-1] >= 0 ) {
1244 std::cout << lb[nla-1] <<
": nhits=" << nh <<
", pdg=" << mc.
PDG() <<
", Pt=" << mc.
Pt() <<
", P=" << mc.
P()
1245 <<
", par=" << mc.
Par()[0] <<
" " << mc.
Par()[1] <<
" " << mc.
Par()[2]
1246 <<
" " << mc.
Par()[3] <<
" " << mc.
Par()[4] <<
" " << mc.
Par()[5] <<
" " << mc.
Par()[6] << std::endl;
1249 if ( labcur >= 0 && lmax < lcurr ) {
1254 for (
int ihit = 0; ihit < NHits; ihit++ ) {
1256 const PndCAPerformance::PndCAHitLabel &l = fPerf->HitLabel( h.
ID() );
1257 if ( l.fLab[0] == labmax || l.fLab[1] == labmax || l.fLab[2] == labmax
1261 purity = ( ( NHits > 0 ) ?
double( lmax ) / double( NHits ) : 0 );
1262 if ( lb )
delete[] lb;
1263 if ( purity < .9 ) label = -1;
1268 bool PndCADisplay::DrawTrack(
PndCATrackParam t,
double Alpha,
const PndCADisplayTmpHit *vHits,
1269 int NHits,
int color, Size_t width,
bool pPoint )
1272 const bool drawEndPoints = 0;
1274 if ( NHits < 2 )
return 0;
1277 if ( width < 0 ) width = 2;
1280 for (
int ii=0; ii< tracker.NFwdTracks(); ii++)
1283 if (track.
NHits()>1)
1285 vector <Double_t> trackX, trackY, trackZ;
1292 for (
int i=0; i < track.
NHits(); i++)
1294 int ih=track.GetHitID (i);
1295 trackX.push_back(MX[ih]);
1296 trackY.push_back(MY[ih]);
1297 trackZ.push_back(MZ[ih]);
1300 pline.SetLineColor(kViolet+(2*ii));
1301 pline.SetLineWidth(0.2);
1303 pline.DrawPolyLine(trackX.size(), &(trackZ[0]), &(trackY[0]) );
1305 pline.DrawPolyLine(trackX.size(), &(trackZ[0]), &(trackX[0]) );
1309 trackX.clear(); trackY.clear(); trackZ.clear();
1312 fFwdMvdZY->cd(); fFwdMvdZY->Update();
1313 fFwdMvdZX->cd(); fFwdMvdZX->Update();
1317 if ( fDrawOnlyRef ) {
1318 int lab = GetTrackMC( vHits, NHits );
1319 if ( lab < 0 )
return 0;
1321 if ( mc.
P() < 1 )
return 0;
1327 int lab = GetTrackMC( vHits, NHits );
1328 color = GetColor( lab + 1 );
1342 vector<double> vx(NHits), vy(NHits), vz(NHits);
1346 double alpha = Alpha;
1349 for (
int iHit = 0; iHit < NHits; iHit++ ) {
1356 double x1 = x0 * hCos +
y0 * hSin;
1357 double y1 =
y0 * hCos - x0 * hSin;
1360 double dx = x1 - tt.
X();
1361 double dy = y1 - tt.
Y();
1362 if ( dx*dx + dy*dy > 1. ) {
1364 if ( tt.
Rotate( dalpha ) ) {
1368 x1 = x0 * hCos +
y0 * hSin;
1369 y1 =
y0 * hCos - x0 * hSin;
1380 double x1 = t.
X(), y1 = t.
Y(), z1 = t.
Z();
1382 double dx = x1 - vx[0];
1383 double dy = y1 - vy[0];
1385 double d0 = dx * dx + dy *
dy;
1386 dx = x1 - vx[mHits-1];
1387 dy = y1 - vy[mHits-1];
1389 double d1 = dx * dx + dy *
dy;
1397 for (
int i = mHits; i > 0; i-- ) {
1410 fLine.SetLineColor( color );
1411 fLine.SetLineWidth( width );
1412 fArc.SetFillStyle( 0 );
1413 fArc.SetLineColor( color );
1414 fArc.SetLineWidth( width );
1416 pl.SetLineColor( color );
1417 pl.SetLineWidth( width );
1419 plZ.SetLineColor( color );
1420 plZ.SetLineWidth( width );
1422 fMarker.SetMarkerSize( width / 2. );
1423 fMarker.SetMarkerColor( color );
1426 pl.DrawPolyLine( mHits, &vx[0], &vy[0] );
1427 if (drawEndPoints) {
1428 fMarker.DrawMarker( vx[0], vy[0] );
1429 fMarker.DrawMarker( vx[mHits-1], vy[mHits-1] );
1432 plZ.DrawPolyLine( mHits, &vz[0], &vy[0] );
1433 if (drawEndPoints) {
1434 fMarker.DrawMarker( vz[0], vy[0] );
1435 fMarker.DrawMarker( vz[mHits-1], vy[mHits-1] );
1438 fLine.SetLineWidth( 1 );
1443 void PndCADisplay::DrawHelix(
float p0,
float c,
float z,
float zStart,
float z0,
float xc,
float yc,
float r,
float b,
int color, Size_t width)
1445 fLine.SetLineColor(color);
1446 fLine.SetLineWidth(width);
1449 p = p0 + c*(zStart-
z0)/b;
1451 x = xc + c*r*
cos(p);
1453 float zPrev = zStart;
1458 for(
int i=1; i<100; i++)
1460 z = zStart + (zEnd-zStart)/100*i;
1461 p = p0 + c*(z-
z0)/b;
1463 x = xc + c*r*
cos(p);
1466 fLine.DrawLine( x, y, xPrev, yPrev);
1468 fLine.DrawLine( z, y, zPrev, yPrev);
1476 void PndCADisplay::DrawParticleGlobal(
float *param,
float q,
float tStart,
float tEnd,
float b,
int color, Size_t width)
1478 fLine.SetLineColor(color);
1479 fLine.SetLineWidth(width);
1480 fArrow.SetFillColor( color );
1481 fArrow.SetLineColor( color );
1482 fArrow.SetLineWidth( width );
1485 for(
int iP=0; iP<8; iP++)
1490 float xPrev=0, yPrev=0, zPrev=0;
1492 const float kCLight = 0.000299792458;
1495 for(
int i=0; i<=100; i++)
1499 float s =
sin(bs), c =
cos(bs);
1502 const float kOvSqr6 = 1./
sqrt(6.);
1504 sB = (1.e-8 <
fabs(bs)) ? (s/b) : ((1-bs*kOvSqr6)*(1+bs*kOvSqr6)*
t) ;
1505 cB = (1.e-8 <
fabs(bs)) ? ((1-c)/
b) : (.5*sB*bs) ;
1507 float px = param[3];
1508 float py = param[4];
1509 float pz = param[5];
1511 p[0] = param[0] + sB*px + cB*py;
1512 p[1] = param[1] - cB*px + sB*py;
1513 p[2] = param[2] + t*
pz;
1515 p[4] = -s*px + c*py;
1523 fLine.DrawLine( p[0], p[1], xPrev, yPrev);
1525 fLine.DrawLine( p[2], p[1], zPrev, yPrev);
1534 void PndCADisplay::DrawParticleGlobal(
float *param,
float q,
float n[4],
float b,
int color, Size_t width)
1536 fLine.SetLineColor(color);
1537 fLine.SetLineWidth(width);
1538 fArrow.SetFillColor( color );
1539 fArrow.SetLineColor( color );
1540 fArrow.SetLineWidth( width );
1543 for(
int iP=0; iP<8; iP++)
1548 float xPrev=p[0], yPrev=p[1], zPrev=p[2];
1550 const float kCLight = 0.000299792458;
1554 double dist = p[0]*n[0]+p[1]*n[1]+p[2]*n[2]+n[3];
1555 double dist_last = dist;
1556 bool step_changed =
false;
1557 for(
int i=1; dist > 0 && i < 10000; i++)
1562 float s =
sin(bs), c =
cos(bs);
1565 const float kOvSqr6 = 1./
sqrt(6.);
1567 sB = (1.e-8 <
fabs(bs)) ? (s/b) : ((1-bs*kOvSqr6)*(1+bs*kOvSqr6)*
t) ;
1568 cB = (1.e-8 <
fabs(bs)) ? ((1-c)/
b) : (.5*sB*bs) ;
1570 float px = param[3];
1571 float py = param[4];
1572 float pz = param[5];
1574 p[0] = param[0] + sB*px + cB*py;
1575 p[1] = param[1] - cB*px + sB*py;
1576 p[2] = param[2] + t*
pz;
1578 p[4] = -s*px + c*py;
1583 dist = p[0]*n[0]+p[1]*n[1]+p[2]*n[2]+n[3];
1585 if(dist < dist_last)
1588 fLine.DrawLine( p[0], p[1], xPrev, yPrev);
1590 fLine.DrawLine( p[2], p[1], zPrev, yPrev);
1592 else if ( abs(dist - dist_last) < 1e-8 ) {
1597 else if (!step_changed) {
1599 step_changed =
true;
1614 DrawGBPoint( xPrev, yPrev, zPrev, color, 0.2 );
1617 void PndCADisplay::DrawGBTrack(
int itr,
int color,
int width )
1624 if ( track.
NHits() < 2 )
return;
1626 vector<PndCADisplayTmpHit> vHits( track.
NHits() );
1628 for (
int ih = 0; ih < track.
NHits(); ih++ ) {
1631 vHits[ih].
SetID( i );
1632 vHits[ih].SetS( 0 );
1633 vHits[ih].SetZ( h.
Z() );
1639 void PndCADisplay::DrawRecoTrack(
int itr,
int color,
int width )
1644 if ( track.
NHits() < 2 )
return;
1646 #if 1 // draw by hits or by parameters
1649 double hLx = hLast.X(), hLy = hLast.Y(), hLz = hLast.
Z();
1652 for (
int ih = 1; ih < track.
NHits(); ih++ ) {
1659 const double betaLast = M_PI_2 - 0.5*atan(2*hLast.
ErrX12()/(hLast.
Err2X2() - hLast.
Err2X1()));
1663 const double ctbL = tan(M_PI_2 - betaLast);
1664 const double ctb = tan(M_PI_2 - beta);
1665 float xL, yL, zL,
x,
y,
z;
1669 double xM = (xL +
x)*0.5;
1670 double zM = ((zL*ctbL - yL) - (z*ctb - y))/(ctbL - ctb);
1671 double yM = y + (zM -
z)*ctb;
1672 double xMg, yMg, zMg;
1675 if ( ih - skipped != 1 || (
fabs(hLast.
ErrX12()) < 1e-7) ) {
1677 DrawGBLine( hLx, hLy, hLz, xMg, yMg, zMg, color, width, 0 );
1679 DrawGBLine( hLx, hLy, hLz, xMg, yMg, zMg, color, width );
1681 DrawGBPoint( xMg, yMg, zMg, kBlack, 0.1 );
1699 DrawGBLine( hLx, hLy, hLz, h.X(), h.Y(), h.
Z(), color, width, 0 );
1701 DrawGBLine( hLx, hLy, hLz, h.X(), h.Y(), h.
Z(), color, width );
1702 hLx = h.X(), hLy = h.Y(), hLz = h.
Z();
1712 #else // draw by hits or by parameters
1716 float x,
y,
z,px,py,
pz;
1720 const float pz0 = p.
DzDs()/p.
QPt();
1723 float param[8] = {
x,
y,
z,px,py,
pz, 0, 0 };
1724 const float l = fGB->GetParameters().MaxR()-
sqrt(x*x + y*y);
1725 DrawParticleGlobal( param, 1.
f, 0, l/
sqrt(px0*px0+py0*py0), tracker.
GetParameters().
Bz(), color, 0 );
1726 #endif // draw by hits or by parameters
1729 void PndCADisplay::DrawMCTrack(
int itr,
int color,
int width )
1731 PndCAPerformance& perf = PndCAPerformance::Instance();
1733 const vector<PndCAMCTrack>& mcTs = *perf.GetMCTracks();
1734 const vector<PndCALocalMCPoint>& mcPs = *perf.GetMCPoints();
1739 fLine.SetLineStyle( 3 );
1741 for (
int ih = 1; ih < track.
NMCPoints(); ih++ ) {
1742 const PndCALocalMCPoint& mcP = mcPs[ track.
FirstMCPointID() + ih ];
1743 DrawGBLine( mcPLast.X(), mcPLast.Y(), mcPLast.Z(), mcP.X(), mcP.Y(), mcP.Z(), color, width );
1747 fLine.SetLineStyle( 1 );
1750 void PndCADisplay::DrawGBTrackFast(
const PndCAGBTracker &tracker,
int itr,
int color )
1755 if ( track.
NHits() < 2 )
return;
1758 PndCADisplayTmpHit *vHits =
new PndCADisplayTmpHit[track.
NHits()];
1761 for (
int ih = 0; ih < track.
NHits(); ih++ ) {
1764 vHits[ih].
SetID( i );
1765 vHits[ih].SetS( 0 );
1766 vHits[ih].SetZ( h->
Z() );
1769 sort( vHits, vHits + track.
NHits(), PndCADisplayTmpHit::CompareHitZ );
1774 if ( color < 0 ) color = GetColorZ( ( h1.
Z() + h2.
Z() ) / 2. );
1776 if ( colorY < 0 ) colorY = GetColorY( ( gy1 + gy2 ) / 2. );
1777 color = colorY = GetColorK( t.
GetQPt() );
1780 fMarker.SetMarkerColor( color );
1781 fMarker.SetMarkerSize( 1. );
1782 fLine.SetLineColor( color );
1783 fLine.SetLineWidth( width );
1784 fArc.SetFillStyle( 0 );
1785 fArc.SetLineColor( color );
1786 fArc.SetLineWidth( width );
1788 pl.SetLineColor( colorY );
1789 pl.SetLineWidth( width );
1796 float x1, y1, z1, x2, y2, z2;
1797 double vx1, vy1, vx2, vy2;
1807 double x0 = t.
GetX();
1819 double xc = x0 - ey * ( 1 / k );
1820 double yc = y0 + ex * ( 1 / k );
1822 double vx = xc, vy = yc;
1826 if ( a1 < 0 ) a1 += 360;
1827 if ( a2 < 0 ) a2 += 360;
1828 if ( a2 < a1 ) a2 += 360;
1830 if ( da > 360 ) da -= 360;
1835 if ( a2 < a1 ) a2 += 360;
1837 fArc.DrawArc( vx, vy, r, a1, a2,
"only" );
1841 fLine.DrawLine( vx1, vy1, vx2, vy2 );
1846 vector<double> py( track.
NHits() ),
pz( track.
NHits() );
1848 for (
int iHit = 0; iHit < track.
NHits(); iHit++ ) {
1863 pl.DrawPolyLine( track.
NHits(), &(pz[0]), &(py[0]) );
1865 fLine.SetLineWidth( 1 );
1869 void PndCADisplay::DrawTrackParam(
TrackParam t,
int color )
1873 for (
int i = 0; i < 100; ++
i ) {
1874 double x = t.
GetX();
1875 double y = t.
GetY();
1877 double z = t.
GetZ();
1882 fLine.SetLineWidth( 1 );
1883 fLine.SetLineColor( color );
1885 double vx =
x, vy =
y, vex = ex, vey = ey;
1891 fLine.DrawLine( vx, vy, vx + vex*4, vy + vey*4 );
1893 fLine.DrawLine( z, vy, z + dzds*4, vy + vey*4 );
1899 void PndCADisplay::SaveCanvasToFile(
TString fileName){
1900 fCanvas->SaveAs(fileName);
1903 void PndCADisplay::SetTPC(
const PndCAParam& tpcParam){
1904 UNUSED_PARAM1(tpcParam);
1905 fZMin = tpcParam.
MinZ();
1906 fZMax = tpcParam.
MaxZ();
1909 fRInnerMin = tpcParam.
MinR();
1912 fROuterMax = tpcParam.
MaxR();
1914 fYX->Range( -fROuterMax-2, -fROuterMax-2, fROuterMax+2, fROuterMax+2 );
1915 fZX->Range( fZMin*1.01, -fROuterMax*1.01, fZMax*1.01, fROuterMax*1.01 );
1917 fZR->Range( fZMin*1.01, -fROuterMax*0.01, fZMax*1.01, fROuterMax*1.01 );
1922 #endif //CATRACKER_DISPLAY
float C(int i1, int i2) const
const PndCAHit & Hit(int iH, int iT) const
void GetDCAPoint(float x, float y, float z, float &px, float &py, float &pz, float Bz) const
friend F32vec4 cos(const F32vec4 &a)
const PndCAGBHit & Hit(int index) const
float GetKappa(float Bz) const
bool Rotate(float alpha, float maxSinPhi=.999)
friend F32vec4 sqrt(const F32vec4 &a)
friend F32vec4 sin(const F32vec4 &a)
const PndCATrackParam & OuterParam() const
const PndCAStation & Station(short i) const
PndCAElementsOnStation< T > & OnStation(char i)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
bool TransportToXWithMaterial(float x, float Bz, float maxSinPhi=.999)
int TrackHit(int i) const
TString pt(TString pts, TString exts="px py pz")
const PndCAGBTrack & Track(int i) const
static T RSqrt(const T &x)
int FirstMCPointID() const
void GetLocalX0X1X2(float &x0, float &x1, float &x2) const
static T ATan2(const T &y, const T &x)
const PndCAGBHit * Hits() const
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 fabs(const F32vec4 &a)
static void CALocalToGlobal(T x0, T x1, T angle, T &x, T &y)
friend F32vec4 atan2(const F32vec4 &y, const F32vec4 &x)
const PndCATrackParam & Param() const
bool TransportToX(float x, float Bz, float maxSinPhi=.999)
static void GlobalToCALocal(T x, T y, T angle, T &x0, T &x1)
PndCAGBTrack * Tracks() const
const PndCATrackParam & InnerParam() const
const PndCAParam & GetParameters() const
void CalculateFitParameters(PndCATrackFitParam &par, float mass=0.13957)
friend F32vec4 operator<(const F32vec4 &a, const F32vec4 &b)
static const float RefThreshold