![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <T0CalibrationMT.h>
|
T0MTHistos * | getHistos (const MuonFixedId &idtube, unsigned int nr) |
| retrieve pointer for tube idtube histograms More...
|
|
ADCMTHistos * | getADCHistos (const MuonFixedId &idtube, unsigned int nr) |
| retrieve pointer for tube idtube histograms More...
|
|
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) |
|
bool | analyse_adc (const int &nr, std::map< int, MdtTubeFitContainer::SingleTubeFit > &full, std::map< int, MdtTubeFitContainer::SingleTubeCalib > &st) |
|
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 More...
|
|
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 More...
|
|
T0CalibrationMT & | operator= (const T0CalibrationMT &right)=delete |
|
| T0CalibrationMT (const T0CalibrationMT &)=delete |
|
◆ MdtCalibOutputPtr
◆ MuonSegCit
◆ MuonSegIt
◆ MuonSegVec
◆ T0CalibrationMT() [1/2]
MuonCalib::T0CalibrationMT::T0CalibrationMT |
( |
const std::string & |
name, |
|
|
const T0MTSettings * |
settings, |
|
|
const std::vector< int > & |
sort_by, |
|
|
const std::vector< int > & |
adc_sort_by |
|
) |
| |
constructor
- Parameters
-
[in] | name | of the region/chamber to be calibrated |
[in] | pointer | to settings vector |
[in] | sorting | criteria (TUBE, CHAMBER, MULTILAYER...) default is by TUBE |
Definition at line 33 of file T0CalibrationMT.cxx.
48 std::string HistoFileName =
"T0MT_" +
m_name +
".root";
49 m_file = std::make_unique<TFile>(HistoFileName.c_str(),
"recreate");
◆ ~T0CalibrationMT()
MuonCalib::T0CalibrationMT::~T0CalibrationMT |
( |
| ) |
|
◆ T0CalibrationMT() [2/2]
◆ analyse()
bool MuonCalib::T0CalibrationMT::analyse |
( |
| ) |
|
extract parameters from spectra
Definition at line 106 of file T0CalibrationMT.cxx.
108 std::map<int, MdtTubeFitContainer::SingleTubeFit>
full;
109 std::map<int, MdtTubeFitContainer::SingleTubeCalib> st;
110 std::map<int, std::string> fit_by;
116 if (
it.first == 0)
continue;
117 MuonFixedId fId(
it.first);
118 NtupleStationId sid(fId);
119 sid.SetMultilayer(0);
122 fi.group_by = fit_by[
it.first];
123 int nML = fId.mdtMultilayer();
124 int nL = fId.mdtTubeLayer();
125 int nT = fId.mdtTube();
127 const Identifier tubeId = idHelper.channelID(fId.stationNameString(),
128 fId.eta(), fId.phi(), nML, nL, nT);
130 bool setInfo =
m_result[sid]->setCalib(std::move(stc), tubeId,
log);
132 log << MSG::WARNING <<
"T0CalibrationMT::PROBLEM! could not set SingleTubeCalib info" <<
endmsg;
139 log << MSG::WARNING <<
"T0CalibrationMT::PROBLEM! could not set SingleTubeFit info" <<
endmsg;
◆ analyse_adc()
◆ analyse_tdc()
◆ analyseSegments()
◆ converged()
bool MuonCalib::T0CalibrationMT::converged |
( |
| ) |
const |
◆ doAdcFit()
fit adc spectrum
Definition at line 241 of file T0CalibrationMT.cxx.
245 const TF1 *
fun(T0h->GetAdcFunction());
246 if (
fun ==
nullptr)
return;
247 for (
auto tube_id : tube_ids) {
248 if (
tube_id.getIdInt() == 0)
continue;
252 stc.adcCal =
fun->GetParameter(1);
253 for (
int i = 0; (
i <
fun->GetNpar() &&
i < 4);
i++) {
254 fi.adc_par[
i] =
fun->GetParameter(
i);
255 fi.adc_err[
i] =
fun->GetParError(
i);
257 fi.adc_chi2 =
fun->GetChisquare() /
fun->GetNDF();
◆ doTimeFit()
fit time spectrum
Definition at line 185 of file T0CalibrationMT.cxx.
193 if (fit_by ==
"CHAMBER")
195 else if (fit_by ==
"MULTILAYER")
197 else if (fit_by ==
"LAYER")
199 else if (fit_by ==
"MEZZ_CARD")
202 const TF1 *
fun(T0h->GetT0Function());
203 for (
auto tube_id : tube_ids) {
204 if (
tube_id.getIdInt() == 0)
continue;
206 stId.SetMultilayer(0);
212 fi.statistics =
static_cast<int>(T0h->GetTSpec()->GetEntries());
213 fi.chi2Tdc = T0h->T0Chi2();
221 stc.statusCode = T0h->StatusCode();
223 fit_by_map[
tube_id.getIdInt()] = fit_by;
227 const TF1 *
fun(T0h->GetTMaxFunction());
229 for (
auto tube_id : tube_ids) {
230 if (
tube_id.getIdInt() == 0)
continue;
235 fi.chi2TdcEnd =
fun->GetChisquare() /
fun->GetNDF();
◆ getADCHistos()
◆ getHistos()
◆ getResults()
◆ handleSegment()
fill tube spectra
Definition at line 65 of file T0CalibrationMT.cxx.
67 MuonFixedId
id = hit->identify();
70 int nML =
id.mdtMultilayer();
71 int nL =
id.mdtTubeLayer();
72 int nT =
id.mdtTube();
74 NtupleStationId sid(
id);
76 std::map<NtupleStationId, MdtTubeFitContainer *>::const_iterator res_it(
m_result.find(sid));
78 const MdtIdHelper& idHelper{res_it->second->idHelperSvc()->mdtIdHelper()};
79 const Identifier tubeId = idHelper.channelID(
id.stationNameString(),
80 id.
eta(),
id.
phi(), nML, nL, nT);
81 stc = res_it->second->getCalib(tubeId);
88 log << MSG::WARNING <<
"no Single Tube Calib info found for ML=" << nML <<
" L=" << nL <<
" T=" << nT <<
endmsg;
94 histos->GetTSpec()->Fill(hit->driftTime() + oldT0 + hit->tubeT0());
98 adc_histos->GetADCSpec()->Fill(hit->adcCount());
◆ name()
virtual std::string MuonCalib::IMdtCalibration::name |
( |
| ) |
const |
|
inlinevirtualinherited |
◆ operator=()
◆ setInput()
unused
Implements MuonCalib::IMdtCalibration.
Definition at line 290 of file T0CalibrationMT.cxx.
297 const T0CalibrationOutput *t0Input =
dynamic_cast<const T0CalibrationOutput *
>(calib_in);
298 if (!calib_in || !t0Input)
return;
301 it.second->setImplementation(
"T0CalibrationMT");
◆ m_adc_histos
◆ m_adc_sort_by
const std::vector<int>& MuonCalib::T0CalibrationMT::m_adc_sort_by |
|
private |
◆ m_adc_tube_ids
◆ m_converged
bool MuonCalib::T0CalibrationMT::m_converged |
|
private |
◆ m_currentItnum
int MuonCalib::T0CalibrationMT::m_currentItnum |
|
private |
◆ m_delete_settings
bool MuonCalib::T0CalibrationMT::m_delete_settings |
|
private |
◆ m_file
std::unique_ptr<TFile> MuonCalib::T0CalibrationMT::m_file |
|
private |
◆ m_histos
◆ m_name
std::string MuonCalib::T0CalibrationMT::m_name |
|
private |
◆ m_nhits_per_tube
std::map<int, int> MuonCalib::T0CalibrationMT::m_nhits_per_tube |
|
private |
◆ m_regiondir
TDirectory* MuonCalib::T0CalibrationMT::m_regiondir |
|
private |
◆ m_rel_tube_t0s
◆ m_result
◆ m_settings
◆ m_sort_by
const std::vector<int>& MuonCalib::T0CalibrationMT::m_sort_by |
|
private |
◆ m_tube_ids
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
std::map< NtupleStationId, MdtTubeFitContainer * > m_result
tube constants
std::unique_ptr< TFile > m_file
pointer to the histogram file
IMdtCalibration(const std::string &name)
constructor, string used to identify the instance
std::vector< std::map< HistogramId, std::set< MuonFixedId > > > m_adc_tube_ids
const int & MinEntriesADC() const
Scalar phi() const
phi method
int m_currentItnum
current iteration (always 1?)
const int & MinEntriesTime() const
Scalar eta() const
pseudorapidity method
MdtTubeFitContainer::SingleTubeFit SingleTubeFit
const bool & CorrectRelT0s() const
virtual IMdtCalibration::MdtCalibOutputPtr getResults() const override
std::map< int, int > m_nhits_per_tube
number of hits per tube
const T0MTSettingsT0 * T0Settings() const
get settings for the t0-fit
bool analyse_adc(const int &nr, std::map< int, MdtTubeFitContainer::SingleTubeFit > &full, std::map< int, MdtTubeFitContainer::SingleTubeCalib > &st)
IMessageSvc * getMessageSvc(bool quiet=false)
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
const std::vector< int > & m_sort_by
static constexpr int T0_PAR_NR_T
bool handleSegment(MuonCalibSegment &seg)
fill tube spectra
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
static constexpr int T0_PAR_NR_BACK
std::vector< std::map< HistogramId, std::unique_ptr< ADCMTHistos > > > m_adc_histos
vector of pointers tube histograms
const bool & FitADC() const
if true fit adc spectrum
static const int MEZZ_CARD
const int & VerboseLevel() const
verbose level 0: no output 1: Fitter output
std::vector< std::map< HistogramId, std::set< MuonFixedId > > > m_tube_ids
ADCMTHistos * getADCHistos(const MuonFixedId &idtube, unsigned int nr)
retrieve pointer for tube idtube histograms
const std::vector< int > & m_adc_sort_by
std::vector< std::map< HistogramId, std::unique_ptr< T0MTHistos > > > m_histos
vector of pointers tube histograms
const bool & FitTime() const
if true fit drift time spectrum
static constexpr int T0_PAR_NR_T0
parameter numbers in t0 fit
virtual std::string name() const
returns name (region) of instance
std::string m_name
calibration region name
static const int TUBE
valid values of the sort_by argument of the Initialize function
T0MTHistos * getHistos(const MuonFixedId &idtube, unsigned int nr)
retrieve pointer for tube idtube histograms
bool analyse()
extract parameters from spectra
TDirectory * m_regiondir
pointer to the ROOT directory
std::map< NtupleStationId, MdtRelativeTubeT0 > m_rel_tube_t0s
static const int MULTILAYER
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)
static constexpr int TMAX_PAR_NR_TMAX
parameters numbers for tmax fit
const T0MTSettings * m_settings
pointer to the settings
bool m_converged
convergence status
std::shared_ptr< MdtCalibHitBase > MdtHitPtr
typedef for a collection of MdtCalibHitBase s