CMS 3D CMS Logo

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

#include <BPhysicsValidation.h>

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

Classes

class  ParticleMonitor
 

Public Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
void bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
 
 BPhysicsValidation (const edm::ParameterSet &)
 
 ~BPhysicsValidation () 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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

void FillDaughters (const reco::GenParticle *p)
 

Private Attributes

std::vector< ParticleMonitordaughters
 
edm::InputTag genparticleCollection_
 
edm::EDGetTokenT< reco::GenParticleCollectiongenparticleCollectionToken_
 
std::string name
 
MonitorElementNobj
 
ParticleMonitor particle
 

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 >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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 BPhysicsValidation.h.

Constructor & Destructor Documentation

◆ BPhysicsValidation()

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

Definition at line 13 of file BPhysicsValidation.cc.

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  particle(name, iPSet) {
18  genparticleCollectionToken_ = consumes<reco::GenParticleCollection>(genparticleCollection_);
19  std::vector<std::string> daughterNames = iPSet.getParameter<std::vector<std::string> >("daughters");
20  for (unsigned int i = 0; i < daughterNames.size(); i++) {
21  std::string curSet = daughterNames[i];
22  daughters.push_back(ParticleMonitor(name + curSet, iPSet.getUntrackedParameter<ParameterSet>(curSet)));
23  }
24 }

References daughters, genparticleCollection_, genparticleCollectionToken_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), mps_fire::i, name, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~BPhysicsValidation()

BPhysicsValidation::~BPhysicsValidation ( )
override

Definition at line 26 of file BPhysicsValidation.cc.

26 {}

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 38 of file BPhysicsValidation.cc.

38  {
41  for (reco::GenParticleCollection::const_iterator iter = genParticles->begin(); iter != genParticles->end(); ++iter) {
42  if (abs(iter->pdgId()) == abs(particle.PDGID())) {
43  Nobj->Fill(0.5, 1.0);
44  particle.Fill(&(*iter), 1.0);
45  FillDaughters(&(*iter));
46  }
47  }
48 }

References funct::abs(), BPhysicsValidation::ParticleMonitor::Fill(), dqm::impl::MonitorElement::Fill(), FillDaughters(), genparticleCollectionToken_, genParticles2HepMC_cfi::genParticles, iEvent, Nobj, particle, and BPhysicsValidation::ParticleMonitor::PDGID().

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 28 of file BPhysicsValidation.cc.

28  {
29  DQMHelper dqm(&i);
30  i.setCurrentFolder("Generator/BPhysics");
31  Nobj = dqm.book1dHisto("N" + name, "N" + name, 1, 0., 1, "bin", "Number of " + name);
33  for (unsigned int j = 0; j < daughters.size(); j++) {
34  daughters[j].Configure(i);
35  }
36 }

References BPhysicsValidation::ParticleMonitor::Configure(), daughters, mps_fire::i, dqmiolumiharvest::j, name, Nobj, and particle.

◆ FillDaughters()

void BPhysicsValidation::FillDaughters ( const reco::GenParticle p)
private

Definition at line 50 of file BPhysicsValidation.cc.

50  {
51  int mpdgid = p->pdgId();
52  for (unsigned int i = 0; i < p->numberOfDaughters(); i++) {
53  const reco::GenParticle* dau = static_cast<const reco::GenParticle*>(p->daughter(i));
54  int pdgid = dau->pdgId();
55  for (unsigned int i = 0; i < daughters.size(); i++) {
56  if (abs(mpdgid) != abs(daughters[i].PDGID()) && daughters[i].PDGID() == pdgid)
57  daughters[i].Fill(dau, 1.0);
58  // note: use abs when comparing to mother to avoid mixing
59  }
60  FillDaughters(dau);
61  }
62 }

References funct::abs(), daughters, HcalObjRepresent::Fill(), mps_fire::i, AlCaHLTBitMon_ParallelJobs::p, EgammaValidation_cff::pdgid, and reco::LeafCandidate::pdgId().

Referenced by analyze().

Member Data Documentation

◆ daughters

std::vector<ParticleMonitor> BPhysicsValidation::daughters
private

Definition at line 86 of file BPhysicsValidation.h.

Referenced by bookHistograms(), BPhysicsValidation(), and FillDaughters().

◆ genparticleCollection_

edm::InputTag BPhysicsValidation::genparticleCollection_
private

Definition at line 82 of file BPhysicsValidation.h.

Referenced by BPhysicsValidation().

◆ genparticleCollectionToken_

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

Definition at line 83 of file BPhysicsValidation.h.

Referenced by analyze(), and BPhysicsValidation().

◆ name

std::string BPhysicsValidation::name
private

◆ Nobj

MonitorElement* BPhysicsValidation::Nobj
private

Definition at line 87 of file BPhysicsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ particle

ParticleMonitor BPhysicsValidation::particle
private

Definition at line 85 of file BPhysicsValidation.h.

Referenced by analyze(), and bookHistograms().

mps_fire.i
i
Definition: mps_fire.py:428
genParticles2HepMC_cfi.genParticles
genParticles
Definition: genParticles2HepMC_cfi.py:4
reco::GenParticle
Definition: GenParticle.h:21
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
BPhysicsValidation::FillDaughters
void FillDaughters(const reco::GenParticle *p)
Definition: BPhysicsValidation.cc:50
edm::Handle< reco::GenParticleCollection >
BPhysicsValidation::daughters
std::vector< ParticleMonitor > daughters
Definition: BPhysicsValidation.h:86
BPhysicsValidation::Nobj
MonitorElement * Nobj
Definition: BPhysicsValidation.h:87
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
BPhysicsValidation::ParticleMonitor::PDGID
int PDGID()
Definition: BPhysicsValidation.h:72
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
BPhysicsValidation::ParticleMonitor::Configure
void Configure(DQMStore::IBooker &i)
Definition: BPhysicsValidation.h:49
BPhysicsValidation::ParticleMonitor::Fill
void Fill(const reco::GenParticle *p, double weight)
Definition: BPhysicsValidation.h:64
edm::ParameterSet
Definition: ParameterSet.h:47
reco::LeafCandidate::pdgId
int pdgId() const final
PDG identifier.
Definition: LeafCandidate.h:176
iEvent
int iEvent
Definition: GenABIO.cc:224
BPhysicsValidation::particle
ParticleMonitor particle
Definition: BPhysicsValidation.h:85
BPhysicsValidation::name
std::string name
Definition: BPhysicsValidation.h:84
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
DQMHelper
Definition: DQMHelper.h:15
BPhysicsValidation::genparticleCollectionToken_
edm::EDGetTokenT< reco::GenParticleCollection > genparticleCollectionToken_
Definition: BPhysicsValidation.h:83
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqm
Definition: DQMStore.h:18
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
EgammaValidation_cff.pdgid
pdgid
Definition: EgammaValidation_cff.py:30
edm::InputTag
Definition: InputTag.h:15
BPhysicsValidation::genparticleCollection_
edm::InputTag genparticleCollection_
Definition: BPhysicsValidation.h:82