PhysicsTools
NanoAOD
plugins
NativeArrayTableProducer.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
2
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
3
#include "
DataFormats/NanoAOD/interface/FlatTable.h
"
4
5
#include <vector>
6
7
template
<
typename
TIn,
typename
TCol, nanoaod::FlatTable::ColumnType CT>
8
class
NativeArrayTableProducer
:
public
edm::stream::EDProducer
<> {
9
public
:
10
NativeArrayTableProducer
(
edm::ParameterSet
const
&
params
)
11
:
name_
(
params
.getParameter<
std
::
string
>(
"name"
)),
12
doc_
(
params
.existsAs<
std
::
string
>(
"doc"
) ?
params
.getParameter<
std
::
string
>(
"doc"
) :
""
),
13
src_
(consumes<TIn>(
params
.getParameter<
edm
::
InputTag
>(
"src"
))) {
14
produces<nanoaod::FlatTable>();
15
}
16
17
~NativeArrayTableProducer
()
override
{}
18
19
void
produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup)
override
{
20
edm::Handle<TIn>
src
;
21
iEvent
.getByToken(
src_
,
src
);
22
23
const
auto
&
in
= *
src
;
24
auto
out
= std::make_unique<nanoaod::FlatTable>(
in
.size(),
name_
,
false
,
false
);
25
out
->setDoc(
doc_
);
26
(*out).template addColumn<TCol>(this->
name_
,
in
, this->
doc_
, CT);
27
iEvent
.put(
std::move
(
out
));
28
}
29
30
protected
:
31
const
std::string
name_
;
32
const
std::string
doc_
;
33
const
edm::EDGetTokenT<TIn>
src_
;
34
};
35
36
typedef
NativeArrayTableProducer<std::vector<float>
,
float
,
nanoaod::FlatTable::FloatColumn
>
FloatArrayTableProducer
;
37
typedef
NativeArrayTableProducer<std::vector<double>
,
float
,
nanoaod::FlatTable::FloatColumn
>
DoubleArrayTableProducer
;
38
typedef
NativeArrayTableProducer<std::vector<int>
,
int
,
nanoaod::FlatTable::IntColumn
>
IntArrayTableProducer
;
39
typedef
NativeArrayTableProducer<std::vector<bool>
, uint8_t,
nanoaod::FlatTable::UInt8Column
>
BoolArrayTableProducer
;
40
41
#include "
FWCore/Framework/interface/MakerMacros.h
"
42
DEFINE_FWK_MODULE
(
FloatArrayTableProducer
);
43
DEFINE_FWK_MODULE
(
DoubleArrayTableProducer
);
44
DEFINE_FWK_MODULE
(
IntArrayTableProducer
);
45
DEFINE_FWK_MODULE
(
BoolArrayTableProducer
);
nanoaod::FlatTable::FloatColumn
Definition:
FlatTable.h:39
dqmMemoryStats.float
float
Definition:
dqmMemoryStats.py:127
CalibrationSummaryClient_cfi.params
params
Definition:
CalibrationSummaryClient_cfi.py:14
edm::EDGetTokenT< TIn >
edm
HLT enums.
Definition:
AlignableModifier.h:19
BoolArrayTableProducer
NativeArrayTableProducer< std::vector< bool >, uint8_t, nanoaod::FlatTable::UInt8Column > BoolArrayTableProducer
Definition:
NativeArrayTableProducer.cc:39
EDProducer.h
edm::Handle
Definition:
AssociativeIterator.h:50
NativeArrayTableProducer
Definition:
NativeArrayTableProducer.cc:8
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
NativeArrayTableProducer::produce
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
Definition:
NativeArrayTableProducer.cc:19
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
NativeArrayTableProducer::~NativeArrayTableProducer
~NativeArrayTableProducer() override
Definition:
NativeArrayTableProducer.cc:17
IntArrayTableProducer
NativeArrayTableProducer< std::vector< int >, int, nanoaod::FlatTable::IntColumn > IntArrayTableProducer
Definition:
NativeArrayTableProducer.cc:38
HLT_2018_cff.InputTag
InputTag
Definition:
HLT_2018_cff.py:79016
edm::ParameterSet
Definition:
ParameterSet.h:36
TrackRefitter_38T_cff.src
src
Definition:
TrackRefitter_38T_cff.py:24
recoMuon::in
Definition:
RecoMuonEnumerators.h:6
NativeArrayTableProducer::doc_
const std::string doc_
Definition:
NativeArrayTableProducer.cc:32
createfilelist.int
int
Definition:
createfilelist.py:10
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::stream::EDProducer
Definition:
EDProducer.h:38
edm::EventSetup
Definition:
EventSetup.h:57
nanoaod::FlatTable::UInt8Column
Definition:
FlatTable.h:41
FlatTable.h
NativeArrayTableProducer::NativeArrayTableProducer
NativeArrayTableProducer(edm::ParameterSet const ¶ms)
Definition:
NativeArrayTableProducer.cc:10
nanoaod::FlatTable::IntColumn
Definition:
FlatTable.h:40
eostools.move
def move(src, dest)
Definition:
eostools.py:511
std
Definition:
JetResolutionObject.h:76
FloatArrayTableProducer
NativeArrayTableProducer< std::vector< float >, float, nanoaod::FlatTable::FloatColumn > FloatArrayTableProducer
Definition:
NativeArrayTableProducer.cc:36
NativeArrayTableProducer::src_
const edm::EDGetTokenT< TIn > src_
Definition:
NativeArrayTableProducer.cc:33
DoubleArrayTableProducer
NativeArrayTableProducer< std::vector< double >, float, nanoaod::FlatTable::FloatColumn > DoubleArrayTableProducer
Definition:
NativeArrayTableProducer.cc:37
MillePedeFileConverter_cfg.out
out
Definition:
MillePedeFileConverter_cfg.py:31
ParameterSet.h
NativeArrayTableProducer::name_
const std::string name_
Definition:
NativeArrayTableProducer.cc:31
edm::Event
Definition:
Event.h:73
Generated for CMSSW Reference Manual by
1.8.16