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

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

Definition at line 38 of file NoiseRates.cc.

39 {
40 }

Member Function Documentation

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

Definition at line 112 of file NoiseRates.cc.

References DEFINE_FWK_MODULE, 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_.

113 {
114 
115  // get the lumi section
116  int lumiSection = iEvent.luminosityBlock();
117  lumiCountMap_[lumiSection]++;
118 
119  // get the RBX Noise collection
121  iEvent.getByToken(tok_rbx_,handle);
122  if(!handle.isValid()) {
124  << " could not find HcalNoiseRBXCollection named " << rbxCollName_ << ".\n";
125  return;
126  }
127 
128  // get the Noise summary object
130  iEvent.getByToken(noisetoken_, summary_h);
131  if(!summary_h.isValid()) {
132  throw edm::Exception(edm::errors::ProductNotFound) << " could not find HcalNoiseSummary.\n";
133  return;
134  }
135  const HcalNoiseSummary summary = *summary_h;
136 
137  //Fill the Noise Summary histograms
139  nNSumE_->Fill(summary.NegativeNoiseSumE());
140  nNSumEt_->Fill(summary.NegativeNoiseSumEt());
141 
143  sNSumE_->Fill(summary.spikeNoiseSumE());
144  sNSumEt_->Fill(summary.spikeNoiseSumEt());
145 
147  iNSumE_->Fill(summary.isolatedNoiseSumE());
148  iNSumEt_->Fill(summary.isolatedNoiseSumEt());
149 
150  hNoise_maxZeros_->Fill(summary.maxZeros());
151  hNoise_maxHPDHits_->Fill(summary.maxHPDHits());
153 
154  // loop over the RBXs and fill the histograms
155  for(reco::HcalNoiseRBXCollection::const_iterator it=handle->begin(); it!=handle->end(); ++it) {
156  const reco::HcalNoiseRBX &rbx=(*it);
157 
158  double energy = rbx.recHitEnergy(minHitEnergy_);
159 
160  int nhits = rbx.numRecHits(minHitEnergy_);
161 
162  if(energy < minRBXEnergy_) continue;
163 
164  hRBXEnergy_->Fill(energy);
165 
166  if (nhits <= 9) hRBXEnergyType1_->Fill(energy);
167  else if (nhits <= 18) hRBXEnergyType2_->Fill(energy);
168  else hRBXEnergyType3_->Fill(energy);
169 
170  hRBXNHits_->Fill(nhits);
171 
172  } // done looping over RBXs
173 
174 }
float NegativeNoiseSumEt(void) const
int numSpikeNoiseChannels(void) const
MonitorElement * sNNumChannels_
Definition: NoiseRates.h:79
MonitorElement * hRBXEnergy_
Definition: NoiseRates.h:67
MonitorElement * hNoise_maxHPDNoOtherHits_
Definition: NoiseRates.h:89
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
int numIsolatedNoiseChannels(void) const
float spikeNoiseSumE(void) const
edm::EDGetTokenT< HcalNoiseSummary > noisetoken_
Definition: NoiseRates.h:64
int numRecHits(double threshold=1.5) const
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
MonitorElement * hRBXEnergyType3_
Definition: NoiseRates.h:70
MonitorElement * hRBXNHits_
Definition: NoiseRates.h:71
MonitorElement * nNNumChannels_
Definition: NoiseRates.h:75
float spikeNoiseSumEt(void) const
std::map< int, int > lumiCountMap_
Definition: NoiseRates.h:93
void Fill(long long x)
double minRBXEnergy_
Definition: NoiseRates.h:58
int numNegativeNoiseChannels(void) const
float isolatedNoiseSumEt(void) const
MonitorElement * hNoise_maxZeros_
Definition: NoiseRates.h:87
double recHitEnergy(double theshold=1.5) const
Definition: HcalNoiseRBX.cc:99
MonitorElement * iNNumChannels_
Definition: NoiseRates.h:83
MonitorElement * hRBXEnergyType2_
Definition: NoiseRates.h:69
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * hNoise_maxHPDHits_
Definition: NoiseRates.h:88
edm::InputTag rbxCollName_
Definition: NoiseRates.h:56
MonitorElement * iNSumEt_
Definition: NoiseRates.h:85
MonitorElement * sNSumEt_
Definition: NoiseRates.h:81
MonitorElement * hRBXEnergyType1_
Definition: NoiseRates.h:68
MonitorElement * nNSumEt_
Definition: NoiseRates.h:77
double minHitEnergy_
Definition: NoiseRates.h:59
MonitorElement * iNSumE_
Definition: NoiseRates.h:84
float NegativeNoiseSumE(void) const
MonitorElement * nNSumE_
Definition: NoiseRates.h:76
MonitorElement * sNSumE_
Definition: NoiseRates.h:80
int maxZeros(void) const
float isolatedNoiseSumE(void) const
int maxHPDNoOtherHits(void) const
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > tok_rbx_
Definition: NoiseRates.h:57
int maxHPDHits(void) const
void NoiseRates::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  run,
edm::EventSetup const &  es 
)
override

Definition at line 47 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_.

