|
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, |
|
|
std::shared_ptr< 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 32 of file T0CalibrationMT.cxx.
45 std::string HistoFileName =
"T0MT_" +
m_name +
".root";
46 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 102 of file T0CalibrationMT.cxx.
104 std::map<int, MdtTubeFitContainer::SingleTubeFit>
full;
105 std::map<int, MdtTubeFitContainer::SingleTubeCalib> st;
106 std::map<int, std::string> fit_by;
112 if (
it.first == 0)
continue;
113 MuonFixedId fId(
it.first);
114 NtupleStationId sid(fId);
115 sid.SetMultilayer(0);
118 fi.group_by = fit_by[
it.first];
119 int nML = fId.mdtMultilayer();
120 int nL = fId.mdtTubeLayer();
121 int nT = fId.mdtTube();
123 const Identifier tubeId = idHelper.channelID(fId.stationNameString(),
124 fId.eta(), fId.phi(), nML, nL, nT);
126 bool setInfo =
m_result[sid]->setCalib(std::move(stc), tubeId,
log);
128 log << MSG::WARNING <<
"T0CalibrationMT::PROBLEM! could not set SingleTubeCalib info" <<
endmsg;
135 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 237 of file T0CalibrationMT.cxx.
240 if (T0h->FitAdc() &&
m_settings->MinEntriesADC() <= T0h->GetADCSpec()->GetEntries()) {
241 const TF1 *
fun(T0h->GetAdcFunction());
242 if (
fun ==
nullptr)
return;
243 for (
auto tube_id : tube_ids) {
244 if (
tube_id.getIdInt() == 0)
continue;
248 stc.adcCal =
fun->GetParameter(1);
249 for (
int i = 0; (
i <
fun->GetNpar() &&
i < 4);
i++) {
250 fi.adc_par[
i] =
fun->GetParameter(
i);
251 fi.adc_err[
i] =
fun->GetParError(
i);
253 fi.adc_chi2 =
fun->GetChisquare() /
fun->GetNDF();
◆ doTimeFit()
fit time spectrum
Definition at line 181 of file T0CalibrationMT.cxx.
189 if (fit_by ==
"CHAMBER")
191 else if (fit_by ==
"MULTILAYER")
193 else if (fit_by ==
"LAYER")
195 else if (fit_by ==
"MEZZ_CARD")
197 if (T0h->FitT0() &&
m_settings->MinEntriesTime() <= T0h->GetTSpec()->GetEntries()) {
198 const TF1 *
fun(T0h->GetT0Function());
199 for (
auto tube_id : tube_ids) {
200 if (
tube_id.getIdInt() == 0)
continue;
202 stId.SetMultilayer(0);
208 fi.statistics =
static_cast<int>(T0h->GetTSpec()->GetEntries());
209 fi.chi2Tdc = T0h->T0Chi2();
217 stc.statusCode = T0h->StatusCode();
219 fit_by_map[
tube_id.getIdInt()] = fit_by;
222 if (T0h->FitTmax() &&
m_settings->MinEntriesTime() <= T0h->GetTSpec()->GetEntries()) {
223 const TF1 *
fun(T0h->GetTMaxFunction());
225 for (
auto tube_id : tube_ids) {
226 if (
tube_id.getIdInt() == 0)
continue;
231 fi.chi2TdcEnd =
fun->GetChisquare() /
fun->GetNDF();
◆ getADCHistos()
◆ getHistos()
◆ getResults()
◆ handleSegment()
fill tube spectra
Definition at line 61 of file T0CalibrationMT.cxx.
63 MuonFixedId
id = hit->identify();
66 int nML =
id.mdtMultilayer();
67 int nL =
id.mdtTubeLayer();
68 int nT =
id.mdtTube();
70 NtupleStationId sid(
id);
72 std::map<NtupleStationId, MdtTubeFitContainer *>::const_iterator res_it(
m_result.find(sid));
74 const MdtIdHelper& idHelper{res_it->second->idHelperSvc()->mdtIdHelper()};
75 const Identifier tubeId = idHelper.channelID(
id.stationNameString(),
76 id.
eta(),
id.
phi(), nML, nL, nT);
77 stc = res_it->second->getCalib(tubeId);
84 log << MSG::WARNING <<
"no Single Tube Calib info found for ML=" << nML <<
" L=" << nL <<
" T=" << nT <<
endmsg;
90 histos->GetTSpec()->Fill(hit->driftTime() + oldT0 + hit->tubeT0());
94 adc_histos->GetADCSpec()->Fill(hit->adcCount());
◆ name()
virtual std::string MuonCalib::IMdtCalibration::name |
( |
| ) |
const |
|
inlinevirtualinherited |
◆ operator=()
◆ setInput()
unused
Implements MuonCalib::IMdtCalibration.
Definition at line 286 of file T0CalibrationMT.cxx.
293 const T0CalibrationOutput *t0Input =
dynamic_cast<const T0CalibrationOutput *
>(calib_in);
294 if (!calib_in || !t0Input)
return;
297 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_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
int m_currentItnum
current iteration (always 1?)
std::shared_ptr< const T0MTSettings > m_settings
pointer to the settings
MdtTubeFitContainer::SingleTubeFit SingleTubeFit
virtual IMdtCalibration::MdtCalibOutputPtr getResults() const override
std::map< int, int > m_nhits_per_tube
number of hits per tube
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
static const int MEZZ_CARD
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
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
bool m_converged
convergence status
std::shared_ptr< MdtCalibHitBase > MdtHitPtr
typedef for a collection of MdtCalibHitBase s