ATLAS Offline Software
Loading...
Searching...
No Matches
CalibParamSorter.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
5
6namespace MuonCalib{
7
10
11 int CalibParamSorter::compare(const std::vector<double>& a , const std::vector<double>& b) const {
12 if (a.size() != b.size()) return a.size() < b.size() ? -1 : 1;
13 for (unsigned int i =0 ; i < a.size() ; ++i) {
14 const double d = a[i] - b[i];
15 if (std::abs(d) > m_tolerance) {
16 return d < 0. ? -1 : 1;
17 }
18 }
19 return 0;
20 }
21 int CalibParamSorter::compare(const CalibFunc& a, const CalibFunc& b) const {
22 if (a.name() != b.name()) return a.name() < b.name() ? -1 : 1;
23 return compare(a.parameters() , b.parameters());
24 }
26 const int rtCmp = compare(*a.rt() , *b.rt());
27 if (rtCmp) return rtCmp;
28 return compare(*a.rtRes(), *b.rtRes());
29 }
31 if ( std::abs(a.t0 - b.t0) > m_tolerance) {
32 return a.t0 < b.t0 ? -1 : 1;
33 }
34 if (std::abs(a.adcCal - b.adcCal) > m_tolerance) {
35 return a.adcCal < b.adcCal ? - 1 : 1;
36 }
37 if (a.statusCode != b.statusCode) {
38 return a.statusCode < b.statusCode ? -1 : 1;
39 }
40 return 0;
41 }
42
44 return compare(*a, *b) < 0;
45 }
46 bool CalibParamSorter::operator()(const CalibFunc* a, const CalibFunc* b) const {
47 return compare(*a, *b) < 0;
48 }
54 return compare(*a, *b) < 0;
55 }
57 return compare(*a, *b) < 0;
58 }
59
60}
static Double_t a
generic interface for a calibration function.
Definition CalibFunc.h:33
class which holds calibration constants per rt-region
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
int compare(const std::vector< double > &a, const std::vector< double > &b) const
MdtTubeCalibContainer::SingleTubeCalibPtr SingleTubeCalibPtr
MdtTubeCalibContainer::SingleTubeCalib SingleTubeCalib
bool operator()(const CalibFunc *a, const CalibFunc *b) const
GeoModel::TransientConstSharedPtr< MdtRtRelation > RtRelationPtr