ATLAS Offline Software
MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2024 CERN for the benefit of the ATLAS collaboration
3 */
5 
6 #include "MdtCalibDbAlg.h"
7 #include "MdtCalibR4/TrSqrt.h"
16 #include "GaudiKernel/PhysicalConstants.h"
17 
18 #include "CoralBase/Attribute.h"
19 #include "CoralBase/AttributeListSpecification.h"
20 #include "CoralBase/Blob.h"
22 
23 #include <unordered_map>
24 
26 using namespace MuonCalibR4;
27 
28 MdtCalibDbAlg::MdtCalibDbAlg(const std::string& name, ISvcLocator* pSvcLocator) :
29  AthReentrantAlgorithm(name, pSvcLocator) {}
30 
32  ATH_MSG_VERBOSE("Initialize...");
33  ATH_CHECK(m_idHelperSvc.retrieve());
34  ATH_CHECK(m_idToFixedIdTool.retrieve());
39  return StatusCode::SUCCESS;
40 }
41 
42 StatusCode MdtCalibDbAlg::execute(const EventContext& ctx) const {
43  ATH_MSG_VERBOSE("Executing MdtCalibDbAlgR4");
45  if(writeHandle.isValid()) {
46  ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid.");
47  return StatusCode::SUCCESS;
48  }
49  writeHandle.addDependency(EventIDRange(IOVInfiniteRange::infiniteRunLB()));
50  RegionGranularity gran{RegionGranularity::OnePerMultiLayer};
51  auto writeCdo = std::make_unique<MuonCalib::MdtCalibDataContainer>(m_idHelperSvc.get(), gran);
52 
53  ATH_CHECK(loadRt(ctx,*writeCdo));
54  ATH_CHECK(loadTube(*writeCdo));
55 
56  ATH_CHECK(writeHandle.record(std::move(writeCdo)));
57 
58 
59  return StatusCode::SUCCESS;
60 }
61 
62 StatusCode MdtCalibDbAlg::loadRt(const EventContext& ctx, MuonCalib::MdtCalibDataContainer& writeHandle) const {
63  ATH_MSG_DEBUG("loadRt " << name());
64 
65 
66  SG::ReadCondHandle readHandleRt{m_readKeyRt, ctx};
67  if(!readHandleRt.isValid()) {
68  ATH_MSG_ERROR("No RT data found in " << m_readKeyRt.key());
69  return StatusCode::FAILURE;
70  }
71 
72  std::unordered_map<Identifier, RtPayload> rtCalibration{};
73  for(CondAttrListCollection::const_iterator it = readHandleRt->begin();
74  it != readHandleRt->end(); ++it) {
75  if(!readRtPayload(it->second, rtCalibration)) {
76  ATH_MSG_ERROR("Failed to read RT payload");
77  return StatusCode::FAILURE;
78  }
79  }
80 
81  std::vector<const MuonGMR4::MdtReadoutElement*> detEls = m_r4detMgr->getAllMdtReadoutElements();
82  for(const MuonGMR4::MuonReadoutElement* mdtDetEl : detEls){
83  const Identifier& detElId = mdtDetEl->identify();
84  ATH_MSG_DEBUG("Adding Rt relation for detector element " << m_idHelperSvc->toString(detElId));
85  if(writeHandle.hasDataForChannel(detElId, msgStream())) {
86  const MuonCalib::MdtFullCalibData* dataObj = writeHandle.getCalibData(detElId, msgStream());
87  if(dataObj->rtRelation) {
88  ATH_MSG_DEBUG("Rt relation constants for " << m_idHelperSvc->toString(detElId) << " already exist");
89  continue;
90  }
91  }
92  //find the calibration data for this detector element
93  auto it = rtCalibration.find(detElId);
95  if(it == rtCalibration.end()) {
96  // payload is not appearing in database for multilayer 2, so default it to multilayer 1 calibration
97  if(m_idHelperSvc->mdtIdHelper().multilayer(detElId) == 2) {
98  //try to find the calibration data for multilayer 1
99  Identifier ml1Id = m_idHelperSvc->mdtIdHelper().elementID(m_idHelperSvc->stationName(detElId),
100  m_idHelperSvc->stationEta(detElId),
101  m_idHelperSvc->stationPhi(detElId));
102  Identifier mlID = m_idHelperSvc->mdtIdHelper().multilayerID(ml1Id, 1);
103  it = rtCalibration.find(mlID);
104  if(it == rtCalibration.end()) {
105  ATH_MSG_WARNING("No calibration data found for " << m_idHelperSvc->toString(ml1Id) << " Identifier is " << ml1Id);
106  continue;
107  } else {
108  ATH_MSG_DEBUG("Identifier " << m_idHelperSvc->toString(detElId) << " not found, using multilayer 1 calibration");
109  payload = it->second;
110  }
111  }
112  } else{
113  ATH_MSG_DEBUG("Found calibration data for " << m_idHelperSvc->toString(detElId) << " Identifier is " << detElId);
114  payload = it->second;
115 
116  }
117 
118  //extract rt parameters
119  std::vector<MuonCalib::SamplePoint> samplePointsRt{};
120  for(size_t i = 0; i < payload.times.size(); ++i) {
121  //remap t to [-1,1] range
122  const double chebyShevT = 2.*(payload.times[i] - 0.5*(payload.times.front() + payload.times.back())) / (payload.times.back() - payload.times.front());
123  samplePointsRt.emplace_back(chebyShevT, payload.radii[i], payload.resolutions[i]);
124  }
125 
126  MuonCalib::CalibFunc::ParVec rtPars{payload.times.front(), payload.times.back()}, resolutionPars{};
128  fitter.fit_parameters(samplePointsRt, 1, samplePointsRt.size(), MuonCalib::ChebyshevPolynomial{});
129  for(const double c : fitter.coefficients()) {
130  ATH_MSG_DEBUG("rtPars: " << c);
131  rtPars.push_back(c);
132  }
133 
134  //Extract tr parameters
135  std::vector<MuonCalib::SamplePoint> samplePointsTr{};
136  for(size_t i = 0; i < payload.radii.size(); ++i) {
137  //remap r to [-1,1] range
138  const double chebyShevR = 2.*(payload.radii[i] - 0.5*(payload.radii.front() + payload.radii.back())) / (payload.radii.back() - payload.radii.front());
139  samplePointsTr.emplace_back(chebyShevR, payload.times[i], payload.resolutions[i]);
140  }
141  MuonCalib::CalibFunc::ParVec trPars{payload.radii.front(), payload.radii.back()};
142  fitter.fit_parameters(samplePointsTr, 1, samplePointsTr.size(), MuonCalib::ChebyshevPolynomial{});
143  for(const double c : fitter.coefficients()) {
144  ATH_MSG_DEBUG("trPars: " << c);
145  trPars.push_back(c);
146  }
147 
148  auto rtRelRegion{std::make_shared<MuonCalib::RtChebyshev>(rtPars)};
149  auto rtResRegion{std::make_shared<MuonCalibR4::RtResolutionSqrt>(resolutionPars)};
150  auto trRelRegion{std::make_shared<MuonCalib::TrChebyshev>(rtRelRegion, trPars)};
151  RtRelationPtr MdtRt = std::make_unique<MuonCalib::MdtRtRelation>(std::move(rtRelRegion), std::move(rtResRegion), std::move(trRelRegion), 0.);
152  if(!writeHandle.storeData(detElId, MdtRt, msgStream())) {
153  ATH_MSG_ERROR("Failed to store Rt for " << m_idHelperSvc->toString(detElId));
154  return StatusCode::FAILURE;
155  }
156  }
157  return StatusCode::SUCCESS;
158 }
159 
161  ATH_MSG_DEBUG("loadTube " << name());
162  SG::ReadCondHandle readHandleTube{m_readKeyTube};
163  if(!readHandleTube.isValid()) {
164  ATH_MSG_ERROR("No tube data found in " << m_readKeyTube.key());
165  return StatusCode::FAILURE;
166  }
167  std::unordered_map<Identifier, RtTubePayload> tubeCalibration{};
168  for(CondAttrListCollection::const_iterator it = readHandleTube->begin();
169  it != readHandleTube->end(); ++it) {
170  if(!readTubePayload(it->second, tubeCalibration)) {
171  ATH_MSG_ERROR("Failed to read tube payload");
172  return StatusCode::FAILURE;
173  }
174  }
175  const double inversePropSpeed = 1. / (Gaudi::Units::c_light * m_prop_beta);
176  std::vector<const MuonGMR4::MdtReadoutElement*> detEls = m_r4detMgr->getAllMdtReadoutElements();
177  for(const MuonGMR4::MdtReadoutElement* mdtDetEl: detEls){
178  const Identifier& chamberId = mdtDetEl->identify();
179  if(writeCdo.hasDataForChannel(chamberId, msgStream())) {
180  if(writeCdo.getCalibData(chamberId, msgStream())->tubeCalib) {
181  ATH_MSG_DEBUG("Tube calibration constants for " << m_idHelperSvc->toString(chamberId) << " already exist");
182  continue;
183  }
184  }
185  TubeContainerPtr tubes = std::make_unique<MuonCalib::MdtTubeCalibContainer>(m_idHelperSvc.get(), chamberId);
186  if(!writeCdo.storeData(chamberId, tubes, msgStream())) {
187  ATH_MSG_FATAL("Failed to store chamber " << m_idHelperSvc->toString(chamberId));
188  return StatusCode::FAILURE;
189  }
190  for(std::size_t layer = 1; layer <= mdtDetEl->numLayers(); ++layer){
191  for(std::size_t tube = 1; tube <= mdtDetEl->numTubesInLay(); ++tube){
192  const Identifier tubeId{mdtDetEl->measurementId(mdtDetEl->measurementHash(layer, tube))};
193  auto it = tubeCalibration.find(tubeId);
194  if(it == tubeCalibration.end()) {
195  ATH_MSG_WARNING("No calibration data found for " << m_idHelperSvc->toString(tubeId));
196  continue;
197  }
198  const RtTubePayload& payload = it->second;
200  tubeCalibration.statusCode = payload.statusCode;
201  tubeCalibration.inversePropSpeed = inversePropSpeed;
202  tubeCalibration.t0 = payload.tZero;
203  tubeCalibration.adcCal = payload.meanAdc;
204  if(!tubes->setCalib(std::move(tubeCalibration), tubeId, msgStream())) {
205  ATH_MSG_ERROR("Failed to store tube calibration for " << m_idHelperSvc->toString(tubeId));
206  return StatusCode::FAILURE;
207  }
208  }
209  }
210  }
211  return StatusCode::SUCCESS;
212 }
213 
214 StatusCode MdtCalibDbAlg::readRtPayload(const coral::AttributeList& attributeList, std::unordered_map<Identifier, RtPayload>& rtCalibration) const {
215  ATH_MSG_DEBUG("readRtPayload " << name());
216  std::string data{}, delim{};
217  if (attributeList["data"].specification().type() == typeid(coral::Blob)) {
218  if (!CoralUtilities::readBlobAsString(attributeList["data"].data<coral::Blob>(), data)) {
219  ATH_MSG_FATAL("Cannot uncompress BLOB! Aborting...");
220  return StatusCode::FAILURE;
221  }
222  delim = "\n";
223  } else {
224  data = *(static_cast<const std::string *>((attributeList["data"]).addressOfData()));
225  delim = " ";
226  }
227  const std::vector<std::string> tokens = CxxUtils::tokenize(data, delim);
228  if (tokens.size() < 2) {
229  ATH_MSG_FATAL("The line "<<data<<" cannot be resolved into header & payload");
230  return StatusCode::FAILURE;
231  }
232  const std::string& header = tokens[0];
233  const std::string& payload = tokens[1];
234  const std::vector<int> tokensHeader = CxxUtils::tokenizeInt(header, ",");
235  if(tokensHeader.size()< 2){
236  ATH_MSG_FATAL("Failed to deduce extract number of points & calib Identifier from "<<header);
237  return StatusCode::FAILURE;
238  }
239  const std::size_t calibId = tokensHeader[0];
240  const std::size_t numPoints = tokensHeader[1];
241  MuonCalib::MuonFixedId id(calibId);
242  if (!id.is_mdt()) {
243  ATH_MSG_FATAL("Found non-MDT MuonFixedId, continuing...");
244  return StatusCode::FAILURE;
245  }
246  const Identifier athenaId = m_idToFixedIdTool->fixedIdToId(id);
247  if (!m_idHelperSvc->isMuon(athenaId)) {
248  ATH_MSG_WARNING("The translation from the calibration ID with station: "
249  <<id.stationNameString()<<"("<<id.stationName()<<") "
250  <<" eta:"<<id.eta()<<" phi: "<<id.phi());
251  }
252 
253  RtPayload channelPayload{};
254  channelPayload.station = m_idHelperSvc->stationNameString(athenaId);
255  channelPayload.eta = m_idHelperSvc->stationEta(athenaId);
256  channelPayload.phi = m_idHelperSvc->stationPhi(athenaId);
257  channelPayload.ml = m_idHelperSvc->mdtIdHelper().multilayer(athenaId);
258  channelPayload.layer = m_idHelperSvc->mdtIdHelper().tubeLayer(athenaId);
259  channelPayload.tube = m_idHelperSvc->mdtIdHelper().tube(athenaId);
260  channelPayload.appliedRT = (attributeList["tech"].data<int>());
261 
262  const std::vector<double> dataPoints = CxxUtils::tokenizeDouble(payload, ",");
263  if (dataPoints.size() % 3 != 0) {
264  ATH_MSG_FATAL("Payload does not contain a multiple of 3 elements. Size: " << dataPoints.size());
265  return StatusCode::FAILURE;
266  }
267 
268  // Calculate expected number of data points
269  const std::size_t expectedPoints = dataPoints.size() / 3;
270  if (expectedPoints != numPoints) {
271  ATH_MSG_FATAL("Number of data points (" << expectedPoints << ") does not match numPoints in header (" << numPoints << ").");
272  return StatusCode::FAILURE;
273  }
274 
275  std::vector<double> radii(expectedPoints);
276  std::vector<double> times(expectedPoints);
277  std::vector<double> resos(expectedPoints);
278 
279  for (size_t i = 0; i < expectedPoints; ++i) {
280  radii[i] = dataPoints[i * 3];
281  times[i] = dataPoints[i * 3 + 1];
282  resos[i] = dataPoints[i * 3 + 2];
283  }
284  channelPayload.radii = std::move(radii);
285  channelPayload.times = std::move(times);
286  channelPayload.resolutions = std::move(resos);
287 
288  rtCalibration[athenaId] = std::move(channelPayload);
289  return StatusCode::SUCCESS;
290 }
291 
292 StatusCode MdtCalibDbAlg::readTubePayload(const coral::AttributeList& attributeList, std::unordered_map<Identifier, RtTubePayload>& tubeCalibration) const {
293  ATH_MSG_DEBUG("readTubePayload " << name());
294 
295  std::string data;
296  if (attributeList["data"].specification().type() == typeid(coral::Blob)) {
297  ATH_MSG_VERBOSE("Loading data as a BLOB, uncompressing...");
298  if (!CoralUtilities::readBlobAsString(attributeList["data"].data<coral::Blob>(), data)) {
299  ATH_MSG_FATAL("Cannot uncompress BLOB! Aborting...");
300  return StatusCode::FAILURE;
301  }
302  } else {
303  data = *(static_cast<const std::string*>(attributeList["data"].addressOfData()));
304  }
305 
306  const std::vector<std::string> tokens = CxxUtils::tokenize(data, "\n");
307  if (tokens.size() < 2) {
308  ATH_MSG_FATAL("The line " << data << " cannot be resolved into header & payload");
309  return StatusCode::FAILURE;
310  }
311 
312  std::string header = tokens[0];
313  const std::string& payload = tokens[1];
314 
315  std::string stName = header.substr(2, 3);
316  std::replace(header.begin(), header.end(), '_', ',');
317  const std::vector<std::string> headerTokens = CxxUtils::tokenize(header, ",");
318 
319  if (headerTokens.size() < 6) { // expecting at least 6 tokens
320  ATH_MSG_FATAL("Invalid header format: " << header);
321  return StatusCode::FAILURE;
322  }
323 
324  int phi = std::atoi(headerTokens[1].c_str());
325  int eta = std::atoi(headerTokens[2].c_str());
326  Identifier chamID = m_idHelperSvc->mdtIdHelper().elementID(stName, eta, phi);
327 
328  RtTubePayload channelPayload{};
329  channelPayload.station = stName;
330  channelPayload.eta = eta;
331  channelPayload.phi = phi;
332  channelPayload.appliedT0 = (attributeList["tech"].data<int>());
333 
334  const std::vector<double> payLoadData = CxxUtils::tokenizeDouble(payload, ",");
335  if (payLoadData.size() % 3 != 0) {
336  ATH_MSG_FATAL("Payload size is not a multiple of 3. Size: " << payLoadData.size());
337  return StatusCode::FAILURE;
338  }
339 
340  std::size_t numPoints = payLoadData.size() / 3;
341  std::vector<double> tZeros, meanAdcs;
342  std::vector<int> statusCodes;
343 
344  tZeros.reserve(numPoints);
345  meanAdcs.reserve(numPoints);
346  statusCodes.reserve(numPoints);
347 
348  for (std::size_t i = 0; i < payLoadData.size(); i += 3) {
349  tZeros.push_back(payLoadData[i]);
350  statusCodes.push_back(static_cast<int>(payLoadData[i + 1]));
351  meanAdcs.push_back(payLoadData[i + 2]);
352  }
353 
354  if (statusCodes.size() != tZeros.size() || statusCodes.size() != meanAdcs.size() || statusCodes.empty()) {
355  ATH_MSG_FATAL("Inconsistent payload data sizes for chamber " << m_idHelperSvc->toStringChamber(chamID));
356  return StatusCode::FAILURE;
357  }
358 
359  int ml = 1, layer = 1, tube = 1;
360  const int numMl = m_idHelperSvc->mdtIdHelper().numberOfMultilayers(chamID);
361  const Identifier secondMlID = m_idHelperSvc->mdtIdHelper().multilayerID(chamID, numMl);
362  const int tubesPerLay = std::max(m_idHelperSvc->mdtIdHelper().tubeMax(chamID),
363  m_idHelperSvc->mdtIdHelper().tubeMax(secondMlID));
364  const int numLayers = std::max(m_idHelperSvc->mdtIdHelper().tubeLayerMax(chamID),
365  m_idHelperSvc->mdtIdHelper().tubeLayerMax(secondMlID));
366 
367  for(std::size_t i = 0; i < tZeros.size(); ++i){
368  Identifier tubeID = m_idHelperSvc->mdtIdHelper().channelID(chamID, ml, layer, tube);
369  RtTubePayload tubePayload = channelPayload;
370  tubePayload.ml = ml;
371  tubePayload.layer = layer;
372  tubePayload.tube = tube;
373  tubePayload.tZero = tZeros[i];
374  tubePayload.meanAdc = meanAdcs[i];
375  tubePayload.statusCode = statusCodes[i];
376  tubeCalibration[tubeID] = std::move(tubePayload);
377  if (++tube > tubesPerLay) {
378  tube = 1;
379  if (++layer > numLayers) {
380  layer = 1;
381  ++ml;
382  }
383  }
384  }
385  return StatusCode::SUCCESS;
386 }
387 
388 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
RtResolutionSqrt.h
MdtCalibDbAlg.h
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
MuonCalibR4::MdtCalibDbAlg::readTubePayload
StatusCode readTubePayload(const coral::AttributeList &attributeList, std::unordered_map< Identifier, RtTubePayload > &tubeCalibration) const
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx:292
LArSamples::FitterData::fitter
const ShapeFitter * fitter
Definition: ShapeFitter.cxx:23
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
GeoModel::TransientConstSharedPtr< MdtRtRelation >
MuonCalibR4::MdtCalibDbAlg::RtTubePayload::ml
int ml
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:57
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
CxxUtils::tokenizeDouble
std::vector< double > tokenizeDouble(const std::string &the_str, std::string_view delimiter)
Definition: Control/CxxUtils/Root/StringUtils.cxx:34
header
Definition: hcg.cxx:526
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
MuonCalib::ChebyshevPolynomial
Definition: ChebyshevPolynomial.h:17
MuonCalib::MdtCalibDataContainer::RegionGranularity
RegionGranularity
Definition: MdtCalibDataContainer.h:26
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
CxxUtils::tokenizeInt
std::vector< int > tokenizeInt(const std::string &the_str, std::string_view delimiter)
Definition: Control/CxxUtils/Root/StringUtils.cxx:55
MuonCalib::MdtCalibDataContainer::storeData
bool storeData(const Identifier &mlID, CorrectionPtr corrFuncSet, MsgStream &msg)
Definition: MdtCalibDataContainer.cxx:49
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
CxxUtils::tokenize
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
Definition: Control/CxxUtils/Root/StringUtils.cxx:15
MuonCalibR4::MdtCalibDbAlg::RtTubePayload
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:50
MuonCalib::MdtFullCalibData::rtRelation
RtRelationPtr rtRelation
Definition: MdtFullCalibData.h:21
skel.it
it
Definition: skel.GENtoEVGEN.py:396
MuonGMR4::MuonReadoutElement
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:38
MuonCalibR4::MdtCalibDbAlg::m_readKeyTube
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyTube
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:80
TrSqrt.h
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
beamspotman.tokens
tokens
Definition: beamspotman.py:1284
MuonCalib::MdtFullCalibData
class which holds the full set of calibration constants for a given tube
Definition: MdtFullCalibData.h:15
MuonCalibR4::MdtCalibDbAlg::readRtPayload
StatusCode readRtPayload(const coral::AttributeList &attributeList, std::unordered_map< Identifier, RtPayload > &rtCalibration) const
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx:214
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
MuonCalibR4::MdtCalibDbAlg::RtTubePayload::layer
int layer
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:59
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib::statusCode
unsigned int statusCode
Definition: MdtTubeCalibContainer.h:26
MuonCalibR4::MdtCalibDbAlg::loadTube
StatusCode loadTube(MuonCalib::MdtCalibDataContainer &writeCdo) const
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx:160
MuonCalib::BaseFunctionFitter
Definition: BaseFunctionFitter.h:39
MuonCalibR4::MdtCalibDbAlg::RtTubePayload::tube
int tube
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:58
MuonCalibR4::MdtCalibDbAlg::RtPayload::station
std::string station
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:38
MuonCalib::MdtFullCalibData::tubeCalib
TubeContainerPtr tubeCalib
Definition: MdtFullCalibData.h:22
MuonCalibR4::MdtCalibDbAlg::m_idToFixedIdTool
ToolHandle< MuonCalib::IIdToFixedIdTool > m_idToFixedIdTool
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:81
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MuonCalibR4::MdtCalibDbAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx:42
lumiFormat.i
int i
Definition: lumiFormat.py:85
CoralUtilities::readBlobAsString
bool readBlobAsString(const coral::Blob &, std::string &)
Definition: blobaccess.cxx:85
MdtRtRelation.h
MuonCalibR4::MdtCalibDbAlg::m_r4detMgr
const MuonGMR4::MuonDetectorManager * m_r4detMgr
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:74
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
MuonCalibR4::MdtCalibDbAlg::RtTubePayload::station
std::string station
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:51
IOVInfiniteRange::infiniteRunLB
static EventIDRange infiniteRunLB()
Produces an EventIDRange that is infinite in RunLumi and invalid in Time.
Definition: IOVInfiniteRange.h:39
MuonCalib::CalibFunc::ParVec
std::vector< double > ParVec
Definition: CalibFunc.h:35
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonCalibR4::MdtCalibDbAlg::m_readKeyRt
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyRt
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:78
MuonCalibR4
MdtCalibDbAlgR4 reads raw condition data and writes derived condition data to the condition store.
Definition: RtResolutionSqrt.h:10
RegionGranularity
MdtCalibDataContainer::RegionGranularity RegionGranularity
Definition: MuonConditions/MuonCondGeneral/MuonCondAlg/src/MdtCalibDbAlg.cxx:47
MuonCalibR4::MdtCalibDbAlg::m_maxOrder
Gaudi::Property< unsigned int > m_maxOrder
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:84
IOVInfiniteRange.h
BaseFunctionFitter.h
MuonCalibR4::MdtCalibDbAlg::initialize
virtual StatusCode initialize() override
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx:31
MuonGMR4::MdtReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h:22
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MuonCalib::MuonFixedId
Definition: MuonFixedId.h:50
MuonCalibR4::MdtCalibDbAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:73
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
HI::TowerBins::numLayers
constexpr unsigned int numLayers()
Definition: HIEventDefs.h:23
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:63
MuonCalib::MdtCalibDataContainer::getCalibData
const MdtFullCalibData * getCalibData(const Identifier &measId, MsgStream &msg) const
Returns the calibration data associated with this station
Definition: MdtCalibDataContainer.cxx:38
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
MuonCalibR4::MdtCalibDbAlg::MdtCalibDbAlg
MdtCalibDbAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx:28
MuonCalibR4::MdtCalibDbAlg::m_prop_beta
Gaudi::Property< double > m_prop_beta
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:83
ChebyshevPolynomial.h
blobaccess.h
RtChebyshev.h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CondAttrListCollection::const_iterator
ChanAttrListMap::const_iterator const_iterator
Definition: CondAttrListCollection.h:63
MuonCalib::MdtCalibDataContainer
Definition: MdtCalibDataContainer.h:20
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MdtFullCalibData.h
MuonCalibR4::MdtCalibDbAlg::m_writeKey
SG::WriteCondHandleKey< MuonCalib::MdtCalibDataContainer > m_writeKey
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:75
MuonCalibR4::MdtCalibDbAlg::RtTubePayload::meanAdc
double meanAdc
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:55
TrChebyshev.h
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
MuonCalib::MdtCalibDataContainer::hasDataForChannel
bool hasDataForChannel(const Identifier &measId, MsgStream &msg) const
Checks whether a calibration data object is already present.
Definition: MdtCalibDataContainer.cxx:33
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib
Definition: MdtTubeCalibContainer.h:18
MuonCalibR4::MdtCalibDbAlg::loadRt
StatusCode loadRt(const EventContext &ctx, MuonCalib::MdtCalibDataContainer &writeCdo) const
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.cxx:62
MuonCalibR4::MdtCalibDbAlg::RtTubePayload::tZero
double tZero
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:54
python.compressB64.c
def c
Definition: compressB64.py:93
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
MuonFixedId.h
calibdata.tube
tube
Definition: calibdata.py:31
MuonCalibR4::MdtCalibDbAlg::RtPayload
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:37
MuonCalibR4::MdtCalibDbAlg::RtTubePayload::statusCode
int statusCode
Definition: MuonPhaseII/MuonConditions/MuonCondAlgR4/src/MdtCalibDbAlg.h:56
plot_times.times
def times(fn)
Definition: plot_times.py:11
Identifier
Definition: IdentifierFieldParser.cxx:14