7#include "GeoModelKernel/throwExcept.h"
12 ostr<<
"slope: "<<std::setprecision(15)<<obj.slope;
13 ostr<<
" intercept: "<<std::setprecision(15)<<obj.intercept;
29 return static_cast<unsigned int>(hash)*(idHelper.
gasGapMax()) + (idHelper.
gasGap(chan_id) -1);
32 return static_cast<unsigned int>(hash)*(idHelper.
gasGapMax() * 3 ) +
64 if (calib_mod.
channels.size() <= channel) calib_mod.
channels.resize(channel +1);
68 " "<<(*calib_mod.
channels[channel] ));
71 calib_mod.
channels[channel] = std::make_unique<CalibConstants>(std::move(
constants));
86std::vector<Identifier>
88 std::vector<Identifier> chnls;
90 chnls.reserve(calibMap.size());
93 if (module.channels.empty())
continue;
94 if (side ==
"A" &&
m_idHelperSvc->stationEta(module.layer_id) < 0)
continue;
95 if (side ==
"C" &&
m_idHelperSvc->stationEta(module.layer_id) > 0)
continue;
98 if (tech ==
"STGC")
continue;
100 for (
unsigned int chn = 1 ; chn <=
module.channels.size() ; ++chn) {
101 if (!module.channels[chn -1])
continue;
103 chnls.push_back(idHelper.
channelID(module.layer_id,
105 idHelper.
gasGap(module.layer_id), chn ));
108 if (tech ==
"MM")
break;
110 for (
unsigned int chn = 1 ; chn <=
module.channels.size() ; ++chn) {
111 if (!module.channels[chn -1])
continue;
112 chnls.push_back(idHelper.
channelID(module.layer_id,
114 idHelper.
gasGap(module.layer_id),
125 const unsigned int channel = (
m_idHelperSvc->isMM(channelId) ?
128 if (calibMap.at(array_idx).channels.size() > channel && calibMap[array_idx].channels[channel]) {
129 return calibMap[array_idx].channels[channel].get();
137 std::map<MuonCond::CalibTechType, ZeroCalibMap>::const_iterator itr =
m_zero.find(tech);
140 ZeroCalibMap::const_iterator type_itr = zeroMap.find(
type);
141 if(type_itr != zeroMap.end())
return &type_itr->second;
#define ATH_MSG_VERBOSE(x)
std::ostream & operator<<(std::ostream &ostr, const NswCalibDbTimeChargeData::CalibConstants &obj)
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
This is a "hash" representation of an Identifier.
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
int gasGap(const Identifier &id) const override
get the hashes
int multilayer(const Identifier &id) const
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
const CalibConstants * getCalibForChannel(const CalibDataType type, const Identifier &channelId) const
Retrieves the calibration constant for a particular readout channel.
const Muon::IMuonIdHelperSvc * m_idHelperSvc
int identToModuleIdx(const Identifier &chan_id) const
void setZero(CalibDataType type, MuonCond::CalibTechType tech, CalibConstants constants)
void setData(CalibDataType type, const Identifier &chnlId, CalibConstants constants)
NswCalibDbTimeChargeData(const Muon::IMuonIdHelperSvc *idHelperSvc)
ChannelCalibMap m_pdo_data
const size_t m_nMmElements
Segmentation of the elements is per NSW gasGap. Each wedge has 4 gasgaps.
const CalibConstants * getZeroCalibChannel(const CalibDataType type, const MuonCond::CalibTechType tech) const
Returns the dummy calibration constant for the given technology type.
ChannelCalibMap m_tdo_data
std::vector< Identifier > getChannelIds(const CalibDataType type, const std::string &tech, const std::string &side) const
std::vector< CalibModule > ChannelCalibMap
std::map< CalibDataType, CalibConstants > ZeroCalibMap
std::map< MuonCond::CalibTechType, ZeroCalibMap > m_zero
const size_t m_nStgcElements
Additionally reserve space for the 3 channel types.
int multilayer(const Identifier &id) const
int channelType(const Identifier &id) const
int gasGap(const Identifier &id) const override
get the hashes
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel) const
Helper struct to cache all calibration constants in a common place of the memory.
std::vector< std::unique_ptr< CalibConstants > > channels
#define THROW_EXCEPTION(MESSAGE)