![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <RtCalibrationCurved.h>
|
| RtCalibrationCurved (const std::string &name) |
| Default constructor: r-t accuracy is set to 0.5 mm. More...
|
|
| RtCalibrationCurved (const std::string &name, const double &rt_accuracy, const unsigned int &func_type, const unsigned int &ord, const bool &fix_min, const bool &fix_max, const int &max_it, bool do_parabolic_extrapolation=false, bool do_smoothing=false, bool do_multilayer_rt_scale=false) |
| Constructor. More...
|
|
| ~RtCalibrationCurved () |
| Destructor. More...
|
|
double | reliability () const |
| get the reliability of the final r-t relationship: 0: no convergence yet 1: convergence, r(t) is reliable 2: convergence, r(t) is unreliable More...
|
|
double | estimatedRtAccuracy () const |
| get the estimated r-t quality (CLHEP::mm), the accuracy of the input r-t is computed at the end of the iteration; in order to get the accuracy of the final r-t, the algorithm has to be rerun with the final r-t as an input More...
|
|
int | numberOfSegments () const |
| get the number of segments which were passed to the algorithm More...
|
|
int | numberOfSegmentsUsed () const |
| get the number of segments which are used in the autocalibration More...
|
|
int | iteration () const |
| get the number of the current iteration More...
|
|
bool | smoothing () const |
| returns true, if the r-t relationship will be smoothened using the conventional autocalibration after convergence; returns false otherwise More...
|
|
void | setEstimateRtAccuracy (const double &acc) |
| set the estimated r-t accuracy =acc More...
|
|
void | fullMatrix (const bool &yes_or_no) |
| yes_or_no=true: the full matrix relating the errors in the r-t relationship to the residuals is used yes_or_no=false: unit matrix is used (algorithm is equivalent to to the conventional/classical method More...
|
|
void | switch_on_control_histograms (const std::string &file_name) |
| this methods requests control histograms from the algorithms; the algorithm will write them to ROOT file called "file_name" More...
|
|
void | switch_off_control_histograms () |
| the algorithm does not produce controll histograms (this is the default) More...
|
|
void | forceMonotony () |
| force r(t) to be monotonically increasing (this is default) More...
|
|
void | doNotForceMonotony () |
| do not force r(t) to be monotonically increasing More...
|
|
void | doParabolicExtrapolation () |
| requires that parabolic extrapolation will be used for small and large radii More...
|
|
void | noParabolicExtrapolation () |
| no parabolic extrapolation is done More...
|
|
void | doSmoothing () |
| requires that the r-t relationship will be smoothened using the conventional autocalibration after convergence More...
|
|
void | noSmoothing () |
| do not smoothen the r-t relationship after convergence More...
|
|
MdtCalibOutputPtr | analyseSegments (const MuonSegVec &seg) override |
| perform the full autocalibration including iterations (required since MdtCalibInterfaces-00-01-06) More...
|
|
bool | handleSegment (MuonCalibSegment &seg) |
| analyse the segment "seg" (this method was required before MdtCalibInterfaces-00-01-06) More...
|
|
void | setInput (const IMdtCalibrationOutput *rt_input) override |
| set the r-t relationship, the internal autocalibration objects are reset More...
|
|
bool | analyse (const MuonSegVec &seg) |
| perform the autocalibration with the segments acquired so far More...
|
|
bool | converged () const |
| returns true, if the autocalibration has converged More...
|
|
virtual MdtCalibOutputPtr | getResults () const override |
| returns the final r-t relationship More...
|
|
virtual std::string | name () const |
| returns name (region) of instance More...
|
|
|
void | init (const double &rt_accuracy, const unsigned int &func_type, const unsigned int &ord, const bool &fix_min, const bool &fix_max, const int &max_it, bool do_parabolic_extrapolation, bool do_smoothing, bool do_multilayer_rt_scale) |
|
double | t_from_r (const double &r) |
|
void | display_segment (MuonCalibSegment *segment, std::ofstream &outfile, const CurvedLine *curved_segment) |
|
std::shared_ptr< RtRelationLookUp > | performParabolicExtrapolation (const bool &min, const bool &max, const IRtRelation &in_rt) |
|
Definition at line 46 of file RtCalibrationCurved.h.
◆ MdtCalibOutputPtr
◆ MuonSegCit
◆ MuonSegIt
◆ MuonSegVec
◆ RtCalibrationCurved() [1/2]
RtCalibrationCurved::RtCalibrationCurved |
( |
const std::string & |
name | ) |
|
Default constructor: r-t accuracy is set to 0.5 mm.
The r-t accuracy is used internally to distinguish between good and bad segments. By default Legendre polynomials are used to parametrize the r-t correction. The order of the r-t correction polynomial is set to 15. Segments are not restricted to single multilayers. The full matrix relating the errors in r(t) to the residuals is used. No parabolic extrapolations are used. By default no smoothing is applied after convergence.
Definition at line 35 of file RtCalibrationCurved.cxx.
36 init(0.5 *
CLHEP::mm, 1, 15,
true,
false, 15,
false,
false,
false);
◆ RtCalibrationCurved() [2/2]
RtCalibrationCurved::RtCalibrationCurved |
( |
const std::string & |
name, |
|
|
const double & |
rt_accuracy, |
|
|
const unsigned int & |
func_type, |
|
|
const unsigned int & |
ord, |
|
|
const bool & |
fix_min, |
|
|
const bool & |
fix_max, |
|
|
const int & |
max_it, |
|
|
bool |
do_parabolic_extrapolation = false , |
|
|
bool |
do_smoothing = false , |
|
|
bool |
do_multilayer_rt_scale = false |
|
) |
| |
Constructor.
- Parameters
-
rt_accuracy | r-t accuracy in mm. The r-t accuracy is used internally to distinguish between good and bad segments. |
func_type | Type of function to be used for the r-t correction; = 1: Legendre polynomial (default), = 2: Chebyshev polynomial, = 3: polygon equidistant in r. |
ord | Order of the r-t correction function (15 is default). |
fix_min | =true: r(t0) is fixed in the autocalibration procedure (this is default). |
fix_max | =true: r(tmax) is fixed in the autocalibration procedure (false is default). |
max_it | Maximum number of iterations (20 by default). |
do_parabolic_extrapolation | Use parabolic extrapolations for small and larged drift radii. |
do_smoothing | Smoothing of the r-t relations after convergence. |
Definition at line 39 of file RtCalibrationCurved.cxx.
43 init(rt_accuracy, func_type, ord, fix_min, fix_max, max_it, do_parabolic_extrapolation, do_smoothing, do_multilayer_rt_scale);
◆ ~RtCalibrationCurved()
RtCalibrationCurved::~RtCalibrationCurved |
( |
| ) |
|
◆ analyse()
perform the autocalibration with the segments acquired so far
Definition at line 563 of file RtCalibrationCurved.cxx.
568 unsigned int nb_points(30);
570 std::shared_ptr<const RtChebyshev> rt_Chebyshev = std::dynamic_pointer_cast<const RtChebyshev>(
m_rt);
571 std::shared_ptr<const RtRelationLookUp> rt_LookUp = std::dynamic_pointer_cast<const RtRelationLookUp>(
m_rt);
573 std::vector<double> rt_param(
m_rt->nPar());
584 log << MSG::WARNING <<
"analyse() - Could not solve the autocalibration equation!" <<
endmsg;
601 std::vector<SamplePoint> x_r(nb_points + 1);
606 for (
unsigned int k = 0;
k < nb_points + 1;
k++) {
608 x_r[
k].set_x2(rt_Chebyshev->
radius(x_r[
k].x1()));
610 x_r[
k].set_error(1.0);
622 x_r[
k].set_error(0.01);
624 x_r[
k].set_x2(x_r[
k].
x2() - r_corr);
629 for (
unsigned int k = 0;
k < nb_points;
k++) {
630 if (x_r[
k].
x2() > x_r[
k + 1].
x2()) { x_r[
k + 1].set_x2(x_r[
k].
x2()); }
635 fitter.fit_parameters(x_r, 1, nb_points + 1, &chebyshev);
636 rt_param[0] = rt_Chebyshev->
tLower();
637 rt_param[1] = rt_Chebyshev->
tUpper();
640 m_rt_new = std::make_shared<RtChebyshev>(rt_param);
647 unsigned int min_k(2), max_k(rt_param.size());
649 if (
m_fix_max) { max_k = rt_param.size() - 1; }
650 for (
unsigned int k = min_k;
k < max_k;
k++) {
654 rt_param[
k] = rt_param[
k] - r_corr;
656 if (rt_param[
k] < rt_param[
k - 1]) { rt_param[
k] = rt_param[
k - 1]; }
660 m_rt_new = std::make_shared<RtRelationLookUp>(rt_param);
671 double r_corr_max = 0.0;
673 for (
unsigned int k = 0;
k < 100;
k++) {
676 if (std::abs(r_corr) > r_corr_max) { r_corr_max = std::abs(r_corr); }
713 m_output = std::make_shared<RtCalibrationOutput>(
◆ analyseSegments()
perform the full autocalibration including iterations (required since MdtCalibInterfaces-00-01-06)
Implements MuonCalib::IMdtCalibration.
Definition at line 101 of file RtCalibrationCurved.cxx.
102 std::shared_ptr<const IRtRelation> tmp_rt;
107 for (
const auto &
k : seg) {
108 for (
unsigned int l = 0;
l <
k->hitsOnTrack();
l++) {
110 double dd = (
k->mdtHOT())[
l]->signedDistanceToTrack();
123 log << MSG::WARNING <<
"analyseSegments() - analyse failed, segments:" <<
endmsg;
124 for (
unsigned int i = 0;
i < seg.size();
i++) {
125 log << MSG::WARNING <<
i <<
" " << seg[
i]->direction() <<
" " << seg[
i]->position() <<
endmsg;
133 tmp_rt = rtOut->
rt();
139 m_output = std::make_shared<RtCalibrationOutput>(
150 double r{0},
d{0},
adc{0};
151 for (
const auto &
k : seg) {
152 for (
unsigned int l = 0;
l <
k->hitsOnTrack();
l++) {
153 adc = (
k->mdtHOT())[
l]->adcCount();
155 d = (
k->mdtHOT())[
l]->signedDistanceToTrack();
165 int max_smoothing_iterations(
static_cast<int>(
m_max_it));
166 if (max_smoothing_iterations == 0) { max_smoothing_iterations = 1; }
169 double convergence_RMS(0.002);
178 while (it < max_smoothing_iterations && RMS > convergence_RMS) {
185 for (
const auto &
k : seg) {
186 if (
k->mdtHitsOnTrack() < 4) {
continue; }
188 for (
unsigned int h = 0;
h <
k->mdtHitsOnTrack();
h++) {
189 k->mdtHOT()[
h]->setDriftRadius(tmp_rt->
radius(
k->mdtHOT()[
h]->driftTime()),
190 k->mdtHOT()[
h]->sigmaDriftRadius());
191 if (
k->mdtHOT()[
h]->sigmaDriftRadius() < 0.5 *
m_r_max) {
192 avres = avres +
k->mdtHOT()[
h]->sigma2DriftRadius();
194 avres = avres + 0.01;
197 avres = avres /
static_cast<double>(
k->mdtHitsOnTrack());
198 avres = std::sqrt(avres);
205 log << MSG::WARNING <<
"analyseSegments() - too small number of reconstructed segments!" <<
endmsg;
207 for (
const auto &
k : seg) {
208 for (
unsigned int l = 0;
l <
k->hitsOnTrack();
l++) {
210 double d = (
k->mdtHOT())[
l]->signedDistanceToTrack();
222 double bin_width(0.01 * (smooth_rt.tUpper() - smooth_rt.tLower()));
223 for (
double t = smooth_rt.tLower();
t <= smooth_rt.tUpper();
t =
t +
bin_width) {
226 RMS = std::sqrt(0.01 *
RMS);
232 tmp_rt = std::make_shared<RtRelationLookUp>(smooth_rt);
238 m_output = std::make_shared<RtCalibrationOutput>(
244 for (
const auto &
k : seg) {
245 for (
unsigned int l = 0;
l <
k->hitsOnTrack();
l++) {
246 double adc = (
k->mdtHOT())[
l]->adcCount();
248 double d = (
k->mdtHOT())[
l]->signedDistanceToTrack();
◆ converged()
bool RtCalibrationCurved::converged |
( |
| ) |
const |
◆ display_segment()
Definition at line 827 of file RtCalibrationCurved.cxx.
831 double y_min, y_max, z_min, z_max;
838 y_min = (
segment->mdtHOT()[0])->localPosition().y();
840 z_min = (
segment->mdtHOT()[0])->localPosition().z();
842 for (
unsigned int k = 1;
k <
segment->mdtHitsOnTrack();
k++) {
843 if ((
segment->mdtHOT()[
k])->localPosition().y() < y_min) { y_min = (
segment->mdtHOT()[
k])->localPosition().y(); }
844 if ((
segment->mdtHOT()[
k])->localPosition().y() > y_max) { y_max = (
segment->mdtHOT()[
k])->localPosition().y(); }
845 if ((
segment->mdtHOT()[
k])->localPosition().z() < z_min) { z_min = (
segment->mdtHOT()[
k])->localPosition().z(); }
846 if ((
segment->mdtHOT()[
k])->localPosition().z() > z_max) { z_max = (
segment->mdtHOT()[
k])->localPosition().z(); }
848 for (
unsigned int k = 0;
k <
segment->mdtCloseHits();
k++) {
849 if ((
segment->mdtClose()[
k])->localPosition().y() < y_min) { y_min = (
segment->mdtClose()[
k])->localPosition().y(); }
850 if ((
segment->mdtClose()[
k])->localPosition().y() > y_max) { y_max = (
segment->mdtClose()[
k])->localPosition().y(); }
851 if ((
segment->mdtClose()[
k])->localPosition().z() < z_min) { z_min = (
segment->mdtClose()[
k])->localPosition().z(); }
852 if ((
segment->mdtClose()[
k])->localPosition().z() > z_max) { z_max = (
segment->mdtClose()[
k])->localPosition().z(); }
856 if (y_max - y_min > z_max - z_min) {
857 outfile <<
"nullptr " << y_min - 30.0 <<
" " << y_max + 30.0 <<
" " << 0.5 * (z_min + z_max) - 0.5 * (y_max - y_min) - 30.0 <<
" "
858 << 0.5 * (z_min + z_max) + 0.5 * (y_max - y_min) + 30.0 <<
"\n";
860 outfile <<
"nullptr " << 0.5 * (y_min + y_max) - 0.5 * (z_max - z_min) - 30.0 <<
" "
861 << 0.5 * (y_min + y_max) + 0.5 * (z_max - z_min) + 30.0 <<
" " << z_min - 30.0 <<
" " << z_max + 30.0 <<
"\n";
865 for (
unsigned int k = 0;
k <
segment->mdtHitsOnTrack();
k++) {
868 <<
"ARC " << (
segment->mdtHOT()[
k])->localPosition().y() <<
" " << (
segment->mdtHOT()[
k])->localPosition().z() <<
" 15.0\n";
872 <<
"ARC " << (
segment->mdtHOT()[
k])->localPosition().y() <<
" " << (
segment->mdtHOT()[
k])->localPosition().z() <<
" "
877 for (
unsigned int k = 0;
k <
segment->mdtCloseHits();
k++) {
880 <<
"ARC " << (
segment->mdtClose()[
k])->localPosition().y() <<
" " << (
segment->mdtClose()[
k])->localPosition().z()
885 <<
"ARC " << (
segment->mdtClose()[
k])->localPosition().y() <<
" " << (
segment->mdtClose()[
k])->localPosition().z() <<
" "
891 if (curved_segment ==
nullptr) {
894 <<
"LINE " << aux_track.a_x2() * (z_min - 30.0) + aux_track.b_x2() <<
" " << z_min - 30.0 <<
" "
895 << aux_track.a_x2() * (z_max + 30.0) + aux_track.b_x2() <<
" " << z_max + 30.0 <<
"\n";
899 if (curved_segment !=
nullptr) {
900 double step_size((60.0 + z_max - z_min) / 50.0);
901 for (
double aux_z = z_min; aux_z <= z_max; aux_z = aux_z + step_size) {
903 <<
"LINE " << curved_segment->
getPointOnLine(aux_z).y() <<
" " << aux_z <<
" "
904 << curved_segment->
getPointOnLine(aux_z + step_size).y() <<
" " << aux_z + step_size <<
"\n";
◆ doNotForceMonotony()
void RtCalibrationCurved::doNotForceMonotony |
( |
| ) |
|
◆ doParabolicExtrapolation()
void RtCalibrationCurved::doParabolicExtrapolation |
( |
| ) |
|
requires that parabolic extrapolation will be used for small and large radii
Definition at line 98 of file RtCalibrationCurved.cxx.
◆ doSmoothing()
void RtCalibrationCurved::doSmoothing |
( |
| ) |
|
requires that the r-t relationship will be smoothened using the conventional autocalibration after convergence
Definition at line 99 of file RtCalibrationCurved.cxx.
◆ estimatedRtAccuracy()
double RtCalibrationCurved::estimatedRtAccuracy |
( |
| ) |
const |
get the estimated r-t quality (CLHEP::mm), the accuracy of the input r-t is computed at the end of the iteration; in order to get the accuracy of the final r-t, the algorithm has to be rerun with the final r-t as an input
Definition at line 51 of file RtCalibrationCurved.cxx.
◆ forceMonotony()
void RtCalibrationCurved::forceMonotony |
( |
| ) |
|
◆ fullMatrix()
void MuonCalib::RtCalibrationCurved::fullMatrix |
( |
const bool & |
yes_or_no | ) |
|
yes_or_no=true: the full matrix relating the errors in the r-t relationship to the residuals is used yes_or_no=false: unit matrix is used (algorithm is equivalent to to the conventional/classical method
◆ getResults()
◆ handleSegment()
analyse the segment "seg" (this method was required before MdtCalibInterfaces-00-01-06)
Definition at line 267 of file RtCalibrationCurved.cxx.
282 if (std::abs(seg.
direction().y()) > 100) {
return true; }
291 double chi2_scale_factor;
296 unsigned int nb_hits_in_ml;
298 std::vector<double> d_track;
300 std::vector<MTStraightLine>
w;
305 std::vector<CLHEP::HepVector>
F;
307 CLHEP::HepVector residual_value;
308 CLHEP::HepVector weighted_residual;
323 aux_res = seg.
mdtHOT()[
k]->sigmaDriftRadius();
324 if (
m_rt->radius(seg.
mdtHOT()[
k]->driftTime()) < 0.75) {
325 if (aux_res < 0.5 - m_rt->
radius(seg.
mdtHOT()[
k]->driftTime())) { aux_res = 0.5 -
m_rt->radius(seg.
mdtHOT()[
k]->driftTime()); }
332 hit_selection[
k] = 0;
337 hit_selection[
k] = 1;
341 if (hit_selection[
k] == 0) {
345 av_res = av_res + 0.01;
350 nb_hits_in_ml = nb_hits_in_ml + (1 - hit_selection[
k]);
354 av_res = std::sqrt(av_res /
static_cast<double>(seg.
mdtHitsOnTrack()));
355 chi2_scale_factor = std::hypot(av_res,
m_rt_accuracy) / av_res;
365 if (nb_hits_in_ml < 4) {
return true; }
372 if (std::isnan(
track.chi2())) {
return true; }
375 if (
track.chi2PerDegreesOfFreedom() > 5 * chi2_scale_factor) {
return true; }
379 if (
track.numberOfTrackHits() < 4) {
return true; }
384 if (std::abs(
track.getTangent(seg.
mdtHOT()[0]->localPosition().z()).a_x2()) > 8.0e8) {
return true; }
393 F = std::vector<CLHEP::HepVector>(
track.numberOfTrackHits());
394 for (
unsigned int h = 0;
h <
track.numberOfTrackHits();
h++) {
399 for (
int p = 0;
p <
F[
h].num_row();
p++) {
400 double x = std::sqrt(1.0 +
std::pow(
track.getTangent((
track.trackHits()[
h]->localPosition()).z()).a_x2(), 2));
411 for (
unsigned int h = 0;
h <
track.numberOfTrackHits();
h++) {
421 log << MSG::WARNING <<
"handleSegment() - Could not invert track matrix!" <<
endmsg;
427 d_track = std::vector<double>(
track.numberOfTrackHits());
428 w = std::vector<MTStraightLine>(
track.numberOfTrackHits());
429 residual_value = CLHEP::HepVector(
track.numberOfTrackHits());
430 weighted_residual = CLHEP::HepVector(
track.numberOfTrackHits());
432 m_U[
l] = CLHEP::HepVector(
track.numberOfTrackHits());
435 for (
unsigned int h = 0;
h <
track.numberOfTrackHits();
h++) {
438 d_track[
h] =
track.getTangent((
track.trackHits()[
h]->localPosition()).z()).signDistFrom(
w[
h]);
450 D = CLHEP::HepMatrix(
track.numberOfTrackHits(),
track.numberOfTrackHits());
451 for (
unsigned int h = 0;
h <
track.numberOfTrackHits();
h++) {
452 for (
unsigned int hp = 0; hp <
track.numberOfTrackHits(); hp++) {
453 D[
h][hp] = (
h == hp) - (2 * (d_track[
h] >= 0) - 1) * (2 * (d_track[hp] >= 0) - 1) *
dot(F[
h],
m_M_track_inverse * F[hp]) /
454 (
track.trackHits()[hp])->sigma2DriftRadius();
460 std::vector<double> sigma_residual(
track.numberOfTrackHits(), 0.0);
461 for (
unsigned int h = 0;
h <
track.numberOfTrackHits();
h++) {
462 for (
unsigned int hp = 0; hp <
track.numberOfTrackHits(); hp++) {
463 sigma_residual[
h] = sigma_residual[
h] +
std::pow(D[
h][hp] * (
track.trackHits()[hp])->sigmaDriftRadius(), 2);
465 sigma_residual[
h] = std::sqrt(sigma_residual[
h]);
466 if (sigma_residual[
h] < av_res /
track.numberOfTrackHits()) { sigma_residual[
h] = av_res / std::sqrt(
track.numberOfTrackHits()); }
470 for (
unsigned int h = 0;
h <
track.numberOfTrackHits();
h++) {
471 weighted_residual[
h] = residual_value[
h] / sigma_residual[
h];
479 CLHEP::HepSymMatrix A_tmp(
m_A);
483 for (
unsigned int pp =
p; pp <
m_order; pp++) {
485 if (std::isnan(A_tmp[
p][pp])) {
return true; }
489 CLHEP::HepVector b_tmp(
m_b);
492 if (std::isnan(b_tmp[
p])) {
return true; }
◆ init()
void RtCalibrationCurved::init |
( |
const double & |
rt_accuracy, |
|
|
const unsigned int & |
func_type, |
|
|
const unsigned int & |
ord, |
|
|
const bool & |
fix_min, |
|
|
const bool & |
fix_max, |
|
|
const int & |
max_it, |
|
|
bool |
do_parabolic_extrapolation, |
|
|
bool |
do_smoothing, |
|
|
bool |
do_multilayer_rt_scale |
|
) |
| |
|
private |
Definition at line 726 of file RtCalibrationCurved.cxx.
751 m_tracker = std::make_unique<CurvedPatRec>();
754 throw std::runtime_error(
755 Form(
"File: %s, Line: %d\nRtCalibrationCurved::init - Order of the correction polynomial must be >0!", __FILE__, __LINE__));
770 if (func_type < 1 || func_type > 3) {
771 throw std::runtime_error(
772 Form(
"File: %s, Line: %d\nRtCalibrationCurved::init - Illegal correction function type!", __FILE__, __LINE__));
775 case 1:
m_base_function = std::make_unique<LegendrePolynomial>();
break;
776 case 2:
m_base_function = std::make_unique<ChebyshevPolynomial>();
break;
779 throw std::runtime_error(
780 Form(
"File: %s, Line: %d\nRtCalibrationCurved::init - Order must be >2 for polygons! It is set to %i by the user.",
◆ iteration()
int RtCalibrationCurved::iteration |
( |
| ) |
const |
◆ name()
virtual std::string MuonCalib::IMdtCalibration::name |
( |
| ) |
const |
|
inlinevirtualinherited |
◆ noParabolicExtrapolation()
void MuonCalib::RtCalibrationCurved::noParabolicExtrapolation |
( |
| ) |
|
no parabolic extrapolation is done
◆ noSmoothing()
void RtCalibrationCurved::noSmoothing |
( |
| ) |
|
◆ numberOfSegments()
int RtCalibrationCurved::numberOfSegments |
( |
| ) |
const |
◆ numberOfSegmentsUsed()
int RtCalibrationCurved::numberOfSegmentsUsed |
( |
| ) |
const |
◆ performParabolicExtrapolation()
Definition at line 913 of file RtCalibrationCurved.cxx.
919 std::shared_ptr<RtRelationLookUp> rt_low, rt_high;
920 std::vector<SamplePoint> add_fit_point;
926 add_fit_point.clear();
942 add_fit_point.clear();
◆ reliability()
double RtCalibrationCurved::reliability |
( |
| ) |
const |
get the reliability of the final r-t relationship: 0: no convergence yet 1: convergence, r(t) is reliable 2: convergence, r(t) is unreliable
Definition at line 49 of file RtCalibrationCurved.cxx.
◆ setEstimateRtAccuracy()
void RtCalibrationCurved::setEstimateRtAccuracy |
( |
const double & |
acc | ) |
|
◆ setInput()
set the r-t relationship, the internal autocalibration objects are reset
Implements MuonCalib::IMdtCalibration.
Definition at line 506 of file RtCalibrationCurved.cxx.
515 if (
input ==
nullptr) {
516 throw std::runtime_error(
517 Form(
"File: %s, Line: %d\nRtCalibrationCurved::setInput - Calibration input class not supported.", __FILE__, __LINE__));
536 std::shared_ptr<const RtChebyshev> rt_Chebyshev = std::dynamic_pointer_cast<const RtChebyshev>(
m_rt);
537 std::shared_ptr<const RtRelationLookUp> rt_LookUp = std::dynamic_pointer_cast<const RtRelationLookUp>(
m_rt);
539 if (!rt_Chebyshev && !rt_LookUp) {
540 throw std::runtime_error(Form(
"File: %s, Line: %d\nRtCalibrationCurved::setInput - r-t class not supported.", __FILE__, __LINE__));
◆ smoothing()
bool RtCalibrationCurved::smoothing |
( |
| ) |
const |
returns true, if the r-t relationship will be smoothened using the conventional autocalibration after convergence; returns false otherwise
Definition at line 59 of file RtCalibrationCurved.cxx.
◆ switch_off_control_histograms()
void RtCalibrationCurved::switch_off_control_histograms |
( |
| ) |
|
the algorithm does not produce controll histograms (this is the default)
Definition at line 88 of file RtCalibrationCurved.cxx.
◆ switch_on_control_histograms()
void RtCalibrationCurved::switch_on_control_histograms |
( |
const std::string & |
file_name | ) |
|
this methods requests control histograms from the algorithms; the algorithm will write them to ROOT file called "file_name"
Definition at line 63 of file RtCalibrationCurved.cxx.
71 m_cut_evolution = std::make_unique<TH1F>(
"m_cut_evolution",
"CUT EVOLUTION", 11, -0.5, 10.5);
72 m_nb_segment_hits = std::make_unique<TH1F>(
"m_nb_segment_hits",
"NUMBER OF HITS ON THE REFITTED SEGMENTS", 11, -0.5, 10.5);
73 m_pull_initial = std::make_unique<TH1F>(
"m_pull_initial",
"INITIAL PULL DISTRIBUTION", 200, -5.05, 5.05);
75 std::make_unique<TH2F>(
"m_residuals_initial",
"INITIAL OF THE REFITTED SEGMENTS", 100, -0.5, 15.0, 300, -1.5, 1.5);
76 m_residuals_initial_all = std::make_unique<TH2F>(
"m_residuals_initial_all",
"INITIAL OF THE REFITTED SEGMENTS BEFORE CONVERGENCE", 300,
77 -15.0, 15.0, 1000, -5, 5);
78 m_residuals_final = std::make_unique<TH2F>(
"m_residuals_final",
"FINAL OF THE REFITTED SEGMENTS", 100, -0.5, 15.0, 300, -1.5, 1.5);
80 std::make_unique<TH2F>(
"m_driftTime_final",
"FINAL DRIFTTIME OF THE REFITTED SEGMENTS", 300, -15.0, 15.0, 300, -15.0, 15.0);
82 std::make_unique<TH2F>(
"m_driftTime_initial",
"FINAL DRIFTTIME OF THE REFITTED SEGMENTS", 300, -15.0, 15.0, 1300, -100, 1200);
84 std::make_unique<TH2F>(
"m_adc_resi_initial",
"FINAL ADC VS RESIDUAL OF THE REFITTED SEGMENTS", 1350, 0, 1350, 300, -15, 15);
◆ t_from_r()
double RtCalibrationCurved::t_from_r |
( |
const double & |
r | ) |
|
|
private |
Definition at line 806 of file RtCalibrationCurved.cxx.
810 double precision(0.001);
817 while (t_max - t_min > 0.1 && std::abs(
m_rt->radius(0.5 * (t_min + t_max)) -
r) > precision) {
818 if (
m_rt->radius(0.5 * (t_min + t_max)) >
r) {
819 t_max = 0.5 * (t_min + t_max);
821 t_min = 0.5 * (t_min + t_max);
825 return 0.5 * (t_min + t_max);
◆ m_A
CLHEP::HepSymMatrix MuonCalib::RtCalibrationCurved::m_A |
|
private |
◆ m_adc_vs_residual_final
std::unique_ptr<TH2F> MuonCalib::RtCalibrationCurved::m_adc_vs_residual_final |
|
private |
◆ m_alpha
CLHEP::HepVector MuonCalib::RtCalibrationCurved::m_alpha |
|
private |
◆ m_b
CLHEP::HepVector MuonCalib::RtCalibrationCurved::m_b |
|
private |
◆ m_base_function
std::unique_ptr<BaseFunction> MuonCalib::RtCalibrationCurved::m_base_function |
|
private |
◆ m_chi2
double MuonCalib::RtCalibrationCurved::m_chi2 = 0.0 |
|
private |
◆ m_chi2_previous
double MuonCalib::RtCalibrationCurved::m_chi2_previous = 0.0 |
|
private |
◆ m_control_histograms
bool MuonCalib::RtCalibrationCurved::m_control_histograms = false |
|
private |
◆ m_cut_evolution
std::unique_ptr<TH1F> MuonCalib::RtCalibrationCurved::m_cut_evolution |
|
private |
◆ m_do_multilayer_rt_scale
bool MuonCalib::RtCalibrationCurved::m_do_multilayer_rt_scale = false |
|
private |
◆ m_do_parabolic_extrapolation
bool MuonCalib::RtCalibrationCurved::m_do_parabolic_extrapolation = false |
|
private |
◆ m_do_smoothing
bool MuonCalib::RtCalibrationCurved::m_do_smoothing = false |
|
private |
◆ m_driftTime_final
std::unique_ptr<TH2F> MuonCalib::RtCalibrationCurved::m_driftTime_final |
|
private |
◆ m_driftTime_initial
std::unique_ptr<TH2F> MuonCalib::RtCalibrationCurved::m_driftTime_initial |
|
private |
◆ m_fix_max
bool MuonCalib::RtCalibrationCurved::m_fix_max = false |
|
private |
◆ m_fix_min
bool MuonCalib::RtCalibrationCurved::m_fix_min = false |
|
private |
◆ m_force_monotony
bool MuonCalib::RtCalibrationCurved::m_force_monotony = false |
|
private |
◆ m_iteration
int MuonCalib::RtCalibrationCurved::m_iteration = 0 |
|
private |
◆ m_Legendre
◆ m_M_track
CLHEP::HepSymMatrix MuonCalib::RtCalibrationCurved::m_M_track |
|
private |
◆ m_M_track_inverse
CLHEP::HepSymMatrix MuonCalib::RtCalibrationCurved::m_M_track_inverse |
|
private |
◆ m_max_it
int MuonCalib::RtCalibrationCurved::m_max_it = 0 |
|
private |
◆ m_multilayer
std::array<bool, 2> MuonCalib::RtCalibrationCurved::m_multilayer {} |
|
private |
◆ m_multilayer_rt_difference
◆ m_name
std::string MuonCalib::IMdtCalibration::m_name |
|
privateinherited |
◆ m_nb_segment_hits
std::unique_ptr<TH1F> MuonCalib::RtCalibrationCurved::m_nb_segment_hits |
|
private |
◆ m_nb_segments
int MuonCalib::RtCalibrationCurved::m_nb_segments = 0 |
|
private |
◆ m_nb_segments_used
int MuonCalib::RtCalibrationCurved::m_nb_segments_used = 0 |
|
private |
◆ m_order
unsigned int MuonCalib::RtCalibrationCurved::m_order = 0U |
|
private |
◆ m_output
◆ m_pull_final
std::unique_ptr<TH1F> MuonCalib::RtCalibrationCurved::m_pull_final |
|
private |
◆ m_pull_initial
std::unique_ptr<TH1F> MuonCalib::RtCalibrationCurved::m_pull_initial |
|
private |
◆ m_r_max
double MuonCalib::RtCalibrationCurved::m_r_max = 0.0 |
|
private |
◆ m_residuals_final
std::unique_ptr<TH2F> MuonCalib::RtCalibrationCurved::m_residuals_final |
|
private |
◆ m_residuals_initial
std::unique_ptr<TH2F> MuonCalib::RtCalibrationCurved::m_residuals_initial |
|
private |
◆ m_residuals_initial_all
std::unique_ptr<TH2F> MuonCalib::RtCalibrationCurved::m_residuals_initial_all |
|
private |
◆ m_rt
◆ m_rt_accuracy
double MuonCalib::RtCalibrationCurved::m_rt_accuracy = 0.0 |
|
private |
◆ m_rt_accuracy_previous
double MuonCalib::RtCalibrationCurved::m_rt_accuracy_previous |
|
private |
◆ m_rt_new
std::shared_ptr<IRtRelation> MuonCalib::RtCalibrationCurved::m_rt_new |
|
private |
◆ m_status
int MuonCalib::RtCalibrationCurved::m_status = 0 |
|
private |
◆ m_t_length
double MuonCalib::RtCalibrationCurved::m_t_length = 0.0 |
|
private |
◆ m_t_mean
double MuonCalib::RtCalibrationCurved::m_t_mean = 0.0 |
|
private |
◆ m_tfile
std::unique_ptr<TFile> MuonCalib::RtCalibrationCurved::m_tfile |
|
private |
◆ m_tracker
std::unique_ptr<CurvedPatRec> MuonCalib::RtCalibrationCurved::m_tracker |
|
private |
◆ m_U
std::vector<CLHEP::HepVector> MuonCalib::RtCalibrationCurved::m_U |
|
private |
◆ m_U_weighted
std::vector<CLHEP::HepVector> MuonCalib::RtCalibrationCurved::m_U_weighted |
|
private |
The documentation for this class was generated from the following files:
std::unique_ptr< TH2F > m_driftTime_initial
std::unique_ptr< BaseFunction > m_base_function
const ShapeFitter * fitter
std::shared_ptr< IRtRelation > m_rt_new
std::unique_ptr< TH2F > m_residuals_initial
IMdtCalibration(const std::string &name)
constructor, string used to identify the instance
virtual double tUpper(void) const =0
std::unique_ptr< TFile > m_tfile
std::array< bool, 2 > m_multilayer
float GetTmaxDiff() const
return the difference in total dirft time between the two multilayers (ML1 - ML2)
std::unique_ptr< TH1F > m_pull_initial
const Legendre_polynomial * m_Legendre
const Amg::Vector3D & position() const
retrieve local position of segment (on station level)
std::shared_ptr< const IRtRelation > m_rt
unsigned int numberOfRtParameters(void) const
get the coefficients of the r(t) polynomial
static const Legendre_polynomial * get_Legendre_polynomial(void)
get a pointer to the Legendre polynomial
bool smoothing() const
returns true, if the r-t relationship will be smoothened using the conventional autocalibration after...
Equidistant look up table for rt-relations with the time as key.
IMessageSvc * getMessageSvc(bool quiet=false)
Amg::Vector3D getPointOnLine(const double &loc_z) const
get the point on the line a the local z coordinate "loc_z"
double par(unsigned int index) const
const Amg::Vector3D & direction() const
retrieve local direction of segment (on station level) retrieve the transformation from local chamber...
bool m_do_parabolic_extrapolation
std::unique_ptr< TH2F > m_residuals_final
std::unique_ptr< TH2F > m_driftTime_final
bool m_control_histograms
double get_reduced_time(const double &t) const
std::shared_ptr< RtRelationLookUp > performParabolicExtrapolation(const bool &min, const bool &max, const IRtRelation &in_rt)
std::unique_ptr< TH2F > m_residuals_initial_all
std::unique_ptr< MultilayerRtDifference > m_multilayer_rt_difference
CLHEP::HepSymMatrix m_M_track
double value(const int &order, const double &x) const
get the value of the Legendre polynomial of order m_order at x
CLHEP::HepSymMatrix m_M_track_inverse
std::unique_ptr< TH1F > m_cut_evolution
std::shared_ptr< RtCalibrationOutput > m_output
double tLower(void) const
< get the lower drift-time bound
std::unique_ptr< TH1F > m_nb_segment_hits
bool m_do_multilayer_rt_scale
def dot(G, fn, nodesToHighlight=[])
void SetTmaxDiff(const float &d)
set the difference in total drift time betwene the two multilayers (ML1 - ML2)
virtual std::string name() const
returns name (region) of instance
unsigned int mdtHitsOnTrack() const
retrieve the number of MdtCalibHitBase s assigned to this segment
virtual double radius(double t) const =0
returns drift radius for a given time
void init(const double &rt_accuracy, const unsigned int &func_type, const unsigned int &ord, const bool &fix_min, const bool &fix_max, const int &max_it, bool do_parabolic_extrapolation, bool do_smoothing, bool do_multilayer_rt_scale)
std::shared_ptr< const IRtRelation > rt() const
access to private attributes
std::unique_ptr< TH2F > m_adc_vs_residual_final
Eigen::Matrix< double, 3, 1 > Vector3D
double tUpper(void) const
get the number of parameters used to describe the r(t) relationship
void setInput(const IMdtCalibrationOutput *rt_input) override
set the r-t relationship, the internal autocalibration objects are reset
bool converged() const
returns true, if the autocalibration has converged
const ParVec & parameters() const
bool analyse(const MuonSegVec &seg)
perform the autocalibration with the segments acquired so far
double m_rt_accuracy_previous
double radius(double t) const
get the radius corresponding to the drift time t; if t is not within [t_low, t_up] an unphysical radi...
double t_from_r(const double &r)
virtual MdtCalibOutputPtr getResults() const override
returns the final r-t relationship
bool handleSegment(MuonCalibSegment &seg)
analyse the segment "seg" (this method was required before MdtCalibInterfaces-00-01-06)
unsigned int nPar() const
const boost::regex rr(r_r)
const MdtHitVec & mdtHOT() const
retrieve the full set of MdtCalibHitBase s assigned to this segment
std::vector< CLHEP::HepVector > m_U_weighted
std::vector< CLHEP::HepVector > m_U
std::unique_ptr< CurvedPatRec > m_tracker
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
std::vector< unsigned int > HitSelection