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 DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase 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 bookHistograms (DQMStore::IBooker &ib, const edm::Run &run, const edm::EventSetup &c)
 
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 (DQMStore::IBooker &)
 
 ~HcalCoarsePedestalMonitor ()
 
- Public Member Functions inherited from HcalBaseDQMonitor
 HcalBaseDQMonitor (const edm::ParameterSet &ps)
 
 HcalBaseDQMonitor ()
 
virtual ~HcalBaseDQMonitor ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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 (const HcalTopology &)
 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::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from HcalBaseDQMonitor
virtual void cleanup (void)
 
virtual void dqmBeginRun (const edm::Run &run, const edm::EventSetup &c)
 
void getLogicalMap (const edm::EventSetup &c)
 
bool IsAllowedCalibType ()
 
bool LumiInOrder (int lumisec)
 
void SetupEtaPhiHists (DQMStore::IBooker &ib, 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_
 
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 17 of file HcalCoarsePedestalMonitor.h.

Constructor & Destructor Documentation

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

Definition at line 15 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  : HcalBaseDQMonitor(ps) {
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 104 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_.

104  {
106 
107  if (!IsAllowedCalibType()) return;
108  if (LumiInOrder(e.luminosityBlock())==false) return;
109 
110 
111  // try to get digis
116 
117  if (!(e.getByToken(tok_hbhe_,hbhe_digi)))
118  {
119  edm::LogWarning("HcalCoarsePedestalMonitor")<< digiLabel_<<" hbhe_digi not available";
120  return;
121  }
122 
123  if (!(e.getByToken(tok_hf_,hf_digi)))
124  {
125  edm::LogWarning("HcalCoarsePedestalMonitor")<< digiLabel_<<" hf_digi not available";
126  return;
127  }
128  if (!(e.getByToken(tok_ho_,ho_digi)))
129  {
130  edm::LogWarning("HcalCoarsePedestalMonitor")<< digiLabel_<<" ho_digi not available";
131  return;
132  }
133  if (!(e.getByToken(tok_report_,report)))
134  {
135  edm::LogWarning("HcalCoarsePedestalMonitor")<< digiLabel_<<" unpacker report not available";
136  return;
137  }
138 
139  // all objects grabbed; event is good
140  if (debug_>1) std::cout <<"\t<HcalCoarsePedestalMonitor::analyze> Processing good event! event # = "<<ievt_<<std::endl;
141 
142 // HcalBaseDQMonitor::analyze(e,s); // base class increments ievt_, etc. counters
143 
144  // Digi collection was grabbed successfully; process the Event
145  processEvent(*hbhe_digi, *ho_digi, *hf_digi, *report);
146 
147 } //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:462
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:62
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:145
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 265 of file HcalCoarsePedestalMonitor.cc.

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

267 {
270 }
MonitorElement * ProblemsCurrentLB
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void Reset(void)
reset ME (ie. contents, errors, etc)
void HcalCoarsePedestalMonitor::bookHistograms ( DQMStore::IBooker ib,
const edm::Run run,
const edm::EventSetup c 
)
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 94 of file HcalCoarsePedestalMonitor.cc.

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

95 {
97  if (mergeRuns_ && tevt_>0) return; // don't reset counters if merging runs
98 
99  if (tevt_==0) this->setup(ib); // create all histograms; not necessary if merging runs together
100  if (mergeRuns_==false) this->reset(); // call reset at start of all runs
101 } // void HcalCoarsePedestalMonitor::bookHistograms()
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
void setup(DQMStore::IBooker &)
void HcalCoarsePedestalMonitor::endJob ( void  )

Definition at line 53 of file HcalCoarsePedestalMonitor.cc.

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

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

Reimplemented from HcalBaseDQMonitor.

Definition at line 272 of file HcalCoarsePedestalMonitor.cc.

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

273  {
274  if (LumiInOrder(lumiSeg.luminosityBlock())==false) return;
275 
277  c.get<HcalRecNumberingRecord>().get(topo);
278  fill_Nevents(*topo);
279  return;
280 }
bool LumiInOrder(int lumisec)
void fill_Nevents(const HcalTopology &)
Methods, variables accessible only within class code.
LuminosityBlockNumber_t luminosityBlock() const
const T & get() const
Definition: EventSetup.h:56
void HcalCoarsePedestalMonitor::endRun ( const edm::Run run,
const edm::EventSetup c 
)
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 48 of file HcalCoarsePedestalMonitor.cc.

49 {
50  // Anything to do here?
51 }
void HcalCoarsePedestalMonitor::fill_Nevents ( const HcalTopology topology)
private

Methods, variables accessible only within class code.

Definition at line 282 of file HcalCoarsePedestalMonitor.cc.

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

Referenced by endLuminosityBlock().

282  {
283 
284  // require minimum number of events before processing
285  if (ievt_<minEvents_)
286  return;
287 
288 
289  // Set underflow bin to the number of pedestal events processed
290  // (Assume that number of ped events is the same for all channels/subdetectors)
291  for (unsigned int i=0;i<CoarsePedestalsSumByDepth.depth.size();++i)
292  CoarsePedestalsSumByDepth.depth[i]->setBinContent(0,0,ievt_);
293  for (unsigned int i=0;i<CoarsePedestalsOccByDepth.depth.size();++i)
294  CoarsePedestalsOccByDepth.depth[i]->setBinContent(0,0,ievt_);
295 
296 
297  int iphi=-1, ieta=-99, idepth=0, calcEta=-99;
298  // Loop over all depths, eta, phi
299  for (int d=0;d<4;++d) {
300  idepth=d+1;
301  for (int phi=0;phi<72;++phi) {
302  iphi=phi+1; // actual iphi value
303  for (int eta=0;eta<83;++eta) {
304  ieta=eta-41; // actual ieta value;
305  if (topology.validDetId(HcalBarrel, ieta, iphi, idepth)) {
306  calcEta = CalcEtaBin(HcalBarrel,ieta,idepth);
307  CoarsePedestalsSumByDepth.depth[d]->Fill(ieta,iphi,pedestalsum_[calcEta][phi][d]);
308  CoarsePedestalsOccByDepth.depth[d]->Fill(ieta,iphi,pedestalocc_[calcEta][phi][d]);
309  }
310  if (topology.validDetId(HcalEndcap, ieta, iphi, idepth)) {
311  calcEta = CalcEtaBin(HcalEndcap,ieta,idepth);
312  CoarsePedestalsSumByDepth.depth[d]->Fill(ieta,iphi,pedestalsum_[calcEta][phi][d]);
313  CoarsePedestalsOccByDepth.depth[d]->Fill(ieta,iphi,pedestalocc_[calcEta][phi][d]);
314  }
315  if (topology.validDetId(HcalOuter, ieta, iphi, idepth)) {
316  calcEta = CalcEtaBin(HcalOuter,ieta,idepth);
317  CoarsePedestalsSumByDepth.depth[d]->Fill(ieta,iphi,pedestalsum_[calcEta][phi][d]);
318  CoarsePedestalsOccByDepth.depth[d]->Fill(ieta,iphi,pedestalocc_[calcEta][phi][d]);
319  }
320  if (topology.validDetId(HcalForward, ieta, iphi, idepth)) {
321  calcEta = CalcEtaBin(HcalBarrel,ieta,idepth);
322  int zside=ieta/abs(ieta);
323  CoarsePedestalsSumByDepth.depth[d]->Fill(ieta+zside,iphi,pedestalsum_[calcEta][phi][d]);
324  CoarsePedestalsOccByDepth.depth[d]->Fill(ieta+zside,iphi,pedestalocc_[calcEta][phi][d]);
325  }
326  }
327  }
328  }
329  // Fill unphysical bins
332 
333  return;
334 } // void HcalCoarsePedestalMonitor::fill_Nevents(const HcalTopology&)
int i
Definition: DBlmapReader.cc:9
bool validDetId(HcalSubdetector subdet, int ieta, int iphi, int depth) const
int zside(DetId const &)
tuple d
Definition: ztail.py:151
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)
void HcalCoarsePedestalMonitor::processEvent ( const HBHEDigiCollection hbhe,
const HODigiCollection ho,
const HFDigiCollection hf,
const HcalUnpackerReport report 
)

Definition at line 150 of file HcalCoarsePedestalMonitor.cc.

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

Referenced by analyze().

154 {
155  // Skip events in which minimal good digis found -- still getting some strange (calib?) events through DQM
156 
157  unsigned int allgooddigis= hbhe.size()+ho.size()+hf.size();
158  // bad threshold: ignore events in which bad outnumber good by more than 100:1
159  // (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)
160  if ((allgooddigis==0) ||
161  (1.*report.badQualityDigis()>100*allgooddigis))
162  {
163  return;
164  }
165 
167 
168  unsigned int digisize=0;
169  int depth=0, iphi=0, ieta=0, binEta=-9999;
170 
171  double value=0;
172 
173  for (HBHEDigiCollection::const_iterator j=hbhe.begin(); j!=hbhe.end(); ++j)
174  {
175  const HBHEDataFrame digi = (const HBHEDataFrame)(*j);
176  if (digi.id().subdet()==HcalBarrel)
177  {if (!HBpresent_) continue;}
178  else if (digi.id().subdet()==HcalEndcap)
179  {if (!HEpresent_) continue;}
180  else continue;
181  digisize=digi.size();
182  if (digisize<8)
183  continue;
184 
185  depth=digi.id().depth();
186  iphi=digi.id().iphi();
187  ieta=digi.id().ieta();
188 
189  digi.id().subdet()==HcalBarrel ?
190  binEta=CalcEtaBin(HcalBarrel, ieta, depth) :
191  binEta=CalcEtaBin(HcalEndcap, ieta, depth);
192 
193  // 'value' is the average pedestal over the 8 time slices.
194  // In the CoarsePedestal client, we will divide the summed value by Nevents (in underflow bin)
195  // in order to calculate average pedestals.
196  value=0;
197  for (unsigned int i=0;i<8;++i)
198  value+=digi.sample(i).adc()/8.;
199  pedestalsum_[binEta][iphi-1][depth-1]+=value;
200  ++pedestalocc_[binEta][iphi-1][depth-1];
201  }
202 
203 
205  if (HOpresent_)
206  {
207  for (HODigiCollection::const_iterator j=ho.begin(); j!=ho.end(); ++j)
208  {
209  const HODataFrame digi = (const HODataFrame)(*j);
210  digisize=digi.size();
211  if (digisize<8)
212  continue;
213 
214  depth=digi.id().depth();
215  iphi=digi.id().iphi();
216  ieta=digi.id().ieta();
217  binEta=CalcEtaBin(HcalOuter, ieta, depth);
218 
219  // Don't fill cells that are part of HO ring 2 if an exclusion is applied
220  if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,4)==false)
221  continue;
222 
223  // 'value' is the average pedestal over the 8 time slices.
224  // In the CoarsePedestal client, we will divide the summed value by Nevents (in underflow bin)
225  // in order to calculate average pedestals.
226  value=0;
227  for (unsigned int i=0;i<8;++i)
228  value+=digi.sample(i).adc()/8.;
229  pedestalsum_[binEta][iphi-1][depth-1]+=value;
230  ++pedestalocc_[binEta][iphi-1][depth-1];
231  } // for (HODigiCollection)
232  }
233 
235  if (HFpresent_)
236  {
237  for (HFDigiCollection::const_iterator j=hf.begin(); j!=hf.end(); ++j)
238  {
239  const HFDataFrame digi = (const HFDataFrame)(*j);
240  digisize=digi.size();
241  if (digisize<8)
242  continue;
243  digisize=digi.size();
244  if (digisize<8)
245  continue;
246 
247  depth=digi.id().depth();
248  iphi=digi.id().iphi();
249  ieta=digi.id().ieta();
250  binEta=CalcEtaBin(HcalForward, ieta, depth);
251  // 'value' is the average pedestal over the 8 time slices.
252  // In the CoarsePedestal client, we will divide the summed value by Nevents (in underflow bin)
253  // in order to calculate average pedestals.
254  value=0;
255  for (unsigned int i=0;i<8;++i)
256  value+=digi.sample(i).adc()/8.;
257  pedestalsum_[binEta][iphi-1][depth-1]+=value;
258  ++pedestalocc_[binEta][iphi-1][depth-1];
259  } // for (HFDigiCollection)
260  } // if (HFpresent_)
261 
262  return;
263 } // void HcalCoarsePedestalMonitor::processEvent(...)
int i
Definition: DBlmapReader.cc:9
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
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.cc:106
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
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.cc:101
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
const HcalDetId & id() const
Definition: HFDataFrame.h:22
const_iterator begin() const
void HcalCoarsePedestalMonitor::reset ( void  )
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 337 of file HcalCoarsePedestalMonitor.cc.

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

