CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ecaldqm::StatusManager Class Reference

#include <StatusManager.h>

Public Member Functions

uint32_t getStatus (uint32_t) const
 
void readFromObj (EcalDQMChannelStatus const &, EcalDQMTowerStatus const &)
 
void readFromStream (std::istream &, EcalElectronicsMapping const *)
 
 StatusManager ()
 
void writeToObj (EcalDQMChannelStatus &, EcalDQMTowerStatus &) const
 
void writeToStream (std::ostream &) const
 
 ~StatusManager ()
 

Private Attributes

std::map< std::string, uint32_t > dictionary_
 
std::map< uint32_t, uint32_t > status_
 

Detailed Description

Definition at line 16 of file StatusManager.h.

Constructor & Destructor Documentation

◆ StatusManager()

ecaldqm::StatusManager::StatusManager ( )

Definition at line 18 of file StatusManager.cc.

References EcalDQMStatusHelper::CH_GAIN_SWITCH_ERROR, EcalDQMStatusHelper::CH_GAIN_ZERO_ERROR, EcalDQMStatusHelper::CH_ID_ERROR, dictionary_, EcalDQMStatusHelper::LASER_MEAN_ERROR, EcalDQMStatusHelper::LASER_RMS_ERROR, EcalDQMStatusHelper::LASER_TIMING_MEAN_ERROR, EcalDQMStatusHelper::LASER_TIMING_RMS_ERROR, EcalDQMStatusHelper::LED_MEAN_ERROR, EcalDQMStatusHelper::LED_RMS_ERROR, EcalDQMStatusHelper::LED_TIMING_MEAN_ERROR, EcalDQMStatusHelper::LED_TIMING_RMS_ERROR, EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR, EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_RMS_ERROR, EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR, EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_RMS_ERROR, EcalDQMStatusHelper::PEDESTAL_MIDDLE_GAIN_MEAN_ERROR, EcalDQMStatusHelper::PEDESTAL_MIDDLE_GAIN_RMS_ERROR, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR, EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR, EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_ERROR, EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_WARNING, EcalDQMStatusHelper::STATUS_FLAG_ERROR, EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR, EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_RMS_ERROR, EcalDQMStatusHelper::TESTPULSE_LOW_GAIN_MEAN_ERROR, EcalDQMStatusHelper::TESTPULSE_LOW_GAIN_RMS_ERROR, EcalDQMStatusHelper::TESTPULSE_MIDDLE_GAIN_MEAN_ERROR, EcalDQMStatusHelper::TESTPULSE_MIDDLE_GAIN_RMS_ERROR, EcalDQMStatusHelper::TT_ID_ERROR, and EcalDQMStatusHelper::TT_SIZE_ERROR.

