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

#include <HcalCoarsePedestalMonitor.h>

Inheritance diagram for HcalCoarsePedestalMonitor:
HcalBaseDQMonitor edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
void beginRun (const edm::Run &run, const edm::EventSetup &c)
 
void cleanup ()
 
void endJob ()
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
void endRun (const edm::Run &run, const edm::EventSetup &c)
 
 HcalCoarsePedestalMonitor (const edm::ParameterSet &ps)
 
void processEvent (const HBHEDigiCollection &hbhe, const HODigiCollection &ho, const HFDigiCollection &hf, const HcalUnpackerReport &report)
 
void reset ()
 
void setup ()
 
 ~HcalCoarsePedestalMonitor ()
 
- Public Member Functions inherited from HcalBaseDQMonitor
 HcalBaseDQMonitor (const edm::ParameterSet &ps)
 
 HcalBaseDQMonitor ()
 
virtual ~HcalBaseDQMonitor ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

void fill_Nevents ()
 Methods, variables accessible only within class code. More...
 
void zeroCounters ()
 

Private Attributes

double ADCDiffThresh_
 
EtaPhiHists CoarsePedestalsOccByDepth
 
EtaPhiHists CoarsePedestalsSumByDepth
 
edm::InputTag digiLabel_
 
bool excludeHORing2_
 
int minEvents_
 
int pedestalocc_ [85][72][4]
 
double pedestalsum_ [85][72][4]
 
edm::EDGetTokenT
< HBHEDigiCollection
tok_hbhe_
 
edm::EDGetTokenT
< HFDigiCollection
tok_hf_
 
edm::EDGetTokenT
< HODigiCollection
tok_ho_
 
edm::EDGetTokenT
< HcalUnpackerReport
tok_report_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from HcalBaseDQMonitor
virtual void beginJob ()
 
void getLogicalMap (const edm::EventSetup &c)
 
bool IsAllowedCalibType ()
 
bool LumiInOrder (int lumisec)
 
void SetupEtaPhiHists (EtaPhiHists &hh, std::string Name, std::string Units)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from HcalBaseDQMonitor
std::vector< int > AllowedCalibTypes_
 
int badChannelStatusMask_
 
int currentLS
 
int currenttype_
 
DQMStoredbe_
 
int debug_
 
bool enableCleanup_
 
bool eventAllowed_
 
bool HBpresent_
 
bool HEpresent_
 
bool HFpresent_
 
bool HOpresent_
 
int ievt_
 
std::map< unsigned int, int > KnownBadCells_
 
int levt_
 
HcalLogicalMaplogicalMap_
 
bool makeDiagnostics_
 
MonitorElementmeIevt_
 
MonitorElementmeLevt_
 
bool mergeRuns_
 
MonitorElementmeTevt_
 
MonitorElementmeTevtHist_
 
bool needLogicalMap_
 
int NLumiBlocks_
 
bool Online_
 
std::string prefixME_
 
MonitorElementProblemsCurrentLB
 
MonitorElementProblemsVsLB
 
MonitorElementProblemsVsLB_HB
 
MonitorElementProblemsVsLB_HBHEHF
 
MonitorElementProblemsVsLB_HE
 
MonitorElementProblemsVsLB_HF
 
MonitorElementProblemsVsLB_HO
 
bool skipOutOfOrderLS_
 
std::string subdir_
 
int tevt_
 

Detailed Description

Author
J. Temple - Univ. of Maryland

Definition at line 16 of file HcalCoarsePedestalMonitor.h.

Constructor & Destructor Documentation

HcalCoarsePedestalMonitor::HcalCoarsePedestalMonitor ( const edm::ParameterSet ps)

Definition at line 14 of file HcalCoarsePedestalMonitor.cc.

