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 
21 
22 #include "GaudiKernel/ServiceHandle.h"
23 #include "GaudiKernel/ToolHandle.h"
24 #include "GaudiKernel/ThreadLocalContext.h" //for Gaudi::Hive::currentContext()
25 
26 #include <mutex>
27 #include <string>
28 #include <vector>
29 
30 namespace Trk {
31 class Track;
32 class IExtrapolator;
33 class TrackParticleBase;
34 }
35 namespace Rec {
36 class TrackParticle;
37 }
38 class AtlasDetectorID;
39 class Identifier;
40 class PixelID;
41 class EventContext;
42 
43 namespace InDet {
44 
46  : virtual public IInDetTestPixelLayerTool
47  , public AthAlgTool
48 {
49 
50 public:
51  InDetTestPixelLayerTool(const std::string& name,
52  const std::string& n,
53  const IInterface* p);
54 
55  virtual StatusCode initialize() override final;
56 
57  // bool expectHitInPixelLayer(const Rec::TrackParticle*) const ;
58  virtual bool expectHitInPixelLayer(
59  const EventContext& ctx,
61  int pixel_layer) const override final;
62  virtual bool expectHitInPixelLayer(
63  const EventContext& ctx,
64  const Trk::Track*,
65  int pixel_layer,
66  bool checkBarrelOnly = false) const override final;
67  virtual bool expectHitInPixelLayer(const EventContext& ctx,
68  const Trk::TrackParameters* trackpar,
69  int pixel_layer,
70  bool checkBarrelOnly = false) const override final;
71 
72  virtual bool expectHit(
73  const Trk::TrackParameters* trackpar) const override final;
74 
76  virtual bool getTrackStateOnPixelLayerInfo(
78  std::vector<TrackStateOnPixelLayerInfo>& infoList) const override final;
79  virtual bool getTrackStateOnPixelLayerInfo(
80  const Trk::Track*,
81  std::vector<TrackStateOnPixelLayerInfo>& infoList) const override final;
82  virtual bool getTrackStateOnPixelLayerInfo(
83  const Trk::TrackParameters* trackpar,
84  std::vector<TrackStateOnPixelLayerInfo>& infoList,
85  int pixel_layer = -1,
86  bool checkBarrelOnly = false) const override final;
87 
88  virtual double getFracGood(const Trk::TrackParticleBase* trackpar,
89  int pixel_layer) const override final;
90  virtual double getFracGood(const Trk::TrackParameters* trackpar,
91  int pixel_layer) const override final;
92 
93 private:
94 
95  bool isActive(const Trk::TrackParameters* trackpar) const;
97  const EventContext& ctx,
98  const Trk::TrackParameters* trackpar,
99  std::vector<std::unique_ptr<const Trk::TrackParameters>>& pixelLayerParam)
100  const;
102  const Trk::TrackParameters* trackpar,
103  std::vector<std::unique_ptr<const Trk::TrackParameters>>& pixelLayerParam)
104  const
105  {
107  Gaudi::Hive::currentContext(), trackpar, pixelLayerParam);
108  }
109 
110  double getFracGood(const Trk::TrackParameters* trackpar,
111  double phiRegionSize,
112  double etaRegionSize,
113  const InDet::SiDetectorElementStatus *pixelDetElStatus) const;
114 
116 
118  ToolHandle<Trk::IExtrapolator> m_extrapolator{
119  this,
120  "Extrapolator",
121  "Trk::Extrapolator/InDetExtrapolator",
122  "Extrapolator used to extrapolate to layers"
123  };
124 
126  ToolHandle<IInDetConditionsTool> m_pixelCondSummaryTool{
127  this,
128  "PixelSummaryTool",
129  "PixelConditionsSummaryTool/InDetPixelConditionsSummaryTool",
130  "Tool to retrieve Pixel Conditions summary"
131  };
132 
137  {this, "PixelDetElStatus", "", "Key of SiDetectorElementStatus for Pixel"};
138 
141 
144 
145  BooleanProperty m_checkActiveAreas{this, "CheckActiveAreas", true};
146  BooleanProperty m_checkDeadRegions{this, "CheckDeadRegions", true};
147  BooleanProperty m_checkDisabledFEs{this, "CheckDisabledFEs", true};
148  DoubleProperty m_phiRegionSize{this, "PhiRegionSize", 3.};
149  DoubleProperty m_etaRegionSize{this, "EtaRegionSize", 3.};
150  DoubleProperty m_goodFracCut{this, "GoodFracCut", 0.5};
151  DoubleProperty m_outerRadius{this, "OuterRadius", 230.};
152 };
153 
154 
157  if (!m_pixelDetElStatus.empty()) {
159  if (!pixelDetElStatus.isValid()) {
160  std::stringstream msg;
161  msg << "Failed to get " << m_pixelDetElStatus.key() << " from StoreGate in " << name();
162  throw std::runtime_error(msg.str());
163  }
164  }
165  return pixelDetElStatus;
166 }
167 
168 } // end namespace
169 
170 #endif
InDet::InDetTestPixelLayerTool::m_pixelId
const PixelID * m_pixelId
ID pixel helper.
Definition: InDetTestPixelLayerTool.h:143
IInDetConditionsTool.h
TrackParameters.h
InDet::InDetTestPixelLayerTool::m_goodFracCut
DoubleProperty m_goodFracCut
Definition: InDetTestPixelLayerTool.h:150
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
SiDetectorElementStatus.h
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
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:541
InDet::InDetTestPixelLayerTool::m_checkDeadRegions
BooleanProperty m_checkDeadRegions
Definition: InDetTestPixelLayerTool.h:146
InDet::InDetTestPixelLayerTool::getPixelDetElStatus
SG::ReadHandle< InDet::SiDetectorElementStatus > getPixelDetElStatus(const EventContext &ctx) const
Definition: InDetTestPixelLayerTool.h:155
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:126
InDet::InDetTestPixelLayerTool::m_etaRegionSize
DoubleProperty m_etaRegionSize
Definition: InDetTestPixelLayerTool.h:149
InDet::InDetTestPixelLayerTool::getTrackStateOnPixelLayerInfo
virtual bool getTrackStateOnPixelLayerInfo(const Trk::TrackParticleBase *, std::vector< TrackStateOnPixelLayerInfo > &infoList) const override final
Definition: InDetTestPixelLayerTool.cxx:396
InDet::InDetTestPixelLayerTool::m_checkDisabledFEs
BooleanProperty m_checkDisabledFEs
Definition: InDetTestPixelLayerTool.h:147
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:148
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:244
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
ResidualPull.h
InDet::SiDetectorElementStatus
Definition: SiDetectorElementStatus.h:62
Rec
Gaudi Tools.
Definition: FakeTrackBuilder.h:10
beamspotman.n
n
Definition: beamspotman.py:727
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:48
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:88
InDet::InDetTestPixelLayerTool::expectHit
virtual bool expectHit(const Trk::TrackParameters *trackpar) const override final
Definition: InDetTestPixelLayerTool.cxx:199
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:137
InDet::InDetTestPixelLayerTool::getPixelLayerParameters
bool getPixelLayerParameters(const Trk::TrackParameters *trackpar, std::vector< std::unique_ptr< const Trk::TrackParameters >> &pixelLayerParam) const
Definition: InDetTestPixelLayerTool.h:101
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
InDet::IInDetTestPixelLayerTool
Definition: IInDetTestPixelLayerTool.h:29
InDet::InDetTestPixelLayerTool::m_idHelper
const AtlasDetectorID * m_idHelper
detector helper
Definition: InDetTestPixelLayerTool.h:140
InDet::InDetTestPixelLayerTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Pointer to Extrapolator AlgTool.
Definition: InDetTestPixelLayerTool.h:118
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
InDet::InDetTestPixelLayerTool::m_checkActiveAreas
BooleanProperty m_checkActiveAreas
Definition: InDetTestPixelLayerTool.h:145
InDet::InDetTestPixelLayerTool::isActive
bool isActive(const Trk::TrackParameters *trackpar) const
Definition: InDetTestPixelLayerTool.cxx:328
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:151
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:52
Identifier
Definition: IdentifierFieldParser.cxx:14