ATLAS Offline Software
TBExtrapolTrackToCaloTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // ***************************************************************************
6 // Liquid Argon H8 Combined TestBeam Geometry
7 // -----------------------------------------
8 //
9 // 25.10.2004 Creation of the class by claire.bourdarios@cern.ch
10 //
11 // ***************************************************************************
12 
13 #ifndef TBREC_TBEXTRAPOLTRACKTOCALO_H
14 #define TBREC_TBEXTRAPOLTRACKTOCALO_H
15 
18 
20 
22 #include "GaudiKernel/ToolHandle.h"
23 
26 
29 
31 class IMessageSvc;
32 class CaloDepthTool;
34 class ImpactInCalo;
35 
38 
39 namespace Trk {
40  class Track;
41  class IExtrapolator;
42  class TrackParticleBase;
43 }
44 
45 static const InterfaceID IID_TBExtrapolTrackToCaloTool("TBExtrapolTrackToCaloTool", 1 , 0);
46 
47 //<<<<<< INCLUDES >>>>>>
48 
80 //class TBExtrapolTrackToCaloTool : public AthAlgTool,
81 // virtual public IExtrapolateToCaloTool
83 {
84 public:
85 
86  // Retrieve interface ID
87  static const InterfaceID& interfaceID() { return IID_TBExtrapolTrackToCaloTool; }
88  // Constructor:
89 
90  TBExtrapolTrackToCaloTool(const std::string& type,
91  const std::string& name,
92  const IInterface* parent);
93 
95 
96  virtual StatusCode initialize() override;
97  virtual StatusCode finalize() override;
98 
99 
101  void CaloVariables (const Trk::TrackParameters* parm,
102  double& etaCaloLocal, double& phiCaloLocal);
103  void CaloLocalPoint (const Trk::TrackParameters* parm,
104  Amg::Vector3D* pt_ctb,
105  Amg::Vector3D* pt_local);
106 
108  bool TrackSeenByCalo(const Trk::Track* trk,
110  const double offset,
111  Amg::Vector3D* pt_ctb,
112  Amg::Vector3D* pt_local);
113 
114  bool TrackSeenByCalo(const Trk::TrackParameters* parm,
116  const double offset,
117  Amg::Vector3D* pt_ctb,
118  Amg::Vector3D* pt_local);
119 
120  bool TrackSeenByCalo (const Trk::Track* trk,
121  const bool barrel,
122  const CaloCell_ID::SUBCALO subcalo,
123  const int sampling_or_module,
124  const double offset,
125  Amg::Vector3D* pt_ctb,
126  Amg::Vector3D* pt_local);
127 
128  bool TrackSeenByCalo (const Trk::TrackParameters* parm,
129  const bool barrel,
130  const CaloCell_ID::SUBCALO subcalo,
131  const int sampling_or_module,
132  const double offset,
133  Amg::Vector3D* pt_ctb,
134  Amg::Vector3D* pt_local);
135 
136  bool TrackSeenByCalo (const Trk::Track* trk,
138  const double offset,
139  Amg::Vector3D* pt_ctb,
140  Amg::Vector3D* pt_local,
141  double& trketa_atcalo, double& trkphi_atcalo);
142 
143  /* new methods in base class, not implemented yet */
145  const CaloCell_ID::CaloSample /*sample*/,
146  const double /*offset*/,
148  const Trk::ParticleHypothesis /*particle*/=Trk::undefined) const{std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}
149 
151  const CaloCell_ID::CaloSample /*sample*/,
152  const double /*offset*/,
154  const Trk::ParticleHypothesis /*particle*/=Trk::undefined) const {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}
155 
157  const CaloCell_ID::CaloSample /*sample*/,
158  const double /*offset*/,
159  Trk::ParticleHypothesis /*particle*/,
160  const Trk::PropDirection /*dir*/=Trk::alongMomentum) const {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}
161 
163  const CaloCell_ID::CaloSample /*sample*/,
164  const double /*offset*/,
165  Trk::ParticleHypothesis /*particle*/,
166  const Trk::PropDirection /*dir*/=Trk::alongMomentum) const {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}
167 
168  virtual const Trk::TrackParameters* extrapolate (const xAOD::TrackParticle& /*trk*/,
169  const CaloCell_ID::CaloSample /*sample*/,
170  const double /*offset*/,
172  const Trk::ParticleHypothesis /*particle*/=Trk::undefined) const
173  {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}
174 
177  const CaloCell_ID::CaloSample /*sample*/,
178  const double /*offset*/,
179  const Trk::PropDirection /*dir*/=Trk::alongMomentum ) const
180  {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}
181 
183  Trk::ParticleHypothesis /*particle*/,
184  const Trk::PropDirection /*dir*/=Trk::alongMomentum) const {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}
185 
187  Trk::ParticleHypothesis /*particle*/,
188  const Trk::PropDirection /*dir*/=Trk::alongMomentum) const {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}
189 
191  const Trk::ParticleHypothesis /*particle*/=Trk::undefined,
192  const Trk::PropDirection /*dir*/=Trk::alongMomentum) const {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}
193 
195  const Trk::ParticleHypothesis /*particle*/=Trk::undefined,
196  const Trk::PropDirection /*dir*/=Trk::alongMomentum) const {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}
197 
199  const Trk::ParticleHypothesis /*particle*/=Trk::undefined,
200  const Trk::PropDirection /*dir*/=Trk::alongMomentum) const {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}
201 
202 
204  const Trk::ParticleHypothesis /*particle*/=Trk::undefined,
205  const Trk::PropDirection /*dir*/=Trk::alongMomentum) const {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}
206 
208  const Trk::ParticleHypothesis /*particle*/=Trk::undefined,
209  const Trk::PropDirection /*dir*/=Trk::alongMomentum) const {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}
210 
211  virtual ImpactInCalo* getImpactInCalo (const Trk::TrackParameters& /*parameters*/,
212  Trk::ParticleHypothesis /*particleHypo*/,
213  const Trk::PropDirection /*dir*/=Trk::alongMomentum) const {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}
214 
215  virtual ImpactInCalo* getImpactInCalo (const Trk::NeutralParameters& /*parameters*/,
216  Trk::ParticleHypothesis /*particleHypo*/,
217  const Trk::PropDirection /*dir*/=Trk::alongMomentum) const {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}
218 
221 
222 
225  const Trk::Surface* surf);
226 
228  const Trk::TrackParameters* extrapolate(const Trk::Track* trk,
229  const Trk::Surface* surf);
230 
231 
232  virtual Amg::Vector3D getMomentumAtVertex(const xAOD::Vertex& vertex, bool /*reuse*/) const;
233 
234 #if 0
235  virtual Trk::Intersection getIntersectionInCalo(const Amg::Vector3D& position, const Amg::Vector3D& momentum, const CaloCell_ID::CaloSample sample) const;
236 #endif
237 
238 private:
239 
240 
241 
242  // CaloDetDescr usual stuff
244  , "CaloDetDescrManager"
245  , "CaloDetDescrManager"
246  , "SG Key for CaloDetDescrManager in the Condition Store" };
247 
248  const CaloCell_ID* m_calo_id{nullptr};
250 
252 
253  // Defines the surface for extrapolation :
254  ToolHandle<ICaloSurfaceBuilder> m_calosurf;
255 
256 
257  // Pre-configured extrapolator : will be choosen via jobOpt
258  ToolHandle< Trk::IExtrapolator > m_extrapolator;
259 };
260 
261 
262 #endif // TRACKTOCALO_EXTRAPOLTRACKTOCALO_H
263 
264 
265 
266 
267 
268 
CaloDepthTool
Implementation of the ICaloDepthTool interface.Given a Track direction, checks if it is in the Calori...
Definition: CaloDepthTool.h:47
TBExtrapolTrackToCaloTool::m_calo_tb_coord
ICaloCoordinateTool * m_calo_tb_coord
Definition: TBExtrapolTrackToCaloTool.h:249
CaloPhiRange
This class defines the phi convention for Calorimeters.
Definition: CaloPhiRange.h:28
Trk::Intersection
Definition: Intersection.h:24
TBExtrapolTrackToCaloTool::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: TBExtrapolTrackToCaloTool.h:243
TrackParameters.h
TBExtrapolTrackToCaloTool::m_calo_id
const CaloCell_ID * m_calo_id
Definition: TBExtrapolTrackToCaloTool.h:248
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
TBExtrapolTrackToCaloTool::CaloVariables
void CaloVariables(const Trk::TrackParameters *parm, double &etaCaloLocal, double &phiCaloLocal)
now return the variables needed to compare with CaloClusters:
Definition: TBExtrapolTrackToCaloTool.cxx:122
TBExtrapolTrackToCaloTool::getCaloDepth
CaloDepthTool * getCaloDepth()
access to the private tool used to define the extrapolation depth, needed to play with delta-eta
Definition: TBExtrapolTrackToCaloTool.cxx:412
TBExtrapolTrackToCaloTool::getParametersInCalo
virtual const DataVector< const Trk::TrackParameters > * getParametersInCalo(const xAOD::TrackParticle &, const Trk::ParticleHypothesis=Trk::undefined, const Trk::PropDirection=Trk::alongMomentum) const
Definition: TBExtrapolTrackToCaloTool.h:198
ImpactInCalo
The ImpactInCalo collection is created by the TrackToCaloAlg algorithm, which loops on all Tracks of ...
Definition: ImpactInCalo.h:33
TBExtrapolTrackToCaloTool::getImpactInCalo
ImpactInCalo * getImpactInCalo(const Trk::Track &, const Trk::ParticleHypothesis=Trk::undefined, const Trk::PropDirection=Trk::alongMomentum) const
Definition: TBExtrapolTrackToCaloTool.h:203
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
TBExtrapolTrackToCaloTool::extrapolate
const Trk::TrackParameters * extrapolate(const Trk::Track &, const CaloCell_ID::CaloSample, const double, const Trk::PropDirection=Trk::alongMomentum, const Trk::ParticleHypothesis=Trk::undefined) const
Definition: TBExtrapolTrackToCaloTool.h:144
Trk::undefined
@ undefined
Definition: ParticleHypothesis.h:38
TBExtrapolTrackToCaloTool::getImpactInCalo
ImpactInCalo * getImpactInCalo(const Trk::TrackParticleBase &, const Trk::ParticleHypothesis=Trk::undefined, const Trk::PropDirection=Trk::alongMomentum) const
Definition: TBExtrapolTrackToCaloTool.h:207
TBExtrapolTrackToCaloTool::extrapolate
virtual const Trk::TrackParameters * extrapolate(const xAOD::TrackParticle &, const CaloCell_ID::CaloSample, const double, const Trk::PropDirection=Trk::alongMomentum, const Trk::ParticleHypothesis=Trk::undefined) const
Definition: TBExtrapolTrackToCaloTool.h:168
TBExtrapolTrackToCaloTool
This class takes a given TrkTrack, extrapolates it to the Calo and returns the variables needed to co...
Definition: TBExtrapolTrackToCaloTool.h:83
ICaloSurfaceBuilder
Interface to CaloSurfaceBuilder.
Definition: ICaloSurfaceBuilder.h:43
TBExtrapolTrackToCaloTool::interfaceID
static const InterfaceID & interfaceID()
Definition: TBExtrapolTrackToCaloTool.h:87
TBExtrapolTrackToCaloTool::TrackSeenByCalo
bool TrackSeenByCalo(const Trk::Track *trk, const CaloCell_ID::CaloSample sample, const double offset, Amg::Vector3D *pt_ctb, Amg::Vector3D *pt_local)
The "do-it-all" method which combines the 3 steps.
Definition: TBExtrapolTrackToCaloTool.cxx:207
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
CaloCell_ID.h
TBExtrapolTrackToCaloTool::getParametersInCalo
virtual const DataVector< const Trk::NeutralParameters > * getParametersInCalo(const Trk::NeutralParameters &, Trk::ParticleHypothesis, const Trk::PropDirection=Trk::alongMomentum) const
Definition: TBExtrapolTrackToCaloTool.h:186
TBExtrapolTrackToCaloTool::extrapolate
const Trk::TrackParameters * extrapolate(const Trk::TrackParameters &, const CaloCell_ID::CaloSample, const double, Trk::ParticleHypothesis, const Trk::PropDirection=Trk::alongMomentum) const
Definition: TBExtrapolTrackToCaloTool.h:156
Trk::TrackParticleBase
Definition: TrackParticleBase.h:41
TBExtrapolTrackToCaloTool::getParametersInCalo
virtual const DataVector< const Trk::TrackParameters > * getParametersInCalo(const Trk::TrackParameters &, Trk::ParticleHypothesis, const Trk::PropDirection=Trk::alongMomentum) const
Definition: TBExtrapolTrackToCaloTool.h:182
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
GeoPrimitives.h
Trk::PropDirection
PropDirection
Definition: PropDirection.h:19
TBExtrapolTrackToCaloTool::m_calosurf
ToolHandle< ICaloSurfaceBuilder > m_calosurf
Definition: TBExtrapolTrackToCaloTool.h:254
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:116
TBExtrapolTrackToCaloTool::getParametersInCalo
virtual const DataVector< const Trk::TrackParameters > * getParametersInCalo(const Trk::TrackParticleBase &, const Trk::ParticleHypothesis=Trk::undefined, const Trk::PropDirection=Trk::alongMomentum) const
Definition: TBExtrapolTrackToCaloTool.h:190
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TBExtrapolTrackToCaloTool::getParametersInCalo
virtual const DataVector< const Trk::TrackParameters > * getParametersInCalo(const Trk::Track &, const Trk::ParticleHypothesis=Trk::undefined, const Trk::PropDirection=Trk::alongMomentum) const
Definition: TBExtrapolTrackToCaloTool.h:194
CaloCell_Base_ID::SUBCALO
SUBCALO
enumeration of sub calorimeters
Definition: CaloCell_Base_ID.h:46
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloPhiRange.h
CaloPhiRange class declaration.
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
Trk::ParametersBase
Definition: ParametersBase.h:55
TBExtrapolTrackToCaloTool::~TBExtrapolTrackToCaloTool
virtual ~TBExtrapolTrackToCaloTool()
Definition: TBExtrapolTrackToCaloTool.cxx:52
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
ICaloCoordinateTool
This (clean) interface is implemented in the (rather dirty) ICaloCoordinateTool class,...
Definition: ICaloCoordinateTool.h:65
TBExtrapolTrackToCaloTool::extrapolate
const Trk::TrackParameters * extrapolate(const Trk::TrackParticleBase &, const CaloCell_ID::CaloSample, const double, const Trk::PropDirection=Trk::alongMomentum, const Trk::ParticleHypothesis=Trk::undefined) const
Definition: TBExtrapolTrackToCaloTool.h:150
TBExtrapolTrackToCaloTool::finalize
virtual StatusCode finalize() override
Definition: TBExtrapolTrackToCaloTool.cxx:115
ReadCondHandleKey.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
TBExtrapolTrackToCaloTool::getMomentumAtVertex
virtual Amg::Vector3D getMomentumAtVertex(const xAOD::Vertex &vertex, bool) const
Definition: TBExtrapolTrackToCaloTool.cxx:503
TBExtrapolTrackToCaloTool::getImpactInCalo
virtual ImpactInCalo * getImpactInCalo(const Trk::TrackParameters &, Trk::ParticleHypothesis, const Trk::PropDirection=Trk::alongMomentum) const
Definition: TBExtrapolTrackToCaloTool.h:211
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TBExtrapolTrackToCaloTool::initialize
virtual StatusCode initialize() override
Definition: TBExtrapolTrackToCaloTool.cxx:56
NeutralParticle.h
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
TBExtrapolTrackToCaloTool::m_range
CaloPhiRange m_range
Definition: TBExtrapolTrackToCaloTool.h:251
TBExtrapolTrackToCaloTool::getImpactInCalo
virtual ImpactInCalo * getImpactInCalo(const Trk::NeutralParameters &, Trk::ParticleHypothesis, const Trk::PropDirection=Trk::alongMomentum) const
Definition: TBExtrapolTrackToCaloTool.h:215
SG::ReadCondHandleKey< CaloDetDescrManager >
TrackParticle.h
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
TBExtrapolTrackToCaloTool::extrapolate
virtual const Trk::NeutralParameters * extrapolate(const xAOD::NeutralParticle &, const CaloCell_ID::CaloSample, const double, const Trk::PropDirection=Trk::alongMomentum) const
get Trk::NeutralParameters at the calorimeter sample from xAOD::NeutralParticle
Definition: TBExtrapolTrackToCaloTool.h:176
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
TBExtrapolTrackToCaloTool::TBExtrapolTrackToCaloTool
TBExtrapolTrackToCaloTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TBExtrapolTrackToCaloTool.cxx:39
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DetectorZone::barrel
@ barrel
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
TBExtrapolTrackToCaloTool::CaloLocalPoint
void CaloLocalPoint(const Trk::TrackParameters *parm, Amg::Vector3D *pt_ctb, Amg::Vector3D *pt_local)
Definition: TBExtrapolTrackToCaloTool.cxx:165
TBExtrapolTrackToCaloTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: TBExtrapolTrackToCaloTool.h:258
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
AthAlgTool
Definition: AthAlgTool.h:26
xAOD::NeutralParticle_v1
Class describing a NeutralParticle.
Definition: NeutralParticle_v1.h:40
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
TBExtrapolTrackToCaloTool::extrapolate
const Trk::NeutralParameters * extrapolate(const Trk::NeutralParameters &, const CaloCell_ID::CaloSample, const double, Trk::ParticleHypothesis, const Trk::PropDirection=Trk::alongMomentum) const
Definition: TBExtrapolTrackToCaloTool.h:162
Intersection.h