ATLAS Offline Software
ITkPixelClusterOnTrackTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ITkPixelClusterOnTrackTool_H
6 #define ITkPixelClusterOnTrackTool_H
7 
8 #include "GaudiKernel/ToolHandle.h"
9 #include "GaudiKernel/ThreadLocalContext.h"
11 
16 
20 
21 #include "Identifier/Identifier.h"
23 
29 
31 
32 #include <atomic>
33 #include <mutex>
34 
35 namespace ITk
36 {
37 
52  enum class PixelClusterStrategy {
53  DEFAULT=0,
54  OUTLIER=1,
55  SHARED =2,
56  SPLIT =3
57  };
58 
60  public AthAlgTool, virtual public Trk::IRIO_OnTrackCreator
61 {
63  // Public methods:
65 
66 public:
67 
69  PixelClusterOnTrackTool(const std::string&,const std::string&,
70  const IInterface*);
71  virtual ~PixelClusterOnTrackTool () = default;
73  virtual StatusCode initialize() override;
74 
82  const Trk::PrepRawData&, const Trk::TrackParameters&, const EventContext& ctx = Gaudi::Hive::currentContext()) const override;
83 
85  // Private methods:
87 
88 protected:
90  const Trk::TrackParameters&) const;
91 
93  const Trk::TrackParameters&) const;
94 
97  Amg::MatrixX&) const;
98 
101  Amg::MatrixX&) const;
102 
104  const Trk::TrackParameters&,
105  const ITk::PixelClusterStrategy) const;
106 
109  if (!pix || m_clusterSplitProbContainer.key().empty())
111 
114  if (!splitProbContainer.isValid()) {
115  ATH_MSG_FATAL("Failed to get cluster splitting probability container "
117  }
118  return splitProbContainer->splitProbability(pix);
119  }
120 
121 private:
122 
124  // Private data:
126 
127  ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool{this, "LorentzAngleTool", "SiLorentzAngleTool", "Tool to retreive Lorentz angle"};
128 
129  SG::ReadCondHandleKey<ITk::PixelOfflineCalibData> m_clusterITkErrorKey{this, "ITkPixelOfflineCalibData", "ITkPixelOfflineCalibData", "Output key of ITk pixel cluster"};
130 
132  {this,"PixelErrorScalingKey", "/Indet/TrkErrorScalingPixel", "Key for pixel error scaling conditions data."};
133 
136  IntegerProperty m_positionStrategy{this, "PositionStrategy", 1,
137  "Which calibration of cluster positions"};
138  mutable std::atomic_int m_errorStrategy{2};
139  IntegerProperty m_errorStrategyProperty{this, "ErrorStrategy", 2,
140  "Which calibration of cluster position errors"};
141 
142 
155  const PixelID* m_pixelid = nullptr;
157 
159  bool m_applyNNcorrection{false};
160  BooleanProperty m_applyNNcorrectionProperty{this, "applyNNcorrection", false};
161 
163  ToolHandle<InDet::NnClusterizationFactory> m_NnClusterizationFactory
164  {this, "NnClusterizationFactory",
165  "InDet::NnClusterizationFactory/NnClusterizationFactory"};
166 
167  BooleanProperty m_doNotRecalibrateNN{this, "doNotRecalibrateNN", false};
168  BooleanProperty m_noNNandBroadErrors{this, "noNNandBroadErrors", false};
170  BooleanProperty m_usingTIDE_Ambi{this, "RunningTIDE_Ambi", false};
172  {this, "SplitClusterAmbiguityMap", ""};
173 
175  {this, "ClusterSplitProbabilityName", "",""};
176 
177 };
178 
179 } // end of namespace ITk
180 
181 #endif // ITkPixelClusterOnTrackTool_H
ITk::PixelClusterOnTrackTool::m_NnClusterizationFactory
ToolHandle< InDet::NnClusterizationFactory > m_NnClusterizationFactory
NN clusterizationi factory for NN based positions and errors.
Definition: ITkPixelClusterOnTrackTool.h:164
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
ITk::PixelClusterOnTrackTool::~PixelClusterOnTrackTool
virtual ~PixelClusterOnTrackTool()=default
PixelDistortionData.h
Hold pixel distortion data produced by PixelDistortionAlg.
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
ITkPixelOfflineCalibData.h
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
ITk::PixelClusterOnTrackTool::m_splitClusterMapKey
SG::ReadHandleKey< InDet::PixelGangedClusterAmbiguities > m_splitClusterMapKey
Definition: ITkPixelClusterOnTrackTool.h:172
TrackParameters.h
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
Trk::ClusterSplitProbabilityContainer::ProbabilityInfo
Definition: ClusterSplitProbabilityContainer.h:22
IRIO_OnTrackCreator.h
ITk::PixelClusterStrategy::SPLIT
@ SPLIT
ITk::PixelClusterOnTrackTool::m_noNNandBroadErrors
BooleanProperty m_noNNandBroadErrors
Definition: ITkPixelClusterOnTrackTool.h:168
ITk::PixelClusterOnTrackTool::getClusterSplittingProbability
const Trk::ClusterSplitProbabilityContainer::ProbabilityInfo & getClusterSplittingProbability(const InDet::PixelCluster *pix) const
Definition: ITkPixelClusterOnTrackTool.h:108
ITk::PixelClusterOnTrackTool::m_usingTIDE_Ambi
BooleanProperty m_usingTIDE_Ambi
Enable different treatment of cluster errors based on NN information (do only if TIDE ambi is run)
Definition: ITkPixelClusterOnTrackTool.h:170
ISiLorentzAngleTool.h
ITk::PixelClusterOnTrackTool::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: ITkPixelClusterOnTrackTool.h:127
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
SG::ReadHandleKey< InDet::PixelGangedClusterAmbiguities >
ITk::PixelClusterOnTrackTool::getErrorsTIDE_Ambi
bool getErrorsTIDE_Ambi(const InDet::PixelCluster *, const Trk::TrackParameters &, Amg::Vector2D &, Amg::MatrixX &) const
Definition: ITkPixelClusterOnTrackTool.cxx:602
ITk::PixelClusterOnTrackTool::m_positionStrategy
IntegerProperty m_positionStrategy
toolhandle for central error scaling flag storing if errors need scaling or should be kept nominal
Definition: ITkPixelClusterOnTrackTool.h:136
ITk::PixelClusterOnTrackTool::m_clusterITkErrorKey
SG::ReadCondHandleKey< ITk::PixelOfflineCalibData > m_clusterITkErrorKey
Definition: ITkPixelClusterOnTrackTool.h:129
GeoPrimitives.h
ITk::PixelClusterOnTrackTool::correctNN
InDet::PixelClusterOnTrack * correctNN(const Trk::PrepRawData &, const Trk::TrackParameters &) const
Definition: ITkPixelClusterOnTrackTool.cxx:371
ITk::PixelClusterOnTrackTool::m_pixelid
const PixelID * m_pixelid
Flag controlling how module distortions are taken into account:
Definition: ITkPixelClusterOnTrackTool.h:156
PixelGangedClusterAmbiguities.h
ITk::PixelClusterOnTrackTool::getErrorsDefaultAmbi
bool getErrorsDefaultAmbi(const InDet::PixelCluster *, const Trk::TrackParameters &, Amg::Vector2D &, Amg::MatrixX &) const
Definition: ITkPixelClusterOnTrackTool.cxx:454
ITk::PixelClusterStrategy::SHARED
@ SHARED
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ITk::PixelClusterOnTrackTool::correctDefault
InDet::PixelClusterOnTrack * correctDefault(const Trk::PrepRawData &, const Trk::TrackParameters &) const
The correct method produces a PixelClusterOnTrack using the measured PixelCluster and the track predi...
Definition: ITkPixelClusterOnTrackTool.cxx:144
AthAlgTool.h
ITk::PixelClusterStrategy
PixelClusterStrategy
creates PixelClusterOnTrack objects allowing to calibrate cluster position and error using a given tr...
Definition: ITkPixelClusterOnTrackTool.h:52
ITk::PixelClusterOnTrackTool::m_errorStrategy
std::atomic_int m_errorStrategy
Definition: ITkPixelClusterOnTrackTool.h:138
ITk::PixelClusterOnTrackTool::m_pixelErrorScalingKey
SG::ReadCondHandleKey< RIO_OnTrackErrorScaling > m_pixelErrorScalingKey
Definition: ITkPixelClusterOnTrackTool.h:132
ITk::PixelClusterOnTrackTool::initialize
virtual StatusCode initialize() override
AlgTool initialisation.
Definition: ITkPixelClusterOnTrackTool.cxx:72
ITk::PixelClusterOnTrackTool::m_clusterSplitProbContainer
SG::ReadHandleKey< Trk::ClusterSplitProbabilityContainer > m_clusterSplitProbContainer
Definition: ITkPixelClusterOnTrackTool.h:175
Trk::ParametersBase
Definition: ParametersBase.h:55
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ITk::PixelClusterOnTrackTool::m_doNotRecalibrateNN
BooleanProperty m_doNotRecalibrateNN
Definition: ITkPixelClusterOnTrackTool.h:167
ReadCondHandleKey.h
Trk::PrepRawData
Definition: PrepRawData.h:62
ITk
Definition: ITkPixelOfflineCalibCondAlg.cxx:14
ITk::PixelClusterOnTrackTool::m_applyNNcorrection
bool m_applyNNcorrection
Enable NN based calibration (do only if NN calibration is applied)
Definition: ITkPixelClusterOnTrackTool.h:159
ITk::PixelClusterOnTrackTool
Definition: ITkPixelClusterOnTrackTool.h:61
InDet::PixelCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:49
ITk::PixelClusterOnTrackTool::m_applyNNcorrectionProperty
BooleanProperty m_applyNNcorrectionProperty
Definition: ITkPixelClusterOnTrackTool.h:160
SG::ReadCondHandleKey< ITk::PixelOfflineCalibData >
ITk::PixelClusterOnTrackTool::PixelClusterOnTrackTool
PixelClusterOnTrackTool(const std::string &, const std::string &, const IInterface *)
AlgTool constructor.
Definition: ITkPixelClusterOnTrackTool.cxx:60
PixelRIO_OnTrackErrorScaling.h
NnClusterizationFactory.h
InDet::PixelClusterOnTrack
Definition: PixelClusterOnTrack.h:51
ITk::PixelClusterOnTrackTool::m_errorStrategyProperty
IntegerProperty m_errorStrategyProperty
Definition: ITkPixelClusterOnTrackTool.h:139
ITk::PixelClusterStrategy::OUTLIER
@ OUTLIER
ClusterSplitProbabilityContainer.h
ITk::PixelClusterOnTrackTool::correct
virtual InDet::PixelClusterOnTrack * correct(const Trk::PrepRawData &, const Trk::TrackParameters &, const EventContext &ctx=Gaudi::Hive::currentContext()) const override
produces a PixelClusterOnTrack (object factory!).
Definition: ITkPixelClusterOnTrackTool.cxx:107
Trk::ClusterSplitProbabilityContainer::splitProbability
const ProbabilityInfo & splitProbability(const PrepRawData *cluster) const
Definition: ClusterSplitProbabilityContainer.h:35
ITk::PixelClusterStrategy::DEFAULT
@ DEFAULT
AthAlgTool
Definition: AthAlgTool.h:26
Trk::IRIO_OnTrackCreator
Interface class for transforming Trk::PrepRawData to Trk::RIO_OnTrack using a local track hypothesis.
Definition: IRIO_OnTrackCreator.h:33
pix
Definition: PixelMapping.cxx:16
PixelClusterOnTrack.h
PixelID
Definition: PixelID.h:67
Trk::ClusterSplitProbabilityContainer::getNoSplitProbability
static const ProbabilityInfo & getNoSplitProbability()
Definition: ClusterSplitProbabilityContainer.h:33