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 Member Functions | Private Attributes
HcalHotCellClient Class Reference

#include <HcalHotCellClient.h>

Inheritance diagram for HcalHotCellClient:
HcalBaseDQClient

Public Member Functions

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

Private Member Functions

void setupProblemCells (DQMStore::IBooker &, DQMStore::IGetter &)
 

Private Attributes

bool doProblemCellSetup_
 
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_
 
bool enableCleanup_
 
bool enoughevents_
 
HcalLogicalMaplogicalMap_
 
double minerrorrate_
 
int minevents_
 
std::string name_
 
bool needLogicalMap_
 
bool Online_
 
std::string prefixME_
 
MonitorElementProblemCells
 
EtaPhiHistsProblemCellsByDepth
 
std::vector< std::string > problemnames_
 
std::string subdir_
 
bool testenabled_
 
const HcalTopologytopo_
 
bool validHtmlOutput_
 

Detailed Description

Definition at line 8 of file HcalHotCellClient.h.

Constructor & Destructor Documentation

HcalHotCellClient::HcalHotCellClient ( )
inline

Constructors.

Definition at line 13 of file HcalHotCellClient.h.

References HcalBaseDQClient::name_.

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

Definition at line 18 of file HcalHotCellClient.cc.

References HcalBaseDQClient::name_.

19 {
20  name_=myname;
21 }
HcalHotCellClient::HcalHotCellClient ( std::string  myname,
const edm::ParameterSet ps 
)

Definition at line 23 of file HcalHotCellClient.cc.

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

24 {
25  name_=myname;
26  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
27  debug_ = ps.getUntrackedParameter<int>("debug",0);
28  prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
29  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
30  prefixME_.append("/");
31  subdir_ = ps.getUntrackedParameter<std::string>("HotCellFolder","HotCellMonitor_Hcal/"); // HotCellMonitor_Hcal
32  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
33  subdir_.append("/");
34  subdir_=prefixME_+subdir_;
35 
36  validHtmlOutput_ = ps.getUntrackedParameter<bool>("HotCell_validHtmlOutput",true);
37  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
38  badChannelStatusMask_ = ps.getUntrackedParameter<int>("HotCell_BadChannelStatusMask",
39  ps.getUntrackedParameter<int>("BadChannelStatusMask",
40  (1<<HcalChannelStatus::HcalCellHot))); // identify channel status values to mask
41  // badChannelStatusMask_ = ps.getUntrackedParameter<int>("HotCell_BadChannelStatusMask", (1<<1)); // identify channel status values to mask
42 
43  minerrorrate_ = ps.getUntrackedParameter<double>("HotCell_minerrorrate",
44  ps.getUntrackedParameter<double>("minerrorrate",0.25));
45  minevents_ = ps.getUntrackedParameter<int>("HotCell_minevents",
46  ps.getUntrackedParameter<int>("minevents",100));
47  Online_ = ps.getUntrackedParameter<bool>("online",false);
48 
50  ProblemCells=0;
51 
52  doProblemCellSetup_ = true;
53 }
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * ProblemCells
EtaPhiHists * ProblemCellsByDepth
std::string subdir_
std::string prefixME_
HcalHotCellClient::~HcalHotCellClient ( )

Destructor.

Definition at line 373 of file HcalHotCellClient.cc.

References HcalBaseDQClient::ProblemCellsByDepth.

374 {
376 }
EtaPhiHists * ProblemCellsByDepth

Member Function Documentation

void HcalHotCellClient::analyze ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 55 of file HcalHotCellClient.cc.

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

56 {
57  if (debug_>2) std::cout <<"\tHcalHotCellClient::analyze()"<<std::endl;
59  calculateProblems(ib,ig);
60 }
void setupProblemCells(DQMStore::IBooker &, DQMStore::IGetter &)
virtual void calculateProblems(void)
tuple cout
Definition: gather_cfg.py:145
void HcalHotCellClient::beginRun ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 243 of file HcalHotCellClient.cc.