References ADCDiffThresh_, HcalBaseDQMonitor::AllowedCalibTypes_, HcalBaseDQMonitor::debug_, digiLabel_, HcalBaseDQMonitor::enableCleanup_, excludeHORing2_, edm::ParameterSet::getUntrackedParameter(), HcalBaseDQMonitor::makeDiagnostics_, HcalBaseDQMonitor::mergeRuns_, minEvents_, HcalBaseDQMonitor::NLumiBlocks_, HcalBaseDQMonitor::Online_, HcalBaseDQMonitor::prefixME_, HcalBaseDQMonitor::skipOutOfOrderLS_, AlCaHLTBitMon_QueryRunRegistry::string, HcalBaseDQMonitor::subdir_, tok_hbhe_, tok_hf_, tok_ho_, and tok_report_.

15 {
16  Online_ = ps.getUntrackedParameter<bool>("online",false);
17  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns",false);
18  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
19  debug_ = ps.getUntrackedParameter<int>("debug",0);
20  prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
21  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
22  prefixME_.append("/");
23  subdir_ = ps.getUntrackedParameter<std::string>("TaskFolder","CoarsePedestalMonitor_Hcal");
24  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
25  subdir_.append("/");
26  subdir_=prefixME_+subdir_;
27  AllowedCalibTypes_ = ps.getUntrackedParameter<std::vector<int> > ("AllowedCalibTypes");
28  skipOutOfOrderLS_ = ps.getUntrackedParameter<bool>("skipOutOfOrderLS",true);
29  NLumiBlocks_ = ps.getUntrackedParameter<int>("NLumiBlocks",4000);
30  makeDiagnostics_ = ps.getUntrackedParameter<bool>("makeDiagnostics",false);
32  ADCDiffThresh_ = ps.getUntrackedParameter<double>("ADCDiffThresh",1.);
33  minEvents_ = ps.getUntrackedParameter<int>("minEvents",100); // minimum number of events needed before histograms are filled
34  excludeHORing2_ = ps.getUntrackedParameter<bool>("excludeHORing2",false);
35 
36  tok_hbhe_ = consumes<HBHEDigiCollection>(digiLabel_);
37  tok_ho_ = consumes<HODigiCollection>(digiLabel_);
38  tok_hf_ = consumes<HFDigiCollection>(digiLabel_);
39  tok_report_ = consumes<HcalUnpackerReport>(digiLabel_);
40 
41 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< int > AllowedCalibTypes_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
edm::EDGetTokenT< HcalUnpackerReport > tok_report_
edm::EDGetTokenT< HODigiCollection > tok_ho_
HcalCoarsePedestalMonitor::~HcalCoarsePedestalMonitor ( )

Definition at line 45 of file HcalCoarsePedestalMonitor.cc.

45 {}

Member Function Documentation

void HcalCoarsePedestalMonitor::analyze ( const edm::Event e,
const edm::EventSetup c 
)
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 125 of file HcalCoarsePedestalMonitor.cc.

References HcalBaseDQMonitor::analyze(), gather_cfg::cout, HcalBaseDQMonitor::debug_, digiLabel_, edm::Event::getByToken(), HcalBaseDQMonitor::ievt_, HcalBaseDQMonitor::IsAllowedCalibType(), HcalBaseDQMonitor::LumiInOrder(), edm::EventBase::luminosityBlock(), processEvent(), zeeHLT_cff::report, tok_hbhe_, tok_hf_, tok_ho_, and tok_report_.

126 {
127  if (!IsAllowedCalibType()) return;
128  if (LumiInOrder(e.luminosityBlock())==false) return;
129 
130 
131  // try to get digis
136 
137  if (!(e.getByToken(tok_hbhe_,hbhe_digi)))
138  {
139  edm::LogWarning("HcalCoarsePedestalMonitor")<< digiLabel_<<" hbhe_digi not available";
140  return;
141  }
142 
143  if (!(e.getByToken(tok_hf_,hf_digi)))
144  {
145  edm::LogWarning("HcalCoarsePedestalMonitor")<< digiLabel_<<" hf_digi not available";
146  return;
147  }
148  if (!(e.getByToken(tok_ho_,ho_digi)))
149  {
150  edm::LogWarning("HcalCoarsePedestalMonitor")<< digiLabel_<<" ho_digi not available";
151  return;
152  }
153  if (!(e.getByToken(tok_report_,report)))
154  {
155  edm::LogWarning("HcalCoarsePedestalMonitor")<< digiLabel_<<" unpacker report not available";
156  return;
157  }
158 
159  // all objects grabbed; event is good
160  if (debug_>1) std::cout <<"\t<HcalCoarsePedestalMonitor::analyze> Processing good event! event # = "<<ievt_<<std::endl;
161 
162  HcalBaseDQMonitor::analyze(e,s); // base class increments ievt_, etc. counters
163 
164  // Digi collection was grabbed successfully; process the Event
165  processEvent(*hbhe_digi, *ho_digi, *hf_digi, *report);
166 
167 } //void HcalCoarsePedestalMonitor::analyze(...)
bool LumiInOrder(int lumisec)
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
edm::EDGetTokenT< HFDigiCollection > tok_hf_
void processEvent(const HBHEDigiCollection &hbhe, const HODigiCollection &ho, const HFDigiCollection &hf, const HcalUnpackerReport &report)
tuple report
Definition: zeeHLT_cff.py:9
tuple cout
Definition: gather_cfg.py:121
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
edm::EDGetTokenT< HcalUnpackerReport > tok_report_
edm::EDGetTokenT< HODigiCollection > tok_ho_
void HcalCoarsePedestalMonitor::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 293 of file HcalCoarsePedestalMonitor.cc.

References HcalBaseDQMonitor::beginLuminosityBlock(), HcalBaseDQMonitor::ProblemsCurrentLB, and MonitorElement::Reset().

295 {
298 }
MonitorElement * ProblemsCurrentLB
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void Reset(void)
reset ME (ie. contents, errors, etc)
void HcalCoarsePedestalMonitor::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 115 of file HcalCoarsePedestalMonitor.cc.

References HcalBaseDQMonitor::beginRun(), HcalBaseDQMonitor::mergeRuns_, reset(), setup(), and HcalBaseDQMonitor::tevt_.

116 {
118  if (mergeRuns_ && tevt_>0) return; // don't reset counters if merging runs
119 
120  if (tevt_==0) this->setup(); // create all histograms; not necessary if merging runs together
121  if (mergeRuns_==false) this->reset(); // call reset at start of all runs
122 } // void HcalCoarsePedestalMonitor::beginRun()
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
void HcalCoarsePedestalMonitor::cleanup ( void  )
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 49 of file HcalCoarsePedestalMonitor.cc.

References gather_cfg::cout, HcalBaseDQMonitor::dbe_, HcalBaseDQMonitor::debug_, HcalBaseDQMonitor::enableCleanup_, DQMStore::removeContents(), DQMStore::setCurrentFolder(), and HcalBaseDQMonitor::subdir_.

Referenced by endJob().

50 {
51  // Need to add code to clear out subfolders as well?
52  if (debug_>0) std::cout <<"HcalCoarsePedestalMonitor::cleanup()"<<std::endl;
53  if (!enableCleanup_) return;
54  if (dbe_)
55  {
56  // removeContents doesn't remove subdirectories
59  dbe_->setCurrentFolder(subdir_+"CoarsePedestal_parameters");
61  dbe_->setCurrentFolder(subdir_+"LSvalues");
63  } // if(dbe_)
64 
65 } // void HcalCoarsePedestalMonitor::cleanup();
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
Definition: DQMStore.cc:3080
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
void HcalCoarsePedestalMonitor::endJob ( void  )
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 73 of file HcalCoarsePedestalMonitor.cc.

References cleanup(), gather_cfg::cout, HcalBaseDQMonitor::debug_, and HcalBaseDQMonitor::enableCleanup_.

74 {
75  if (debug_>0) std::cout <<"HcalCoarsePedestalMonitor::endJob()"<<std::endl;
76  if (enableCleanup_) cleanup(); // when do we force cleanup?
77 }
tuple cout
Definition: gather_cfg.py:121
void HcalCoarsePedestalMonitor::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 300 of file HcalCoarsePedestalMonitor.cc.

References fill_Nevents(), HcalBaseDQMonitor::LumiInOrder(), and edm::LuminosityBlockBase::luminosityBlock().

302 {
303  if (LumiInOrder(lumiSeg.luminosityBlock())==false) return;
304  fill_Nevents();
305  return;
306 }
bool LumiInOrder(int lumisec)
LuminosityBlockNumber_t luminosityBlock() const
void fill_Nevents()
Methods, variables accessible only within class code.
void HcalCoarsePedestalMonitor::endRun ( const edm::Run run,
const edm::EventSetup c 
)
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 68 of file HcalCoarsePedestalMonitor.cc.

69 {
70  // Anything to do here?
71 }
void HcalCoarsePedestalMonitor::fill_Nevents ( )
private

Methods, variables accessible only within class code.

Definition at line 307 of file HcalCoarsePedestalMonitor.cc.

References funct::abs(), CalcEtaBin(), CoarsePedestalsOccByDepth, CoarsePedestalsSumByDepth, EtaPhiHists::depth, eta(), HcalObjRepresent::FillUnphysicalHEHFBins(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, i, HcalBaseDQMonitor::ievt_, minEvents_, pedestalocc_, pedestalsum_, phi, validDetId(), and ecaldqm::zside().

Referenced by endLuminosityBlock().

308 {
309 
310  // require minimum number of events before processing
311  if (ievt_<minEvents_)
312  return;
313 
314 
315  // Set underflow bin to the number of pedestal events processed
316  // (Assume that number of ped events is the same for all channels/subdetectors)
317  for (unsigned int i=0;i<CoarsePedestalsSumByDepth.depth.size();++i)
318  CoarsePedestalsSumByDepth.depth[i]->setBinContent(0,0,ievt_);
319  for (unsigned int i=0;i<CoarsePedestalsOccByDepth.depth.size();++i)
320  CoarsePedestalsOccByDepth.depth[i]->setBinContent(0,0,ievt_);
321 
322 
323  int iphi=-1, ieta=-99, idepth=0, calcEta=-99;
324  // Loop over all depths, eta, phi
325  for (int d=0;d<4;++d)
326  {
327  idepth=d+1;
328  for (int phi=0;phi<72;++phi)
329  {
330  iphi=phi+1; // actual iphi value
331  for (int eta=0;eta<83;++eta)
332  {
333  ieta=eta-41; // actual ieta value;
334  if (validDetId(HcalBarrel, ieta, iphi, idepth))
335  {
336  calcEta = CalcEtaBin(HcalBarrel,ieta,idepth);
337  CoarsePedestalsSumByDepth.depth[d]->Fill(ieta,iphi,pedestalsum_[calcEta][phi][d]);
338  CoarsePedestalsOccByDepth.depth[d]->Fill(ieta,iphi,pedestalocc_[calcEta][phi][d]);
339  }
340  if (validDetId(HcalEndcap, ieta, iphi, idepth))
341  {
342  calcEta = CalcEtaBin(HcalEndcap,ieta,idepth);
343  CoarsePedestalsSumByDepth.depth[d]->Fill(ieta,iphi,pedestalsum_[calcEta][phi][d]);
344  CoarsePedestalsOccByDepth.depth[d]->Fill(ieta,iphi,pedestalocc_[calcEta][phi][d]);
345  }
346  if (validDetId(HcalOuter, ieta, iphi, idepth))
347  {
348  calcEta = CalcEtaBin(HcalOuter,ieta,idepth);
349  CoarsePedestalsSumByDepth.depth[d]->Fill(ieta,iphi,pedestalsum_[calcEta][phi][d]);
350  CoarsePedestalsOccByDepth.depth[d]->Fill(ieta,iphi,pedestalocc_[calcEta][phi][d]);
351  }
352  if (validDetId(HcalForward, ieta, iphi, idepth))
353  {
354  calcEta = CalcEtaBin(HcalBarrel,ieta,idepth);
355  int zside=ieta/abs(ieta);
356  CoarsePedestalsSumByDepth.depth[d]->Fill(ieta+zside,iphi,pedestalsum_[calcEta][phi][d]);
357  CoarsePedestalsOccByDepth.depth[d]->Fill(ieta+zside,iphi,pedestalocc_[calcEta][phi][d]);
358  }
359  }
360  }
361  }
362  // Fill unphysical bins
365 
366  return;
367 } // void HcalCoarsePedestalMonitor::fill_Nevents()
int i
Definition: DBlmapReader.cc:9
int zside(DetId const &)
T eta() const
std::vector< MonitorElement * > depth
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
int CalcEtaBin(int subdet, int ieta, int depth)
bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
Definition: DDAxes.h:10
void HcalCoarsePedestalMonitor::processEvent ( const HBHEDigiCollection hbhe,
const HODigiCollection ho,
const HFDigiCollection hf,
const HcalUnpackerReport report 
)

Definition at line 170 of file HcalCoarsePedestalMonitor.cc.

References funct::abs(), HcalQIESample::adc(), HcalUnpackerReport::badQualityDigis(), edm::SortedCollection< T, SORT >::begin(), CalcEtaBin(), gather_cfg::cout, HcalBaseDQMonitor::dbe_, HcalBaseDQMonitor::debug_, HcalDetId::depth(), edm::SortedCollection< T, SORT >::end(), excludeHORing2_, HcalBaseDQMonitor::HBpresent_, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HcalBaseDQMonitor::HEpresent_, HcalBaseDQMonitor::HFpresent_, HcalBaseDQMonitor::HOpresent_, i, HBHEDataFrame::id(), HFDataFrame::id(), HODataFrame::id(), HcalDetId::ieta(), HcalDetId::iphi(), isSiPM(), j, pedestalocc_, pedestalsum_, HFDataFrame::sample(), HBHEDataFrame::sample(), HODataFrame::sample(), HBHEDataFrame::size(), HFDataFrame::size(), HODataFrame::size(), edm::SortedCollection< T, SORT >::size(), HcalDetId::subdet(), and relativeConstraints::value.

Referenced by analyze().

174 {
175  if(!dbe_)
176  {
177  if(debug_)
178  std::cout <<"HcalCoarsePedestalMonitor::processEvent DQMStore not instantiated!!!"<<std::endl;
179  return;
180  }
181 
182  // Skip events in which minimal good digis found -- still getting some strange (calib?) events through DQM
183 
184  unsigned int allgooddigis= hbhe.size()+ho.size()+hf.size();
185  // bad threshold: ignore events in which bad outnumber good by more than 100:1
186  // (one RBX in HBHE seems to send valid data occasionally even on QIE resets, which is why we can't just require allgooddigis==0 when looking for events to skip)
187  if ((allgooddigis==0) ||
188  (1.*report.badQualityDigis()>100*allgooddigis))
189  {
190  return;
191  }
192 
194 
195  unsigned int digisize=0;
196  int depth=0, iphi=0, ieta=0, binEta=-9999;
197 
198  double value=0;
199 
200  for (HBHEDigiCollection::const_iterator j=hbhe.begin(); j!=hbhe.end(); ++j)
201  {
202  const HBHEDataFrame digi = (const HBHEDataFrame)(*j);
203  if (digi.id().subdet()==HcalBarrel)
204  {if (!HBpresent_) continue;}
205  else if (digi.id().subdet()==HcalEndcap)
206  {if (!HEpresent_) continue;}
207  else continue;
208  digisize=digi.size();
209  if (digisize<8)
210  continue;
211 
212  depth=digi.id().depth();
213  iphi=digi.id().iphi();
214  ieta=digi.id().ieta();
215 
216  digi.id().subdet()==HcalBarrel ?
217  binEta=CalcEtaBin(HcalBarrel, ieta, depth) :
218  binEta=CalcEtaBin(HcalEndcap, ieta, depth);
219 
220  // 'value' is the average pedestal over the 8 time slices.
221  // In the CoarsePedestal client, we will divide the summed value by Nevents (in underflow bin)
222  // in order to calculate average pedestals.
223  value=0;
224  for (unsigned int i=0;i<8;++i)
225  value+=digi.sample(i).adc()/8.;
226  pedestalsum_[binEta][iphi-1][depth-1]+=value;
227  ++pedestalocc_[binEta][iphi-1][depth-1];
228  }
229 
230 
232  if (HOpresent_)
233  {
234  for (HODigiCollection::const_iterator j=ho.begin(); j!=ho.end(); ++j)
235  {
236  const HODataFrame digi = (const HODataFrame)(*j);
237  digisize=digi.size();
238  if (digisize<8)
239  continue;
240 
241  depth=digi.id().depth();
242  iphi=digi.id().iphi();
243  ieta=digi.id().ieta();
244  binEta=CalcEtaBin(HcalOuter, ieta, depth);
245 
246  // Don't fill cells that are part of HO ring 2 if an exclusion is applied
247  if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,4)==false)
248  continue;
249 
250  // 'value' is the average pedestal over the 8 time slices.
251  // In the CoarsePedestal client, we will divide the summed value by Nevents (in underflow bin)
252  // in order to calculate average pedestals.
253  value=0;
254  for (unsigned int i=0;i<8;++i)
255  value+=digi.sample(i).adc()/8.;
256  pedestalsum_[binEta][iphi-1][depth-1]+=value;
257  ++pedestalocc_[binEta][iphi-1][depth-1];
258  } // for (HODigiCollection)
259  }
260 
262  if (HFpresent_)
263  {
264  for (HFDigiCollection::const_iterator j=hf.begin(); j!=hf.end(); ++j)
265  {
266  const HFDataFrame digi = (const HFDataFrame)(*j);
267  digisize=digi.size();
268  if (digisize<8)
269  continue;
270  digisize=digi.size();
271  if (digisize<8)
272  continue;
273 
274  depth=digi.id().depth();
275  iphi=digi.id().iphi();
276  ieta=digi.id().ieta();
277  binEta=CalcEtaBin(HcalForward, ieta, depth);
278  // 'value' is the average pedestal over the 8 time slices.
279  // In the CoarsePedestal client, we will divide the summed value by Nevents (in underflow bin)
280  // in order to calculate average pedestals.
281  value=0;
282  for (unsigned int i=0;i<8;++i)
283  value+=digi.sample(i).adc()/8.;
284  pedestalsum_[binEta][iphi-1][depth-1]+=value;
285  ++pedestalocc_[binEta][iphi-1][depth-1];
286  } // for (HFDigiCollection)
287  } // if (HFpresent_)
288 
289  return;
290 } // void HcalCoarsePedestalMonitor::processEvent(...)
int i
Definition: DBlmapReader.cc:9
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:30
int adc() const
get the ADC sample
Definition: HcalQIESample.h:22
int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:26
std::vector< HBHEDataFrame >::const_iterator const_iterator
const HcalQIESample & sample(int i) const
access a sample
Definition: HODataFrame.h:40
const HcalDetId & id() const
Definition: HODataFrame.h:23
bool isSiPM(int ieta, int iphi, int depth)
int depth() const
get the tower depth
Definition: HcalDetId.h:40
int ieta() const
get the cell ieta
Definition: HcalDetId.h:36
int size() const
total number of samples in the digi
Definition: HODataFrame.h:27
const HcalQIESample & sample(int i) const
access a sample
Definition: HFDataFrame.h:39
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
const_iterator end() const
int iphi() const
get the cell iphi
Definition: HcalDetId.h:38
int size() const
total number of samples in the digi
Definition: HFDataFrame.h:26
const HcalQIESample & sample(int i) const
access a sample
Definition: HBHEDataFrame.h:39
int CalcEtaBin(int subdet, int ieta, int depth)
int badQualityDigis() const
size_type size() const
const HcalDetId & id() const
Definition: HBHEDataFrame.h:22
tuple cout
Definition: gather_cfg.py:121
const HcalDetId & id() const
Definition: HFDataFrame.h:22
const_iterator begin() const
void HcalCoarsePedestalMonitor::reset ( void  )
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 370 of file HcalCoarsePedestalMonitor.cc.

