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:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

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 one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

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_
 

Detailed Description

Definition at line 42 of file NoiseRates.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file NoiseRates.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  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 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string outputFile_
Definition: NoiseRates.h:52
edm::EDGetTokenT< HcalNoiseSummary > noisetoken_
Definition: NoiseRates.h:63
bool useAllHistos_
Definition: NoiseRates.h:60
double minRBXEnergy_
Definition: NoiseRates.h:57
edm::InputTag rbxCollName_
Definition: NoiseRates.h:55
double minHitEnergy_
Definition: NoiseRates.h:58
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > tok_rbx_
Definition: NoiseRates.h:56
NoiseRates::~NoiseRates ( )
override

Definition at line 34 of file NoiseRates.cc.

34 {}

Member Function Documentation

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

Definition at line 99 of file NoiseRates.cc.

References DEFINE_FWK_MODULE, randomXiThetaGunProducer_cfi::energy, Exception, MonitorElement::Fill(), edm::Event::getByToken(), cmsBatch::handle, hNoise_maxHPDHits_, hNoise_maxHPDNoOtherHits_, hNoise_maxZeros_, hRBXEnergy_, hRBXEnergyType1_, hRBXEnergyType2_, hRBXEnergyType3_, hRBXNHits_, iNNumChannels_, iNSumE_, iNSumEt_, HcalNoiseSummary::isolatedNoiseSumE(), HcalNoiseSummary::isolatedNoiseSumEt(), edm::HandleBase::isValid(), lumiCountMap_, edm::EventBase::luminosityBlock(), HcalNoiseSummary::maxHPDHits(), HcalNoiseSummary::maxHPDNoOtherHits(), HcalNoiseSummary::maxZeros(), minHitEnergy_, minRBXEnergy_, HcalNoiseSummary::NegativeNoiseSumE(), HcalNoiseSummary::NegativeNoiseSumEt(), nhits, nNNumChannels_, nNSumE_, nNSumEt_, noisetoken_, HcalNoiseSummary::numIsolatedNoiseChannels(), HcalNoiseSummary::numNegativeNoiseChannels(), reco::HcalNoiseRBX::numRecHits(), HcalNoiseSummary::numSpikeNoiseChannels(), edm::errors::ProductNotFound, rbxCollName_, reco::HcalNoiseRBX::recHitEnergy(), sNNumChannels_, sNSumE_, sNSumEt_, HcalNoiseSummary::spikeNoiseSumE(), HcalNoiseSummary::spikeNoiseSumEt(), heppy_report::summary, and tok_rbx_.

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
124  nNSumE_->Fill(summary.NegativeNoiseSumE());
125  nNSumEt_->Fill(summary.NegativeNoiseSumEt());
126 
128  sNSumE_->Fill(summary.spikeNoiseSumE());
129  sNSumEt_->Fill(summary.spikeNoiseSumEt());
130 
132  iNSumE_->Fill(summary.isolatedNoiseSumE());
133  iNSumEt_->Fill(summary.isolatedNoiseSumEt());
134 
135  hNoise_maxZeros_->Fill(summary.maxZeros());
136  hNoise_maxHPDHits_->Fill(summary.maxHPDHits());
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 
150  hRBXEnergy_->Fill(energy);
151 
152  if (nhits <= 9)
153  hRBXEnergyType1_->Fill(energy);
154  else if (nhits <= 18)
155  hRBXEnergyType2_->Fill(energy);
156  else
157  hRBXEnergyType3_->Fill(energy);
158 
159  hRBXNHits_->Fill(nhits);
160 
161  } // done looping over RBXs
162 }
float NegativeNoiseSumEt(void) const
int numSpikeNoiseChannels(void) const
MonitorElement * sNNumChannels_
Definition: NoiseRates.h:78
MonitorElement * hRBXEnergy_
Definition: NoiseRates.h:66
MonitorElement * hNoise_maxHPDNoOtherHits_
Definition: NoiseRates.h:88
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
int numIsolatedNoiseChannels(void) const
float spikeNoiseSumE(void) const
edm::EDGetTokenT< HcalNoiseSummary > noisetoken_
Definition: NoiseRates.h:63
int numRecHits(double threshold=1.5) const
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
MonitorElement * hRBXEnergyType3_
Definition: NoiseRates.h:69
MonitorElement * hRBXNHits_
Definition: NoiseRates.h:70
MonitorElement * nNNumChannels_
Definition: NoiseRates.h:74
float spikeNoiseSumEt(void) const
std::map< int, int > lumiCountMap_
Definition: NoiseRates.h:91
void Fill(long long x)
double minRBXEnergy_
Definition: NoiseRates.h:57
int numNegativeNoiseChannels(void) const
float isolatedNoiseSumEt(void) const
MonitorElement * hNoise_maxZeros_
Definition: NoiseRates.h:86
double recHitEnergy(double theshold=1.5) const
Definition: HcalNoiseRBX.cc:99
MonitorElement * iNNumChannels_
Definition: NoiseRates.h:82
MonitorElement * hRBXEnergyType2_
Definition: NoiseRates.h:68
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * hNoise_maxHPDHits_
Definition: NoiseRates.h:87
edm::InputTag rbxCollName_
Definition: NoiseRates.h:55
MonitorElement * iNSumEt_
Definition: NoiseRates.h:84
MonitorElement * sNSumEt_
Definition: NoiseRates.h:80
MonitorElement * hRBXEnergyType1_
Definition: NoiseRates.h:67
MonitorElement * nNSumEt_
Definition: NoiseRates.h:76
double minHitEnergy_
Definition: NoiseRates.h:58
MonitorElement * iNSumE_
Definition: NoiseRates.h:83
float NegativeNoiseSumE(void) const
MonitorElement * nNSumE_
Definition: NoiseRates.h:75
MonitorElement * sNSumE_
Definition: NoiseRates.h:79
int maxZeros(void) const
float isolatedNoiseSumE(void) const
int maxHPDNoOtherHits(void) const
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > tok_rbx_
Definition: NoiseRates.h:56
int maxHPDHits(void) const
void NoiseRates::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  run,
edm::EventSetup const &  es 
)
override

