ATLAS Offline Software
Loading...
Searching...
No Matches
NswCalibDbThresholdData Class Reference

#include <NswCalibDbThresholdData.h>

Collaboration diagram for NswCalibDbThresholdData:

Public Types

enum class  ThrsldTechType { MM , 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 };
@ STGC
Definition RegSelEnums.h:39
@ MM
Definition RegSelEnums.h:38

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}
const Muon::IMuonIdHelperSvc * m_idHelperSvc

◆ ~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){
51 int eta = m_idHelperSvc->stationEta(keys[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}
Scalar eta() const
pseudorapidity method

◆ 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}
value_type get_compact() const
Get the compact id.

◆ 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}

◆ 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.

44{};

◆ m_idHelperSvc

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

Definition at line 48 of file NswCalibDbThresholdData.h.

48{};

◆ m_zero

ZeroMap NswCalibDbThresholdData::m_zero {}
private

Definition at line 45 of file NswCalibDbThresholdData.h.

45{};

The documentation for this class was generated from the following files: