ATLAS Offline Software
EMExtrapolationTools.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef EGAMMATRACKTOOLS_EMEXTRAPOLATIONTOOLS_H
6 #define EGAMMATRACKTOOLS_EMEXTRAPOLATIONTOOLS_H
7 
12 /********************************************************************
13 NAME: EMExtrapolationTools.h
14 PACKAGE: offline/Reconstruction/egammaTrackTools
15 AUTHORS: T. Koffas, C.Anastopoulos
16 PURPOSE: Tool which propagate track and vertices to the calorimeter cluster
17 ********************************************************************/
18 
20 #include "GaudiKernel/EventContext.h"
21 #include "GaudiKernel/ToolHandle.h"
23 
25 
30 #include "xAODTracking/VertexFwd.h"
31 
36 
37 class TRT_ID;
38 class CaloDepthTool;
39 
40 namespace Trk {
41 class INeutralParticleParameterCalculator;
42 }
43 
45  : virtual public IEMExtrapolationTools
46  , public AthAlgTool
47 {
48 
49 public:
51  EMExtrapolationTools(const std::string& type,
52  const std::string& name,
53  const IInterface* parent);
55  virtual ~EMExtrapolationTools() = default;
56 
58  virtual StatusCode initialize() override final;
59 
60  virtual std::pair<std::vector<CaloSampling::CaloSample>,
61  std::vector<std::unique_ptr<Trk::Surface>>>
63  const xAOD::CaloCluster& cluster,
64  const CaloDetDescrManager& caloDD) const override final;
67  virtual StatusCode getMatchAtCalo(
68  const EventContext& ctx,
69  const xAOD::CaloCluster& cluster,
70  const xAOD::TrackParticle& trkPB,
72  const std::vector<std::unique_ptr<Trk::Surface>>& surfaces,
73  std::array<double, 4>& eta,
74  std::array<double, 4>& phi,
75  std::array<double, 4>& deltaEta,
76  std::array<double, 4>& deltaPhi,
77  unsigned int extrapFrom = fromPerigee) const override final;
78 
81  virtual bool matchesAtCalo(const xAOD::CaloCluster* cluster,
83  float etaAtCalo,
84  float phiAtCalo) const override final;
85 
88  virtual bool getEtaPhiAtCalo(const EventContext& ctx,
90  float* etaAtCalo,
91  float* phiAtCalo) const override final;
92 
95  virtual bool getEtaPhiAtCalo(const EventContext& ctx,
96  const Trk::TrackParameters* trkPar,
97  float* etaAtCalo,
98  float* phiAtCalo) const override final;
99 
102  Amg::Vector3D getMomentumAtVertex(const EventContext& ctx,
103  const xAOD::Vertex&,
104  unsigned int) const override final;
105 
108  Amg::Vector3D getMomentumAtVertex(const EventContext& ctx,
109  const xAOD::Vertex&,
110  bool reuse = true) const override final;
111 
112 private:
116 
117  ToolHandle<Trk::IParticleCaloExtensionTool> m_ParticleCaloExtensionTool{
118  this,
119  "CaloExtensionTool",
120  "Trk::ParticleCaloExtensionTool/EMParticleCaloExtensionTool"
121  };
122 
123  ToolHandle<Trk::IExtrapolator> m_extrapolator{
124  this,
125  "Extrapolator",
126  "Trk::Extrapolator/AtlasExtrapolator"
127  };
128 
129  // vertex-to-cluster match cuts used in matchesAtCalo
130  Gaudi::Property<double> m_narrowDeltaPhi{ this, "NarrowDeltaPhi", 0.05 };
131  Gaudi::Property<double> m_narrowDeltaPhiTRTbarrel{ this,
132  "NarrowDeltaPhiTRTbarrel",
133  0.02 };
134  Gaudi::Property<double> m_narrowDeltaPhiTRTendcap{ this,
135  "NarrowDeltaPhiTRTendcap",
136  0.02 };
137  Gaudi::Property<double> m_narrowDeltaEta{ this, "NarrowDeltaEta", 0.05 };
138  Gaudi::Property<double> m_TRTbarrelDeltaEta{ this,
139  "TRTbarrelDeltaEta",
140  0.35 };
141  Gaudi::Property<double> m_TRTendcapDeltaEta{ this, "TRTendcapDeltaEta", 0.2 };
142 
143  // ID TRT helper
144  const TRT_ID* m_trtId;
145  Gaudi::Property<bool> m_enableTRT{ this, "EnableTRT", true };
146 };
147 
148 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
CaloDepthTool
Implementation of the ICaloDepthTool interface.Given a Track direction, checks if it is in the Calori...
Definition: CaloDepthTool.h:47
EMExtrapolationTools::m_narrowDeltaPhiTRTendcap
Gaudi::Property< double > m_narrowDeltaPhiTRTendcap
Definition: EMExtrapolationTools.h:134
EMExtrapolationTools::EMExtrapolationTools
EMExtrapolationTools(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters.
Definition: EMExtrapolationTools.cxx:61
TrackParameters.h
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition: Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
EMExtrapolationTools::getClusterLayerSurfaces
virtual std::pair< std::vector< CaloSampling::CaloSample >, std::vector< std::unique_ptr< Trk::Surface > > > getClusterLayerSurfaces(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &caloDD) const override final
Definition: EMExtrapolationTools.cxx:96
CaloExtensionHelpers.h
EMExtrapolationTools::m_ParticleCaloExtensionTool
ToolHandle< Trk::IParticleCaloExtensionTool > m_ParticleCaloExtensionTool
Definition: EMExtrapolationTools.h:117
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:160
EMExtrapolationTools::m_TRTendcapDeltaEta
Gaudi::Property< double > m_TRTendcapDeltaEta
Definition: EMExtrapolationTools.h:141
EMExtrapolationTools::getTRTsection
int getTRTsection(const xAOD::TrackParticle *trkPB) const
Return +/- 1 (2) if track is in positive/negative TRT barrel (endcap)
Definition: EMExtrapolationTools.cxx:482
CaloSampling
provides Calorimeter Sampling enum
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:17
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:7
EMExtrapolationTools::m_narrowDeltaPhiTRTbarrel
Gaudi::Property< double > m_narrowDeltaPhiTRTbarrel
Definition: EMExtrapolationTools.h:131
EMExtrapolationTools::getMatchAtCalo
virtual StatusCode getMatchAtCalo(const EventContext &ctx, const xAOD::CaloCluster &cluster, const xAOD::TrackParticle &trkPB, const std::vector< CaloSampling::CaloSample > &samples, const std::vector< std::unique_ptr< Trk::Surface >> &surfaces, std::array< double, 4 > &eta, std::array< double, 4 > &phi, std::array< double, 4 > &deltaEta, std::array< double, 4 > &deltaPhi, unsigned int extrapFrom=fromPerigee) const override final
get eta, phi, deltaEta, and deltaPhi at the four calorimeter layers given the Trk::ParametersBase.
Definition: EMExtrapolationTools.cxx:157
EMExtrapolationTools::m_TRTbarrelDeltaEta
Gaudi::Property< double > m_TRTbarrelDeltaEta
Definition: EMExtrapolationTools.h:138
EMExtrapolationTools::m_narrowDeltaPhi
Gaudi::Property< double > m_narrowDeltaPhi
Definition: EMExtrapolationTools.h:130
IExtrapolator.h
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
NeutralParameters.h
IEMExtrapolationTools::fromPerigee
@ fromPerigee
from the perigee of TrackParticle
Definition: IEMExtrapolationTools.h:37
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
EMExtrapolationTools
Definition: EMExtrapolationTools.h:47
EMExtrapolationTools::m_trtId
const TRT_ID * m_trtId
Definition: EMExtrapolationTools.h:144
IEMExtrapolationTools.h
xAOD::TrackParameters
TrackParameters_v1 TrackParameters
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackParameters.h:11
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
CaloClusterFwd.h
P4Helpers::deltaEta
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
Definition: P4Helpers.h:53
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
EMExtrapolationTools::m_narrowDeltaEta
Gaudi::Property< double > m_narrowDeltaEta
Definition: EMExtrapolationTools.h:137
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EMExtrapolationTools::matchesAtCalo
virtual bool matchesAtCalo(const xAOD::CaloCluster *cluster, const xAOD::Vertex *vertex, float etaAtCalo, float phiAtCalo) const override final
test for vertex-to-cluster match given also the positions at the calorimeter from the vertex extrapol...
Definition: EMExtrapolationTools.cxx:290
vector
Definition: MultiHisto.h:13
01SubmitToGrid.samples
samples
Definition: 01SubmitToGrid.py:58
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloCluster
Principal data class for CaloCell clusters.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:79
lumiFormat.array
array
Definition: lumiFormat.py:98
EMExtrapolationTools::m_enableTRT
Gaudi::Property< bool > m_enableTRT
Definition: EMExtrapolationTools.h:145
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
EMExtrapolationTools::getMomentumAtVertex
Amg::Vector3D getMomentumAtVertex(const EventContext &ctx, const xAOD::Vertex &, unsigned int) const override final
get the momentum of the i-th trackParticle assiciated to the vertex at vertex (designed for conversio...
Definition: EMExtrapolationTools.cxx:401
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
EMExtrapolationTools::initialize
virtual StatusCode initialize() override final
initialize method
Definition: EMExtrapolationTools.cxx:71
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
CaloExtensionCollection.h
VertexFwd.h
IEMExtrapolationTools
Definition: IEMExtrapolationTools.h:28
IParticleCaloExtensionTool.h
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
TRT_ID
Definition: TRT_ID.h:84
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrackParticleFwd.h
EMExtrapolationTools::~EMExtrapolationTools
virtual ~EMExtrapolationTools()=default
Destructor.
EMExtrapolationTools::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: EMExtrapolationTools.h:123
AthAlgTool
Definition: AthAlgTool.h:26
EMExtrapolationTools::getEtaPhiAtCalo
virtual bool getEtaPhiAtCalo(const EventContext &ctx, const xAOD::Vertex *vertex, float *etaAtCalo, float *phiAtCalo) const override final
get eta, phi at EM2 given a vertex which is converted to NeutralParameters.
Definition: EMExtrapolationTools.cxx:332