References HcalBaseDQClient::enoughevents_, and nevts_.

244 {
245  enoughevents_=false;
246  nevts_=0;
247 }
void HcalHotCellClient::calculateProblems ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)

Definition at line 62 of file HcalHotCellClient.cc.

References HcalBaseDQClient::badstatusmap, HcalObjRepresent::CalcIeta(), HcalBaseDQClient::cloneME_, gather_cfg::cout, ztail::d, HcalBaseDQClient::debug_, EtaPhiHists::depth, HcalBaseDQClient::enoughevents_, eta, MonitorElement::Fill(), HcalObjRepresent::FillUnphysicalHEHFBins(), DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getTH2F(), HcalBarrel, HcalEmpty, HcalEndcap, HcalEtaPhiHistNames(), HcalForward, HcalOuter, i, isHB(), isHE(), isHF(), isHO(), bookConverter::max, min(), HcalBaseDQClient::minerrorrate_, HcalBaseDQClient::minevents_, HcalBaseDQClient::name(), phi, HcalBaseDQClient::ProblemCells, HcalBaseDQClient::ProblemCellsByDepth, MonitorElement::Reset(), alignCSCRings::s, MonitorElement::setBinContent(), AlCaHLTBitMon_QueryRunRegistry::string, HcalBaseDQClient::subdir_, and ecaldqm::zside().

