Validation
EventGenerator
interface
BPhysicsValidation.h
Go to the documentation of this file.
1
#ifndef BPhysicsValidation_H
2
#define BPhysicsValidation_H
3
4
/*class BPhysicsValidation
5
*
6
* Class to fill Event Generator dqm monitor elements; works on HepMCProduct
7
*
8
*
9
*/
10
#include <iostream>
11
#include "TMath.h"
12
// framework & common header files
13
14
#include "
FWCore/Framework/interface/Event.h
"
15
#include "
FWCore/Framework/interface/EventSetup.h
"
16
#include "
FWCore/Framework/interface/Run.h
"
17
18
#include "
DataFormats/Common/interface/Handle.h
"
19
#include "
FWCore/Framework/interface/ESHandle.h
"
20
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
21
#include "
FWCore/Utilities/interface/InputTag.h
"
22
23
//DQM services
24
#include "
DQMServices/Core/interface/DQMStore.h
"
25
#include "
FWCore/ServiceRegistry/interface/Service.h
"
26
#include "
DQMServices/Core/interface/DQMEDAnalyzer.h
"
27
28
#include "
DataFormats/HepMCCandidate/interface/GenParticle.h
"
29
#include "
DataFormats/HepMCCandidate/interface/GenParticle.h
"
30
#include "
DataFormats/HepMCCandidate/interface/GenParticleFwd.h
"
31
32
#include "
Validation/EventGenerator/interface/DQMHelper.h
"
33
34
class
BPhysicsValidation
:
public
DQMEDAnalyzer
{
35
public
:
36
explicit
BPhysicsValidation
(
const
edm::ParameterSet
&);
37
~BPhysicsValidation
()
override
;
38
39
void
bookHistograms
(
DQMStore::IBooker
&
i
,
edm::Run
const
&,
edm::EventSetup
const
&)
override
;
40
void
analyze
(
edm::Event
const
&,
edm::EventSetup
const
&)
override
;
41
42
private
:
43
class
ParticleMonitor
{
44
public
:
45
ParticleMonitor
(
std::string
name_,
const
edm::ParameterSet
&p_)
46
:
p
(p_),
name
(name_),
pdgid
(
p
.getParameter<
int
>(
"pdgid"
)){};
47
~ParticleMonitor
(){};
48
49
void
Configure
(
DQMStore::IBooker
&
i
) {
50
std::string
pname
=
p
.
getParameter
<
std::string
>(
"pname"
);
51
double
mass_min =
p
.
getParameter
<
double
>(
"massmin"
);
52
double
mass_max =
p
.
getParameter
<
double
>(
"massmax"
);
53
DQMHelper
dqm
(&
i
);
54
i
.setCurrentFolder(
"Generator/BPhysics"
);
55
// Number of analyzed events
56
pt
=
dqm
.book1dHisto(
name
+
"PT"
,
"P_{t} of the "
+
pname
+
"s"
, 100, 0., 100,
"P_{t} (GeV)"
,
"Number of Events"
);
57
eta
=
dqm
.book1dHisto(
name
+
"ETA"
,
"#eta of the "
+
pname
+
"s"
, 100, -5., 5.,
"#eta"
,
"Number of Events"
);
58
phi
=
dqm
.book1dHisto(
59
name
+
"PHI"
,
"#phi of the "
+
pname
+
"s"
, 100, 0, 2 *
TMath::Pi
(),
"#phi"
,
"Number of Events"
);
60
mass
=
dqm
.book1dHisto(
61
name
+
"MASS"
,
"Mass of the "
+
pname
+
"s"
, 100, mass_min, mass_max,
"Mass (GeV)"
,
"Number of Events"
);
62
}
63
64
void
Fill
(
const
reco::GenParticle
*
p
,
double
weight
) {
65
if
(
abs
(
p
->pdgId()) ==
abs
(
pdgid
)) {
66
pt
->
Fill
(
p
->pt(),
weight
);
67
eta
->
Fill
(
p
->eta(),
weight
);
68
phi
->
Fill
(
p
->phi(),
weight
);
69
mass
->
Fill
(
p
->mass(),
weight
);
70
}
71
}
72
int
PDGID
() {
return
pdgid
; }
73
74
private
:
75
const
edm::ParameterSet
p
;
76
std::string
name
;
77
int
pdgid
;
78
MonitorElement
*
pt
, *
eta
, *
phi
, *
mass
;
79
};
80
81
void
FillDaughters
(
const
reco::GenParticle
*
p
);
82
edm::InputTag
genparticleCollection_
;
83
edm::EDGetTokenT<reco::GenParticleCollection>
genparticleCollectionToken_
;
84
std::string
name
;
85
ParticleMonitor
particle
;
86
std::vector<ParticleMonitor>
daughters
;
87
MonitorElement
*
Nobj
;
88
};
89
90
#endif
BPhysicsValidation::ParticleMonitor::eta
MonitorElement * eta
Definition:
BPhysicsValidation.h:78
dqm::impl::MonitorElement
Definition:
MonitorElement.h:99
Handle.h
BPhysicsValidation::bookHistograms
void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
Definition:
BPhysicsValidation.cc:28
mps_fire.i
i
Definition:
mps_fire.py:428
BPhysicsValidation::ParticleMonitor::pt
MonitorElement * pt
Definition:
BPhysicsValidation.h:78
ESHandle.h
BPhysicsValidation
Definition:
BPhysicsValidation.h:34
BPhysicsValidation::ParticleMonitor::mass
MonitorElement * mass
Definition:
BPhysicsValidation.h:78
reco::GenParticle
Definition:
GenParticle.h:21
edm::Run
Definition:
Run.h:45
edm::EDGetTokenT< reco::GenParticleCollection >
mps_merge.weight
weight
Definition:
mps_merge.py:88
DQMStore.h
BPhysicsValidation::FillDaughters
void FillDaughters(const reco::GenParticle *p)
Definition:
BPhysicsValidation.cc:50
GenParticle.h
DQMHelper.h
BPhysicsValidation::daughters
std::vector< ParticleMonitor > daughters
Definition:
BPhysicsValidation.h:86
BPhysicsValidation::Nobj
MonitorElement * Nobj
Definition:
BPhysicsValidation.h:87
BPhysicsValidation::ParticleMonitor::pdgid
int pdgid
Definition:
BPhysicsValidation.h:77
BPhysicsValidation::ParticleMonitor::p
const edm::ParameterSet p
Definition:
BPhysicsValidation.h:75
Service.h
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition:
MonitorElement.h:290
GenParticleFwd.h
BPhysicsValidation::ParticleMonitor::phi
MonitorElement * phi
Definition:
BPhysicsValidation.h:78
Run.h
BPhysicsValidation::ParticleMonitor::PDGID
int PDGID()
Definition:
BPhysicsValidation.h:72
unpackData-CaloStage2.pname
pname
Definition:
unpackData-CaloStage2.py:76
DQMEDAnalyzer.h
BPhysicsValidation::ParticleMonitor::Configure
void Configure(DQMStore::IBooker &i)
Definition:
BPhysicsValidation.h:49
DQMEDAnalyzer
Definition:
DQMEDAnalyzer.py:1
BPhysicsValidation::ParticleMonitor::Fill
void Fill(const reco::GenParticle *p, double weight)
Definition:
BPhysicsValidation.h:64
edm::ParameterSet
Definition:
ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
BPhysicsValidation::ParticleMonitor::ParticleMonitor
ParticleMonitor(std::string name_, const edm::ParameterSet &p_)
Definition:
BPhysicsValidation.h:45
Event.h
BPhysicsValidation::analyze
void analyze(edm::Event const &, edm::EventSetup const &) override
Definition:
BPhysicsValidation.cc:38
createfilelist.int
int
Definition:
createfilelist.py:10
BPhysicsValidation::ParticleMonitor
Definition:
BPhysicsValidation.h:43
BPhysicsValidation::particle
ParticleMonitor particle
Definition:
BPhysicsValidation.h:85
edm::EventSetup
Definition:
EventSetup.h:58
BPhysicsValidation::name
std::string name
Definition:
BPhysicsValidation.h:84
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
InputTag.h
DQMHelper
Definition:
DQMHelper.h:15
BPhysicsValidation::~BPhysicsValidation
~BPhysicsValidation() override
Definition:
BPhysicsValidation.cc:26
BPhysicsValidation::genparticleCollectionToken_
edm::EDGetTokenT< reco::GenParticleCollection > genparticleCollectionToken_
Definition:
BPhysicsValidation.h:83
BPhysicsValidation::BPhysicsValidation
BPhysicsValidation(const edm::ParameterSet &)
Definition:
BPhysicsValidation.cc:13
BPhysicsValidation::ParticleMonitor::name
std::string name
Definition:
BPhysicsValidation.h:76
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
dqm::implementation::IBooker
Definition:
DQMStore.h:43
Pi
const double Pi
Definition:
CosmicMuonParameters.h:18
dqm
Definition:
DQMStore.h:18
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
BPhysicsValidation::ParticleMonitor::~ParticleMonitor
~ParticleMonitor()
Definition:
BPhysicsValidation.h:47
ParameterSet.h
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
weight
Definition:
weight.py:1
BPhysicsValidation::genparticleCollection_
edm::InputTag genparticleCollection_
Definition:
BPhysicsValidation.h:82
Generated for CMSSW Reference Manual by
1.8.16