ATLAS Offline Software
TrackParticlePerigeeAtBSAssociationTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
12 
13 #include "Particle/TrackParticle.h"
15 
16 namespace D3PD {
17 
18 
20 
22 
24 
25  // Pick up the TrackToVertex tool
26  StatusCode sc = m_trackToVertexTool.retrieve();
27  if(sc.isFailure()){
28  REPORT_MESSAGE (MSG::ERROR) << "Could not retrieve TrackToVertexTool";
29  return StatusCode::FAILURE;
30  }
31 
32  return StatusCode::SUCCESS;
33 }
34 
43 {
44  // Protect against bad tracks.
45  if (track.measuredPerigee()->covariance() && track.measuredPerigee()->covariance()->rows()==0)
46  return 0;
49  Amg::Vector3D beamSpot(0,0,0);
50  beamSpot = beamSpotHandle->beamVtx().position();
51 
52  return m_trackToVertexTool->perigeeAtVertex(Gaudi::Hive::currentContext(), track, beamSpot).release();
53 }
54 
63 {
65  Amg::Vector3D beamSpot(0,0,0);
67  beamSpot = beamSpotHandle->beamVtx().position();
68 
69  return m_trackToVertexTool->perigeeAtVertex(Gaudi::Hive::currentContext(), track, beamSpot).release();
70 }
71 
82 {
83  if(p) delete p;
84 }
85 
86 } // namespace D3PD
TrackParticle.h
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
initialize
void initialize()
Definition: run_EoverP.cxx:894
D3PD::TrackParticlePerigeeAtBSAssociationTool::initialize
virtual StatusCode initialize() override
Definition: TrackParticlePerigeeAtBSAssociationTool.cxx:19
TrackParticlePerigeeAtBSAssociationTool.h
Associate from a TrackParticle to its perigee at the beam spot.
D3PD::TrackParticlePerigeeAtBSAssociationTool::get
virtual const Trk::TrackParameters * get(const Rec::TrackParticle &p) override
Return the target object.
Definition: TrackParticlePerigeeAtBSAssociationTool.cxx:42
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
D3PD
Block filler tool for noisy FEB information.
Definition: CaloCellDetailsFillerTool.cxx:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
Trk::ParametersBase
Definition: ParametersBase.h:55
D3PD::TrackParticlePerigeeAtBSAssociationTool::m_trackToVertexTool
ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
Definition: TrackParticlePerigeeAtBSAssociationTool.h:70
errorcheck.h
Helpers for checking error return status codes and reporting errors.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
REPORT_MESSAGE
#define REPORT_MESSAGE(LVL)
Report a message.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:365
Rec::TrackParticle
Definition: Reconstruction/Particle/Particle/TrackParticle.h:47
D3PD::TrackParticlePerigeeAtBSAssociationTool::releaseObject
virtual void releaseObject(const Trk::TrackParameters *p) override
Release an object retrieved from the association.
Definition: TrackParticlePerigeeAtBSAssociationTool.cxx:81
python.BuildSignatureFlags.beamSpot
AthConfigFlags beamSpot(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:454
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
D3PD::TrackParticlePerigeeAtBSAssociationTool::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: TrackParticlePerigeeAtBSAssociationTool.h:66