ATLAS Offline Software
Public Types | Public Member Functions | Private Types | Private Attributes | Friends | List of all members
NswCalibDbThresholdData Class Reference

#include <NswCalibDbThresholdData.h>

Collaboration diagram for NswCalibDbThresholdData:

Public Types

enum  ThrsldTechType { ThrsldTechType::MM, ThrsldTechType::STGC }
 

Public Member Functions

 NswCalibDbThresholdData (const Muon::IMuonIdHelperSvc *idHelperSvc)
 
virtual ~NswCalibDbThresholdData ()=default
 
void setData (const Identifier &, const float)
 
void setZero (ThrsldTechType, const float)
 
std::vector< IdentifiergetChannelIds (const std::string="", const std::string="") const
 
bool getThreshold (const Identifier &, float &) const
 

Private Types

using ChannelMap = std::map< unsigned long long, std::vector< float > >
 
using ZeroMap = std::map< ThrsldTechType, float >
 

Private Attributes

ChannelMap m_data {}
 
ZeroMap m_zero {}
 
const Muon::IMuonIdHelperSvcm_idHelperSvc {}
 

Friends

class NswCalibDbAlg
 

Detailed Description

Definition at line 17 of file NswCalibDbThresholdData.h.

Member Typedef Documentation

◆ ChannelMap

using NswCalibDbThresholdData::ChannelMap = std::map<unsigned long long, std::vector<float> >
private

Definition at line 42 of file NswCalibDbThresholdData.h.

◆ ZeroMap

using NswCalibDbThresholdData::ZeroMap = std::map<ThrsldTechType, float>
private

Definition at line 43 of file NswCalibDbThresholdData.h.

Member Enumeration Documentation

◆ ThrsldTechType

Enumerator
MM 
STGC 

Definition at line 22 of file NswCalibDbThresholdData.h.

22  {
23  MM,
24  STGC
25  };

Constructor & Destructor Documentation

◆ NswCalibDbThresholdData()

NswCalibDbThresholdData::NswCalibDbThresholdData ( const Muon::IMuonIdHelperSvc idHelperSvc)

Definition at line 12 of file NswCalibDbThresholdData.cxx.

12  :
13  m_idHelperSvc(idHelperSvc)
14 {
15 }

◆ ~NswCalibDbThresholdData()

virtual NswCalibDbThresholdData::~NswCalibDbThresholdData ( )
virtualdefault

Member Function Documentation

◆ getChannelIds()

std::vector< Identifier > NswCalibDbThresholdData::getChannelIds ( const std::string  tech = "",
const std::string  side = "" 
) const

Definition at line 40 of file NswCalibDbThresholdData.cxx.

40  {
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 }

◆ getThreshold()

bool NswCalibDbThresholdData::getThreshold ( const Identifier chnlId,
float &  threshold 
) const

For the moment require that there is only one channel per identifier

Definition at line 63 of file NswCalibDbThresholdData.cxx.

63  {
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 }

◆ setData()

void NswCalibDbThresholdData::setData ( const Identifier chnlId,
const float  threshold 
)

Definition at line 22 of file NswCalibDbThresholdData.cxx.

22  {
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 }

◆ setZero()

void NswCalibDbThresholdData::setZero ( ThrsldTechType  tech,
const float  threshold 
)

Definition at line 31 of file NswCalibDbThresholdData.cxx.

31  {
32  m_zero[tech] = threshold;
33 }

Friends And Related Function Documentation

◆ NswCalibDbAlg

friend class NswCalibDbAlg
friend

Definition at line 19 of file NswCalibDbThresholdData.h.

Member Data Documentation

◆ m_data

ChannelMap NswCalibDbThresholdData::m_data {}
private

Definition at line 44 of file NswCalibDbThresholdData.h.

◆ m_idHelperSvc

const Muon::IMuonIdHelperSvc* NswCalibDbThresholdData::m_idHelperSvc {}
private

Definition at line 48 of file NswCalibDbThresholdData.h.

◆ m_zero

ZeroMap NswCalibDbThresholdData::m_zero {}
private

Definition at line 45 of file NswCalibDbThresholdData.h.


The documentation for this class was generated from the following files:
STGC
@ STGC
Definition: RegSelEnums.h:39
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
MM
@ MM
Definition: RegSelEnums.h:38
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
TRT::Hit::side
@ side
Definition: HitInfo.h:83
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
lumiFormat.i
int i
Definition: lumiFormat.py:85
NswCalibDbThresholdData::ThrsldTechType::MM
@ MM
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
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