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

#include <HcalRecHitClient.h>

Inheritance diagram for HcalRecHitClient:
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)
 
 HcalRecHitClient ()
 Constructors. More...
 
 HcalRecHitClient (std::string myname)
 
 HcalRecHitClient (std::string myname, const edm::ParameterSet &ps)
 
void setup (void)
 
bool test_enabled (void)
 
void updateChannelStatus (std::map< HcalDetId, unsigned int > &myqual)
 
 ~HcalRecHitClient ()
 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

EtaPhiHistsmeEnergyByDepth
 
EtaPhiHistsmeEnergyThreshByDepth
 
MonitorElementmeHBEnergy_1D
 
MonitorElementmeHBEnergyRMS_1D
 
MonitorElementmeHBEnergyRMSThresh_1D
 
MonitorElementmeHBEnergyThresh_1D
 
MonitorElementmeHEEnergy_1D
 
MonitorElementmeHEEnergyRMS_1D
 
MonitorElementmeHEEnergyRMSThresh_1D
 
MonitorElementmeHEEnergyThresh_1D
 
MonitorElementmeHFEnergy_1D
 
MonitorElementmeHFEnergyRMS_1D
 
MonitorElementmeHFEnergyRMSThresh_1D
 
MonitorElementmeHFEnergyThresh_1D
 
MonitorElementmeHOEnergy_1D
 
MonitorElementmeHOEnergyRMS_1D
 
MonitorElementmeHOEnergyRMSThresh_1D
 
MonitorElementmeHOEnergyThresh_1D
 
EtaPhiHistsmeSqrtSumEnergy2ByDepth
 
EtaPhiHistsmeSqrtSumEnergy2ThreshByDepth
 
EtaPhiHistsmeTimeByDepth
 
EtaPhiHistsmeTimeThreshByDepth
 
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 10 of file HcalRecHitClient.h.

Constructor & Destructor Documentation

HcalRecHitClient::HcalRecHitClient ( )
inline

Constructors.

Definition at line 15 of file HcalRecHitClient.h.

References HcalBaseDQClient::name_.

15 {name_="";};
HcalRecHitClient::HcalRecHitClient ( std::string  myname)

Definition at line 20 of file HcalRecHitClient.cc.

References HcalBaseDQClient::name_.

21 {
22  name_=myname;
23 }
HcalRecHitClient::HcalRecHitClient ( std::string  myname,
const edm::ParameterSet ps 
)

Definition at line 25 of file HcalRecHitClient.cc.

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

26 {
27  name_=myname;
28  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
29  debug_ = ps.getUntrackedParameter<int>("debug",0);
30  prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
31  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
32  prefixME_.append("/");
33  subdir_ = ps.getUntrackedParameter<std::string>("RecHitFolder","RecHitMonitor_Hcal/"); // RecHitMonitor_Hcal
34  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
35  subdir_.append("/");
36  subdir_=prefixME_+subdir_;
37 
38  validHtmlOutput_ = ps.getUntrackedParameter<bool>("RecHit_validHtmlOutput",true);
39  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
40  badChannelStatusMask_ = ps.getUntrackedParameter<int>("RecHit_BadChannelStatusMask",
41  ps.getUntrackedParameter<int>("BadChannelStatusMask",
42  0)); // identify channel status values to mask
43 
44  minerrorrate_ = ps.getUntrackedParameter<double>("RecHit_minerrorrate",
45  ps.getUntrackedParameter<double>("minerrorrate",0.01));
46  minevents_ = ps.getUntrackedParameter<int>("RecHit_minevents",
47  ps.getUntrackedParameter<int>("minevents",1));
48  enoughevents_=false;
49  Online_ = ps.getUntrackedParameter<bool>("online",false);
50 
51  ProblemCells=0;
53 }
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * ProblemCells
EtaPhiHists * ProblemCellsByDepth
std::string subdir_
std::string prefixME_
HcalRecHitClient::~HcalRecHitClient ( )

Destructor.

Definition at line 504 of file HcalRecHitClient.cc.

505 {}

Member Function Documentation

void HcalRecHitClient::analyze ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 55 of file HcalRecHitClient.cc.

