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
HcalDeadCellClient Class Reference

#include <HcalDeadCellClient.h>

Inheritance diagram for HcalDeadCellClient:
HcalBaseDQClient

Public Member Functions

void analyze (void)
 
void beginJob (void)
 
void beginRun (void)
 
void calculateProblems (void)
 
void cleanup (void)
 
void endJob (void)
 
void endRun (void)
 
bool hasErrors_Temp (void)
 
bool hasOther_Temp (void)
 
bool hasWarnings_Temp (void)
 
 HcalDeadCellClient ()
 Constructors. More...
 
 HcalDeadCellClient (std::string myname)
 
 HcalDeadCellClient (std::string myname, const edm::ParameterSet &ps)
 
void setup (void)
 
bool test_enabled (void)
 
void updateChannelStatus (std::map< HcalDetId, unsigned int > &myqual)
 
 ~HcalDeadCellClient ()
 Destructor. More...
 
- Public Member Functions inherited from HcalBaseDQClient
 HcalBaseDQClient ()
 
 HcalBaseDQClient (std::string s, const edm::ParameterSet &ps)
 
virtual void htmlOutput (std::string htmlDir)
 
std::string name ()
 
void setEventSetup (const edm::EventSetup &es)
 
virtual void setStatusMap (std::map< HcalDetId, unsigned int > &map)
 
virtual bool validHtmlOutput ()
 
virtual ~HcalBaseDQClient (void)
 

Private Attributes

bool excludeHOring2_backup_
 
int HBpresent_
 
int HEpresent_
 
int HFpresent_
 
int HOpresent_
 
int nevts_
 

Additional Inherited Members

- Public Attributes inherited from HcalBaseDQClient
int badChannelStatusMask_
 
std::map< HcalDetId, unsigned int > badstatusmap
 
const edm::EventSetupc
 
bool cloneME_
 
int debug_
 
DQMStoredqmStore_
 
bool enableCleanup_
 
bool enoughevents_
 
double minerrorrate_
 
int minevents_
 
std::string name_
 
bool Online_
 
std::string prefixME_
 
MonitorElementProblemCells
 
EtaPhiHistsProblemCellsByDepth
 
std::vector< std::string > problemnames_
 
std::string subdir_
 
bool testenabled_
 
bool validHtmlOutput_
 

Detailed Description

Definition at line 8 of file HcalDeadCellClient.h.

Constructor & Destructor Documentation

HcalDeadCellClient::HcalDeadCellClient ( )
inline

Constructors.

Definition at line 13 of file HcalDeadCellClient.h.

References HcalBaseDQClient::name_.

13 {name_="";};
HcalDeadCellClient::HcalDeadCellClient ( std::string  myname)

Definition at line 20 of file HcalDeadCellClient.cc.

References gather_cfg::cout, and HcalBaseDQClient::name_.

21 {
22  name_=myname;
23  std::cout <<"MY NAME = "<<name_.c_str()<<std::endl;
24 }
tuple cout
Definition: gather_cfg.py:121
HcalDeadCellClient::HcalDeadCellClient ( std::string  myname,
const edm::ParameterSet ps 
)

Definition at line 26 of file HcalDeadCellClient.cc.

References HcalBaseDQClient::badChannelStatusMask_, HcalBaseDQClient::cloneME_, HcalBaseDQClient::debug_, HcalBaseDQClient::enableCleanup_, excludeHOring2_backup_, edm::ParameterSet::getUntrackedParameter(), HcalChannelStatus::HcalCellDead, HcalBaseDQClient::minerrorrate_, HcalBaseDQClient::minevents_, HcalBaseDQClient::name_, HcalBaseDQClient::Online_, HcalBaseDQClient::prefixME_, HcalBaseDQClient::ProblemCells, HcalBaseDQClient::ProblemCellsByDepth, HcalBaseDQClient::subdir_, and HcalBaseDQClient::validHtmlOutput_.

