ATLAS Offline Software
Loading...
Searching...
No Matches
MuonTrackExtrapolationTool.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#ifndef MUON_MUONTRACKEXTRAPOLATIONTOOL_H
6#define MUON_MUONTRACKEXTRAPOLATIONTOOL_H
7
9#include "GaudiKernel/ServiceHandle.h"
10#include "GaudiKernel/ToolHandle.h"
17
18// For magneticfield
21
22namespace Muon {
23
29 public:
31 MuonTrackExtrapolationTool(const std::string &, const std::string &, const IInterface *);
32
34 virtual ~MuonTrackExtrapolationTool() = default;
35
37 virtual StatusCode initialize() override;
38
44 virtual std::unique_ptr<Trk::Track> extrapolate(const Trk::Track &track, const EventContext &ctx) const override;
45
51 virtual std::unique_ptr<TrackCollection> extrapolate(const TrackCollection &tracks, const EventContext &ctx) const override;
52
53 private:
54 double estimateDistanceToEntryRecord(const EventContext &ctx, const Trk::TrackParameters &pars) const;
55 static const Trk::TrackParameters *checkForSecondCrossing(const Trk::TrackParameters &firstCrossing, const Trk::Track &track) ;
56 const Trk::TrackParameters *findClosestParametersToMuonEntry(const EventContext &ctx, const Trk::Track &track) const;
57
60 std::unique_ptr<Trk::TrackParameters> extrapolateToMuonEntryRecord(const EventContext &ctx, const Trk::TrackParameters &pars,
61 Trk::ParticleHypothesis particleHypo = Trk::muon) const;
62
65 std::unique_ptr<Trk::TrackParameters> extrapolateToIP(const EventContext& ctx, const Trk::TrackParameters &pars,
66 Trk::ParticleHypothesis particleHypo = Trk::muon) const;
67
68 std::shared_ptr<Trk::Perigee> createPerigee(const EventContext& ctx, const Trk::TrackParameters &pars) const;
69
70 // Read handle for conditions object to get the field cache
71 SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCacheCondObjInputKey{this, "AtlasFieldCacheCondObj", "fieldCondObj",
72 "Name of the Magnetic Field conditions object key"};
73
75 "Key of input TrackingGeometry"};
76 ServiceHandle<Muon::IMuonEDMHelperSvc> m_edmHelperSvc{this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
77 "Handle to the service providing the IMuonEDMHelperSvc interface"};
78 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
79
80 PublicToolHandle<Muon::MuonEDMPrinterTool> m_printer{this, "EDMPrinter", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
81 "helper to nicely print out tracks"};
82 ToolHandle<Trk::IExtrapolator> m_atlasExtrapolator{this, "AtlasExtrapolator", "Trk::Extrapolator/AtlasExtrapolator"};
83 ToolHandle<Trk::IExtrapolator> m_muonExtrapolator{this, "MuonExtrapolator", "Trk::Extrapolator/MuonExtrapolator"};
84
85 Gaudi::Property<bool> m_cosmics{this, "Cosmics", false};
86 Gaudi::Property<bool> m_keepOldPerigee{this, "KeepInitialPerigee", true};
87 Gaudi::Property<std::string> m_msEntranceName{this, "MuonSystemEntranceName", "MuonSpectrometerEntrance"};
88
89 inline const Trk::TrackingVolume *getVolume(const std::string &vol_name, const EventContext &ctx) const {
91 if (!handle.isValid()) {
92 ATH_MSG_WARNING("Could not retrieve a valid tracking geometry");
93 return nullptr;
94 }
95 return handle.cptr()->trackingVolume(vol_name);
96 }
97 };
98} // namespace Muon
99
100#endif
#define ATH_MSG_WARNING(x)
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Interface class for tools extrapolating muon tracks to a location in the atlas detector.
ToolHandle< Trk::IExtrapolator > m_muonExtrapolator
static const Trk::TrackParameters * checkForSecondCrossing(const Trk::TrackParameters &firstCrossing, const Trk::Track &track)
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
std::shared_ptr< Trk::Perigee > createPerigee(const EventContext &ctx, const Trk::TrackParameters &pars) const
Gaudi::Property< std::string > m_msEntranceName
virtual std::unique_ptr< Trk::Track > extrapolate(const Trk::Track &track, const EventContext &ctx) const override
extrapolates a muon track to the muon entry record and returns a new track expressed at the destinati...
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::unique_ptr< Trk::TrackParameters > extrapolateToMuonEntryRecord(const EventContext &ctx, const Trk::TrackParameters &pars, Trk::ParticleHypothesis particleHypo=Trk::muon) const
extrapolates track parameters to muon entry record, will return a zero pointer if the extrapolation f...
MuonTrackExtrapolationTool(const std::string &, const std::string &, const IInterface *)
constructor
const Trk::TrackParameters * findClosestParametersToMuonEntry(const EventContext &ctx, const Trk::Track &track) const
const Trk::TrackingVolume * getVolume(const std::string &vol_name, const EventContext &ctx) const
virtual StatusCode initialize() override
AlgTool initilize.
ToolHandle< Trk::IExtrapolator > m_atlasExtrapolator
double estimateDistanceToEntryRecord(const EventContext &ctx, const Trk::TrackParameters &pars) const
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
SG::ReadCondHandleKey< Trk::TrackingGeometry > m_trackingGeometryReadKey
std::unique_ptr< Trk::TrackParameters > extrapolateToIP(const EventContext &ctx, const Trk::TrackParameters &pars, Trk::ParticleHypothesis particleHypo=Trk::muon) const
extrapolates track parameters to muon entry record, will return a zero pointer if the extrapolation f...
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
virtual ~MuonTrackExtrapolationTool()=default
destructor
const_pointer_type cptr()
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.
ParametersBase< TrackParametersDim, Charged > TrackParameters