63 {
64  if (debug_>2) std::cout <<"\t\tHcalHotCellClient::calculateProblems()"<<std::endl;
65  double totalevents=0;
66  int etabins=0, phibins=0, zside=0;
67  double problemvalue=0;
68 
69  // Clear away old problems
70  if (ProblemCells!=0)
71  {
73  (ProblemCells->getTH2F())->SetMaximum(1.05);
74  (ProblemCells->getTH2F())->SetMinimum(0.);
75  }
76  for (unsigned int d=0;ProblemCellsByDepth!=0 && d<ProblemCellsByDepth->depth.size();++d)
77  {
78  if (ProblemCellsByDepth->depth[d]!=0)
79  {
80  ProblemCellsByDepth->depth[d]->Reset();
81  (ProblemCellsByDepth->depth[d]->getTH2F())->SetMaximum(1.05);
82  (ProblemCellsByDepth->depth[d]->getTH2F())->SetMinimum(0.);
83  }
84  }
85 
86  // Get histograms that are used in testing
87  TH2F* HotAboveThresholdByDepth[4];
88  TH2F* HotAlwaysAboveThresholdByDepth[4];
89  TH2F* HotAboveETThresholdByDepth[4];
90  TH2F* HotAlwaysAboveETThresholdByDepth[4];
91  TH2F* HotNeighborsByDepth[4];
92 
93  std::vector<std::string> name = HcalEtaPhiHistNames();
94 
95  bool neighbortest=false;
96 
97  MonitorElement* me;
98  for (int i=0;i<4;++i)
99  {
100  // Assume histograms aren't found by default
101  HotAboveThresholdByDepth[i]=0;
102  HotAlwaysAboveThresholdByDepth[i]=0;
103  HotAboveETThresholdByDepth[i]=0;
104  HotAlwaysAboveETThresholdByDepth[i]=0;
105  HotNeighborsByDepth[i]=0;
106 
107  std::string s=subdir_+"hot_rechit_above_threshold/"+name[i]+"Hot Cells Above ET Threshold";
108  me=ig.get(s.c_str());
109  if (me!=0)HotAboveETThresholdByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, HotAboveETThresholdByDepth[i], debug_);
110 
111  s=subdir_+"hot_rechit_always_above_threshold/"+name[i]+"Hot Cells Persistently Above ET Threshold";
112  me=ig.get(s.c_str());
113  if (me!=0)HotAlwaysAboveETThresholdByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, HotAlwaysAboveETThresholdByDepth[i], debug_);
114 
115  s=subdir_+"hot_rechit_above_threshold/"+name[i]+"Hot Cells Above Energy Threshold";
116  me=ig.get(s.c_str());
117  if (me!=0)HotAboveThresholdByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, HotAboveThresholdByDepth[i], debug_);
118 
119  s=subdir_+"hot_rechit_always_above_threshold/"+name[i]+"Hot Cells Persistently Above Energy Threshold";
120  me=ig.get(s.c_str());
121  if (me!=0)HotAlwaysAboveThresholdByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, HotAlwaysAboveThresholdByDepth[i], debug_);
122 
123  s=subdir_+"hot_neighbortest/"+name[i]+"Hot Cells Failing Neighbor Test";
124  me=ig.get(s.c_str());
125  if (me!=0)HotNeighborsByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, HotNeighborsByDepth[i], debug_);
126  s=subdir_+"hot_neighbortest/NeighborTestEnabled";
127  me=ig.get(s.c_str());
128  if (me!=0 && me->getIntValue()==1)
129  neighbortest=true;
130  }
131 
132 
133  // Because we're clearing and re-forming the problem cell histogram here, we don't need to do any cute
134  // setting of the underflow bin to 0, and we can plot results as a raw rate between 0-1.
135 
136  for (unsigned int d=0;ProblemCellsByDepth!=0 && d<ProblemCellsByDepth->depth.size();++d)
137  {
138  if (ProblemCellsByDepth->depth[d]==0) continue;
139 
140  if (HotAboveETThresholdByDepth[d]) totalevents = std::max(totalevents, HotAboveETThresholdByDepth[d]->GetBinContent(0));
141  else if (HotAlwaysAboveETThresholdByDepth[d]) totalevents = std::max(totalevents, HotAlwaysAboveETThresholdByDepth[d]->GetBinContent(0));
142  else if (HotAboveThresholdByDepth[d]) totalevents = std::max(totalevents, HotAboveThresholdByDepth[d]->GetBinContent(0));
143  else if (HotAlwaysAboveThresholdByDepth[d]) totalevents = std::max(totalevents, HotAlwaysAboveThresholdByDepth[d]->GetBinContent(0));
144  else if (neighbortest==true && HotNeighborsByDepth[d]) totalevents = std::max(totalevents, HotNeighborsByDepth[d]->GetBinContent(0));
145  else if (debug_>0) std::cout <<"<HcalHotCellClient::calculateProblems> No evaluation histograms found; no valid hot tests enabled?" << std::endl;
146  if (totalevents==0 || totalevents<minevents_) continue;
147  enoughevents_=true; // kind of a hack here
148  etabins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsX();
149  phibins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsY();
150  problemvalue=0;
151  for (int eta=0;eta<etabins;++eta)
152  {
153  int ieta=CalcIeta(eta,d+1);
154  if (ieta==-9999) continue;
155  for (int phi=0;phi<phibins;++phi)
156  {
157  problemvalue=0; // problem fraction sums over all three tests
158  // If cell is never-present in all runs, then problemvalue = event
159  if (HotAboveETThresholdByDepth[d]!=0)
160  problemvalue+=HotAboveETThresholdByDepth[d]->GetBinContent(eta+1,phi+1);
161  if (HotAboveThresholdByDepth[d]!=0)
162  problemvalue+=HotAboveThresholdByDepth[d]->GetBinContent(eta+1,phi+1);
163  if (HotAlwaysAboveThresholdByDepth[d]!=0)
164  problemvalue+=HotAlwaysAboveThresholdByDepth[d]->GetBinContent(eta+1,phi+1);
165  if (neighbortest==true && HotNeighborsByDepth[d]!=0)
166  problemvalue+=HotNeighborsByDepth[d]->GetBinContent(eta+1,phi+1);
167  if (problemvalue==0) continue;
168  problemvalue/=totalevents; // problem value is a rate; should be between 0 and 1
169  problemvalue = std::min(1.,problemvalue);
170 
171  zside=0;
172  if (isHF(eta,d+1)) // shift ieta by 1 for HF
173  ieta<0 ? zside = -1 : zside = 1;
174 
175  // For problem cells that exceed our allowed rate,
176  // set the values to -1 if the cells are already marked in the status database
177  if (problemvalue>minerrorrate_)
178  {
179  HcalSubdetector subdet=HcalEmpty;
180  if (isHB(eta,d+1))subdet=HcalBarrel;
181  else if (isHE(eta,d+1)) subdet=HcalEndcap;
182  else if (isHF(eta,d+1)) subdet=HcalForward;
183  else if (isHO(eta,d+1)) subdet=HcalOuter;
184  HcalDetId hcalid(subdet, ieta, phi+1, (int)(d+1));
185  if (badstatusmap.find(hcalid)!=badstatusmap.end())
186  problemvalue=999;
187  }
188  ProblemCellsByDepth->depth[d]->setBinContent(eta+1,phi+1,problemvalue);
189  if (ProblemCells!=0) ProblemCells->Fill(ieta+zside,phi+1,problemvalue);
190  } // loop on phi
191  } // loop on eta
192  } // loop on depth
193 
194  if (ProblemCells==0)
195  {
196  if (debug_>0) std::cout <<"<HcalHotCellClient::analyze> ProblemCells histogram does not exist!"<<std::endl;
197  return;
198  }
199 
200  // Normalization of ProblemCell plot, in the case where there are errors in multiple depths
201  etabins=(ProblemCells->getTH2F())->GetNbinsX();
202  phibins=(ProblemCells->getTH2F())->GetNbinsY();
203  for (int eta=0;eta<etabins;++eta)
204  {
205  for (int phi=0;phi<phibins;++phi)
206  {
209  }
210  }
211 
214  return;
215 }
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)
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:301
std::vector< std::string > HcalEtaPhiHistNames()
int zside(DetId const &)
bool isHE(int etabin, int depth)
void Fill(long long x)
tuple d
Definition: ztail.py:151
std::vector< MonitorElement * > depth
int CalcIeta(int subdet, int eta, int depth)
EtaPhiHists * ProblemCellsByDepth
HcalSubdetector
Definition: HcalAssistant.h:31
T min(T a, T b)
Definition: MathUtil.h:58
bool isHB(int etabin, int depth)
bool isHF(int etabin, int depth)
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)
tuple cout
Definition: gather_cfg.py:145
TH2F * getTH2F(void) const
void Reset(void)
reset ME (ie. contents, errors, etc)
void HcalHotCellClient::cleanup ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 252 of file HcalHotCellClient.cc.

