ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
ISF::TrkExtrapolator Class Reference

#include <TrkExtrapolator.h>

Inheritance diagram for ISF::TrkExtrapolator:
Collaboration diagram for ISF::TrkExtrapolator:

Public Member Functions

 TrkExtrapolator (const std::string &t, const std::string &n, const IInterface *p)
 Constructor with parameters. More...
 
 ~TrkExtrapolator ()
 Destructor. More...
 
virtual StatusCode initialize () override
 Athena AlgTool initialization. More...
 
virtual StatusCode finalize () override
 Athena AlgTool finalization. More...
 
virtual ISF::ISFParticleextrapolate (const ISF::ISFParticle &particle) const override
 Extrapolate the given ISFParticle. More...
 

Private Attributes

SG::ReadCondHandleKey< Trk::TrackingGeometrym_trackingGeometryReadKey {this, "TrackingGeometryReadKey", "AtlasTrackingGeometry", "Key of input TrackingGeometry"}
 tracking geometry for geometry signature More...
 
ToolHandle< Trk::IExtrapolatorm_extrapolator
 extrapolation to calo entry More...
 
std::string m_trackingVolumeName
 name of the volume within the extrapolation is carried out More...
 
CxxUtils::CachedPointer< const Trk::TrackingVolume > m_trackingVolume ATLAS_THREAD_SAFE
 volume within the extrapolation is carried out More...
 
Trk::PdgToParticleHypothesism_pdgToParticleHypothesis
 converts PDG ID to hypothesis for TrackParameters More...
 

Detailed Description

An Athena AlgTool wrapper for the Tracking Extrapolator engine.

Author
Elmar.nosp@m..Rit.nosp@m.sch@c.nosp@m.ern..nosp@m.ch (refactored original implementation by Robert Harrington rober.nosp@m.th@c.nosp@m.ern.c.nosp@m.h)

Definition at line 46 of file TrkExtrapolator.h.

Constructor & Destructor Documentation

◆ TrkExtrapolator()

ISF::TrkExtrapolator::TrkExtrapolator ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Constructor with parameters.

Constructor.

Definition at line 17 of file TrkExtrapolator.cxx.

18  : base_class(t,n,p),
19  m_extrapolator("Trk::Extrapolator/AtlasExtrapolator"),
21  m_trackingVolume(0),
23 {
24  declareProperty( "TrackingVolumeName",
26  "Name of the TrackingVolume within which the extrapolation is to be carried out");
27  declareProperty( "Extrapolator",
29  "Extrapolator used for track extrapolation" );
30 }

◆ ~TrkExtrapolator()

ISF::TrkExtrapolator::~TrkExtrapolator ( )

Destructor.

Definition at line 33 of file TrkExtrapolator.cxx.

34 {
36 }

Member Function Documentation

◆ extrapolate()

ISF::ISFParticle * ISF::TrkExtrapolator::extrapolate ( const ISF::ISFParticle particle) const
overridevirtual

Extrapolate the given ISFParticle.

Extrapolate the given ISFParticle to the given TrackingVolume name.

Definition at line 66 of file TrkExtrapolator.cxx.

66  {
67 
68  const EventContext& ctx = Gaudi::Hive::currentContext();
69  if( m_extrapolator.empty() ) {
70  ATH_MSG_ERROR( "Problem with extrapolator!" );
71  return 0;
72  }
73 
74  if ( !m_trackingVolume.get() ) {
75  // ------------------------------- get the trackingGeometry at first place
77  if (!readHandle.isValid() || *readHandle == nullptr) {
78  ATH_MSG_ERROR("Problem with TrackingGeometry '" << m_trackingGeometryReadKey.fullKey() << "' from CondStore.");
79  return 0;
80  }
81 
82  const Trk::TrackingGeometry* trackingGeometry = *readHandle;
83  const Trk::TrackingVolume* trackingVolume = trackingGeometry->trackingVolume( m_trackingVolumeName);
84  if (!trackingVolume) {
85  ATH_MSG_FATAL("Failed to retrieve TrackingVolume: " << m_trackingVolumeName);
86  return 0;
87  }
88  m_trackingVolume.set(trackingVolume);
89  }
90 
91  // create objects from ISFParticle needed for extrapolation
92  Trk::CurvilinearParameters par(particle.position(),particle.momentum(),particle.charge());
93 
94  int absPdg = abs(particle.pdgCode());
95  //bool photon = (absPdg == 22);
96  //bool geantino = (absPdg == 999);
97  //bool charged = photon || geantino ? false : (particle.charge()*particle.charge() > 0) ;
98 
99  Trk::ParticleHypothesis particleHypo =
100  m_pdgToParticleHypothesis->convert(particle.pdgCode(),particle.charge());
101  if ( absPdg == 999 ) particleHypo = Trk::geantino;
102 
103  // extrapolate to calorimeter entry
104  const Trk::TrackParameters* extrapolatedPars = m_extrapolator->extrapolateToVolume(ctx,
105  par,
106  *m_trackingVolume.get(),
108  particleHypo).release();
109 
110  // create a new ISF particle representing the given particle at the extrapolated position
111  ISFParticle *extrapolatedParticle = new ISFParticle( extrapolatedPars->position(),
112  extrapolatedPars->momentum(),
113  particle.mass(),
114  particle.charge(),
115  particle.pdgCode(),
116  particle.status(),
117  particle.timeStamp(),
118  particle,
119  particle.id() // FIXME should this be undefined instead?
120  );
121 
122  // cleanup
123  delete extrapolatedPars;
124 
125  return extrapolatedParticle;
126 }

