12#include "CLHEP/Random/RandGaussZiggurat.h"
13#include "CoralBase/Attribute.h"
14#include "CoralBase/AttributeListSpecification.h"
15#include "GaudiKernel/PhysicalConstants.h"
41#include "GeoModelKernel/throwExcept.h"
68 ATH_MSG_DEBUG(
" initialize Random Number Service: running with t0 shift "
73 ATH_MSG_ERROR(
"Could not get random number engine from AthRNGSvc. Abort.");
74 return StatusCode::FAILURE;
79 ATH_MSG_INFO(
"************************************" << std::endl
80 <<
" Running with Calibration Deformations! " << std::endl
81 <<
" For performance studies only!" << std::endl
82 <<
" **************************************");
96 return StatusCode::SUCCESS;
103 if (key.empty())
continue;
107 return StatusCode::FAILURE;
110 ATH_MSG_INFO(
"Size of CondAttrListCollection " << readHandle.
fullKey() <<
" readCdoRt->size()= " << readHandle->size());
114 return StatusCode::SUCCESS;
119 return StatusCode::FAILURE;
121 if (readHandle->hasDCS()) {
124 return StatusCode::SUCCESS;
131 <<
". In theory this should not be called, but may happen"
132 <<
" if multiple concurrent events are being processed out of order.");
133 return StatusCode::SUCCESS;
140 gran = RegionGranularity::OneRt;
142 ATH_MSG_DEBUG(
"Save one set of calibration constants per multi layer");
143 gran = RegionGranularity::OnePerMultiLayer;
144 }
else ATH_MSG_DEBUG(
"Save one set of calibration constants per chamber");
145 std::unique_ptr<MuonCalib::MdtCalibDataContainer> writeCdo = std::make_unique<MuonCalib::MdtCalibDataContainer>(
m_idHelperSvc.get(), gran);
150 return StatusCode::SUCCESS;
156 std::ifstream inputFile(fileName);
159 return StatusCode::FAILURE;
173 for (
unsigned int n = 0; n < rts.nRts(); ++n) {
174 std::unique_ptr<MuonCalib::RtDataFromFile::RtRelation> rt(rts.getRt(n));
181 if (times.size() < 2) {
183 return StatusCode::FAILURE;
186 if (times.size() != radii.size() || times.size() != reso.size()) {
188 return StatusCode::FAILURE;
191 double t_min = times[0];
192 double bin_size = times[1] - t_min;
195 return StatusCode::FAILURE;
201 rtPars.push_back(t_min);
202 rtPars.push_back(bin_size);
205 rtPars.insert(rtPars.end(), radii.begin(), radii.end());
211 resoPars.insert(resoPars.end(), reso.begin(), reso.end());
216 std::shared_ptr<MuonCalib::IRtRelation> rtRel{std::make_shared<RtRelationLookUp>(rtPars)};
217 std::shared_ptr<MuonCalib::IRtResolution> resoRel{std::make_shared<RtResolutionLookUp>(resoPars)};
227 RtRelationPtr MdtRt = std::make_shared<MuonCalib::MdtRtRelation>(rtRel, resoRel);
242 if (writeCdo.
granularity() != RegionGranularity::OnePerMultiLayer)
continue;
253 if (!writeCdo.
storeData(detElId, std::move(storeMe), msgStream())) {
255 return StatusCode::FAILURE;
259 loadedRts[detElId] = MdtRt;
264 if (
msgLvl(MSG::VERBOSE)) {
265 int npoints = rtRel->nPar() - 2;
267 for (
int ipt = 0; ipt < npoints; ++ipt) {
268 double t = t_min + ipt * bin_size;
269 ATH_MSG_VERBOSE(
" " << ipt <<
" " << t <<
" " << rtRel->radius(t) <<
" " << resoRel->resolution(t));
276 return StatusCode::SUCCESS;
279 static std::atomic<bool> rtWarningPrinted =
false;
283 if (detEl) {
return std::make_optional<double>(detEl->
innerTubeRadius()); }
287 if (detEl) {
return std::make_optional<double>(detEl->
innerTubeRadius()); }
289 if (!rtWarningPrinted) {
290 ATH_MSG_WARNING(
"getInnerTubeRadius() - no Muon station known under the name "
292 rtWarningPrinted =
true;
298 std::string data{}, delim{};
299 if (attr[
"data"].specification().
type() ==
typeid(coral::Blob)) {
303 return StatusCode::FAILURE;
307 data = *(
static_cast<const std::string *
>((attr[
"data"]).addressOfData()));
310 const std::vector<std::string> tokens =
tokenize(data, delim);
311 if (tokens.size() < 2) {
312 ATH_MSG_FATAL(
"The line "<<data<<
" cannot be resolved into header & payload");
313 return StatusCode::FAILURE;
315 const std::string&
header = tokens[0];
316 const std::string& payload = tokens[1];
319 unsigned int numPoints{0};
320 nlohmann::json channel{};
322 channel[
"appliedRT"] = rt_ts_applied;
327 if(tokensHeader.size()< 2){
328 ATH_MSG_FATAL(
"Failed to deduce extract number of points & calib Identifier from "<<
header);
329 return StatusCode::FAILURE;
331 unsigned int calibId = tokensHeader[0];
332 numPoints = tokensHeader[1];
336 return StatusCode::FAILURE;
340 ATH_MSG_WARNING(
"The translation from the calibration ID with station: "
341 <<
id.stationNameString()<<
"("<<
id.stationName()<<
") "
342 <<
" eta:"<<
id.
eta()<<
" phi: "<<
id.
phi());
344 channel[
"station"] =
m_idHelperSvc->stationNameString(athenaId);
347 channel[
"ml"] = idHelper.
multilayer(athenaId);
348 channel[
"layer"] = idHelper.
tubeLayer(athenaId);
349 channel[
"tube"] = idHelper.
tube(athenaId);
352 const std::vector<double> dataPoints =
tokenizeDouble(payload,
",");
353 std::vector<double> radii{}, times{}, resos{};
354 radii.reserve(numPoints);
355 times.reserve(numPoints);
356 resos.reserve(numPoints);
360 for (
unsigned int k = 0 ; k < dataPoints.size(); ++k) {
361 const double value = dataPoints[k];
364 radii.push_back(value);
367 times.push_back(value);
370 resos.push_back(value);
376 if (radii.size() != numPoints ||
377 times.size() != numPoints ||
378 resos.size() != numPoints) {
379 ATH_MSG_FATAL(
"Payload "<<payload<<
" does not lead to the expected number of points "<<numPoints<<
" vs. "<<dataPoints.size());
380 return StatusCode::FAILURE;
382 channel[
"radii"] = std::move(radii);
383 channel[
"times"] = std::move(times);
384 channel[
"resolutions"] = std::move(resos);
385 json.push_back(channel);
386 return StatusCode::SUCCESS;
396 return StatusCode::FAILURE;
400 nlohmann::json rtCalibJson = nlohmann::json::array();
404 itr != readHandleRt->end(); ++itr) {
405 const coral::AttributeList &atr = itr->second;
407 if (atr[
"data"].specification().
type() ==
typeid(coral::Blob)) {
411 return StatusCode::FAILURE;
415 data = *(
static_cast<const std::string *
>((atr[
"data"]).addressOfData()));
418 nlohmann::json yy = nlohmann::json::parse(data);
419 for (
auto &it : yy.items()) {
420 nlohmann::json yx = it.value();
421 rtCalibJson.push_back(yx);
428 itr != readHandleRt->end(); ++itr) {
435 for (
const auto& payload : rtCalibJson) {
436 const bool rt_ts_applied = payload[
"appliedRT"];
438 const std::string
stName = payload[
"station"];
440 payload[
"ml"], payload[
"layer"], payload[
"tube"]);
443 if (!innerTubeRadius)
continue;
446 const std::vector<double> radii = payload[
"radii"];
447 const std::vector<double> times = payload[
"times"];
448 const std::vector<double> resolutions = payload[
"resolutions"];
461 std::vector<MuonCalib::SamplePoint> tr_points{}, ts_points{};
463 float multilayer_tmax_diff{-std::numeric_limits<float>::max()};
466 for (
unsigned int k = 0; k < radii.size(); ++k) {
467 float radius = radii[k];
469 float oldradius = radius;
471 float rshift =
m_rtShift * 1.87652e-2 * radius * (radius - *innerTubeRadius);
472 radius = oldradius +
rshift;
473 ATH_MSG_DEBUG(
"DEFORM RT: old radius " << oldradius <<
" new radius " << radius <<
" shift " <<
rshift
478 float oldradius = radius;
480 ATH_MSG_DEBUG(
"DEFORM RT: old radius " << oldradius <<
" new radius " << radius <<
" scale factor " <<
m_rtScale);
484 float time = times[k];
488 float sigma = resolutions[k];
492 if (tr_point.
x2() < -99) {
493 multilayer_tmax_diff = tr_point.
x1();
494 }
else if (tr_points.empty() || (tr_points.back().x1() < tr_point.
x1() && tr_points.back().x2() < tr_point.
x2())) {
495 tr_points.push_back(tr_point);
496 ts_points.push_back(ts_point);
501 if (ts_points.size() < 3) {
503 return StatusCode::FAILURE;
507 float sign(rt_ts_applied ? -1.0 : 1.0);
509 for (
auto & tr_point : tr_points) {
510 int slice_number =
static_cast<int>(std::floor(tr_point.
x2() / slice_width));
511 if (slice_number < 0) slice_number = 0;
520 if (
msgLvl(MSG::VERBOSE)) {
523 ATH_MSG_VERBOSE(point.x1() <<
"|" << point.x2() <<
"|" << point.error());
526 for (
unsigned int i = 0; i < reso->nPar(); i++) {
ATH_MSG_VERBOSE(i <<
" " << reso->par(i)); }
531 if (!reso || !rt) {
continue; }
533 if (rt->par(1) == 0.) {
537 return StatusCode::FAILURE;
540 if (multilayer_tmax_diff > -8e8) { rt->SetTmaxDiff(multilayer_tmax_diff); }
542 RtRelationPtr rt_rel = std::make_shared<MuonCalib::MdtRtRelation>(std::move(rt), std::move(reso));
544 if (!writeCdo.
storeData(athenaId ,rt_rel, msgStream()))
return StatusCode::FAILURE;
546 loadedRtRel[athenaId] = std::move(rt_rel);
551 if (loadedRtRel.empty()) {
552 return StatusCode::SUCCESS;
555 ATH_MSG_DEBUG(
"Initializing " << loadedRtRel.size()<<
" b-field functions");
560 if (readCondHandleDb->hasDCS()) {
561 condDbData = readCondHandleDb.
cptr();
563 ATH_MSG_INFO(
"Do not retrieve the HV from DCS. Fall back to 2730 & 3080");
568 for (
const auto& [athenaId, rtRelation] : loadedRtRel) {
569 CorrectionPtr corrFuncSet = std::make_unique<MuonCalib::MdtCorFuncSet>();
572 std::vector<double> corr_params(2);
573 bool loadDefault{
false};
578 if (corr_params[0] < std::numeric_limits<float>::epsilon()) {
582 }
else loadDefault =
true;
585 corr_params[0] = 2730.0;
587 corr_params[0] = 3080.0;
590 corr_params[1] = 0.11;
591 corrFuncSet->
setBField(std::make_unique<MuonCalib::BFieldCorFunc>(
"medium", corr_params, rtRelation->rt()));
596 if (!writeCdo.
storeData(athenaId, std::move(corrFuncSet), msgStream()))
return StatusCode::FAILURE;
599 return StatusCode::SUCCESS;
609 for (; it != it_end; ++it) {
620 if (!writeCdo.
storeData(*it, tubes, msgStream()))
return StatusCode::FAILURE;
626 unsigned int nlayers = tubes->
numLayers();
627 unsigned int ntubes = tubes->
numTubes();
628 int size = nml * nlayers * ntubes;
631 <<
" size " <<
size <<
" ml " << nml <<
" l " << nlayers <<
" t " << ntubes);
632 for (
unsigned int ml = 1; ml <= nml; ++ml) {
633 for (
unsigned int l = 1; l <= nlayers; ++l) {
634 for (
unsigned int t = 1; t <= ntubes; ++t) {
639 tubes->
setCalib(std::move(data), tubeId, msgStream());
644 return StatusCode::SUCCESS;
650 if (attr[
"data"].specification().
type() ==
typeid(coral::Blob)) {
654 return StatusCode::FAILURE;
658 data = *(
static_cast<const std::string *
>((attr[
"data"]).addressOfData()));
660 std::vector<std::string> tokens =
tokenize(data,
"\n");
661 if (tokens.size() < 2) {
662 ATH_MSG_FATAL(
"The line "<<data<<
" cannot be resolved into header & payload");
663 return StatusCode::FAILURE;
665 std::string&
header = tokens[0];
666 const std::string& payload = tokens[1];
673 int eta{0},
phi{0}, nTubes{0};
676 const std::vector<std::string> headerTokens =
tokenize(
header,
",");
679 nTubes =
atoi(headerTokens[5]);
685 static std::atomic<bool> idWarningPrinted =
false;
686 if (!idWarningPrinted) {
688 <<
" is invalid. Skipping");
689 idWarningPrinted.store(
true, std::memory_order_relaxed);
691 return StatusCode::SUCCESS;
693 nlohmann::json channel{};
695 channel[
"appliedT0"] = t0_ts_applied;
696 channel[
"station"] =
stName;
697 channel[
"eta"] =
eta;
698 channel[
"phi"] =
phi;
700 const std::vector<double> payLoadData =
tokenizeDouble(payload,
",");
701 std::vector<double> tzeros{}, meanAdcs{};
702 std::vector<int> statusCodes{};
705 for (
unsigned int k = 0; k < payLoadData.size(); ++k){
706 const double value = payLoadData[k];
709 tzeros.push_back(value);
712 statusCodes.push_back(value);
715 meanAdcs.push_back(value);
720 if (statusCodes.size() != tzeros.size() ||
721 statusCodes.size() != meanAdcs.size() ||
722 statusCodes.empty()) {
724 return StatusCode::FAILURE;
727 int ml{1}, layer{1}, tube{1};
731 const int tubesPerLay = std::max(idHelper.
tubeMax(chamID), idHelper.
tubeMax(secondMlID));
733 if (
m_checkTubes && (numMl * numLayers * tubesPerLay) != nTubes) {
734 ATH_MSG_FATAL(
"Calibration database differs in terms of number of tubes for chamber "
735 <<
m_idHelperSvc->toStringChamber(chamID)<<
". Expected "<<(numMl * numLayers * tubesPerLay)
736 <<
" vs. observed "<<nTubes);
737 return StatusCode::FAILURE;
739 nlohmann::json calibData = nlohmann::json::array();
740 for (
unsigned int k = 0; k < tzeros.size(); ++k) {
741 nlohmann::json channelData{};
742 channelData[
"ml"] = ml;
743 channelData[
"layer"] =layer;
744 channelData[
"tube"] = tube;
745 channelData[
"t0"] = tzeros[k];
746 channelData[
"meanAdc"] = meanAdcs[k];
747 channelData[
"status"] = statusCodes[k];
749 if (tube > tubesPerLay){
753 if (layer > numLayers){
757 calibData.push_back(std::move(channelData));
759 channel[
"calibConstants"] = std::move(calibData);
760 json.push_back(std::move(channel));
761 return StatusCode::SUCCESS;
770 nlohmann::json t0CalibJson = nlohmann::json::array();
773 itr != readHandleTube->end(); ++itr) {
774 const coral::AttributeList &atr = itr->second;
776 if (atr[
"data"].specification().
type() ==
typeid(coral::Blob)) {
780 return StatusCode::FAILURE;
784 data = *(
static_cast<const std::string *
>((atr[
"data"]).addressOfData()));
787 nlohmann::json yy = nlohmann::json::parse(data);
788 for (
auto &it : yy.items()) {
789 nlohmann::json yx = it.value();
790 t0CalibJson.push_back(yx);
797 itr != readHandleTube->end(); ++itr) {
803 const float inversePropSpeed = 1. / (Gaudi::Units::c_light *
m_prop_beta);
809 for (
const auto& chambChannel : t0CalibJson) {
810 const std::string
stName = chambChannel[
"station"];
811 const int ieta = chambChannel[
"eta"];
812 const int iphi = chambChannel[
"phi"];
813 const bool t0_ts_applied = chambChannel[
"appliedT0"];
819 static std::atomic<bool> idWarningPrinted =
false;
820 if (!idWarningPrinted) {
822 <<
" is not valid, skipping");
823 idWarningPrinted.store(
true, std::memory_order_relaxed);
837 if (!writeCdo.
storeData(chId, tubes, msgStream())) {
839 <<
" ID fields: "<<
stName<<
","<<ieta<<
","<<iphi);
840 return StatusCode::FAILURE;
843 const nlohmann::json& tubeConstants = chambChannel[
"calibConstants"];
844 for (
const auto& tubeChannel : tubeConstants) {
845 const int ml = tubeChannel[
"ml"];
846 const int l = tubeChannel[
"layer"];
847 const int t = tubeChannel[
"tube"];
848 double tzero = tubeChannel[
"t0"];
854 CLHEP::HepRandomEngine *engine =
m_RNGWrapper->getEngine(ctx);
855 double sh = CLHEP::RandGaussZiggurat::shoot(engine, 0.,
m_t0Spread);
857 ATH_MSG_VERBOSE(
"T0 spread " <<
sh <<
" t0 " << tzero <<
" id " << ml <<
" " << l <<
" " << t);
862 const int statusCode = tubeChannel[
"status"];
863 const double meanAdc = tubeChannel[
"meanAdc"];
867 datatube.
adcCal = meanAdc;
869 tubes->
setCalib(std::move(datatube), tubeId, msgStream());
875 return StatusCode::SUCCESS;
882 std::vector<Double_t>
x(sample_points.size(),0);
883 std::vector<Double_t>
y(sample_points.size(),0);
885 for (
unsigned int i = 0; i < sample_points.size(); i++) {
886 x[i] = sample_points[i].x1();
887 y[i] = sample_points[i].x2();
889 TSpline3
sp(
"Rt Res Tmp",
x.data(),
y.data(), sample_points.size());
893 unsigned int nb_points(100);
894 std::vector<double> res_param(nb_points + 2);
895 Double_t bin_width = (
x[sample_points.size() - 1] -
x[0]) /
static_cast<Double_t
>(nb_points);
898 res_param[1] = bin_width;
899 for (
unsigned int k = 0; k < nb_points; k++) {
900 Double_t xx =
x[0] + k * bin_width;
901 res_param[k + 2] =
sp.Eval(xx);
902 if (std::isnan(res_param[k + 2])) {
903 TFile outf(
"kacke.root",
"RECREATE");
906 "encountered nan element");
909 return std::make_unique<MuonCalib::RtResolutionLookUp>(std::move(res_param));
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
bool isValid() const
Test to see if the link can be dereferenced.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
Abstract interface to IOVDbSvc to access IOVRange and tag information.
MdtFullCalibData::CorrectionPtr CorrectionPtr
MdtFullCalibData::TubeContainerPtr TubeContainerPtr
MdtCalibDataContainer::RegionGranularity RegionGranularity
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
ChanAttrListMap::const_iterator const_iterator
static EventIDRange infiniteTime()
Produces an EventIDRange that is inifinite in Time and invalid in RunLumi.
value_type get_compact() const
Get the compact id.
const DcsConstants & getHvState(const Identifier &multiLayerID) const
Identifier multilayerID(const Identifier &channeldID) const
int multilayer(const Identifier &id) const
Access to components of the ID.
Identifier elementID(int stationName, int stationEta, int stationPhi) const
int tube(const Identifier &id) const
static int tubeLayerMax()
int tubeLayer(const Identifier &id) const
int numberOfMultilayers(const Identifier &id) const
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
std::vector< double > ParVec
bool storeData(const Identifier &mlID, CorrectionPtr corrFuncSet, MsgStream &msg)
bool hasDataForChannel(const Identifier &measId, MsgStream &msg) const
Checks whether a calibration data object is already present.
void setInversePropSpeed(const float speed)
RegionGranularity granularity() const
const MdtFullCalibData * getCalibData(const Identifier &measId, MsgStream &msg) const
Returns the calibration data associated with this station.
void setBField(std::unique_ptr< IMdtBFieldCorFunc > &&bField)
void setSlewing(std::unique_ptr< IMdtSlewCorFunc > &&slew)
unsigned int numLayers() const
unsigned int numMultilayers() const
bool setCalib(SingleTubeCalib val, const Identifier &tubeId, MsgStream &msg)
set the calibration constants of a single tube
unsigned int numTubes() const
Implements fixed identifiers not dependent upon Athena Identifier for internal use in the calibration...
Manages the I/O of the Rt realtions from/to file.
std::vector< double > DataVec
static std::unique_ptr< IRtRelation > getRtRelationLookUp(const std::vector< SamplePoint > &sample_points)
This class provides a sample point for the BaseFunctionFitter.
double x2() const
get the error on the x2 coordinate of the sample point
void set_error(const double merror)
void set_x2(const double mx2)
set the error of the x2 coordinate sample point to merror
void set_x1(const double mx1)
set the x2 coordinate of the sample point to mx2
double x1() const
< get the x1 coordinate of the sample point
Readout element to describe the Monitored Drift Tube (Mdt) chambers Mdt chambers usually comrpise out...
double innerTubeRadius() const
Returns the inner tube radius.
double innerTubeRadius() const
Returns the inner tube radius excluding the aluminium walls.
std::vector< Identifier >::const_iterator const_id_iterator
const_id_iterator module_end() const
const_id_iterator module_begin() const
Iterators over full set of ids.
const_id_iterator detectorElement_begin() const
Iterators over full set of ids.
const_id_iterator detectorElement_end() const
Gaudi::Property< bool > m_newFormat2020
ServiceHandle< IAthRNGSvc > m_AthRNGSvc
Gaudi::Property< bool > m_TimeSlewingCorrection
MuonCalib::MdtFullCalibData::RtRelationPtr RtRelationPtr
ATHRNG::RNGWrapper * m_RNGWrapper
Gaudi::Property< bool > m_createSlewingFunction
SG::ReadCondHandleKey< MdtCondDbData > m_readKeyDCS
Gaudi::Property< bool > m_useNewGeo
const MuonGM::MuonDetectorManager * m_detMgr
StatusCode legacyTubePayloadToJSON(const coral::AttributeList &attr, nlohmann::json &json) const
virtual StatusCode execute(const EventContext &ctx) const override
std::optional< double > getInnerTubeRadius(const Identifier &id) const
Gaudi::Property< double > m_prop_beta
StatusCode declareDependency(const EventContext &ctx, SG::WriteCondHandle< MuonCalib::MdtCalibDataContainer > &writeHandle) const
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyTube
Gaudi::Property< double > m_t0Spread
Gaudi::Property< double > m_t0Shift
Gaudi::Property< double > m_defaultT0
StringProperty m_RTfileName
SG::WriteCondHandleKey< MuonCalib::MdtCalibDataContainer > m_writeKey
StatusCode defaultRt(MuonCalib::MdtCalibDataContainer &writeCdoRt, LoadedRtMap &loadedRts) const
Gaudi::Property< double > m_TsCorrectionT0
Gaudi::Property< bool > m_checkTubes
only needed to retrieve information on number of tubes etc. (no alignment needed)
virtual StatusCode initialize() override
Gaudi::Property< double > m_rtShift
Gaudi::Property< std::vector< float > > m_MeanCorrectionVsR
StringProperty m_randomStream
StatusCode loadTube(const EventContext &ctx, MuonCalib::MdtCalibDataContainer &writeCdo) const
ToolHandle< MuonCalib::IIdToFixedIdTool > m_idToFixedIdTool
StatusCode legacyRtPayloadToJSON(const coral::AttributeList &attr, nlohmann::json &json) const
Parses the legacy payload for the RT functions to a json format.
StatusCode defaultT0s(MuonCalib::MdtCalibDataContainer &writeCdoTube) const
Gaudi::Property< bool > m_UseMLRt
Gaudi::Property< bool > m_create_b_field_function
std::map< Identifier, RtRelationPtr > LoadedRtMap
static std::unique_ptr< MuonCalib::RtResolutionLookUp > getRtResolutionInterpolation(const std::vector< MuonCalib::SamplePoint > &sample_points)
Gaudi::Property< double > m_rtScale
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
StatusCode loadRt(const EventContext &ctx, MuonCalib::MdtCalibDataContainer &writeCdo) const
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyRt
const MuonGMR4::MuonDetectorManager * m_r4detMgr
static std::string find_calib_file(const std::string &logical_file_name)
const DataObjID & fullKey() const
const EventIDRange & getRange()
const_pointer_type cptr()
void addDependency(const EventIDRange &range)
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const DataObjID & fullKey() const
bool readBlobAsString(const coral::Blob &, std::string &)
std::vector< double > tokenizeDouble(std::string_view the_str, std::string_view delimiter)
const std::string & name() const
Return the root name of the expression.
bit_t size() const
Count the number of 1 bits in the set.
std::vector< int > tokenizeInt(std::string_view str, std::string_view delimiter)
std::vector< std::string > tokenize(std::string_view the_str, std::string_view delimiters)
Splits the string into smaller substrings.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
namespace to identify classes related only to muon calibration
@ TIME_SLEWING_CORRECTION_APPLIED
const std::string & stName(StIndex index)
convert StIndex into a string
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
class which holds the full set of calibration constants for a given tube
TubeContainerPtr tubeCalib
GeoModel::TransientConstSharedPtr< MdtTubeCalibContainer > TubeContainerPtr
GeoModel::TransientConstSharedPtr< MdtCorFuncSet > CorrectionPtr
float adcCal
quality flag for the SingleTubeCalib constants: 0 all ok, 1 no hits found, 2 too few hits,...
float t0
< relative t0 in chamber (ns)
Helper struct to cache all dcs constants in a common place of the memory.
#define THROW_EXCEPTION(MESSAGE)