Belle II Software development
CDCTriggerTrack Class Reference

Track created by the CDC trigger. More...

#include <CDCTriggerTrack.h>

Inheritance diagram for CDCTriggerTrack:
Helix

Public Member Functions

 CDCTriggerTrack ()
 default constructor, initializing everything to 0.
 
 CDCTriggerTrack (double phi0, double omega, double chi2, const std::vector< bool > &foundoldtrack, const std::vector< bool > &driftthreshold, bool valstereobit=false, int expert=-1, short time=0, short quadrant=-1)
 2D constructor, initializing 3D values to 0.
 
 CDCTriggerTrack (double phi0, double omega, double chi2, short time=0, short quadrant=-1)
 
 CDCTriggerTrack (double phi0, double omega, double chi2D, double z0, double cotTheta, double chi3D, const std::vector< bool > &foundoldtrack=std::vector< bool >(6, false), const std::vector< bool > &driftthreshold=std::vector< bool >(9, false), bool valstereobit=false, int expert=-1, const std::vector< unsigned > &tsvector=std::vector< unsigned >(9, 0), short time=0, short quadrant=-1, unsigned qualityvector=0)
 3D constructor
 
 CDCTriggerTrack (double phi0, double omega, double chi2D, double z0, double cotTheta, double prob, double chi3D, const std::vector< bool > &foundoldtrack=std::vector< bool >(6, false), const std::vector< bool > &driftthreshold=std::vector< bool >(9, false), bool valstereobit=false, int expert=-1, const std::vector< unsigned > &tsvector=std::vector< unsigned >(9, 0), short time=0, short quadrant=-1, unsigned qualityvector=0)
 3D constructor with p
 
 ~CDCTriggerTrack ()
 destructor, empty because we don't allocate memory anywhere.
 
float getChi2D () const
 get chi2 value of 2D fitter
 
float getChi3D () const
 get chi2 value of 3D fitter
 
float getTime () const
 get the track found time
 
double getPt () const
 get the absolute value of the transverse momentum at the perigee assuming d0 = 0
 
short getQuadrant () const
 get the quadrant
 
std::vector< bool > getFoundOldTrack () const
 returns true, if old 2dtrack was found
 
bool getValidStereoBit () const
 returns true, if at least 3 stereo ts were found
 
std::vector< bool > getDriftThreshold () const
 returns true, if the drift time was fitted into the time window
 
int getExpert () const
 return sl pattern of neurotrack
 
std::vector< unsigned > getTSVector () const
 return the vector of used Track Segments.
 
void setQualityVector (const unsigned newbits)
 setter and getter for the quality vector.
 
unsigned getQualityVector () const
 
void setHasETFTime (bool x)
 
bool getHasETFTime () const
 
int getETF_unpacked () const
 getter and setter functions for etf timing
 
int getETF_recalced () const
 
void setETF_unpacked (int x)
 
void setETF_recalced (int x)
 
void setRawPhi0 (const int phi0)
 setter and getter functions for raw track values
 
void setRawOmega (const int omega)
 
void setRawZ (const int z)
 
void setRawTheta (const int theta)
 
void setRawInput (const std::vector< int > input)
 
void setProb (const float input)
 
void setNNTToGDL (const bool nntgdl)
 
void setSTTToGDL (const bool sttgdl)
 
int getRawPhi0 () const
 
int getRawOmega () const
 
int getRawZ () const
 
int getRawTheta () const
 
double getProb () const
 
std::vector< int > getRawInput () const
 
bool getNNTToGDL () const
 
bool getSTTToGDL () const
 
const HepPoint3Dcenter (void) const
 returns position of helix center(z = 0.);
 
const HepPoint3Dpivot (void) const
 returns pivot position.
 
const HepPoint3Dpivot (const HepPoint3D &newPivot)
 Sets pivot position.
 
double radius (void) const
 returns radious of helix.
 
HepPoint3D x (double dPhi=0.) const
 returns position after rotating angle dPhi in phi direction.
 
double * x (double dPhi, double p[3]) const
 returns position after rotating angle dPhi in phi direction.
 
HepPoint3D x (double dPhi, HepSymMatrix &Ex) const
 returns position and convariance matrix(Ex) after rotation.
 
Hep3Vector direction (double dPhi=0.) const
 returns direction vector after rotating angle dPhi in phi direction.
 
Hep3Vector momentum (double dPhi=0.) const
 returns momentum vector after rotating angle dPhi in phi direction.
 
Hep3Vector momentum (double dPhi, HepSymMatrix &Em) const
 returns momentum vector after rotating angle dPhi in phi direction.
 
HepLorentzVector momentum (double dPhi, double mass) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
 
HepLorentzVector momentum (double dPhi, double mass, HepSymMatrix &Em) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
 
HepLorentzVector momentum (double dPhi, double mass, HepPoint3D &x, HepSymMatrix &Emx) const
 returns 4momentum vector after rotating angle dPhi in phi direction.
 
double dr (void) const
 Return helix parameter dr.
 
double phi0 (void) const
 Return helix parameter phi0.
 
double kappa (void) const
 Return helix parameter kappa.
 
double dz (void) const
 Return helix parameter dz.
 
double tanl (void) const
 Return helix parameter tangent lambda.
 
double curv (void) const
 Return curvature of helix.
 
double sinPhi0 (void) const
 Return sin phi0.
 
double cosPhi0 (void) const
 Return cos phi0.
 
const HepVector & a (void) const
 Returns helix parameters.
 
const HepVector & a (const HepVector &newA)
 Sets helix parameters.
 
const HepSymMatrix & Ea (void) const
 Returns error matrix.
 
const HepSymMatrix & Ea (const HepSymMatrix &newdA)
 Sets helix parameters and error matrix.
 
