CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 
 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 15 of file StatusManager.h.

Constructor & Destructor Documentation

ecaldqm::StatusManager::StatusManager ( )

Definition at line 21 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.

21  :
22  dictionary_(),
23  status_()
24  {
25  dictionary_["CH_ID_ERROR"] = 0x1 << EcalDQMStatusHelper::CH_ID_ERROR;
26  dictionary_["CH_GAIN_ZERO_ERROR"] = 0x1 << EcalDQMStatusHelper::CH_GAIN_ZERO_ERROR;
27  dictionary_["CH_GAIN_SWITCH_ERROR"] = 0x1 << EcalDQMStatusHelper::CH_GAIN_SWITCH_ERROR;
28  dictionary_["TT_ID_ERROR"] = 0x1 << EcalDQMStatusHelper::TT_ID_ERROR;
29  dictionary_["TT_SIZE_ERROR"] = 0x1 << EcalDQMStatusHelper::TT_SIZE_ERROR;
30 
31  dictionary_["PEDESTAL_LOW_GAIN_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_MEAN_ERROR;
32  dictionary_["PEDESTAL_MIDDLE_GAIN_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::PEDESTAL_MIDDLE_GAIN_MEAN_ERROR;
33  dictionary_["PEDESTAL_HIGH_GAIN_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_MEAN_ERROR;
34  dictionary_["PEDESTAL_LOW_GAIN_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::PEDESTAL_LOW_GAIN_RMS_ERROR;
35  dictionary_["PEDESTAL_MIDDLE_GAIN_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::PEDESTAL_MIDDLE_GAIN_RMS_ERROR;
36  dictionary_["PEDESTAL_HIGH_GAIN_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::PEDESTAL_HIGH_GAIN_RMS_ERROR;
37 
38  dictionary_["PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR;
39  dictionary_["PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR;
40 
41  dictionary_["TESTPULSE_LOW_GAIN_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::TESTPULSE_LOW_GAIN_MEAN_ERROR;
42  dictionary_["TESTPULSE_MIDDLE_GAIN_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::TESTPULSE_MIDDLE_GAIN_MEAN_ERROR;
43  dictionary_["TESTPULSE_HIGH_GAIN_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_MEAN_ERROR;
44  dictionary_["TESTPULSE_LOW_GAIN_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::TESTPULSE_LOW_GAIN_RMS_ERROR;
45  dictionary_["TESTPULSE_MIDDLE_GAIN_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::TESTPULSE_MIDDLE_GAIN_RMS_ERROR;
46  dictionary_["TESTPULSE_HIGH_GAIN_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::TESTPULSE_HIGH_GAIN_RMS_ERROR;
47 
48  dictionary_["LASER_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::LASER_MEAN_ERROR;
49  dictionary_["LASER_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::LASER_RMS_ERROR;
50  dictionary_["LASER_TIMING_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::LASER_TIMING_MEAN_ERROR;
51  dictionary_["LASER_TIMING_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::LASER_TIMING_RMS_ERROR;
52 
53  dictionary_["LED_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::LED_MEAN_ERROR;
54  dictionary_["LED_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::LED_RMS_ERROR;
55  dictionary_["LED_TIMING_MEAN_ERROR"] = 0x1 << EcalDQMStatusHelper::LED_TIMING_MEAN_ERROR;
56  dictionary_["LED_TIMING_RMS_ERROR"] = 0x1 << EcalDQMStatusHelper::LED_TIMING_RMS_ERROR;
57 
58  dictionary_["STATUS_FLAG_ERROR"] = 0x1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR;
59 
60  dictionary_["PHYSICS_BAD_CHANNEL_WARNING"] = 0x1 << EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_WARNING;
61  dictionary_["PHYSICS_BAD_CHANNEL_ERROR"] = 0x1 << EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_ERROR;
62 
63  dictionary_["disabled_channel"] =
76 
77  dictionary_["dead_channel"] =
102 
103  dictionary_["pedestal_problem"] =
112 
113  dictionary_["testpulse_problem"] =
120 
121  dictionary_["laser_problem"] =
126 
127  dictionary_["led_problem"] =
132 
133  dictionary_["noise_problem"] =
139  }
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:28
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:29
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
ecaldqm::StatusManager::~StatusManager ( )
inline

Definition at line 18 of file StatusManager.h.

18 {}

Member Function Documentation

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

Definition at line 265 of file StatusManager.cc.

References status_.

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

266  {
267  std::map<uint32_t, uint32_t>::const_iterator itr(status_.find(_key));
268  if(itr == status_.end()) return 0;
269  return itr->second;
270  }
std::map< uint32_t, uint32_t > status_
Definition: StatusManager.h:29
void ecaldqm::StatusManager::readFromObj ( EcalDQMChannelStatus const &  _channelStatus,
EcalDQMTowerStatus const &  _towerStatus 
)

Definition at line 215 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().

216  {
217  EcalDQMChannelStatus::Items const& barrelChStatus(_channelStatus.barrelItems());
218  for(unsigned iC(0); iC != EBDetId::kSizeForDenseIndexing; ++iC)
219  status_.insert(std::pair<uint32_t, uint32_t>(EBDetId::unhashIndex(iC).rawId(), barrelChStatus[iC].getStatusCode()));
220 
221  EcalDQMChannelStatus::Items const& endcapChStatus(_channelStatus.endcapItems());
222  for(unsigned iC(0); iC != EEDetId::kSizeForDenseIndexing; ++iC)
223  status_.insert(std::pair<uint32_t, uint32_t>(EEDetId::unhashIndex(iC).rawId(), endcapChStatus[iC].getStatusCode()));
224 
225  EcalDQMTowerStatus::Items const& barrelTowStatus(_towerStatus.barrelItems());
226  for(unsigned iC(0); iC != EcalTrigTowerDetId::kEBTotalTowers; ++iC)
227  status_.insert(std::pair<uint32_t, uint32_t>(EcalTrigTowerDetId::detIdFromDenseIndex(iC).rawId(), barrelTowStatus[iC].getStatusCode()));
228 
229  EcalDQMTowerStatus::Items const& endcapTowStatus(_towerStatus.endcapItems());
230  for(unsigned iC(0); iC != EcalScDetId::kSizeForDenseIndexing; ++iC)
231  status_.insert(std::pair<uint32_t, uint32_t>(EcalScDetId::unhashIndex(iC).rawId(), endcapTowStatus[iC].getStatusCode()));
232  }
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
static EcalScDetId unhashIndex(int hi)
Definition: EcalScDetId.h:118
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:99
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:114
std::map< uint32_t, uint32_t > status_
Definition: StatusManager.h:29
void ecaldqm::StatusManager::readFromStream ( std::istream &  _input)

Definition at line 142 of file StatusManager.cc.

References ecaldqm::dccId(), dictionary_, EcalBarrel, EcalEndcap, ecaldqm::getElectronicsMap(), ecaldqm::kEEpLow, geometryCSVtoXML::line, matches, python.rootplot.argparse::module, status_, AlCaHLTBitMon_QueryRunRegistry::string, EBDetId::unhashIndex(), EEDetId::unhashIndex(), EBDetId::validDenseIndex(), EEDetId::validDenseIndex(), and ecaldqm::zside().

Referenced by EcalDQMonitorClient::EcalDQMonitorClient(), and EcalDQMStatusWriter::EcalDQMStatusWriter().

143  {
144  TPRegexp linePat("^[ ]*(Crystal|TT|PN)[ ]+(EB[0-9+-]*|EE[0-9+-]*|[0-9]+)[ ]+([0-9]+)[ ]([a-zA-Z_]+)");
145 
147  while(true){
148  std::getline(_input, line);
149  if(!_input.good()) break;
150 
151  if(!linePat.MatchB(line)) continue;
152 
153  TObjArray* matches(linePat.MatchS(line));
154  TString channelType(matches->At(1)->GetName());
155  TString module(matches->At(2)->GetName());
156  unsigned channel(TString(matches->At(3)->GetName()).Atoi());
157  TString statusName(matches->At(4)->GetName());
158  delete matches;
159 
160  std::map<std::string, uint32_t>::const_iterator dItr(dictionary_.find(statusName.Data()));
161  if(dItr == dictionary_.end()) continue;
162  uint32_t statusVal(dItr->second);
163 
164  if(channelType == "Crystal"){
165  // module: Subdetector name, channel: dense ID
166  // Store using EBDetId and EEDetId as keys (following EcalDQMChannelStatus)
167 
168  if(module == "EB"){
169  if(!EBDetId::validDenseIndex(channel)) continue;
170  status_.insert(std::pair<uint32_t, uint32_t>(EBDetId::unhashIndex(channel).rawId(), statusVal));
171  }
172  else if(module == "EE"){
173  if(!EEDetId::validDenseIndex(channel)) continue;
174  status_.insert(std::pair<uint32_t, uint32_t>(EEDetId::unhashIndex(channel).rawId(), statusVal));
175  }
176  }
177  else if(channelType == "TT"){
178  // module: Supermodule name, channel: RU ID (electronics ID tower)
179  // Store using EcalTrigTowerDetId and EcalScDetId as keys (following EcalDQMTowerStatus)
180 
181  if(module.Contains("EB")){
182  /* TODO CHECK THIS */
183 
184  int iEta((channel - 1) / 4 + 1);
185  int zside(0);
186  int iPhi(0);
187  if(module(3) == '-'){
188  zside = -1;
189  iPhi = (channel - 1) % 4 + 1;
190  }
191  else{
192  zside = 1;
193  iPhi = (68 - channel) % 4 + 1;
194  }
195 
196  status_.insert(std::pair<uint32_t, uint32_t>(EcalTrigTowerDetId(zside, EcalBarrel, iEta, iPhi).rawId(), statusVal));
197  }
198  else if(module.Contains("EE")){
199  std::vector<EcalScDetId> scIds(getElectronicsMap()->getEcalScDetId(dccId(module.Data()), channel, false));
200  for(unsigned iS(0); iS != scIds.size(); ++iS)
201  status_.insert(std::pair<uint32_t, uint32_t>(scIds[iS].rawId(), statusVal));
202  }
203  }
204  else if(channelType == "PN"){
205  // module: DCC ID, channel: iPN
206  // Store using EcalPnDiodeDetId as keys
207  unsigned iDCC(module.Atoi() - 1);
208  int subdet(iDCC <= kEEmHigh || iDCC >= kEEpLow ? EcalEndcap : EcalBarrel);
209  status_.insert(std::pair<uint32_t, uint32_t>(EcalPnDiodeDetId(subdet, iDCC + 1, channel).rawId(), statusVal));
210  }
211  }
212  }
EcalElectronicsMapping const * getElectronicsMap()
int zside(DetId const &)
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:99
std::map< std::string, uint32_t > dictionary_
Definition: StatusManager.h:28
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:114
std::map< uint32_t, uint32_t > status_
Definition: StatusManager.h:29
static bool validDenseIndex(uint32_t din)
Definition: EEDetId.h:213
unsigned dccId(DetId const &)
Definition: vlib.h:208
static bool validDenseIndex(uint32_t din)
Definition: EBDetId.h:109
void ecaldqm::StatusManager::writeToObj ( EcalDQMChannelStatus _channelStatus,
EcalDQMTowerStatus _towerStatus 
) const

Definition at line 241 of file StatusManager.cc.

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

Referenced by EcalDQMStatusWriter::EcalDQMStatusWriter().

242  {
243  for(unsigned iC(0); iC != EBDetId::kSizeForDenseIndexing; ++iC){
244  uint32_t key(EBDetId::unhashIndex(iC).rawId());
245  _channelStatus.setValue(key, EcalDQMStatusCode(getStatus(key)));
246  }
247 
248  for(unsigned iC(0); iC != EEDetId::kSizeForDenseIndexing; ++iC){
249  uint32_t key(EEDetId::unhashIndex(iC).rawId());
250  _channelStatus.setValue(key, EcalDQMStatusCode(getStatus(key)));
251  }
252 
253  for(unsigned iC(0); iC != EcalTrigTowerDetId::kEBTotalTowers; ++iC){
255  _towerStatus.setValue(key, EcalDQMStatusCode(getStatus(key)));
256  }
257 
258  for(unsigned iC(0); iC != EcalScDetId::kSizeForDenseIndexing; ++iC){
259  uint32_t key(EcalScDetId::unhashIndex(iC));
260  _towerStatus.setValue(key, EcalDQMStatusCode(getStatus(key)));
261  }
262  }
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
uint32_t getStatus(uint32_t) const
static EcalScDetId unhashIndex(int hi)
Definition: EcalScDetId.h:118
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:99
void setValue(const uint32_t id, const Item &item)
void setValue(const uint32_t id, const Item &item)
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:114
void ecaldqm::StatusManager::writeToStream ( std::ostream &  _output) const

Definition at line 235 of file StatusManager.cc.

236  {
237 
238  }

Member Data Documentation

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

Definition at line 28 of file StatusManager.h.

Referenced by readFromStream(), and StatusManager().

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

Definition at line 29 of file StatusManager.h.

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