|
ATLAS Offline Software
|
#include <AdaptiveResidualSmoothing.h>
|
| AdaptiveResidualSmoothing () |
| Default constructor. More...
|
|
void | clear () |
| clear the memory of the class More...
|
|
void | addResidual (const double radius, const double residual) |
| add the residual at the given radius More...
|
|
bool | addResidualsFromSegment (MuonCalibSegment &seg, bool curved, double road_width) |
| reconstruct the given segment and store the residuals; if curved is true a curved segment fit is performed, otherwise a straight segment is fitted to the drift radii; the user must set the road width used in the pattern recognition; returns true in case of success More...
|
|
RtRelationLookUp | performSmoothing (const IRtRelation &rt_rel, unsigned int nb_entries_per_bin, bool fix_t_min, bool fix_t_max) |
| use the stored residuals to improve the given r-t relationship to give smoother residuals; the user has to set the number of entries per radial bin; the user can request that the radii for the minimum and maximum drift time are untouched More...
|
|
RtRelationLookUp | performSmoothing (const IRtRelation &rt_rel, const bool &fix_t_min, const bool &fix_t_max) |
| use the stored residuals to improve the given r-t relationship to give smoother residuals; the user can request that the radii for the minimum and maximum drift time are untouched More...
|
|
Definition at line 48 of file AdaptiveResidualSmoothing.h.
◆ AdaptiveResidualSmoothing()
AdaptiveResidualSmoothing::AdaptiveResidualSmoothing |
( |
| ) |
|
◆ addResidual()
void AdaptiveResidualSmoothing::addResidual |
( |
const double |
radius, |
|
|
const double |
residual |
|
) |
| |
◆ addResidualsFromSegment()
bool AdaptiveResidualSmoothing::addResidualsFromSegment |
( |
MuonCalibSegment & |
seg, |
|
|
bool |
curved, |
|
|
double |
road_width |
|
) |
| |
reconstruct the given segment and store the residuals; if curved is true a curved segment fit is performed, otherwise a straight segment is fitted to the drift radii; the user must set the road width used in the pattern recognition; returns true in case of success
Definition at line 39 of file AdaptiveResidualSmoothing.cxx.
44 CLHEP::HepVector point(2);
67 fitter->SetRefineSegmentFlag(
false);
86 for (
const auto & trackHit : trackHits) {
87 point[0] = trackHit->driftRadius();
88 point[1] = trackHit->driftRadius() - std::abs(trackHit->signedDistanceToTrack());
◆ clear()
void AdaptiveResidualSmoothing::clear |
( |
| ) |
|
◆ performSmoothing() [1/2]
use the stored residuals to improve the given r-t relationship to give smoother residuals; the user can request that the radii for the minimum and maximum drift time are untouched
Definition at line 178 of file AdaptiveResidualSmoothing.cxx.
183 unsigned int nb_bins;
184 unsigned int min_nb_entries_per_bin(20);
190 unsigned int bin_index;
202 nb_bins =
static_cast<unsigned int>(std::sqrt(
m_residual_point.size() / 6.));
205 if (nb_bins == 0) { nb_bins = 1; }
214 log << MSG::WARNING <<
"performSmoothing() - No residuals are stored. no correction applied to r(t)!" <<
endmsg;
217 step_size = r_max /
static_cast<double>(nb_bins);
224 std::vector<SamplePoint> corr(nb_bins);
225 std::vector<double> radii(nb_bins);
233 std::vector<std::vector<const DataPoint *> > sample_points_per_r_bin(nb_bins);
237 if (std::abs(
k.dataVector()[0]) >= r_max) {
continue; }
238 bin_index =
static_cast<unsigned int>(std::abs(
k.dataVector()[0]) / step_size);
239 sample_points_per_r_bin[bin_index].push_back(&
k);
245 for (
unsigned int bin = 0;
bin < nb_bins;
bin++) {
250 unsigned int k_min(
static_cast<unsigned int>(0.01 * sample_points_per_r_bin[
bin].
size()));
251 unsigned int k_max(
static_cast<unsigned int>(0.99 * sample_points_per_r_bin[
bin].
size()));
256 for (
unsigned int k = k_min;
k < k_max;
k++) {
257 aux_rad = aux_rad + sample_points_per_r_bin[
bin][
k]->dataVector()[0];
258 aux_corr = aux_corr + sample_points_per_r_bin[
bin][
k]->dataVector()[1];
260 if (k_max - k_min < 0.25 * min_nb_entries_per_bin) {
261 radii[
bin] = (0.5 +
bin) * step_size;
264 radii[
bin] = aux_rad /
static_cast<double>(k_max - k_min);
265 corr[
bin] =
SamplePoint(radii[
bin], aux_corr /
static_cast<double>(k_max - k_min), 1.0);
272 fitter.fit_parameters(corr, 1, corr.size(), polygon);
275 std::vector<double> rt_params;
276 rt_params.push_back(rt_rel.
tLower());
277 rt_params.push_back(0.01 * (rt_rel.
tUpper() - rt_rel.
tLower()));
279 for (
double t = rt_rel.
tLower();
t <= rt_rel.
tUpper();
t =
t + rt_params[1]) {
281 for (
unsigned int l = 0;
l < radii.size();
l++) {
282 delta_r = delta_r +
fitter.coefficients()[
l] * polygon.value(
l, rt_rel.
radius(
t));
284 if (rt_rel.
radius(
t) > r_max) { delta_r = 0.0; }
285 if (fix_t_min && (rt_rel.
radius(
t) < 0.5)) { delta_r = 0.0; }
286 if (fix_t_max && (rt_rel.
radius(
t) > 14.1)) { delta_r = 0.0; }
287 rt_params.push_back(rt_rel.
radius(
t) - delta_r);
◆ performSmoothing() [2/2]
use the stored residuals to improve the given r-t relationship to give smoother residuals; the user has to set the number of entries per radial bin; the user can request that the radii for the minimum and maximum drift time are untouched
Definition at line 95 of file AdaptiveResidualSmoothing.cxx.
102 std::vector<unsigned int> ref_coord(1);
109 throw std::runtime_error(
110 Form(
"File: %s, Line: %d\nAdaptiveResidualSmoothing::performSmoothing - No residuals stored.", __FILE__, __LINE__));
114 throw std::runtime_error(
115 Form(
"File: %s, Line: %d\nAdaptiveResidualSmoothing::performSmoothing - Not enough residuals stored.", __FILE__, __LINE__));
123 bin_maker.binDataPoints(nb_entries_per_bin, ref_coord);
130 std::vector<double>
rad(bin_maker.getBins().size());
131 std::vector<SamplePoint> corr(bin_maker.getBins().size());
132 for (
unsigned int k = 0;
k < bin_maker.getBins().
size();
k++) {
133 rad[
k] = (bin_maker.getBins()[
k])->centreOfGravity()[0];
134 corr[
k].set_x1(
rad[
k]);
135 corr[
k].set_x2((bin_maker.getBins()[
k])->centreOfGravity()[1]);
136 corr[
k].set_error(1.0);
140 std::vector<double> radi;
141 radi.push_back(
rad[0]);
143 for (
unsigned int k = 1;
k <
rad.size();
k++) {
145 radi.push_back(
rad[
k]);
152 fitter.fit_parameters(corr, 1, corr.size(), polygon);
155 std::vector<double> rt_params;
156 rt_params.push_back(rt_rel.
tLower());
157 rt_params.push_back(0.01 * (rt_rel.
tUpper() - rt_rel.
tLower()));
159 for (
double t = rt_rel.
tLower();
t <= rt_rel.
tUpper();
t =
t + rt_params[1]) {
161 for (
unsigned int l = 0;
l < radi.size();
l++) {
162 delta_r = delta_r +
fitter.coefficients()[
l] * polygon.value(
l, rt_rel.
radius(
t));
164 if (fix_t_min && (rt_rel.
radius(
t) < 0.5)) { delta_r = 0.0; }
165 if (fix_t_max && (rt_rel.
radius(
t) > 14.1)) { delta_r = 0.0; }
166 rt_params.push_back(rt_rel.
radius(
t) - delta_r);
◆ t_from_r()
Definition at line 298 of file AdaptiveResidualSmoothing.cxx.
303 double precision(0.001);
304 double t_max(rt_rel.
tUpper());
305 double t_min(rt_rel.
tLower());
311 while (t_max - t_min > 0.1 && std::abs(rt_rel.
radius(0.5 * (t_min + t_max)) -
r) > precision) {
312 if (rt_rel.
radius(0.5 * (t_min + t_max)) >
r) {
313 t_max = 0.5 * (t_min + t_max);
315 t_min = 0.5 * (t_min + t_max);
319 return 0.5 * (t_min + t_max);
◆ m_cfitter
CurvedPatRec MuonCalib::AdaptiveResidualSmoothing::m_cfitter |
|
private |
◆ m_residual_point
std::vector<DataPoint> MuonCalib::AdaptiveResidualSmoothing::m_residual_point |
|
private |
◆ m_sfitter
The documentation for this class was generated from the following files:
const ShapeFitter * fitter
void setRoadWidth(const double r_road_width)
set the road width for the pattern recognition = r_road_width
std::vector< MdtHitPtr > MdtHitVec
bool fit(MuonCalibSegment &r_segment) const
reconstruction of the track using all hits in the segment "r_segment", returns true in case of succes...
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.
double chi2PerDegreesOfFreedom() const
Return chi2 / number of TrackHits - 2.
void setRoadWidth(const double r_road_width)
set the road width [mm] for the pattern recognition = r_road_width
std::vector< DataPoint > m_residual_point
const MdtHitVec & trackHits() const
virtual double tUpper() const =0
Returns the upper time covered by the r-t.
unsigned int mdtHitsOnTrack() const
retrieve the number of MdtCalibHitBase s assigned to this segment
const std::string selection
virtual double radius(double t) const =0
returns drift radius for a given time
bool fit(MuonCalibSegment &r_segment) const
reconstruction of the track using all hits in the segment "r_segment", returns true in case of succes...
double chi2PerDegreesOfFreedom() const
Return chi2 / number of TrackHits - 3.
virtual double tLower() const =0
Returns the lower time covered by the r-t.
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
const MdtHitVec & trackHits() const
std::vector< unsigned int > HitSelection