References CoarsePedestalsOccByDepth, CoarsePedestalsSumByDepth, EtaPhiHists::Reset(), and zeroCounters().

Referenced by beginRun(), and setup().

371 {
372  // then reset the MonitorElements
373  zeroCounters();
376  return;
377 }
void Reset(void)
void HcalCoarsePedestalMonitor::setup ( void  )
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 80 of file HcalCoarsePedestalMonitor.cc.

References ADCDiffThresh_, DQMStore::bookFloat(), DQMStore::bookInt(), CoarsePedestalsOccByDepth, CoarsePedestalsSumByDepth, gather_cfg::cout, HcalBaseDQMonitor::dbe_, HcalBaseDQMonitor::debug_, EtaPhiHists::depth, excludeHORing2_, MonitorElement::Fill(), i, minEvents_, mergeVDriftHistosByStation::name, reset(), DQMStore::setCurrentFolder(), HcalBaseDQMonitor::setup(), HcalBaseDQMonitor::SetupEtaPhiHists(), and HcalBaseDQMonitor::subdir_.

Referenced by beginRun().

81 {
82  // Call base class setup
84  if (!dbe_) return;
85 
86  /******* Set up all histograms ********/
87  if (debug_>1)
88  std::cout <<"<HcalCoarsePedestalMonitor::beginRun> Setting up histograms"<<std::endl;
89 
90  std::ostringstream name;
91  dbe_->setCurrentFolder(subdir_ +"CoarsePedestalSumPlots");
92  SetupEtaPhiHists(CoarsePedestalsSumByDepth,"Coarse Pedestal Summed Map","");
93  SetupEtaPhiHists(CoarsePedestalsOccByDepth,"Coarse Pedestal Occupancy Map","");
94  for (unsigned int i=0;i<CoarsePedestalsSumByDepth.depth.size();++i)
95  (CoarsePedestalsSumByDepth.depth[i]->getTH2F())->SetOption("colz");
96  for (unsigned int i=0;i<CoarsePedestalsOccByDepth.depth.size();++i)
97  (CoarsePedestalsOccByDepth.depth[i]->getTH2F())->SetOption("colz");
98 
99 
100  dbe_->setCurrentFolder(subdir_+"CoarsePedestal_parameters");
101  MonitorElement* ADCDiffThresh = dbe_->bookFloat("ADCdiff_Problem_Threshold");
102  ADCDiffThresh->Fill(ADCDiffThresh_);
103  MonitorElement* minevents = dbe_->bookInt("minEventsNeededForPedestalCalculation");
104  minevents->Fill(minEvents_);
105  MonitorElement* excludeHORing2 = dbe_->bookInt("excludeHORing2");
106  if (excludeHORing2_==true)
107  excludeHORing2->Fill(1);
108  else
109  excludeHORing2->Fill(0);
110 
111  this->reset();
112  return;
113 } // void HcalCoarsePedestalMonitor::setup()
int i
Definition: DBlmapReader.cc:9
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:879
void Fill(long long x)
std::vector< MonitorElement * > depth
void SetupEtaPhiHists(EtaPhiHists &hh, std::string Name, std::string Units)
tuple cout
Definition: gather_cfg.py:121
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:849
virtual void setup(void)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
void HcalCoarsePedestalMonitor::zeroCounters ( )
private