References HcalObjRepresent::CalcIeta(), calculateProblems(), HcalBaseDQClient::cloneME_, gather_cfg::cout, HcalBaseDQClient::debug_, EtaPhiHists::depth, HcalBaseDQClient::dqmStore_, eta(), MonitorElement::Fill(), HcalObjRepresent::FillUnphysicalHEHFBins(), DQMStore::get(), HcalBarrel, HcalEndcap, HcalEtaPhiHistNames(), HcalForward, HcalOuter, i, isHB(), isHE(), isHF(), isHO(), meEnergyByDepth, meEnergyThreshByDepth, meHBEnergy_1D, meHBEnergyRMS_1D, meHBEnergyRMSThresh_1D, meHBEnergyThresh_1D, meHEEnergy_1D, meHEEnergyRMS_1D, meHEEnergyRMSThresh_1D, meHEEnergyThresh_1D, meHFEnergy_1D, meHFEnergyRMS_1D, meHFEnergyRMSThresh_1D, meHFEnergyThresh_1D, meHOEnergy_1D, meHOEnergyRMS_1D, meHOEnergyRMSThresh_1D, meHOEnergyThresh_1D, meTimeByDepth, meTimeThreshByDepth, HcalBaseDQClient::name(), phi, funct::pow(), MonitorElement::Reset(), RMS, alignCSCRings::s, mathSSE::sqrt(), HcalBaseDQClient::subdir_, and validDetId().

Referenced by endRun().