void set (const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
 Sets helix pivot position, parameters, and error matrix.
 
void ignoreErrorMatrix (void)
 Unsets error matrix.
 
double bFieldZ (double bz)
 Sets/returns z component of the magnetic field.
 
double bFieldZ (void) const
 Returns z component of the magnetic field.
 
HepMatrix delApDelA (const HepVector &ap) const
 DAp/DA.
 
HepMatrix delXDelA (double phi) const
 DX/DA.
 
HepMatrix delMDelA (double phi) const
 DM/DA.
 
HepMatrix del4MDelA (double phi, double mass) const
 DM4/DA.
 
HepMatrix del4MXDelA (double phi, double mass) const
 DMX4/DA.
 

Static Public Member Functions

static void set_limits (const HepVector &a_min, const HepVector &a_max)
 set limit for parameter "a"
 
static bool set_exception (bool)
 set exception
 
static bool set_print (bool)
 Set print option for debugging.
 

Static Public Attributes

static const double ConstantAlpha = 222.376063
 Constant alpha for uniform field.
 

Protected Member Functions

 ClassDef (CDCTriggerTrack, 14)
 Needed to make the ROOT object storable.
 

Protected Attributes

double m_prob
 
float m_chi2D
 
float m_chi3D
 chi2 value from 3D fitter
 
short m_time
 number of trigger clocks of (the track output - L1 trigger)
 
short m_quadrant
 iTracker of the unpacked quadrant
 
std::vector< bool > m_foundoldtrack
 array to store whether an old 2dtrack was found
 
std::vector< bool > m_driftthreshold
 store if drift time was within the timing window
 
bool m_valstereobit
 store if at least 3 valid stereo ts were found in the NNInput
 
int m_expert
 store value for used expert network
 
std::vector< unsigned > m_tsvector
 store which track segments were used.
 
unsigned m_qualityvector
 store bits for different quality flags.
 
int m_etf_unpacked {0}
 unpacked etf time from the unpacker
 
int m_etf_recalced {0}
 etf time recalculated from the hw input
 
bool m_hasETFTime {0}
 chi2 value from 2D fitter
 
int m_rawphi0 {0}
 values to store the raw network and 2dfinder output
 
int m_rawomega {0}
 
int m_rawz {0}
 
int m_rawtheta {0}
 
std::vector< int > m_rawinput
 
bool m_nntgdl {0}
 nnt decision that the firmware passed to gdl
 
bool m_sttgdl {0}
 stt decision that the firmware passed to gdl
 

Private Member Functions

void updateCache (void)
 updateCache
 
void checkValid (void)
 Check whether helix parameters is valid or not.
 
void debugPrint (void) const
 Print the helix parameters to stdout.
 
void debugHelix (void) const
 Debug Helix.
 

Private Attributes

bool m_matrixValid = false
 True: matrix valid, False: matrix not valid.
 
bool m_helixValid = false
 True: helix valid, False: helix not valid.
 
double m_bField = 15.0
 Magnetic field, assuming uniform Bz in the unit of kG.
 
double m_alpha = 222.376063
 10000.0/(speed of light)/B.
 
HepPoint3D m_pivot
 Pivot.
 
HepVector m_a
 Helix parameter.
 
HepSymMatrix m_Ea
 Error of the helix parameter.
 
HepPoint3D m_center
 Cache of the center position of Helix.
 
double m_cp
 Cache of the cos phi0.
 
double m_sp
 Cache of the sin phi0.
 
double m_pt
 Cache of the pt.
 
double m_r
 Cache of the r.
 
double m_ac [5] = {0.0, 0.0, 0.0, 0.0, 0.0}
 Cache of the helix parameter.
 

Static Private Attributes

static HepVector ms_amin
 minimum limit of Helix parameter a
 
static HepVector ms_amax
 maxiimum limit of Helix parameter a
 
static bool ms_check_range
 Check the helix parameter's range.
 
static bool ms_print_debug
 Debug option flag.
 
static bool ms_throw_exception
 Throw exception flag.
 
static const std::string invalidhelix
 String "Invalid Helix".
 

Detailed Description

Track created by the CDC trigger.

Definition at line 21 of file CDCTriggerTrack.h.

Constructor & Destructor Documentation

◆ CDCTriggerTrack() [1/5]

CDCTriggerTrack ( )
inline

default constructor, initializing everything to 0.

Definition at line 24 of file CDCTriggerTrack.h.

24 : Helix(), m_chi2D(0.), m_chi3D(0.), m_time(0), m_quadrant(-1), m_foundoldtrack(6, false), m_driftthreshold(9,
25 false), m_valstereobit(false), m_expert(-1), m_tsvector(9, 0), m_qualityvector(0) { }

◆ CDCTriggerTrack() [2/5]

CDCTriggerTrack ( double phi0,
double omega,
double chi2,
const std::vector< bool > & foundoldtrack,
const std::vector< bool > & driftthreshold,
bool valstereobit = false,
int expert = -1,
short time = 0,
short quadrant = -1 )
inline

2D constructor, initializing 3D values to 0.

Parameters
phi0The angle between the transverse momentum and the x axis and in [-pi, pi].
omegaThe signed curvature of the track where the sign is given by the charge of the particle.
chi2Chi2 value of the 2D fit.
foundoldtrackvector with boolean information whether an old 2dtrack was found
driftthresholdvector with boolean information whether drift time was within the timing window
valstereobitswitch whether at least 3 valid stereo ts found in the NNInput
expertwhether to use expert network
timefound time for firmware tracks.
quadrantiTracker of the unpacked quadrant.

Definition at line 41 of file CDCTriggerTrack.h.

47 :
48 Helix(0., phi0, omega, 0., 0.), m_chi2D(chi2), m_chi3D(0.),
49 m_time(time),
50 m_quadrant(quadrant),
51 m_foundoldtrack(foundoldtrack),
52 m_driftthreshold(driftthreshold),
53 m_valstereobit(valstereobit),
54 m_expert(expert),
55 m_tsvector(9, 0),
56 m_qualityvector(0) { }

◆ CDCTriggerTrack() [3/5]

CDCTriggerTrack ( double phi0,
double omega,
double chi2,
short time = 0,
short quadrant = -1 )
inline

Definition at line 58 of file CDCTriggerTrack.h.

60 :
61 Helix(0., phi0, omega, 0., 0.), m_chi2D(chi2), m_chi3D(0.),
62 m_time(time),
63 m_quadrant(quadrant),
64 m_foundoldtrack(6, false),
65 m_driftthreshold(9, false),
66 m_valstereobit(false),
67 m_expert(-1),
68 m_tsvector(9, 0),
69 m_qualityvector(0) { }

◆ CDCTriggerTrack() [4/5]

CDCTriggerTrack ( double phi0,
double omega,
double chi2D,
double z0,
double cotTheta,
double chi3D,
const std::vector< bool > & foundoldtrack = std::vector<bool>(6, false),
const std::vector< bool > & driftthreshold = std::vector<bool>(9, false),
bool valstereobit = false,
int expert = -1,
const std::vector< unsigned > & tsvector = std::vector<unsigned>(9, 0),
short time = 0,
short quadrant = -1,
unsigned qualityvector = 0 )
inline

3D constructor

Parameters
phi0The angle between the transverse momentum and the x axis and in [-pi, pi].
omegaThe signed curvature of the track where the sign is given by the charge of the particle.
chi2DChi2 value of the 2D fit.
z0The z coordinate of the perigee.
cotThetaThe slope of the track in the sz plane (dz/ds).
chi3DChi2 value of the 3D fit.
foundoldtrackvector with boolean information whether an old 2dtrack was found
driftthresholdvector with boolean information whether drift time was within the timing window
valstereobitswitch whether at least 3 valid stereo ts found in the NNInput
expertwhether to use expert network
tsvectorvector of which track segments were used
timefound time for firmware tracks.
quadrantiTracker of the unpacked quadrant.
qualityvectorquality flag bit

Definition at line 87 of file CDCTriggerTrack.h.

95 :
96 Helix(0., phi0, omega, z0, cotTheta), m_chi2D(chi2D), m_chi3D(chi3D), m_time(time), m_quadrant(quadrant),
97 m_foundoldtrack(foundoldtrack),
98 m_driftthreshold(driftthreshold),
99 m_valstereobit(valstereobit),
100 m_expert(expert),
101 m_tsvector(tsvector),
102 m_qualityvector(qualityvector),
103 m_etf_unpacked(0),
104 m_etf_recalced(0) { }

◆ CDCTriggerTrack() [5/5]

CDCTriggerTrack ( double phi0,
double omega,
double chi2D,
double z0,
double cotTheta,
double prob,
double chi3D,
const std::vector< bool > & foundoldtrack = std::vector<bool>(6, false),
const std::vector< bool > & driftthreshold = std::vector<bool>(9, false),
bool valstereobit = false,
int expert = -1,
const std::vector< unsigned > & tsvector = std::vector<unsigned>(9, 0),
short time = 0,
short quadrant = -1,
unsigned qualityvector = 0 )
inline

3D constructor with p

Parameters
phi0The angle between the transverse momentum and the x axis and in [-pi, pi].
omegaThe signed curvature of the track where the sign is given by the charge of the particle.
chi2DChi2 value of the 2D fit.
z0The z coordinate of the perigee.
cotThetaThe slope of the track in the sz plane (dz/ds).
chi3DChi2 value of the 3D fit.
foundoldtrackvector with boolean information whether an old 2dtrack was found
driftthresholdvector with boolean information whether drift time was within the timing window
valstereobitswitch whether at least 3 valid stereo ts found in the NNInput
expertwhether to use expert network
tsvectorvector of which track segments were used
timefound time for firmware tracks.
quadrantiTracker of the unpacked quadrant.
qualityvectorquality flag bit
probthe probability of bkg track

Definition at line 124 of file CDCTriggerTrack.h.

132 :
133 Helix(0., phi0, omega, z0, cotTheta), m_prob(prob), m_chi2D(chi2D), m_chi3D(chi3D), m_time(time), m_quadrant(quadrant),
134 m_foundoldtrack(foundoldtrack),
135 m_driftthreshold(driftthreshold),
136 m_valstereobit(valstereobit),
137 m_expert(expert),
138 m_tsvector(tsvector),
139 m_qualityvector(qualityvector),
140 m_etf_unpacked(0),
141 m_etf_recalced(0) { }

◆ ~CDCTriggerTrack()

~CDCTriggerTrack ( )
inline

destructor, empty because we don't allocate memory anywhere.

Definition at line 146 of file CDCTriggerTrack.h.

146{ }

Member Function Documentation

◆ a() [1/2]

const HepVector & a ( const HepVector & newA)
inlineinherited

Sets helix parameters.

Definition at line 444 of file Helix.h.

445 {
446 if (i.num_row() == 5) {
447 m_a = i;
448 m_helixValid = false;
449 updateCache();
450#if defined(BELLE_DEBUG)
451 DEBUG_HELIX;
452 } else {
453 {
454 std::cout << "Helix::input vector's num_row is not 5" << std::endl;
455 DEBUG_PRINT;
456 if (ms_throw_exception) throw invalidhelix;
457 }
458#endif
459 }
460 return m_a;
461 }

◆ a() [2/2]

const HepVector & a ( void ) const
inlineinherited

Returns helix parameters.

Definition at line 428 of file Helix.h.

429 {
430 DEBUG_HELIX;
431 return m_a;
432 }

◆ bFieldZ() [1/2]

double bFieldZ ( double bz)
inlineinherited

Sets/returns z component of the magnetic field.

Parameters
[in]bzz-component of the magnetic field.
Attention
Helix param. alpha is also stored.

Definition at line 473 of file Helix.h.

474 {
475 DEBUG_HELIX;
476 m_bField = a;
477 m_alpha = 10000. / 2.99792458 / m_bField;
478 updateCache();
479 return m_bField;
480 }

◆ bFieldZ() [2/2]

double bFieldZ ( void ) const
inlineinherited

Returns z component of the magnetic field.

Definition at line 484 of file Helix.h.

485 {
486 DEBUG_HELIX;
487 return m_bField;
488 }

◆ center()

const HepPoint3D & center ( void ) const
inlineinherited

returns position of helix center(z = 0.);

Definition at line 343 of file Helix.h.

344 {
345#if defined(BELLE_DEBUG)
346 if (!m_helixValid) {
347 DEBUG_PRINT;
348 if (msthrow_exception) throw invalidhelix;
349 }
350#endif
351 return m_center;
352 }

◆ checkValid()

void checkValid ( void )
privateinherited

Check whether helix parameters is valid or not.

Sets m_helixValid.

Definition at line 902 of file Helix.cc.

903{
904
905 if (!ms_check_range) return;
906 const double adr = fabs(m_a[0]);
907 const double acpa = fabs(m_a[2]);
908 if (!(adr >= ms_amin[0] && adr <= ms_amax[0])) {
909 m_helixValid = false;
910 } else if (!(acpa >= ms_amin[2] && acpa <= ms_amax[2])) {
911 m_helixValid = false;
912 } else {
913 m_helixValid = true;
914 }
915 if (!m_helixValid) {
916 if (m_a[0] != 0.0 || m_a[1] != 0.0 || m_a[2] != 0.0 ||
917 m_a[3] != 0.0 || m_a[4] != 0.0) {
918 DEBUG_PRINT;
919 }
920 }
921
922}
bool m_helixValid
True: helix valid, False: helix not valid.
Definition Helix.h:290
static bool ms_check_range
Check the helix parameter's range.
Definition Helix.h:235
static HepVector ms_amin
minimum limit of Helix parameter a
Definition Helix.h:231
HepVector m_a
Helix parameter.
Definition Helix.h:298
static HepVector ms_amax
maxiimum limit of Helix parameter a
Definition Helix.h:233

◆ cosPhi0()

double cosPhi0 ( void ) const
inlineinherited

Return cos phi0.

Definition at line 500 of file Helix.h.

501 {
502 DEBUG_HELIX;
503 return m_cp;
504 }

◆ curv()

double curv ( void ) const
inlineinherited

Return curvature of helix.

Definition at line 420 of file Helix.h.

421 {
422 DEBUG_HELIX;
423 return m_r;
424 }

◆ debugHelix()

void debugHelix ( void ) const
privateinherited

Debug Helix.

Definition at line 925 of file Helix.cc.

926{
927 if (!m_helixValid) {
928 if (ms_check_range) {DEBUG_PRINT;}
929 if (ms_throw_exception) { throw invalidhelix;}
930 }
931}
static bool ms_throw_exception
Throw exception flag.
Definition Helix.h:239
static const std::string invalidhelix
String "Invalid Helix".
Definition Helix.h:318

◆ debugPrint()

void debugPrint ( void ) const
privateinherited

Print the helix parameters to stdout.

Definition at line 885 of file Helix.cc.

886{
887
888 const double dr = m_a[0];
889 const double phi0 = m_a[1];
890 const double cpa = m_a[2];
891 const double dz = m_a[3];
892 const double tnl = m_a[4];
893 if (ms_print_debug) {
894 std::cout << "Helix::dr = " << dr << " phi0 = " << phi0 << " cpa = " << cpa
895 << " dz = " << dz << " tnl = " << tnl << std::endl;
896 std::cout << " pivot = " << m_pivot << std::endl;
897 }
898}
static bool ms_print_debug
Debug option flag.
Definition Helix.h:237
double phi0(void) const
Return helix parameter phi0.
Definition Helix.h:388
double dr(void) const
Return helix parameter dr.
Definition Helix.h:380
double dz(void) const
Return helix parameter dz.
Definition Helix.h:404
HepPoint3D m_pivot
Pivot.
Definition Helix.h:296

◆ del4MDelA()

HepMatrix del4MDelA ( double phi,
double mass ) const
inherited

DM4/DA.

Definition at line 754 of file Helix.cc.

755{
756 DEBUG_HELIX;
757
758 //
759 // Calculate Jacobian (@4m/@a)
760 // Vector a is helix parameters and phi is internal parameter.
761 // Vector 4m is 4 momentum.
762 //
763
764 HepMatrix d4MDA(4, 5, 0);
765
766 double phi0 = m_ac[1];
767 double cpa = m_ac[2];
768 double tnl = m_ac[4];
769
770 double cosf0phi = cos(phi0 + phi);
771 double sinf0phi = sin(phi0 + phi);
772
773 double rho;
774 if (cpa != 0.)rho = 1. / cpa;
775 else rho = (DBL_MAX);
776
777 double charge = 1.;
778 if (cpa < 0.)charge = -1.;
779
780 double E = sqrt(rho * rho * (1. + tnl * tnl) + mass * mass);
781
782 d4MDA[0][1] = -fabs(rho) * cosf0phi;
783 d4MDA[0][2] = charge * rho * rho * sinf0phi;
784
785 d4MDA[1][1] = -fabs(rho) * sinf0phi;
786 d4MDA[1][2] = -charge * rho * rho * cosf0phi;
787
788 d4MDA[2][2] = -charge * rho * rho * tnl;
789 d4MDA[2][4] = fabs(rho);
790
791 if (cpa != 0.0 && E != 0.0) {
792 d4MDA[3][2] = (-1. - tnl * tnl) / (cpa * cpa * cpa * E);
793 d4MDA[3][4] = tnl / (cpa * cpa * E);
794 } else {
795 d4MDA[3][2] = (DBL_MAX);
796 d4MDA[3][4] = (DBL_MAX);
797 }
798 return d4MDA;
799}
R E
internal precision of FFTW codelets
double m_ac[5]
Cache of the helix parameter.
Definition Helix.h:315
double sqrt(double a)
sqrt for double
Definition beamHelpers.h:28

◆ del4MXDelA()

HepMatrix del4MXDelA ( double phi,
double mass ) const
inherited

DMX4/DA.

Definition at line 803 of file Helix.cc.

804{
805 DEBUG_HELIX;
806
807 //
808 // Calculate Jacobian (@4mx/@a)
809 // Vector a is helix parameters and phi is internal parameter.
810 // Vector 4xm is 4 momentum and position.
811 //
812
813 HepMatrix d4MXDA(7, 5, 0);
814
815 const double& dr = m_ac[0];
816 const double& phi0 = m_ac[1];
817 const double& cpa = m_ac[2];
818 //const double & dz = m_ac[3];
819 const double& tnl = m_ac[4];
820
821 double cosf0phi = cos(phi0 + phi);
822 double sinf0phi = sin(phi0 + phi);
823
824 double rho;
825 if (cpa != 0.)rho = 1. / cpa;
826 else rho = (DBL_MAX);
827
828 double charge = 1.;
829 if (cpa < 0.)charge = -1.;
830
831 double E = sqrt(rho * rho * (1. + tnl * tnl) + mass * mass);
832
833 d4MXDA[0][1] = - fabs(rho) * cosf0phi;
834 d4MXDA[0][2] = charge * rho * rho * sinf0phi;
835
836 d4MXDA[1][1] = - fabs(rho) * sinf0phi;
837 d4MXDA[1][2] = - charge * rho * rho * cosf0phi;
838
839 d4MXDA[2][2] = - charge * rho * rho * tnl;
840 d4MXDA[2][4] = fabs(rho);
841
842 if (cpa != 0.0 && E != 0.0) {
843 d4MXDA[3][2] = (- 1. - tnl * tnl) / (cpa * cpa * cpa * E);
844 d4MXDA[3][4] = tnl / (cpa * cpa * E);
845 } else {
846 d4MXDA[3][2] = (DBL_MAX);
847 d4MXDA[3][4] = (DBL_MAX);
848 }
849
850 d4MXDA[4][0] = m_cp;
851 d4MXDA[4][1] = - dr * m_sp + m_r * (- m_sp + sinf0phi);
852 if (cpa != 0.0) {
853 d4MXDA[4][2] = - (m_r / cpa) * (m_cp - cosf0phi);
854 } else {
855 d4MXDA[4][2] = (DBL_MAX);
856 }
857
858 d4MXDA[5][0] = m_sp;
859 d4MXDA[5][1] = dr * m_cp + m_r * (m_cp - cosf0phi);
860 if (cpa != 0.0) {
861 d4MXDA[5][2] = - (m_r / cpa) * (m_sp - sinf0phi);
862
863 d4MXDA[6][2] = (m_r / cpa) * tnl * phi;
864 } else {
865 d4MXDA[5][2] = (DBL_MAX);
866
867 d4MXDA[6][2] = (DBL_MAX);
868 }
869
870 d4MXDA[6][3] = 1.;
871 d4MXDA[6][4] = - m_r * phi;
872
873 return d4MXDA;
874}
double m_cp
Cache of the cos phi0.
Definition Helix.h:307
double m_sp
Cache of the sin phi0.
Definition Helix.h:309
double m_r
Cache of the r.
Definition Helix.h:313

◆ delApDelA()

HepMatrix delApDelA ( const HepVector & ap) const
inherited

DAp/DA.

Definition at line 589 of file Helix.cc.

590{
591 DEBUG_HELIX;
592 //
593 // Calculate Jacobian (@ap/@a)
594 // Vector ap is new helix parameters and a is old helix parameters.
595 //
596
597 HepMatrix dApDA(5, 5, 0);
598
599 const double& dr = m_ac[0];
600 const double& phi0 = m_ac[1];
601 const double& cpa = m_ac[2];
602 //const double & dz = m_ac[3];
603 const double& tnl = m_ac[4];
604
605 double drp = ap[0];
606 double phi0p = ap[1];
607 //double cpap = ap[2];
608 //double dzp = ap[3];
609 //double tnlp = ap[4];
610
611 double rdr = m_r + dr;
612 double rdrpr;
613 if ((m_r + drp) != 0.0) {
614 rdrpr = 1. / (m_r + drp);
615 } else {
616 rdrpr = (DBL_MAX);
617 }
618 // double csfd = cos(phi0)*cos(phi0p) + sin(phi0)*sin(phi0p);
619 // double snfd = cos(phi0)*sin(phi0p) - sin(phi0)*cos(phi0p);
620 double csfd = cos(phi0p - phi0);
621 double snfd = sin(phi0p - phi0);
622 double phid = fmod(phi0p - phi0 + M_PI8, M_PI2);
623 if (phid > M_PI) phid = phid - M_PI2;
624
625 dApDA[0][0] = csfd;
626 dApDA[0][1] = rdr * snfd;
627 if (cpa != 0.0) {
628 dApDA[0][2] = (m_r / cpa) * (1.0 - csfd);
629 } else {
630 dApDA[0][2] = (DBL_MAX);
631 }
632
633 dApDA[1][0] = - rdrpr * snfd;
634 dApDA[1][1] = rdr * rdrpr * csfd;
635 if (cpa != 0.0) {
636 dApDA[1][2] = (m_r / cpa) * rdrpr * snfd;
637 } else {
638 dApDA[1][2] = (DBL_MAX);
639 }
640
641 dApDA[2][2] = 1.0;
642
643 dApDA[3][0] = m_r * rdrpr * tnl * snfd;
644 dApDA[3][1] = m_r * tnl * (1.0 - rdr * rdrpr * csfd);
645 if (cpa != 0.0) {
646 dApDA[3][2] = (m_r / cpa) * tnl * (phid - m_r * rdrpr * snfd);
647 } else {
648 dApDA[3][2] = (DBL_MAX);
649 }
650 dApDA[3][3] = 1.0;
651 dApDA[3][4] = - m_r * phid;
652
653 dApDA[4][4] = 1.0;
654
655 return dApDA;
656}
const double M_PI8
8*PI
Definition Helix.cc:39
const double M_PI2
2*PI
Definition Helix.cc:31

◆ delMDelA()

HepMatrix delMDelA ( double phi) const
inherited

DM/DA.

Definition at line 715 of file Helix.cc.

716{
717 DEBUG_HELIX;
718 //
719 // Calculate Jacobian (@m/@a)
720 // Vector a is helix parameters and phi is internal parameter.
721 // Vector m is momentum.
722 //
723
724 HepMatrix dMDA(3, 5, 0);
725
726 const double& phi0 = m_ac[1];
727 const double& cpa = m_ac[2];
728 const double& tnl = m_ac[4];
729
730 double cosf0phi = cos(phi0 + phi);
731 double sinf0phi = sin(phi0 + phi);
732
733 double rho;
734 if (cpa != 0.)rho = 1. / cpa;
735 else rho = (DBL_MAX);
736
737 double charge = 1.;
738 if (cpa < 0.)charge = -1.;
739
740 dMDA[0][1] = -fabs(rho) * cosf0phi;
741 dMDA[0][2] = charge * rho * rho * sinf0phi;
742
743 dMDA[1][1] = -fabs(rho) * sinf0phi;
744 dMDA[1][2] = -charge * rho * rho * cosf0phi;
745
746 dMDA[2][2] = -charge * rho * rho * tnl;
747 dMDA[2][4] = fabs(rho);
748
749 return dMDA;
750}

◆ delXDelA()

HepMatrix delXDelA ( double phi) const
inherited

DX/DA.

Definition at line 659 of file Helix.cc.

660{
661 DEBUG_HELIX;
662 //
663 // Calculate Jacobian (@x/@a)
664 // Vector a is helix parameters and phi is internal parameter
665 // which specifys the point to be calculated for Ex(phi).
666 //
667
668 HepMatrix dXDA(3, 5, 0);
669
670 const double& dr = m_ac[0];
671 const double& phi0 = m_ac[1];
672 const double& cpa = m_ac[2];
673 //const double & dz = m_ac[3];
674 const double& tnl = m_ac[4];
675
676 double cosf0phi = cos(phi0 + phi);
677 double sinf0phi = sin(phi0 + phi);
678
679 dXDA[0][0] = m_cp;
680 dXDA[0][1] = - dr * m_sp + m_r * (- m_sp + sinf0phi);
681 if (cpa != 0.0) {
682 dXDA[0][2] = - (m_r / cpa) * (m_cp - cosf0phi);
683 } else {
684 dXDA[0][2] = (DBL_MAX);
685 }
686 // dXDA[0][3] = 0.0;
687 // dXDA[0][4] = 0.0;
688
689 dXDA[1][0] = m_sp;
690 dXDA[1][1] = dr * m_cp + m_r * (m_cp - cosf0phi);
691 if (cpa != 0.0) {
692 dXDA[1][2] = - (m_r / cpa) * (m_sp - sinf0phi);
693 } else {
694 dXDA[1][2] = (DBL_MAX);
695 }
696 // dXDA[1][3] = 0.0;
697 // dXDA[1][4] = 0.0;
698
699 // dXDA[2][0] = 0.0;
700 // dXDA[2][1] = 0.0;
701 if (cpa != 0.0) {
702 dXDA[2][2] = (m_r / cpa) * tnl * phi;
703 } else {
704 dXDA[2][2] = (DBL_MAX);
705 }
706 dXDA[2][3] = 1.0;
707 dXDA[2][4] = - m_r * phi;
708
709 return dXDA;
710}

◆ direction()

Hep3Vector direction ( double dPhi = 0.) const
inlineinherited

returns direction vector after rotating angle dPhi in phi direction.

Definition at line 372 of file Helix.h.

373 {
374 DEBUG_HELIX;
375 return momentum(phi).unit();
376 }

◆ dr()

double dr ( void ) const
inlineinherited

Return helix parameter dr.

Definition at line 380 of file Helix.h.

381 {
382 DEBUG_HELIX;
383 return m_ac[0];
384 }

◆ dz()

double dz ( void ) const
inlineinherited

Return helix parameter dz.

Definition at line 404 of file Helix.h.

405 {
406 DEBUG_HELIX;
407 return m_ac[3];
408 }

◆ Ea() [1/2]

const HepSymMatrix & Ea ( const HepSymMatrix & newdA)
inlineinherited

Sets helix parameters and error matrix.

Definition at line 465 of file Helix.h.

466 {
467 DEBUG_HELIX;
468 return m_Ea = i;
469 }

◆ Ea() [2/2]

const HepSymMatrix & Ea ( void ) const
inlineinherited

Returns error matrix.

Definition at line 436 of file Helix.h.

437 {
438 DEBUG_HELIX;
439 return m_Ea;
440 }

◆ getChi2D()

float getChi2D ( ) const
inline

get chi2 value of 2D fitter

Definition at line 150 of file CDCTriggerTrack.h.

150{ return m_chi2D; }

◆ getChi3D()

float getChi3D ( ) const
inline

get chi2 value of 3D fitter

Definition at line 152 of file CDCTriggerTrack.h.

152{ return m_chi3D; }

◆ getDriftThreshold()

std::vector< bool > getDriftThreshold ( ) const
inline

returns true, if the drift time was fitted into the time window

Definition at line 175 of file CDCTriggerTrack.h.

175{return m_driftthreshold;}

◆ getETF_recalced()

int getETF_recalced ( ) const
inline

Definition at line 197 of file CDCTriggerTrack.h.

197{return m_etf_recalced;}

◆ getETF_unpacked()

int getETF_unpacked ( ) const
inline

getter and setter functions for etf timing

Definition at line 196 of file CDCTriggerTrack.h.

196{return m_etf_unpacked;}

◆ getExpert()

int getExpert ( ) const
inline

return sl pattern of neurotrack

Definition at line 178 of file CDCTriggerTrack.h.

178{return m_expert;}

◆ getFoundOldTrack()

std::vector< bool > getFoundOldTrack ( ) const
inline

returns true, if old 2dtrack was found

Definition at line 169 of file CDCTriggerTrack.h.

169{return m_foundoldtrack;}

◆ getHasETFTime()

bool getHasETFTime ( ) const
inline

Definition at line 194 of file CDCTriggerTrack.h.

194{return m_hasETFTime;}

◆ getNNTToGDL()

bool getNNTToGDL ( ) const
inline

Definition at line 239 of file CDCTriggerTrack.h.

239{return m_nntgdl;}

◆ getProb()

double getProb ( ) const
inline

Definition at line 237 of file CDCTriggerTrack.h.

237{return m_prob;}

◆ getPt()

double getPt ( ) const
inline

get the absolute value of the transverse momentum at the perigee assuming d0 = 0

Definition at line 158 of file CDCTriggerTrack.h.

159 {
160 const double bField = BFieldManager::getField(0, 0, getZ0()).Z() / Unit::T;
161 return getTransverseMomentum(bField);
162 }

◆ getQuadrant()

short getQuadrant ( ) const
inline

get the quadrant

Definition at line 164 of file CDCTriggerTrack.h.

165 {
166 return m_quadrant;
167 }

◆ getQualityVector()

unsigned getQualityVector ( ) const
inline

Definition at line 192 of file CDCTriggerTrack.h.

192{return m_qualityvector;}

◆ getRawInput()

std::vector< int > getRawInput ( ) const
inline

Definition at line 238 of file CDCTriggerTrack.h.

238{return m_rawinput;}

◆ getRawOmega()

int getRawOmega ( ) const
inline

Definition at line 234 of file CDCTriggerTrack.h.

234{return m_rawomega;}

◆ getRawPhi0()

int getRawPhi0 ( ) const
inline

Definition at line 233 of file CDCTriggerTrack.h.

233{return m_rawphi0;}

◆ getRawTheta()

int getRawTheta ( ) const
inline

Definition at line 236 of file CDCTriggerTrack.h.

236{return m_rawtheta;}

◆ getRawZ()

int getRawZ ( ) const
inline

Definition at line 235 of file CDCTriggerTrack.h.

235{return m_rawz;}

◆ getSTTToGDL()

bool getSTTToGDL ( ) const
inline

Definition at line 240 of file CDCTriggerTrack.h.

240{return m_sttgdl;}

◆ getTime()

float getTime ( ) const
inline

get the track found time

Definition at line 154 of file CDCTriggerTrack.h.

154{ return m_time; }

◆ getTSVector()

std::vector< unsigned > getTSVector ( ) const
inline

return the vector of used Track Segments.

The First bit is the innermost TS, the last bit the outermost.

Definition at line 182 of file CDCTriggerTrack.h.

182{return m_tsvector;}

◆ getValidStereoBit()

bool getValidStereoBit ( ) const
inline

returns true, if at least 3 stereo ts were found

Definition at line 172 of file CDCTriggerTrack.h.

172{return m_valstereobit;}

◆ ignoreErrorMatrix()

void ignoreErrorMatrix ( void )
inherited

Unsets error matrix.

Error calculations will be ignored after this function call until an error matrix be set again. 0 matrix will be return as a return value for error matrix when you call functions which returns an error matrix.

Definition at line 877 of file Helix.cc.

878{
879 m_matrixValid = false;
880 m_Ea *= 0.;
881}
bool m_matrixValid
True: matrix valid, False: matrix not valid.
Definition Helix.h:288
HepSymMatrix m_Ea
Error of the helix parameter.
Definition Helix.h:300

◆ kappa()

double kappa ( void ) const
inlineinherited

Return helix parameter kappa.

Definition at line 396 of file Helix.h.

397 {
398 DEBUG_HELIX;
399 return m_ac[2];
400 }

◆ momentum() [1/5]

HepLorentzVector momentum ( double dPhi,
double mass ) const
inherited

returns 4momentum vector after rotating angle dPhi in phi direction.

Definition at line 310 of file Helix.cc.

311{
312 DEBUG_HELIX;
313 //
314 // Calculate momentum.
315 //
316 // Pt = | 1/kappa | (GeV/c)
317 //
318 // Px = -Pt * sin(phi0 + phi)
319 // Py = Pt * cos(phi0 + phi)
320 // Pz = Pt * tan(lambda)
321 //
322 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
323
324 double pt = fabs(m_pt);
325 double px = - pt * sin(m_ac[1] + phi);
326 double py = pt * cos(m_ac[1] + phi);
327 double pz = pt * m_ac[4];
328 double E = sqrt(pt * pt * (1. + m_ac[4] * m_ac[4]) + mass * mass);
329
330 return HepLorentzVector(px, py, pz, E);
331}
double m_pt
Cache of the pt.
Definition Helix.h:311

◆ momentum() [2/5]

HepLorentzVector momentum ( double dPhi,
double mass,
HepPoint3D & x,
HepSymMatrix & Emx ) const
inherited

returns 4momentum vector after rotating angle dPhi in phi direction.

Definition at line 362 of file Helix.cc.

366{
367 DEBUG_HELIX;
368 //
369 // Calculate momentum.
370 //
371 // Pt = | 1/kappa | (GeV/c)
372 //
373 // Px = -Pt * sin(phi0 + phi)
374 // Py = Pt * cos(phi0 + phi)
375 // Pz = Pt * tan(lambda)
376 //
377 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
378
379 double pt = fabs(m_pt);
380 double px = - pt * sin(m_ac[1] + phi);
381 double py = pt * cos(m_ac[1] + phi);
382 double pz = pt * m_ac[4];
383 double E = sqrt(pt * pt * (1. + m_ac[4] * m_ac[4]) + mass * mass);
384
385 x.setX(m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] + phi)));
386 x.setY(m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] + phi)));
387 x.setZ(m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi);
388
389 if (m_matrixValid) Emx = m_Ea.similarity(del4MXDelA(phi, mass));
390 else Emx = m_Ea;
391
392 return HepLorentzVector(px, py, pz, E);
393}
HepMatrix del4MXDelA(double phi, double mass) const
DMX4/DA.
Definition Helix.cc:803
HepPoint3D x(double dPhi=0.) const
returns position after rotating angle dPhi in phi direction.
Definition Helix.cc:201

