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 Attributes
BPhysicsSpectrum Class Reference

#include <BPhysicsSpectrum.h>

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

Public Member Functions

virtual void analyze (edm::Event const &, edm::EventSetup const &) override
 
virtual void bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
 
 BPhysicsSpectrum (const edm::ParameterSet &)
 
virtual void dqmBeginRun (const edm::Run &r, const edm::EventSetup &c) override
 
virtual ~BPhysicsSpectrum ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 Attributes

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

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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::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 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 ( )
virtual

Definition at line 24 of file BPhysicsSpectrum.cc.

24 {}

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 34 of file BPhysicsSpectrum.cc.

References funct::abs(), MonitorElement::Fill(), genparticleCollectionToken_, genParticleCandidates2GenParticles_cfi::genParticles, edm::Event::getByToken(), 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 }
int i
Definition: DBlmapReader.cc:9
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:276
void BPhysicsSpectrum::dqmBeginRun ( const edm::Run r,
const edm::EventSetup c 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

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().