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 
14 
15 // MagField cache
18 
21 
22 namespace Trk {
23  class PrepRawData;
24  class PlaneSurface;
25  class SpacePoint;
26 }
27 
33 
34 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) {
35  if(m_pPRD!=nullptr) {
36  memcpy(&m_Xk[0], X, sizeof(m_Xk));
37  memcpy(&m_Ck[0], C, sizeof(m_Ck));
38  }
39  else {
40  memset(&m_Xk[0], 0, sizeof(m_Xk));
41  memset(&m_Ck[0], 0, sizeof(m_Ck));
42  }
43 }
44 
46  double m_Xk[5];
47  double m_Ck[15];
48  double m_dchi2;
49  int m_ndof;
50 };
51 
53 
57 
58  TrigFTF_ExtendedTrackState(double const*, const Trk::PlaneSurface*);
59 
60  void AddHole();
61  void AddHit(const Trk::PrepRawData*, double, int);
62  void SwapTheEnds();
63  void correctAngles();
64  void report() const;
65 
66  double m_Xk[10];
67  double m_Gk[10][10];
68  double m_chi2;
69  double m_ndof;
70 
71  const Trk::PlaneSurface* m_pS;//moving plane - the "head"
72  const Trk::PlaneSurface* m_pO;//initial plane- the "tail"
73 
74  std::list<TrigFTF_HitAssignment> m_track;
75 
77  int m_nHoles;
78 
80 
81 };
82 
84 {
85  public:
86  TrigInDetTrackFollowingTool( const std::string&, const std::string&, const IInterface* );
87  virtual StatusCode initialize();
88  virtual StatusCode finalize();
89 
90  virtual Trk::Track* getTrack(const std::vector<const Trk::SpacePoint*>&, const std::vector<const InDetDD::SiDetectorElement*>&, const EventContext&) const;
91 
92 private:
93 
94  ToolHandle<ITrigL2LayerNumberTool> m_layerNumberTool {this, "LayerNumberTool", "TrigL2LayerNumberToolITk"};
95 
96  std::unique_ptr<TrigFTF_ExtendedTrackState> fitTheSeed(const std::vector<const Trk::SpacePoint*>&, MagField::AtlasFieldCache&) const;
97 
100 
102 
103  int RungeKutta34(double*, double*, const Trk::PlaneSurface*, MagField::AtlasFieldCache&, bool) const;
104 
105  bool tentativeExtrapolation(double const*, double*, const Trk::PlaneSurface*, const Trk::PlaneSurface*, MagField::AtlasFieldCache&) const;
106 
107  inline double processHit(const InDet::PixelCluster*, double*, double*, const TrigFTF_ExtendedTrackState&) const;
108  inline double processHit(const InDet::SCT_Cluster*, int, double&, double&, double*, const TrigFTF_ExtendedTrackState&) const;
109 
110  inline void findNearestHit(int, const InDet::PixelClusterCollection*, const double*, std::vector<std::tuple<double, const Trk::PrepRawData*, int> >&) const;
111  inline void findNearestHit(int, const InDet::SCT_ClusterCollection*, int, const double*, std::vector<std::tuple<double, const Trk::PrepRawData*, int> >&) const;
112 
113  inline void crossProduct(double const *, double const *, double*) const;
114 
115  double estimateRK_Step(const Trk::PlaneSurface*, double const *) const;
116 
117  Gaudi::Property<int> m_nClustersMin {this, "nClustersMin", 7, "Minimum number of clusters on track"};
118  Gaudi::Property<int> m_nHolesMax {this, "nHolesMax", 100, "Maximum number of holes on track"};
119  Gaudi::Property<double> m_maxChi2Dist_Pixels {this, "Chi2MaxPixels", 25.0, "the Pixel hit chi2 cut"};
120  Gaudi::Property<double> m_maxChi2Dist_Strips {this, "Chi2MaxStrips", 12.0, "the Strip hit chi2 cut"};
121 
122  Gaudi::Property<double> m_winX_Pixels {this, "XSearchWindowPixels", 3.0, "x-size of hit search window for Pixels"};
123  Gaudi::Property<double> m_winY_Pixels {this, "YSearchWindowPixels", 3.0, "y-size of hit search window for Pixels"};
124  Gaudi::Property<double> m_winX_Strips {this, "XSearchWindowStrips", 3.0, "x-size of hit search window for Strips"};
125 
126  Gaudi::Property<bool> m_useHitErrors {this, "UseHitErrors", false, "use PrepRawData errors"};
127  Gaudi::Property<bool> m_useDetectorThickness {this, "UseDetectorThickness", false, "get Si-modules thickness from InDet Geometry"};
128  Gaudi::Property<double> m_nominalRadLength {this, "ModuleRadLength", 0.04, "fixed radiation thickness of the detector modules"};
129 
130  SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"};
131  SG::ReadHandleKey<InDet::PixelClusterContainer> m_pixcontainerkey{this, "PixelClusterContainer","ITkPixelClusters"};
132  SG::ReadHandleKey<InDet::SCT_ClusterContainer> m_sctcontainerkey{this, "SCT_ClusterContainer", "ITkStripClusters"};
133 
134 };
135 
136 #endif
TrigFTF_HitAssignment::m_Ck
double m_Ck[15]
Definition: TrigInDetTrackFollowingTool.h:47
ITrigInDetTrackFollowingTool
Definition: ITrigInDetTrackFollowingTool.h:23
TrigInDetTrackFollowingTool::finalize
virtual StatusCode finalize()
Definition: TrigInDetTrackFollowingTool.cxx:190
TrigFTF_HitAssignment::m_pPRD
const Trk::PrepRawData * m_pPRD
Definition: TrigInDetTrackFollowingTool.h:45
IDTPM::ndof
float ndof(const U &p)
Definition: TrackParametersHelper.h:134
ITrigInDetTrackFollowingTool.h
TrigFTF_ExtendedTrackState::m_pS
const Trk::PlaneSurface * m_pS
Definition: TrigInDetTrackFollowingTool.h:71
TrigFTF_HitAssignment::m_ndof
int m_ndof
Definition: TrigInDetTrackFollowingTool.h:49
TrigFTF_HitAssignment::~TrigFTF_HitAssignment
~TrigFTF_HitAssignment()
Definition: TrigInDetTrackFollowingTool.h:30
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
TrigFTF_ExtendedTrackState::SwapTheEnds
void SwapTheEnds()
Definition: TrigInDetTrackFollowingTool.cxx:107
AtlasFieldCacheCondObj.h
TrigFTF_ExtendedTrackState::m_nClusters
int m_nClusters
Definition: TrigInDetTrackFollowingTool.h:76
TrigInDetTrackFollowingTool::m_useDetectorThickness
Gaudi::Property< bool > m_useDetectorThickness
Definition: TrigInDetTrackFollowingTool.h:127
DMTest::C
C_v1 C
Definition: C.h:26
TrigInDetTrackFollowingTool::m_useHitErrors
Gaudi::Property< bool > m_useHitErrors
Definition: TrigInDetTrackFollowingTool.h:126
TrigInDetTrackFollowingTool::crossProduct
void crossProduct(double const *, double const *, double *) const
Definition: TrigInDetTrackFollowingTool.cxx:1665
ITrigL2LayerNumberTool.h
TrigInDetTrackFollowingTool::RungeKutta34
int RungeKutta34(double *, double *, const Trk::PlaneSurface *, MagField::AtlasFieldCache &, bool) const
Definition: TrigInDetTrackFollowingTool.cxx:1384
TrigInDetTrackFollowingTool
Definition: TrigInDetTrackFollowingTool.h:84
TrigFTF_ExtendedTrackState::~TrigFTF_ExtendedTrackState
~TrigFTF_ExtendedTrackState()
Definition: TrigInDetTrackFollowingTool.h:55
SG::ReadHandleKey< InDet::PixelClusterContainer >
TrigInDetTrackFollowingTool::m_sctcontainerkey
SG::ReadHandleKey< InDet::SCT_ClusterContainer > m_sctcontainerkey
Definition: TrigInDetTrackFollowingTool.h:132
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
SpacePoint
Definition: Trigger/TrigAccel/TrigCudaFitter/src/SpacePoint.h:7
TrigFTF_ExtendedTrackState::AddHit
void AddHit(const Trk::PrepRawData *, double, int)
Definition: TrigInDetTrackFollowingTool.cxx:84
TrigFTF_ExtendedTrackState::AddHole
void AddHole()
Definition: TrigInDetTrackFollowingTool.cxx:62
TrigInDetTrackFollowingTool::processHit
double processHit(const InDet::PixelCluster *, double *, double *, const TrigFTF_ExtendedTrackState &) const
Definition: TrigInDetTrackFollowingTool.cxx:262
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TrigFTF_ExtendedTrackState::m_isSwapped
bool m_isSwapped
Definition: TrigInDetTrackFollowingTool.h:79
TrigFTF_HitAssignment
Definition: TrigInDetTrackFollowingTool.h:28
TrigFTF_ExtendedTrackState::m_Xk
double m_Xk[10]
Definition: TrigInDetTrackFollowingTool.h:66
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigInDetTrackFollowingTool::m_layerNumberTool
ToolHandle< ITrigL2LayerNumberTool > m_layerNumberTool
Definition: TrigInDetTrackFollowingTool.h:94
TrigFTF_ExtendedTrackState
Definition: TrigInDetTrackFollowingTool.h:52
TrigFTF_ExtendedTrackState::m_ndof
double m_ndof
Definition: TrigInDetTrackFollowingTool.h:69
AthAlgTool.h
AtlasFieldCache.h
TrigInDetTrackFollowingTool::fitTheSeed
std::unique_ptr< TrigFTF_ExtendedTrackState > fitTheSeed(const std::vector< const Trk::SpacePoint * > &, MagField::AtlasFieldCache &) const
Definition: TrigInDetTrackFollowingTool.cxx:447
TrigFTF_ExtendedTrackState::m_pO
const Trk::PlaneSurface * m_pO
Definition: TrigInDetTrackFollowingTool.h:72
TrigFTF_ExtendedTrackState::m_Gk
double m_Gk[10][10]
Definition: TrigInDetTrackFollowingTool.h:67
TrigInDetTrackFollowingTool::m_winX_Strips
Gaudi::Property< double > m_winX_Strips
Definition: TrigInDetTrackFollowingTool.h:124
InDet::SCT_Cluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SCT_Cluster.h:34
TrigFTF_ExtendedTrackState::report
void report() const
Definition: TrigInDetTrackFollowingTool.cxx:136
TrigInDetTrackFollowingTool::m_nHolesMax
Gaudi::Property< int > m_nHolesMax
Definition: TrigInDetTrackFollowingTool.h:118
TrigInDetTrackFollowingTool::m_fieldCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey
Definition: TrigInDetTrackFollowingTool.h:130
TrigInDetTrackFollowingTool::TrigInDetTrackFollowingTool
TrigInDetTrackFollowingTool(const std::string &, const std::string &, const IInterface *)
Definition: TrigInDetTrackFollowingTool.cxx:166
TrigInDetTrackFollowingTool::estimateRK_Step
double estimateRK_Step(const Trk::PlaneSurface *, double const *) const
Definition: TrigInDetTrackFollowingTool.cxx:1353
Trk::PrepRawData
Definition: PrepRawData.h:62
TrigInDetTrackFollowingTool::updateTrackState
const Trk::PrepRawData * updateTrackState(const InDet::PixelCluster *, TrigFTF_ExtendedTrackState &, bool) const
Definition: TrigInDetTrackFollowingTool.cxx:337
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
TrigFTF_ExtendedTrackState::correctAngles
void correctAngles()
Definition: TrigInDetTrackFollowingTool.cxx:72
PixelClusterContainer.h
TrigInDetTrackFollowingTool::m_maxChi2Dist_Strips
Gaudi::Property< double > m_maxChi2Dist_Strips
Definition: TrigInDetTrackFollowingTool.h:120
TrigInDetTrackFollowingTool::getTrack
virtual Trk::Track * getTrack(const std::vector< const Trk::SpacePoint * > &, const std::vector< const InDetDD::SiDetectorElement * > &, const EventContext &) const
Definition: TrigInDetTrackFollowingTool.cxx:635
TrigInDetTrackFollowingTool::m_winY_Pixels
Gaudi::Property< double > m_winY_Pixels
Definition: TrigInDetTrackFollowingTool.h:123
TrigInDetTrackFollowingTool::m_nominalRadLength
Gaudi::Property< double > m_nominalRadLength
Definition: TrigInDetTrackFollowingTool.h:128
TrigFTF_ExtendedTrackState::operator=
TrigFTF_ExtendedTrackState & operator=(const TrigFTF_ExtendedTrackState &)=delete
TrigFTF_ExtendedTrackState::m_chi2
double m_chi2
Definition: TrigInDetTrackFollowingTool.h:68
InDet::PixelCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:49
SG::ReadCondHandleKey< AtlasFieldCacheCondObj >
TrigInDetTrackFollowingTool::findNearestHit
void findNearestHit(int, const InDet::PixelClusterCollection *, const double *, std::vector< std::tuple< double, const Trk::PrepRawData *, int > > &) const
Definition: TrigInDetTrackFollowingTool.cxx:195
TrigFTF_HitAssignment::m_dchi2
double m_dchi2
Definition: TrigInDetTrackFollowingTool.h:48
TrigInDetTrackFollowingTool::tentativeExtrapolation
bool tentativeExtrapolation(double const *, double *, const Trk::PlaneSurface *, const Trk::PlaneSurface *, MagField::AtlasFieldCache &) const
Definition: TrigInDetTrackFollowingTool.cxx:1188
TrigInDetTrackFollowingTool::m_maxChi2Dist_Pixels
Gaudi::Property< double > m_maxChi2Dist_Pixels
Definition: TrigInDetTrackFollowingTool.h:119
Trk::PlaneSurface
Definition: PlaneSurface.h:64
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:74
SCT_ClusterContainer.h
TrigFTF_ExtendedTrackState::m_nHoles
int m_nHoles
Definition: TrigInDetTrackFollowingTool.h:77
TrigInDetTrackFollowingTool::m_winX_Pixels
Gaudi::Property< double > m_winX_Pixels
Definition: TrigInDetTrackFollowingTool.h:122
TrigInDetTrackFollowingTool::m_pixcontainerkey
SG::ReadHandleKey< InDet::PixelClusterContainer > m_pixcontainerkey
Definition: TrigInDetTrackFollowingTool.h:131
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:46
TrigInDetTrackFollowingTool::extrapolateTrackState
int extrapolateTrackState(TrigFTF_ExtendedTrackState &, const Trk::PlaneSurface *, MagField::AtlasFieldCache &) const
Definition: TrigInDetTrackFollowingTool.cxx:1031
TrigInDetTrackFollowingTool::initialize
virtual StatusCode initialize()
Definition: TrigInDetTrackFollowingTool.cxx:173
TrigInDetTrackFollowingTool::m_nClustersMin
Gaudi::Property< int > m_nClustersMin
Definition: TrigInDetTrackFollowingTool.h:117
TrigFTF_HitAssignment::TrigFTF_HitAssignment
TrigFTF_HitAssignment(const Trk::PrepRawData *p, double const *X, double const *C, double dchi2, int ndof)
Definition: TrigInDetTrackFollowingTool.h:34
InDet::PixelClusterCollection
Trk::PrepRawDataCollection< PixelCluster > PixelClusterCollection
Definition: PixelClusterCollection.h:26
TrigFTF_ExtendedTrackState::TrigFTF_ExtendedTrackState
TrigFTF_ExtendedTrackState()=delete