Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
d
e
f
l
m
o
p
s
t
u
v
Related Functions
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Package Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
IOMC
Input
plugins
HepMCEventWriter.cc
Go to the documentation of this file.
1
#include <algorithm>
2
#include <iostream>
3
#include <iterator>
4
#include <fstream>
5
#include <string>
6
#include <memory>
7
8
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
9
#include "
FWCore/Framework/interface/MakerMacros.h
"
10
#include "
FWCore/Framework/interface/Event.h
"
11
#include "
FWCore/Framework/interface/Run.h
"
12
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
13
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
14
#include "
FWCore/Utilities/interface/InputTag.h
"
15
#include "
FWCore/Utilities/interface/propagate_const.h
"
16
#include "
SimDataFormats/GeneratorProducts/interface/HepMCProduct.h
"
17
18
#include "HepMC/IO_GenEvent.h"
19
20
class
HepMCEventWriter
:
public
edm::EDAnalyzer
{
21
public
:
22
explicit
HepMCEventWriter
(
const
edm::ParameterSet
&
params
);
23
~HepMCEventWriter
()
override
;
24
25
protected
:
26
void
beginRun
(
const
edm::Run
&
run
,
const
edm::EventSetup
&es)
override
;
27
void
endRun
(
const
edm::Run
&
run
,
const
edm::EventSetup
&es)
override
;
28
void
analyze
(
const
edm::Event
&
event
,
const
edm::EventSetup
&es)
override
;
29
30
private
:
31
edm::propagate_const<HepMC::IO_GenEvent *>
_output
;
32
edm::InputTag
hepMCProduct_
;
33
};
34
35
HepMCEventWriter::HepMCEventWriter
(
const
edm::ParameterSet
&
params
)
36
: hepMCProduct_(
params
.getParameter<
edm
::
InputTag
>(
"hepMCProduct"
)) {}
37
38
HepMCEventWriter::~HepMCEventWriter
() {}
39
40
void
HepMCEventWriter::beginRun
(
const
edm::Run
&
run
,
const
edm::EventSetup
&es) {
41
_output
=
new
HepMC::IO_GenEvent(
"GenEvent_ASCII.dat"
,
std::ios::out
);
42
}
43
44
void
HepMCEventWriter::endRun
(
const
edm::Run
&
run
,
const
edm::EventSetup
&es) {
45
if
(
_output
)
46
delete
_output
.
get
();
47
}
48
49
void
HepMCEventWriter::analyze
(
const
edm::Event
&
event
,
const
edm::EventSetup
&es) {
50
edm::Handle<edm::HepMCProduct>
product;
51
event
.getByLabel(
hepMCProduct_
, product);
52
53
const
HepMC::GenEvent
*evt = product->
GetEvent
();
54
55
_output
->write_event(evt);
56
}
57
58
DEFINE_FWK_MODULE
(
HepMCEventWriter
);
MessageLogger.h
propagate_const.h
CalibrationSummaryClient_cfi.params
params
Definition:
CalibrationSummaryClient_cfi.py:14
edm::Run
Definition:
Run.h:45
edm
HLT enums.
Definition:
AlignableModifier.h:19
HepMCEventWriter::HepMCEventWriter
HepMCEventWriter(const edm::ParameterSet ¶ms)
Definition:
HepMCEventWriter.cc:35
HepMCEventWriter::_output
edm::propagate_const< HepMC::IO_GenEvent * > _output
Definition:
HepMCEventWriter.cc:31
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89301
edm::propagate_const::get
constexpr element_type const * get() const
Definition:
propagate_const.h:64
EDAnalyzer.h
edm::Handle< edm::HepMCProduct >
HepMC::GenEvent
Definition:
hepmc_rootio.cc:9
edm::EDAnalyzer
Definition:
EDAnalyzer.h:28
MakerMacros.h
HepMCEventWriter
Definition:
HepMCEventWriter.cc:20
edm::propagate_const< HepMC::IO_GenEvent * >
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
Run.h
HepMCEventWriter::endRun
void endRun(const edm::Run &run, const edm::EventSetup &es) override
Definition:
HepMCEventWriter.cc:44
edm::ParameterSet
Definition:
ParameterSet.h:47
HepMCEventWriter::analyze
void analyze(const edm::Event &event, const edm::EventSetup &es) override
Definition:
HepMCEventWriter.cc:49
Event.h
edm::EventSetup
Definition:
EventSetup.h:58
edm::HepMCProduct::GetEvent
const HepMC::GenEvent * GetEvent() const
Definition:
HepMCProduct.h:37
InputTag.h
HepMCEventWriter::beginRun
void beginRun(const edm::Run &run, const edm::EventSetup &es) override
Definition:
HepMCEventWriter.cc:40
writedatasetfile.run
run
Definition:
writedatasetfile.py:27
HepMCEventWriter::~HepMCEventWriter
~HepMCEventWriter() override
Definition:
HepMCEventWriter.cc:38
MillePedeFileConverter_cfg.out
out
Definition:
MillePedeFileConverter_cfg.py:31
ParameterSet.h
HepMCProduct.h
HepMCEventWriter::hepMCProduct_
edm::InputTag hepMCProduct_
Definition:
HepMCEventWriter.cc:32
event
Definition:
event.py:1
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
Generated for CMSSW Reference Manual by
1.8.16