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:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
 
 NoiseRates (const edm::ParameterSet &)
 
 ~NoiseRates ()
 
- 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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 &)
 

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 40 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::getUntrackedParameter(), minHitEnergy_, minRBXEnergy_, 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 }
T getUntrackedParameter(std::string const &, T const &) const
std::string outputFile_
Definition: NoiseRates.h:50
bool useAllHistos_
Definition: NoiseRates.h:57
double minRBXEnergy_
Definition: NoiseRates.h:55
edm::InputTag rbxCollName_
Definition: NoiseRates.h:53
double minHitEnergy_
Definition: NoiseRates.h:56
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > tok_rbx_
Definition: NoiseRates.h:54
NoiseRates::~NoiseRates ( )

Definition at line 35 of file NoiseRates.cc.

36 {
37 }

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 77 of file NoiseRates.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_.

78 {
79 
80  // get the lumi section
81  int lumiSection = iEvent.luminosityBlock();
82  lumiCountMap_[lumiSection]++;
83 
84  // get the RBX Noise collection
86  iEvent.getByToken(tok_rbx_,handle);
87  if(!handle.isValid()) {
89  << " could not find HcalNoiseRBXCollection named " << rbxCollName_ << ".\n";
90  return;
91  }
92 
93  // loop over the RBXs and fill the histograms
94  for(reco::HcalNoiseRBXCollection::const_iterator it=handle->begin(); it!=handle->end(); ++it) {
95  const reco::HcalNoiseRBX &rbx=(*it);
96 
97  double energy = rbx.recHitEnergy(minHitEnergy_);
98 
99  int nhits = rbx.numRecHits(minHitEnergy_);
100 
101  if(energy < minRBXEnergy_) continue;
102 
103  hRBXEnergy_->Fill(energy);
104 
105  if (nhits <= 9) hRBXEnergyType1_->Fill(energy);
106  else if (nhits <= 18) hRBXEnergyType2_->Fill(energy);
107  else hRBXEnergyType3_->Fill(energy);
108 
109  hRBXNHits_->Fill(nhits);
110 
111  } // done looping over RBXs
112 
113 }
MonitorElement * hRBXEnergy_
Definition: NoiseRates.h:60
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
int numRecHits(double threshold=1.5) const
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
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:75
edm::InputTag rbxCollName_
Definition: NoiseRates.h:53
MonitorElement * hRBXEnergyType1_
Definition: NoiseRates.h:61
double minHitEnergy_
Definition: NoiseRates.h:56
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > tok_rbx_
Definition: NoiseRates.h:54
void NoiseRates::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  run,
edm::EventSetup const &  es 
)
virtual

Implements DQMEDAnalyzer.

Definition at line 44 of file NoiseRates.cc.

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

45 {
46 
47  ib.setCurrentFolder("NoiseRatesV/NoiseRatesTask");
48 
49  // book histograms
50  Char_t histo[100];
51 
52  //Lumi block is not drawn; the rest are
53  if (useAllHistos_){
54  sprintf (histo, "hLumiBlockCount" );
55  hLumiBlockCount_ = ib.book1D(histo, histo, 1, -0.5, 0.5);
56  }
57 
58  sprintf (histo, "hRBXEnergy" );
59  hRBXEnergy_ = ib.book1D(histo, histo, 300, 0, 3000);
60 
61  sprintf (histo, "hRBXEnergyType1" );
62  hRBXEnergyType1_ = ib.book1D(histo, histo, 300, 0, 3000);
63 
64  sprintf (histo, "hRBXEnergyType2" );
65  hRBXEnergyType2_ = ib.book1D(histo, histo, 300, 0, 3000);
66 
67  sprintf (histo, "hRBXEnergyType3" );
68  hRBXEnergyType3_ = ib.book1D(histo, histo, 300, 0, 3000);
69 
70  sprintf (histo, "hRBXNHits" );
71  hRBXNHits_ = ib.book1D(histo, histo, 73,-0.5,72.5);
72 
73 }
MonitorElement * hRBXEnergy_
Definition: NoiseRates.h:60
bool useAllHistos_
Definition: NoiseRates.h:57
MonitorElement * hRBXEnergyType3_
Definition: NoiseRates.h:63
MonitorElement * hLumiBlockCount_
Definition: NoiseRates.h:59
MonitorElement * hRBXNHits_
Definition: NoiseRates.h:64
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * hRBXEnergyType2_
Definition: NoiseRates.h:62
MonitorElement * hRBXEnergyType1_
Definition: NoiseRates.h:61
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274

Member Data Documentation

MonitorElement* NoiseRates::hLumiBlockCount_
private

Definition at line 59 of file NoiseRates.h.

Referenced by bookHistograms().

MonitorElement* NoiseRates::hRBXEnergy_
private

Definition at line 60 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hRBXEnergyType1_
private

Definition at line 61 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hRBXEnergyType2_
private

Definition at line 62 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hRBXEnergyType3_
private

Definition at line 63 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* NoiseRates::hRBXNHits_
private

Definition at line 64 of file NoiseRates.h.

Referenced by analyze(), and bookHistograms().

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 50 of file NoiseRates.h.

Referenced by NoiseRates().

edm::InputTag NoiseRates::rbxCollName_
private

Definition at line 53 of file NoiseRates.h.

Referenced by analyze(), and NoiseRates().

edm::EDGetTokenT<reco::HcalNoiseRBXCollection> NoiseRates::tok_rbx_
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 bookHistograms(), and NoiseRates().