CMS 3D CMS Logo

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

#include <NoiseRates.h>

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

Public Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 NoiseRates (const edm::ParameterSet &)
 
 ~NoiseRates () 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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) 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 >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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 41 of file NoiseRates.h.

Constructor & Destructor Documentation

◆ NoiseRates()

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

Definition at line 17 of file NoiseRates.cc.

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  minRBXEnergy_ = iConfig.getUntrackedParameter<double>("minRBXEnergy");
24  minHitEnergy_ = iConfig.getUntrackedParameter<double>("minHitEnergy");
25 
26  tok_rbx_ = consumes<reco::HcalNoiseRBXCollection>(rbxCollName_);
27 
28  useAllHistos_ = iConfig.getUntrackedParameter<bool>("useAllHistos", false);
29 
30  // Hcal Noise Summary
31  noisetoken_ = consumes<HcalNoiseSummary>(iConfig.getParameter<edm::InputTag>("noiselabel"));
32 }

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

◆ ~NoiseRates()

NoiseRates::~NoiseRates ( )
override

Definition at line 34 of file NoiseRates.cc.

34 {}

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 99 of file NoiseRates.cc.

99  {
100  // get the lumi section
101  int lumiSection = iEvent.luminosityBlock();
102  lumiCountMap_[lumiSection]++;
103 
104  // get the RBX Noise collection
106  iEvent.getByToken(tok_rbx_, handle);
107  if (!handle.isValid()) {
109  << " could not find HcalNoiseRBXCollection named " << rbxCollName_ << ".\n";
110  return;
111  }
112 
113  // get the Noise summary object
115  iEvent.getByToken(noisetoken_, summary_h);
116  if (!summary_h.isValid()) {
117  throw edm::Exception(edm::errors::ProductNotFound) << " could not find HcalNoiseSummary.\n";
118  return;
119  }
120  const HcalNoiseSummary summary = *summary_h;
121 
122  // Fill the Noise Summary histograms
123  nNNumChannels_->Fill(summary.numNegativeNoiseChannels());
124  nNSumE_->Fill(summary.NegativeNoiseSumE());
125  nNSumEt_->Fill(summary.NegativeNoiseSumEt());
126 
127  sNNumChannels_->Fill(summary.numSpikeNoiseChannels());
128  sNSumE_->Fill(summary.spikeNoiseSumE());
129  sNSumEt_->Fill(summary.spikeNoiseSumEt());
130 
131  iNNumChannels_->Fill(summary.numIsolatedNoiseChannels());
132  iNSumE_->Fill(summary.isolatedNoiseSumE());
133  iNSumEt_->Fill(summary.isolatedNoiseSumEt());
134 
135  hNoise_maxZeros_->Fill(summary.maxZeros());
136  hNoise_maxHPDHits_->Fill(summary.maxHPDHits());
137  hNoise_maxHPDNoOtherHits_->Fill(summary.maxHPDNoOtherHits());
138 
139  // loop over the RBXs and fill the histograms
140  for (reco::HcalNoiseRBXCollection::const_iterator it = handle->begin(); it != handle->end(); ++it) {
141  const reco::HcalNoiseRBX &rbx = (*it);
142 
143  double energy = rbx.recHitEnergy(minHitEnergy_);
144 
145  int nhits = rbx.numRecHits(minHitEnergy_);
146 
147  if (energy < minRBXEnergy_)
148  continue;
149 
151 
152  if (nhits <= 9)
154  else if (nhits <= 18)
156  else
158 
160 
161  } // done looping over RBXs
162 }

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_.

◆ bookHistograms()

void NoiseRates::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  run,
edm::EventSetup const &  es 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 40 of file NoiseRates.cc.