27 {
28  name_=myname;
29  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
30  debug_ = ps.getUntrackedParameter<int>("debug",0);
31  prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
32  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
33  prefixME_.append("/");
34  subdir_ = ps.getUntrackedParameter<std::string>("DeadCellFolder","DeadCellMonitor_Hcal/"); // DeadCellMonitor_Hcal
35  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
36  subdir_.append("/");
37  subdir_=prefixME_+subdir_;
38 
39  validHtmlOutput_ = ps.getUntrackedParameter<bool>("DeadCell_validHtmlOutput",true);
40  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
41  badChannelStatusMask_ = ps.getUntrackedParameter<int>("DeadCell_BadChannelStatusMask",
42  ps.getUntrackedParameter<int>("BadChannelStatusMask",
43  (1<<HcalChannelStatus::HcalCellDead))); // identify channel status values to mask
44 
45  minerrorrate_ = ps.getUntrackedParameter<double>("DeadCell_minerrorrate",
46  ps.getUntrackedParameter<double>("minerrorrate",0.25));
47  minevents_ = ps.getUntrackedParameter<int>("DeadCell_minevents",
48  ps.getUntrackedParameter<int>("minevents",1000));
49 
50  excludeHOring2_backup_=ps.getUntrackedParameter<bool>("excludeHOring2_backup",false); // this is used only if excludeHOring2 value from Dead Cell task can't be read
51  Online_ = ps.getUntrackedParameter<bool>("online",false);
52 
54  ProblemCells=0;
55 
56 }
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * ProblemCells
EtaPhiHists * ProblemCellsByDepth
std::string subdir_
std::string prefixME_
HcalDeadCellClient::~HcalDeadCellClient ( )

Destructor.

Definition at line 446 of file HcalDeadCellClient.cc.

447 {}

Member Function Documentation

void HcalDeadCellClient::analyze ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 58 of file HcalDeadCellClient.cc.

References calculateProblems(), gather_cfg::cout, and HcalBaseDQClient::debug_.

Referenced by endRun().

59 {
60  if (debug_>2) std::cout <<"\tHcalDeadCellClient::analyze()"<<std::endl;
62 }
tuple cout
Definition: gather_cfg.py:121
void HcalDeadCellClient::beginJob ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 280 of file HcalDeadCellClient.cc.

References gather_cfg::cout, HcalBaseDQClient::debug_, HcalBaseDQClient::dqmStore_, cppFunctionSkipper::operator, and DQMStore::showDirStructure().

281 {
283  if (debug_>0)
284  {
285  std::cout <<"<HcalDeadCellClient::beginJob()> Displaying dqmStore directory structure:"<<std::endl;
287  }
288 }
tuple cout
Definition: gather_cfg.py:121
void showDirStructure(void) const
Definition: DQMStore.cc:2761
DQMStore * dqmStore_
void HcalDeadCellClient::beginRun ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 291 of file HcalDeadCellClient.cc.

References DQMStore::book2D(), gather_cfg::cout, HcalBaseDQClient::debug_, EtaPhiHists::depth, HcalBaseDQClient::dqmStore_, HcalBaseDQClient::enoughevents_, MonitorElement::getName(), HBpresent_, HEpresent_, HFpresent_, HOpresent_, i, nevts_, HcalBaseDQClient::ProblemCells, HcalBaseDQClient::ProblemCellsByDepth, HcalBaseDQClient::problemnames_, DQMStore::setCurrentFolder(), EtaPhiHists::setup(), and HcalBaseDQClient::subdir_.

