ATLAS Offline Software
InDetPhysHitDecoratorAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 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"
22 
23 class Identifier;
24 class AtlasDetectorID;
25 class PixelID;
26 class SCT_ID;
27 class TRT_ID;
28 
29 namespace Trk {
30  class IUpdator;
31  class ITrackHoleSearchTool;
32  class IResidualPullCalculator;
33 }
34 
35 // class to decorate xAOD::TruthParticles with additional information required by validation
37 public:
38  // L0PIXBARR : layer0 of pixel barrel (IBL in Run2)
39  // PIXEL : in barrel all layers appart from layer0. In end-caps all disks/rings.
40  enum Subdetector {
42  };
43  enum Region {
45  };
46  InDetPhysHitDecoratorAlg(const std::string& name, ISvcLocator* pSvcLocator);
47  virtual
49  virtual StatusCode initialize() override;
50  virtual StatusCode finalize() override;
51  virtual StatusCode execute(const EventContext &ctx) const override;
52 
53 private:
54  bool
56  std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,std::vector<float> > > &float_decor,
57  std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,std::vector<int> > > &int_decor,
58  std::vector< SG::WriteDecorHandle<xAOD::TrackParticleContainer,std::vector<uint64_t> > > &uint64_decor) const;
59 
60  ToolHandle<Trk::ITrackHoleSearchTool> m_holeSearchTool;
61  ToolHandle<Trk::IUpdator> m_updatorHandle; // !< Tool handle of updator for unbiased states
62  ToolHandle<Trk::IResidualPullCalculator> m_residualPullCalculator; // !< The residual and pull calculator tool
63  // handle
64  ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool{this, "LorentzAngleTool", "SiLorentzAngleTool", "Tool to retrieve Lorentz angle"};
65 
74  };
78  };
79  enum EDecorations {
93  };
94  // need tracks particle key, to compose decoration keys
96  {this,"TrackParticleContainerName", "InDetTrackParticles",""};
97 
98  std::vector<SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> > m_intDecor;
99  std::vector<SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> > m_uint64Decor;
100  std::vector<SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> > m_floatDecor;
101 
102  Gaudi::Property<std::string> m_prefix
103  {this, "Prefix", "", "Decoration prefix to avoid clashes."};
104 
105  const double m_ptThreshold;
107  mutable std::atomic<bool> m_alreadyWarned{false};
108  // the following help identify a surface in the detector
111  const SCT_ID* m_sctID;
112  const TRT_ID* m_trtID;
113 
114  // private member functions
115  bool decideDetectorRegion(const Identifier& id, Subdetector& det, Region& r, int& layer) const;
116  const Trk::TrackParameters*
118  const Trk::MeasurementBase* measurement,
119  bool &isUnbiased) const;
120 };
121 
122 #endif
InDetPhysHitDecoratorAlg::kDecorResidualLocX
@ kDecorResidualLocX
Definition: InDetPhysHitDecoratorAlg.h:80
beamspotman.r
def r
Definition: beamspotman.py:676
InDetPhysHitDecoratorAlg::m_holeSearchTool
ToolHandle< Trk::ITrackHoleSearchTool > m_holeSearchTool
Definition: InDetPhysHitDecoratorAlg.h:60
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
InDetPhysHitDecoratorAlg::N_SUBDETECTORS
@ N_SUBDETECTORS
Definition: InDetPhysHitDecoratorAlg.h:41
InDetPhysHitDecoratorAlg::kDecorMeasLocY
@ kDecorMeasLocY
Definition: InDetPhysHitDecoratorAlg.h:87
InDetPhysHitDecoratorAlg::finalize
virtual StatusCode finalize() override
Definition: InDetPhysHitDecoratorAlg.cxx:120
InDetPhysHitDecoratorAlg::kDecorILayer
@ kDecorILayer
Definition: InDetPhysHitDecoratorAlg.h:69
InDetPhysHitDecoratorAlg::~InDetPhysHitDecoratorAlg
virtual ~InDetPhysHitDecoratorAlg()
Definition: InDetPhysHitDecoratorAlg.cxx:46
InDetPhysHitDecoratorAlg::m_residualPullCalculator
ToolHandle< Trk::IResidualPullCalculator > m_residualPullCalculator
Definition: InDetPhysHitDecoratorAlg.h:62
InDetPhysHitDecoratorAlg::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: InDetPhysHitDecoratorAlg.h:109
InDetPhysHitDecoratorAlg::kDecorPullLocY
@ kDecorPullLocY
Definition: InDetPhysHitDecoratorAlg.h:86
InDetPhysHitDecoratorAlg::kDecorTrkParamLocX
@ kDecorTrkParamLocX
Definition: InDetPhysHitDecoratorAlg.h:83
InDetPhysHitDecoratorAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: InDetPhysHitDecoratorAlg.cxx:126
ISiLorentzAngleTool.h
InDetPhysHitDecoratorAlg::INVALID_REGION
@ INVALID_REGION
Definition: InDetPhysHitDecoratorAlg.h:44
InDetPhysHitDecoratorAlg::Region
Region
Definition: InDetPhysHitDecoratorAlg.h:43
SG::ReadHandleKey< xAOD::TrackParticleContainer >
InDetPhysHitDecoratorAlg::m_updatorHandle
ToolHandle< Trk::IUpdator > m_updatorHandle
Definition: InDetPhysHitDecoratorAlg.h:61
InDetPhysHitDecoratorAlg::m_prefix
Gaudi::Property< std::string > m_prefix
Definition: InDetPhysHitDecoratorAlg.h:103
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
InDetPhysHitDecoratorAlg::SCT
@ SCT
Definition: InDetPhysHitDecoratorAlg.h:41
InDetPhysHitDecoratorAlg::kDecorPullLocX
@ kDecorPullLocX
Definition: InDetPhysHitDecoratorAlg.h:81
InDetPhysHitDecoratorAlg::kDecorMeasLocCovY
@ kDecorMeasLocCovY
Definition: InDetPhysHitDecoratorAlg.h:89
InDetPhysHitDecoratorAlg::kDecorType
@ kDecorType
Definition: InDetPhysHitDecoratorAlg.h:70
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDetPhysHitDecoratorAlg::TRT
@ TRT
Definition: InDetPhysHitDecoratorAlg.h:41
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
InDetPhysHitDecoratorAlg::Subdetector
Subdetector
Definition: InDetPhysHitDecoratorAlg.h:40
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:99
WritePulseShapeToCool.det
det
Definition: WritePulseShapeToCool.py:204
InDetPhysHitDecoratorAlg::initialize
virtual StatusCode initialize() override
Definition: InDetPhysHitDecoratorAlg.cxx:51
WriteDecorHandle.h
Handle class for adding a decoration to an object.
InDetPhysHitDecoratorAlg::m_trkParticleName
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trkParticleName
Definition: InDetPhysHitDecoratorAlg.h:96
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:150
Trk::ParametersBase
Definition: ParametersBase.h:55
InDetPhysHitDecoratorAlg::kDecorAngle
@ kDecorAngle
Definition: InDetPhysHitDecoratorAlg.h:90
InDetPhysHitDecoratorAlg::getUnbiasedTrackParameters
const Trk::TrackParameters * getUnbiasedTrackParameters(const Trk::TrackParameters *trkParameters, const Trk::MeasurementBase *measurement, bool &isUnbiased) const
Definition: InDetPhysHitDecoratorAlg.cxx:539
InDetPhysHitDecoratorAlg::kDecorTrkParamLocY
@ kDecorTrkParamLocY
Definition: InDetPhysHitDecoratorAlg.h:88
InDetPhysHitDecoratorAlg::EDecorations
EDecorations
Definition: InDetPhysHitDecoratorAlg.h:79
DataVector< xAOD::TrackParticle_v1 >
InDetPhysHitDecoratorAlg::m_floatDecor
std::vector< SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > > m_floatDecor
Definition: InDetPhysHitDecoratorAlg.h:100
AthReentrantAlgorithm.h
Trk::MeasurementBase
Definition: MeasurementBase.h:58
InDetPhysHitDecoratorAlg::kDecorEtaLoc
@ kDecorEtaLoc
Definition: InDetPhysHitDecoratorAlg.h:91
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
InDetPhysHitDecoratorAlg::L0PIXBARR
@ L0PIXBARR
Definition: InDetPhysHitDecoratorAlg.h:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
InDetPhysHitDecoratorAlg::kDecorDet
@ kDecorDet
Definition: InDetPhysHitDecoratorAlg.h:68
InDetPhysHitDecoratorAlg::m_trtID
const TRT_ID * m_trtID
Definition: InDetPhysHitDecoratorAlg.h:112
InDetPhysHitDecoratorAlg::m_alreadyWarned
std::atomic< bool > m_alreadyWarned
Definition: InDetPhysHitDecoratorAlg.h:107
InDetPhysHitDecoratorAlg::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: InDetPhysHitDecoratorAlg.h:64
InDetPhysHitDecoratorAlg::kDecorEtaWidth
@ kDecorEtaWidth
Definition: InDetPhysHitDecoratorAlg.h:72
InDetPhysHitDecoratorAlg::InDetPhysHitDecoratorAlg
InDetPhysHitDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: InDetPhysHitDecoratorAlg.cxx:30
TRT_ID
Definition: TRT_ID.h:84
InDetPhysHitDecoratorAlg::m_ptThreshold
const double m_ptThreshold
Definition: InDetPhysHitDecoratorAlg.h:105
SCT_ID
Definition: SCT_ID.h:68
InDetPhysHitDecoratorAlg::kDecorResidualLocY
@ kDecorResidualLocY
Definition: InDetPhysHitDecoratorAlg.h:85
InDetPhysHitDecoratorAlg::BARREL
@ BARREL
Definition: InDetPhysHitDecoratorAlg.h:44
InDetPhysHitDecoratorAlg::m_pixelID
const PixelID * m_pixelID
Definition: InDetPhysHitDecoratorAlg.h:110
InDetPhysHitDecoratorAlg::kNIntDecorators
@ kNIntDecorators
Definition: InDetPhysHitDecoratorAlg.h:73
InDetPhysHitDecoratorAlg::decideDetectorRegion
bool decideDetectorRegion(const Identifier &id, Subdetector &det, Region &r, int &layer) const
Definition: InDetPhysHitDecoratorAlg.cxx:487
InDetPhysHitDecoratorAlg::PIXEL
@ PIXEL
Definition: InDetPhysHitDecoratorAlg.h:41
InDetPhysHitDecoratorAlg::m_sctID
const SCT_ID * m_sctID
Definition: InDetPhysHitDecoratorAlg.h:111
InDetPhysHitDecoratorAlg::m_intDecor
std::vector< SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > > m_intDecor
Definition: InDetPhysHitDecoratorAlg.h:98
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
InDetPhysHitDecoratorAlg::kDecorPhiWidth
@ kDecorPhiWidth
Definition: InDetPhysHitDecoratorAlg.h:71
InDetPhysHitDecoratorAlg::EIntDecorations
EIntDecorations
Definition: InDetPhysHitDecoratorAlg.h:66
InDetPhysHitDecoratorAlg
Definition: InDetPhysHitDecoratorAlg.h:36
InDetPhysHitDecoratorAlg::kNUInt64Decorators
@ kNUInt64Decorators
Definition: InDetPhysHitDecoratorAlg.h:77
InDetPhysHitDecoratorAlg::ENDCAP
@ ENDCAP
Definition: InDetPhysHitDecoratorAlg.h:44
InDetPhysHitDecoratorAlg::kNFloatDecorators
@ kNFloatDecorators
Definition: InDetPhysHitDecoratorAlg.h:92
PixelID
Definition: PixelID.h:67
InDetPhysHitDecoratorAlg::EUInt64Decorations
EUInt64Decorations
Definition: InDetPhysHitDecoratorAlg.h:75
InDetPhysHitDecoratorAlg::kDecorID
@ kDecorID
Definition: InDetPhysHitDecoratorAlg.h:76
InDetPhysHitDecoratorAlg::m_uint64Decor
std::vector< SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > > m_uint64Decor
Definition: InDetPhysHitDecoratorAlg.h:99
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:41
InDetPhysHitDecoratorAlg::m_doUpgrade
bool m_doUpgrade
Definition: InDetPhysHitDecoratorAlg.h:106
InDetPhysHitDecoratorAlg::kDecorMeasLocCovX
@ kDecorMeasLocCovX
Definition: InDetPhysHitDecoratorAlg.h:84
InDetPhysHitDecoratorAlg::kDecorMeasLocX
@ kDecorMeasLocX
Definition: InDetPhysHitDecoratorAlg.h:82
InDetPhysHitDecoratorAlg::kDecorRegion
@ kDecorRegion
Definition: InDetPhysHitDecoratorAlg.h:67