◆ momentum() [3/5]

HepLorentzVector momentum ( double dPhi,
double mass,
HepSymMatrix & Em ) const
inherited

returns 4momentum vector after rotating angle dPhi in phi direction.

Definition at line 335 of file Helix.cc.

336{
337 DEBUG_HELIX;
338 //
339 // Calculate momentum.
340 //
341 // Pt = | 1/kappa | (GeV/c)
342 //
343 // Px = -Pt * sin(phi0 + phi)
344 // Py = Pt * cos(phi0 + phi)
345 // Pz = Pt * tan(lambda)
346 //
347 // E = sqrt( 1/kappa/kappa * (1+tan(lambda)*tan(lambda)) + mass*mass )
348
349 double pt = fabs(m_pt);
350 double px = - pt * sin(m_ac[1] + phi);
351 double py = pt * cos(m_ac[1] + phi);
352 double pz = pt * m_ac[4];
353 double E = sqrt(pt * pt * (1. + m_ac[4] * m_ac[4]) + mass * mass);
354
355 if (m_matrixValid) Em = m_Ea.similarity(del4MDelA(phi, mass));
356 else Em = m_Ea;
357
358 return HepLorentzVector(px, py, pz, E);
359}
HepMatrix del4MDelA(double phi, double mass) const
DM4/DA.
Definition Helix.cc:754

