ATLAS Offline Software
InDetTestPixelLayerTool.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 InDetTestPixelLayerTool_H
6 #define InDetTestPixelLayerTool_H
7 
11 
15 
17 
19 
22 
23 #include "GaudiKernel/ServiceHandle.h"
24 #include "GaudiKernel/ToolHandle.h"
25 #include "GaudiKernel/ThreadLocalContext.h" //for Gaudi::Hive::currentContext()
26 
27 #include <mutex>
28 #include <string>
29 #include <vector>
30 
31 namespace Trk {
32 class Track;
33 class IExtrapolator;
34 class TrackParticleBase;
35 }
36 namespace Rec {
37 class TrackParticle;
38 }
39 class AtlasDetectorID;
40 class Identifier;
41 class PixelID;
42 class EventContext;
43 
44 namespace InDet {
45 
47  : virtual public IInDetTestPixelLayerTool
48  , public AthAlgTool
49 {
50 
51 public:
52  InDetTestPixelLayerTool(const std::string& name,
53  const std::string& n,
54  const IInterface* p);
55 
56  virtual StatusCode initialize() override final;
57 
58  // bool expectHitInPixelLayer(const Rec::TrackParticle*) const ;
59  virtual bool expectHitInPixelLayer(
60  const EventContext& ctx,
62  int pixel_layer) const override final;
63  virtual bool expectHitInPixelLayer(
64  const EventContext& ctx,
65  const Trk::Track*,
66  int pixel_layer,
67  bool checkBarrelOnly = false) const override final;
68  virtual bool expectHitInPixelLayer(const EventContext& ctx,
69  const Trk::TrackParameters* trackpar,
70  int pixel_layer,
71  bool checkBarrelOnly = false) const override final;
72 
73  virtual bool expectHit(
74  const Trk::TrackParameters* trackpar) const override final;
75 
77  virtual bool getTrackStateOnPixelLayerInfo(
79  std::vector<TrackStateOnPixelLayerInfo>& infoList) const override final;
80  virtual bool getTrackStateOnPixelLayerInfo(
81  const Trk::Track*,
82  std::vector<TrackStateOnPixelLayerInfo>& infoList) const override final;
83  virtual bool getTrackStateOnPixelLayerInfo(
84  const Trk::TrackParameters* trackpar,
85  std::vector<TrackStateOnPixelLayerInfo>& infoList,
86  int pixel_layer = -1,
87  bool checkBarrelOnly = false) const override final;
88 
89  virtual double getFracGood(const Trk::TrackParticleBase* trackpar,
90  int pixel_layer) const override final;
91  virtual double getFracGood(const Trk::TrackParameters* trackpar,
92  int pixel_layer) const override final;
93 
94 private:
95 
96  bool isActive(const Trk::TrackParameters* trackpar) const;
98  const EventContext& ctx,
99  const Trk::TrackParameters* trackpar,
100  std::vector<std::unique_ptr<const Trk::TrackParameters>>& pixelLayerParam)
101  const;
103  const Trk::TrackParameters* trackpar,
104  std::vector<std::unique_ptr<const Trk::TrackParameters>>& pixelLayerParam)
105  const
106  {
108  Gaudi::Hive::currentContext(), trackpar, pixelLayerParam);
109  }
110 
111  double getFracGood(const Trk::TrackParameters* trackpar,
112  double phiRegionSize,
113  double etaRegionSize,
114  const InDet::SiDetectorElementStatus *pixelDetElStatus) const;
115 
117 
119  ToolHandle<Trk::IExtrapolator> m_extrapolator{
120  this,
121  "Extrapolator",
122  "Trk::Extrapolator/InDetExtrapolator",
123  "Extrapolator used to extrapolate to layers"
124  };
125 
127  ToolHandle<IInDetConditionsTool> m_pixelCondSummaryTool{
128  this,
129  "PixelSummaryTool",
130  "PixelConditionsSummaryTool/InDetPixelConditionsSummaryTool",
131  "Tool to retrieve Pixel Conditions summary"
132  };
133 
138  {this, "PixelDetElStatus", "", "Key of SiDetectorElementStatus for Pixel"};
139 
141  {this, "PixelReadoutManager", "PixelReadoutManager", "Pixel readout manager" };
142 
145 
148 
149  BooleanProperty m_checkActiveAreas{this, "CheckActiveAreas", false};
150  BooleanProperty m_checkDeadRegions{this, "CheckDeadRegions", false};
151  BooleanProperty m_checkDisabledFEs{this, "CheckDisabledFEs", false};
152  DoubleProperty m_phiRegionSize{this, "PhiRegionSize", 3.};
153  DoubleProperty m_etaRegionSize{this, "EtaRegionSize", 3.};
154  DoubleProperty m_goodFracCut{this, "GoodFracCut", 0.5};
155  DoubleProperty m_outerRadius{this, "OuterRadius", 230.};
156 };
157 
158 
161  if (!m_pixelDetElStatus.empty()) {
163  if (!pixelDetElStatus.isValid()) {
164  std::stringstream msg;
165  msg << "Failed to get " << m_pixelDetElStatus.key() << " from StoreGate in " << name();
166  throw std::runtime_error(msg.str());
167  }
168  }
169  return pixelDetElStatus;
170 }
171 
172 } // end namespace
173 
174 #endif
InDet::InDetTestPixelLayerTool::m_pixelId
const PixelID * m_pixelId
ID pixel helper.
Definition: InDetTestPixelLayerTool.h:147
IInDetConditionsTool.h
TrackParameters.h
InDet::InDetTestPixelLayerTool::m_goodFracCut
DoubleProperty m_goodFracCut
Definition: InDetTestPixelLayerTool.h:154
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
SiDetectorElementStatus.h
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::InDetTestPixelLayerTool::getPixelLayerParameters
bool getPixelLayerParameters(const EventContext &ctx, const Trk::TrackParameters *trackpar, std::vector< std::unique_ptr< const Trk::TrackParameters >> &pixelLayerParam) const
Definition: InDetTestPixelLayerTool.cxx:544
InDet::InDetTestPixelLayerTool::m_checkDeadRegions
BooleanProperty m_checkDeadRegions
Definition: InDetTestPixelLayerTool.h:150
InDet::InDetTestPixelLayerTool::getPixelDetElStatus
SG::ReadHandle< InDet::SiDetectorElementStatus > getPixelDetElStatus(const EventContext &ctx) const
Definition: InDetTestPixelLayerTool.h:159
IExtrapolator.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::SiDetectorElementStatus >
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
InDet::InDetTestPixelLayerTool::m_pixelCondSummaryTool
ToolHandle< IInDetConditionsTool > m_pixelCondSummaryTool
Handles to IConditionsSummaryServices for Pixels.
Definition: InDetTestPixelLayerTool.h:127
InDet::InDetTestPixelLayerTool::m_etaRegionSize
DoubleProperty m_etaRegionSize
Definition: InDetTestPixelLayerTool.h:153
InDet::InDetTestPixelLayerTool::getTrackStateOnPixelLayerInfo
virtual bool getTrackStateOnPixelLayerInfo(const Trk::TrackParticleBase *, std::vector< TrackStateOnPixelLayerInfo > &infoList) const override final
Definition: InDetTestPixelLayerTool.cxx:399
InDet::InDetTestPixelLayerTool::m_checkDisabledFEs
BooleanProperty m_checkDisabledFEs
Definition: InDetTestPixelLayerTool.h:151
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
Trk::TrackParticleBase
Definition: TrackParticleBase.h:41
InDet::InDetTestPixelLayerTool::m_phiRegionSize
DoubleProperty m_phiRegionSize
Definition: InDetTestPixelLayerTool.h:152
IInDetTestPixelLayerTool.h
InDet::InDetTestPixelLayerTool::initialize
virtual StatusCode initialize() override final
Definition: InDetTestPixelLayerTool.cxx:41
InDet::InDetTestPixelLayerTool::getFracGood
virtual double getFracGood(const Trk::TrackParticleBase *trackpar, int pixel_layer) const override final
Definition: InDetTestPixelLayerTool.cxx:247
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ResidualPull.h
InDet::SiDetectorElementStatus
Definition: SiDetectorElementStatus.h:62
Rec
Name: MuonSpContainer.h Package : offline/Reconstruction/MuonIdentification/muonEvent.
Definition: FakeTrackBuilder.h:10
beamspotman.n
n
Definition: beamspotman.py:731
TrackStateOnPixelLayerInfo.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
InDet::InDetTestPixelLayerTool
Definition: InDetTestPixelLayerTool.h:49
Trk::ParametersBase
Definition: ParametersBase.h:55
InDet::InDetTestPixelLayerTool::expectHitInPixelLayer
virtual bool expectHitInPixelLayer(const EventContext &ctx, const Trk::TrackParticleBase *, int pixel_layer) const override final
Definition: InDetTestPixelLayerTool.cxx:91
InDet::InDetTestPixelLayerTool::expectHit
virtual bool expectHit(const Trk::TrackParameters *trackpar) const override final
Definition: InDetTestPixelLayerTool.cxx:202
IPixelReadoutManager.h
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
InDet::InDetTestPixelLayerTool::m_pixelDetElStatus
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatus
Optional read handle to get status data to test whether a pixel detector element is good.
Definition: InDetTestPixelLayerTool.h:138
InDet::InDetTestPixelLayerTool::getPixelLayerParameters
bool getPixelLayerParameters(const Trk::TrackParameters *trackpar, std::vector< std::unique_ptr< const Trk::TrackParameters >> &pixelLayerParam) const
Definition: InDetTestPixelLayerTool.h:102
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
InDet::IInDetTestPixelLayerTool
Definition: IInDetTestPixelLayerTool.h:29
InDet::InDetTestPixelLayerTool::m_pixelReadout
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
Definition: InDetTestPixelLayerTool.h:141
InDet::InDetTestPixelLayerTool::m_idHelper
const AtlasDetectorID * m_idHelper
detector helper
Definition: InDetTestPixelLayerTool.h:144
InDet::InDetTestPixelLayerTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Pointer to Extrapolator AlgTool.
Definition: InDetTestPixelLayerTool.h:119
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
InDet::InDetTestPixelLayerTool::m_checkActiveAreas
BooleanProperty m_checkActiveAreas
Definition: InDetTestPixelLayerTool.h:149
InDet::InDetTestPixelLayerTool::isActive
bool isActive(const Trk::TrackParameters *trackpar) const
Definition: InDetTestPixelLayerTool.cxx:331
SlotSpecificObj.h
Maintain a set of objects, one per slot.
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
InDet::InDetTestPixelLayerTool::m_outerRadius
DoubleProperty m_outerRadius
Definition: InDetTestPixelLayerTool.h:155
AthAlgTool
Definition: AthAlgTool.h:26
InDet::InDetTestPixelLayerTool::InDetTestPixelLayerTool
InDetTestPixelLayerTool(const std::string &name, const std::string &n, const IInterface *p)
Definition: InDetTestPixelLayerTool.cxx:30
PixelID
Definition: PixelID.h:67
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
ServiceHandle< InDetDD::IPixelReadoutManager >
Identifier
Definition: IdentifierFieldParser.cxx:14