Referenced by esMonitoring.FDJsonServer::handle_close().

252 {}
void HcalHotCellClient::endJob ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 219 of file HcalHotCellClient.cc.

219 {}
bool HcalHotCellClient::hasErrors_Temp ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 254 of file HcalHotCellClient.cc.

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

255 {
256  if (!ProblemCells)
257  {
258  if (debug_>1) std::cout <<"<HcalHotCellClient::hasErrors_Temp> ProblemCells histogram does not exist!"<<std::endl;
259  return false;
260  }
261  int problemcount=0;
262  int ieta=-9999;
263 
264  for (int depth=0;depth<4; ++depth)
265  {
266  int etabins = (ProblemCells->getTH2F())->GetNbinsX();
267  int phibins = (ProblemCells->getTH2F())->GetNbinsY();
268  for (int hist_eta=0;hist_eta<etabins;++hist_eta)
269  {
270  for (int hist_phi=0; hist_phi<phibins;++hist_phi)
271  {
272  ieta=CalcIeta(hist_eta,depth+1);
273  if (ieta==-9999) continue;
275  continue;
276  if (ProblemCellsByDepth->depth[depth]->getBinContent(hist_eta,hist_phi)>minerrorrate_)
277  ++problemcount;
278  } // for (int hist_phi=1;...)
279  } // for (int hist_eta=1;...)
280  } // for (int depth=0;...)
281 
282  if (problemcount>0) return true;
283  return false;
284 }
MonitorElement * ProblemCells
std::vector< MonitorElement * > depth
int CalcIeta(int subdet, int eta, int depth)
EtaPhiHists * ProblemCellsByDepth
tuple cout
Definition: gather_cfg.py:145
TH2F * getTH2F(void) const
bool HcalHotCellClient::hasOther_Temp ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 287 of file HcalHotCellClient.cc.