48 {
49 
50  ib.setCurrentFolder("NoiseRatesV/NoiseRatesTask");
51 
52  // book histograms
53  Char_t histo[100];
54 
55  //Lumi block is not drawn; the rest are
56  if (useAllHistos_){
57  sprintf (histo, "hLumiBlockCount" );
58  hLumiBlockCount_ = ib.book1D(histo, histo, 1, -0.5, 0.5);
59  }
60 
61  sprintf (histo, "hRBXEnergy" );
62  hRBXEnergy_ = ib.book1D(histo, histo, 300, 0, 3000);
63 
64  sprintf (histo, "hRBXEnergyType1" );
65  hRBXEnergyType1_ = ib.book1D(histo, histo, 300, 0, 3000);
66 
67  sprintf (histo, "hRBXEnergyType2" );
68  hRBXEnergyType2_ = ib.book1D(histo, histo, 300, 0, 3000);
69 
70  sprintf (histo, "hRBXEnergyType3" );
71  hRBXEnergyType3_ = ib.book1D(histo, histo, 300, 0, 3000);
72 
73  sprintf (histo, "hRBXNHits" );
74  hRBXNHits_ = ib.book1D(histo, histo, 73,-0.5,72.5);
75 
76  //HcalNoiseSummary
77 
78  sprintf (histo, "nNNumChannels");
79  nNNumChannels_ = ib.book1D(histo, histo, 100, 0, 100);
80  sprintf (histo, "nNSumE");
81  nNSumE_ = ib.book1D(histo, histo , 100, 0, 5000);
82  sprintf (histo, "nNSumEt");
83  nNSumEt_ = ib.book1D(histo, histo , 100, 0, 2000);
84 
85  sprintf (histo, "sNNumChannels");
86  sNNumChannels_ = ib.book1D(histo, histo, 100, 0, 100);
87  sprintf (histo, "sNSumE");
88  sNSumE_ = ib.book1D(histo, histo , 100, 0, 5000);
89  sprintf (histo, "sNSumEt");
90  sNSumEt_ = ib.book1D(histo, histo , 100, 0, 2000);
91 
92  sprintf (histo, "iNNumChannels");
93  iNNumChannels_ = ib.book1D(histo, histo, 100, 0, 100);
94  sprintf (histo, "iNSumE");
95  iNSumE_ = ib.book1D(histo, histo , 100, 0, 5000);
96  sprintf (histo, "iNSumEt");
97  iNSumEt_ = ib.book1D(histo, histo , 100, 0, 2000);
98 
99  sprintf (histo, "hNoise_maxZeros");
100  hNoise_maxZeros_ = ib.book1D(histo, histo, 80, 0, 80);
101  sprintf (histo, "hNoise_maxHPDHits");
102  hNoise_maxHPDHits_ = ib.book1D(histo, histo, 20, 0, 20);
103  sprintf (histo, "hNoise_maxHPDNoOtherHits");
104  hNoise_maxHPDNoOtherHits_ = ib.book1D(histo, histo, 20, 0, 20);
105 
106 
107 
108 }
MonitorElement * sNNumChannels_
Definition: NoiseRates.h:79
MonitorElement * hRBXEnergy_
Definition: NoiseRates.h:67
MonitorElement * hNoise_maxHPDNoOtherHits_
Definition: NoiseRates.h:89
bool useAllHistos_
Definition: NoiseRates.h:61
MonitorElement * hRBXEnergyType3_
Definition: NoiseRates.h:70
MonitorElement * hLumiBlockCount_
Definition: NoiseRates.h:66
MonitorElement * hRBXNHits_
Definition: NoiseRates.h:71
MonitorElement * nNNumChannels_
Definition: NoiseRates.h:75
MonitorElement * hNoise_maxZeros_
Definition: NoiseRates.h:87
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * iNNumChannels_
Definition: NoiseRates.h:83
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * hRBXEnergyType2_
Definition: NoiseRates.h:69
MonitorElement * hNoise_maxHPDHits_
Definition: NoiseRates.h:88
MonitorElement * iNSumEt_
Definition: NoiseRates.h:85
MonitorElement * sNSumEt_
Definition: NoiseRates.h:81
MonitorElement * hRBXEnergyType1_
Definition: NoiseRates.h:68
MonitorElement * nNSumEt_
Definition: NoiseRates.h:77
MonitorElement * iNSumE_
Definition: NoiseRates.h:84
MonitorElement * nNSumE_
Definition: NoiseRates.h:76
MonitorElement * sNSumE_
Definition: NoiseRates.h:80

Member Data Documentation

MonitorElement* NoiseRates::hLumiBlockCount_
private

Definition at line 66 of file NoiseRates.h.

Referenced by bookHistograms().

MonitorElement* NoiseRates::hNoise_maxHPDHits_
private

Definition at line 88 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hNoise_maxHPDNoOtherHits_
private

Definition at line 89 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hNoise_maxZeros_
private

Definition at line 87 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hRBXEnergy_
private

Definition at line 67 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hRBXEnergyType1_
private

Definition at line 68 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hRBXEnergyType2_
private

Definition at line 69 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hRBXEnergyType3_
private

Definition at line 70 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hRBXNHits_
private

Definition at line 71 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::iNNumChannels_
private

Definition at line 83 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::iNSumE_
private

Definition at line 84 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::iNSumEt_
private

Definition at line 85 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 93 of file NoiseRates.h.

Referenced by analyze().

double NoiseRates::minHitEnergy_
private

Definition at line 59 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

double NoiseRates::minRBXEnergy_
private

Definition at line 58 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

MonitorElement* NoiseRates::nNNumChannels_
private

Definition at line 75 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::nNSumE_
private

Definition at line 76 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::nNSumEt_
private

Definition at line 77 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 64 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

std::string NoiseRates::outputFile_
private

Definition at line 53 of file NoiseRates.h.

Referenced by NoiseRates().

edm::InputTag NoiseRates::rbxCollName_
private

Definition at line 56 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

MonitorElement* NoiseRates::sNNumChannels_
private

Definition at line 79 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::sNSumE_
private

Definition at line 80 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::sNSumEt_
private

Definition at line 81 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 57 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

bool NoiseRates::useAllHistos_
private

Definition at line 61 of file NoiseRates.h.

Referenced by bookHistograms(), and NoiseRates().