40  {
41  ib.setCurrentFolder("NoiseRatesV/NoiseRatesTask");
42 
43  // book histograms
44  Char_t histo[100];
45 
46  // Lumi block is not drawn; the rest are
47  if (useAllHistos_) {
48  sprintf(histo, "hLumiBlockCount");
49  hLumiBlockCount_ = ib.book1D(histo, histo, 1, -0.5, 0.5);
50  }
51 
52  sprintf(histo, "hRBXEnergy");
53  hRBXEnergy_ = ib.book1D(histo, histo, 300, 0, 3000);
54 
55  sprintf(histo, "hRBXEnergyType1");
56  hRBXEnergyType1_ = ib.book1D(histo, histo, 300, 0, 3000);
57 
58  sprintf(histo, "hRBXEnergyType2");
59  hRBXEnergyType2_ = ib.book1D(histo, histo, 300, 0, 3000);
60 
61  sprintf(histo, "hRBXEnergyType3");
62  hRBXEnergyType3_ = ib.book1D(histo, histo, 300, 0, 3000);
63 
64  sprintf(histo, "hRBXNHits");
65  hRBXNHits_ = ib.book1D(histo, histo, 73, -0.5, 72.5);
66 
67  // HcalNoiseSummary
68 
69  sprintf(histo, "nNNumChannels");
70  nNNumChannels_ = ib.book1D(histo, histo, 100, 0, 100);
71  sprintf(histo, "nNSumE");
72  nNSumE_ = ib.book1D(histo, histo, 100, 0, 5000);
73  sprintf(histo, "nNSumEt");
74  nNSumEt_ = ib.book1D(histo, histo, 100, 0, 2000);
75 
76  sprintf(histo, "sNNumChannels");
77  sNNumChannels_ = ib.book1D(histo, histo, 100, 0, 100);
78  sprintf(histo, "sNSumE");
79  sNSumE_ = ib.book1D(histo, histo, 100, 0, 5000);
80  sprintf(histo, "sNSumEt");
81  sNSumEt_ = ib.book1D(histo, histo, 100, 0, 2000);
82 
83  sprintf(histo, "iNNumChannels");
84  iNNumChannels_ = ib.book1D(histo, histo, 100, 0, 100);
85  sprintf(histo, "iNSumE");
86  iNSumE_ = ib.book1D(histo, histo, 100, 0, 5000);
87  sprintf(histo, "iNSumEt");
88  iNSumEt_ = ib.book1D(histo, histo, 100, 0, 2000);
89 
90  sprintf(histo, "hNoise_maxZeros");
91  hNoise_maxZeros_ = ib.book1D(histo, histo, 80, 0, 80);
92  sprintf(histo, "hNoise_maxHPDHits");
93  hNoise_maxHPDHits_ = ib.book1D(histo, histo, 20, 0, 20);
94  sprintf(histo, "hNoise_maxHPDNoOtherHits");
95  hNoise_maxHPDNoOtherHits_ = ib.book1D(histo, histo, 20, 0, 20);
96 }

References timingPdfMaker::histo, hLumiBlockCount_, hNoise_maxHPDHits_, hNoise_maxHPDNoOtherHits_, hNoise_maxZeros_, hRBXEnergy_, hRBXEnergyType1_, hRBXEnergyType2_, hRBXEnergyType3_, hRBXNHits_, cuy::ib, iNNumChannels_, iNSumE_, iNSumEt_, nNNumChannels_, nNSumE_, nNSumEt_, sNNumChannels_, sNSumE_, sNSumEt_, and useAllHistos_.

Member Data Documentation

◆ hLumiBlockCount_

MonitorElement* NoiseRates::hLumiBlockCount_
private

Definition at line 64 of file NoiseRates.h.

Referenced by bookHistograms().

◆ hNoise_maxHPDHits_

MonitorElement* NoiseRates::hNoise_maxHPDHits_
private

Definition at line 86 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hNoise_maxHPDNoOtherHits_

MonitorElement* NoiseRates::hNoise_maxHPDNoOtherHits_
private

Definition at line 87 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hNoise_maxZeros_

MonitorElement* NoiseRates::hNoise_maxZeros_
private

Definition at line 85 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hRBXEnergy_

MonitorElement* NoiseRates::hRBXEnergy_
private

Definition at line 65 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hRBXEnergyType1_

MonitorElement* NoiseRates::hRBXEnergyType1_
private

Definition at line 66 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hRBXEnergyType2_

MonitorElement* NoiseRates::hRBXEnergyType2_
private

Definition at line 67 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hRBXEnergyType3_

MonitorElement* NoiseRates::hRBXEnergyType3_
private

Definition at line 68 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hRBXNHits_

MonitorElement* NoiseRates::hRBXNHits_
private

Definition at line 69 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ iNNumChannels_

MonitorElement* NoiseRates::iNNumChannels_
private

Definition at line 81 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ iNSumE_

MonitorElement* NoiseRates::iNSumE_
private

Definition at line 82 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ iNSumEt_

MonitorElement* NoiseRates::iNSumEt_
private

Definition at line 83 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ lumiCountMap_

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

Definition at line 90 of file NoiseRates.h.

Referenced by analyze().

◆ minHitEnergy_

double NoiseRates::minHitEnergy_
private

Definition at line 57 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

◆ minRBXEnergy_

double NoiseRates::minRBXEnergy_
private

Definition at line 56 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

◆ nNNumChannels_

MonitorElement* NoiseRates::nNNumChannels_
private

Definition at line 73 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ nNSumE_

MonitorElement* NoiseRates::nNSumE_
private

Definition at line 74 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ nNSumEt_

MonitorElement* NoiseRates::nNSumEt_
private

Definition at line 75 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ noisetoken_

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

Definition at line 62 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

◆ outputFile_

std::string NoiseRates::outputFile_
private

Definition at line 51 of file NoiseRates.h.

Referenced by NoiseRates().

