ATLAS Offline Software
Loading...
Searching...
No Matches
NswCalibDbAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "NswCalibDbAlg.h"
6
7#include "TTree.h"
8#include "TFile.h"
10#include "CoralBase/Blob.h"
18#include "GeoModelKernel/throwExcept.h"
19
20#include<ctime>
21
22namespace Muon{
23// Initialize
26
27 // retrievals
28 ATH_MSG_DEBUG( "initializing " << name() );
29 ATH_CHECK(m_idHelperSvc.retrieve());
30
31 // initialize read keys
44 m_loadMmT0Data = m_loadMmT0Data && m_idHelperSvc->hasMM() && (!m_mmT0FilePath.empty() || !m_readKey_mm_t0.empty());
45 m_loadsTgcT0Data = m_loadsTgcT0Data && m_idHelperSvc->hasSTGC() && (!m_stgcT0FilePath.empty() || !m_readKey_stgc_t0.empty()) ;
46
49
50 // write key for time/charge data
51 ATH_CHECK(m_writeKey_tdopdo.initialize());
52
53 // write key for threshold data
55
57
58 return StatusCode::SUCCESS;
59}
60
61
62// execute
63StatusCode
64NswCalibDbAlg::execute(const EventContext& ctx) const {
65
66 ATH_MSG_DEBUG( "execute " << name() );
67
71 return StatusCode::SUCCESS;
72
73}
74
75// processTdoPdoData
76StatusCode
77NswCalibDbAlg::processTdoPdoData(const EventContext& ctx) const {
78
79 // set up write handles for time/charge data
81 if (wrHdl.isValid()) {
82 ATH_MSG_DEBUG("CondHandle " << wrHdl.fullKey() << " is already valid."
83 << " In theory this should not be called, but may happen"
84 << " if multiple concurrent events are being processed out of order.");
85 return StatusCode::SUCCESS;
86 }
87 ATH_MSG_DEBUG("Range of time/charge output is " << wrHdl.getRange());
88 auto wrCdo{std::make_unique<NswCalibDbTimeChargeData>(m_idHelperSvc.get())};
89
90 // MM
91 ATH_CHECK(loadTimeChargeData(ctx, m_readKey_mm_sidea_tdo, TimeChargeTech::MM, TimeChargeType::TDO, *wrCdo));
92 ATH_CHECK(loadTimeChargeData(ctx, m_readKey_mm_sidec_tdo, TimeChargeTech::MM, TimeChargeType::TDO, *wrCdo));
93 ATH_CHECK(loadTimeChargeData(ctx, m_readKey_mm_sidea_pdo, TimeChargeTech::MM, TimeChargeType::PDO, *wrCdo));
94 ATH_CHECK(loadTimeChargeData(ctx, m_readKey_mm_sidec_pdo, TimeChargeTech::MM, TimeChargeType::PDO, *wrCdo));
95 ATH_CHECK(loadTimeChargeData(ctx, m_readKey_stgc_sidea_tdo, TimeChargeTech::STGC, TimeChargeType::TDO, *wrCdo));
96 ATH_CHECK(loadTimeChargeData(ctx, m_readKey_stgc_sidec_tdo, TimeChargeTech::STGC, TimeChargeType::TDO, *wrCdo));
97 ATH_CHECK(loadTimeChargeData(ctx, m_readKey_stgc_sidea_pdo, TimeChargeTech::STGC, TimeChargeType::PDO, *wrCdo));
98 ATH_CHECK(loadTimeChargeData(ctx, m_readKey_stgc_sidec_pdo, TimeChargeTech::STGC, TimeChargeType::PDO, *wrCdo));
103 ATH_CHECK(wrHdl.record(std::move(wrCdo)));
104 ATH_MSG_DEBUG("Recorded new " << wrHdl.key() << " with range " << wrHdl.getRange() << " into Conditions Store");
105
106 return StatusCode::SUCCESS; // nothing to do
107
108}
109
110
111// processThrData
112StatusCode
113NswCalibDbAlg::processThrData(const EventContext& ctx) const {
114
116 return StatusCode::SUCCESS; // nothing to do
117 }
118 // set up write handles for threshold data
120 if (wrHdl.isValid()) {
121 ATH_MSG_DEBUG("CondHandle " << wrHdl.fullKey() << " is already valid."
122 << " In theory this should not be called, but may happen"
123 << " if multiple concurrent events are being processed out of order.");
124 return StatusCode::SUCCESS;
125 }
126 ATH_MSG_DEBUG("Range of threshold output is " << wrHdl.getRange());
127 auto wrCdo{std::make_unique<NswCalibDbThresholdData>(m_idHelperSvc.get())};
128
129 ATH_CHECK(loadThresholdData(ctx, m_readKey_mm_sidea_thr, ThresholdTech::MM, *wrCdo));
130 ATH_CHECK(loadThresholdData(ctx, m_readKey_mm_sidec_thr, ThresholdTech::MM, *wrCdo));
131 ATH_CHECK(loadThresholdData(ctx, m_readKey_stgc_sidea_thr, ThresholdTech::STGC, *wrCdo));
132 ATH_CHECK(loadThresholdData(ctx, m_readKey_stgc_sidec_thr, ThresholdTech::STGC, *wrCdo));
135
136 // insert/write data for threshold data
137 ATH_CHECK(wrHdl.record(std::move(wrCdo)));
138 ATH_MSG_DEBUG("Recorded new " << wrHdl.key() << " with range " << wrHdl.getRange() << " into Conditions Store");
139
140 return StatusCode::SUCCESS;
141}
142
143// processMmT0Data
144StatusCode
145NswCalibDbAlg::processNSWT0Data(const EventContext& ctx) const {
146 // set up write handles for MmT0 data
148 return StatusCode::SUCCESS;
149 }
150
152 if (wrHdl.isValid()) {
153 ATH_MSG_DEBUG("CondHandle " << wrHdl.fullKey() << " is already valid."
154 << " In theory this should not be called, but may happen"
155 << " if multiple concurrent events are being processed out of order.");
156 return StatusCode::SUCCESS;
157 }
158 wrHdl.addDependency(EventIDRange(IOVInfiniteRange::infiniteTime()));
159
160 ATH_MSG_DEBUG("Range of MmT0 output is " << wrHdl.getRange());
161 auto wrCdo{std::make_unique<NswT0Data>(m_idHelperSvc.get())};
162 if(m_loadMmT0Data){
163 if(!m_mmT0FilePath.empty() ){ // let's read the constants from a file
164 ATH_MSG_INFO("processing MM T0 from file " << m_mmT0FilePath);
165 std::unique_ptr<TFile> file (TFile::Open(m_mmT0FilePath.value().c_str()));
166 if(!file || file->IsZombie()){
167 ATH_MSG_FATAL("Failed to open file containing the MM T0Data. Filepath: "<<m_mmT0FilePath);
168 return StatusCode::FAILURE;
169 }
170 std::unique_ptr<TTree> tree{dynamic_cast<TTree*>(file->Get("tree_ch"))};
171 if(!tree){
172 ATH_MSG_FATAL("Failed to load tree containing the NswT0Data.");
173 return StatusCode::FAILURE;
174 }
175 ATH_CHECK(loadT0Data(std::move(tree), *wrCdo, T0Tech::MM));
176
177 } else if(!m_readKey_mm_t0.empty()){
178 ATH_MSG_DEBUG("LOAD NSW MM T0 FROM DB");
179 std::unique_ptr<TTree> tree{};
181 ATH_CHECK(loadT0Data(std::move(tree), *wrCdo, T0Tech::MM));
182
183 } else {
184 ATH_MSG_ERROR("Neither a database folder nor a file have been provided to read the MM T0 constants");
185 return StatusCode::FAILURE;
186 }
187 }
189 if(!m_stgcT0FilePath.empty()){ // let's read the constants from a file
190 ATH_MSG_INFO("processing sTGC T0 from file " << m_stgcT0FilePath);
191 wrHdl.addDependency(EventIDRange(IOVInfiniteRange::infiniteTime()));
192 std::unique_ptr<TFile> file (TFile::Open(m_stgcT0FilePath.value().c_str()));
193 if(!file || file->IsZombie()){
194 ATH_MSG_FATAL("Failed to open file containing the sTGC T0Data. Filepath: "<<m_stgcT0FilePath);
195 return StatusCode::FAILURE;
196 }
197 std::unique_ptr<TTree> tree{dynamic_cast<TTree*>(file->Get("tree_ch"))};
198 if(!tree){
199 ATH_MSG_FATAL("Failed to load tree containing the NswT0Data.");
200 return StatusCode::FAILURE;
201 }
202 ATH_CHECK(loadT0Data(std::move(tree), *wrCdo, T0Tech::STGC));
203
204 } else if(!m_readKey_stgc_t0.empty()) {
205 ATH_MSG_DEBUG("LOAD NSW sTGC T0 FROM DB");
206 std::unique_ptr<TTree> tree;
207 //check failure implies tree is nullptr, and will exit
209 //coverity[FORWARD_NULL:FALSE]
210 ATH_CHECK(loadT0Data(std::move(tree), *wrCdo, T0Tech::STGC));
211
212 } else {
213 ATH_MSG_ERROR("Neither a database folder nor a file have been provided to read the sTGC T0 constants");
214 return StatusCode::FAILURE;
215 }
216 }
218
219 // insert/write data for NswT0Data data
220 ATH_CHECK(wrHdl.record(std::move(wrCdo)));
221 ATH_MSG_DEBUG("Recorded new " << wrHdl.key() << " with range " << wrHdl.getRange() << " into Conditions Store");
222
223 return StatusCode::SUCCESS;
224}
225
226StatusCode NswCalibDbAlg::loadT0ToTree(const EventContext& ctx,
227 const readKey_t& readKey,
228 std::unique_ptr<TTree>& tree) const{
229 // set up read handle
230 const CondAttrListCollection* readCdo{};
231 ATH_CHECK(SG::get(readCdo, readKey, ctx));
232 if(!readCdo){
233 ATH_MSG_DEBUG("Key is empty");
234 return StatusCode::SUCCESS;
235 }
236 // iterate through data
238 for(itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
239
240 // retrieve blob
241 const coral::AttributeList& atr = itr->second;
242 if(atr["data"].specification().type() != typeid(coral::Blob)) {
243 ATH_MSG_FATAL( "Data column is not of type blob!" );
244 return StatusCode::FAILURE;
245 }
246 coral::Blob blob = atr["data"].data<coral::Blob>();
248 ATH_MSG_FATAL( "Cannot retrieve data from coral blob!" );
249 return StatusCode::FAILURE;
250 }
251 }
252 return StatusCode::SUCCESS;
253}
254
255StatusCode NswCalibDbAlg::loadT0Data(std::unique_ptr<TTree>&& tree,
256 NswT0Data& writeCdo,
257 const T0Tech tech) const{
258 int sector{0}, layer{0}, channel{0}, channelType{0}, stationEta{0};
259 double time{0};
260 tree->SetBranchAddress("sector", &sector);
261 tree->SetBranchAddress("layer", &layer);
262 tree->SetBranchAddress("channel", &channel);
263 tree->SetBranchAddress("mean", &time);
264 tree->SetBranchAddress("stationEta", &stationEta);
265 tree->SetBranchAddress("channel_type", &channelType);
266 if (msgLvl(MSG::VERBOSE)) {
267 tree->Print();
268 }
269
270 ATH_MSG_DEBUG("NSW t0 calibration tree has "<< tree->GetEntries() <<" entries for tech "
271 << (tech==T0Tech::MM ? "MM" : "sTGC"));
272
273 for(Long64_t i_channel=0; i_channel<tree->GetEntries(); ++i_channel) {
274 tree->GetEntry(i_channel);
275
276 int stationPhi = ((std::abs(sector)-1)/2)+1;
277 uint multilayer = (layer<4 ? 1:2); // multilayer 1 corresponds to layers 0-3, ML 2 to layers 4-7
278 uint gasGap = layer - (multilayer-1)*4 + 1;
279
280 Identifier id{};
281
282 if(tech==T0Tech::MM){
283 std::string stationName = (sector%2==1 ? "MML" : "MMS");
284 bool isValid{true};
285 id = m_idHelperSvc->mmIdHelper().channelID(stationName, stationEta, stationPhi,multilayer,gasGap, channel
286 // checking the validity of the identifier in production code is too expensiv, therefore only check it in debug build
287 #ifndef NDEBUG
288 , isValid
289 #endif
290 );
291
292 if(!isValid){
293 ATH_MSG_ERROR("MM sector "<< sector <<" layer " << layer<< " channel "<< channel << " mean "<< time << " stationEta " << stationEta << " stationPhi " << stationPhi <<" stationName "<< stationName << " multilayer " << multilayer << " gas gap "<< gasGap << " channel " << channel);
294 ATH_MSG_ERROR("Failed to build identifier");
295 return StatusCode::FAILURE;
296 }
297 } else {
298 std::string stationName = (sector%2==1 ? "STL" : "STS");
299 bool isValid{true};
300 id = m_idHelperSvc->stgcIdHelper().channelID(stationName, stationEta, stationPhi, multilayer, gasGap, channelType, channel
301 // checking the validity of the identifier in production code is too expensiv, therefore only check it in debug build
302 #ifndef NDEBUG
303 , isValid
304 #endif
305 );
306 if(!isValid){
307 ATH_MSG_ERROR("Failed to build identifier");
308 ATH_MSG_DEBUG("STG sector "<< sector <<" layer " << layer<< " channel "<< channel << " mean "<< time << " stationEta " << stationEta << " stationPhi " << stationPhi <<" stationName "<< stationName << " multilayer " << multilayer << " gas gap "<< gasGap << " channel " << channel << " channel type" << channelType);
309 return StatusCode::FAILURE;
310 }
311 }
312 writeCdo.setData(id, time);
313 }
314 return StatusCode::SUCCESS;
315
316}
317
318
319// loadThresholdData
320StatusCode
321NswCalibDbAlg::loadThresholdData(const EventContext& ctx,
322 const readKey_t& readKey,
323 const ThresholdTech tech,
324 NswCalibDbThresholdData& writeCdo) const {
325 // set up read handle
326 const CondAttrListCollection* readCdo{nullptr};
327 ATH_CHECK(SG::get(readCdo, readKey, ctx));
328 if(!readCdo){
329 ATH_MSG_DEBUG("Empty key");
330 return StatusCode::SUCCESS;
331 }
332 // iterate through data
334 unsigned nObjs = 0;
335 for(itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
336
337 // retrieve blob
338 const coral::AttributeList& atr = itr->second;
339 if(atr["data"].specification().type() != typeid(coral::Blob)) {
340 ATH_MSG_FATAL( "Data column is not of type blob!" );
341 return StatusCode::FAILURE;
342 }
343 coral::Blob blob = atr["data"].data<coral::Blob>();
344 std::unique_ptr<TTree> tree;
346 ATH_MSG_FATAL( "Cannot retrieve data from coral blob!" );
347 return StatusCode::FAILURE;
348 }
349
350 // parse tree
351 unsigned elinkId{0}, vmm{0}, channel{0};
352 float threshold{0.};
353 tree->SetBranchAddress("vmm", &vmm);
354 tree->SetBranchAddress("channel", &channel);
355 tree->SetBranchAddress("elinkId", &elinkId);
356 tree->SetBranchAddress("threshold", &threshold);
357
358 // loop over channels
359 unsigned nChns = 0;
360 for(unsigned iEvt=0; iEvt<tree->GetEntries(); ++iEvt){
361 tree->GetEntry(iEvt);
362 Identifier channelId;
363 if(!buildChannelId(channelId, elinkId, vmm, channel)){
364 ATH_MSG_DEBUG("Could not find valid channelId for elink "<<elinkId<<" This is either caused by calibration data of a channel that is known to be not connected to the detector or might point to some issues in the identifier used for the calibration constants");
365 continue;
366 }
367 if(channelId.get_compact()==0){
368 writeCdo.setZero(tech, threshold);
369 ++nChns;
370 continue;
371 }
372 writeCdo.setData(channelId, threshold);
373 ++nChns;
374 }
375 ATH_MSG_VERBOSE("Retrieved data for "<<nChns<<" channels.");
376 ++nObjs;
377 }
378 ATH_MSG_DEBUG("Retrieved data for "<<nObjs<<" objects.");
379 return StatusCode::SUCCESS;
380}
381
382 template <typename Key_t,
383 typename... KeyArgs_t>
384 StatusCode NswCalibDbAlg::declareDependency(const EventContext& ctx,
385 SG::WriteCondHandle<Key_t>& writeHandle,
386 const readKey_t& readKey,
387 KeyArgs_t&... otherKeys) const {
388 if (!readKey.empty()) {
389 SG::ReadCondHandle readHandle{readKey, ctx};
390 if (!readHandle.isValid()) {
391 ATH_MSG_FATAL("Failed to load conditions data "<<readKey.fullKey());
392 return StatusCode::FAILURE;
393 }
394 ATH_MSG_DEBUG("Size of CondAttrListCollection " << readKey.fullKey()
395 << " readCdo->size()= " << readHandle->size());
396 writeHandle.addDependency(readHandle);
397 }
398 if constexpr(sizeof...(otherKeys) > 0) {
399 ATH_CHECK(declareDependency(ctx,writeHandle, otherKeys...));
400 }
401 return StatusCode::SUCCESS;
402 }
403
404
405
406// loadTimeChargeData
407StatusCode
408NswCalibDbAlg::loadTimeChargeData(const EventContext& ctx,
409 const readKey_t& readKey,
410 const TimeChargeTech tech,
411 const TimeChargeType type,
412 NswCalibDbTimeChargeData& writeCdo) const {
413
414 if (readKey.empty()) {
415 ATH_MSG_DEBUG("Empty key parsed");
416 return StatusCode::SUCCESS;
417 }
418 // set up read handle
419 const CondAttrListCollection* readCdo{nullptr};
420 ATH_CHECK(SG::get(readCdo, readKey, ctx));
421 // iterate through data
423 unsigned nObjs = 0;
424 for(itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
425
426 // retrieve blob
427 const coral::AttributeList& atr = itr->second;
428 if(atr["data"].specification().type() != typeid(coral::Blob)) {
429 ATH_MSG_FATAL( "Data column is not of type blob!" );
430 return StatusCode::FAILURE;
431 }
432 coral::Blob blob = atr["data"].data<coral::Blob>();
433 std::unique_ptr<TTree> tree;
435 ATH_MSG_FATAL( "Cannot retrieve data from coral blob!" );
436 return StatusCode::FAILURE;
437 }
438 // parse tree
439 unsigned elinkId{0}, vmm{0}, channel{0};
440 float slope{0.f}, intercept{0.f};
441 //float slope{0}, slopeError{0}, intercept{0},interceptError{0};
442
443 tree->SetBranchAddress("vmm", &vmm);
444 tree->SetBranchAddress("channel", &channel);
445 tree->SetBranchAddress("elinkId", &elinkId);
446 tree->SetBranchAddress("slope", &slope);
447 //tree->SetBranchAddress("slopeError" , &slopeError ); // keep for later
448 tree->SetBranchAddress("intercept", &intercept);
449 //tree->SetBranchAddress("interceptError", &interceptError);
450
451
452 // loop over channels
453 unsigned nChns = 0;
454 for(Long64_t iEvt=0; iEvt<tree->GetEntries(); ++iEvt){
455 tree->GetEntry(iEvt);
456 Identifier channelId{};
457 if(!buildChannelId(channelId, elinkId, vmm, channel)) {
458 ATH_MSG_DEBUG("Could not find valid channelId for elink "<<elinkId
459 <<" This is either caused by calibration data of a channel that is known to be not connected "
460 <<"to the detector or might point to some issues in the identifier used for the calibration constants");
461 continue;
462 }
463
465 calib_data.slope = slope;
466 //calib_data.slopeError = slopeError; // keep for later
467 calib_data.intercept = intercept;
468 //calib_data.interceptError = interceptError;
469
470 if(!channelId.get_compact()){
471 writeCdo.setZero(type, tech, calib_data);
472 ++nChns;
473 continue;
474 }
475 writeCdo.setData(type, channelId, calib_data);
476 ++nChns;
477 }
478 ATH_MSG_VERBOSE("Retrieved data for "<<nChns<<" channels. "<<tree->GetName()<<" "<<tree->GetEntries());
479 ++nObjs;
480 }
481 ATH_MSG_DEBUG("Retrieved data for "<<nObjs<<" objects.");
482
483 return StatusCode::SUCCESS;
484}
485
486
487// buildChannelId
488bool NswCalibDbAlg::buildChannelId(Identifier& channelId, unsigned elinkId, unsigned vmm, unsigned channel) const {
489
490 // return dummy Identifier
491 if(elinkId==0){
492 channelId = Identifier(0);
493 return true;
494 }
495
496 // build NSWOfflineHelper
497 auto resId = std::make_unique<Muon::nsw::NSWResourceId>(elinkId);
498 Muon::nsw::helper::NSWOfflineHelper helper(resId.get(), vmm, channel);
499
500 std::string stationName;
501 if(resId->detId() == eformat::MUON_MMEGA_ENDCAP_A_SIDE || resId->detId() == eformat::MUON_MMEGA_ENDCAP_C_SIDE) {
502 stationName = resId->is_large_station () ? "MML" : "MMS";
503 } else if(resId->detId() == eformat::MUON_STGC_ENDCAP_A_SIDE || resId->detId() == eformat::MUON_STGC_ENDCAP_C_SIDE) {
504 stationName = resId->is_large_station () ? "STL" : "STS";
505 } else {
506 ATH_MSG_ERROR("NSWResource Id "<< elinkId << " does not yield detID that is either sTGC or MMG");
507 THROW_EXCEPTION("NSWCalibDbAlg buildChannelId called with detID that is neither sTGC or MMG");
508 }
509
510 int8_t stationEta = resId->station_eta ();
511 uint8_t stationPhi = resId->station_phi ();
512 uint8_t multiLayer = resId->multi_layer ();
513 uint8_t gasGap = resId->gas_gap ();
514
515 uint8_t channelType = helper.channel_type ();
516 uint16_t channelNumber = helper.channel_number();
517
518 ATH_MSG_VERBOSE("Station name=" << stationName
519 << " Station eta=" << static_cast <int> (stationEta)
520 << " Station phi=" << static_cast <unsigned> (stationPhi)
521 << " Multilayer=" << static_cast <unsigned> (multiLayer)
522 << " Gas gap=" << static_cast <unsigned> (gasGap)
523 << " Channel type=" << static_cast <unsigned> (channelType)
524 << " Channel Number=" << channelNumber );
525
526
527 // MM
528 if(resId->detId() == eformat::MUON_MMEGA_ENDCAP_A_SIDE || resId->detId() == eformat::MUON_MMEGA_ENDCAP_C_SIDE){
529 bool isValid {false};
530 Identifier chnlId = m_idHelperSvc->mmIdHelper().channelID(stationName, static_cast<int>(stationEta), static_cast<int>(stationPhi), static_cast<int>(multiLayer), static_cast<int>(gasGap), static_cast<int>(channelNumber), isValid);
531 if(!isValid){
532 ATH_MSG_DEBUG("Could not extract valid channelId for MM elink "<<elinkId);
533 return false;
534 }
535 channelId = chnlId;
536 }
537 // sTGC
538 else if(resId->detId() == eformat::MUON_STGC_ENDCAP_A_SIDE || resId->detId() == eformat::MUON_STGC_ENDCAP_C_SIDE){
539 bool isValid {false};
540 Identifier chnlId = m_idHelperSvc->stgcIdHelper().channelID(stationName, static_cast<int>(stationEta), static_cast<int>(stationPhi), static_cast<int>(multiLayer), static_cast<int>(gasGap), static_cast<int>(channelType), static_cast<int>(channelNumber), isValid);
541 if(!isValid){
542 ATH_MSG_DEBUG("Could not extract valid channelId for STGC elink "<<elinkId);
543 return false;
544 }
545 channelId = chnlId;
546 }
547
548 return true;
549}
550}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
unsigned int uint
static const Attributes_t empty
bool msgLvl(const MSG::Level lvl) const
This class is a collection of AttributeLists where each one is associated with a channel number.
const_iterator end() const
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
ChanAttrListMap::const_iterator const_iterator
static EventIDRange infiniteTime()
Produces an EventIDRange that is inifinite in Time and invalid in RunLumi.
Gaudi::Property< bool > m_isData
Gaudi::Property< std::string > m_stgcT0FilePath
StatusCode loadT0Data(std::unique_ptr< TTree > &&tree, NswT0Data &writeCdo, const T0Tech tech) const
NswCalibDbThresholdData::ThrsldTechType ThresholdTech
readKey_t m_readKey_mm_sidea_pdo
Gaudi::Property< bool > m_loadsTgcT0Data
readKey_t m_readKey_mm_sidec_tdo
StatusCode loadT0ToTree(const EventContext &ctx, const readKey_t &readKey, std::unique_ptr< TTree > &tree) const
StatusCode processNSWT0Data(const EventContext &ctx) const
bool buildChannelId(Identifier &channelId, unsigned elinkId, unsigned vmm, unsigned channel) const
readKey_t m_readKey_mm_sidea_tdo
Gaudi::Property< bool > m_processThresholds
readKey_t m_readKey_mm_sidec_pdo
readKey_t m_readKey_stgc_sidec_thr
Gaudi::Property< bool > m_loadMmT0Data
StatusCode loadThresholdData(const EventContext &ctx, const readKey_t &readKey, const ThresholdTech tech, NswCalibDbThresholdData &writeCdo) const
readKey_t m_readKey_stgc_sidea_pdo
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
NswCalibDbTimeChargeData::CalibDataType TimeChargeType
StatusCode processTdoPdoData(const EventContext &ctx) const
virtual StatusCode initialize() override
MuonCond::CalibTechType TimeChargeTech
readKey_t m_readKey_stgc_t0
MuonCond::CalibTechType T0Tech
readKey_t m_readKey_stgc_sidec_tdo
Gaudi::Property< std::string > m_mmT0FilePath
readKey_t m_readKey_stgc_sidec_pdo
writeKeyMmT0_t m_writeKey_nswT0
virtual StatusCode execute(const EventContext &) const override
SG::ReadCondHandleKey< CondAttrListCollection > readKey_t
readKey_t m_readKey_stgc_sidea_tdo
readKey_t m_readKey_mm_sidec_thr
writeKeyThr_t m_writeKey_thr
readKey_t m_readKey_mm_sidea_thr
SG::WriteCondHandle< NswT0Data > writeHandleT0_t
readKey_t m_readKey_stgc_sidea_thr
StatusCode declareDependency(const EventContext &ctx, SG::WriteCondHandle< Key_t > &writeHandle, const readKey_t &readKey, KeyArgs_t &... otherKeys) const
writeKeyTdoPdo_t m_writeKey_tdopdo
StatusCode processThrData(const EventContext &ctx) const
StatusCode loadTimeChargeData(const EventContext &ctx, const readKey_t &readKey, const TimeChargeTech tech, const TimeChargeType type, NswCalibDbTimeChargeData &writeCdo) const
Conditions data to model a channel dependent energy deposit threshold such that the electronics retur...
void setData(const Identifier &channelId, const float)
void setZero(const ThrsldTechType tech, const float)
void setZero(CalibDataType type, MuonCond::CalibTechType tech, CalibConstants constants)
void setData(CalibDataType type, const Identifier &chnlId, CalibConstants constants)
Conditions data object to calibrate the timeoff set of each individual channel in the NSW.
Definition NswT0Data.h:26
void setData(const Identifier &channelId, const float channelT0)
Set the t0 calibration constant for a given nsw channel.
Definition NswT0Data.cxx:42
bool empty() const
Test if the key is blank.
const std::string & key() const
void addDependency(const EventIDRange &range)
const EventIDRange & getRange() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const DataObjID & fullKey() const
bool readBlobAsTTree(const coral::Blob &blob, std::unique_ptr< TTree > &tree, const std::string_view name="tree")
Interprets the coral::Blob as a TTree instance.
::StatusCode StatusCode
StatusCode definition for legacy code.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Helper struct to cache all calibration constants in a common place of the memory.
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10
TChain * tree
TFile * file