|
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "Identifier/Identifier.h"
23 m_mmIdHelper(mmIdHelper),
24 m_stgcIdHelper(stgcIdHelper),
25 m_muonGeoMgr(muonGeoMgr)
30 ostr <<
" timeSince " <<
obj.timeSince <<
" timeUntil " <<
obj.timeUntil <<
" elink " <<
obj.elink;
38 throw std::runtime_error(
"NswDcsDbData() - Failed to retrieve valid micromega hash ");
44 throw std::runtime_error(
"NswDcsDbData() - Failed to retrieve valid stgc hash ");
48 throw std::runtime_error(
"NswDcsDbData() - No NSW identifier");
60 if (array_idx >= dcsMap.size()) dcsMap.resize(array_idx + 1);
67 throw std::runtime_error(
"NswDcsDbData::setData() -- Cannot overwrite channel");
74 if (array_idx >= dcsMap.size()) dcsMap.resize(array_idx + 1);
75 DcsModule& dcs_mod = dcsMap.at(array_idx);
82 throw std::runtime_error(
"setData() -- Cannot overwrite channel");
94 if (array_idx >=
data.size())
data.resize(array_idx + 1);
96 x.timeSince = timeSince;
97 x.timeUntil = timeUntil;
99 x.permanentlyDisabled = permanentlyDisabled;
100 data[array_idx][chnlId].insert(
x);
107 if (array_idx >=
data.size())
data.resize(array_idx + 1);
116 std::vector<Identifier>
118 std::vector<Identifier> chnls;
121 chnls.reserve(dcsMap.size());
123 if(
module.channels.empty())
continue;
126 for(
unsigned int chn = 1 ; chn <=
module.channels.size() ; ++chn) {
127 if(!
module.channels[chn -1])
continue;
133 chnls.reserve(dcsMap.size());
135 if(
module.channels.empty())
continue;
138 for(
unsigned int chn = 1 ; chn <=
module.channels.size() ; ++chn) {
139 if(!
module.channels[chn -1])
continue;
156 if (dcsMap.size() > array_idx && dcsMap.at(array_idx).channels.size() >
channel && dcsMap[array_idx].channels[
channel])
return dcsMap[array_idx].channels[
channel].get();
163 if (dcsMap.size() > array_idx && dcsMap.at(array_idx).channels.size() >
channel && dcsMap[array_idx].channels[
channel])
return dcsMap[array_idx].channels[
channel].get();
173 if (dcsMap.size() > array_idx && dcsMap.at(array_idx).channels.size() >
channel && dcsMap[array_idx].channels[
channel])
return dcsMap[array_idx].channels[
channel].get();
184 bool permanentlyDisabled{
false};
205 return driftHvIsGood && stripHvIsGood;
213 if(
data.size()<=array_idx ||
data[array_idx].empty())
return true;
214 const std::map<Identifier, std::set<TDaqConstants>>& dataInRoElement =
data[array_idx];
228 auto elm = dataInRoElement.find(mapIdentifier);
229 if(elm == dataInRoElement.end())
return true;
231 uint64_t evtTime = ctx.eventID().time_stamp()*1e9;
232 evtTime += ctx.eventID().time_stamp_ns_offset();
233 x.timeSince = evtTime;
234 x.timeUntil = evtTime;
237 auto disabledLink = elm->second.find(
x);
238 if(disabledLink != elm->second.end()){
239 permanentlyDisabled = disabledLink->permanentlyDisabled;
248 if(
data.size()<=array_idx ||
data[array_idx].empty())
return true;
258 if(!
m_mmIdHelper.
is_mm(
channelId))
throw std::runtime_error(
"the check for unconnected channels was called with an identifier that is in MM and not sTGC");
261 if(!detectorReadoutElement) {
262 throw std::runtime_error(
"failed to retrieve MMReadoutElement");
266 throw std::runtime_error(
"failed to retrieve MuonChannelDesign");
271 if(channel_number <= channelDesign->nMissedBottomStereo || channel_number >= channelDesign->
totalStrips - channelDesign->
nMissedTopStereo) {
275 if(channel_number <= channelDesign->nMissedBottomEta || channel_number >= channelDesign->
totalStrips - channelDesign->
nMissedTopEta) {
int multilayer(const Identifier &id) const
char data[hepevt_bytes_allocation_ATLAS]
const DcsConstants * getDataForChannelHv(const DcsTechType tech, const Identifier &channelId, bool issTgcQ1OuterHv) const
Retrieves the calibration constant for a particular readout channel.
NswDcsDbData(const MmIdHelper &mmHelper, const sTgcIdHelper &stgcHelper, const MuonGM::MuonDetectorManager *muonGeoMgr)
void setDataEltx(const DcsTechType tech, const Identifier &chnlId)
bool isGood(const EventContext &ctx, const Identifier &channelId, bool issTgcQ1OuterHv=false) const
Returns whether the channel is alive, i.e. DCS state on, etc...
ChannelTDaqMap m_data_tdaq_mmg
std::string find(const std::string &s)
return a remapped string
std::vector< std::unique_ptr< DcsConstants > > channels
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel) const
size_type detectorElement_hash_max() const
const MuonChannelDesign * getDesign(const Identifier &id) const
returns the MuonChannelDesign class for the given identifier
Identifier febID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int radius) const
std::ostream & operator<<(std::ostream &ostr, const NswDcsDbData::TDaqConstants &obj)
virtual int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const override
ChannelDcsMap m_data_hv_stg
int multilayer(const Identifier &id) const
bool isSmall(const Identifier &id) const
bool is_stgc(const Identifier &id) const
Identifier multilayerID(const Identifier &channeldID) const
unsigned int identToModuleIdx(const Identifier &chan_id) const
int channel(const Identifier &id) const override
bool isGoodHv(const Identifier &channelId, bool issTgcQ1OuterHv=false) const
int gasGap(const Identifier &id) const override
get the hashes
bool isGoodEltx(const Identifier &channelId) const
Helper struct to cache all dcs constants in a common place of the memory.
std::vector< DcsModule > ChannelDcsMap
bool is_mm(const Identifier &id) const
ChannelDcsMap m_data_hv_mmd
void setDataHv(const DcsTechType tech, const Identifier &chnlId, DcsConstants constants)
std::vector< std::set< Identifier > > ChannelEltxMap
bool isGoodTDaq(const EventContext &ctx, const Identifier &channelId, bool &permanentlyDisabled) const
int stationEta(const Identifier &id) const
virtual int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const override
std::vector< Identifier > getChannelIdsHv(const DcsTechType tech, const std::string &side) const
ChannelEltxMap m_data_eltx_mmg
int channel(const Identifier &id) const override
int gasGap(const Identifier &id) const override
get the hashes
std::vector< std::map< Identifier, std::set< TDaqConstants > >> ChannelTDaqMap
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
ChannelDcsMap m_data_hv_mmg
const MMReadoutElement * getMMReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
const MmIdHelper & m_mmIdHelper
bool isConnectedChannel(const Identifier &channelId) const
Identifier pcbID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int pcb) const
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
void setDataTDaq(const DcsTechType tech, const Identifier &chnlId, uint64_t timeSince, uint64_t timeUntil, unsigned int elink, bool permanentlyDisabled)
Identifier febID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType) const
const sTgcIdHelper & m_stgcIdHelper
const MuonGM::MuonDetectorManager * m_muonGeoMgr
Identifier hvID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, bool isInnerQ1) const
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
bool isStereo(const Identifier &id) const
int channelType(const Identifier &id) const
ChannelTDaqMap m_data_tdaq_stg
ChannelEltxMap m_data_eltx_stg