ATLAS Offline Software
PixelClusterOnTrackTool.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 PixelClusterOnTrackTool_H
6 #define PixelClusterOnTrackTool_H
7 
8 #include "GaudiKernel/ToolHandle.h"
9 #include "GaudiKernel/ThreadLocalContext.h"
11 
15 
19 
20 #include "Identifier/Identifier.h"
22 
28 
30 
32 
33 #include <atomic>
34 #include <mutex>
35 
36 namespace InDet {
37 
52  class NnClusterizationFactory;
53 
59  };
60 
62  public AthAlgTool, virtual public Trk::IRIO_OnTrackCreator
63 {
65  // Public methods:
67 
68 public:
69 
71  PixelClusterOnTrackTool(const std::string&,const std::string&,
72  const IInterface*);
75  virtual StatusCode initialize() override;
77  virtual StatusCode finalize () override;
78 
86  const Trk::PrepRawData&, const Trk::TrackParameters&, const EventContext& ctx = Gaudi::Hive::currentContext()) const override;
87 
89  // Private methods:
91 
92 protected:
93  void correctBow(const Identifier&, Amg::Vector2D& locpos, const double tanphi, const double taneta, const EventContext& ctx) const;
94 
96  const Trk::TrackParameters&,
97  const EventContext& ctx) const;
98 
100  const Trk::TrackParameters&,
101  const EventContext& ctx) const;
102 
104  Amg::Vector2D&, Amg::MatrixX&) const;
105 
107  Amg::Vector2D&, Amg::MatrixX&) const;
108 
110  const Trk::TrackParameters&,
111  const InDet::PixelClusterStrategy) const;
112 
115 
117  if (!splitProbContainer.isValid()) {
118  ATH_MSG_FATAL("Failed to get cluster splitting probability container " << m_clusterSplitProbContainer);
119  }
120  return splitProbContainer->splitProbability(pix);
121  }
122 
123 private:
124 
126  // Private data:
128 
130  {this, "PixelDistortionData", "PixelDistortionData", "Output readout distortion data"};
131 
132  ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool
133  {this, "LorentzAngleTool", "SiLorentzAngleTool", "Tool to retrieve Lorentz angle"};
134 
136  {this, "PixelOfflineCalibData", "PixelOfflineCalibData", "Output key of pixel cluster"};
138  {this,"PixelErrorScalingKey", "/Indet/TrkErrorScalingPixel", "Key for pixel error scaling conditions data."};
139 
142  BooleanProperty m_disableDistortions{this, "DisableDistortions", false,
143  "Disable simulation of module distortions"};
144  IntegerProperty m_positionStrategy{this, "PositionStrategy", 1,
145  "Which calibration of cluster positions"};
146  mutable std::atomic_int m_errorStrategy{2};
147  IntegerProperty m_errorStrategyProperty
148  {this, "ErrorStrategy", 2, "Which calibration of cluster position errors"};
149 
150 
163  const PixelID* m_pixelid = nullptr;
165 
167  BooleanProperty m_applyNNcorrectionProperty{this, "applyNNcorrection", false};
168  bool m_applyNNcorrection = false; // Updated depending on other configs
169  BooleanProperty m_NNIBLcorrection{this, "NNIBLcorrection", false};
170  bool m_IBLAbsent = true;
171 
173  ToolHandle<NnClusterizationFactory> m_NnClusterizationFactory
174  {this, "NnClusterizationFactory",
175  "InDet::NnClusterizationFactory/NnClusterizationFactory"};
177  {this, "IBLParameterSvc", "IBLParameterSvc"};
178 
179  BooleanProperty m_doNotRecalibrateNN{this, "doNotRecalibrateNN", false};
180  BooleanProperty m_noNNandBroadErrors{this, "noNNandBroadErrors", false};
182  BooleanProperty m_usingTIDE_Ambi{this, "RunningTIDE_Ambi", false};
184  {this, "SplitClusterAmbiguityMap", ""};
185 
187  {this, "ClusterSplitProbabilityName", "",""};
188 
189  //moved from static to member variable
190  static constexpr int s_nbinphi=9;
191  static constexpr int s_nbineta=6;
192  double m_calphi[s_nbinphi]{};
193  double m_caleta[s_nbineta][3]{};
194  double m_calerrphi[s_nbinphi][3]{};
195  double m_calerreta[s_nbineta][3]{};
196  double m_phix[s_nbinphi+1]{};
197  double m_etax[s_nbineta+1]{};
198 };
199 
200 } // end of namespace InDet
201 
202 #endif // PixelClusterOnTrackTool_H
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
InDet::PixelClusterOnTrackTool::m_doNotRecalibrateNN
BooleanProperty m_doNotRecalibrateNN
Definition: PixelClusterOnTrackTool.h:179
PixelDistortionData.h
Hold pixel distortion data produced by PixelDistortionAlg.
InDet::PixelClusterOnTrackTool::m_splitClusterMapKey
SG::ReadHandleKey< InDet::PixelGangedClusterAmbiguities > m_splitClusterMapKey
Definition: PixelClusterOnTrackTool.h:184
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
InDet::PixelClusterOnTrackTool::m_clusterSplitProbContainer
SG::ReadHandleKey< Trk::ClusterSplitProbabilityContainer > m_clusterSplitProbContainer
Definition: PixelClusterOnTrackTool.h:187
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
TrackParameters.h
PixelOfflineCalibData.h
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
InDet::PixelClusterOnTrackTool::m_clusterErrorKey
SG::ReadCondHandleKey< PixelCalib::PixelOfflineCalibData > m_clusterErrorKey
Definition: PixelClusterOnTrackTool.h:136
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
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::PixelClusterOnTrackTool::m_calphi
double m_calphi[s_nbinphi]
Definition: PixelClusterOnTrackTool.h:192
InDet::PixelClusterOnTrackTool::m_NnClusterizationFactory
ToolHandle< NnClusterizationFactory > m_NnClusterizationFactory
NN clusterizationi factory for NN based positions and errors.
Definition: PixelClusterOnTrackTool.h:174
IRIO_OnTrackCreator.h
InDet::PixelClusterOnTrackTool::m_phix
double m_phix[s_nbinphi+1]
Definition: PixelClusterOnTrackTool.h:196
InDet::PixelClusterOnTrackTool::initialize
virtual StatusCode initialize() override
AlgTool initialisation.
Definition: PixelClusterOnTrackTool.cxx:74
InDet::PixelClusterOnTrackTool::m_distortionKey
SG::ReadCondHandleKey< PixelDistortionData > m_distortionKey
Definition: PixelClusterOnTrackTool.h:130
InDet::PixelClusterOnTrackTool::m_disableDistortions
BooleanProperty m_disableDistortions
toolhandle for central error scaling flag storing if errors need scaling or should be kept nominal
Definition: PixelClusterOnTrackTool.h:142
ISiLorentzAngleTool.h
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 >
InDet::PixelClusterOnTrackTool::m_pixelErrorScalingKey
SG::ReadCondHandleKey< RIO_OnTrackErrorScaling > m_pixelErrorScalingKey
Definition: PixelClusterOnTrackTool.h:138
InDet::PixelClusterOnTrackTool::m_errorStrategy
std::atomic_int m_errorStrategy
Definition: PixelClusterOnTrackTool.h:146
InDet::PixelClusterOnTrackTool::finalize
virtual StatusCode finalize() override
AlgTool termination.
Definition: PixelClusterOnTrackTool.cxx:130
GeoPrimitives.h
InDet::PixelClusterOnTrackTool::m_IBLParameterSvc
ServiceHandle< IIBLParameterSvc > m_IBLParameterSvc
Definition: PixelClusterOnTrackTool.h:177
InDet::PixelClusterOnTrackTool
Definition: PixelClusterOnTrackTool.h:63
IIBLParameterSvc.h
InDet::PixelClusterOnTrackTool::s_nbinphi
static constexpr int s_nbinphi
Definition: PixelClusterOnTrackTool.h:190
InDet::PixelClusterOnTrackTool::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: PixelClusterOnTrackTool.h:133
InDet::PixelClusterOnTrackTool::m_IBLAbsent
bool m_IBLAbsent
Definition: PixelClusterOnTrackTool.h:170
PixelGangedClusterAmbiguities.h
InDet::PixelClusterStrategy
PixelClusterStrategy
Definition: PixelClusterOnTrackTool.h:54
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::PixelClusterOnTrackTool::m_errorStrategyProperty
IntegerProperty m_errorStrategyProperty
Definition: PixelClusterOnTrackTool.h:148
AthAlgTool.h
InDet::PIXELCLUSTER_DEFAULT
@ PIXELCLUSTER_DEFAULT
Definition: PixelClusterOnTrackTool.h:55
InDet::PIXELCLUSTER_SHARED
@ PIXELCLUSTER_SHARED
Definition: PixelClusterOnTrackTool.h:57
InDet::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: PixelClusterOnTrackTool.h:182
InDet::PixelClusterOnTrackTool::m_caleta
double m_caleta[s_nbineta][3]
Definition: PixelClusterOnTrackTool.h:193
InDet::PixelClusterOnTrackTool::getClusterSplittingProbability
const Trk::ClusterSplitProbabilityContainer::ProbabilityInfo & getClusterSplittingProbability(const InDet::PixelCluster *pix) const
Definition: PixelClusterOnTrackTool.h:113
InDet::PixelClusterOnTrackTool::m_NNIBLcorrection
BooleanProperty m_NNIBLcorrection
Definition: PixelClusterOnTrackTool.h:169
Trk::ParametersBase
Definition: ParametersBase.h:55
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
InDet::PixelClusterOnTrackTool::m_applyNNcorrectionProperty
BooleanProperty m_applyNNcorrectionProperty
Enable NN based calibration (do only if NN calibration is applied)
Definition: PixelClusterOnTrackTool.h:167
ReadCondHandleKey.h
Trk::PrepRawData
Definition: PrepRawData.h:62
InDet::PIXELCLUSTER_OUTLIER
@ PIXELCLUSTER_OUTLIER
Definition: PixelClusterOnTrackTool.h:56
InDet::PixelClusterOnTrackTool::m_calerrphi
double m_calerrphi[s_nbinphi][3]
Definition: PixelClusterOnTrackTool.h:194
InDet::PixelClusterOnTrackTool::PixelClusterOnTrackTool
PixelClusterOnTrackTool(const std::string &, const std::string &, const IInterface *)
AlgTool constructor.
Definition: PixelClusterOnTrackTool.cxx:58
InDet::PixelCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:49
SG::ReadCondHandleKey< PixelDistortionData >
InDet::PixelClusterOnTrackTool::correctBow
void correctBow(const Identifier &, Amg::Vector2D &locpos, const double tanphi, const double taneta, const EventContext &ctx) const
Definition: PixelClusterOnTrackTool.cxx:516
InDet::PixelClusterOnTrackTool::getErrorsTIDE_Ambi
bool getErrorsTIDE_Ambi(const InDet::PixelCluster *, const Trk::TrackParameters &, Amg::Vector2D &, Amg::MatrixX &) const
Definition: PixelClusterOnTrackTool.cxx:807
PixelRIO_OnTrackErrorScaling.h
InDet::PixelClusterOnTrack
Definition: PixelClusterOnTrack.h:51
InDet::PixelClusterOnTrackTool::correctNN
InDet::PixelClusterOnTrack * correctNN(const Trk::PrepRawData &, const Trk::TrackParameters &, const EventContext &ctx) const
Definition: PixelClusterOnTrackTool.cxx:548
InDet::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: PixelClusterOnTrackTool.cxx:141
ClusterSplitProbabilityContainer.h
InDet::PixelClusterOnTrackTool::~PixelClusterOnTrackTool
virtual ~PixelClusterOnTrackTool()
InDet::PixelClusterOnTrackTool::m_calerreta
double m_calerreta[s_nbineta][3]
Definition: PixelClusterOnTrackTool.h:195
InDet::PixelClusterOnTrackTool::s_nbineta
static constexpr int s_nbineta
Definition: PixelClusterOnTrackTool.h:191
Trk::ClusterSplitProbabilityContainer::splitProbability
const ProbabilityInfo & splitProbability(const PrepRawData *cluster) const
Definition: ClusterSplitProbabilityContainer.h:35
InDet::PixelClusterOnTrackTool::m_applyNNcorrection
bool m_applyNNcorrection
Definition: PixelClusterOnTrackTool.h:168
AthAlgTool
Definition: AthAlgTool.h:26
InDet::PIXELCLUSTER_SPLIT
@ PIXELCLUSTER_SPLIT
Definition: PixelClusterOnTrackTool.h:58
Trk::IRIO_OnTrackCreator
Interface class for transforming Trk::PrepRawData to Trk::RIO_OnTrack using a local track hypothesis.
Definition: IRIO_OnTrackCreator.h:33
InDet::PixelClusterOnTrackTool::m_pixelid
const PixelID * m_pixelid
Flag controlling how module distortions are taken into account:
Definition: PixelClusterOnTrackTool.h:164
pix
Definition: PixelMapping.cxx:16
PixelClusterOnTrack.h
PixelID
Definition: PixelID.h:67
InDet::PixelClusterOnTrackTool::getErrorsDefaultAmbi
bool getErrorsDefaultAmbi(const InDet::PixelCluster *, const Trk::TrackParameters &, Amg::Vector2D &, Amg::MatrixX &) const
Definition: PixelClusterOnTrackTool.cxx:659
InDet::PixelClusterOnTrackTool::correctDefault
InDet::PixelClusterOnTrack * correctDefault(const Trk::PrepRawData &, const Trk::TrackParameters &, const EventContext &ctx) const
The correct method produces a PixelClusterOnTrack using the measured PixelCluster and the track predi...
Definition: PixelClusterOnTrackTool.cxx:179
InDet::PixelClusterOnTrackTool::m_etax
double m_etax[s_nbineta+1]
Definition: PixelClusterOnTrackTool.h:197
InDet::PixelClusterOnTrackTool::m_positionStrategy
IntegerProperty m_positionStrategy
Definition: PixelClusterOnTrackTool.h:144
Trk::ClusterSplitProbabilityContainer::getNoSplitProbability
static const ProbabilityInfo & getNoSplitProbability()
Definition: ClusterSplitProbabilityContainer.h:33
InDet::PixelClusterOnTrackTool::m_noNNandBroadErrors
BooleanProperty m_noNNandBroadErrors
Definition: PixelClusterOnTrackTool.h:180
ServiceHandle< IIBLParameterSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14