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
HcalNoiseRates Class Reference

#include <HcalNoiseRates.h>

Inheritance diagram for HcalNoiseRates:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 HcalNoiseRates (const edm::ParameterSet &)
 
 ~HcalNoiseRates ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
virtual void endJob ()
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 42 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::getUntrackedParameter(), minHitEnergy_, minRBXEnergy_, 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 }
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag rbxCollName_
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > tok_rbx_
std::string outputFile_
double minHitEnergy_
double minRBXEnergy_
HcalNoiseRates::~HcalNoiseRates ( )

Definition at line 67 of file HcalNoiseRates.cc.

68 {
69 }

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 78 of file HcalNoiseRates.cc.

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

79 {
80 
81  // get the lumi section
82  int lumiSection = iEvent.luminosityBlock();
83  lumiCountMap_[lumiSection]++;
84 
85  // get the RBX Noise collection
87  iEvent.getByToken(tok_rbx_,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 }
edm::InputTag rbxCollName_
MonitorElement * hRBXEnergyType1_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
int numRecHits(double threshold=1.5) const
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
MonitorElement * hRBXEnergy_
MonitorElement * hRBXEnergyType2_
void Fill(long long x)
double recHitEnergy(double theshold=1.5) const
Definition: HcalNoiseRBX.cc:99
tuple handle
Definition: patZpeak.py:22
bool isValid() const
Definition: HandleBase.h:76
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > tok_rbx_
MonitorElement * hRBXEnergyType3_
double minHitEnergy_
std::map< int, int > lumiCountMap_
double minRBXEnergy_
MonitorElement * hRBXNHits_
void HcalNoiseRates::beginJob ( void  )
privatevirtual

Definition at line 119 of file HcalNoiseRates.cc.

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

Implements DQMEDAnalyzer.

Definition at line 32 of file HcalNoiseRates.cc.

References DQMStore::IBooker::book1D(), timingPdfMaker::histo, hLumiBlockCount_, hRBXEnergy_, hRBXEnergyType1_, hRBXEnergyType2_, hRBXEnergyType3_, hRBXNHits_, DQMStore::IBooker::setCurrentFolder(), and useAllHistos_.

34 {
35 
36 
37  ibooker.setCurrentFolder("HcalNoiseRatesD/HcalNoiseRatesTask");
38 
39  Char_t histo[100];
40 
41  // book histograms
42 
43  //Lumi block is not drawn; the rest are
44  if (useAllHistos_){
45  sprintf (histo, "hLumiBlockCount" );
46  hLumiBlockCount_ = ibooker.book1D(histo, histo, 1, -0.5, 0.5);
47  }
48 
49  sprintf (histo, "hRBXEnergy" );
50  hRBXEnergy_ = ibooker.book1D(histo, histo, 300, 0, 3000);
51 
52  sprintf (histo, "hRBXEnergyType1" );
53  hRBXEnergyType1_ = ibooker.book1D(histo, histo, 300, 0, 3000);
54 
55  sprintf (histo, "hRBXEnergyType2" );
56  hRBXEnergyType2_ = ibooker.book1D(histo, histo, 300, 0, 3000);
57 
58  sprintf (histo, "hRBXEnergyType3" );
59  hRBXEnergyType3_ = ibooker.book1D(histo, histo, 300, 0, 3000);
60 
61  sprintf (histo, "hRBXNHits" );
62  hRBXNHits_ = ibooker.book1D(histo, histo, 73,-0.5,72.5);
63 
64 }
MonitorElement * hRBXEnergyType1_
MonitorElement * hRBXEnergy_
MonitorElement * hRBXEnergyType2_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:113
MonitorElement * hRBXEnergyType3_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * hLumiBlockCount_
MonitorElement * hRBXNHits_
void HcalNoiseRates::endJob ( void  )
privatevirtual

Definition at line 123 of file HcalNoiseRates.cc.

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

123  {
124 
125  if (useAllHistos_) hLumiBlockCount_->Fill(0.0, lumiCountMap_.size());
126 
127 }
void Fill(long long x)
MonitorElement * hLumiBlockCount_
std::map< int, int > lumiCountMap_

Member Data Documentation

MonitorElement* HcalNoiseRates::hLumiBlockCount_
private

Definition at line 63 of file HcalNoiseRates.h.

Referenced by bookHistograms(), and endJob().

MonitorElement* HcalNoiseRates::hRBXEnergy_
private

Definition at line 64 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::hRBXEnergyType1_
private

Definition at line 65 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::hRBXEnergyType2_
private

Definition at line 66 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::hRBXEnergyType3_
private

Definition at line 67 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* HcalNoiseRates::hRBXNHits_
private

Definition at line 68 of file HcalNoiseRates.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 71 of file HcalNoiseRates.h.

Referenced by analyze(), and endJob().

double HcalNoiseRates::minHitEnergy_
private

Definition at line 60 of file HcalNoiseRates.h.

Referenced by analyze(), and HcalNoiseRates().

double HcalNoiseRates::minRBXEnergy_
private

Definition at line 59 of file HcalNoiseRates.h.

Referenced by analyze(), and HcalNoiseRates().

std::string HcalNoiseRates::outputFile_
private

Definition at line 54 of file HcalNoiseRates.h.

Referenced by HcalNoiseRates().

edm::InputTag HcalNoiseRates::rbxCollName_
private

Definition at line 57 of file HcalNoiseRates.h.

Referenced by analyze(), and HcalNoiseRates().

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

Definition at line 58 of file HcalNoiseRates.h.

Referenced by analyze(), and HcalNoiseRates().

bool HcalNoiseRates::useAllHistos_
private

Definition at line 61 of file HcalNoiseRates.h.

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