292 {
293  enoughevents_=false;
294  HBpresent_=-1;
295  HEpresent_=-1;
296  HOpresent_=-1;
297  HFpresent_=-1;
298  if (!dqmStore_)
299  {
300  if (debug_>0) std::cout <<"<HcalDeadCellClient::beginRun> dqmStore does not exist!"<<std::endl;
301  return;
302  }
304  problemnames_.clear();
305  ProblemCells=dqmStore_->book2D(" ProblemDeadCells",
306  " Problem Dead Cell Rate for all HCAL;ieta;iphi",
307  85,-42.5,42.5,
308  72,0.5,72.5);
309  problemnames_.push_back(ProblemCells->getName());
310  if (debug_>1)
311  std::cout << "Tried to create ProblemCells Monitor Element in directory "<<subdir_<<" \t Failed? "<<(ProblemCells==0)<<std::endl;
312  dqmStore_->setCurrentFolder(subdir_+"problem_deadcells");
314  ProblemCellsByDepth->setup(dqmStore_," Problem Dead Cell Rate");
315  for (unsigned int i=0; i<ProblemCellsByDepth->depth.size();++i)
316  problemnames_.push_back(ProblemCellsByDepth->depth[i]->getName());
317 
318  nevts_=0;
319 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
MonitorElement * ProblemCells
void setup(DQMStore *&m_dbe, std::string Name, std::string Units="")
std::vector< MonitorElement * > depth
std::vector< std::string > problemnames_
EtaPhiHists * ProblemCellsByDepth
std::string subdir_
tuple cout
Definition: gather_cfg.py:121
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
DQMStore * dqmStore_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void HcalDeadCellClient::calculateProblems ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 64 of file HcalDeadCellClient.cc.

References abs, HcalBaseDQClient::badstatusmap, HcalObjRepresent::CalcIeta(), HcalBaseDQClient::cloneME_, gather_cfg::cout, HcalBaseDQClient::debug_, EtaPhiHists::depth, HcalBaseDQClient::dqmStore_, HcalBaseDQClient::enoughevents_, eta(), excludeHOring2_backup_, MonitorElement::Fill(), HcalObjRepresent::FillUnphysicalHEHFBins(), DQMStore::get(), MonitorElement::getBinContent(), MonitorElement::getIntValue(), MonitorElement::getTH2F(), HBpresent_, HcalBarrel, HcalEmpty, HcalEndcap, HcalEtaPhiHistNames(), HcalForward, HcalOuter, HEpresent_, HFpresent_, HOpresent_, i, isHB(), isHE(), isHF(), isHO(), isSiPM(), min, HcalBaseDQClient::minerrorrate_, HcalBaseDQClient::minevents_, HcalBaseDQClient::name(), phi, HcalBaseDQClient::prefixME_, HcalBaseDQClient::ProblemCells, HcalBaseDQClient::ProblemCellsByDepth, MonitorElement::Reset(), alignCSCRings::s, MonitorElement::setBinContent(), and HcalBaseDQClient::subdir_.

Referenced by analyze().

65 {
66 
67 
68  if (debug_>2) std::cout <<"\t\tHcalDeadCellClient::calculateProblems()"<<std::endl;
69  if(!dqmStore_)
70  {
71  if (debug_>2) std::cout <<"DQM STORE DOESN'T EXIST"<<std::endl;
72  return;
73  }
74 
75  MonitorElement* temp_present;
76 
77  temp_present=dqmStore_->get(subdir_+"ExcludeHOring2");
78  int excludeFromHOring2 = 0;
79  if (temp_present)
80  {
81  excludeFromHOring2 = temp_present->getIntValue();
82  if (debug_>2)
83  std::cout <<"Read 'excludeFromHOring2' from HcalMonitorTask output; value = "<<excludeFromHOring2<<std::endl;
84  }
85  else
86  {
87  excludeHOring2_backup_==true ? excludeFromHOring2=1 : excludeFromHOring2=0;
88  if (debug_>2)
89  std::cout <<"Could not read excludeFromHOring2 from HcalMonitorTasks; using value from cfg file: "<<excludeFromHOring2<<std::endl;
90  }
91 
92  // Don't fill histograms if nothing from Hcal is present
93  if (HBpresent_!=1)
94  {
95  temp_present=dqmStore_->get(prefixME_+"HcalInfo/HBpresent");
96  if (temp_present!=0)
97  HBpresent_=temp_present->getIntValue();
98  }
99  if (HEpresent_!=1)
100  {
101  temp_present=dqmStore_->get(prefixME_+"HcalInfo/HEpresent");
102  if (temp_present!=0)
103  HEpresent_=temp_present->getIntValue();
104  }
105  if (HOpresent_!=1)
106  {
107  temp_present=dqmStore_->get(prefixME_+"HcalInfo/HOpresent");
108  if (temp_present!=0)
109  HOpresent_=temp_present->getIntValue();
110  }
111  if (HFpresent_!=1)
112  {
113  temp_present=dqmStore_->get(prefixME_+"HcalInfo/HFpresent");
114  if (temp_present!=0)
115  HFpresent_=temp_present->getIntValue();
116  }
117  // Never saw any data from any Hcal FED; don't count as dead.
118  if (HBpresent_==-1 && HEpresent_==-1 && HOpresent_==-1 && HFpresent_==-1)
119  return;
120  double totalevents=0;
121  int etabins=0, phibins=0, zside=0;
122  double problemvalue=0;
123 
124  // Clear away old problems
125  if (ProblemCells!=0)
126  {
127  ProblemCells->Reset();
128  (ProblemCells->getTH2F())->SetMaximum(1.05);
129  (ProblemCells->getTH2F())->SetMinimum(0.);
130  }
131  for (unsigned int d=0;ProblemCellsByDepth!=0 && d<ProblemCellsByDepth->depth.size();++d)
132  {
133  if (ProblemCellsByDepth->depth[d]!=0)
134  {
135  ProblemCellsByDepth->depth[d]->Reset();
136  (ProblemCellsByDepth->depth[d]->getTH2F())->SetMaximum(1.05);
137  (ProblemCellsByDepth->depth[d]->getTH2F())->SetMinimum(0.);
138  }
139  }
140 
141  // Get histograms that are used in testing
142  TH2F* DigiPresentByDepth[4];
143  TH2F* RecentMissingDigisByDepth[4];
144  TH2F* RecHitsPresentByDepth[4];
145  TH2F* RecentMissingRecHitsByDepth[4];
146 
147  std::vector<std::string> name = HcalEtaPhiHistNames();
148 
149  MonitorElement* me;
150  for (int i=0;i<4;++i)
151  {
152  // Assume that histograms can't be found
153  DigiPresentByDepth[i]=0;
154  RecentMissingDigisByDepth[i]=0;
155  RecHitsPresentByDepth[i]=0;
156  RecentMissingRecHitsByDepth[i]=0;
157 
158  std::string s=subdir_+"dead_digi_never_present/"+name[i]+"Digi Present At Least Once";
159  me=dqmStore_->get(s.c_str());
160  if (me!=0) DigiPresentByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, DigiPresentByDepth[i], debug_);
161 
162  s=subdir_+"dead_digi_often_missing/"+name[i]+"Dead Cells with No Digis";
163  me=dqmStore_->get(s.c_str());
164  if (me!=0) RecentMissingDigisByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, RecentMissingDigisByDepth[i], debug_);
165 
166  s=subdir_+"dead_rechit_never_present/"+name[i]+"RecHit Above Threshold At Least Once";
167  me=dqmStore_->get(s.c_str());
168  if (me!=0) RecHitsPresentByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, RecHitsPresentByDepth[i], debug_);
169 
170  s=subdir_+"dead_rechit_often_missing/"+name[i]+"RecHits Failing Energy Threshold Test";
171  me=dqmStore_->get(s.c_str());
172  if (me!=0)RecentMissingRecHitsByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, RecentMissingRecHitsByDepth[i], debug_);
173 
174  }
175 
176  // Because we're clearing and re-forming the problem cell histogram here, we don't need to do any cute
177  // setting of the underflow bin to 0, and we can plot results as a raw rate between 0-1.
178 
179  for (unsigned int d=0;ProblemCellsByDepth!=0 && d<ProblemCellsByDepth->depth.size();++d)
180  {
181  if (ProblemCellsByDepth->depth[d]==0) continue;
182 
183  if (DigiPresentByDepth[d]==0) continue;
184  // Get number of entries from DigiPresent histogram
185  // (need to do this for offline DQM combinations of output)
186  totalevents=DigiPresentByDepth[d]->GetBinContent(0);
187  if (totalevents==0 || totalevents<minevents_) continue;
188  enoughevents_=true; // kind of a hack here
189  etabins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsX();
190  phibins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsY();
191  problemvalue=0;
192  for (int eta=0;eta<etabins;++eta)
193  {
194  int ieta=CalcIeta(eta,d+1);
195  if (ieta==-9999) continue;
196 
197  for (int phi=0;phi<phibins;++phi)
198  {
199  problemvalue=0;
200  // Don't count problems in HO ring 2 if the "excludeFromHOring2" bit is in use
201  if (isHO(eta,d+1) && excludeFromHOring2>0 && isSiPM(ieta,phi+1,d+1)==false && abs(ieta)>10)
202  continue;
203 
204  // Never-present histogram is a boolean, with underflow bin = 1 (for each instance)
205  // Offline DQM adds up never-present histograms from multiple outputs
206  // For now, we want offline DQM to show LS-based 'occupancies', rather than simple boolean on/off
207  // May change in the future?
208 
209  // If cell is never-present in all runs, then problemvalue = event
210  if (DigiPresentByDepth[d]!=0 && DigiPresentByDepth[d]->GetBinContent(eta+1,phi+1)==0)
211  problemvalue=totalevents;
212 
213  // Rec Hit presence test
214  else if (RecHitsPresentByDepth[d]!=0)
215  {
216  if (RecHitsPresentByDepth[d]->GetBinContent(eta+1,phi+1)==0)
217  problemvalue=totalevents;
218  else if (RecHitsPresentByDepth[d]->GetBinContent(eta+1,phi+1)>1)
219  RecHitsPresentByDepth[d]->SetBinContent(eta+1,phi+1,1);
220  }
221  else
222  {
223  if (RecentMissingDigisByDepth[d]!=0)
224  problemvalue+=RecentMissingDigisByDepth[d]->GetBinContent(eta+1,phi+1);
225  if (RecentMissingRecHitsByDepth[d]!=0)
226  problemvalue+=RecentMissingRecHitsByDepth[d]->GetBinContent(eta+1,phi+1);
227  }
228 
229  if (problemvalue==0) continue;
230 
231  problemvalue/=totalevents; // problem value is a rate; should be between 0 and 1
232  problemvalue = std::min(1.,problemvalue);
233 
234  zside=0;
235  if (isHF(eta,d+1)) // shift ieta by 1 for HF
236  ieta<0 ? zside = -1 : zside = 1;
237 
238  // For problem cells that exceed our allowed rate,
239  // set the values to -1 if the cells are already marked in the status database
240  if (problemvalue>minerrorrate_)
241  {
242  HcalSubdetector subdet=HcalEmpty;
243  if (isHB(eta,d+1))subdet=HcalBarrel;
244  else if (isHE(eta,d+1)) subdet=HcalEndcap;
245  else if (isHF(eta,d+1)) subdet=HcalForward;
246  else if (isHO(eta,d+1)) subdet=HcalOuter;
247  HcalDetId hcalid(subdet, ieta, phi+1, (int)(d+1));
248  if (badstatusmap.find(hcalid)!=badstatusmap.end())
249  problemvalue=999;
250  }
251  ProblemCellsByDepth->depth[d]->setBinContent(eta+1,phi+1,problemvalue);
252  if (ProblemCells!=0) ProblemCells->Fill(ieta+zside,phi+1,problemvalue);
253  } // loop on phi
254  } // loop on eta
255  } // loop on depth
256 
257  if (ProblemCells==0)
258  {
259  if (debug_>0) std::cout <<"<HcalDeadCellClient::analyze> ProblemCells histogram does not exist!"<<std::endl;
260  return;
261  }
262 
263  // Normalization of ProblemCell plot, in the case where there are errors in multiple depths
264  etabins=(ProblemCells->getTH2F())->GetNbinsX();
265  phibins=(ProblemCells->getTH2F())->GetNbinsY();
266  for (int eta=0;eta<etabins;++eta)
267  {
268  for (int phi=0;phi<phibins;++phi)
269  {
272  }
273  }
274 
277  return;
278 }
bool isHO(int etabin, int depth)
int i
Definition: DBlmapReader.cc:9
MonitorElement * ProblemCells
std::string name()
void setBinContent(int binx, double content)
set content of bin (1-D)
std::vector< std::string > HcalEtaPhiHistNames()
#define abs(x)
Definition: mlp_lapack.h:159
#define min(a, b)
Definition: mlp_lapack.h:161
bool isHE(int etabin, int depth)
T eta() const
void Fill(long long x)
bool isSiPM(int ieta, int iphi, int depth)
std::vector< MonitorElement * > depth
int CalcIeta(int subdet, int eta, int depth)
EtaPhiHists * ProblemCellsByDepth
HcalSubdetector
Definition: HcalAssistant.h:32
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
bool isHB(int etabin, int depth)
bool isHF(int etabin, int depth)
int64_t getIntValue(void) const
std::string subdir_
std::map< HcalDetId, unsigned int > badstatusmap
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
double getBinContent(int binx) const
get content of bin (1-D)
std::string prefixME_
tuple cout
Definition: gather_cfg.py:121
TH2F * getTH2F(void) const
void Reset(void)
reset ME (ie. contents, errors, etc)
DQMStore * dqmStore_
Definition: DDAxes.h:10
void HcalDeadCellClient::cleanup ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 324 of file HcalDeadCellClient.cc.

