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::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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 &)
 
void dqmBeginRun (const edm::Run &r, const edm::EventSetup &c) override
 
 ~BPhysicsSpectrum () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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 edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 37 of file BPhysicsSpectrum.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file BPhysicsSpectrum.cc.

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

13  :
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 {
20  genparticleCollectionToken_=consumes<reco::GenParticleCollection>(genparticleCollection_);
21  Particles = iPSet.getParameter<std::vector<int> >("pdgids");
22 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::GenParticleCollection > genparticleCollectionToken_
edm::InputTag genparticleCollection_
std::vector< int > Particles
BPhysicsSpectrum::~BPhysicsSpectrum ( )
override

Definition at line 24 of file BPhysicsSpectrum.cc.

24 {}

Member Function Documentation

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

Reimplemented from DQMEDAnalyzer.

Definition at line 34 of file BPhysicsSpectrum.cc.

References funct::abs(), MonitorElement::Fill(), genparticleCollectionToken_, GenHFHadronMatcher_cfi::genParticles, edm::Event::getByToken(), mps_fire::i, mass, Nobj, and Particles.

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

Implements DQMEDAnalyzer.

Definition at line 28 of file BPhysicsSpectrum.cc.

References DQMHelper::book1dHisto(), mass, mass_max, mass_min, name, Nobj, and DQMStore::IBooker::setCurrentFolder().

28  {
29  DQMHelper dqm(&i); i.setCurrentFolder("Generator/BPhysics");
30  Nobj = dqm.book1dHisto("NSpectrum"+name, "NSpectrum"+name, 1, 0., 1,"bin","Number of "+name);
31  mass = dqm.book1dHisto(name+"Mass","Mass Spectrum", 100, mass_min, mass_max,"Mass (GeV)","Number of Events");
32 }
MonitorElement * Nobj
MonitorElement * mass
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
void BPhysicsSpectrum::dqmBeginRun ( const edm::Run r,
const edm::EventSetup c 
)
override

Definition at line 26 of file BPhysicsSpectrum.cc.

26 {}

Member Data Documentation

edm::InputTag BPhysicsSpectrum::genparticleCollection_
private

Definition at line 48 of file BPhysicsSpectrum.h.

Referenced by BPhysicsSpectrum().

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

Definition at line 49 of file BPhysicsSpectrum.h.

Referenced by analyze(), and BPhysicsSpectrum().

MonitorElement* BPhysicsSpectrum::mass
private
double BPhysicsSpectrum::mass_max
private

Definition at line 51 of file BPhysicsSpectrum.h.

Referenced by bookHistograms().

double BPhysicsSpectrum::mass_min
private

Definition at line 51 of file BPhysicsSpectrum.h.

Referenced by bookHistograms().

std::string BPhysicsSpectrum::name
private
MonitorElement * BPhysicsSpectrum::Nobj
private

Definition at line 47 of file BPhysicsSpectrum.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 52 of file BPhysicsSpectrum.h.

Referenced by analyze(), and BPhysicsSpectrum().