Definition at line 379 of file HcalCoarsePedestalMonitor.cc.

References i, j, gen::k, pedestalocc_, and pedestalsum_.

Referenced by reset().

380 {
381  for (int i=0;i<85;++i)
382  for (int j=0;j<72;++j)
383  for (int k=0;k<4;++k)
384  {
385  pedestalsum_[i][j][k]=0;
386  pedestalocc_[i][j][k]=0;
387  }
388 }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
int k[5][pyjets_maxn]

Member Data Documentation

double HcalCoarsePedestalMonitor::ADCDiffThresh_
private

Definition at line 58 of file HcalCoarsePedestalMonitor.h.

Referenced by HcalCoarsePedestalMonitor(), and setup().

EtaPhiHists HcalCoarsePedestalMonitor::CoarsePedestalsOccByDepth
private

Definition at line 53 of file HcalCoarsePedestalMonitor.h.

Referenced by fill_Nevents(), reset(), and setup().

EtaPhiHists HcalCoarsePedestalMonitor::CoarsePedestalsSumByDepth
private

Definition at line 52 of file HcalCoarsePedestalMonitor.h.

Referenced by fill_Nevents(), reset(), and setup().

edm::InputTag HcalCoarsePedestalMonitor::digiLabel_
private

Definition at line 60 of file HcalCoarsePedestalMonitor.h.