324 {}
void HcalDeadCellClient::endJob ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 289 of file HcalDeadCellClient.cc.

289 {}
void HcalDeadCellClient::endRun ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 321 of file HcalDeadCellClient.cc.

References analyze().

321 {analyze();}
bool HcalDeadCellClient::hasErrors_Temp ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 326 of file HcalDeadCellClient.cc.

References HcalObjRepresent::CalcIeta(), gather_cfg::cout, HcalBaseDQClient::debug_, EtaPhiHists::depth, MonitorElement::getTH2F(), HcalBaseDQClient::minerrorrate_, HcalBaseDQClient::ProblemCells, and HcalBaseDQClient::ProblemCellsByDepth.

327 {
328  if (!ProblemCells)
329  {
330  if (debug_>1) std::cout <<"<HcalDeadCellClient::hasErrors_Temp> ProblemCells histogram does not exist!"<<std::endl;
331  return false;
332  }
333  int problemcount=0;
334  int ieta=-9999;
335 
336  for (int depth=0;depth<4; ++depth)
337  {
338  int etabins = (ProblemCells->getTH2F())->GetNbinsX();
339  int phibins = (ProblemCells->getTH2F())->GetNbinsY();
340  for (int hist_eta=0;hist_eta<etabins;++hist_eta)
341  {
342  for (int hist_phi=0; hist_phi<phibins;++hist_phi)
343  {
344  ieta=CalcIeta(hist_eta,depth+1);
345  if (ieta==-9999) continue;
346  if (ProblemCellsByDepth->depth[depth]==0)
347  continue;
348  if (ProblemCellsByDepth->depth[depth]->getBinContent(hist_eta,hist_phi)>minerrorrate_)
349  ++problemcount;
350  } // for (int hist_phi=1;...)
351  } // for (int hist_eta=1;...)
352  } // for (int depth=0;...)
353 
354  if (problemcount>0) return true;
355  return false;
356 }
MonitorElement * ProblemCells
std::vector< MonitorElement * > depth
int CalcIeta(int subdet, int eta, int depth)
EtaPhiHists * ProblemCellsByDepth
tuple cout
Definition: gather_cfg.py:121
TH2F * getTH2F(void) const
bool HcalDeadCellClient::hasOther_Temp ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 359 of file HcalDeadCellClient.cc.