◆ momentum() [4/5]

Hep3Vector momentum ( double dPhi,
HepSymMatrix & Em ) const
inherited

returns momentum vector after rotating angle dPhi in phi direction.

Definition at line 285 of file Helix.cc.

286{
287 DEBUG_HELIX;
288 //
289 // Calculate momentum.
290 //
291 // Pt = | 1/kappa | (GeV/c)
292 //
293 // Px = -Pt * sin(phi0 + phi)
294 // Py = Pt * cos(phi0 + phi)
295 // Pz = Pt * tan(lambda)
296 //
297
298 double pt = fabs(m_pt);
299 double px = - pt * sin(m_ac[1] + phi);
300 double py = pt * cos(m_ac[1] + phi);
301 double pz = pt * m_ac[4];
302
303 if (m_matrixValid) Em = m_Ea.similarity(delMDelA(phi));
304 else Em = m_Ea;
305
306 return Hep3Vector(px, py, pz);
307}
HepMatrix delMDelA(double phi) const
DM/DA.
Definition Helix.cc:715

◆ momentum() [5/5]

Hep3Vector momentum ( double dPhi = 0.) const
inherited

returns momentum vector after rotating angle dPhi in phi direction.

Definition at line 263 of file Helix.cc.

264{
265 DEBUG_HELIX;
266 //
267 // Calculate momentum.
268 //
269 // Pt = | 1/kappa | (GeV/c)
270 //
271 // Px = -Pt * sin(phi0 + phi)
272 // Py = Pt * cos(phi0 + phi)
273 // Pz = Pt * tan(lambda)
274 //
275
276 double pt = fabs(m_pt);
277 double px = - pt * sin(m_ac[1] + phi);
278 double py = pt * cos(m_ac[1] + phi);
279 double pz = pt * m_ac[4];
280
281 return Hep3Vector(px, py, pz);
282}

◆ phi0()

double phi0 ( void ) const
inlineinherited

Return helix parameter phi0.

Definition at line 388 of file Helix.h.

389 {
390 DEBUG_HELIX;
391 return m_ac[1];
392 }

◆ pivot() [1/2]

const HepPoint3D & pivot ( const HepPoint3D & newPivot)
inherited

Sets pivot position.

Definition at line 397 of file Helix.cc.

398{
399 DEBUG_HELIX;
400#if defined(BELLE_DEBUG)
401 try {
402#endif
403 const double& dr = m_ac[0];
404 const double& phi0 = m_ac[1];
405 const double& kappa = m_ac[2];
406 const double& dz = m_ac[3];
407 const double& tanl = m_ac[4];
408
409 double rdr = dr + m_r;
410 double phi = fmod(phi0 + M_PI4, M_PI2);
411 double csf0 = cos(phi);
412 double snf0 = (1. - csf0) * (1. + csf0);
413 snf0 = sqrt((snf0 > 0.) ? snf0 : 0.);
414 if (phi > M_PI) snf0 = - snf0;
415
416 double xc = m_pivot.x() + rdr * csf0;
417 double yc = m_pivot.y() + rdr * snf0;
418 double csf, snf;
419 if (m_r != 0.0) {
420 csf = (xc - newPivot.x()) / m_r;
421 snf = (yc - newPivot.y()) / m_r;
422 double anrm = sqrt(csf * csf + snf * snf);
423 if (anrm != 0.0) {
424 csf /= anrm;
425 snf /= anrm;
426 phi = atan2(snf, csf);
427 } else {
428 csf = 1.0;
429 snf = 0.0;
430 phi = 0.0;
431 }
432 } else {
433 csf = 1.0;
434 snf = 0.0;
435 phi = 0.0;
436 }
437 double phid = fmod(phi - phi0 + M_PI8, M_PI2);
438 if (phid > M_PI) phid = phid - M_PI2;
439 double drp = (m_pivot.x() + dr * csf0 + m_r * (csf0 - csf) - newPivot.x())
440 * csf
441 + (m_pivot.y() + dr * snf0 + m_r * (snf0 - snf) - newPivot.y()) * snf;
442 double dzp = m_pivot.z() + dz - m_r * tanl * phid - newPivot.z();
443
444 HepVector ap(5);
445 ap[0] = drp;
446 ap[1] = fmod(phi + M_PI4, M_PI2);
447 ap[2] = kappa;
448 ap[3] = dzp;
449 ap[4] = tanl;
450
451 // if (m_matrixValid) m_Ea.assign(delApDelA(ap) * m_Ea * delApDelA(ap).T());
452 if (m_matrixValid) m_Ea = m_Ea.similarity(delApDelA(ap));
453
454 m_a = ap;
455 m_pivot = newPivot;
456
457 //...Are these needed?...iw...
458 updateCache();
459 return m_pivot;
460#if defined(BELLE_DEBUG)
461 } catch (...) {
462 m_helixValid = false;
463 DEBUG_PRINT;
465 }
466#endif
467 return m_pivot;
468}
void updateCache(void)
updateCache
Definition Helix.cc:513
double tanl(void) const
Return helix parameter tangent lambda.
Definition Helix.h:412
HepMatrix delApDelA(const HepVector &ap) const
DAp/DA.
Definition Helix.cc:589
double kappa(void) const
Return helix parameter kappa.
Definition Helix.h:396
const double M_PI4
4*PI
Definition Helix.cc:35

