CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HcalNoiseRates Class Reference

#include <HcalNoiseRates.h>

Inheritance diagram for HcalNoiseRates:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 HcalNoiseRates (const edm::ParameterSet &)
 
 ~HcalNoiseRates () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

MonitorElementhLumiBlockCount_
 
MonitorElementhNoise_maxHPDHits_
 
MonitorElementhNoise_maxHPDNoOtherHits_
 
MonitorElementhNoise_maxZeros_
 
MonitorElementhRBXEnergy_
 
MonitorElementhRBXEnergyType1_
 
MonitorElementhRBXEnergyType2_
 
MonitorElementhRBXEnergyType3_
 
MonitorElementhRBXNHits_
 
MonitorElementiNNumChannels_
 
MonitorElementiNSumE_
 
MonitorElementiNSumEt_
 
std::map< int, int > lumiCountMap_
 
double minHitEnergy_
 
double minRBXEnergy_
 
MonitorElementnNNumChannels_
 
MonitorElementnNSumE_
 
MonitorElementnNSumEt_
 
edm::EDGetTokenT< HcalNoiseSummarynoisetoken_
 
std::string outputFile_
 
edm::InputTag rbxCollName_
 
MonitorElementsNNumChannels_
 
MonitorElementsNSumE_
 
MonitorElementsNSumEt_
 
edm::EDGetTokenT< reco::HcalNoiseRBXCollectiontok_rbx_
 
bool useAllHistos_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 39 of file HcalNoiseRates.h.

Constructor & Destructor Documentation

◆ HcalNoiseRates()

HcalNoiseRates::HcalNoiseRates ( const edm::ParameterSet iConfig)
explicit

Definition at line 17 of file HcalNoiseRates.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), minHitEnergy_, minRBXEnergy_, noisetoken_, outputFile_, rbxCollName_, AlCaHLTBitMon_QueryRunRegistry::string, tok_rbx_, and useAllHistos_.