Definition at line 40 of file NoiseRates.cc.

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

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 }
MonitorElement * sNNumChannels_
Definition: NoiseRates.h:78
MonitorElement * hRBXEnergy_
Definition: NoiseRates.h:66
MonitorElement * hNoise_maxHPDNoOtherHits_
Definition: NoiseRates.h:88
bool useAllHistos_
Definition: NoiseRates.h:60
MonitorElement * hRBXEnergyType3_
Definition: NoiseRates.h:69
MonitorElement * hLumiBlockCount_
Definition: NoiseRates.h:65
MonitorElement * hRBXNHits_
Definition: NoiseRates.h:70
MonitorElement * nNNumChannels_
Definition: NoiseRates.h:74
MonitorElement * hNoise_maxZeros_
Definition: NoiseRates.h:86
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * iNNumChannels_
Definition: NoiseRates.h:82
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * hRBXEnergyType2_
Definition: NoiseRates.h:68
MonitorElement * hNoise_maxHPDHits_
Definition: NoiseRates.h:87
MonitorElement * iNSumEt_
Definition: NoiseRates.h:84
MonitorElement * sNSumEt_
Definition: NoiseRates.h:80
MonitorElement * hRBXEnergyType1_
Definition: NoiseRates.h:67
MonitorElement * nNSumEt_
Definition: NoiseRates.h:76
MonitorElement * iNSumE_
Definition: NoiseRates.h:83
MonitorElement * nNSumE_
Definition: NoiseRates.h:75
MonitorElement * sNSumE_
Definition: NoiseRates.h:79

Member Data Documentation

MonitorElement* NoiseRates::hLumiBlockCount_
private

Definition at line 65 of file NoiseRates.h.

Referenced by bookHistograms().

MonitorElement* NoiseRates::hNoise_maxHPDHits_
private

Definition at line 87 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hNoise_maxHPDNoOtherHits_
private

Definition at line 88 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hNoise_maxZeros_
private

Definition at line 86 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hRBXEnergy_
private

Definition at line 66 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hRBXEnergyType1_
private

Definition at line 67 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hRBXEnergyType2_
private

Definition at line 68 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hRBXEnergyType3_
private

Definition at line 69 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hRBXNHits_
private

Definition at line 70 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::iNNumChannels_
private

Definition at line 82 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::iNSumE_
private

Definition at line 83 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::iNSumEt_
private

Definition at line 84 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 91 of file NoiseRates.h.

Referenced by analyze().

double NoiseRates::minHitEnergy_
private

Definition at line 58 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

double NoiseRates::minRBXEnergy_
private

Definition at line 57 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

MonitorElement* NoiseRates::nNNumChannels_
private

Definition at line 74 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::nNSumE_
private

Definition at line 75 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::nNSumEt_
private

Definition at line 76 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 63 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

std::string NoiseRates::outputFile_
private

Definition at line 52 of file NoiseRates.h.

Referenced by NoiseRates().

edm::InputTag NoiseRates::rbxCollName_
private

Definition at line 55 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

MonitorElement* NoiseRates::sNNumChannels_
private

Definition at line 78 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::sNSumE_
private

Definition at line 79 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::sNSumEt_
private

Definition at line 80 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 56 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

bool NoiseRates::useAllHistos_
private

Definition at line 60 of file NoiseRates.h.

Referenced by bookHistograms(), and NoiseRates().