ATLAS Offline Software
InDetPhysHitDecoratorAlg.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 INDETPHYSVALMONITORING_InDetPhysHitDecoratorAlg_H
6 #define INDETPHYSVALMONITORING_InDetPhysHitDecoratorAlg_H
7 
13 // STL includes
14 #include <mutex>
15 #include <string>
17 #include "GaudiKernel/ToolHandle.h"
20 #include "GaudiKernel/EventContext.h"
25 
26 class Identifier;
27 class AtlasDetectorID;
28 class PixelID;
29 class SCT_ID;
30 class TRT_ID;
31 
32 // class to decorate xAOD::TruthParticles with additional information required by validation
34 public:
35  // L0PIXBARR : layer0 of pixel barrel (IBL in Run2)
36  // PIXEL : in barrel all layers appart from layer0. In end-caps all disks/rings.
37  enum Subdetector {
39  };
40  enum Region {
42  };
43  InDetPhysHitDecoratorAlg(const std::string& name, ISvcLocator* pSvcLocator);
44  virtual
46  virtual StatusCode initialize() override;
47  virtual StatusCode finalize() override;
48  virtual StatusCode execute(const EventContext &ctx) const override;
49 
50 private:
51  bool
53  std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,std::vector<float> > > &float_decor,
54  std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,std::vector<int> > > &int_decor,
55  std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,std::vector<uint64_t> > > &uint64_decor) const;
56 
57  ToolHandle<Trk::ITrackHoleSearchTool> m_holeSearchTool
58  {this, "InDetTrackHoleSearchTool", "InDet::InDetTrackHoleSearchTool"};
59  ToolHandle<Trk::IUpdator> m_updatorHandle
60  {this, "Updator", "Trk::KalmanUpdator/TrkKalmanUpdator",
61  "Tool handle of updator for unbiased states"};
62  ToolHandle<Trk::IResidualPullCalculator> m_residualPullCalculator
63  {this, "ResidualPullCalculator",
64  "Trk::ResidualPullCalculator/ResidualPullCalculator"};
65  ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool{this, "LorentzAngleTool", "SiLorentzAngleTool", "Tool to retrieve Lorentz angle"};
66 
75  };
79  };
80  enum EDecorations {
94  };
95  // need tracks particle key, to compose decoration keys
97  {this,"TrackParticleContainerName", "InDetTrackParticles",""};
98 
99  std::vector<SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> > m_intDecor;
100  std::vector<SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> > m_uint64Decor;
101  std::vector<SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> > m_floatDecor;
102 
103  Gaudi::Property<std::string> m_prefix
104  {this, "Prefix", "", "Decoration prefix to avoid clashes."};
105 
106  mutable std::atomic<bool> m_alreadyWarned{false};
107  // the following help identify a surface in the detector
108  const AtlasDetectorID* m_idHelper{nullptr};
109  const PixelID* m_pixelID{nullptr};
110  const SCT_ID* m_sctID{nullptr};
111  const TRT_ID* m_trtID{nullptr};
112 
113  // private member functions
114  bool decideDetectorRegion(const Identifier& id, Subdetector& det, Region& r, int& layer) const;
115  const Trk::TrackParameters*
117  const Trk::MeasurementBase* measurement,
118  bool &isUnbiased) const;
119 };
120 
121 #endif
InDetPhysHitDecoratorAlg::kDecorResidualLocX
@ kDecorResidualLocX
Definition: InDetPhysHitDecoratorAlg.h:81
beamspotman.r
def r
Definition: beamspotman.py:676
InDetPhysHitDecoratorAlg::m_holeSearchTool
ToolHandle< Trk::ITrackHoleSearchTool > m_holeSearchTool
Definition: InDetPhysHitDecoratorAlg.h:58
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
InDetPhysHitDecoratorAlg::N_SUBDETECTORS
@ N_SUBDETECTORS
Definition: InDetPhysHitDecoratorAlg.h:38
InDetPhysHitDecoratorAlg::kDecorMeasLocY
@ kDecorMeasLocY
Definition: InDetPhysHitDecoratorAlg.h:88
InDetPhysHitDecoratorAlg::finalize
virtual StatusCode finalize() override
Definition: InDetPhysHitDecoratorAlg.cxx:98
InDetPhysHitDecoratorAlg::kDecorILayer
@ kDecorILayer
Definition: InDetPhysHitDecoratorAlg.h:70
InDetPhysHitDecoratorAlg::~InDetPhysHitDecoratorAlg
virtual ~InDetPhysHitDecoratorAlg()
Definition: InDetPhysHitDecoratorAlg.cxx:30
TRTCalib_Extractor.det
det
Definition: TRTCalib_Extractor.py:36
InDetPhysHitDecoratorAlg::m_residualPullCalculator
ToolHandle< Trk::IResidualPullCalculator > m_residualPullCalculator
Definition: InDetPhysHitDecoratorAlg.h:63
InDetPhysHitDecoratorAlg::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: InDetPhysHitDecoratorAlg.h:108
InDetPhysHitDecoratorAlg::kDecorPullLocY
@ kDecorPullLocY
Definition: InDetPhysHitDecoratorAlg.h:87
InDetPhysHitDecoratorAlg::kDecorTrkParamLocX
@ kDecorTrkParamLocX
Definition: InDetPhysHitDecoratorAlg.h:84
InDetPhysHitDecoratorAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: InDetPhysHitDecoratorAlg.cxx:104
ISiLorentzAngleTool.h
InDetPhysHitDecoratorAlg::INVALID_REGION
@ INVALID_REGION
Definition: InDetPhysHitDecoratorAlg.h:41
InDetPhysHitDecoratorAlg::Region
Region
Definition: InDetPhysHitDecoratorAlg.h:40
SG::ReadHandleKey< xAOD::TrackParticleContainer >
InDetPhysHitDecoratorAlg::m_updatorHandle
ToolHandle< Trk::IUpdator > m_updatorHandle
Definition: InDetPhysHitDecoratorAlg.h:60
InDetPhysHitDecoratorAlg::m_prefix
Gaudi::Property< std::string > m_prefix
Definition: InDetPhysHitDecoratorAlg.h:104
IUpdator.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
InDetPhysHitDecoratorAlg::SCT
@ SCT
Definition: InDetPhysHitDecoratorAlg.h:38
InDetPhysHitDecoratorAlg::kDecorPullLocX
@ kDecorPullLocX
Definition: InDetPhysHitDecoratorAlg.h:82
InDetPhysHitDecoratorAlg::kDecorMeasLocCovY
@ kDecorMeasLocCovY
Definition: InDetPhysHitDecoratorAlg.h:90
InDetPhysHitDecoratorAlg::kDecorType
@ kDecorType
Definition: InDetPhysHitDecoratorAlg.h:71
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDetPhysHitDecoratorAlg::TRT
@ TRT
Definition: InDetPhysHitDecoratorAlg.h:38
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
InDetPhysHitDecoratorAlg::Subdetector
Subdetector
Definition: InDetPhysHitDecoratorAlg.h:37
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
InDetPhysHitDecoratorAlg::initialize
virtual StatusCode initialize() override
Definition: InDetPhysHitDecoratorAlg.cxx:34
WriteDecorHandle.h
Handle class for adding a decoration to an object.
InDetPhysHitDecoratorAlg::m_trkParticleName
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trkParticleName
Definition: InDetPhysHitDecoratorAlg.h:97
InDetPhysHitDecoratorAlg::decorateTrack
bool decorateTrack(const xAOD::TrackParticle &particle, std::vector< SG::WriteDecorHandle< xAOD::TrackParticleContainer, std::vector< float > > > &float_decor, std::vector< SG::WriteDecorHandle< xAOD::TrackParticleContainer, std::vector< int > > > &int_decor, std::vector< SG::WriteDecorHandle< xAOD::TrackParticleContainer, std::vector< uint64_t > > > &uint64_decor) const
Definition: InDetPhysHitDecoratorAlg.cxx:128
Region
Region
Definition: TrigL2HitResidual.h:14
Trk::ParametersBase
Definition: ParametersBase.h:55
InDetPhysHitDecoratorAlg::kDecorAngle
@ kDecorAngle
Definition: InDetPhysHitDecoratorAlg.h:91
InDetPhysHitDecoratorAlg::getUnbiasedTrackParameters
const Trk::TrackParameters * getUnbiasedTrackParameters(const Trk::TrackParameters *trkParameters, const Trk::MeasurementBase *measurement, bool &isUnbiased) const
Definition: InDetPhysHitDecoratorAlg.cxx:481
InDetPhysHitDecoratorAlg::kDecorTrkParamLocY
@ kDecorTrkParamLocY
Definition: InDetPhysHitDecoratorAlg.h:89
InDetPhysHitDecoratorAlg::EDecorations
EDecorations
Definition: InDetPhysHitDecoratorAlg.h:80
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
InDetPhysHitDecoratorAlg::m_floatDecor
std::vector< SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > > m_floatDecor
Definition: InDetPhysHitDecoratorAlg.h:101
AthReentrantAlgorithm.h
Trk::MeasurementBase
Definition: MeasurementBase.h:58
InDetPhysHitDecoratorAlg::kDecorEtaLoc
@ kDecorEtaLoc
Definition: InDetPhysHitDecoratorAlg.h:92
ITrackHoleSearchTool.h
InDetPhysHitDecoratorAlg::L0PIXBARR
@ L0PIXBARR
Definition: InDetPhysHitDecoratorAlg.h:38
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
InDetPhysHitDecoratorAlg::kDecorDet
@ kDecorDet
Definition: InDetPhysHitDecoratorAlg.h:69
InDetPhysHitDecoratorAlg::m_trtID
const TRT_ID * m_trtID
Definition: InDetPhysHitDecoratorAlg.h:111
InDetPhysHitDecoratorAlg::m_alreadyWarned
std::atomic< bool > m_alreadyWarned
Definition: InDetPhysHitDecoratorAlg.h:106
InDetPhysHitDecoratorAlg::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: InDetPhysHitDecoratorAlg.h:65
InDetPhysHitDecoratorAlg::kDecorEtaWidth
@ kDecorEtaWidth
Definition: InDetPhysHitDecoratorAlg.h:73
InDetPhysHitDecoratorAlg::InDetPhysHitDecoratorAlg
InDetPhysHitDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: InDetPhysHitDecoratorAlg.cxx:27
IResidualPullCalculator.h
TRT_ID
Definition: TRT_ID.h:84
SCT_ID
Definition: SCT_ID.h:68
InDetPhysHitDecoratorAlg::kDecorResidualLocY
@ kDecorResidualLocY
Definition: InDetPhysHitDecoratorAlg.h:86
InDetPhysHitDecoratorAlg::BARREL
@ BARREL
Definition: InDetPhysHitDecoratorAlg.h:41
InDetPhysHitDecoratorAlg::m_pixelID
const PixelID * m_pixelID
Definition: InDetPhysHitDecoratorAlg.h:109
InDetPhysHitDecoratorAlg::kNIntDecorators
@ kNIntDecorators
Definition: InDetPhysHitDecoratorAlg.h:74
InDetPhysHitDecoratorAlg::decideDetectorRegion
bool decideDetectorRegion(const Identifier &id, Subdetector &det, Region &r, int &layer) const
Definition: InDetPhysHitDecoratorAlg.cxx:448
InDetPhysHitDecoratorAlg::PIXEL
@ PIXEL
Definition: InDetPhysHitDecoratorAlg.h:38
InDetPhysHitDecoratorAlg::m_sctID
const SCT_ID * m_sctID
Definition: InDetPhysHitDecoratorAlg.h:110
InDetPhysHitDecoratorAlg::m_intDecor
std::vector< SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > > m_intDecor
Definition: InDetPhysHitDecoratorAlg.h:99
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
InDetPhysHitDecoratorAlg::kDecorPhiWidth
@ kDecorPhiWidth
Definition: InDetPhysHitDecoratorAlg.h:72
InDetPhysHitDecoratorAlg::EIntDecorations
EIntDecorations
Definition: InDetPhysHitDecoratorAlg.h:67
InDetPhysHitDecoratorAlg
Definition: InDetPhysHitDecoratorAlg.h:33
InDetPhysHitDecoratorAlg::kNUInt64Decorators
@ kNUInt64Decorators
Definition: InDetPhysHitDecoratorAlg.h:78
InDetPhysHitDecoratorAlg::ENDCAP
@ ENDCAP
Definition: InDetPhysHitDecoratorAlg.h:41
InDetPhysHitDecoratorAlg::kNFloatDecorators
@ kNFloatDecorators
Definition: InDetPhysHitDecoratorAlg.h:93
PixelID
Definition: PixelID.h:67
InDetPhysHitDecoratorAlg::EUInt64Decorations
EUInt64Decorations
Definition: InDetPhysHitDecoratorAlg.h:76
InDetPhysHitDecoratorAlg::kDecorID
@ kDecorID
Definition: InDetPhysHitDecoratorAlg.h:77
InDetPhysHitDecoratorAlg::m_uint64Decor
std::vector< SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > > m_uint64Decor
Definition: InDetPhysHitDecoratorAlg.h:100
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
TrackParticleContainer.h
InDetPhysHitDecoratorAlg::INVALID_DETECTOR
@ INVALID_DETECTOR
Definition: InDetPhysHitDecoratorAlg.h:38
InDetPhysHitDecoratorAlg::kDecorMeasLocCovX
@ kDecorMeasLocCovX
Definition: InDetPhysHitDecoratorAlg.h:85
InDetPhysHitDecoratorAlg::kDecorMeasLocX
@ kDecorMeasLocX
Definition: InDetPhysHitDecoratorAlg.h:83
Identifier
Definition: IdentifierFieldParser.cxx:14
InDetPhysHitDecoratorAlg::kDecorRegion
@ kDecorRegion
Definition: InDetPhysHitDecoratorAlg.h:68