Referenced by analyze(), and HcalCoarsePedestalMonitor().

bool HcalCoarsePedestalMonitor::excludeHORing2_
private

Definition at line 62 of file HcalCoarsePedestalMonitor.h.

Referenced by HcalCoarsePedestalMonitor(), processEvent(), and setup().

int HcalCoarsePedestalMonitor::minEvents_
private

Definition at line 61 of file HcalCoarsePedestalMonitor.h.

Referenced by fill_Nevents(), HcalCoarsePedestalMonitor(), and setup().

int HcalCoarsePedestalMonitor::pedestalocc_[85][72][4]
private

Definition at line 56 of file HcalCoarsePedestalMonitor.h.

Referenced by fill_Nevents(), processEvent(), and zeroCounters().

double HcalCoarsePedestalMonitor::pedestalsum_[85][72][4]
private

Definition at line 55 of file HcalCoarsePedestalMonitor.h.

Referenced by fill_Nevents(), processEvent(), and zeroCounters().

edm::EDGetTokenT<HBHEDigiCollection> HcalCoarsePedestalMonitor::tok_hbhe_
private

Definition at line 64 of file HcalCoarsePedestalMonitor.h.

Referenced by analyze(), and HcalCoarsePedestalMonitor().

edm::EDGetTokenT<HFDigiCollection> HcalCoarsePedestalMonitor::tok_hf_
private

Definition at line 66 of file HcalCoarsePedestalMonitor.h.

Referenced by analyze(), and HcalCoarsePedestalMonitor().

edm::EDGetTokenT<HODigiCollection> HcalCoarsePedestalMonitor::tok_ho_
private

Definition at line 65 of file HcalCoarsePedestalMonitor.h.

Referenced by analyze(), and HcalCoarsePedestalMonitor().

edm::EDGetTokenT<HcalUnpackerReport> HcalCoarsePedestalMonitor::tok_report_
private

Definition at line 67 of file HcalCoarsePedestalMonitor.h.

Referenced by analyze(), and HcalCoarsePedestalMonitor().