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 MmIdHelper &, const sTgcIdHelper &)
 
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 MmIdHelperm_mmIdHelper
 
const sTgcIdHelperm_stgcIdHelper
 

Friends

class NswCalibDbAlg
 

Detailed Description

Definition at line 21 of file NswCalibDbThresholdData.h.

Member Typedef Documentation

◆ ChannelMap

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

Definition at line 46 of file NswCalibDbThresholdData.h.

◆ ZeroMap

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

Definition at line 47 of file NswCalibDbThresholdData.h.

Member Enumeration Documentation

◆ ThrsldTechType

Enumerator
MM 
STGC 

Definition at line 26 of file NswCalibDbThresholdData.h.

26  {
27  MM,
28  STGC
29  };

Constructor & Destructor Documentation

◆ NswCalibDbThresholdData()

NswCalibDbThresholdData::NswCalibDbThresholdData ( const MmIdHelper mmIdHelper,
const sTgcIdHelper stgcIdHelper 
)

Definition at line 12 of file NswCalibDbThresholdData.cxx.

12  :
13  m_mmIdHelper(mmIdHelper),
14  m_stgcIdHelper(stgcIdHelper)
15 {
16 }

◆ ~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 41 of file NswCalibDbThresholdData.cxx.

41  {
42  std::vector<Identifier> keys;
43  keys.reserve(m_data.size());
44  for (const auto& p : m_data) {
45  keys.emplace_back(p.first);
46  }
47 
48  if(tech.empty() && side.empty()) return keys;
49  std::vector<Identifier> chnls;
50 
51  for(unsigned int i=0; i<keys.size(); ++i){
52  bool isMM = m_mmIdHelper.is_mm(keys[i]);
53  bool isSTGC = m_stgcIdHelper.is_stgc(keys[i]);
55  if(!isSTGC && tech == "STGC") continue;
56  if(!isMM && tech == "MM") continue;
57  if(eta<=0 && side == "A") continue;
58  if(eta>=0 && side == "C") continue;
59  chnls.push_back(keys[i]);
60  }
61  return chnls;
62 }

◆ 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 66 of file NswCalibDbThresholdData.cxx.

66  {
67  unsigned long long channelId = chnlId.get_compact();
68  ChannelMap::const_iterator chan_itr = m_data.find(channelId);
70  if(chan_itr != m_data.end() && chan_itr->second.size() == 1) {
71  threshold = chan_itr->second[0];
72  return true;
73  }
74  // if channelId doesn't exist in buffer, use 0 channel data ("all channels"), if exists
76 
77  ZeroMap::const_iterator zero_itr = m_zero.find(tech);
78  if (zero_itr != m_zero.end()) {
79  threshold = zero_itr->second;
80  return true;
81  }
82  threshold = 0.;
83  return false;
84 }

◆ setData()

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

Definition at line 23 of file NswCalibDbThresholdData.cxx.

23  {
24  unsigned long long channelId = chnlId.get_compact();
25  if(m_data.find(channelId) != m_data.end()) return;
26  // storing as vector is not optimal, but keep for now in case we'll add more data in the future
27  m_data[channelId].push_back(threshold);
28 }

◆ setZero()

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

Definition at line 32 of file NswCalibDbThresholdData.cxx.

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

Friends And Related Function Documentation

◆ NswCalibDbAlg

friend class NswCalibDbAlg
friend

Definition at line 23 of file NswCalibDbThresholdData.h.

Member Data Documentation

◆ m_data

ChannelMap NswCalibDbThresholdData::m_data {}
private

Definition at line 48 of file NswCalibDbThresholdData.h.

◆ m_mmIdHelper

const MmIdHelper& NswCalibDbThresholdData::m_mmIdHelper
private

Definition at line 52 of file NswCalibDbThresholdData.h.

◆ m_stgcIdHelper

const sTgcIdHelper& NswCalibDbThresholdData::m_stgcIdHelper
private

Definition at line 53 of file NswCalibDbThresholdData.h.

◆ m_zero

ZeroMap NswCalibDbThresholdData::m_zero {}
private

Definition at line 49 of file NswCalibDbThresholdData.h.


The documentation for this class was generated from the following files:
STGC
@ STGC
Definition: RegSelEnums.h:39
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
NswCalibDbThresholdData::ThrsldTechType
ThrsldTechType
Definition: NswCalibDbThresholdData.h:26
NswCalibDbThresholdData::m_zero
ZeroMap m_zero
Definition: NswCalibDbThresholdData.h:49
MM
@ MM
Definition: RegSelEnums.h:38
NswCalibDbThresholdData::ThrsldTechType::STGC
@ STGC
TRT::Hit::side
@ side
Definition: HitInfo.h:83
MuonIdHelper::is_stgc
bool is_stgc(const Identifier &id) const
Definition: MuonIdHelper.cxx:798
lumiFormat.i
int i
Definition: lumiFormat.py:92
NswCalibDbThresholdData::ThrsldTechType::MM
@ MM
MuonIdHelper::is_mm
bool is_mm(const Identifier &id) const
Definition: MuonIdHelper.cxx:801
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
NswCalibDbThresholdData::m_data
ChannelMap m_data
Definition: NswCalibDbThresholdData.h:48
threshold
Definition: chainparser.cxx:74
MuonIdHelper::stationEta
int stationEta(const Identifier &id) const
Definition: MuonIdHelper.cxx:809
NswCalibDbThresholdData::m_stgcIdHelper
const sTgcIdHelper & m_stgcIdHelper
Definition: NswCalibDbThresholdData.h:53
Identifier::get_compact
value_type get_compact(void) const
Get the compact id.
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
NswCalibDbThresholdData::m_mmIdHelper
const MmIdHelper & m_mmIdHelper
Definition: NswCalibDbThresholdData.h:52
dumpTgcDigiThreshold.threshold
list threshold
Definition: dumpTgcDigiThreshold.py:34