◆ pivot() [2/2]

const HepPoint3D & pivot ( void ) const
inlineinherited

returns pivot position.

Definition at line 356 of file Helix.h.

357 {
358 DEBUG_HELIX;
359 return m_pivot;
360 }

◆ radius()

double radius ( void ) const
inlineinherited

returns radious of helix.

Definition at line 364 of file Helix.h.

365 {
366 DEBUG_HELIX;
367 return m_r;
368 }

◆ set()

void set ( const HepPoint3D & pivot,
const HepVector & a,
const HepSymMatrix & Ea )
inherited

Sets helix pivot position, parameters, and error matrix.

Definition at line 471 of file Helix.cc.

474{
475 m_pivot = pivot;
476 m_a = a;
477 m_Ea = Ea;
478 m_matrixValid = true;
479 m_helixValid = false;
480 updateCache();
481 DEBUG_HELIX;
482}
const HepPoint3D & pivot(void) const
returns pivot position.
Definition Helix.h:356
const HepSymMatrix & Ea(void) const
Returns error matrix.
Definition Helix.h:436
const HepVector & a(void) const
Returns helix parameters.
Definition Helix.h:428

◆ set_exception()

bool set_exception ( bool t)
staticinherited

set exception

Definition at line 116 of file Helix.cc.

117{
118 return ms_throw_exception = t;
119}

◆ set_limits()

void set_limits ( const HepVector & a_min,
const HepVector & a_max )
staticinherited

set limit for parameter "a"

Definition at line 127 of file Helix.cc.

