ATLAS Offline Software
ParticleCaloExtensionTool.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 /*
6  * ParticleCaloExtensionTool.h - implements the IParticleCaloExtenions
7  * Interface begin : Summer 2014
8  * updated : 2018-2019 for AthenaMT
9  * authors : Niels van Eldik (CERN PH-ATC),Christos Anastopoulos
10  */
11 
12 #ifndef TRKPARTICLECREATOR_PARTICLECALOEXTENSIONTOOL_H
13 #define TRKPARTICLECREATOR_PARTICLECALOEXTENSIONTOOL_H
15 #include "GaudiKernel/ServiceHandle.h"
16 #include "GaudiKernel/ToolHandle.h"
17 
18 /*interface */
20 
21 /* interfce for the extrapolator tool*/
22 
27 /*
28  * xAOD includes
29  */
34 
35 /* monitoring */
37 
38 class AtlasDetectorID;
40 namespace Trk {
41 
42 class IExtrapolator;
43 
45  : virtual public IParticleCaloExtensionTool
46  , public AthAlgTool
47 {
48 public:
49  ParticleCaloExtensionTool(const std::string&,
50  const std::string&,
51  const IInterface*);
53 
54  virtual StatusCode initialize() override final;
55  virtual StatusCode finalize() override final;
56 
57  /*
58  * Implement the IParticleCaloExtension methods
59  * see IParticleCaloExtension.h for
60  * detailed documentation of the various options
61  * and methods
62  */
63  virtual std::unique_ptr<Trk::CaloExtension> caloExtension(
64  const EventContext& ctx,
65  const xAOD::IParticle& particle) const override final;
66 
68  const EventContext& ctx,
70  IParticleCaloExtensionTool::Cache& cache) const override final;
71 
74  const CaloExtensionCollection& cache) const override final;
75 
77  const EventContext& ctx,
79  const std::vector<bool>& mask,
80  CaloExtensionCollection& caloextensions) const override final;
81 
82  virtual std::unique_ptr<Trk::CaloExtension> caloExtension(
83  const EventContext& ctx,
84  const TrackParameters& startPars,
85  PropDirection propDir,
86  ParticleHypothesis particleType) const override final;
87 
88  std::vector<std::unique_ptr<Trk::Surface>> caloSurfacesFromLayers(
89  const std::vector<CaloSampling::CaloSample>& clusterLayers,
90  double eta,
91  const CaloDetDescrManager& caloDD) const override final;
92 
93  virtual std::vector<std::pair<CaloSampling::CaloSample,
94  std::unique_ptr<const Trk::TrackParameters>>>
96  const EventContext& ctx,
97  const TrackParameters& startPars,
98  const std::vector<CaloSampling::CaloSample>& clusterLayers,
99  const std::vector<std::unique_ptr<Trk::Surface>>& caloSurfaces,
100  ParticleHypothesis particleType) const override final;
101 
102  virtual std::vector<std::pair<CaloSampling::CaloSample,
103  std::unique_ptr<const Trk::TrackParameters>>>
105  const EventContext& ctx,
106  const TrackParameters& startPars,
107  const std::vector<CaloSampling::CaloSample>& clusterLayers,
108  double eta,
109  const CaloDetDescrManager& caloDD,
110  ParticleHypothesis particleType) const override final;
111 
112 private:
113  /*
114  * Internal methods for different IParticle types
115  */
116  std::unique_ptr<Trk::CaloExtension> caloExtension(
117  const EventContext& ctx,
119  std::unique_ptr<Trk::CaloExtension> caloExtension(
120  const EventContext& ctx,
122  std::unique_ptr<Trk::CaloExtension> caloExtension(
123  const EventContext& ctx,
125 
126  ToolHandle<Trk::IExtrapolator> m_extrapolator{ this, "Extrapolator", "" };
127 
129  ToolHandle<ICaloSurfaceBuilder> m_calosurf{
130  this,
131  "CaloSurfaceBuilder",
132  "",
133  "Tool to build calorimeter layer surfaces"
134  };
135 
136  Gaudi::Property<std::string> m_particleTypeName{
137  this, "ParticleType", "muon",
138  "The particle type used during extrapolation when not passed via the "
139  "method interfaces"
140  ": muon, pion, nonInteracting"};
141 
142  Gaudi::Property<bool> m_startFromPerigee{ this,
143  "StartFromPerigee",
144  false,
145  "Start from Perigee" };
148 
149  Gaudi::Property<unsigned int> m_extrapolDetectorID{
150  this,
151  "ExtrapolationDetectorID",
152  Trk::Calo,
153  "The detector this tool should extrapolate through. Expects a "
154  "Trk::GeometrySignature enum value."
155  };
156 
158  ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool","","Monitoring tool"};
159 };
160 } // namespace Trk
161 
162 #endif
Trk::ParticleCaloExtensionTool::~ParticleCaloExtensionTool
virtual ~ParticleCaloExtensionTool()
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
GeometrySignature.h
Trk::ParticleCaloExtensionTool::caloExtension
virtual std::unique_ptr< Trk::CaloExtension > caloExtension(const EventContext &ctx, const xAOD::IParticle &particle) const override final
Method returning the calo layers crossed by the IParticle track or the IParticle itself if it is neut...
Definition: ParticleCaloExtensionTool.cxx:69
Trk::CaloExtension
Tracking class to hold the extrapolation from a particle from the ID to the muon system (or the other...
Definition: CaloExtension.h:18
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
Trk::ParticleCaloExtensionTool::m_particleStrategy
ParticleHypothesis m_particleStrategy
Definition: ParticleCaloExtensionTool.h:147
CaloSampling
provides Calorimeter Sampling enum
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:17
TruthParticle
Definition: PhysicsAnalysis/TruthParticleID/McParticleEvent/McParticleEvent/TruthParticle.h:58
Trk::ParticleCaloExtensionTool
Definition: ParticleCaloExtensionTool.h:47
Trk::ParticleCaloExtensionTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: ParticleCaloExtensionTool.h:126
IExtrapolator.h
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
Trk::Calo
@ Calo
Definition: GeometrySignature.h:28
particleType
Definition: particleType.h:29
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
Trk::ParticleCaloExtensionTool::m_extrapolDetectorID
Gaudi::Property< unsigned int > m_extrapolDetectorID
Definition: ParticleCaloExtensionTool.h:149
Trk::ParticleCaloExtensionTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Monitoring tool for recording histograms of the alg in action.
Definition: ParticleCaloExtensionTool.h:158
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
Trk::ParticleCaloExtensionTool::caloExtensionCollection
virtual StatusCode caloExtensionCollection(const EventContext &ctx, const xAOD::IParticleContainer &particles, const std::vector< bool > &mask, CaloExtensionCollection &caloextensions) const override final
Method that can be used by algorithms that : A.
Definition: ParticleCaloExtensionTool.cxx:128
Trk::ParticleCaloExtensionTool::m_detID
const AtlasDetectorID * m_detID
Definition: ParticleCaloExtensionTool.h:146
Trk::PropDirection
PropDirection
Definition: PropDirection.h:19
Trk::ParticleCaloExtensionTool::m_calosurf
ToolHandle< ICaloSurfaceBuilder > m_calosurf
Tool to build calorimeter layer surfaces.
Definition: ParticleCaloExtensionTool.h:129
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloCluster.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
vector
Definition: MultiHisto.h:13
AthAlgTool.h
Trk::ParticleCaloExtensionTool::ParticleCaloExtensionTool
ParticleCaloExtensionTool(const std::string &, const std::string &, const IInterface *)
Definition: ParticleCaloExtensionTool.cxx:20
Trk::ParametersBase
Definition: ParametersBase.h:55
Trk::ParticleCaloExtensionTool::initialize
virtual StatusCode initialize() override final
Definition: ParticleCaloExtensionTool.cxx:33
xAOD::NeutralParticle
NeutralParticle_v1 NeutralParticle
Reference the current persistent version:
Definition: NeutralParticle.h:13
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
ParticleHypothesis.h
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
Trk::IParticleCaloExtensionTool
Interface for extending Particles with calo intersections.
Definition: IParticleCaloExtensionTool.h:96
Trk::ParticleCaloExtensionTool::m_startFromPerigee
Gaudi::Property< bool > m_startFromPerigee
Definition: ParticleCaloExtensionTool.h:142
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
ICaloSurfaceBuilder.h
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
NeutralParticle.h
Trk::IParticleCaloExtensionTool::Cache
std::unordered_map< size_t, std::unique_ptr< Trk::CaloExtension > > Cache
Definition: IParticleCaloExtensionTool.h:98
Trk::ParticleCaloExtensionTool::finalize
virtual StatusCode finalize() override final
Definition: ParticleCaloExtensionTool.cxx:63
Trk::IExtrapolator
Definition: IExtrapolator.h:62
TrackParticle.h
IParticleCaloExtensionTool.h
Trk::ParticleCaloExtensionTool::caloSurfacesFromLayers
std::vector< std::unique_ptr< Trk::Surface > > caloSurfacesFromLayers(const std::vector< CaloSampling::CaloSample > &clusterLayers, double eta, const CaloDetDescrManager &caloDD) const override final
Method returning a vector of calo surfaces give calo layers/samplings.
Definition: ParticleCaloExtensionTool.cxx:401
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
Trk::ParticleCaloExtensionTool::surfaceCaloExtension
virtual std::vector< std::pair< CaloSampling::CaloSample, std::unique_ptr< const Trk::TrackParameters > > > surfaceCaloExtension(const EventContext &ctx, const TrackParameters &startPars, const std::vector< CaloSampling::CaloSample > &clusterLayers, const std::vector< std::unique_ptr< Trk::Surface >> &caloSurfaces, ParticleHypothesis particleType) const override final
Method returning a vector of the Track Parameters at layers/samplings.
Definition: ParticleCaloExtensionTool.cxx:421
LArG4FSStartPointFilter.particles
list particles
Definition: LArG4FSStartPointFilter.py:84
Trk::ParticleCaloExtensionTool::m_particleTypeName
Gaudi::Property< std::string > m_particleTypeName
Definition: ParticleCaloExtensionTool.h:136
AthAlgTool
Definition: AthAlgTool.h:26
TruthParticle.h
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
IParticle
Definition: Event/EventKernel/EventKernel/IParticle.h:43
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
Trk::ParticleCaloExtensionTool::layersCaloExtension
virtual std::vector< std::pair< CaloSampling::CaloSample, std::unique_ptr< const Trk::TrackParameters > > > layersCaloExtension(const EventContext &ctx, const TrackParameters &startPars, const std::vector< CaloSampling::CaloSample > &clusterLayers, double eta, const CaloDetDescrManager &caloDD, ParticleHypothesis particleType) const override final
Method returning a vector of the Track Parameters at layers/samplings.
Definition: ParticleCaloExtensionTool.cxx:453