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
GeneratorInterface
LHEInterface
plugins
LHEWriter.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/Utilities/interface/InputTag.h
"
14
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
15
16
#include "
SimDataFormats/GeneratorProducts/interface/LHERunInfoProduct.h
"
17
#include "
SimDataFormats/GeneratorProducts/interface/LHEEventProduct.h
"
18
19
using namespace
lhef
;
20
21
class
LHEWriter
:
public
edm::EDAnalyzer
{
22
public
:
23
explicit
LHEWriter
(
const
edm::ParameterSet
&
params
);
24
~
LHEWriter
()
override
;
25
26
protected
:
27
void
beginRun(
const
edm::Run
&
run
,
const
edm::EventSetup
&es)
override
;
28
void
endRun
(
const
edm::Run
&
run
,
const
edm::EventSetup
&es)
override
;
29
void
analyze
(
const
edm::Event
&
event
,
const
edm::EventSetup
&es)
override
;
30
31
private
:
32
std::ofstream
file
;
33
std::ofstream
file1
;
34
35
edm::EDGetTokenT<LHERunInfoProduct>
tokenLHERunInfo_
;
36
edm::EDGetTokenT<LHEEventProduct>
tokenLHEEvent_
;
37
};
38
39
LHEWriter::LHEWriter
(
const
edm::ParameterSet
&
params
)
40
: tokenLHERunInfo_(consumes<
LHERunInfoProduct
,
edm
::
InRun
>(
41
params
.getUntrackedParameter<
edm
::
InputTag
>(
"moduleLabel"
,
std
::
string
(
"source"
)))),
42
tokenLHEEvent_(consumes<
LHEEventProduct
>(
43
params
.getUntrackedParameter<
edm
::
InputTag
>(
"moduleLabel"
,
std
::
string
(
"source"
)))) {}
44
45
LHEWriter::~LHEWriter
() {}
46
47
void
LHEWriter::beginRun
(
const
edm::Run
&
run
,
const
edm::EventSetup
&es) {
48
file
.open(
"writer.lhe"
,
std::fstream::out
|
std::fstream::trunc
);
49
file1
.open(
"writer1.lhe"
,
std::fstream::out
|
std::fstream::trunc
);
50
}
51
52
void
LHEWriter::endRun
(
const
edm::Run
&
run
,
const
edm::EventSetup
&es) {
53
edm::Handle<LHERunInfoProduct>
product;
54
//run.getByLabel("source", product);
55
run
.getByToken(
tokenLHERunInfo_
, product);
56
57
std::copy
(product->
begin
(), product->
end
(), std::ostream_iterator<std::string>(
file
));
58
59
file1
<<
LHERunInfoProduct::endOfFile
();
60
file
.close();
61
file1
.close();
62
63
system(
"cat writer1.lhe >> writer.lhe"
);
64
system(
"rm -rf writer1.lhe"
);
65
}
66
67
void
LHEWriter::analyze
(
const
edm::Event
&
event
,
const
edm::EventSetup
&es) {
68
edm::Handle<LHEEventProduct>
product;
69
//event.getByLabel("source", product);
70
event
.getByToken(
tokenLHEEvent_
, product);
71
72
std::copy
(product->
begin
(), product->
end
(), std::ostream_iterator<std::string>(
file1
));
73
}
74
75
DEFINE_FWK_MODULE
(
LHEWriter
);
Ecal2004TBTDCRanges_v1_cff.endRun
endRun
Definition:
Ecal2004TBTDCRanges_v1_cff.py:4
MessageLogger.h
LHEEventProduct
Definition:
LHEEventProduct.h:12
filterCSVwithJSON.copy
copy
Definition:
filterCSVwithJSON.py:36
LHEWriter::LHEWriter
LHEWriter(const edm::ParameterSet ¶ms)
Definition:
LHEWriter.cc:39
CalibrationSummaryClient_cfi.params
params
Definition:
CalibrationSummaryClient_cfi.py:14
edm::Run
Definition:
Run.h:45
edm::EDGetTokenT< LHERunInfoProduct >
edm
HLT enums.
Definition:
AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89301
LHEWriter::tokenLHEEvent_
edm::EDGetTokenT< LHEEventProduct > tokenLHEEvent_
Definition:
LHEWriter.cc:36
EDAnalyzer.h
edm::Handle
Definition:
AssociativeIterator.h:50
edm::InRun
Definition:
BranchType.h:11
LHEEventProduct::end
const_iterator end() const
Definition:
LHEEventProduct.h:100
edm::EDAnalyzer
Definition:
EDAnalyzer.h:28
LHEWriter::beginRun
void beginRun(const edm::Run &run, const edm::EventSetup &es) override
Definition:
LHEWriter.cc:47
LHEWriter::analyze
void analyze(const edm::Event &event, const edm::EventSetup &es) override
Definition:
LHEWriter.cc:67
LHERunInfoProduct.h
MakerMacros.h
LHERunInfoProduct
Definition:
LHERunInfoProduct.h:13
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
LHERunInfoProduct::end
const_iterator end() const
Definition:
LHERunInfoProduct.h:109
Run.h
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
lhef
Definition:
ExhumeHadronizer.h:12
LHEWriter::endRun
void endRun(const edm::Run &run, const edm::EventSetup &es) override
Definition:
LHEWriter.cc:52
LHERunInfoProduct::begin
const_iterator begin() const
Definition:
LHERunInfoProduct.cc:115
analyze
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EventSetup
Definition:
EventSetup.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
InputTag.h
LHEEventProduct.h
std
Definition:
JetResolutionObject.h:76
writedatasetfile.run
run
Definition:
writedatasetfile.py:27
LHEWriter::tokenLHERunInfo_
edm::EDGetTokenT< LHERunInfoProduct > tokenLHERunInfo_
Definition:
LHEWriter.cc:35
LHEWriter::file
std::ofstream file
Definition:
LHEWriter.cc:32
LHEWriter::file1
std::ofstream file1
Definition:
LHEWriter.cc:33
LHEWriter
Definition:
LHEWriter.cc:21
MillePedeFileConverter_cfg.out
out
Definition:
MillePedeFileConverter_cfg.py:31
LHEEventProduct::begin
const_iterator begin() const
Definition:
LHEEventProduct.cc:64
LHEWriter::~LHEWriter
~LHEWriter() override
Definition:
LHEWriter.cc:45
ParameterSet.h
event
Definition:
event.py:1
edm::Event
Definition:
Event.h:73
pileupReCalc_HLTpaths.trunc
trunc
Definition:
pileupReCalc_HLTpaths.py:143
LHERunInfoProduct::endOfFile
static const std::string & endOfFile()
Definition:
LHERunInfoProduct.cc:138
Generated for CMSSW Reference Manual by
1.8.16