ATLAS Offline Software
TrigInDetTrackFollowingTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGINDETTRACKFITTER_TRIGINDETTRACKFOLLOWINGTOOL_H
6 #define TRIGINDETTRACKFITTER_TRIGINDETTRACKFOLLOWINGTOOL_H
7 
9 #include "GaudiKernel/ToolHandle.h"
10 #include "GaudiKernel/ServiceHandle.h"
11 
13 
14 // MagField cache
17 
20 
21 namespace Trk {
22  class PrepRawData;
23  class PlaneSurface;
24  class SpacePoint;
25 }
26 
32 
33 TrigFTF_HitAssignment(const Trk::PrepRawData* p, double const* X, double const* C, double dchi2, int ndof) : m_pPRD(p), m_dchi2(dchi2), m_ndof(ndof) {
34  if(m_pPRD!=nullptr) {
35  memcpy(&m_Xk[0], X, sizeof(m_Xk));
36  memcpy(&m_Ck[0], C, sizeof(m_Ck));
37  }
38  else {
39  memset(&m_Xk[0], 0, sizeof(m_Xk));
40  memset(&m_Ck[0], 0, sizeof(m_Ck));
41  }
42 }
43 
45  double m_Xk[5];
46  double m_Ck[15];
47  double m_dchi2;
48  int m_ndof;
49 };
50 
52 
56 
57  TrigFTF_ExtendedTrackState(double const*, const Trk::PlaneSurface*);
58 
59  void AddHole();
60  void AddHit(const Trk::PrepRawData*, double, int);
61  void SwapTheEnds();
62  void correctAngles();
63  void report() const;
64 
65  double m_Xk[10];
66  double m_Gk[10][10];
67  double m_chi2;
68  double m_ndof;
69 
70  const Trk::PlaneSurface* m_pS;//moving plane - the "head"
71  const Trk::PlaneSurface* m_pO;//initial plane- the "tail"
72 
73  std::list<TrigFTF_HitAssignment> m_track;
74 
76  int m_nHoles;
77 
79 
80 };
81 
83 {
84  public:
85  TrigInDetTrackFollowingTool( const std::string&, const std::string&, const IInterface* );
86  virtual StatusCode initialize();
87  virtual StatusCode finalize();
88 
89  virtual Trk::Track* getTrack(const std::vector<const Trk::SpacePoint*>&, const std::vector<const InDetDD::SiDetectorElement*>&, const EventContext&) const;
90 
91 private:
92 
93  std::unique_ptr<TrigFTF_ExtendedTrackState> fitTheSeed(const std::vector<const Trk::SpacePoint*>&, MagField::AtlasFieldCache&) const;
94 
97 
99 
100  int RungeKutta34(double*, double*, const Trk::PlaneSurface*, MagField::AtlasFieldCache&, bool) const;
101 
102  bool checkIntersection(double const*, const Trk::PlaneSurface*, const Trk::PlaneSurface*, MagField::AtlasFieldCache&) const;
103 
104  inline double processHit(const InDet::PixelCluster*, double*, double*, const TrigFTF_ExtendedTrackState&) const;
105  inline double processHit(const InDet::SCT_Cluster*, int, double&, double&, double*, const TrigFTF_ExtendedTrackState&) const;
106 
107  inline void crossProduct(double const *, double const *, double*) const;
108 
109  double estimateRK_Step(const Trk::PlaneSurface*, double const *) const;
110 
111  Gaudi::Property<int> m_nClustersMin {this, "nClustersMin", 7, "Minimum number of clusters on track"};
112  Gaudi::Property<int> m_nHolesMax {this, "nHolesMax", 3, "Maximum number of holes on track"};
113  Gaudi::Property<double> m_maxChi2Dist_Pixels {this, "Chi2MaxPixels", 50.0, "the Pixel hit chi2 cut"};
114  Gaudi::Property<double> m_maxChi2Dist_Strips {this, "Chi2MaxStrips", 150.0, "the Strip hit chi2 cut"};
115  Gaudi::Property<bool> m_useHitErrors {this, "UseHitErrors", false, "use PrepRawData errors"};
116  Gaudi::Property<bool> m_useDetectorThickness {this, "UseDetectorThickness", false, "get Si-modules thickness from InDet Geometry"};
117  Gaudi::Property<double> m_nominalRadLength {this, "ModuleRadLength", 0.05, "fixed radiation thickness of the detector modules"};
118 
119  SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"};
120  SG::ReadHandleKey<InDet::PixelClusterContainer> m_pixcontainerkey{this, "PixelClusterContainer","ITkPixelClusters"};
121  SG::ReadHandleKey<InDet::SCT_ClusterContainer> m_sctcontainerkey{this, "SCT_ClusterContainer", "ITkStripClusters"};
122 
123 };
124 
125 #endif
TrigFTF_HitAssignment::m_Ck
double m_Ck[15]
Definition: TrigInDetTrackFollowingTool.h:46
ITrigInDetTrackFollowingTool
Definition: ITrigInDetTrackFollowingTool.h:23
TrigInDetTrackFollowingTool::finalize
virtual StatusCode finalize()
Definition: TrigInDetTrackFollowingTool.cxx:181
TrigFTF_HitAssignment::m_pPRD
const Trk::PrepRawData * m_pPRD
Definition: TrigInDetTrackFollowingTool.h:44
IDTPM::ndof
float ndof(const U &p)
Definition: TrackParametersHelper.h:142
ITrigInDetTrackFollowingTool.h
TrigFTF_ExtendedTrackState::m_pS
const Trk::PlaneSurface * m_pS
Definition: TrigInDetTrackFollowingTool.h:70
TrigFTF_HitAssignment::m_ndof
int m_ndof
Definition: TrigInDetTrackFollowingTool.h:48
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
TrigFTF_HitAssignment::~TrigFTF_HitAssignment
~TrigFTF_HitAssignment()
Definition: TrigInDetTrackFollowingTool.h:29
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
TrigFTF_ExtendedTrackState::SwapTheEnds
void SwapTheEnds()
Definition: TrigInDetTrackFollowingTool.cxx:106
AtlasFieldCacheCondObj.h
TrigFTF_ExtendedTrackState::m_nClusters
int m_nClusters
Definition: TrigInDetTrackFollowingTool.h:75
TrigInDetTrackFollowingTool::m_useDetectorThickness
Gaudi::Property< bool > m_useDetectorThickness
Definition: TrigInDetTrackFollowingTool.h:116
DMTest::C
C_v1 C
Definition: C.h:26
TrigInDetTrackFollowingTool::m_useHitErrors
Gaudi::Property< bool > m_useHitErrors
Definition: TrigInDetTrackFollowingTool.h:115
TrigInDetTrackFollowingTool::crossProduct
void crossProduct(double const *, double const *, double *) const
Definition: TrigInDetTrackFollowingTool.cxx:1587
TrigInDetTrackFollowingTool::RungeKutta34
int RungeKutta34(double *, double *, const Trk::PlaneSurface *, MagField::AtlasFieldCache &, bool) const
Definition: TrigInDetTrackFollowingTool.cxx:1306
TrigInDetTrackFollowingTool
Definition: TrigInDetTrackFollowingTool.h:83
TrigFTF_ExtendedTrackState::~TrigFTF_ExtendedTrackState
~TrigFTF_ExtendedTrackState()
Definition: TrigInDetTrackFollowingTool.h:54
SG::ReadHandleKey< InDet::PixelClusterContainer >
TrigInDetTrackFollowingTool::m_sctcontainerkey
SG::ReadHandleKey< InDet::SCT_ClusterContainer > m_sctcontainerkey
Definition: TrigInDetTrackFollowingTool.h:121
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
SpacePoint
Definition: Trigger/TrigAccel/TrigCudaFitter/src/SpacePoint.h:6
TrigFTF_ExtendedTrackState::AddHit
void AddHit(const Trk::PrepRawData *, double, int)
Definition: TrigInDetTrackFollowingTool.cxx:83
TrigFTF_ExtendedTrackState::AddHole
void AddHole()
Definition: TrigInDetTrackFollowingTool.cxx:61
TrigInDetTrackFollowingTool::processHit
double processHit(const InDet::PixelCluster *, double *, double *, const TrigFTF_ExtendedTrackState &) const
Definition: TrigInDetTrackFollowingTool.cxx:186
TrigFTF_ExtendedTrackState::m_isSwapped
bool m_isSwapped
Definition: TrigInDetTrackFollowingTool.h:78
TrigFTF_HitAssignment
Definition: TrigInDetTrackFollowingTool.h:27
TrigFTF_ExtendedTrackState::m_Xk
double m_Xk[10]
Definition: TrigInDetTrackFollowingTool.h:65
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigFTF_ExtendedTrackState
Definition: TrigInDetTrackFollowingTool.h:51
TrigFTF_ExtendedTrackState::m_ndof
double m_ndof
Definition: TrigInDetTrackFollowingTool.h:68
AthAlgTool.h
AtlasFieldCache.h
TrigInDetTrackFollowingTool::fitTheSeed
std::unique_ptr< TrigFTF_ExtendedTrackState > fitTheSeed(const std::vector< const Trk::SpacePoint * > &, MagField::AtlasFieldCache &) const
Definition: TrigInDetTrackFollowingTool.cxx:405
TrigFTF_ExtendedTrackState::m_pO
const Trk::PlaneSurface * m_pO
Definition: TrigInDetTrackFollowingTool.h:71
TrigFTF_ExtendedTrackState::m_Gk
double m_Gk[10][10]
Definition: TrigInDetTrackFollowingTool.h:66
InDet::SCT_Cluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SCT_Cluster.h:34
TrigFTF_ExtendedTrackState::report
void report() const
Definition: TrigInDetTrackFollowingTool.cxx:135
TrigInDetTrackFollowingTool::m_nHolesMax
Gaudi::Property< int > m_nHolesMax
Definition: TrigInDetTrackFollowingTool.h:112
TrigInDetTrackFollowingTool::m_fieldCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey
Definition: TrigInDetTrackFollowingTool.h:119
TrigInDetTrackFollowingTool::TrigInDetTrackFollowingTool
TrigInDetTrackFollowingTool(const std::string &, const std::string &, const IInterface *)
Definition: TrigInDetTrackFollowingTool.cxx:165
TrigInDetTrackFollowingTool::estimateRK_Step
double estimateRK_Step(const Trk::PlaneSurface *, double const *) const
Definition: TrigInDetTrackFollowingTool.cxx:1275
Trk::PrepRawData
Definition: PrepRawData.h:62
TrigInDetTrackFollowingTool::checkIntersection
bool checkIntersection(double const *, const Trk::PlaneSurface *, const Trk::PlaneSurface *, MagField::AtlasFieldCache &) const
Definition: TrigInDetTrackFollowingTool.cxx:1101
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
TrigFTF_ExtendedTrackState::correctAngles
void correctAngles()
Definition: TrigInDetTrackFollowingTool.cxx:71
PixelClusterContainer.h
TrigInDetTrackFollowingTool::m_maxChi2Dist_Strips
Gaudi::Property< double > m_maxChi2Dist_Strips
Definition: TrigInDetTrackFollowingTool.h:114
TrigInDetTrackFollowingTool::getTrack
virtual Trk::Track * getTrack(const std::vector< const Trk::SpacePoint * > &, const std::vector< const InDetDD::SiDetectorElement * > &, const EventContext &) const
Definition: TrigInDetTrackFollowingTool.cxx:593
TrigInDetTrackFollowingTool::m_nominalRadLength
Gaudi::Property< double > m_nominalRadLength
Definition: TrigInDetTrackFollowingTool.h:117
TrigFTF_ExtendedTrackState::operator=
TrigFTF_ExtendedTrackState & operator=(const TrigFTF_ExtendedTrackState &)=delete
TrigFTF_ExtendedTrackState::m_chi2
double m_chi2
Definition: TrigInDetTrackFollowingTool.h:67
InDet::PixelCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:49
SG::ReadCondHandleKey< AtlasFieldCacheCondObj >
TrigFTF_HitAssignment::m_dchi2
double m_dchi2
Definition: TrigInDetTrackFollowingTool.h:47
TrigInDetTrackFollowingTool::m_maxChi2Dist_Pixels
Gaudi::Property< double > m_maxChi2Dist_Pixels
Definition: TrigInDetTrackFollowingTool.h:113
Trk::PlaneSurface
Definition: PlaneSurface.h:64
TrigInDetTrackFollowingTool::updateTrackState
const Trk::PrepRawData * updateTrackState(const InDet::PixelCluster *, const InDet::PixelClusterCollection *, TrigFTF_ExtendedTrackState &) const
Definition: TrigInDetTrackFollowingTool.cxx:261
TrigFTF_HitAssignment::TrigFTF_HitAssignment
TrigFTF_HitAssignment()=delete
TrigFTF_HitAssignment::TrigFTF_HitAssignment
TrigFTF_HitAssignment(const TrigFTF_HitAssignment &)=delete
MagField::AtlasFieldCache
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
Definition: AtlasFieldCache.h:43
TrigFTF_ExtendedTrackState::m_track
std::list< TrigFTF_HitAssignment > m_track
Definition: TrigInDetTrackFollowingTool.h:73
SCT_ClusterContainer.h
TrigFTF_ExtendedTrackState::m_nHoles
int m_nHoles
Definition: TrigInDetTrackFollowingTool.h:76
TrigInDetTrackFollowingTool::m_pixcontainerkey
SG::ReadHandleKey< InDet::PixelClusterContainer > m_pixcontainerkey
Definition: TrigInDetTrackFollowingTool.h:120
AthAlgTool
Definition: AthAlgTool.h:26
InDet::SCT_ClusterCollection
Trk::PrepRawDataCollection< SCT_Cluster > SCT_ClusterCollection
Definition: SCT_ClusterCollection.h:26
TrigFTF_HitAssignment::operator=
TrigFTF_HitAssignment & operator=(const TrigFTF_HitAssignment &)=delete
TrigFTF_HitAssignment::m_Xk
double m_Xk[5]
Definition: TrigInDetTrackFollowingTool.h:45
TrigInDetTrackFollowingTool::extrapolateTrackState
int extrapolateTrackState(TrigFTF_ExtendedTrackState &, const Trk::PlaneSurface *, MagField::AtlasFieldCache &) const
Definition: TrigInDetTrackFollowingTool.cxx:938
TrigInDetTrackFollowingTool::initialize
virtual StatusCode initialize()
Definition: TrigInDetTrackFollowingTool.cxx:172
TrigInDetTrackFollowingTool::m_nClustersMin
Gaudi::Property< int > m_nClustersMin
Definition: TrigInDetTrackFollowingTool.h:111
TrigFTF_HitAssignment::TrigFTF_HitAssignment
TrigFTF_HitAssignment(const Trk::PrepRawData *p, double const *X, double const *C, double dchi2, int ndof)
Definition: TrigInDetTrackFollowingTool.h:33
InDet::PixelClusterCollection
Trk::PrepRawDataCollection< PixelCluster > PixelClusterCollection
Definition: PixelClusterCollection.h:26
TrigFTF_ExtendedTrackState::TrigFTF_ExtendedTrackState
TrigFTF_ExtendedTrackState()=delete