287 {return false;}
bool HcalHotCellClient::hasWarnings_Temp ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 286 of file HcalHotCellClient.cc.

286 {return false;}
void HcalHotCellClient::setup ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 251 of file HcalHotCellClient.cc.

251 {}
void HcalHotCellClient::setupProblemCells ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
private

Definition at line 221 of file HcalHotCellClient.cc.

References DQMStore::IBooker::book2D(), gather_cfg::cout, HcalBaseDQClient::debug_, EtaPhiHists::depth, doProblemCellSetup_, MonitorElement::getName(), i, HcalBaseDQClient::ProblemCells, HcalBaseDQClient::ProblemCellsByDepth, HcalBaseDQClient::problemnames_, DQMStore::IBooker::setCurrentFolder(), EtaPhiHists::setup(), and HcalBaseDQClient::subdir_.

Referenced by analyze().

222 {
223 
225  problemnames_.clear();
226  ProblemCells=ib.book2D(" ProblemHotCells",
227  " Problem Hot Cell Rate for all HCAL;ieta;iphi",
228  85,-42.5,42.5,
229  72,0.5,72.5);
230  problemnames_.push_back(ProblemCells->getName());
231  if (debug_>1)
232  std::cout << "Tried to create ProblemCells Monitor Element in directory "<<subdir_<<" \t Failed? "<<(ProblemCells==0)<<std::endl;
233  ib.setCurrentFolder(subdir_+"problem_hotcells");
235  ProblemCellsByDepth->setup(ib," Problem Hot Cell Rate");
236  for (unsigned int i=0; i<ProblemCellsByDepth->depth.size();++i)
237  problemnames_.push_back(ProblemCellsByDepth->depth[i]->getName());
238 
239  doProblemCellSetup_ = false;
240 
241 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
MonitorElement * ProblemCells
std::vector< MonitorElement * > depth
std::vector< std::string > problemnames_
EtaPhiHists * ProblemCellsByDepth
void setup(DQMStore::IBooker &m_dbe, std::string Name, std::string Units="")
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:273
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::string subdir_
tuple cout
Definition: gather_cfg.py:145
bool HcalHotCellClient::test_enabled ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 288 of file HcalHotCellClient.cc.

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

Reimplemented from HcalBaseDQClient.

Definition at line 291 of file HcalHotCellClient.cc.

References HcalObjRepresent::CalcIeta(), gather_cfg::cout, ztail::d, HcalBaseDQClient::debug_, EtaPhiHists::depth, HcalBarrel, HcalChannelStatus::HcalCellHot, HcalEndcap, HcalForward, HcalOuter, isHB(), isHE(), isHF(), HcalBaseDQClient::minerrorrate_, HcalBaseDQClient::minevents_, nevts_, HcalBaseDQClient::ProblemCellsByDepth, HcalBaseDQClient::topo_, and HcalTopology::validDetId().

292 {
293  // This gets called by HcalMonitorClient
294  if (nevts_<minevents_) return; // not enough events to make judgment; don't create new status file
295 
296  float binval;
297  int ieta=0;
298  int iphi=0;
299  int etabins=0;
300  int phibins=0;
301 
302  int subdet=0;
303  if (debug_>1)
304  {
305  std::cout <<"<HcalHotCellClient> Summary of Hot Cells in Run: "<<std::endl;
306  std::cout <<"(Error rate must be >= "<<minerrorrate_*100.<<"% )"<<std::endl;
307  }
308  for (int d=0;d<4;++d)
309  {
310  etabins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsX();
311  phibins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsY();
312  for (int hist_eta=0;hist_eta<etabins;++hist_eta)
313  {
314  ieta=CalcIeta(hist_eta,d+1);
315  if (ieta==-9999) continue;
316  for (int hist_phi=0;hist_phi<phibins;++hist_phi)
317  {
318  iphi=hist_phi+1;
319 
320  // ProblemCells have already been normalized
321  binval=ProblemCellsByDepth->depth[d]->getBinContent(hist_eta+1,hist_phi+1);
322 
323  // Set subdetector labels for output
324  if (d<2)
325  {
326  if (isHB(hist_eta,d+1))
327  subdet=HcalBarrel;
328  else if (isHE(hist_eta,d+1))
329  subdet=HcalEndcap;
330  else if (isHF(hist_eta,d+1))
331  subdet=HcalForward;
332  }
333  else if (d==2)
334  subdet=HcalEndcap;
335  else if (d==3)
336  subdet=HcalOuter;
337  // Set correct depth label
338 
339  HcalDetId myid((HcalSubdetector)(subdet), ieta, iphi, d+1);
340  // Need this to keep from flagging non-existent HE/HF cells
341  if (!(topo_->validDetId((HcalSubdetector)(subdet), ieta, iphi, d+1))) continue;
342 
343  int hotcell=0;
344  if (binval>minerrorrate_)
345  hotcell=1;
346  if (hotcell==1 && debug_>0)
347  std::cout <<"Hot Cell : subdetector = "<<subdet<<" (eta,phi,depth) = ("<<ieta<<", "<<iphi<<", "<<d+1<<"): "<<binval*100.<<"%"<<std::endl;
348 
349  // DetID not found in quality list; add it. (This shouldn't happen!)
350  if (myqual.find(myid)==myqual.end())
351  {
352  myqual[myid]=(hotcell<<HcalChannelStatus::HcalCellHot); //
353  }
354  else
355  {
356  int mask=(1<<HcalChannelStatus::HcalCellHot);
357  // hot cell found; 'or' the hot cell mask with existing ID
358  if (hotcell==1)
359  myqual[myid] |=mask;
360  // cell is not found, 'and' the inverse of the mask with the existing ID.
361  // Does this work correctly? I think so, but need to verify.
362  // Also, do we want to allow the client to turn off hot cell masks, or only add them?
363  else
364  myqual[myid] &=~mask;
365  }
366  } // for (int hist_phi=1;hist_phi<=phibins;++hist_phi)
367  } // for (int hist_eta=1;hist_eta<=etabins;++hist_eta)
368  } // for (int d=0;d<4;++d)
369 
370 
371 } //void HcalHotCellClient::updateChannelStatus
bool validDetId(HcalSubdetector subdet, int ieta, int iphi, int depth) const
const HcalTopology * topo_
bool isHE(int etabin, int depth)
tuple d
Definition: ztail.py:151
std::vector< MonitorElement * > depth
int CalcIeta(int subdet, int eta, int depth)
EtaPhiHists * ProblemCellsByDepth
HcalSubdetector
Definition: HcalAssistant.h:31
bool isHB(int etabin, int depth)
bool isHF(int etabin, int depth)
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

bool HcalHotCellClient::doProblemCellSetup_
private

Definition at line 38 of file HcalHotCellClient.h.

Referenced by analyze(), HcalHotCellClient(), and setupProblemCells().

int HcalHotCellClient::nevts_
private

Definition at line 35 of file HcalHotCellClient.h.

Referenced by beginRun(), and updateChannelStatus().