◆ finalize()

StatusCode ISF::TrkExtrapolator::finalize ( )
overridevirtual

Athena AlgTool finalization.

Definition at line 57 of file TrkExtrapolator.cxx.

58 {
59  ATH_MSG_VERBOSE("finalize() begin");
60 
61  ATH_MSG_VERBOSE("finalize() successful");
62  return StatusCode::SUCCESS;
63 }

◆ initialize()

StatusCode ISF::TrkExtrapolator::initialize ( )
overridevirtual

Athena AlgTool initialization.

Definition at line 40 of file TrkExtrapolator.cxx.

41 {
42  ATH_MSG_VERBOSE("initialize() begin");
43 
44  StatusCode sc = m_extrapolator.retrieve();
45  if (sc.isFailure()){
46  ATH_MSG_FATAL( "Could not retrieve " << m_extrapolator );
47  return StatusCode::FAILURE;
48  }
49  // initialize the TrackingGeometryReadKey
51 
52  ATH_MSG_VERBOSE("initialize() successful");
53  return StatusCode::SUCCESS;
54 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

CxxUtils::CachedPointer<const Trk::TrackingVolume> m_trackingVolume ISF::TrkExtrapolator::ATLAS_THREAD_SAFE
mutableprivate

volume within the extrapolation is carried out

Definition at line 72 of file TrkExtrapolator.h.

◆ m_extrapolator

ToolHandle<Trk::IExtrapolator> ISF::TrkExtrapolator::m_extrapolator
private

extrapolation to calo entry

ToolHandle for track extrapolator

Definition at line 69 of file TrkExtrapolator.h.

◆ m_pdgToParticleHypothesis

Trk::PdgToParticleHypothesis* ISF::TrkExtrapolator::m_pdgToParticleHypothesis
private

converts PDG ID to hypothesis for TrackParameters

Definition at line 74 of file TrkExtrapolator.h.

◆ m_trackingGeometryReadKey

SG::ReadCondHandleKey<Trk::TrackingGeometry> ISF::TrkExtrapolator::m_trackingGeometryReadKey {this, "TrackingGeometryReadKey", "AtlasTrackingGeometry", "Key of input TrackingGeometry"}
private

tracking geometry for geometry signature

Definition at line 66 of file TrkExtrapolator.h.

◆ m_trackingVolumeName

std::string ISF::TrkExtrapolator::m_trackingVolumeName
private

name of the volume within the extrapolation is carried out

Definition at line 71 of file TrkExtrapolator.h.


The documentation for this class was generated from the following files:
ISF::TrkExtrapolator::m_pdgToParticleHypothesis
Trk::PdgToParticleHypothesis * m_pdgToParticleHypothesis
converts PDG ID to hypothesis for TrackParameters
Definition: TrkExtrapolator.h:74
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Trk::PdgToParticleHypothesis::convert
Trk::ParticleHypothesis convert(int pdg, bool &stable, bool &exiting, double charge=1.) const
Converter method : PDG -> Particle Hyptothesis.
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
ISF::TrkExtrapolator::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
extrapolation to calo entry
Definition: TrkExtrapolator.h:69
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:731
Trk::TrackingGeometry
Definition: TrackingGeometry.h:67
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trk::geantino
@ geantino
Definition: ParticleHypothesis.h:26
ISF::TrkExtrapolator::m_trackingVolumeName
std::string m_trackingVolumeName
name of the volume within the extrapolation is carried out
Definition: TrkExtrapolator.h:71
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Trk::ParametersBase
Definition: ParametersBase.h:55
Trk::CurvilinearParametersT
Definition: CurvilinearParametersT.h:48
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
Trk::PdgToParticleHypothesis
Definition: PdgToParticleHypothesis.h:29
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
ISF::TrkExtrapolator::m_trackingGeometryReadKey
SG::ReadCondHandleKey< Trk::TrackingGeometry > m_trackingGeometryReadKey
tracking geometry for geometry signature
Definition: TrkExtrapolator.h:66
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
Trk::TrackingGeometry::trackingVolume
const TrackingVolume * trackingVolume(const std::string &name) const
return the tracking Volume by name, 0 if it doesn't exist
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
Trk::TrackingVolume
Definition: TrackingVolume.h:121