Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
NswCalibDbThresholdData.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #include "Identifier/Identifier.h"
9 
10 
11 // general functions ---------------------------------
13  m_idHelperSvc(idHelperSvc)
14 {
15 }
16 
17 
18 // setting functions ---------------------------------
19 
20 // setData
21 void
23  unsigned long long channelId = chnlId.get_compact();
24  if(m_data.find(channelId) != m_data.end()) return;
25  // storing as vector is not optimal, but keep for now in case we'll add more data in the future
26  m_data[channelId].push_back(threshold);
27 }
28 
29 // setZero
30 void
32  m_zero[tech] = threshold;
33 }
34 
35 
36 // retrieval functions -------------------------------
37 
38 // getChannelIds
39 std::vector<Identifier>
40 NswCalibDbThresholdData::getChannelIds(const std::string tech, const std::string side) const {
41  std::vector<Identifier> keys;
42  keys.reserve(m_data.size());
43  for (const auto& p : m_data) {
44  keys.emplace_back(p.first);
45  }
46 
47  if(tech.empty() && side.empty()) return keys;
48  std::vector<Identifier> chnls;
49 
50  for(unsigned int i=0; i<keys.size(); ++i){
52  if(!m_idHelperSvc->issTgc(keys[i]) && tech == "STGC") continue;
53  if(!m_idHelperSvc->isMM(keys[i]) && tech == "MM") continue;
54  if(eta<=0 && side == "A") continue;
55  if(eta>=0 && side == "C") continue;
56  chnls.push_back(keys[i]);
57  }
58  return chnls;
59 }
60 
61 // getThreshold
62 bool
64  unsigned long long channelId = chnlId.get_compact();
65  ChannelMap::const_iterator chan_itr = m_data.find(channelId);
67  if(chan_itr != m_data.end() && chan_itr->second.size() == 1) {
68  threshold = chan_itr->second[0];
69  return true;
70  }
71  // if channelId doesn't exist in buffer, use 0 channel data ("all channels"), if exists
73 
74  ZeroMap::const_iterator zero_itr = m_zero.find(tech);
75  if (zero_itr != m_zero.end()) {
76  threshold = zero_itr->second;
77  return true;
78  }
79  threshold = 0.;
80  return false;
81 }
82 
83 
84 
sTgcIdHelper.h
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
NswCalibDbThresholdData::ThrsldTechType
ThrsldTechType
Definition: NswCalibDbThresholdData.h:22
NswCalibDbThresholdData::m_zero
ZeroMap m_zero
Definition: NswCalibDbThresholdData.h:45
Identifier::get_compact
value_type get_compact() const
Get the compact id.
Muon::IMuonIdHelperSvc::stationEta
virtual int stationEta(const Identifier &id) const =0
Return stationEta for all technologies.
NswCalibDbThresholdData::ThrsldTechType::STGC
@ STGC
NswCalibDbThresholdData::NswCalibDbThresholdData
NswCalibDbThresholdData(const Muon::IMuonIdHelperSvc *idHelperSvc)
Definition: NswCalibDbThresholdData.cxx:12
TRT::Hit::side
@ side
Definition: HitInfo.h:83
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
NswCalibDbThresholdData::setData
void setData(const Identifier &, const float)
Definition: NswCalibDbThresholdData.cxx:22
lumiFormat.i
int i
Definition: lumiFormat.py:85
NswCalibDbThresholdData::ThrsldTechType::MM
@ MM
MmIdHelper.h
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
NswCalibDbThresholdData::m_data
ChannelMap m_data
Definition: NswCalibDbThresholdData.h:44
Muon::IMuonIdHelperSvc::isMM
virtual bool isMM(const Identifier &id) const =0
returns whether this is a MM Identifier or not
NswCalibDbThresholdData::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition: NswCalibDbThresholdData.h:48
threshold
Definition: chainparser.cxx:74
NswCalibDbThresholdData::getChannelIds
std::vector< Identifier > getChannelIds(const std::string="", const std::string="") const
Definition: NswCalibDbThresholdData.cxx:40
NswCalibDbThresholdData::setZero
void setZero(ThrsldTechType, const float)
Definition: NswCalibDbThresholdData.cxx:31
NswCalibDbThresholdData::getThreshold
bool getThreshold(const Identifier &, float &) const
Definition: NswCalibDbThresholdData.cxx:63
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:27
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
dumpTgcDigiThreshold.threshold
list threshold
Definition: dumpTgcDigiThreshold.py:34
Muon::IMuonIdHelperSvc::issTgc
virtual bool issTgc(const Identifier &id) const =0
returns whether this is a sTGC Identifier or not
NswCalibDbThresholdData.h
Identifier
Definition: IdentifierFieldParser.cxx:14