CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
BPhysicsSpectrum Class Reference

#include <BPhysicsSpectrum.h>

Inheritance diagram for BPhysicsSpectrum:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
void bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
 
 BPhysicsSpectrum (const edm::ParameterSet &)
 
 ~BPhysicsSpectrum () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

edm::InputTag genparticleCollection_
 
edm::EDGetTokenT< reco::GenParticleCollectiongenparticleCollectionToken_
 
MonitorElementmass
 
double mass_max
 
double mass_min
 
std::string name
 
MonitorElementNobj
 
std::vector< int > Particles
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 34 of file BPhysicsSpectrum.h.

Constructor & Destructor Documentation

◆ BPhysicsSpectrum()

BPhysicsSpectrum::BPhysicsSpectrum ( const edm::ParameterSet iPSet)
explicit

Definition at line 13 of file BPhysicsSpectrum.cc.

References genparticleCollection_, genparticleCollectionToken_, edm::ParameterSet::getParameter(), and Particles.

14  : genparticleCollection_(iPSet.getParameter<edm::InputTag>("genparticleCollection")),
15  // do not include weights right now to allow for running on aod
16  name(iPSet.getParameter<std::string>("name")),
17  mass_min(iPSet.getParameter<double>("massmin")),
18  mass_max(iPSet.getParameter<double>("massmax")) {
19  genparticleCollectionToken_ = consumes<reco::GenParticleCollection>(genparticleCollection_);
20  Particles = iPSet.getParameter<std::vector<int> >("pdgids");
21 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< reco::GenParticleCollection > genparticleCollectionToken_
edm::InputTag genparticleCollection_
std::vector< int > Particles

◆ ~BPhysicsSpectrum()

BPhysicsSpectrum::~BPhysicsSpectrum ( )
override

Definition at line 23 of file BPhysicsSpectrum.cc.

23 {}

Member Function Documentation

◆ analyze()

void BPhysicsSpectrum::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 32 of file BPhysicsSpectrum.cc.

References funct::abs(), dqm::impl::MonitorElement::Fill(), genparticleCollectionToken_, AJJGenJetFilter_cfi::genParticles, mps_fire::i, iEvent, mass, Nobj, and Particles.

32  {
35  for (reco::GenParticleCollection::const_iterator iter = genParticles->begin(); iter != genParticles->end(); ++iter) {
36  for (unsigned int i = 0; i < Particles.size(); i++) {
37  if (abs(iter->pdgId()) == abs(Particles[i])) {
38  Nobj->Fill(0.5, 1.0);
39  mass->Fill(iter->mass(), 1.0);
40  }
41  }
42  }
43 }
MonitorElement * Nobj
MonitorElement * mass
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::GenParticleCollection > genparticleCollectionToken_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< int > Particles

◆ bookHistograms()

void BPhysicsSpectrum::bookHistograms ( DQMStore::IBooker i,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 25 of file BPhysicsSpectrum.cc.

References mps_fire::i, mass, mass_max, mass_min, name, and Nobj.

25  {
26  DQMHelper dqm(&i);
27  i.setCurrentFolder("Generator/BPhysics");
28  Nobj = dqm.book1dHisto("NSpectrum" + name, "NSpectrum" + name, 1, 0., 1, "bin", "Number of " + name);
29  mass = dqm.book1dHisto(name + "Mass", "Mass Spectrum", 100, mass_min, mass_max, "Mass (GeV)", "Number of Events");
30 }
MonitorElement * Nobj
MonitorElement * mass
Definition: DQMStore.h:18

Member Data Documentation

◆ genparticleCollection_

edm::InputTag BPhysicsSpectrum::genparticleCollection_
private

Definition at line 44 of file BPhysicsSpectrum.h.

Referenced by BPhysicsSpectrum().

◆ genparticleCollectionToken_

edm::EDGetTokenT<reco::GenParticleCollection> BPhysicsSpectrum::genparticleCollectionToken_
private

Definition at line 45 of file BPhysicsSpectrum.h.

Referenced by analyze(), and BPhysicsSpectrum().

◆ mass

MonitorElement* BPhysicsSpectrum::mass
private

◆ mass_max

double BPhysicsSpectrum::mass_max
private

Definition at line 47 of file BPhysicsSpectrum.h.

Referenced by bookHistograms().

◆ mass_min

double BPhysicsSpectrum::mass_min
private

Definition at line 47 of file BPhysicsSpectrum.h.

Referenced by bookHistograms().

◆ name

std::string BPhysicsSpectrum::name
private

◆ Nobj

MonitorElement * BPhysicsSpectrum::Nobj
private

Definition at line 43 of file BPhysicsSpectrum.h.

Referenced by analyze(), and bookHistograms().

◆ Particles

std::vector<int> BPhysicsSpectrum::Particles
private

Definition at line 48 of file BPhysicsSpectrum.h.

Referenced by analyze(), and BPhysicsSpectrum().