CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
NoiseRates Class Reference

#include <NoiseRates.h>

Inheritance diagram for NoiseRates:
edm::EDAnalyzer

Public Member Functions

 NoiseRates (const edm::ParameterSet &)
 
 ~NoiseRates ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 

Private Attributes

DQMStoredbe_
 
MonitorElementhLumiBlockCount_
 
MonitorElementhRBXEnergy_
 
MonitorElementhRBXEnergyType1_
 
MonitorElementhRBXEnergyType2_
 
MonitorElementhRBXEnergyType3_
 
MonitorElementhRBXNHits_
 
std::map< int, int > lumiCountMap_
 
double minHitEnergy_
 
double minRBXEnergy_
 
std::string outputFile_
 
edm::InputTag rbxCollName_
 
bool useAllHistos_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 39 of file NoiseRates.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file NoiseRates.cc.

References dbe_, edm::ParameterSet::getUntrackedParameter(), interpolateCardsSimple::histo, hLumiBlockCount_, hRBXEnergy_, hRBXEnergyType1_, hRBXEnergyType2_, hRBXEnergyType3_, hRBXNHits_, minHitEnergy_, minRBXEnergy_, cppFunctionSkipper::operator, outputFile_, rbxCollName_, and useAllHistos_.

19 {
20 
21  // DQM ROOT output
22  outputFile_ = iConfig.getUntrackedParameter<std::string>("outputFile","myfile.root");
23 
24  dbe_ = 0;
25  // get hold of back-end interface
26  dbe_ = edm::Service<DQMStore>().operator->();
27 
28  Char_t histo[100];
29 
30  if ( dbe_ ) {
31  dbe_->setCurrentFolder("NoiseRatesV/NoiseRatesTask");
32  }
33 
34  // set parameters
35  rbxCollName_ = iConfig.getUntrackedParameter<edm::InputTag>("rbxCollName");
36  minRBXEnergy_ = iConfig.getUntrackedParameter<double>("minRBXEnergy");
37  minHitEnergy_ = iConfig.getUntrackedParameter<double>("minHitEnergy");
38 
39  useAllHistos_ = iConfig.getUntrackedParameter<bool>("useAllHistos", false);
40 
41  // book histograms
42 
43  //Lumi block is not drawn; the rest are
44  if (useAllHistos_){
45  sprintf (histo, "hLumiBlockCount" );
46  hLumiBlockCount_ = dbe_->book1D(histo, histo, 1, -0.5, 0.5);
47  }
48 
49  sprintf (histo, "hRBXEnergy" );
50  hRBXEnergy_ = dbe_->book1D(histo, histo, 300, 0, 3000);
51 
52  sprintf (histo, "hRBXEnergyType1" );
53  hRBXEnergyType1_ = dbe_->book1D(histo, histo, 300, 0, 3000);
54 
55  sprintf (histo, "hRBXEnergyType2" );
56  hRBXEnergyType2_ = dbe_->book1D(histo, histo, 300, 0, 3000);
57 
58  sprintf (histo, "hRBXEnergyType3" );
59  hRBXEnergyType3_ = dbe_->book1D(histo, histo, 300, 0, 3000);
60 
61  sprintf (histo, "hRBXNHits" );
62  hRBXNHits_ = dbe_->book1D(histo, histo, 73,-0.5,72.5);
63 
64 }
MonitorElement * hRBXEnergy_
Definition: NoiseRates.h:60
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
std::string outputFile_
Definition: NoiseRates.h:51
bool useAllHistos_
Definition: NoiseRates.h:57
MonitorElement * hRBXEnergyType3_
Definition: NoiseRates.h:63
MonitorElement * hLumiBlockCount_
Definition: NoiseRates.h:59
MonitorElement * hRBXNHits_
Definition: NoiseRates.h:64
double minRBXEnergy_
Definition: NoiseRates.h:55
MonitorElement * hRBXEnergyType2_
Definition: NoiseRates.h:62
edm::InputTag rbxCollName_
Definition: NoiseRates.h:54
MonitorElement * hRBXEnergyType1_
Definition: NoiseRates.h:61
double minHitEnergy_
Definition: NoiseRates.h:56
DQMStore * dbe_
Definition: NoiseRates.h:50
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
NoiseRates::~NoiseRates ( )

Definition at line 67 of file NoiseRates.cc.