◆ rbxCollName_

edm::InputTag NoiseRates::rbxCollName_
private

Definition at line 54 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

◆ sNNumChannels_

MonitorElement* NoiseRates::sNNumChannels_
private

Definition at line 77 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ sNSumE_

MonitorElement* NoiseRates::sNSumE_
private

Definition at line 78 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ sNSumEt_

MonitorElement* NoiseRates::sNSumEt_
private

Definition at line 79 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ tok_rbx_

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

Definition at line 55 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

◆ useAllHistos_

bool NoiseRates::useAllHistos_
private

Definition at line 59 of file NoiseRates.h.

Referenced by bookHistograms(), and NoiseRates().

NoiseRates::outputFile_
std::string outputFile_
Definition: NoiseRates.h:51
NoiseRates::sNSumE_
MonitorElement * sNSumE_
Definition: NoiseRates.h:78
NoiseRates::hLumiBlockCount_
MonitorElement * hLumiBlockCount_
Definition: NoiseRates.h:64
HcalNoiseSummary
Definition: HcalNoiseSummary.h:31
reco::HcalNoiseRBX::numRecHits
int numRecHits(double threshold=1.5) const
Definition: HcalNoiseRBX.cc:110
NoiseRates::noisetoken_
edm::EDGetTokenT< HcalNoiseSummary > noisetoken_
Definition: NoiseRates.h:62
patZpeak.handle
handle
Definition: patZpeak.py:23
NoiseRates::iNNumChannels_
MonitorElement * iNNumChannels_
Definition: NoiseRates.h:81
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition: AssociativeIterator.h:50
NoiseRates::minHitEnergy_
double minHitEnergy_
Definition: NoiseRates.h:57
edm::errors::ProductNotFound
Definition: EDMException.h:33
NoiseRates::hNoise_maxHPDNoOtherHits_
MonitorElement * hNoise_maxHPDNoOtherHits_
Definition: NoiseRates.h:87
NoiseRates::sNNumChannels_
MonitorElement * sNNumChannels_
Definition: NoiseRates.h:77
NoiseRates::hNoise_maxZeros_
MonitorElement * hNoise_maxZeros_
Definition: NoiseRates.h:85
NoiseRates::hRBXEnergyType3_
MonitorElement * hRBXEnergyType3_
Definition: NoiseRates.h:68
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
NoiseRates::iNSumEt_
MonitorElement * iNSumEt_
Definition: NoiseRates.h:83
NoiseRates::useAllHistos_
bool useAllHistos_
Definition: NoiseRates.h:59
NoiseRates::nNNumChannels_
MonitorElement * nNNumChannels_
Definition: NoiseRates.h:73
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
NoiseRates::hRBXNHits_
MonitorElement * hRBXNHits_
Definition: NoiseRates.h:69
NoiseRates::hRBXEnergyType2_
MonitorElement * hRBXEnergyType2_
Definition: NoiseRates.h:67
nhits
Definition: HIMultiTrackSelector.h:42
NoiseRates::hNoise_maxHPDHits_
MonitorElement * hNoise_maxHPDHits_
Definition: NoiseRates.h:86
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
NoiseRates::sNSumEt_
MonitorElement * sNSumEt_
Definition: NoiseRates.h:79
iEvent
int iEvent
Definition: GenABIO.cc:224
edmLumisInFiles.summary
summary
Definition: edmLumisInFiles.py:39
cuy.ib
ib
Definition: cuy.py:662
NoiseRates::minRBXEnergy_
double minRBXEnergy_
Definition: NoiseRates.h:56
NoiseRates::rbxCollName_
edm::InputTag rbxCollName_
Definition: NoiseRates.h:54
reco::HcalNoiseRBX
Definition: HcalNoiseRBX.h:32
NoiseRates::tok_rbx_
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > tok_rbx_
Definition: NoiseRates.h:55
Exception
Definition: hltDiff.cc:245
NoiseRates::iNSumE_
MonitorElement * iNSumE_
Definition: NoiseRates.h:82
NoiseRates::nNSumE_
MonitorElement * nNSumE_
Definition: NoiseRates.h:74
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
NoiseRates::hRBXEnergyType1_
MonitorElement * hRBXEnergyType1_
Definition: NoiseRates.h:66
reco::HcalNoiseRBX::recHitEnergy
double recHitEnergy(double theshold=1.5) const
Definition: HcalNoiseRBX.cc:76
NoiseRates::lumiCountMap_
std::map< int, int > lumiCountMap_
Definition: NoiseRates.h:90
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
NoiseRates::nNSumEt_
MonitorElement * nNSumEt_
Definition: NoiseRates.h:75
edm::InputTag
Definition: InputTag.h:15
NoiseRates::hRBXEnergy_
MonitorElement * hRBXEnergy_
Definition: NoiseRates.h:65