359 {return false;}
bool HcalDeadCellClient::hasWarnings_Temp ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 358 of file HcalDeadCellClient.cc.

358 {return false;}
void HcalDeadCellClient::setup ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 323 of file HcalDeadCellClient.cc.

323 {}
bool HcalDeadCellClient::test_enabled ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 360 of file HcalDeadCellClient.cc.

360 {return true;}
void HcalDeadCellClient::updateChannelStatus ( std::map< HcalDetId, unsigned int > &  myqual)
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 364 of file HcalDeadCellClient.cc.

References HcalObjRepresent::CalcIeta(), gather_cfg::cout, HcalBaseDQClient::debug_, EtaPhiHists::depth, HcalBaseDQClient::enoughevents_, HcalBarrel, HcalChannelStatus::HcalCellDead, HcalEndcap, HcalForward, HcalOuter, isHB(), isHE(), isHF(), HcalBaseDQClient::minerrorrate_, HcalBaseDQClient::ProblemCellsByDepth, and validDetId().

365 {
366  // This gets called by HcalMonitorClient
367 
368  if (enoughevents_==false) return; // not enough events to make judgment; don't create new status file
369 
370  float binval;
371  int ieta=0;
372  int iphi=0;
373  int etabins=0;
374  int phibins=0;
375 
376  int subdet=0;
377  if (debug_>1)
378  {
379  std::cout <<"<HcalDeadCellClient> Summary of Dead Cells in Run: "<<std::endl;
380  std::cout <<"(Error rate must be >= "<<minerrorrate_*100.<<"% )"<<std::endl;
381  }
382  for (int d=0;d<4;++d)
383  {
384  etabins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsX();
385  phibins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsY();
386  for (int hist_eta=0;hist_eta<etabins;++hist_eta)
387  {
388  ieta=CalcIeta(hist_eta,d+1);
389  if (ieta==-9999) continue;
390  for (int hist_phi=0;hist_phi<phibins;++hist_phi)
391  {
392  iphi=hist_phi+1;
393 
394  // ProblemCells have already been normalized
395  binval=ProblemCellsByDepth->depth[d]->getBinContent(hist_eta+1,hist_phi+1);
396 
397  // Set subdetector labels for output
398  if (d<2)
399  {
400  if (isHB(hist_eta,d+1))
401  subdet=HcalBarrel;
402  else if (isHE(hist_eta,d+1))
403  subdet=HcalEndcap;
404  else if (isHF(hist_eta,d+1))
405  subdet=HcalForward;
406  }
407  else if (d==2)
408  subdet=HcalEndcap;
409  else if (d==3)
410  subdet=HcalOuter;
411  // Set correct depth label
412 
413  HcalDetId myid((HcalSubdetector)(subdet), ieta, iphi, d+1);
414  // Need this to keep from flagging non-existent HE/HF cells
415  if (!validDetId((HcalSubdetector)(subdet), ieta, iphi, d+1))
416  continue;
417 
418  int deadcell=0;
419  if (binval>minerrorrate_)
420  deadcell=1;
421  if (deadcell==1 && debug_>0)
422  std::cout <<"Dead Cell : subdetector = "<<subdet<<" (eta,phi,depth) = ("<<ieta<<", "<<iphi<<", "<<d+1<<"): "<<binval*100.<<"%"<<std::endl;
423 
424  // DetID not found in quality list; add it.
425  if (myqual.find(myid)==myqual.end())
426  myqual[myid]=(deadcell<<HcalChannelStatus::HcalCellDead); // deadcell shifted to bit 6
427  else
428  {
429  int mask=(1<<HcalChannelStatus::HcalCellDead);
430  // dead cell found; 'or' the dead cell mask with existing ID
431  if (deadcell==1)
432  myqual[myid] |=mask;
433  // cell is not found, 'and' the inverse of the mask with the existing ID.
434  // Does this work correctly? I think so, but need to verify.
435  // Also, do we want to allow the client to turn off dead cell masks, or only add them?
436  else
437  myqual[myid] &=~mask;
438  }
439  } // for (int hist_phi=1;hist_phi<=phibins;++hist_phi)
440  } // for (int hist_eta=1;hist_eta<=etabins;++hist_eta)
441  } // for (int d=0;d<4;++d)
442 
443 
444 } //void HcalDeadCellClient::updateChannelStatus
bool isHE(int etabin, int depth)
std::vector< MonitorElement * > depth
int CalcIeta(int subdet, int eta, int depth)
EtaPhiHists * ProblemCellsByDepth
HcalSubdetector
Definition: HcalAssistant.h:32
bool isHB(int etabin, int depth)
bool isHF(int etabin, int depth)
tuple cout
Definition: gather_cfg.py:121
bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)

Member Data Documentation

bool HcalDeadCellClient::excludeHOring2_backup_
private

Definition at line 39 of file HcalDeadCellClient.h.

Referenced by calculateProblems(), and HcalDeadCellClient().

int HcalDeadCellClient::HBpresent_
private

Definition at line 38 of file HcalDeadCellClient.h.

Referenced by beginRun(), and calculateProblems().

int HcalDeadCellClient::HEpresent_
private

Definition at line 38 of file HcalDeadCellClient.h.

Referenced by beginRun(), and calculateProblems().

int HcalDeadCellClient::HFpresent_
private

Definition at line 38 of file HcalDeadCellClient.h.

Referenced by beginRun(), and calculateProblems().

int HcalDeadCellClient::HOpresent_
private

Definition at line 38 of file HcalDeadCellClient.h.

Referenced by beginRun(), and calculateProblems().

int HcalDeadCellClient::nevts_
private

Definition at line 36 of file HcalDeadCellClient.h.

Referenced by beginRun().