17  {
18  // DQM ROOT output
19  outputFile_ = iConfig.getUntrackedParameter<std::string>("outputFile", "myfile.root");
20 
21  // set parameters
22  rbxCollName_ = iConfig.getUntrackedParameter<edm::InputTag>("rbxCollName");
23  tok_rbx_ = consumes<reco::HcalNoiseRBXCollection>(rbxCollName_);
24  minRBXEnergy_ = iConfig.getUntrackedParameter<double>("minRBXEnergy");
25  minHitEnergy_ = iConfig.getUntrackedParameter<double>("minHitEnergy");
26 
27  useAllHistos_ = iConfig.getUntrackedParameter<bool>("useAllHistos", false);
28 
29  // Hcal Noise Summary
30  noisetoken_ = consumes<HcalNoiseSummary>(iConfig.getParameter<edm::InputTag>("noiselabel"));
31 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag rbxCollName_
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > tok_rbx_
edm::EDGetTokenT< HcalNoiseSummary > noisetoken_
std::string outputFile_
double minHitEnergy_
double minRBXEnergy_

◆ ~HcalNoiseRates()

HcalNoiseRates::~HcalNoiseRates ( )
override

Definition at line 96 of file HcalNoiseRates.cc.

96 {}

Member Function Documentation

◆ analyze()

void HcalNoiseRates::analyze ( const edm::Event iEvent,
const edm::EventSetup evSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 103 of file HcalNoiseRates.cc.

References HCALHighEnergyHPDFilter_cfi::energy, Exception, dqm::impl::MonitorElement::Fill(), patZpeak::handle, hNoise_maxHPDHits_, hNoise_maxHPDNoOtherHits_, hNoise_maxZeros_, hRBXEnergy_, hRBXEnergyType1_, hRBXEnergyType2_, hRBXEnergyType3_, hRBXNHits_, iEvent, iNNumChannels_, iNSumE_, iNSumEt_, edm::HandleBase::isValid(), lumiCountMap_, minHitEnergy_, minRBXEnergy_, nhits, nNNumChannels_, nNSumE_, nNSumEt_, noisetoken_, reco::HcalNoiseRBX::numRecHits(), edm::errors::ProductNotFound, rbxCollName_, reco::HcalNoiseRBX::recHitEnergy(), sNNumChannels_, sNSumE_, sNSumEt_, edmLumisInFiles::summary, and tok_rbx_.

103  {
104  // get the lumi section
105  int lumiSection = iEvent.luminosityBlock();
106  lumiCountMap_[lumiSection]++;
107 
108  // get the RBX Noise collection
110  iEvent.getByToken(tok_rbx_, handle);
111  if (!handle.isValid()) {
113  << " could not find HcalNoiseRBXCollection named " << rbxCollName_ << ".\n";
114  return;
115  }
116 
117  // get the Noise summary object
119  iEvent.getByToken(noisetoken_, summary_h);
120  if (!summary_h.isValid()) {
121  throw edm::Exception(edm::errors::ProductNotFound) << " could not find HcalNoiseSummary.\n";
122  return;
123  }
124  const HcalNoiseSummary summary = *summary_h;
125 
126  // Fill the Noise Summary histograms
127  nNNumChannels_->Fill(summary.numNegativeNoiseChannels());
128  nNSumE_->Fill(summary.NegativeNoiseSumE());
129  nNSumEt_->Fill(summary.NegativeNoiseSumEt());
130 
131  sNNumChannels_->Fill(summary.numSpikeNoiseChannels());
132  sNSumE_->Fill(summary.spikeNoiseSumE());
133  sNSumEt_->Fill(summary.spikeNoiseSumEt());
134 
135  iNNumChannels_->Fill(summary.numIsolatedNoiseChannels());
136  iNSumE_->Fill(summary.isolatedNoiseSumE());
137  iNSumEt_->Fill(summary.isolatedNoiseSumEt());
138 
139  hNoise_maxZeros_->Fill(summary.maxZeros());
140  hNoise_maxHPDHits_->Fill(summary.maxHPDHits());
141  hNoise_maxHPDNoOtherHits_->Fill(summary.maxHPDNoOtherHits());
142 
143  // loop over the RBXs and fill the histograms
144  for (reco::HcalNoiseRBXCollection::const_iterator it = handle->begin(); it != handle->end(); ++it) {
145  const reco::HcalNoiseRBX &rbx = (*it);
146 
147  double energy = rbx.recHitEnergy(minHitEnergy_);
148 
149  int nhits = rbx.numRecHits(minHitEnergy_);
150 
151  if (energy < minRBXEnergy_)
152  continue;
153 
155 
156  if (nhits <= 9)
158  else if (nhits <= 18)
160  else
162 
164 
165  } // done looping over RBXs
166 }
MonitorElement * nNNumChannels_
edm::InputTag rbxCollName_
MonitorElement * hRBXEnergyType1_
double recHitEnergy(double theshold=1.5) const
Definition: HcalNoiseRBX.cc:76
MonitorElement * iNNumChannels_
int numRecHits(double threshold=1.5) const
MonitorElement * hRBXEnergy_
MonitorElement * sNNumChannels_
MonitorElement * hRBXEnergyType2_
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
MonitorElement * nNSumE_
MonitorElement * hNoise_maxHPDNoOtherHits_
MonitorElement * sNSumEt_
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > tok_rbx_
edm::EDGetTokenT< HcalNoiseSummary > noisetoken_
MonitorElement * hNoise_maxHPDHits_
MonitorElement * hRBXEnergyType3_
double minHitEnergy_
MonitorElement * nNSumEt_
bool isValid() const
Definition: HandleBase.h:70
MonitorElement * sNSumE_
std::map< int, int > lumiCountMap_
MonitorElement * iNSumEt_
MonitorElement * iNSumE_
double minRBXEnergy_
MonitorElement * hNoise_maxZeros_
MonitorElement * hRBXNHits_

◆ bookHistograms()

void HcalNoiseRates::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 33 of file HcalNoiseRates.cc.

References dqm::implementation::IBooker::book1D(), timingPdfMaker::histo, hLumiBlockCount_, hNoise_maxHPDHits_, hNoise_maxHPDNoOtherHits_, hNoise_maxZeros_, hRBXEnergy_, hRBXEnergyType1_, hRBXEnergyType2_, hRBXEnergyType3_, hRBXNHits_, iNNumChannels_, iNSumE_, iNSumEt_, nNNumChannels_, nNSumE_, nNSumEt_, dqm::implementation::NavigatorBase::setCurrentFolder(), sNNumChannels_, sNSumE_, sNSumEt_, and useAllHistos_.

37 {
38  ibooker.setCurrentFolder("HcalNoiseRatesD/HcalNoiseRatesTask");
39 
40  Char_t histo[100];
41 
42  // book histograms
43 
44  // Lumi block is not drawn; the rest are
45  if (useAllHistos_) {
46  sprintf(histo, "hLumiBlockCount");
47  hLumiBlockCount_ = ibooker.book1D(histo, histo, 1, -0.5, 0.5);
48  }
49 
50  sprintf(histo, "hRBXEnergy");
51  hRBXEnergy_ = ibooker.book1D(histo, histo, 300, 0, 3000);
52 
53  sprintf(histo, "hRBXEnergyType1");
54  hRBXEnergyType1_ = ibooker.book1D(histo, histo, 300, 0, 3000);
55 
56  sprintf(histo, "hRBXEnergyType2");
57  hRBXEnergyType2_ = ibooker.book1D(histo, histo, 300, 0, 3000);
58 
59  sprintf(histo, "hRBXEnergyType3");
60  hRBXEnergyType3_ = ibooker.book1D(histo, histo, 300, 0, 3000);
61 
62  sprintf(histo, "hRBXNHits");
63  hRBXNHits_ = ibooker.book1D(histo, histo, 73, -0.5, 72.5);
64 
65  // HcalNoiseSummary
66 
67  sprintf(histo, "nNNumChannels");
68  nNNumChannels_ = ibooker.book1D(histo, histo, 100, 0, 100);
69  sprintf(histo, "nNSumE");
70  nNSumE_ = ibooker.book1D(histo, histo, 100, 0, 5000);
71  sprintf(histo, "nNSumEt");
72  nNSumEt_ = ibooker.book1D(histo, histo, 100, 0, 2000);
73 
74  sprintf(histo, "sNNumChannels");
75  sNNumChannels_ = ibooker.book1D(histo, histo, 100, 0, 100);
76  sprintf(histo, "sNSumE");
77  sNSumE_ = ibooker.book1D(histo, histo, 100, 0, 5000);
78  sprintf(histo, "sNSumEt");
79  sNSumEt_ = ibooker.book1D(histo, histo, 100, 0, 2000);
80 
81  sprintf(histo, "iNNumChannels");
82  iNNumChannels_ = ibooker.book1D(histo, histo, 100, 0, 100);
83  sprintf(histo, "iNSumE");
84  iNSumE_ = ibooker.book1D(histo, histo, 100, 0, 5000);
85  sprintf(histo, "iNSumEt");
86  iNSumEt_ = ibooker.book1D(histo, histo, 100, 0, 2000);
87 
88  sprintf(histo, "hNoise_maxZeros");
89  hNoise_maxZeros_ = ibooker.book1D(histo, histo, 80, 0, 80);
90  sprintf(histo, "hNoise_maxHPDHits");
91  hNoise_maxHPDHits_ = ibooker.book1D(histo, histo, 20, 0, 20);
92  sprintf(histo, "hNoise_maxHPDNoOtherHits");
93  hNoise_maxHPDNoOtherHits_ = ibooker.book1D(histo, histo, 20, 0, 20);
94 }
MonitorElement * nNNumChannels_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * hRBXEnergyType1_
MonitorElement * iNNumChannels_
MonitorElement * hRBXEnergy_
MonitorElement * sNNumChannels_
MonitorElement * hRBXEnergyType2_
MonitorElement * nNSumE_
MonitorElement * hNoise_maxHPDNoOtherHits_
MonitorElement * sNSumEt_
MonitorElement * hNoise_maxHPDHits_
MonitorElement * hRBXEnergyType3_
MonitorElement * nNSumEt_
MonitorElement * hLumiBlockCount_
MonitorElement * sNSumE_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * iNSumEt_
MonitorElement * iNSumE_
MonitorElement * hNoise_maxZeros_
MonitorElement * hRBXNHits_

Member Data Documentation

◆ hLumiBlockCount_

MonitorElement* HcalNoiseRates::hLumiBlockCount_
private

Definition at line 60 of file HcalNoiseRates.h.

Referenced by bookHistograms().

◆ hNoise_maxHPDHits_

MonitorElement* HcalNoiseRates::hNoise_maxHPDHits_
private

Definition at line 85 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hNoise_maxHPDNoOtherHits_

MonitorElement* HcalNoiseRates::hNoise_maxHPDNoOtherHits_
private

Definition at line 86 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hNoise_maxZeros_

MonitorElement* HcalNoiseRates::hNoise_maxZeros_
private

Definition at line 84 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hRBXEnergy_

MonitorElement* HcalNoiseRates::hRBXEnergy_
private

Definition at line 61 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hRBXEnergyType1_

MonitorElement* HcalNoiseRates::hRBXEnergyType1_
private

Definition at line 62 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hRBXEnergyType2_

MonitorElement* HcalNoiseRates::hRBXEnergyType2_
private

Definition at line 63 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hRBXEnergyType3_

MonitorElement* HcalNoiseRates::hRBXEnergyType3_
private

Definition at line 64 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hRBXNHits_

MonitorElement* HcalNoiseRates::hRBXNHits_
private

Definition at line 65 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ iNNumChannels_

MonitorElement* HcalNoiseRates::iNNumChannels_
private

Definition at line 80 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ iNSumE_

MonitorElement* HcalNoiseRates::iNSumE_
private

Definition at line 81 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ iNSumEt_

MonitorElement* HcalNoiseRates::iNSumEt_
private

Definition at line 82 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ lumiCountMap_

std::map<int, int> HcalNoiseRates::lumiCountMap_
private

Definition at line 68 of file HcalNoiseRates.h.

Referenced by analyze().

◆ minHitEnergy_

double HcalNoiseRates::minHitEnergy_
private

Definition at line 54 of file HcalNoiseRates.h.

Referenced by analyze(), and HcalNoiseRates().

◆ minRBXEnergy_

double HcalNoiseRates::minRBXEnergy_
private

Definition at line 53 of file HcalNoiseRates.h.

Referenced by analyze(), and HcalNoiseRates().

◆ nNNumChannels_

MonitorElement* HcalNoiseRates::nNNumChannels_
private

Definition at line 72 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ nNSumE_

MonitorElement* HcalNoiseRates::nNSumE_
private

Definition at line 73 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ nNSumEt_

MonitorElement* HcalNoiseRates::nNSumEt_
private

Definition at line 74 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ noisetoken_

edm::EDGetTokenT<HcalNoiseSummary> HcalNoiseRates::noisetoken_
private

Definition at line 58 of file HcalNoiseRates.h.

Referenced by analyze(), and HcalNoiseRates().

◆ outputFile_

std::string HcalNoiseRates::outputFile_
private

Definition at line 48 of file HcalNoiseRates.h.

Referenced by HcalNoiseRates().

◆ rbxCollName_

edm::InputTag HcalNoiseRates::rbxCollName_
private

Definition at line 51 of file HcalNoiseRates.h.

Referenced by analyze(), and HcalNoiseRates().

◆ sNNumChannels_

MonitorElement* HcalNoiseRates::sNNumChannels_
private

Definition at line 76 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ sNSumE_

MonitorElement* HcalNoiseRates::sNSumE_
private

Definition at line 77 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ sNSumEt_

MonitorElement* HcalNoiseRates::sNSumEt_
private

Definition at line 78 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ tok_rbx_

edm::EDGetTokenT<reco::HcalNoiseRBXCollection> HcalNoiseRates::tok_rbx_
private

Definition at line 52 of file HcalNoiseRates.h.

Referenced by analyze(), and HcalNoiseRates().

◆ useAllHistos_

bool HcalNoiseRates::useAllHistos_
private

Definition at line 55 of file HcalNoiseRates.h.

Referenced by bookHistograms(), and HcalNoiseRates().