128{
129 if (a_min.num_row() != 5 || a_max.num_row() != 5) return;
130 ms_amin = a_min;
131 ms_amax = a_max;
132 ms_check_range = true;
133}

◆ set_print()

bool set_print ( bool t)
staticinherited

Set print option for debugging.

Definition at line 121 of file Helix.cc.

122{
123 return ms_print_debug = t;
124}

◆ setETF_recalced()

void setETF_recalced ( int x)
inline

Definition at line 199 of file CDCTriggerTrack.h.

199{m_etf_recalced = x;}

◆ setETF_unpacked()

void setETF_unpacked ( int x)
inline

Definition at line 198 of file CDCTriggerTrack.h.

198{m_etf_unpacked = x;}

◆ setHasETFTime()

void setHasETFTime ( bool x)
inline

Definition at line 193 of file CDCTriggerTrack.h.

193{m_hasETFTime = x;}

◆ setNNTToGDL()

void setNNTToGDL ( const bool nntgdl)
inline

Definition at line 225 of file CDCTriggerTrack.h.

226 {
227 m_nntgdl = nntgdl;
228 }

◆ setProb()

void setProb ( const float input)
inline

Definition at line 221 of file CDCTriggerTrack.h.

222 {
223 m_prob = input;
224 }

◆ setQualityVector()

void setQualityVector ( const unsigned newbits)
inline

setter and getter for the quality vector.

For the setter, the given uint is xored with the current qualityvector, thus all bits with a 1 are changed.

Definition at line 187 of file CDCTriggerTrack.h.

188 {
189 m_qualityvector = m_qualityvector ^ newbits;
190 }

◆ setRawInput()

void setRawInput ( const std::vector< int > input)
inline

Definition at line 217 of file CDCTriggerTrack.h.

218 {
219 m_rawinput = input;
220 }

◆ setRawOmega()

void setRawOmega ( const int omega)
inline

Definition at line 205 of file CDCTriggerTrack.h.

206 {
207 m_rawomega = omega;
208 }

◆ setRawPhi0()

void setRawPhi0 ( const int phi0)
inline

setter and getter functions for raw track values

Definition at line 201 of file CDCTriggerTrack.h.

202 {
203 m_rawphi0 = phi0;
204 }

◆ setRawTheta()

void setRawTheta ( const int theta)
inline

Definition at line 213 of file CDCTriggerTrack.h.

214 {
215 m_rawtheta = theta;
216 }

◆ setRawZ()

void setRawZ ( const int z)
inline

Definition at line 209 of file CDCTriggerTrack.h.

210 {
211 m_rawz = z;
212 }

◆ setSTTToGDL()

void setSTTToGDL ( const bool sttgdl)
inline

Definition at line 229 of file CDCTriggerTrack.h.

230 {
231 m_sttgdl = sttgdl;
232 }

◆ sinPhi0()

double sinPhi0 ( void ) const
inlineinherited

Return sin phi0.

Definition at line 492 of file Helix.h.

493 {
494 DEBUG_HELIX;
495 return m_sp;
496 }

◆ tanl()

double tanl ( void ) const
inlineinherited

Return helix parameter tangent lambda.

Definition at line 412 of file Helix.h.

413 {
414 DEBUG_HELIX;
415 return m_ac[4];
416 }

◆ updateCache()

void updateCache ( void )
privateinherited

updateCache

Definition at line 513 of file Helix.cc.

514{
515
516#if defined(BELLE_DEBUG)
517 checkValid();
518 if (m_helixValid) {
519#endif
520
521 //
522 // Calculate Helix center( xc, yc ).
523 //
524 // xc = x0 + (dr + (alpha / kappa)) * cos(phi0) (cm)
525 // yc = y0 + (dr + (alpha / kappa)) * sin(phi0) (cm)
526 //
527
528 m_ac[0] = m_a[0];
529 m_ac[1] = m_a[1];
530 m_ac[2] = m_a[2];
531 m_ac[3] = m_a[3];
532 m_ac[4] = m_a[4];
533
534 m_cp = cos(m_ac[1]);
535 m_sp = sin(m_ac[1]);
536 if (m_ac[2] != 0.0) {
537 if (m_ac[2] == DBL_MAX || m_ac[2] == (-DBL_MAX)) {
538 m_pt = m_r = 0;
539 return;
540 } else {
541 m_pt = 1. / m_ac[2];
542 m_r = m_alpha / m_ac[2];
543 }
544 } else {
545 m_pt = (DBL_MAX);
546 m_r = (DBL_MAX);
547 return;
548 }
549
550 double x = m_pivot.x() + (m_ac[0] + m_r) * m_cp;
551 double y = m_pivot.y() + (m_ac[0] + m_r) * m_sp;
552 m_center.setX(x);
553 m_center.setY(y);
554 m_center.setZ(0.);
555#if defined(BELLE_DEBUG)
556 } else {
557 m_ac[0] = m_a[0];
558 m_ac[1] = m_a[1];
559 m_ac[2] = m_a[2];
560 m_ac[3] = m_a[3];
561 m_ac[4] = m_a[4];
562
563 m_cp = cos(m_ac[1]);
564 m_sp = sin(m_ac[1]);
565 if (m_ac[2] != 0.0) {
566 if (m_ac[2] == DBL_MAX || m_ac[2] == (-DBL_MAX)) {
567 m_pt = m_r = 0;
568 return;
569 } else {
570 m_pt = 1. / m_ac[2];
571 m_r = m_alpha / m_ac[2];
572 }
573 } else {
574 m_pt = (DBL_MAX);
575 m_r = (DBL_MAX);
576 return;
577 }
578
579 double x = m_pivot.x() + (m_ac[0] + m_r) * m_cp;
580 double y = m_pivot.y() + (m_ac[0] + m_r) * m_sp;
581 m_center.setX(x);
582 m_center.setY(y);
583 m_center.setZ(0.);
584 }
585#endif
586}
void checkValid(void)
Check whether helix parameters is valid or not.
Definition Helix.cc:902
HepPoint3D m_center
Cache of the center position of Helix.
Definition Helix.h:305
double m_alpha
10000.0/(speed of light)/B.
Definition Helix.h:294

◆ x() [1/3]

double * x ( double dPhi,
double p[3] ) const
inherited

returns position after rotating angle dPhi in phi direction.

x = x0 + dr * cos(phi0) + (alpha / kappa) * (cos(phi0) - cos(phi0+phi)) y = y0 + dr * sin(phi0) + (alpha / kappa) * (sin(phi0) - sin(phi0+phi)) z = z0 + dz - (alpha / kappa) * tan(lambda) * phi

Returns
double[3]

Definition at line 220 of file Helix.cc.

221{
222 DEBUG_HELIX;
223 //
224 // Calculate position (x,y,z) along helix.
225 //
226 // x = x0 + dr * cos(phi0) + (alpha / kappa) * (cos(phi0) - cos(phi0+phi))
227 // y = y0 + dr * sin(phi0) + (alpha / kappa) * (sin(phi0) - sin(phi0+phi))
228 // z = z0 + dz - (alpha / kappa) * tan(lambda) * phi
229 //
230
231 p[0] = m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] + phi));
232 p[1] = m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] + phi));
233 p[2] = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi;
234
235 return p;
236}

◆ x() [2/3]

HepPoint3D x ( double dPhi,
HepSymMatrix & Ex ) const
inherited

returns position and convariance matrix(Ex) after rotation.

Definition at line 239 of file Helix.cc.

240{
241 DEBUG_HELIX;
242
243 double x = m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] + phi));
244 double y = m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] + phi));
245 double z = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi;
246
247 //
248 // Calculate position error matrix.
249 // Ex(phi) = (@x/@a)(Ea)(@x/@a)^T, phi is deflection angle to specify the
250 // point to be calculated.
251 //
252 // HepMatrix dXDA(3, 5, 0);
253 // dXDA = delXDelA(phi);
254 // Ex.assign(dXDA * m_Ea * dXDA.T());
255
256 if (m_matrixValid) Ex = m_Ea.similarity(delXDelA(phi));
257 else Ex = m_Ea;
258
259 return HepPoint3D(x, y, z);
260}
HepMatrix delXDelA(double phi) const
DX/DA.
Definition Helix.cc:659

◆ x() [3/3]

HepPoint3D x ( double dPhi = 0.) const
inherited

returns position after rotating angle dPhi in phi direction.

