|
ATLAS Offline Software
|
#include <RtCalibrationIntegration.h>
|
void | init (bool close_hits, double r_max, double lower_extrapolation_radius, double higher_extrapolation_radius, bool add_tmax_difference) |
|
This class allows the user to obtain an r-t relationship from the drift time spectrum in a given calibration region. The user can ask the class to restrict the r-t determination on hit on the segments or to use close hits too. The algorithms performs a t0 and tmax fit in order to get t(r=0) and t(r=rmax) right.
Definition at line 33 of file RtCalibrationIntegration.h.
◆ MdtCalibOutputPtr
◆ MuonSegCit
◆ MuonSegIt
◆ MuonSegVec
◆ RtCalibrationIntegration() [1/2]
MuonCalib::RtCalibrationIntegration::RtCalibrationIntegration |
( |
const std::string & |
name | ) |
|
|
inline |
Default constructor.
Only hits on the segment are used by the algorithm by default. The maximum drift radius is set to 14.6 mm.
Definition at line 36 of file RtCalibrationIntegration.h.
◆ RtCalibrationIntegration() [2/2]
MuonCalib::RtCalibrationIntegration::RtCalibrationIntegration |
( |
const std::string & |
name, |
|
|
bool |
close_hits, |
|
|
double |
r_max, |
|
|
double |
lower_extrapolation_radius, |
|
|
double |
upper_extrapolation_radius, |
|
|
bool |
add_tmax_difference |
|
) |
| |
|
inline |
Constructor.
If close_hits is set to true, also close hits are used. The maximum drift radius is set to r_max [mm].
Definition at line 40 of file RtCalibrationIntegration.h.
◆ analyse()
bool RtCalibrationIntegration::analyse |
( |
void |
| ) |
|
perform the integration method
Definition at line 85 of file RtCalibrationIntegration.cxx.
98 std::array<T0MTHistos, 2> drift_time_spec_ml;
103 unsigned int nb_bins(100);
105 std::vector<SamplePoint> point(nb_bins + 1);
116 log << MSG::WARNING <<
"analyse() - Less than 2000 drift-time entries! No r-t relationship will be determined!" <<
endmsg;
130 float min_t =
m_t_drift[0].first - 100.0;
132 std::unique_ptr<TH1F> tspec = std::make_unique<TH1F>(
"tspec",
"DRIFT-TIME SPECTRUM", n_bins, min_t, max_t);
133 std::array<std::unique_ptr<TH1F>, 2> tspec_ml;
134 tspec_ml[0] = std::make_unique<TH1F>(
"tspec_ml0",
"DRIFT-TIME SPECTRUM ML 0", n_bins, min_t, max_t);
135 tspec_ml[1] = std::make_unique<TH1F>(
"tspec_ml1",
"DRIFT-TIME SPECTRUM ML 1", n_bins, min_t, max_t);
138 tspec->Fill(
k.first, 1.0);
139 tspec_ml[
static_cast<unsigned int>(
k.second)]->Fill(
k.first, 1.0);
141 drift_time_spec.
SetTSpec(1, tspec.get(), &t0_setting,
false);
142 drift_time_spec_ml[0].SetTSpec(2, tspec_ml[0].
get(), &t0_setting,
false);
143 drift_time_spec_ml[1].SetTSpec(3, tspec_ml[1].
get(), &t0_setting,
false);
147 if (!drift_time_spec.
FitT0() || !drift_time_spec.
T0Ok()) {
149 log << MSG::WARNING <<
"analyse() - t0 fit not successful, no r-t relationship will be calculated!" <<
endmsg;
154 if (!drift_time_spec.
FitTmax() || !drift_time_spec.
TmaxOk()) {
156 log << MSG::WARNING <<
"analyse() - tmax fit not successful, no r-t relationship will be calculated!" <<
endmsg;
170 bin_content =
static_cast<double>(
m_nb_hits_used) /
static_cast<double>(nb_bins);
175 point[0].set_x2(0.0);
176 point[0].set_error(0.1);
179 for (
unsigned int k = 1;
k < nb_bins;
k++) {
181 point[
k].set_x1(
m_t_drift[k_min +
static_cast<int>(bin_content) * (
k)].
first);
183 point[
k].set_error(1.0);
186 point[nb_bins].set_x1(tmax);
187 point[nb_bins].set_x2(
m_r_max);
188 point[nb_bins].set_error(1.);
196 std::vector<SamplePoint> add_fit_point;
201 std::shared_ptr<IRtRelation> rt_new = std::make_shared<RtRelationLookUp>(tmp_rt);
209 std::array<float, 2>
b{}, tmax{},
T{};
210 for (
unsigned int i = 0;
i < 2;
i++) {
211 if (!drift_time_spec_ml[
i].FitT0()) {
215 if (!drift_time_spec_ml[
i].FitTmax()) {
225 int refit =
static_cast<int>((
b[1] + 1.33717e-03) > (
b[0] + 1.33717
e-03));
226 int norefit =
static_cast<bool>(refit) ? 0 : 1;
227 TF1 *fixfun = drift_time_spec_ml[refit].GetTMaxFunctionNC();
230 TList *
l = drift_time_spec_ml[refit].GetTSpec()->GetListOfFunctions();
231 l->Remove(
l->FindObject(
"mt_tmax_fermi"));
232 fit_ok = drift_time_spec_ml[refit].FitTmax();
244 m_output = std::make_unique<RtCalibrationOutput>(
245 rt_new, std::make_shared<RtFullInfo>(
"RtCalibrationIntegration", 1,
m_nb_segments_used, 0.0, 0.0, 0.0, 0.0));
◆ analyseSegments()
◆ converged()
bool RtCalibrationIntegration::converged |
( |
void |
| ) |
const |
◆ getResults()
◆ handleSegment()
◆ init()
void RtCalibrationIntegration::init |
( |
bool |
close_hits, |
|
|
double |
r_max, |
|
|
double |
lower_extrapolation_radius, |
|
|
double |
higher_extrapolation_radius, |
|
|
bool |
add_tmax_difference |
|
) |
| |
|
private |
◆ name()
virtual std::string MuonCalib::IMdtCalibration::name |
( |
| ) |
const |
|
inlinevirtualinherited |
◆ number_of_hits_used()
unsigned int RtCalibrationIntegration::number_of_hits_used |
( |
void |
| ) |
const |
◆ setInput()
◆ m_add_tmax_difference
bool MuonCalib::RtCalibrationIntegration::m_add_tmax_difference |
|
private |
◆ m_close_hits
bool MuonCalib::RtCalibrationIntegration::m_close_hits |
|
private |
◆ m_lower_extrapolation_radius
double MuonCalib::RtCalibrationIntegration::m_lower_extrapolation_radius |
|
private |
◆ m_name
std::string MuonCalib::IMdtCalibration::m_name |
|
privateinherited |
◆ m_nb_hits_used
unsigned int MuonCalib::RtCalibrationIntegration::m_nb_hits_used |
|
private |
◆ m_nb_segments_used
unsigned int MuonCalib::RtCalibrationIntegration::m_nb_segments_used |
|
private |
◆ m_output
◆ m_r_max
double MuonCalib::RtCalibrationIntegration::m_r_max |
|
private |
◆ m_rt
std::shared_ptr<IRtRelation> MuonCalib::RtCalibrationIntegration::m_rt |
|
private |
◆ m_t_drift
std::vector<std::pair<double, bool> > MuonCalib::RtCalibrationIntegration::m_t_drift |
|
private |
◆ m_upper_extrapolation_radius
double MuonCalib::RtCalibrationIntegration::m_upper_extrapolation_radius |
|
private |
parabolic extrapolation.
the parabolic fit will be performet between the lower extrapolation radius and the upper extrapolation value and be extrapolated till r_max
Definition at line 76 of file RtCalibrationIntegration.h.
The documentation for this class was generated from the following files:
const T0MTSettingsTMax * TMaxSettings() const
get settings for the tmax-fit
const double & ScrambleThreshold() const
the chi2 threshold at which the scrambling method is used
unsigned int m_nb_hits_used
bool handleSegment(MuonCalibSegment &seg)
analyse the segment "seg"
bool m_add_tmax_difference
std::vector< ALFA_RawData_p1 > t0
bool analyse(void)
perform the integration method
const TF1 * GetT0Function() const
returns function fitted to the riding edge of the spectrum
unsigned int m_nb_segments_used
const T0MTSettingsT0 * T0Settings() const
get settings for the t0-fit
const double & SlicingThreshold() const
the chi2 threshold at which the slicing method is used
Equidistant look up table for rt-relations with the time as key.
IMessageSvc * getMessageSvc(bool quiet=false)
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
std::shared_ptr< IRtRelation > m_rt
unsigned int mdtCloseHits() const
retrieve the number of nearby mdt hits.
double m_upper_extrapolation_radius
parabolic extrapolation.
bool FitTmax()
Performs tmax-fit Returns true if fit is successfull.
void SetTSpec(int id, TH1F *spec, const T0MTSettings *settings, bool copy_spec=true)
set the pointer of the drift-time spectrum to an existing spectrum.
MdtCalibOutputPtr getResults() const override
returns the final r-t relationship
std::shared_ptr< RtCalibrationOutput > m_output
static RtChebyshev getRtChebyshev(const std::vector< SamplePoint > &sample_points, const unsigned int &order)
< get an RtChebyshev resembling the r(t) function as described by the sample points in the vector "sa...
double m_lower_extrapolation_radius
sets the lower radius to perform the
static constexpr int TMAX_PAR_NR_B
static constexpr int T0_PAR_NR_T0
parameter numbers in t0 fit
void SetTmaxDiff(const float &d)
set the difference in total drift time betwene the two multilayers (ML1 - ML2)
unsigned int mdtHitsOnTrack() const
retrieve the number of MdtCalibHitBase s assigned to this segment
const TF1 * GetTMaxFunction() const
returns function fitted to the riding edge of the spectrum
bool FitT0()
Perform t0-fit Returns true if fit is successfull.
const bool & AddFitfun() const
If set to true the fitted functions are added to the histograms.
static constexpr int TMAX_PAR_NR_T
std::vector< std::pair< double, bool > > m_t_drift
double GetEntries(TH1D *h, int ilow, int ihi)
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
static constexpr int TMAX_PAR_NR_TMAX
parameters numbers for tmax fit
const double & DistAB() const
Distance of the a/b region from the detected falling edge.
const MdtHitVec & mdtHOT() const
retrieve the full set of MdtCalibHitBase s assigned to this segment
void update_parameter_on_mttmax(TH1 *h, TF1 *f, const float &b, const float &T, const T0MTSettingsTMax &tmax_settings)
bool T0Ok() const
returns true if t0-fit was successfull
bool TmaxOk() const
returns true if tmax-fir was successfull