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=default
 
- 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
 

Private Attributes

MonitorElementhLumiBlockCount_
 
MonitorElementhNoise_maxHPDHits_
 
MonitorElementhNoise_maxHPDNoOtherHits_
 
MonitorElementhNoise_maxZeros_
 
MonitorElementhRBXEnergy_
 
MonitorElementhRBXEnergyType1_
 
MonitorElementhRBXEnergyType2_
 
MonitorElementhRBXEnergyType3_
 
MonitorElementhRBXNHits_
 
MonitorElementiNNumChannels_
 
MonitorElementiNSumE_
 
MonitorElementiNSumEt_
 
std::map< int, int > lumiCountMap_
 
const double minHitEnergy_
 
const double minRBXEnergy_
 
MonitorElementnNNumChannels_
 
MonitorElementnNSumE_
 
MonitorElementnNSumEt_
 
const edm::EDGetTokenT< HcalNoiseSummarynoisetoken_
 
const std::string outputFile_
 
const edm::InputTag rbxCollName_
 
MonitorElementsNNumChannels_
 
MonitorElementsNSumE_
 
MonitorElementsNSumEt_
 
const edm::EDGetTokenT< reco::HcalNoiseRBXCollectiontok_rbx_
 
const 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 41 of file NoiseRates.h.

Constructor & Destructor Documentation

◆ NoiseRates()

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

Definition at line 17 of file NoiseRates.cc.

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

◆ ~NoiseRates()

NoiseRates::~NoiseRates ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 93 of file NoiseRates.cc.

