ATLAS Offline Software
Loading...
Searching...
No Matches
T0CalibrationMT.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef T0CALIBRATIONMT_H
6#define T0CALIBRATIONMT_H
7
8#include <iostream>
9#include <map>
10#include <set>
11#include <string>
12#include <vector>
13#include <memory>
17
18class TH1;
19class TFile;
20class TDirectory;
21
22namespace MuonCalib {
23
24 class MuonCalibSegment;
26 class MuonFixedId;
27 class T0MTSettings;
28 class T0MTHistos;
29 class T0ADCHistos;
30 class ADCMTHistos;
31 class HistogramId;
33
41 public:
47
48 T0CalibrationMT(const std::string& name,
49 std::shared_ptr<const T0MTSettings> settings,
50 const std::vector<int> &sort_by,
51 const std::vector<int> &adc_sort_by);
52
55
57
58 void setInput(const IMdtCalibrationOutput *input) override;
59
60 bool analyse();
61
62 bool converged() const;
63
66 virtual IMdtCalibration::MdtCalibOutputPtr getResults() const override;
67
69
70 private:
71 T0MTHistos *getHistos(const MuonFixedId &idtube, unsigned int nr);
72 ADCMTHistos *getADCHistos(const MuonFixedId &idtube, unsigned int nr);
73 bool analyse_tdc(const int &nr, std::map<int, MdtTubeFitContainer::SingleTubeFit> &full,
74 std::map<int, MdtTubeFitContainer::SingleTubeCalib> &st, std::map<int, std::string> &fit_by_map);
75 bool analyse_adc(const int &nr, std::map<int, MdtTubeFitContainer::SingleTubeFit> &full,
76 std::map<int, MdtTubeFitContainer::SingleTubeCalib> &st);
77
78 void doTimeFit(T0MTHistos *T0h, const std::set<MuonFixedId> &tube_ids, std::map<int, MdtTubeFitContainer::SingleTubeFit> &fim,
79 std::map<int, MdtTubeFitContainer::SingleTubeCalib> &stcm, std::map<int, std::string> &fit_by_map,
80 const std::string &fit_by);
81
82 void doAdcFit(ADCMTHistos *T0h, const std::set<MuonFixedId> &tube_ids, std::map<int, MdtTubeFitContainer::SingleTubeFit> &fim,
83 std::map<int, MdtTubeFitContainer::SingleTubeCalib> &stcm);
84
85 std::shared_ptr<const T0MTSettings> m_settings;
87 std::string m_name;
89 std::unique_ptr<TFile> m_file;
90 TDirectory *m_regiondir;
91
92 std::vector<std::map<HistogramId, std::unique_ptr<T0MTHistos>>> m_histos;
93 std::vector<std::map<HistogramId, std::unique_ptr<ADCMTHistos>>> m_adc_histos;
94 std::vector<std::map<HistogramId, std::set<MuonFixedId>>> m_tube_ids;
95 std::vector<std::map<HistogramId, std::set<MuonFixedId>>> m_adc_tube_ids;
96 std::map<int, int> m_nhits_per_tube;
97 std::map<NtupleStationId, MdtTubeFitContainer *> m_result;
98 std::map<NtupleStationId, MdtRelativeTubeT0> m_rel_tube_t0s;
99 const std::vector<int> &m_sort_by;
100 const std::vector<int> &m_adc_sort_by;
101
102 // hidden assignment operator and copy constructor
105 };
106} // namespace MuonCalib
107
108#endif
Histogram and fitter class for drift time and pulsehight spectra The rising slope is fitted by a ferm...
Definition ADCMTHistos.h:44
Identifier class for drift time histograms.
Definition HistogramId.h:24
Interface to pass calibration output during calibration.
IMdtCalibration(const std::string &name)
constructor, string used to identify the instance
virtual std::string name() const
returns name (region) of instance
std::shared_ptr< IMdtCalibrationOutput > MdtCalibOutputPtr
std::vector< std::shared_ptr< MuonCalibSegment > > MuonSegVec
A MuonCalibSegment is a reconstructed three dimensional track segment in the MuonSpectrometer.
Implements fixed identifiers not dependent upon Athena Identifier for internal use in the calibration...
Definition MuonFixedId.h:50
std::unique_ptr< TFile > m_file
pointer to the histogram file
void doTimeFit(T0MTHistos *T0h, const std::set< MuonFixedId > &tube_ids, std::map< int, MdtTubeFitContainer::SingleTubeFit > &fim, std::map< int, MdtTubeFitContainer::SingleTubeCalib > &stcm, std::map< int, std::string > &fit_by_map, const std::string &fit_by)
fit time spectrum
std::vector< std::map< HistogramId, std::unique_ptr< ADCMTHistos > > > m_adc_histos
vector of pointers tube histograms
virtual IMdtCalibration::MdtCalibOutputPtr getResults() const override
T0MTHistos * getHistos(const MuonFixedId &idtube, unsigned int nr)
retrieve pointer for tube idtube histograms
bool analyse_adc(const int &nr, std::map< int, MdtTubeFitContainer::SingleTubeFit > &full, std::map< int, MdtTubeFitContainer::SingleTubeCalib > &st)
T0CalibrationMT & operator=(const T0CalibrationMT &right)=delete
std::shared_ptr< const T0MTSettings > m_settings
pointer to the settings
void setInput(const IMdtCalibrationOutput *input) override
unused
void doAdcFit(ADCMTHistos *T0h, const std::set< MuonFixedId > &tube_ids, std::map< int, MdtTubeFitContainer::SingleTubeFit > &fim, std::map< int, MdtTubeFitContainer::SingleTubeCalib > &stcm)
fit adc spectrum
std::vector< std::map< HistogramId, std::set< MuonFixedId > > > m_adc_tube_ids
int m_currentItnum
current iteration (always 1?)
bool m_converged
convergence status
bool handleSegment(MuonCalibSegment &seg)
fill tube spectra
std::vector< std::map< HistogramId, std::set< MuonFixedId > > > m_tube_ids
bool analyse()
extract parameters from spectra
std::map< int, int > m_nhits_per_tube
number of hits per tube
std::map< NtupleStationId, MdtTubeFitContainer * > m_result
tube constants
T0CalibrationMT(const std::string &name, std::shared_ptr< const T0MTSettings > settings, const std::vector< int > &sort_by, const std::vector< int > &adc_sort_by)
constructor
TDirectory * m_regiondir
pointer to the ROOT directory
const std::vector< int > & m_sort_by
std::vector< std::map< HistogramId, std::unique_ptr< T0MTHistos > > > m_histos
vector of pointers tube histograms
virtual IMdtCalibration::MdtCalibOutputPtr analyseSegments(const MuonSegVec &segs) override
new interface function
bool converged() const
return m_converged
bool analyse_tdc(const int &nr, std::map< int, MdtTubeFitContainer::SingleTubeFit > &full, std::map< int, MdtTubeFitContainer::SingleTubeCalib > &st, std::map< int, std::string > &fit_by_map)
std::map< NtupleStationId, MdtRelativeTubeT0 > m_rel_tube_t0s
ADCMTHistos * getADCHistos(const MuonFixedId &idtube, unsigned int nr)
retrieve pointer for tube idtube histograms
const std::vector< int > & m_adc_sort_by
std::string m_name
calibration region name
T0CalibrationMT(const T0CalibrationMT &)=delete
Histogram and fitter class for drift time and pulsehight spectra The rising slope is fitted by a ferm...
Definition T0MTHistos.h:40
Settings for the T0 calibration (histogram booking and fitting parameters) Parameters for pattern rec...
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.