Referenced by bookHistograms(), and setup().

338 {
339  // then reset the MonitorElements
340  zeroCounters();
343  return;
344 }
void Reset(void)
void HcalCoarsePedestalMonitor::setup ( DQMStore::IBooker ib)
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 60 of file HcalCoarsePedestalMonitor.cc.

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

Referenced by bookHistograms().

61 {
62  // Call base class setup
64 
65  /******* Set up all histograms ********/
66  if (debug_>1)
67  std::cout <<"<HcalCoarsePedestalMonitor::setup> Setting up histograms"<<std::endl;
68 
69  std::ostringstream name;
70  ib.setCurrentFolder(subdir_ +"CoarsePedestalSumPlots");
71  SetupEtaPhiHists(ib,CoarsePedestalsSumByDepth,"Coarse Pedestal Summed Map","");
72  SetupEtaPhiHists(ib,CoarsePedestalsOccByDepth,"Coarse Pedestal Occupancy Map","");
73  for (unsigned int i=0;i<CoarsePedestalsSumByDepth.depth.size();++i)
74  (CoarsePedestalsSumByDepth.depth[i]->getTH2F())->SetOption("colz");
75  for (unsigned int i=0;i<CoarsePedestalsOccByDepth.depth.size();++i)
76  (CoarsePedestalsOccByDepth.depth[i]->getTH2F())->SetOption("colz");
77 
78 
79  ib.setCurrentFolder(subdir_+"CoarsePedestal_parameters");
80  MonitorElement* ADCDiffThresh = ib.bookFloat("ADCdiff_Problem_Threshold");
81  ADCDiffThresh->Fill(ADCDiffThresh_);
82  MonitorElement* minevents = ib.bookInt("minEventsNeededForPedestalCalculation");
83  minevents->Fill(minEvents_);
84  MonitorElement* excludeHORing2 = ib.bookInt("excludeHORing2");
85  if (excludeHORing2_==true)
86  excludeHORing2->Fill(1);
87  else
88  excludeHORing2->Fill(0);
89 
90  this->reset();
91  return;
92 } // void HcalCoarsePedestalMonitor::setup()
int i
Definition: DBlmapReader.cc:9
MonitorElement * bookInt(Args &&...args)
Definition: DQMStore.h:103
void Fill(long long x)
void SetupEtaPhiHists(DQMStore::IBooker &ib, EtaPhiHists &hh, std::string Name, std::string Units)
std::vector< MonitorElement * > depth
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:273
tuple cout
Definition: gather_cfg.py:145
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
virtual void setup(DQMStore::IBooker &)
void HcalCoarsePedestalMonitor::zeroCounters ( )
private

