ATLAS Offline Software
MuonAlignmentUncertTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // MuonAlignmentUncertTool
7 // Helper classes to read the scattering and alignment uncertainties
8 // of the muons from the histograms
10 
11 #ifndef MUONCOMBINEDBASETOOLS_MUONALIGNMENTUNCERTTOOL_H
12 #define MUONCOMBINEDBASETOOLS_MUONALIGNMENTUNCERTTOOL_H
13 
15 #include <GaudiKernel/ServiceHandle.h>
19 #include <TrkTrack/Track.h>
21 
22 #include "GaudiKernel/ToolHandle.h"
24 #include <memory>
26 #include <TH1.h>
27 
28 #include <functional>
29 #include <map>
30 #include <string>
31 #include <vector>
32 
33 namespace Muon {
35  public:
36  MuonAlignmentUncertTool(const std::string& type, const std::string& name, const IInterface* parent);
38 
39  StatusCode initialize() override;
40 
41  float get_uncertainty(const Trk::Track* trk) const override;
42 
47  const Trk::TrackStateOnSurface*& calo_entrance, const Trk::TrackStateOnSurface*& calo_exit,
48  const Trk::TrackStateOnSurface*& ms_entrance) const override;
49 
50  private:
53  std::function<int(const Trk::Track* trk)> make_reader(const TAxis* axis) const;
54 
57  ServiceHandle<Trk::ITrackingVolumesSvc> m_trackingVolumesSvc{this, "TrackingVolumesSvc", "TrackingVolumesSvc/TrackingVolumesSvc"};
58 
59  Gaudi::Property<std::string> m_in_file{this, "InFile",
60  "MuonCombinedBaseTools/AlignmentUncertainties/201029_initial/ID_MS_Uncertainties.root",
61  "Location of the calibration file"};
62  Gaudi::Property<std::string> m_histo_name{this, "HistoName", "", "Name of the histogram in the file"};
63 
65  std::unique_ptr<TH1> m_histo;
66  unsigned int m_dim;
69  std::function<int(const Trk::Track* trk)> m_x_reader;
70  std::function<int(const Trk::Track* trk)> m_y_reader;
71  std::function<int(const Trk::Track* trk)> m_z_reader;
72 
73  std::unique_ptr<const Trk::Volume> m_calorimeterVolume;
74  std::unique_ptr<const Trk::Volume> m_indetVolume;
75  };
76 
77 } // namespace Muon
78 
79 #endif
Muon::MuonAlignmentUncertTool::m_x_reader
std::function< int(const Trk::Track *trk)> m_x_reader
Standard functions used to read the histogram having as input a Trk::Track.
Definition: MuonAlignmentUncertTool.h:69
Muon::MuonAlignmentUncertTool::m_trackingVolumesSvc
ServiceHandle< Trk::ITrackingVolumesSvc > m_trackingVolumesSvc
Volume service to.
Definition: MuonAlignmentUncertTool.h:57
Muon::MuonAlignmentUncertTool::get_uncertainty
float get_uncertainty(const Trk::Track *trk) const override
IMuonAlignmentUncertTool interface: retrieve the associated uncertainties.
Definition: MuonAlignmentUncertTool.cxx:64
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Muon::IMuonAlignmentUncertTool
Definition: IMuonAlignmentUncertTool.h:26
Muon::MuonAlignmentUncertTool::m_z_reader
std::function< int(const Trk::Track *trk)> m_z_reader
Definition: MuonAlignmentUncertTool.h:71
yodamerge_tmp.axis
list axis
Definition: yodamerge_tmp.py:241
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
Track.h
Muon::MuonAlignmentUncertTool::m_y_reader
std::function< int(const Trk::Track *trk)> m_y_reader
Definition: MuonAlignmentUncertTool.h:70
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
Muon::MuonAlignmentUncertTool::MuonAlignmentUncertTool
MuonAlignmentUncertTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MuonAlignmentUncertTool.cxx:27
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Muon::MuonAlignmentUncertTool::make_reader
std::function< int(const Trk::Track *trk)> make_reader(const TAxis *axis) const
Helper function to assign the uncertainty from the Axis.
Definition: MuonAlignmentUncertTool.cxx:76
Muon::MuonAlignmentUncertTool::~MuonAlignmentUncertTool
~MuonAlignmentUncertTool()=default
Muon::MuonAlignmentUncertTool::m_histo
std::unique_ptr< TH1 > m_histo
Histogram to be cached.
Definition: MuonAlignmentUncertTool.h:65
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Muon::MuonAlignmentUncertTool::m_calorimeterVolume
std::unique_ptr< const Trk::Volume > m_calorimeterVolume
Definition: MuonAlignmentUncertTool.h:73
Muon::MuonAlignmentUncertTool::m_histo_name
Gaudi::Property< std::string > m_histo_name
Definition: MuonAlignmentUncertTool.h:62
Muon::MuonAlignmentUncertTool
Definition: MuonAlignmentUncertTool.h:34
Muon::MuonAlignmentUncertTool::m_in_file
Gaudi::Property< std::string > m_in_file
Definition: MuonAlignmentUncertTool.h:59
Muon::MuonAlignmentUncertTool::m_dim
unsigned int m_dim
Definition: MuonAlignmentUncertTool.h:66
TrackingVolume.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Muon::MuonAlignmentUncertTool::get_track_state_measures
void get_track_state_measures(const Trk::Track *track, const Trk::TrackStateOnSurface *&id_exit, const Trk::TrackStateOnSurface *&calo_entrance, const Trk::TrackStateOnSurface *&calo_exit, const Trk::TrackStateOnSurface *&ms_entrance) const override
Helper method to retrieve the last measurement of the ID, the first and last scatterer in the calorim...
Definition: MuonAlignmentUncertTool.cxx:219
Muon::MuonAlignmentUncertTool::m_indetVolume
std::unique_ptr< const Trk::Volume > m_indetVolume
Definition: MuonAlignmentUncertTool.h:74
IMuonAlignmentUncertTool.h
Muon::MuonAlignmentUncertTool::initialize
StatusCode initialize() override
Definition: MuonAlignmentUncertTool.cxx:36
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
AthAlgTool
Definition: AthAlgTool.h:26
ITrackingVolumesSvc.h
TrackStateOnSurface.h
ServiceHandle< Trk::ITrackingVolumesSvc >