56 {
57  if (debug_>2) std::cout <<"\tHcalRecHitClient::analyze()"<<std::endl;
58 
59  TH2F* OccupancyByDepth[4];
60  TH2F* SumEnergyByDepth[4];
61  TH2F* SumTimeByDepth[4];
62  TH2F* SqrtSumEnergy2ByDepth[4];
63 
64  TH2F* OccupancyThreshByDepth[4];
65  TH2F* SumEnergyThreshByDepth[4];
66  TH2F* SumTimeThreshByDepth[4];
67  TH2F* SqrtSumEnergy2ThreshByDepth[4];
68 
69  std::vector<std::string> name = HcalEtaPhiHistNames();
70 
71  MonitorElement* me;
72  bool gotHistos=true;
73 
74  for (int i=0;i<4;++i)
75  {
76  std::string s=subdir_+"Distributions_AllRecHits/"+name[i]+"RecHit Occupancy";
77  me=dqmStore_->get(s.c_str());
78  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
79  OccupancyByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, OccupancyByDepth[i], debug_);
80  s=subdir_+"Distributions_AllRecHits/sumplots/"+name[i]+"RecHit Summed Energy GeV";
81  me=dqmStore_->get(s.c_str());
82  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
83  SumEnergyByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SumEnergyByDepth[i], debug_);
84  s=subdir_+"Distributions_AllRecHits/sumplots/"+name[i]+"RecHit Summed Time nS";
85  me=dqmStore_->get(s.c_str());
86  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
87  SumTimeByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SumTimeByDepth[i], debug_);
88  s=subdir_+"Distributions_AllRecHits/sumplots/"+name[i]+"RecHit Sqrt Summed Energy2 GeV";
89  me=dqmStore_->get(s.c_str());
90  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
91  SqrtSumEnergy2ByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SqrtSumEnergy2ByDepth[i], debug_);
92 
93  // Threshold histograms
94  s=subdir_+"Distributions_PassedMinBias/"+name[i]+"Above Threshold RecHit Occupancy";
95  me=dqmStore_->get(s.c_str());
96  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
97  OccupancyThreshByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, OccupancyThreshByDepth[i], debug_);
98  s=subdir_+"Distributions_PassedMinBias/sumplots/"+name[i]+"Above Threshold RecHit Summed Energy GeV";
99  me=dqmStore_->get(s.c_str());
100  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
101  SumEnergyThreshByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SumEnergyThreshByDepth[i], debug_);
102  s=subdir_+"Distributions_PassedMinBias/sumplots/"+name[i]+"Above Threshold RecHit Summed Time nS";
103  me=dqmStore_->get(s.c_str());
104  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
105  SumTimeThreshByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SumTimeThreshByDepth[i], debug_);
106  s=subdir_+"Distributions_PassedMinBias/sumplots/"+name[i]+"Above Threshold RecHit Sqrt Summed Energy2 GeV";
107  me=dqmStore_->get(s.c_str());
108  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
109  SqrtSumEnergy2ThreshByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SqrtSumEnergy2ThreshByDepth[i], debug_);
110  }
111  if (gotHistos==false)
112  {
113  if (debug_>0) std::cout <<"<HcalRecHitClient::calculateProblems()> Not all histograms could be found; skipping normalization"<<std::endl;
114  return;
115  }
116 
117  // Clear histograms before re-filling
118  meHBEnergy_1D->Reset();
120  meHEEnergy_1D->Reset();
122  meHOEnergy_1D->Reset();
124  meHFEnergy_1D->Reset();
134 
135  for (int mydepth=0;mydepth<4;++mydepth)
136  {
137  for (int eta=0;eta<OccupancyByDepth[mydepth]->GetNbinsX();++eta)
138  {
139  // eta+1=1: ieta = -42
140  // eta+1=13: ieta = -29
141 
142  for (int phi=0;phi<72;++phi)
143  {
144  if (OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1)>0)
145  {
146  // fill 1D plots
147  if (isHB(eta,mydepth+1))
148  {
149  if (validDetId(HcalBarrel, CalcIeta(HcalBarrel, eta, mydepth+1), phi+1, mydepth+1))
150  {
151  meHBEnergy_1D->Fill(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
152  meHBEnergyRMS_1D->Fill(sqrt(pow(SqrtSumEnergy2ByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1)-pow(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)));
153  }
154  }
155  else if (isHE(eta,mydepth+1))
156  {
157  if (validDetId(HcalEndcap, CalcIeta(HcalEndcap, eta, mydepth+1), phi+1, mydepth+1))
158  {
159 
160  meHEEnergy_1D->Fill(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
161  meHEEnergyRMS_1D->Fill(sqrt(pow(SqrtSumEnergy2ByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1)-pow(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)));
162  }
163  }
164  else if (isHO(eta,mydepth+1))
165  {
166  if (validDetId(HcalOuter, CalcIeta(HcalOuter, eta, mydepth+1), phi+1, mydepth+1))
167  {
168  meHOEnergy_1D->Fill(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
169  meHOEnergyRMS_1D->Fill(sqrt(pow(SqrtSumEnergy2ByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1)-pow(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)));
170  }
171  }
172  else if (isHF(eta,mydepth+1))
173  {
174  if (validDetId(HcalForward, CalcIeta(HcalForward, eta, mydepth+1), phi+1, mydepth+1))
175  {
176  meHFEnergy_1D->Fill(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
177  meHFEnergyRMS_1D->Fill(sqrt(pow(SqrtSumEnergy2ByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1)-pow(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)));
178  }
179  }
180  // normalize 2D plots by number of events
181 
182  meEnergyByDepth->depth[mydepth]->setBinContent(eta+1, phi+1, SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
183  meTimeByDepth->depth[mydepth]->setBinContent(eta+1, phi+1, SumTimeByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
184  } // (OccupancyByDepth[mydepth]->GetBinContent(eta+1,phi+1)>0)
185 
186  if (OccupancyThreshByDepth[mydepth]==0) continue;
187  if (OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)>0)
188  {
189  // fill 1D plots
190  if (isHB(eta,mydepth+1))
191  {
192  if (validDetId(HcalBarrel, CalcIeta(HcalBarrel, eta, mydepth+1), phi+1, mydepth+1))
193  {
194  meHBEnergyThresh_1D->Fill(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
195  double RMS=pow(SqrtSumEnergy2ThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1,phi+1)-pow(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1),2);
196  RMS=pow(fabs(RMS),0.5);
198  }
199  }
200  else if (isHE(eta,mydepth+1))
201  {
202  if (validDetId(HcalEndcap, CalcIeta(HcalEndcap, eta, mydepth+1), phi+1, mydepth+1))
203  {
204 
205  meHEEnergyThresh_1D->Fill(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
206  double RMS=pow(SqrtSumEnergy2ThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1,phi+1)-pow(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1),2);
207  RMS=pow(fabs(RMS),0.5);
209  }
210  }
211  else if (isHO(eta,mydepth+1))
212  {
213  if (validDetId(HcalOuter, CalcIeta(HcalOuter, eta, mydepth+1), phi+1, mydepth+1))
214  {
215  meHOEnergyThresh_1D->Fill(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
216  double RMS=pow(SqrtSumEnergy2ThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1,phi+1)-pow(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1),2);
217  RMS=pow(fabs(RMS),0.5);
219  }
220  }
221  else if (isHF(eta,mydepth+1))
222  {
223  if (validDetId(HcalForward, CalcIeta(HcalForward, eta, mydepth+1), phi+1, mydepth+1))
224  {
225  meHFEnergyThresh_1D->Fill(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
226  double RMS=pow(SqrtSumEnergy2ThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1,phi+1)-pow(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1),2);
227  RMS=pow(fabs(RMS),0.5);
229  }
230  }
231  // fill 2D plots
232  meEnergyThreshByDepth->depth[mydepth]->setBinContent(eta+1, phi+1, SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
233  meTimeThreshByDepth->depth[mydepth]->setBinContent(eta+1, phi+1, SumTimeThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
234  }
235  } // for (int phi=0;phi<72;++phi)
236  } // for (int eta=0;eta<OccupancyByDepth->..;++eta)
237  } // for (int mydepth=0;...)
238 
243 
245 }
bool isHO(int etabin, int depth)
MonitorElement * meHFEnergyThresh_1D
int i
Definition: DBlmapReader.cc:9
std::string name()
MonitorElement * meHOEnergyRMS_1D
MonitorElement * meHEEnergyRMS_1D
MonitorElement * meHFEnergyRMS_1D
MonitorElement * meHEEnergyRMSThresh_1D
std::vector< std::string > HcalEtaPhiHistNames()
MonitorElement * meHBEnergyRMS_1D
bool isHE(int etabin, int depth)
T eta() const
EtaPhiHists * meTimeThreshByDepth
MonitorElement * meHFEnergyRMSThresh_1D
void Fill(long long x)
MonitorElement * meHEEnergy_1D
MonitorElement * meHBEnergy_1D
std::vector< MonitorElement * > depth
int CalcIeta(int subdet, int eta, int depth)
MonitorElement * meHOEnergyRMSThresh_1D
T sqrt(T t)
Definition: SSEVec.h:46
EtaPhiHists * meEnergyThreshByDepth
MonitorElement * meHOEnergyThresh_1D
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)
MonitorElement * meHOEnergy_1D
MonitorElement * meHEEnergyThresh_1D
bool isHF(int etabin, int depth)
MonitorElement * meHFEnergy_1D
EtaPhiHists * meEnergyByDepth
std::string subdir_
MonitorElement * meHBEnergyThresh_1D
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
void calculateProblems(void)
EtaPhiHists * meTimeByDepth
tuple cout
Definition: gather_cfg.py:121
MonitorElement * meHBEnergyRMSThresh_1D
void Reset(void)
reset ME (ie. contents, errors, etc)
DQMStore * dqmStore_
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
Definition: DDAxes.h:10
void HcalRecHitClient::beginJob ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 355 of file HcalRecHitClient.cc.

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

356 {
358  if (debug_>0)
359  {
360  std::cout <<"<HcalRecHitClient::beginJob()> Displaying dqmStore directory structure:"<<std::endl;
362  }
363 }
tuple cout
Definition: gather_cfg.py:121
void showDirStructure(void) const
Definition: DQMStore.cc:2761
DQMStore * dqmStore_
void HcalRecHitClient::beginRun ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 366 of file HcalRecHitClient.cc.

References DQMStore::book1D(), DQMStore::book2D(), gather_cfg::cout, HcalBaseDQClient::debug_, EtaPhiHists::depth, HcalBaseDQClient::dqmStore_, MonitorElement::getName(), i, meEnergyByDepth, meEnergyThreshByDepth, meHBEnergy_1D, meHBEnergyRMS_1D, meHBEnergyRMSThresh_1D, meHBEnergyThresh_1D, meHEEnergy_1D, meHEEnergyRMS_1D, meHEEnergyRMSThresh_1D, meHEEnergyThresh_1D, meHFEnergy_1D, meHFEnergyRMS_1D, meHFEnergyRMSThresh_1D, meHFEnergyThresh_1D, meHOEnergy_1D, meHOEnergyRMS_1D, meHOEnergyRMSThresh_1D, meHOEnergyThresh_1D, meTimeByDepth, meTimeThreshByDepth, nevts_, HcalBaseDQClient::ProblemCells, HcalBaseDQClient::ProblemCellsByDepth, HcalBaseDQClient::problemnames_, DQMStore::setCurrentFolder(), EtaPhiHists::setup(), HcalBaseDQClient::subdir_, vdt::x, and detailsBasic3DVector::y.

367 {
368  if (debug_>1) std::cout <<"<HcalRecHitClient::endRun>"<<std::endl;
369 
370  if (!dqmStore_)
371  {
372  if (debug_>0) std::cout <<"<HcalRecHitClient::beginRun> dqmStore does not exist!"<<std::endl;
373  return;
374  }
376  problemnames_.clear();
377  ProblemCells=dqmStore_->book2D(" ProblemRecHits",
378  "Problem RecHit Rate for all HCAL;ieta;iphi",
379  85,-42.5,42.5,
380  72,0.5,72.5);
381  problemnames_.push_back(ProblemCells->getName());
382  if (debug_>1)
383  std::cout << "Tried to create ProblemCells Monitor Element in directory "<<subdir_<<" \t Failed? "<<(ProblemCells==0)<<std::endl;
384  dqmStore_->setCurrentFolder(subdir_+"problem_rechits");
386  ProblemCellsByDepth->setup(dqmStore_," Problem RecHit Rate");
387  for (unsigned int i=0; i<ProblemCellsByDepth->depth.size();++i)
388  problemnames_.push_back(ProblemCellsByDepth->depth[i]->getName());
389 
390  nevts_=0;
391 
392  dqmStore_->setCurrentFolder(subdir_+"Distributions_AllRecHits");
394  meEnergyByDepth->setup(dqmStore_,"RecHit Average Energy","GeV");
395  meTimeByDepth = new EtaPhiHists();
396  meTimeByDepth->setup(dqmStore_,"RecHit Average Time","nS");
397  // set all average times to -1000 by default (so that they don't show up on plots
398  for (unsigned int i=0;i<meTimeByDepth->depth.size();++i)
399  {
400  (meTimeByDepth->depth[i]->getTH2F())->SetMinimum(-150);
401  (meTimeByDepth->depth[i]->getTH2F())->SetMaximum(150);
402  int etabins=(meTimeByDepth->depth[i]->getTH2F())->GetNbinsX();
403  int phibins=(meTimeByDepth->depth[i]->getTH2F())->GetNbinsY();
404  for (int x=1;x<=etabins;++x)
405  for (int y=1;y<=phibins;++y)
406  meTimeByDepth->depth[i]->setBinContent(x,y,-1000);
407  }
408 
409  dqmStore_->setCurrentFolder(subdir_+"Distributions_PassedMinBias");
411  meEnergyThreshByDepth->setup(dqmStore_,"Above Threshold RecHit Average Energy","GeV");
413  meTimeThreshByDepth->setup(dqmStore_,"Above Threshold RecHit Average Time","nS");
414  // set all average times to -1000 by default (so that they don't show up on plots
415  for (unsigned int i=0;i<meTimeThreshByDepth->depth.size();++i)
416  {
417  (meTimeThreshByDepth->depth[i]->getTH2F())->SetMinimum(-150);
418  (meTimeThreshByDepth->depth[i]->getTH2F())->SetMaximum(150);
419  int etabins=(meTimeThreshByDepth->depth[i]->getTH2F())->GetNbinsX();
420  int phibins=(meTimeThreshByDepth->depth[i]->getTH2F())->GetNbinsY();
421  for (int x=1;x<=etabins;++x)
422  for (int y=1;y<=phibins;++y)
423  meTimeThreshByDepth->depth[i]->setBinContent(x,y,-1000);
424  }
425 
426  dqmStore_->setCurrentFolder(subdir_+"Distributions_AllRecHits/rechit_1D_plots/");
427  meHBEnergy_1D=dqmStore_->book1D("HB_energy_1D","HB Average Energy Per RecHit;Energy (GeV)",200,-5,15);
428  meHEEnergy_1D=dqmStore_->book1D("HE_energy_1D","HE Average Energy Per RecHit;Energy (GeV)",200,-5,15);
429  meHOEnergy_1D=dqmStore_->book1D("HO_energy_1D","HO Average Energy Per RecHit;Energy (GeV)",200,-10,20);
430  meHFEnergy_1D=dqmStore_->book1D("HF_energy_1D","HF Average Energy Per RecHit;Energy (GeV)",200,-5,15);
431 
432  meHBEnergyRMS_1D=dqmStore_->book1D("HB_energy_RMS_1D","HB Energy RMS Per RecHit;Energy (GeV)",250,0,5);
433  meHEEnergyRMS_1D=dqmStore_->book1D("HE_energy_RMS_1D","HE Energy RMS Per RecHit;Energy (GeV)",250,0,5);
434  meHOEnergyRMS_1D=dqmStore_->book1D("HO_energy_RMS_1D","HO Energy RMS Per RecHit;Energy (GeV)",250,0,5);
435  meHFEnergyRMS_1D=dqmStore_->book1D("HF_energy_RMS_1D","HF Energy RMS Per RecHit;Energy (GeV)",250,0,5);
436 
437  dqmStore_->setCurrentFolder(subdir_+"Distributions_PassedMinBias/rechit_1D_plots/");
438  meHBEnergyThresh_1D=dqmStore_->book1D("HB_energyThresh_1D","HB Average Energy Per RecHit Above Threshold;Energy (GeV)",200,-5,35);
439  meHEEnergyThresh_1D=dqmStore_->book1D("HE_energyThresh_1D","HE Average Energy Per RecHit Above Threshold;Energy (GeV)",200,-5,35);
440  meHOEnergyThresh_1D=dqmStore_->book1D("HO_energyThresh_1D","HO Average Energy Per RecHit Above Threshold;Energy (GeV)",300,-10,50);
441  meHFEnergyThresh_1D=dqmStore_->book1D("HF_energyThresh_1D","HF Average Energy Per RecHit Above Threshold;Energy (GeV)",200,-5,95);
442 
443  meHBEnergyRMSThresh_1D=dqmStore_->book1D("HB_energy_RMSThresh_1D","HB Energy RMS Per RecHit Above Threshold;Energy (GeV)",200,0,10);
444  meHEEnergyRMSThresh_1D=dqmStore_->book1D("HE_energy_RMSThresh_1D","HE Energy RMS Per RecHit Above Threshold;Energy (GeV)",200,0,10);
445  meHOEnergyRMSThresh_1D=dqmStore_->book1D("HO_energy_RMSThresh_1D","HO Energy RMS Per RecHit Above Threshold;Energy (GeV)",200,0,10);
446  meHFEnergyRMSThresh_1D=dqmStore_->book1D("HF_energy_RMSThresh_1D","HF Energy RMS Per RecHit Above Threshold;Energy (GeV)",200,0,20);
447 }
MonitorElement * meHFEnergyThresh_1D
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
MonitorElement * ProblemCells
MonitorElement * meHOEnergyRMS_1D
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
MonitorElement * meHEEnergyRMS_1D
MonitorElement * meHFEnergyRMS_1D
MonitorElement * meHEEnergyRMSThresh_1D
void setup(DQMStore *&m_dbe, std::string Name, std::string Units="")
MonitorElement * meHBEnergyRMS_1D
EtaPhiHists * meTimeThreshByDepth
MonitorElement * meHFEnergyRMSThresh_1D
MonitorElement * meHEEnergy_1D
MonitorElement * meHBEnergy_1D
std::vector< MonitorElement * > depth
MonitorElement * meHOEnergyRMSThresh_1D
std::vector< std::string > problemnames_
EtaPhiHists * ProblemCellsByDepth
EtaPhiHists * meEnergyThreshByDepth
MonitorElement * meHOEnergyThresh_1D
MonitorElement * meHOEnergy_1D
MonitorElement * meHEEnergyThresh_1D
MonitorElement * meHFEnergy_1D
EtaPhiHists * meEnergyByDepth
std::string subdir_
MonitorElement * meHBEnergyThresh_1D
EtaPhiHists * meTimeByDepth
tuple cout
Definition: gather_cfg.py:121
MonitorElement * meHBEnergyRMSThresh_1D
x
Definition: VDTMath.h:216
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 HcalRecHitClient::calculateProblems ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 247 of file HcalRecHitClient.cc.

References HcalBaseDQClient::badstatusmap, HcalObjRepresent::CalcIeta(), gather_cfg::cout, HcalBaseDQClient::debug_, EtaPhiHists::depth, HcalBaseDQClient::dqmStore_, HcalBaseDQClient::enoughevents_, eta(), MonitorElement::Fill(), HcalObjRepresent::FillUnphysicalHEHFBins(), MonitorElement::getBinContent(), MonitorElement::getTH2F(), HcalBarrel, HcalEmpty, HcalEndcap, HcalEtaPhiHistNames(), HcalForward, HcalOuter, isHB(), isHE(), isHF(), isHO(), min, HcalBaseDQClient::minerrorrate_, HcalBaseDQClient::minevents_, HcalBaseDQClient::name(), phi, HcalBaseDQClient::ProblemCells, HcalBaseDQClient::ProblemCellsByDepth, MonitorElement::Reset(), and MonitorElement::setBinContent().

Referenced by analyze().

248 {
249  if (debug_>2) std::cout <<"\t\tHcalRecHitClient::calculateProblems()"<<std::endl;
250  if(!dqmStore_) return;
251  double totalevents=0;
252  int etabins=0, phibins=0, zside=0;
253  double problemvalue=0;
254  std::vector<std::string> name = HcalEtaPhiHistNames(); // use this to get EtaPhiHistograms that feed problem calculation, once they exist (see analyze function for example usage of HcalEtaPhiHistNames())
255 
256  // Get histograms used in determining rechit problem rate,
257  // and get totalevents from their underflow bins.
258  // No such problem histograms are defined so far.
259 
260  enoughevents_=true;
261 
262  if (totalevents==0)
263  return;
264 
265  // Clear away old problems
266  if (ProblemCells!=0)
267  {
268  ProblemCells->Reset();
269  (ProblemCells->getTH2F())->SetMaximum(1.05);
270  (ProblemCells->getTH2F())->SetMinimum(0.);
271  }
272  for (unsigned int d=0;d<ProblemCellsByDepth->depth.size();++d)
273  {
274  if (ProblemCellsByDepth->depth[d]!=0)
275  {
276  ProblemCellsByDepth->depth[d]->Reset();
277  (ProblemCellsByDepth->depth[d]->getTH2F())->SetMaximum(1.05);
278  (ProblemCellsByDepth->depth[d]->getTH2F())->SetMinimum(0.);
279  }
280  }
281 
282  for (unsigned int d=0;d<ProblemCellsByDepth->depth.size();++d)
283  {
284  if (ProblemCellsByDepth->depth[d]==0) continue;
285 
286  // Get total events from some future histogram
287  //totalevents=DigiPresentByDepth[d]->GetBinContent(0); // get totalevents from each depth, in case they differ
288  if (totalevents==0 || totalevents<minevents_) continue;
289  etabins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsX();
290  phibins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsY();
291  problemvalue=0;
292  for (int eta=0;eta<etabins;++eta)
293  {
294  int ieta=CalcIeta(eta,d+1);
295  if (ieta==-9999) continue;
296  for (int phi=0;phi<phibins;++phi)
297  {
298  problemvalue=0;
299  // Add histograms here when rechit testing decided upon
300  /*if (DigiPresentByDepth[d]!=0 && DigiPresentByDepth[d]->GetBinContent(eta+1,phi+1)>0)
301  problemvalue=totalevents; */
302 
303  if (problemvalue==0) continue;
304  problemvalue/=totalevents; // problem value is a rate; should be between 0 and 1
305  problemvalue = std::min(1.,problemvalue);
306 
307  zside=0;
308  if (isHF(eta,d+1)) // shift ieta by 1 for HF
309  ieta<0 ? zside = -1 : zside = 1;
310 
311  // For problem cells that exceed our allowed rate,
312  // set the values to 999 if the cells are already marked in the status database
313  if (problemvalue>minerrorrate_)
314  {
315  HcalSubdetector subdet=HcalEmpty;
316  if (isHB(eta,d+1))subdet=HcalBarrel;
317  else if (isHE(eta,d+1)) subdet=HcalEndcap;
318  else if (isHF(eta,d+1)) subdet=HcalForward;
319  else if (isHO(eta,d+1)) subdet=HcalOuter;
320  HcalDetId hcalid(subdet, ieta, phi+1, (int)(d+1));
321  if (badstatusmap.find(hcalid)!=badstatusmap.end())
322  problemvalue=999;
323  }
324 
325 
326  ProblemCellsByDepth->depth[d]->setBinContent(eta+1,phi+1,problemvalue);
327  if (ProblemCells!=0) ProblemCells->Fill(ieta+zside,phi+1,problemvalue);
328  } // loop on phi
329  } // loop on eta
330  } // loop on depth
331 
332  if (ProblemCells==0)
333  {
334  if (debug_>0) std::cout <<"<HcalRecHitClient::analyze> ProblemCells histogram does not exist!"<<std::endl;
335  return;
336  }
337 
338  // Normalization of ProblemCell plot, in the case where there are errors in multiple depths
339  etabins=(ProblemCells->getTH2F())->GetNbinsX();
340  phibins=(ProblemCells->getTH2F())->GetNbinsY();
341  for (int eta=0;eta<etabins;++eta)
342  {
343  for (int phi=0;phi<phibins;++phi)
344  {
347  }
348  }
351  return;
352 
353 }
bool isHO(int etabin, int depth)
MonitorElement * ProblemCells
std::string name()
void setBinContent(int binx, double content)
set content of bin (1-D)
std::vector< std::string > HcalEtaPhiHistNames()
#define min(a, b)
Definition: mlp_lapack.h:161
bool isHE(int etabin, int depth)
T eta() const
void Fill(long long x)
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)
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:121
TH2F * getTH2F(void) const
void Reset(void)
reset ME (ie. contents, errors, etc)
DQMStore * dqmStore_
Definition: DDAxes.h:10
void HcalRecHitClient::cleanup ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 456 of file HcalRecHitClient.cc.

456 {}
void HcalRecHitClient::endJob ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 364 of file HcalRecHitClient.cc.

364 {}
void HcalRecHitClient::endRun ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 449 of file HcalRecHitClient.cc.

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

450 {
451  if (debug_>1) std::cout <<"<HcalRecHitClient::endRun>"<<std::endl;
452  analyze();
453 }
tuple cout
Definition: gather_cfg.py:121
bool HcalRecHitClient::hasErrors_Temp ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 458 of file HcalRecHitClient.cc.

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

459 {
460  if (!ProblemCells)
461  {
462  if (debug_>1) std::cout <<"<HcalRecHitClient::hasErrors_Temp> ProblemCells histogram does not exist!"<<std::endl;
463  return false;
464  }
465  int problemcount=0;
466  int ieta=-9999;
467 
468  for (int depth=0;depth<4; ++depth)
469  {
470  int etabins = (ProblemCells->getTH2F())->GetNbinsX();
471  int phibins = (ProblemCells->getTH2F())->GetNbinsY();
472  for (int hist_eta=0;hist_eta<etabins;++hist_eta)
473  {
474  for (int hist_phi=0; hist_phi<phibins;++hist_phi)
475  {
476  ieta=CalcIeta(hist_eta,depth+1);
477  if (ieta==-9999) continue;
478  if (ProblemCellsByDepth->depth[depth]==0)
479  continue;
480  if (ProblemCellsByDepth->depth[depth]->getBinContent(hist_eta,hist_phi)>minerrorrate_)
481  ++problemcount;
482  } // for (int hist_phi=1;...)
483  } // for (int hist_eta=1;...)
484  } // for (int depth=0;...)
485 
486  if (problemcount>0) return true;
487  return false;
488 }
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 HcalRecHitClient::hasOther_Temp ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 491 of file HcalRecHitClient.cc.

491 {return false;}
bool HcalRecHitClient::hasWarnings_Temp ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 490 of file HcalRecHitClient.cc.

490 {return false;}
void HcalRecHitClient::setup ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 455 of file HcalRecHitClient.cc.

455 {}
bool HcalRecHitClient::test_enabled ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 492 of file HcalRecHitClient.cc.

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

Reimplemented from HcalBaseDQClient.

Definition at line 496 of file HcalRecHitClient.cc.

497 {
498  // rechit quality not used to update channel status yet; see dead cell client for example
499 
500 
501 
502 } //void HcalRecHitClient::updateChannelStatus

Member Data Documentation

EtaPhiHists* HcalRecHitClient::meEnergyByDepth
private

Definition at line 40 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

EtaPhiHists* HcalRecHitClient::meEnergyThreshByDepth
private

Definition at line 41 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

MonitorElement* HcalRecHitClient::meHBEnergy_1D
private

Definition at line 47 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

MonitorElement* HcalRecHitClient::meHBEnergyRMS_1D
private

Definition at line 52 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

MonitorElement* HcalRecHitClient::meHBEnergyRMSThresh_1D
private

Definition at line 62 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

MonitorElement* HcalRecHitClient::meHBEnergyThresh_1D
private

Definition at line 57 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

MonitorElement* HcalRecHitClient::meHEEnergy_1D
private

Definition at line 48 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

MonitorElement* HcalRecHitClient::meHEEnergyRMS_1D
private

Definition at line 53 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

MonitorElement* HcalRecHitClient::meHEEnergyRMSThresh_1D
private

Definition at line 63 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

MonitorElement* HcalRecHitClient::meHEEnergyThresh_1D
private

Definition at line 58 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

MonitorElement* HcalRecHitClient::meHFEnergy_1D
private

Definition at line 50 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

MonitorElement* HcalRecHitClient::meHFEnergyRMS_1D
private

Definition at line 55 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

MonitorElement* HcalRecHitClient::meHFEnergyRMSThresh_1D
private

Definition at line 65 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

MonitorElement* HcalRecHitClient::meHFEnergyThresh_1D
private

Definition at line 60 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

MonitorElement* HcalRecHitClient::meHOEnergy_1D
private

Definition at line 49 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

MonitorElement* HcalRecHitClient::meHOEnergyRMS_1D
private

Definition at line 54 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

MonitorElement* HcalRecHitClient::meHOEnergyRMSThresh_1D
private

Definition at line 64 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

MonitorElement* HcalRecHitClient::meHOEnergyThresh_1D
private

Definition at line 59 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

EtaPhiHists* HcalRecHitClient::meSqrtSumEnergy2ByDepth
private

Definition at line 44 of file HcalRecHitClient.h.

EtaPhiHists* HcalRecHitClient::meSqrtSumEnergy2ThreshByDepth
private

Definition at line 45 of file HcalRecHitClient.h.

EtaPhiHists* HcalRecHitClient::meTimeByDepth
private

Definition at line 42 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

EtaPhiHists* HcalRecHitClient::meTimeThreshByDepth
private

Definition at line 43 of file HcalRecHitClient.h.

Referenced by analyze(), and beginRun().

int HcalRecHitClient::nevts_
private

Definition at line 38 of file HcalRecHitClient.h.

Referenced by beginRun().