ATLAS Offline Software
Loading...
Searching...
No Matches
MuonTGMeasurementTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONTGRECTOOLS_MUONTGMEASUREMENTTOOL_H
6#define MUONTGRECTOOLS_MUONTGMEASUREMENTTOOL_H
7
8#include <fstream>
9#include <string>
10#include <vector>
11
14#include "GaudiKernel/ConcurrencyFlags.h"
15#include "GaudiKernel/ServiceHandle.h"
19#include "MuonTGHits.h"
21#include "MuonTGSegments.h"
33#include "TrkTrack/Track.h"
35
36namespace MuonGM {
38}
39
40namespace Muon {
41
48
49 class MuonTGMeasurementTool : public AthAlgTool, virtual public IMuonTGMeasTool {
50 public:
52 typedef std::pair<const Trk::Layer*, std::vector<Identifier>*> PairOfLayerID;
53 typedef std::pair<const Trk::Layer*, std::vector<const Trk::PrepRawData*>*> PairOfLayerPrd;
54
56 MuonTGMeasurementTool(const std::string& type, const std::string& name, const IInterface*);
57
58 virtual ~MuonTGMeasurementTool() = default;
59
60 virtual StatusCode initialize() override;
61
62 const Trk::TrackParameters* layerToDetEl(const Trk::Layer*, const Trk::TrackParameters*, Identifier) const override;
63 const Trk::TrackParameters* detElToLayer(const Trk::Layer*, const Trk::TrackParameters*, Identifier) const override;
64 const Trk::RIO_OnTrack* measToLayer(const Trk::Layer*, const Trk::TrackParameters*, const Trk::RIO_OnTrack*) const override;
65 double residual(const Trk::Layer*, const Trk::TrackParameters*, const Trk::RIO_OnTrack*) const override;
66 double residual(const Trk::Layer*, const Trk::TrackParameters*, Identifier) const override;
67 double residual(const Trk::TrackParameters*, const Trk::RIO_OnTrack*) const override;
68 double residual(const Trk::TrackParameters*, Identifier&) const override;
69 const Identifier nearestDetEl(const Trk::Layer*, const Trk::TrackParameters*, bool measPhi, double& pitch) const override;
70 const Trk::Layer* associatedLayer(Identifier id, Amg::Vector3D& gp) const override;
71 const Trk::Layer* associatedLayer(Identifier id, const Trk::TrackingVolume* vol) const override;
72 const Trk::Layer* match(Identifier id, const Trk::Layer* lay) const override;
73
74 private:
75 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
76
77 SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey{this, "DetectorManagerKey", "MuonDetectorManager",
78 "Key of input MuonDetectorManager condition data"};
79
81 "TrackingGeometrySvc/AtlasTrackingGeometrySvc"};
82
84 "Key of input TrackingGeometry"};
85
86 const MuonGM::MuonDetectorManager* m_muonDetMgr; // nominal MuonDetectorManager from DetectorStore (used if UseDSManager=true)
87
88 // projection matrices
89 std::unique_ptr<AmgMatrix(5, 5)> m_tgcProjEta;
90 std::unique_ptr<AmgMatrix(5, 5)> m_tgcProjPhi;
91 std::unique_ptr<AmgMatrix(5, 5)> m_rpcProjEta;
92 std::unique_ptr<AmgMatrix(5, 5)> m_rpcProjPhi;
93
94 // steering
95 Gaudi::Property<bool> m_alignedMode{this, "AlignedMode", true};
96 Gaudi::Property<bool> m_useDSManager{this, "UseDSManager", false};
97
98 inline const Trk::TrackingGeometry* getGeometry() const {
100 if (m_trackingGeometryReadKey.empty()) { return m_trackingGeometrySvc->trackingGeometry(); }
101 SG::ReadCondHandle<Trk::TrackingGeometry> handle(m_trackingGeometryReadKey, Gaudi::Hive::currentContext());
102 if (!handle.isValid()) {
103 ATH_MSG_WARNING("Could not retrieve a valid tracking geometry");
104 return nullptr;
105 }
106 return handle.cptr();
107 }
108 };
109
110} // namespace Muon
111
112#endif // MUONTGRECTOOLS_MUONTGMEASUREMENTTOOL_H
#define ATH_MSG_WARNING(x)
#define AmgMatrix(rows, cols)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
contain application tools for (muon) tracking geometry
Gaudi::Property< bool > m_useDSManager
std::unique_ptr< AmgMatrix(5, 5)> m_rpcProjEta
const Trk::TrackParameters * layerToDetEl(const Trk::Layer *, const Trk::TrackParameters *, Identifier) const override
const Trk::RIO_OnTrack * measToLayer(const Trk::Layer *, const Trk::TrackParameters *, const Trk::RIO_OnTrack *) const override
MuonTGMeasurementTool(const std::string &type, const std::string &name, const IInterface *)
Constructor with AlgTool parameters.
SG::ReadCondHandleKey< Trk::TrackingGeometry > m_trackingGeometryReadKey
const Identifier nearestDetEl(const Trk::Layer *, const Trk::TrackParameters *, bool measPhi, double &pitch) const override
virtual ~MuonTGMeasurementTool()=default
const MuonGM::MuonDetectorManager * m_muonDetMgr
virtual StatusCode initialize() override
Gaudi::Property< bool > m_alignedMode
std::unique_ptr< AmgMatrix(5, 5)> m_rpcProjPhi
const Trk::Layer * match(Identifier id, const Trk::Layer *lay) const override
const Trk::TrackingGeometry * getGeometry() const
double residual(const Trk::Layer *, const Trk::TrackParameters *, const Trk::RIO_OnTrack *) const override
ServiceHandle< Trk::ITrackingGeometrySvc > m_trackingGeometrySvc
const Trk::Layer * associatedLayer(Identifier id, Amg::Vector3D &gp) const override
std::pair< const Trk::Layer *, std::vector< Identifier > * > PairOfLayerID
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
std::pair< const Trk::Layer *, std::vector< const Trk::PrepRawData * > * > PairOfLayerPrd
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::unique_ptr< AmgMatrix(5, 5)> m_tgcProjPhi
const Trk::TrackParameters * detElToLayer(const Trk::Layer *, const Trk::TrackParameters *, Identifier) const override
std::unique_ptr< AmgMatrix(5, 5)> m_tgcProjEta
const_pointer_type cptr()
Base Class for a Detector Layer in the Tracking realm.
Definition Layer.h:72
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Definition RIO_OnTrack.h:70
The TrackingGeometry class is the owner of the constructed TrackingVolumes.
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the Athena extensions are properly loaded.
Definition GeoMuonHits.h:27
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
ParametersBase< TrackParametersDim, Charged > TrackParameters