References hcalRecHitTable_cff::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(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, 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_.

93  {
94  // get the lumi section
95  int lumiSection = iEvent.luminosityBlock();
96  lumiCountMap_[lumiSection]++;
97 
98  // get the RBX Noise collection
100  if (!handle.isValid()) {
102  << " could not find HcalNoiseRBXCollection named " << rbxCollName_ << ".\n";
103  return;
104  }
105 
106  // get the Noise summary object
107  const edm::Handle<HcalNoiseSummary> &summary_h = iEvent.getHandle(noisetoken_);
108  if (!summary_h.isValid()) {
109  throw edm::Exception(edm::errors::ProductNotFound) << " could not find HcalNoiseSummary.\n";
110  return;
111  }
112  const HcalNoiseSummary summary = *summary_h;
113 
114  // Fill the Noise Summary histograms
115  nNNumChannels_->Fill(summary.numNegativeNoiseChannels());
116  nNSumE_->Fill(summary.NegativeNoiseSumE());
117  nNSumEt_->Fill(summary.NegativeNoiseSumEt());
118 
119  sNNumChannels_->Fill(summary.numSpikeNoiseChannels());
120  sNSumE_->Fill(summary.spikeNoiseSumE());
121  sNSumEt_->Fill(summary.spikeNoiseSumEt());
122 
123  iNNumChannels_->Fill(summary.numIsolatedNoiseChannels());
124  iNSumE_->Fill(summary.isolatedNoiseSumE());
125  iNSumEt_->Fill(summary.isolatedNoiseSumEt());
126 
127  hNoise_maxZeros_->Fill(summary.maxZeros());
128  hNoise_maxHPDHits_->Fill(summary.maxHPDHits());
129  hNoise_maxHPDNoOtherHits_->Fill(summary.maxHPDNoOtherHits());
130 
131  // loop over the RBXs and fill the histograms
132  for (reco::HcalNoiseRBXCollection::const_iterator it = handle->begin(); it != handle->end(); ++it) {
133  const reco::HcalNoiseRBX &rbx = (*it);
134 
135  double energy = rbx.recHitEnergy(minHitEnergy_);
136 
137  int nhits = rbx.numRecHits(minHitEnergy_);
138 
139  if (energy < minRBXEnergy_)
140  continue;
141 
143 
144  if (nhits <= 9)
146  else if (nhits <= 18)
148  else
150 
152 
153  } // done looping over RBXs
154 }
MonitorElement * sNNumChannels_
Definition: NoiseRates.h:76
MonitorElement * hRBXEnergy_
Definition: NoiseRates.h:64
const double minHitEnergy_
Definition: NoiseRates.h:56
double recHitEnergy(double theshold=1.5) const
Definition: HcalNoiseRBX.cc:76
MonitorElement * hNoise_maxHPDNoOtherHits_
Definition: NoiseRates.h:86
const edm::EDGetTokenT< reco::HcalNoiseRBXCollection > tok_rbx_
Definition: NoiseRates.h:59
const edm::EDGetTokenT< HcalNoiseSummary > noisetoken_
Definition: NoiseRates.h:61
MonitorElement * hRBXEnergyType3_
Definition: NoiseRates.h:67
int numRecHits(double threshold=1.5) const
MonitorElement * hRBXNHits_
Definition: NoiseRates.h:68
MonitorElement * nNNumChannels_
Definition: NoiseRates.h:72
std::map< int, int > lumiCountMap_
Definition: NoiseRates.h:89
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
MonitorElement * hNoise_maxZeros_
Definition: NoiseRates.h:84
MonitorElement * iNNumChannels_
Definition: NoiseRates.h:80
MonitorElement * hRBXEnergyType2_
Definition: NoiseRates.h:66
MonitorElement * hNoise_maxHPDHits_
Definition: NoiseRates.h:85
MonitorElement * iNSumEt_
Definition: NoiseRates.h:82
MonitorElement * sNSumEt_
Definition: NoiseRates.h:78
MonitorElement * hRBXEnergyType1_
Definition: NoiseRates.h:65
MonitorElement * nNSumEt_
Definition: NoiseRates.h:74
MonitorElement * iNSumE_
Definition: NoiseRates.h:81
MonitorElement * nNSumE_
Definition: NoiseRates.h:73
MonitorElement * sNSumE_
Definition: NoiseRates.h:77
bool isValid() const
Definition: HandleBase.h:70
const edm::InputTag rbxCollName_
Definition: NoiseRates.h:54
const double minRBXEnergy_
Definition: NoiseRates.h:55

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 34 of file NoiseRates.cc.

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

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

Member Data Documentation

◆ hLumiBlockCount_

MonitorElement* NoiseRates::hLumiBlockCount_
private

Definition at line 63 of file NoiseRates.h.

Referenced by bookHistograms().

◆ hNoise_maxHPDHits_

MonitorElement* NoiseRates::hNoise_maxHPDHits_
private

Definition at line 85 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hNoise_maxHPDNoOtherHits_

MonitorElement* NoiseRates::hNoise_maxHPDNoOtherHits_
private

Definition at line 86 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hNoise_maxZeros_

MonitorElement* NoiseRates::hNoise_maxZeros_
private

Definition at line 84 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hRBXEnergy_

MonitorElement* NoiseRates::hRBXEnergy_
private

Definition at line 64 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hRBXEnergyType1_

MonitorElement* NoiseRates::hRBXEnergyType1_
private

Definition at line 65 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hRBXEnergyType2_

MonitorElement* NoiseRates::hRBXEnergyType2_
private

Definition at line 66 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hRBXEnergyType3_

MonitorElement* NoiseRates::hRBXEnergyType3_
private

Definition at line 67 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ hRBXNHits_

MonitorElement* NoiseRates::hRBXNHits_
private

Definition at line 68 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ iNNumChannels_

MonitorElement* NoiseRates::iNNumChannels_
private

Definition at line 80 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ iNSumE_

MonitorElement* NoiseRates::iNSumE_
private

Definition at line 81 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ iNSumEt_

MonitorElement* NoiseRates::iNSumEt_
private

Definition at line 82 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ lumiCountMap_

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

Definition at line 89 of file NoiseRates.h.

Referenced by analyze().

◆ minHitEnergy_

const double NoiseRates::minHitEnergy_
private

Definition at line 56 of file NoiseRates.h.

Referenced by analyze().

◆ minRBXEnergy_

const double NoiseRates::minRBXEnergy_
private

Definition at line 55 of file NoiseRates.h.

Referenced by analyze().

◆ nNNumChannels_

MonitorElement* NoiseRates::nNNumChannels_
private

Definition at line 72 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ nNSumE_

MonitorElement* NoiseRates::nNSumE_
private

Definition at line 73 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ nNSumEt_

MonitorElement* NoiseRates::nNSumEt_
private

Definition at line 74 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ noisetoken_

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

Definition at line 61 of file NoiseRates.h.

Referenced by analyze().

◆ outputFile_

const std::string NoiseRates::outputFile_
private

Definition at line 51 of file NoiseRates.h.

◆ rbxCollName_

const edm::InputTag NoiseRates::rbxCollName_
private

Definition at line 54 of file NoiseRates.h.

Referenced by analyze().

◆ sNNumChannels_

MonitorElement* NoiseRates::sNNumChannels_
private

Definition at line 76 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ sNSumE_

MonitorElement* NoiseRates::sNSumE_
private

Definition at line 77 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ sNSumEt_

MonitorElement* NoiseRates::sNSumEt_
private

Definition at line 78 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

◆ tok_rbx_

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

Definition at line 59 of file NoiseRates.h.

Referenced by analyze().

◆ useAllHistos_

const bool NoiseRates::useAllHistos_
private

Definition at line 57 of file NoiseRates.h.

Referenced by bookHistograms().