Definition at line 346 of file HcalCoarsePedestalMonitor.cc.

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

Referenced by reset().

347 {
348  for (int i=0;i<85;++i)
349  for (int j=0;j<72;++j)
350  for (int k=0;k<4;++k)
351  {
352  pedestalsum_[i][j][k]=0;
353  pedestalocc_[i][j][k]=0;
354  }
355 }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9

Member Data Documentation

double HcalCoarsePedestalMonitor::ADCDiffThresh_
private

Definition at line 57 of file HcalCoarsePedestalMonitor.h.

Referenced by HcalCoarsePedestalMonitor(), and setup().

EtaPhiHists HcalCoarsePedestalMonitor::CoarsePedestalsOccByDepth
private

Definition at line 52 of file HcalCoarsePedestalMonitor.h.

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

EtaPhiHists HcalCoarsePedestalMonitor::CoarsePedestalsSumByDepth
private

Definition at line 51 of file HcalCoarsePedestalMonitor.h.

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

edm::InputTag HcalCoarsePedestalMonitor::digiLabel_
private

Definition at line 59 of file HcalCoarsePedestalMonitor.h.

Referenced by analyze(), and HcalCoarsePedestalMonitor().

bool HcalCoarsePedestalMonitor::excludeHORing2_
private

Definition at line 61 of file HcalCoarsePedestalMonitor.h.

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

int HcalCoarsePedestalMonitor::minEvents_
private

Definition at line 60 of file HcalCoarsePedestalMonitor.h.

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

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

Definition at line 55 of file HcalCoarsePedestalMonitor.h.

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

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

Definition at line 54 of file HcalCoarsePedestalMonitor.h.

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

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

Definition at line 63 of file HcalCoarsePedestalMonitor.h.

Referenced by analyze(), and HcalCoarsePedestalMonitor().

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

Definition at line 65 of file HcalCoarsePedestalMonitor.h.

Referenced by analyze(), and HcalCoarsePedestalMonitor().

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

Definition at line 64 of file HcalCoarsePedestalMonitor.h.

Referenced by analyze(), and HcalCoarsePedestalMonitor().

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

Definition at line 66 of file HcalCoarsePedestalMonitor.h.

Referenced by analyze(), and HcalCoarsePedestalMonitor().