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

Public Member Functions

 HcalNoiseRates (const edm::ParameterSet &)
 
 ~HcalNoiseRates () 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
 
void beginJob () override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void endJob () 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 45 of file HcalNoiseRates.h.

Constructor & Destructor Documentation

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

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

Definition at line 100 of file HcalNoiseRates.cc.

101 {
102 }

Member Function Documentation

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

Definition at line 111 of file HcalNoiseRates.cc.

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

112 {
113 
114  // get the lumi section
115  int lumiSection = iEvent.luminosityBlock();
116  lumiCountMap_[lumiSection]++;
117 
118  // get the RBX Noise collection
120  iEvent.getByToken(tok_rbx_,handle);
121  if(!handle.isValid()) {
123  << " could not find HcalNoiseRBXCollection named " << rbxCollName_ << ".\n";
124  return;
125  }
126 
127  // get the Noise summary object
129  iEvent.getByToken(noisetoken_, summary_h);
130  if(!summary_h.isValid()) {
131  throw edm::Exception(edm::errors::ProductNotFound) << " could not find HcalNoiseSummary.\n";
132  return;
133  }
134  const HcalNoiseSummary summary = *summary_h;
135 
136  //Fill the Noise Summary histograms
138  nNSumE_->Fill(summary.NegativeNoiseSumE());
139  nNSumEt_->Fill(summary.NegativeNoiseSumEt());
140 
142  sNSumE_->Fill(summary.spikeNoiseSumE());
143  sNSumEt_->Fill(summary.spikeNoiseSumEt());
144 
146  iNSumE_->Fill(summary.isolatedNoiseSumE());
147  iNSumEt_->Fill(summary.isolatedNoiseSumEt());
148 
149  hNoise_maxZeros_->Fill(summary.maxZeros());
150  hNoise_maxHPDHits_->Fill(summary.maxHPDHits());
152 
153  // loop over the RBXs and fill the histograms
154  for(reco::HcalNoiseRBXCollection::const_iterator it=handle->begin(); it!=handle->end(); ++it) {
155  const reco::HcalNoiseRBX &rbx=(*it);
156 
157  double energy = rbx.recHitEnergy(minHitEnergy_);
158 
159  int nhits = rbx.numRecHits(minHitEnergy_);
160 
161  if(energy < minRBXEnergy_) continue;
162 
163  hRBXEnergy_->Fill(energy);
164 
165  if (nhits <= 9) hRBXEnergyType1_->Fill(energy);
166  else if (nhits <= 18) hRBXEnergyType2_->Fill(energy);
167  else hRBXEnergyType3_->Fill(energy);
168 
169  hRBXNHits_->Fill(nhits);
170 
171  } // done looping over RBXs
172 
173 }
float NegativeNoiseSumEt(void) const
int numSpikeNoiseChannels(void) const
MonitorElement * nNNumChannels_
edm::InputTag rbxCollName_
MonitorElement * hRBXEnergyType1_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
int numIsolatedNoiseChannels(void) const
float spikeNoiseSumE(void) const
int numRecHits(double threshold=1.5) const
MonitorElement * iNNumChannels_
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
MonitorElement * hRBXEnergy_
float spikeNoiseSumEt(void) const
MonitorElement * sNNumChannels_
MonitorElement * hRBXEnergyType2_
void Fill(long long x)
int numNegativeNoiseChannels(void) const
float isolatedNoiseSumEt(void) const
double recHitEnergy(double theshold=1.5) const
Definition: HcalNoiseRBX.cc:99
MonitorElement * nNSumE_
MonitorElement * hNoise_maxHPDNoOtherHits_
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * sNSumEt_
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > tok_rbx_
edm::EDGetTokenT< HcalNoiseSummary > noisetoken_
MonitorElement * hNoise_maxHPDHits_
float NegativeNoiseSumE(void) const
MonitorElement * hRBXEnergyType3_
double minHitEnergy_
MonitorElement * nNSumEt_
int maxZeros(void) const
float isolatedNoiseSumE(void) const
int maxHPDNoOtherHits(void) const
MonitorElement * sNSumE_
std::map< int, int > lumiCountMap_
MonitorElement * iNSumEt_
int maxHPDHits(void) const
MonitorElement * iNSumE_
double minRBXEnergy_
MonitorElement * hNoise_maxZeros_
MonitorElement * hRBXNHits_
void HcalNoiseRates::beginJob ( void  )
overrideprivate

Definition at line 178 of file HcalNoiseRates.cc.

178 {}
void HcalNoiseRates::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivate

Definition at line 35 of file HcalNoiseRates.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_.

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

Definition at line 182 of file HcalNoiseRates.cc.

References DEFINE_FWK_MODULE, MonitorElement::Fill(), hLumiBlockCount_, lumiCountMap_, and useAllHistos_.

182  {
183 
184  if (useAllHistos_) hLumiBlockCount_->Fill(0.0, lumiCountMap_.size());
185 
186 }
void Fill(long long x)
MonitorElement * hLumiBlockCount_
std::map< int, int > lumiCountMap_

Member Data Documentation

MonitorElement* HcalNoiseRates::hLumiBlockCount_
private

Definition at line 69 of file HcalNoiseRates.h.

Referenced by bookHistograms(), and endJob().

MonitorElement* HcalNoiseRates::hNoise_maxHPDHits_
private

Definition at line 94 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::hNoise_maxHPDNoOtherHits_
private

Definition at line 95 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::hNoise_maxZeros_
private

Definition at line 93 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::hRBXEnergy_
private

Definition at line 70 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::hRBXEnergyType1_
private

Definition at line 71 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::hRBXEnergyType2_
private

Definition at line 72 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::hRBXEnergyType3_
private

Definition at line 73 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::hRBXNHits_
private

Definition at line 74 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::iNNumChannels_
private

Definition at line 89 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::iNSumE_
private

Definition at line 90 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::iNSumEt_
private

Definition at line 91 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 77 of file HcalNoiseRates.h.

Referenced by analyze(), and endJob().

double HcalNoiseRates::minHitEnergy_
private

Definition at line 63 of file HcalNoiseRates.h.

Referenced by analyze(), and HcalNoiseRates().

double HcalNoiseRates::minRBXEnergy_
private

Definition at line 62 of file HcalNoiseRates.h.

Referenced by analyze(), and HcalNoiseRates().

MonitorElement* HcalNoiseRates::nNNumChannels_
private

Definition at line 81 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::nNSumE_
private

Definition at line 82 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::nNSumEt_
private

Definition at line 83 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 67 of file HcalNoiseRates.h.

Referenced by analyze(), and HcalNoiseRates().

std::string HcalNoiseRates::outputFile_
private

Definition at line 57 of file HcalNoiseRates.h.

Referenced by HcalNoiseRates().

edm::InputTag HcalNoiseRates::rbxCollName_
private

Definition at line 60 of file HcalNoiseRates.h.

Referenced by analyze(), and HcalNoiseRates().

MonitorElement* HcalNoiseRates::sNNumChannels_
private

Definition at line 85 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::sNSumE_
private

Definition at line 86 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::sNSumEt_
private

Definition at line 87 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 61 of file HcalNoiseRates.h.

Referenced by analyze(), and HcalNoiseRates().

bool HcalNoiseRates::useAllHistos_
private

Definition at line 64 of file HcalNoiseRates.h.

Referenced by bookHistograms(), endJob(), and HcalNoiseRates().