68 {
69 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 78 of file NoiseRates.cc.

References relval_parameters_module::energy, edm::hlt::Exception, MonitorElement::Fill(), edm::Event::getByLabel(), patZpeak::handle, hRBXEnergy_, hRBXEnergyType1_, hRBXEnergyType2_, hRBXEnergyType3_, hRBXNHits_, edm::HandleBase::isValid(), lumiCountMap_, edm::EventBase::luminosityBlock(), minHitEnergy_, minRBXEnergy_, reco::HcalNoiseRBX::numRecHits(), edm::errors::ProductNotFound, rbxCollName_, and reco::HcalNoiseRBX::recHitEnergy().

79 {
80 
81  // get the lumi section
82  int lumiSection = iEvent.luminosityBlock();
83  lumiCountMap_[lumiSection]++;
84 
85  // get the RBX Noise collection
87  iEvent.getByLabel(rbxCollName_,handle);
88  if(!handle.isValid()) {
90  << " could not find HcalNoiseRBXCollection named " << rbxCollName_ << ".\n";
91  return;
92  }
93 
94  // loop over the RBXs and fill the histograms
95  for(reco::HcalNoiseRBXCollection::const_iterator it=handle->begin(); it!=handle->end(); ++it) {
96  const reco::HcalNoiseRBX &rbx=(*it);
97 
98  double energy = rbx.recHitEnergy(minHitEnergy_);
99 
100  int nhits = rbx.numRecHits(minHitEnergy_);
101 
102  if(energy < minRBXEnergy_) continue;
103 
104  hRBXEnergy_->Fill(energy);
105 
106  if (nhits <= 9) hRBXEnergyType1_->Fill(energy);
107  else if (nhits <= 18) hRBXEnergyType2_->Fill(energy);
108  else hRBXEnergyType3_->Fill(energy);
109 
110  hRBXNHits_->Fill(nhits);
111 
112  } // done looping over RBXs
113 
114 }
MonitorElement * hRBXEnergy_
Definition: NoiseRates.h:60
int numRecHits(double threshold=1.5) const
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
MonitorElement * hRBXEnergyType3_
Definition: NoiseRates.h:63
MonitorElement * hRBXNHits_
Definition: NoiseRates.h:64
std::map< int, int > lumiCountMap_
Definition: NoiseRates.h:67
void Fill(long long x)
double minRBXEnergy_
Definition: NoiseRates.h:55
double recHitEnergy(double theshold=1.5) const
Definition: HcalNoiseRBX.cc:99
tuple handle
Definition: patZpeak.py:22
MonitorElement * hRBXEnergyType2_
Definition: NoiseRates.h:62
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
edm::InputTag rbxCollName_
Definition: NoiseRates.h:54
MonitorElement * hRBXEnergyType1_
Definition: NoiseRates.h:61
double minHitEnergy_
Definition: NoiseRates.h:56
void NoiseRates::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 119 of file NoiseRates.cc.

119 {}
void NoiseRates::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 123 of file NoiseRates.cc.

123  {
124 /*
125  if (useAllHistos_) hLumiBlockCount_->Fill(0.0, lumiCountMap_.size());
126 
127  if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_);
128 */
129 }

Member Data Documentation

DQMStore* NoiseRates::dbe_
private

Definition at line 50 of file NoiseRates.h.

Referenced by NoiseRates().

MonitorElement* NoiseRates::hLumiBlockCount_
private

Definition at line 59 of file NoiseRates.h.

Referenced by NoiseRates().

MonitorElement* NoiseRates::hRBXEnergy_
private

Definition at line 60 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

MonitorElement* NoiseRates::hRBXEnergyType1_
private

Definition at line 61 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

MonitorElement* NoiseRates::hRBXEnergyType2_
private

Definition at line 62 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

MonitorElement* NoiseRates::hRBXEnergyType3_
private

Definition at line 63 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

MonitorElement* NoiseRates::hRBXNHits_
private

Definition at line 64 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

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

Definition at line 67 of file NoiseRates.h.

Referenced by analyze().

double NoiseRates::minHitEnergy_
private

Definition at line 56 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

double NoiseRates::minRBXEnergy_
private

Definition at line 55 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

std::string NoiseRates::outputFile_
private

Definition at line 51 of file NoiseRates.h.

Referenced by NoiseRates().

edm::InputTag NoiseRates::rbxCollName_
private

Definition at line 54 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

bool NoiseRates::useAllHistos_
private

Definition at line 57 of file NoiseRates.h.

Referenced by NoiseRates().