x = x0 + dr * cos(phi0) + (alpha / kappa) * (cos(phi0) - cos(phi0+phi)) y = y0 + dr * sin(phi0) + (alpha / kappa) * (sin(phi0) - sin(phi0+phi)) z = z0 + dz - (alpha / kappa) * tan(lambda) * phi

Returns
HepPoint3D

Definition at line 201 of file Helix.cc.

202{
203 DEBUG_HELIX;
204 //
205 // Calculate position (x,y,z) along helix.
206 //
207 // x = x0 + dr * cos(phi0) + (alpha / kappa) * (cos(phi0) - cos(phi0+phi))
208 // y = y0 + dr * sin(phi0) + (alpha / kappa) * (sin(phi0) - sin(phi0+phi))
209 // z = z0 + dz - (alpha / kappa) * tan(lambda) * phi
210 //
211
212 double x = m_pivot.x() + m_ac[0] * m_cp + m_r * (m_cp - cos(m_ac[1] + phi));
213 double y = m_pivot.y() + m_ac[0] * m_sp + m_r * (m_sp - sin(m_ac[1] + phi));
214 double z = m_pivot.z() + m_ac[3] - m_r * m_ac[4] * phi;
215
216 return HepPoint3D(x, y, z);
217}

Member Data Documentation

◆ ConstantAlpha

const double ConstantAlpha = 222.376063
staticinherited

Constant alpha for uniform field.

Definition at line 283 of file Helix.h.

◆ invalidhelix

const std::string invalidhelix
staticprivateinherited

String "Invalid Helix".

Definition at line 318 of file Helix.h.

◆ m_a

HepVector m_a
privateinherited

Helix parameter.

Definition at line 298 of file Helix.h.

◆ m_ac

double m_ac[5] = {0.0, 0.0, 0.0, 0.0, 0.0}
privateinherited

Cache of the helix parameter.

Definition at line 315 of file Helix.h.

315{0.0, 0.0, 0.0, 0.0, 0.0};

◆ m_alpha

double m_alpha = 222.376063
privateinherited

10000.0/(speed of light)/B.

Definition at line 294 of file Helix.h.

◆ m_bField

double m_bField = 15.0
privateinherited

Magnetic field, assuming uniform Bz in the unit of kG.

Definition at line 292 of file Helix.h.

◆ m_center

HepPoint3D m_center
privateinherited

Cache of the center position of Helix.

Definition at line 305 of file Helix.h.

◆ m_chi2D

float m_chi2D
protected

Definition at line 245 of file CDCTriggerTrack.h.

◆ m_chi3D

float m_chi3D
protected

chi2 value from 3D fitter

Definition at line 247 of file CDCTriggerTrack.h.

◆ m_cp

double m_cp
privateinherited

Cache of the cos phi0.

Definition at line 307 of file Helix.h.

◆ m_driftthreshold

std::vector<bool> m_driftthreshold
protected

store if drift time was within the timing window

Definition at line 255 of file CDCTriggerTrack.h.

◆ m_Ea

HepSymMatrix m_Ea
privateinherited

Error of the helix parameter.

Definition at line 300 of file Helix.h.

◆ m_etf_recalced

int m_etf_recalced {0}
protected

etf time recalculated from the hw input

Definition at line 278 of file CDCTriggerTrack.h.

278{0};

◆ m_etf_unpacked

int m_etf_unpacked {0}
protected

unpacked etf time from the unpacker

Definition at line 276 of file CDCTriggerTrack.h.

276{0};

◆ m_expert

int m_expert
protected

store value for used expert network

Definition at line 259 of file CDCTriggerTrack.h.

◆ m_foundoldtrack

std::vector<bool> m_foundoldtrack
protected

array to store whether an old 2dtrack was found

Definition at line 253 of file CDCTriggerTrack.h.

◆ m_hasETFTime

bool m_hasETFTime {0}
protected

chi2 value from 2D fitter

Definition at line 280 of file CDCTriggerTrack.h.

280{0};

◆ m_helixValid

bool m_helixValid = false
privateinherited

True: helix valid, False: helix not valid.

Definition at line 290 of file Helix.h.

◆ m_matrixValid

bool m_matrixValid = false
privateinherited

True: matrix valid, False: matrix not valid.

Definition at line 288 of file Helix.h.

◆ m_nntgdl

bool m_nntgdl {0}
protected

nnt decision that the firmware passed to gdl

Definition at line 288 of file CDCTriggerTrack.h.

288{0};

◆ m_pivot

HepPoint3D m_pivot
privateinherited

Pivot.

Definition at line 296 of file Helix.h.

◆ m_prob

double m_prob
protected

Definition at line 243 of file CDCTriggerTrack.h.

◆ m_pt

double m_pt
privateinherited

Cache of the pt.

Definition at line 311 of file Helix.h.

◆ m_quadrant

short m_quadrant
protected

iTracker of the unpacked quadrant

Definition at line 251 of file CDCTriggerTrack.h.

◆ m_qualityvector

unsigned m_qualityvector
protected

store bits for different quality flags.

2^0 : 0 if all axial ts are contained in the related 2dfindertrack; 1 otherwise. 2^1 : 0 if hwsim nntrack is less than 1cm in z away from hwtrack; 1 otherwise. 2^2 : 0 if all input values for the ID are exactly the same in hw and hwsim; 1 otherwise. 2^3 : 0 if all input values for alpa are exactly the same in hw and hwsim; 1 otherwise. 2^4 : 1 if dt in hw/hwsim is 0 and in hwsim/hw is 1; 0 otherwise. 2^5 : 1 if all inputs in hw are 0 but at least 1 is filled in hwsim; 0 otherwise. 2^6 : 1 if all inputs in hwsim are 0 but at least 1 is filled in hw; 0 otherwise. 2^7 : 1 if more than 1 etf time was recalculated from hw. this indicates, that an old input from a previous track was used in the network.

Definition at line 274 of file CDCTriggerTrack.h.

◆ m_r

double m_r
privateinherited

Cache of the r.

Definition at line 313 of file Helix.h.

◆ m_rawinput

std::vector<int> m_rawinput
protected

Definition at line 286 of file CDCTriggerTrack.h.

◆ m_rawomega

int m_rawomega {0}
protected

Definition at line 283 of file CDCTriggerTrack.h.

283{0};

◆ m_rawphi0

int m_rawphi0 {0}
protected

values to store the raw network and 2dfinder output

Definition at line 282 of file CDCTriggerTrack.h.

282{0};

◆ m_rawtheta

int m_rawtheta {0}
protected

Definition at line 285 of file CDCTriggerTrack.h.

285{0};

◆ m_rawz

int m_rawz {0}
protected

Definition at line 284 of file CDCTriggerTrack.h.

284{0};

◆ m_sp

double m_sp
privateinherited

Cache of the sin phi0.

Definition at line 309 of file Helix.h.

◆ m_sttgdl

bool m_sttgdl {0}
protected

stt decision that the firmware passed to gdl

Definition at line 290 of file CDCTriggerTrack.h.

290{0};

◆ m_time

short m_time
protected

number of trigger clocks of (the track output - L1 trigger)

Definition at line 249 of file CDCTriggerTrack.h.

◆ m_tsvector

std::vector<unsigned> m_tsvector
protected

store which track segments were used.

The First bit is the innermost TS, the last bit the outermost.

Definition at line 262 of file CDCTriggerTrack.h.

◆ m_valstereobit

bool m_valstereobit
protected

store if at least 3 valid stereo ts were found in the NNInput

Definition at line 257 of file CDCTriggerTrack.h.

◆ ms_amax

HepVector ms_amax
staticprivateinherited

maxiimum limit of Helix parameter a

Definition at line 233 of file Helix.h.

◆ ms_amin

HepVector ms_amin
staticprivateinherited

minimum limit of Helix parameter a

Definition at line 231 of file Helix.h.

◆ ms_check_range

bool ms_check_range
staticprivateinherited

Check the helix parameter's range.

Definition at line 235 of file Helix.h.

◆ ms_print_debug

bool ms_print_debug
staticprivateinherited

Debug option flag.

Definition at line 237 of file Helix.h.

◆ ms_throw_exception

bool ms_throw_exception
staticprivateinherited

Throw exception flag.

Definition at line 239 of file Helix.h.


The documentation for this class was generated from the following file: