#include <string>
#include "CLHEP/Vector/ThreeVector.h"
#include "TrackUtil/Helix.h"
#include "TrkReco/TMDCUtil.h"
#include "TrkReco/TTrackBase.h"
#include "TrkReco/TMLink.h"
#include "TrkReco/TBuilder0.h"
#include "TrkReco/TBuilderCosmic.h"
#include "TrkReco/TBuilderCurl.h"
#include "TrkReco/TPoint2D.h"
#include "TrkReco/T3DLine.h"
#include "TrkReco/TRunge.h"
#include "GaudiKernel/IInterface.h"
#include "GaudiKernel/Kernel.h"
#include "GaudiKernel/Service.h"
#include "MagneticField/IMagneticFieldSvc.h"
#include "MagneticField/MagneticFieldSvc.h"
#include "CLHEP/Matrix/Vector.h"
#include "CLHEP/Matrix/SymMatrix.h"
#include "CLHEP/Vector/LorentzVector.h"
#include "CLHEP/Geometry/Point3D.h"
Go to the source code of this file.
◆ HEP_SHORT_NAMES
◆ OLD_STEREO
calculates arc length and z for a stereo hit. uses these functions for curl tracks.
Definition at line 250 of file TTrack.h.
◆ TrackCurlFinder
#define TrackCurlFinder 8 |
◆ TrackFastFinder
#define TrackFastFinder 2 |
◆ TrackFinderMask
#define TrackFinderMask 255 |
◆ TrackFitCdcKalman
#define TrackFitCdcKalman 4 |
◆ TrackFitCosmic
◆ TrackFitGlobal
◆ TrackFitMask
◆ TrackFitShift
◆ TrackFitSvdCdcKalman
#define TrackFitSvdCdcKalman 8 |
◆ TrackHasDaughter
#define TrackHasDaughter 2 |
◆ TrackHasMother
◆ TrackOldConformalFinder
#define TrackOldConformalFinder 1 |
◆ TrackPMCurlFinder
#define TrackPMCurlFinder 32 |
◆ TrackQuality2D
◆ TrackQualityAfterKink
#define TrackQualityAfterKink 2 |
◆ TrackQualityCosmic
#define TrackQualityCosmic 4 |
◆ TrackQualityMask
#define TrackQualityMask 255 |
◆ TrackQualityOutsideCurler
#define TrackQualityOutsideCurler 1 |
◆ TrackQualityShift
#define TrackQualityShift 8 |
◆ TrackRelationMask
#define TrackRelationMask 255 |
◆ TrackRelationShift
#define TrackRelationShift 24 |
◆ TrackSlowFinder
#define TrackSlowFinder 4 |
◆ TrackSVDAssociator
#define TrackSVDAssociator 64 |
◆ TrackTrackManager
#define TrackTrackManager 16 |
◆ TrackTypeCircle
#define TrackTypeCircle 4 |
◆ TrackTypeCosmic
#define TrackTypeCosmic 8 |
◆ TrackTypeCurl
◆ TrackTypeIncomingCosmic
#define TrackTypeIncomingCosmic 8 |
◆ TrackTypeKink
◆ TrackTypeNormal
#define TrackTypeNormal 1 |
◆ TrackTypeOutgoingCosmic
#define TrackTypeOutgoingCosmic 16 |
◆ TrackTypeSVDOnly
#define TrackTypeSVDOnly 256 |
◆ TrackTypeUndefined
#define TrackTypeUndefined 0 |
◆ TTrack_INLINE_DEFINE_HERE
#define TTrack_INLINE_DEFINE_HERE |
◆ HepPoint3D
◆ HelixHasNan()
Helix parameter validity.
Definition at line 3934 of file TTrack.cxx.
3934 {
3936 for (unsigned i = 0; i < 5; i++)
3937 if (isnan(a[i]))
3938 return true;
3940 for (unsigned i = 0; i < 5; i++)
3941 for (unsigned j = 0; j <= i; j++)
3942 if (isnan(Ea[i][j]))
3943 return true;
3944 return false;
3945}
CLHEP::HepSymMatrix SymMatrix
const HepSymMatrix & Ea(void) const
returns error matrix.
const HepVector & a(void) const
returns helix parameters.
Referenced by TTrackManager::goodTrack(), and TrackInformation().
◆ PositiveDefinite()
Error matrix validity.
Definition at line 3918 of file TTrack.cxx.
3918 {
3923
3924 bool positive = true;
3925 if (e[0][0] <= 0.) positive = false;
3926 else if (
e2.determinant() <= 0.) positive =
false;
3927 else if (e3.determinant() <= 0.) positive = false;
3928 else if (e4.determinant() <= 0.) positive = false;
3929 else if (e.determinant() <= 0.) positive = false;
3930 return positive;
3931}
Referenced by TrackInformation().
◆ SortByPt()
int SortByPt |
( |
const void * |
a, |
|
|
const void * |
b |
|
) |
| |
Utility functions.
Definition at line 2530 of file TTrack.cxx.
2530 {
2533 if ((* a)->pt() < (* b)->pt()) return 1;
2534 else if
2535 ((* a)->pt() == (* b)->pt()) return 0;
2536 else return -1;
2537}
A class to represent a track in tracking.
Referenced by TTrackManager::append2D().
◆ Track2Helix() [1/4]
Definition at line 3948 of file TTrack.cxx.
3948 {
3950 if (
t.idhep == 11)
charge = -1;
3951 else if (
t.idhep == -11)
charge = 1;
3952 else if (
t.idhep == 13)
charge = -1;
3953 else if (
t.idhep == -13)
charge = 1;
3954 else if (
t.idhep == 211)
charge = 1;
3955 else if (
t.idhep == -211)
charge = -1;
3956 else if (
t.idhep == 321)
charge = 1;
3957 else if (
t.idhep == -321)
charge = -1;
3958 else if (
t.idhep == 2212)
charge = 1;
3959 else if (
t.idhep == -2212)
charge = -1;
3960 else {
3961 std::cout << "Track2Helix(gen_hepevt) !!! charge of id=";
3962 std::cout <<
t.idhep <<
" is unknown" << std::endl;
3963 }
3964
3965 Hep3Vector mom(
t.P[0],
t.P[1],
t.P[2]);
3966 Hep3Vector pos(
t.V[0] / 10.,
t.V[1] / 10.,
t.V[2] / 10.);
3968}
◆ Track2Helix() [2/4]
returns helix.
Definition at line 3684 of file TTrack.cxx.
3684 {
3685 HepVector a(5);
3686 Hep3Vector p(
t.pivot[0],
t.pivot[1],
t.pivot[2]);
3687 HepSymMatrix er(5,0);
3693 er(1,1) =
t.error[0];
3694 er(2,1) =
t.error[1];
3695 er(2,2) =
t.error[2];
3696 er(3,1) =
t.error[3];
3697 er(3,2) =
t.error[4];
3698 er(3,3) =
t.error[5];
3699 er(4,1) =
t.error[6];
3700 er(4,2) =
t.error[7];
3701 er(4,3) =
t.error[8];
3702 er(4,4) =
t.error[9];
3703 er(5,1) =
t.error[10];
3704 er(5,2) =
t.error[11];
3705 er(5,3) =
t.error[12];
3706 er(5,4) =
t.error[13];
3707 er(5,5) =
t.error[14];
3708 return Helix(p, a, er);
3709}
◆ Track2Helix() [3/4]
Definition at line 3656 of file TTrack.cxx.
3656 {
3657 HepVector a(5);
3658 Hep3Vector p(
t.pivot[0],
t.pivot[1],
t.pivot[2]);
3659 HepSymMatrix er(5,0);
3665 er(1,1) =
t.error[0];
3666 er(2,1) =
t.error[1];
3667 er(2,2) =
t.error[2];
3668 er(3,1) =
t.error[3];
3669 er(3,2) =
t.error[4];
3670 er(3,3) =
t.error[5];
3671 er(4,1) =
t.error[6];
3672 er(4,2) =
t.error[7];
3673 er(4,3) =
t.error[8];
3674 er(4,4) =
t.error[9];
3675 er(5,1) =
t.error[10];
3676 er(5,2) =
t.error[11];
3677 er(5,3) =
t.error[12];
3678 er(5,4) =
t.error[13];
3679 er(5,5) =
t.error[14];
3680 return Helix(p, a, er);
3681}
Referenced by TrackInformation().
◆ Track2Helix() [4/4]
Definition at line 3712 of file TTrack.cxx.
3712 {
3713 HepVector a(5);
3714 Hep3Vector p(
t.pivot_x,
t.pivot_y,
t.pivot_z);
3715 HepSymMatrix er(5,0);
3721 er(1,1) =
t.error[0];
3722 er(2,1) =
t.error[1];
3723 er(2,2) =
t.error[2];
3724 er(3,1) =
t.error[3];
3725 er(3,2) =
t.error[4];
3726 er(3,3) =
t.error[5];
3727 er(4,1) =
t.error[6];
3728 er(4,2) =
t.error[7];
3729 er(4,3) =
t.error[8];
3730 er(4,4) =
t.error[9];
3731 er(5,1) =
t.error[10];
3732 er(5,2) =
t.error[11];
3733 er(5,3) =
t.error[12];
3734 er(5,4) =
t.error[13];
3735 er(5,5) =
t.error[14];
3736 return Helix(p, a, er);
3737}
◆ TrackDump()
std::string TrackDump |
( |
const TTrack & |
t | ) |
|
|
inline |
to dump a track.
Definition at line 697 of file TTrack.h.
697 {
700}
std::string TrackInformation(const TTrack &)
std::string TrackStatus(const TTrack &)
returns string of track status.
std::string TrackKinematics(const TTrack &)
Referenced by TTrackManager::dump(), and TTrackManager::saveTables().
◆ TrackInformation() [1/3]
std::string TrackInformation |
( |
const MdcRec_trk & |
r | ) |
|
Definition at line 3868 of file TTrack.cxx.
3868 {
3869 std::string p;
3871 else p = " nega";
3877}
Helix Track2Helix(const MdcTrk_localz &t)
std::string TrackInformation(const TTrack &t)
bool PositiveDefinite(const Helix &h)
Error matrix validity.
bool HelixHasNan(const Helix &h)
Helix parameter validity.
◆ TrackInformation() [2/3]
std::string TrackInformation |
( |
const TTrack & |
t | ) |
|
Definition at line 3856 of file TTrack.cxx.
3856 {
3858 unsigned n = cores.length();
3860 unsigned nA =
n - nS;
3861 std::string p;
3865}
unsigned NStereoHits(const AList< TMLink > &links)
returns # of stereo hits.
Referenced by TrackDump(), and TrackInformation().
◆ TrackInformation() [3/3]
std::string TrackInformation |
( |
unsigned |
nA, |
|
|
unsigned |
nS, |
|
|
unsigned |
n, |
|
|
float |
chisq |
|
) |
| |
Definition at line 3880 of file TTrack.cxx.
3880 {
3882
3883 s +=
"a" + itostring(
int(nA));
3884 s +=
" s" + itostring(
int(nS));
3885 s +=
" n" + itostring(
int(
n));
3886
3888
3889 if (x < 0.)
s +=
" -";
3891
3892 int y = int(fabs(x));
3893 s += itostring(
y) +
".";
3894 float z = fabs(x);
3895 for (unsigned j = 0; j < 1; j++) {
3896 z *= 10.;
3899 }
3900
3902}
◆ TrackKinematics() [1/2]
std::string TrackKinematics |
( |
const Helix & |
h | ) |
|
Definition at line 3740 of file TTrack.cxx.
3740 {
3744
3745 float chrg = hIp.
a()[2] / fabs(hIp.
a()[2]);
3747 if (chrg > 0.)
s =
"+";
3749
3751 x[0] = fabs(hIp.
a()[0]);
3753 x[2] = 1. / fabs(hIp.
a()[2]);
3754 x[3] = (1. / fabs(hIp.
a()[2])) * hIp.
a()[4];
3755
3756 if ((x[0] < 2.) && (fabs(x[1]) < 4.))
s +=
"i ";
3758
3759 for (unsigned i = 0; i < 4; i++) {
3761
3762 if (x[i] < 0.)
s +=
"-";
3764
3765 int y = int(fabs(x[i]));
3766 s += itostring(
y) +
".";
3767 float z = fabs(x[i]);
3768 for (unsigned j = 0; j < 3; j++) {
3769 z *= 10.;
3772 }
3773 }
3774
3776}
const HepPoint3D & pivot(void) const
returns pivot position.
◆ TrackKinematics() [2/2]
std::string TrackKinematics |
( |
const TTrack & |
t | ) |
|
|
inline |
◆ TrackLayerUsage()
std::string TrackLayerUsage |
( |
const TTrack & |
t | ) |
|
Definition at line 3905 of file TTrack.cxx.
3905 {
3908 std::string nh;
3909 for (unsigned i = 0; i < 11; i++) {
3910 nh += itostring(
n[i]);
3911 if (i % 2) nh += "-";
3912 else if (i < 10) nh += ",";
3913 }
3914 return nh;
3915}
void NHitsSuperLayer(const AList< TMLink > &links, unsigned nHits[11])
returns # of hits per super layer.
◆ TrackStatus() [1/4]
Definition at line 3789 of file TTrack.cxx.
3789 {
3790
3791
3792
3793}
◆ TrackStatus() [2/4]
Definition at line 3796 of file TTrack.cxx.
3796 {
3797
3798
3799
3800
3801
3802
3803}
◆ TrackStatus() [3/4]
std::string TrackStatus |
( |
const TTrack & |
t | ) |
|
returns string of track status.
Definition at line 3779 of file TTrack.cxx.
3779 {
3784 0,
3785 0);
3786}
std::string TrackStatus(const TTrack &t)
returns string of track status.
Referenced by TrackDump(), and TrackStatus().
◆ TrackStatus() [4/4]
std::string TrackStatus |
( |
unsigned |
md, |
|
|
unsigned |
mk, |
|
|
unsigned |
mq, |
|
|
unsigned |
ms, |
|
|
unsigned |
mm, |
|
|
unsigned |
ma |
|
) |
| |
Definition at line 3806 of file TTrack.cxx.
3811 {
3812
3819 if (
f ==
"")
f =
"?";
3820
3821 std::string k;
3829 if (k == "") k = "?";
3830
3836 if (
b ==
"")
b =
"ok";
3837
3843 if (
s ==
"")
s =
"?";
3844
3845 int m = mm;
3846 if (m) --m;
3847
3848 int d = ma;
3849 if (d) --d;
3850
3851 std::string p = " ";
3852 return f + p + k + p +
b + p +
s + p + itostring(m) + p + itostring(d);
3853}
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
#define TrackFitCdcKalman
#define TrackFitSvdCdcKalman
#define TrackQualityAfterKink
#define TrackQualityCosmic
#define TrackTrackManager
#define TrackTypeIncomingCosmic
#define TrackOldConformalFinder
#define TrackQualityOutsideCurler
#define TrackTypeOutgoingCosmic
◆ TrackType() [1/2]
returns string of track type.
Definition at line 685 of file TTrack.h.
◆ TrackType() [2/2]
Definition at line 3030 of file TTrack.cxx.
3030 {
3031 switch (type) {
3033 return std::string("undefined");
3035 return std::string("normal");
3037 return std::string("curl ");
3039 return std::string("circle");
3041 return std::string("cosmic");
3042 }
3043 return std::string("unknown ");
3044}
#define TrackTypeUndefined