12#include "GaudiKernel/MsgStream.h"
51 declareInterface<ICalibrationIOTool>(
this);
82 return StatusCode::FAILURE;
90 return StatusCode::FAILURE;
93 return StatusCode::SUCCESS;
100 return StatusCode::FAILURE;
105 std::vector<int> val(0);
108 return StatusCode::FAILURE;
111 return StatusCode::SUCCESS;
117 return StatusCode::FAILURE;
126 ATH_MSG_INFO(
"Reading t0s for region " << it->regionId());
129 if (
t0 !=
nullptr) t0s[*it] =
t0;
132 return StatusCode::SUCCESS;
138 std::vector<SamplePoint> points;
140 auto rtrelationrt = rt_relation->
rt();
145 if (rtrelationrt->hasTmaxDiff()) {
146 SamplePoint point(rt_relation->
rt()->GetTmaxDiff(), -99.9, 0.0);
147 points.push_back(point);
151 return StatusCode::FAILURE;
158 return StatusCode::FAILURE;
161 return StatusCode::SUCCESS;
168 return StatusCode::FAILURE;
177 std::vector<SamplePoint> in_points;
180 ATH_MSG_INFO(
"Reading rts for region " << it->regionId());
181 std::vector<SamplePoint> outpoints;
182 float tmax_diff(-9e9);
183 for (
auto & in_point : in_points) {
184 if (in_point.x2() < -99) {
185 tmax_diff = in_point.x1();
188 SamplePoint outpoint(in_point.x1(), in_point.x2(), 1.0);
189 outpoints.push_back(outpoint);
192 if (tmax_diff > -8e8) { rts[*it]->SetTmaxDiff(tmax_diff); }
194 for (
auto & in_point : in_points) {
195 if (in_point.x2() < -99) {
continue; }
196 SamplePoint outpoint(in_point.x1(), in_point.error(), 1.0);
197 outpoints.push_back(outpoint);
202 return StatusCode::SUCCESS;
210 if (rt_lookup &&
static_cast<int>(rt_lookup->nPar() - 2) <=
m_max_rt_points) {
211 double t_min(rt_param[0]);
212 double bin_size = rt_param[1];
213 unsigned int nb_points(rt_lookup->nPar() - 2);
214 for (
unsigned int k = 0; k < nb_points; k++) {
215 double radius(rt_param[k + 2]);
216 if (std::isnan(radius)) {
220 SamplePoint point(t_min + bin_size * k, rt_param[k + 2], -1);
221 points.push_back(point);
225 auto rt_spline =
dynamic_cast<const RtSpline*
>(rt);
226 if (rt_spline &&
static_cast<int>(rt_param.size() / 2) <=
m_max_rt_points) {
227 for (
unsigned int i = 0; i < rt_param.size(); i += 2) {
228 SamplePoint point(rt_param[i], rt_param[i + 1], -1);
229 points.push_back(point);
241 for (
auto & point : points) { point.set_error(rt_resolution.
resolution(point.x1())); }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
std::pair< std::vector< unsigned int >, bool > res
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ParVec & parameters() const
std::vector< double > ParVec
bool WriteUpdateRt(const NtupleStationId &id, int head_id, const std::string &, const std::vector< SamplePoint > &points, int validflag, const RtFullInfo *full_info)
bool LoadRt(const NtupleStationId &id, int head_id, bool validated, const std::string &, std::vector< SamplePoint > &points, RtFullInfo *full_info)
MdtStationT0Container * LoadT0Calibration(const NtupleStationId &id, int head_id, std::string &site_name)
bool WriteT0Chamber(const NtupleStationId &id, const MdtTubeFitContainer *t0, std::vector< int > &validation_flag, int head_id, const std::string &site_name)
generic interface for a rt-relation
virtual double tLower() const =0
Returns the lower time covered by the r-t.
virtual double radius(double t) const =0
returns drift radius for a given time
virtual double tUpper() const =0
Returns the upper time covered by the r-t.
Generic interface to retrieve the resolution on the drift radius as a function of the drift time.
virtual double resolution(double t, double bgRate=0.0) const =0
returns resolution for a give time and background rate
Holds single-tube full calibration information of one chamber.
Station Identifier for sorting calibration data.
Class for communication between event loop and rt calibration algorithm contains only a rt relation f...
std::shared_ptr< const RtFullInfo > fullInfo() const
std::shared_ptr< const IRtRelation > rt() const
access to private attributes
This class allows the user to retrieve an RtChebyshev or RtRelationLookUp object corresponding to a s...
static std::unique_ptr< IRtRelation > getRtRelationLookUp(const std::vector< SamplePoint > &sample_points)
addiitonal information used in validation of a rt-relation
Equidistant look up table for rt-relations with the time as key.
static RtResolutionLookUp getRtResolutionLookUp(const std::vector< SamplePoint > &sample_points)
Equidistant look up table for resolution tables with the time as key.
This class contains the implementation of an r(t) relationship parameterized as support points to a c...
This class provides a sample point for the BaseFunctionFitter.
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.