18  : dictionary_(), status_() {
19  dictionary_["CH_ID_ERROR"] = 0x1 << EcalDQMStatusHelper::CH_ID_ERROR;
20  dictionary_["CH_GAIN_ZERO_ERROR"] = 0x1 << EcalDQMStatusHelper::CH_GAIN_ZERO_ERROR;
21  dictionary_["CH_GAIN_SWITCH_ERROR"] = 0x1 << EcalDQMStatusHelper::CH_GAIN_SWITCH_ERROR;
22  dictionary_["TT_ID_ERROR"] = 0x1 << EcalDQMStatusHelper::TT_ID_ERROR;
23  dictionary_["TT_SIZE_ERROR"] = 0x1 << EcalDQMStatusHelper::TT_SIZE_ERROR;
24 
25  dictionary_["PEDESTAL_LOW_GAIN_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR;
26  dictionary_["PEDESTAL_MIDDLE_GAIN_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::PEDESTAL_MIDDLE_GAIN_MEAN_ERROR;
27  dictionary_["PEDESTAL_HIGH_GAIN_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR;
28  dictionary_["PEDESTAL_LOW_GAIN_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_RMS_ERROR;
29  dictionary_["PEDESTAL_MIDDLE_GAIN_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::PEDESTAL_MIDDLE_GAIN_RMS_ERROR;
30  dictionary_["PEDESTAL_HIGH_GAIN_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_RMS_ERROR;
31 
32  dictionary_["PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR"] = 0x1
34  dictionary_["PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR"] = 0x1
36 
37  dictionary_["TESTPULSE_LOW_GAIN_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::TESTPULSE_LOW_GAIN_MEAN_ERROR;
38  dictionary_["TESTPULSE_MIDDLE_GAIN_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::TESTPULSE_MIDDLE_GAIN_MEAN_ERROR;
39  dictionary_["TESTPULSE_HIGH_GAIN_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR;
40  dictionary_["TESTPULSE_LOW_GAIN_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::TESTPULSE_LOW_GAIN_RMS_ERROR;
41  dictionary_["TESTPULSE_MIDDLE_GAIN_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::TESTPULSE_MIDDLE_GAIN_RMS_ERROR;
42  dictionary_["TESTPULSE_HIGH_GAIN_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_RMS_ERROR;
43 
44  dictionary_["LASER_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::LASER_MEAN_ERROR;
45  dictionary_["LASER_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::LASER_RMS_ERROR;
46  dictionary_["LASER_TIMING_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::LASER_TIMING_MEAN_ERROR;
47  dictionary_["LASER_TIMING_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::LASER_TIMING_RMS_ERROR;
48 
49  dictionary_["LED_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::LED_MEAN_ERROR;
50  dictionary_["LED_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::LED_RMS_ERROR;
51  dictionary_["LED_TIMING_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::LED_TIMING_MEAN_ERROR;
52  dictionary_["LED_TIMING_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::LED_TIMING_RMS_ERROR;
53 
54  dictionary_["STATUS_FLAG_ERROR"] = 0x1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR;
55 
56  dictionary_["PHYSICS_BAD_CHANNEL_WARNING"] = 0x1 << EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_WARNING;
57  dictionary_["PHYSICS_BAD_CHANNEL_ERROR"] = 0x1 << EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_ERROR;
58 
59  dictionary_["disabled_channel"] =
69 
70  dictionary_["dead_channel"] =
90 
99 
106 
107  dictionary_["laser_problem"] =
110 
111  dictionary_["led_problem"] =
114 
120  }
static const int LED_MEAN_ERROR
static const int PEDESTAL_MIDDLE_GAIN_RMS_ERROR
static const int LASER_MEAN_ERROR
static const int TESTPULSE_LOW_GAIN_RMS_ERROR
static const int PHYSICS_BAD_CHANNEL_WARNING
static const int LASER_TIMING_RMS_ERROR
static const int PEDESTAL_HIGH_GAIN_MEAN_ERROR
static const int PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR
static const int PHYSICS_BAD_CHANNEL_ERROR
static const int TT_SIZE_ERROR
static const int CH_GAIN_SWITCH_ERROR
static const int TESTPULSE_MIDDLE_GAIN_MEAN_ERROR
static const int PEDESTAL_LOW_GAIN_RMS_ERROR
std::map< std::string, uint32_t > dictionary_
Definition: StatusManager.h:29
static const int PEDESTAL_HIGH_GAIN_RMS_ERROR
static const int STATUS_FLAG_ERROR
static const int TESTPULSE_MIDDLE_GAIN_RMS_ERROR
static const int TESTPULSE_HIGH_GAIN_RMS_ERROR
static const int LED_TIMING_MEAN_ERROR
static const int PEDESTAL_LOW_GAIN_MEAN_ERROR
static const int TESTPULSE_LOW_GAIN_MEAN_ERROR
static const int LED_TIMING_RMS_ERROR
static const int CH_GAIN_ZERO_ERROR
static const int PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR
static const int LASER_TIMING_MEAN_ERROR
std::map< uint32_t, uint32_t > status_
Definition: StatusManager.h:30
static const int TT_ID_ERROR
static const int LED_RMS_ERROR
static const int PEDESTAL_MIDDLE_GAIN_MEAN_ERROR
static const int TESTPULSE_HIGH_GAIN_MEAN_ERROR
static const int LASER_RMS_ERROR
static const int CH_ID_ERROR

◆ ~StatusManager()

ecaldqm::StatusManager::~StatusManager ( )
inline

Definition at line 19 of file StatusManager.h.

19 {}

Member Function Documentation

◆ getStatus()

uint32_t ecaldqm::StatusManager::getStatus ( uint32_t  _key) const

Definition at line 247 of file StatusManager.cc.

References status_.

Referenced by ecaldqm::MESet::maskMatches(), and writeToObj().

247  {
248  std::map<uint32_t, uint32_t>::const_iterator itr(status_.find(_key));
249  if (itr == status_.end())
250  return 0;
251  return itr->second;
252  }
std::map< uint32_t, uint32_t > status_
Definition: StatusManager.h:30

◆ readFromObj()

void ecaldqm::StatusManager::readFromObj ( EcalDQMChannelStatus const &  _channelStatus,
EcalDQMTowerStatus const &  _towerStatus 
)

Definition at line 201 of file StatusManager.cc.

References EcalCondObjectContainer< T >::barrelItems(), EcalCondTowerObjectContainer< T >::barrelItems(), EcalTrigTowerDetId::detIdFromDenseIndex(), EcalCondObjectContainer< T >::endcapItems(), EcalCondTowerObjectContainer< T >::endcapItems(), EcalTrigTowerDetId::kEBTotalTowers, EBDetId::kSizeForDenseIndexing, EcalScDetId::kSizeForDenseIndexing, EEDetId::kSizeForDenseIndexing, DetId::rawId(), status_, EBDetId::unhashIndex(), EcalScDetId::unhashIndex(), and EEDetId::unhashIndex().

Referenced by EcalDQMonitorClient::beginRun().

201  {
202  EcalDQMChannelStatus::Items const &barrelChStatus(_channelStatus.barrelItems());
203  for (unsigned iC(0); iC != EBDetId::kSizeForDenseIndexing; ++iC)
204  status_.insert(
205  std::pair<uint32_t, uint32_t>(EBDetId::unhashIndex(iC).rawId(), barrelChStatus[iC].getStatusCode()));
206 
207  EcalDQMChannelStatus::Items const &endcapChStatus(_channelStatus.endcapItems());
208  for (unsigned iC(0); iC != EEDetId::kSizeForDenseIndexing; ++iC)
209  status_.insert(
210  std::pair<uint32_t, uint32_t>(EEDetId::unhashIndex(iC).rawId(), endcapChStatus[iC].getStatusCode()));
211 
212  EcalDQMTowerStatus::Items const &barrelTowStatus(_towerStatus.barrelItems());
213  for (unsigned iC(0); iC != EcalTrigTowerDetId::kEBTotalTowers; ++iC)
214  status_.insert(std::pair<uint32_t, uint32_t>(EcalTrigTowerDetId::detIdFromDenseIndex(iC).rawId(),
215  barrelTowStatus[iC].getStatusCode()));
216 
217  EcalDQMTowerStatus::Items const &endcapTowStatus(_towerStatus.endcapItems());
218  for (unsigned iC(0); iC != EcalScDetId::kSizeForDenseIndexing; ++iC)
219  status_.insert(
220  std::pair<uint32_t, uint32_t>(EcalScDetId::unhashIndex(iC).rawId(), endcapTowStatus[iC].getStatusCode()));
221  }
static constexpr int kSizeForDenseIndexing
Definition: EEDetId.h:328
static constexpr int kEBTotalTowers
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
static EcalScDetId unhashIndex(int hi)
Definition: EcalScDetId.h:117
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:65
static constexpr int kSizeForDenseIndexing
Definition: EBDetId.h:155
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
std::map< uint32_t, uint32_t > status_
Definition: StatusManager.h:30

◆ readFromStream()

void ecaldqm::StatusManager::readFromStream ( std::istream &  _input,
EcalElectronicsMapping const *  electronicsMap 
)

Definition at line 122 of file StatusManager.cc.

References ecaldqm::dccId(), dictionary_, EcalBarrel, EcalEndcap, EcalElectronicsMapping::getEcalScDetId(), l1tPhase2CaloJetEmulator_cfi::iEta, ecaldqm::kEEpLow, mps_splice::line, oniaPATMuonsWithTrigger_cff::matches, callgraph::module, nano_mu_digi_cff::rawId, ecaldqm::smName(), status_, AlCaHLTBitMon_QueryRunRegistry::string, EBDetId::unhashIndex(), EEDetId::unhashIndex(), EBDetId::validDenseIndex(), EEDetId::validDenseIndex(), and ecaldqm::zside().

Referenced by EcalDQMStatusWriter::beginRun().

122  {
123  TPRegexp linePat(
124  "^[ ]*(Crystal|TT|PN)[ ]+(EB[0-9+-]*|EE[0-9+-]*|[0-9]+)[ "
125  "]+([0-9]+)[ ]([a-zA-Z_]+)");
126 
128  while (true) {
129  std::getline(_input, line);
130  if (!_input.good())
131  break;
132 
133  if (!linePat.MatchB(line))
134  continue;
135 
136  TObjArray *matches(linePat.MatchS(line));
137  TString channelType(matches->At(1)->GetName());
138  TString module(matches->At(2)->GetName());
139  unsigned channel(TString(matches->At(3)->GetName()).Atoi());
140  TString statusName(matches->At(4)->GetName());
141  delete matches;
142 
143  std::map<std::string, uint32_t>::const_iterator dItr(dictionary_.find(statusName.Data()));
144  if (dItr == dictionary_.end())
145  continue;
146  uint32_t statusVal(dItr->second);
147 
148  if (channelType == "Crystal") {
149  // module: Subdetector name, channel: dense ID
150  // Store using EBDetId and EEDetId as keys (following
151  // EcalDQMChannelStatus)
152 
153  if (module == "EB") {
154  if (!EBDetId::validDenseIndex(channel))
155  continue;
156  status_.insert(std::pair<uint32_t, uint32_t>(EBDetId::unhashIndex(channel).rawId(), statusVal));
157  } else if (module == "EE") {
158  if (!EEDetId::validDenseIndex(channel))
159  continue;
160  status_.insert(std::pair<uint32_t, uint32_t>(EEDetId::unhashIndex(channel).rawId(), statusVal));
161  }
162  } else if (channelType == "TT") {
163  // module: Supermodule name, channel: RU ID (electronics ID tower)
164  // Store using EcalTrigTowerDetId and EcalScDetId as keys (following
165  // EcalDQMTowerStatus)
166 
167  if (module.Contains("EB")) {
168  /* TODO CHECK THIS */
169 
170  int iEta((channel - 1) / 4 + 1);
171  int zside(0);
172  int iPhi(0);
173  std::string smName = module.Data();
174  unsigned smNumber(std::atoi(smName.substr(3).c_str()));
175 
176  if (module(2) == '-') {
177  zside = -1;
178  iPhi = 4 * (smNumber - 1) + (channel - 1) % 4 - 1;
179  } else {
180  zside = 1;
181  iPhi = 4 * (smNumber - 1) + (68 - channel) % 4 - 1;
182  }
183 
184  status_.insert(
185  std::pair<uint32_t, uint32_t>(EcalTrigTowerDetId(zside, EcalBarrel, iEta, iPhi).rawId(), statusVal));
186  } else if (module.Contains("EE")) {
187  std::vector<EcalScDetId> scIds(electronicsMap->getEcalScDetId(dccId(module.Data()), channel, false));
188  for (unsigned iS(0); iS != scIds.size(); ++iS)
189  status_.insert(std::pair<uint32_t, uint32_t>(scIds[iS].rawId(), statusVal));
190  }
191  } else if (channelType == "PN") {
192  // module: DCC ID, channel: iPN
193  // Store using EcalPnDiodeDetId as keys
194  unsigned iDCC(module.Atoi() - 1);
195  int subdet(iDCC <= kEEmHigh || iDCC >= kEEpLow ? EcalEndcap : EcalBarrel);
196  status_.insert(std::pair<uint32_t, uint32_t>(EcalPnDiodeDetId(subdet, iDCC + 1, channel).rawId(), statusVal));
197  }
198  }
199  }
int zside(DetId const &)
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:65
std::map< std::string, uint32_t > dictionary_
Definition: StatusManager.h:29
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
std::string smName(unsigned)
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
std::map< uint32_t, uint32_t > status_
Definition: StatusManager.h:30
static bool validDenseIndex(uint32_t din)
Definition: EEDetId.h:213
static bool validDenseIndex(uint32_t din)
Definition: EBDetId.h:105

◆ writeToObj()

void ecaldqm::StatusManager::writeToObj ( EcalDQMChannelStatus _channelStatus,
EcalDQMTowerStatus _towerStatus 
) const

Definition at line 225 of file StatusManager.cc.

References EcalTrigTowerDetId::detIdFromDenseIndex(), getStatus(), EcalTrigTowerDetId::kEBTotalTowers, submitPVResolutionJobs::key, EBDetId::kSizeForDenseIndexing, EcalScDetId::kSizeForDenseIndexing, EEDetId::kSizeForDenseIndexing, nano_mu_digi_cff::rawId, EcalCondTowerObjectContainer< T >::setValue(), EcalCondObjectContainer< T >::setValue(), EBDetId::unhashIndex(), EcalScDetId::unhashIndex(), and EEDetId::unhashIndex().

Referenced by EcalDQMStatusWriter::beginRun().

225  {
226  for (unsigned iC(0); iC != EBDetId::kSizeForDenseIndexing; ++iC) {
227  uint32_t key(EBDetId::unhashIndex(iC).rawId());
228  _channelStatus.setValue(key, EcalDQMStatusCode(getStatus(key)));
229  }
230 
231  for (unsigned iC(0); iC != EEDetId::kSizeForDenseIndexing; ++iC) {
232  uint32_t key(EEDetId::unhashIndex(iC).rawId());
233  _channelStatus.setValue(key, EcalDQMStatusCode(getStatus(key)));
234  }
235 
236  for (unsigned iC(0); iC != EcalTrigTowerDetId::kEBTotalTowers; ++iC) {
238  _towerStatus.setValue(key, EcalDQMStatusCode(getStatus(key)));
239  }
240 
241  for (unsigned iC(0); iC != EcalScDetId::kSizeForDenseIndexing; ++iC) {
242  uint32_t key(EcalScDetId::unhashIndex(iC));
243  _towerStatus.setValue(key, EcalDQMStatusCode(getStatus(key)));
244  }
245  }
static constexpr int kSizeForDenseIndexing
Definition: EEDetId.h:328
static constexpr int kEBTotalTowers
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
static EcalScDetId unhashIndex(int hi)
Definition: EcalScDetId.h:117
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:65
void setValue(const uint32_t id, const Item &item)
void setValue(const uint32_t id, const Item &item)
static constexpr int kSizeForDenseIndexing
Definition: EBDetId.h:155
key
prepare the HTCondor submission files and eventually submit them
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
uint32_t getStatus(uint32_t) const

◆ writeToStream()

void ecaldqm::StatusManager::writeToStream ( std::ostream &  _output) const

Definition at line 223 of file StatusManager.cc.

223 {}

Member Data Documentation

◆ dictionary_

std::map<std::string, uint32_t> ecaldqm::StatusManager::dictionary_
private

Definition at line 29 of file StatusManager.h.

Referenced by readFromStream(), and StatusManager().

◆ status_

std::map<uint32_t, uint32_t> ecaldqm::StatusManager::status_
private

Definition at line 30 of file StatusManager.h.

Referenced by getStatus(), readFromObj(), and readFromStream().