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
L1Trigger
L1TGEM
plugins
ME0PadDigiProducer.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
2
#include "
FWCore/Framework/interface/MakerMacros.h
"
3
#include "
FWCore/Framework/interface/ESHandle.h
"
4
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
5
#include "
FWCore/Framework/interface/Event.h
"
6
#include "
FWCore/Framework/interface/EventSetup.h
"
7
#include "
FWCore/Utilities/interface/Exception.h
"
8
#include "
FWCore/Utilities/interface/InputTag.h
"
9
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
10
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
11
12
#include "
DataFormats/Common/interface/Handle.h
"
13
#include "
DataFormats/GEMDigi/interface/ME0DigiCollection.h
"
14
#include "
DataFormats/GEMDigi/interface/ME0PadDigiCollection.h
"
15
16
#include "
Geometry/Records/interface/MuonGeometryRecord.h
"
17
#include "
Geometry/GEMGeometry/interface/ME0Geometry.h
"
18
19
#include <set>
20
22
23
class
ME0PadDigiProducer
:
public
edm::stream::EDProducer
<> {
24
public
:
25
explicit
ME0PadDigiProducer
(
const
edm::ParameterSet
& ps);
26
27
~ME0PadDigiProducer
()
override
;
28
29
void
beginRun
(
const
edm::Run
&,
const
edm::EventSetup
&)
override
;
30
31
void
produce
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
32
33
private
:
34
void
buildPads
(
const
ME0DigiCollection
& digis,
ME0PadDigiCollection
& out_pads)
const
;
35
37
edm::EDGetTokenT<ME0DigiCollection>
digi_token_
;
38
edm::InputTag
digis_
;
39
40
const
ME0Geometry
*
geometry_
;
41
};
42
43
ME0PadDigiProducer::ME0PadDigiProducer
(
const
edm::ParameterSet
& ps) : geometry_(nullptr) {
44
digis_
= ps.
getParameter
<
edm::InputTag
>(
"InputCollection"
);
45
46
digi_token_
= consumes<ME0DigiCollection>(
digis_
);
47
48
produces<ME0PadDigiCollection>();
49
}
50
51
ME0PadDigiProducer::~ME0PadDigiProducer
() {}
52
53
void
ME0PadDigiProducer::beginRun
(
const
edm::Run
&
run
,
const
edm::EventSetup
& eventSetup) {
54
edm::ESHandle<ME0Geometry>
hGeom;
55
eventSetup.
get
<
MuonGeometryRecord
>().
get
(hGeom);
56
geometry_
= &*hGeom;
57
}
58
59
void
ME0PadDigiProducer::produce
(
edm::Event
&
e
,
const
edm::EventSetup
& eventSetup) {
60
edm::Handle<ME0DigiCollection>
hdigis;
61
e
.getByToken(
digi_token_
, hdigis);
62
63
// Create empty output
64
std::unique_ptr<ME0PadDigiCollection> pPads(
new
ME0PadDigiCollection
());
65
66
// build the pads
67
buildPads
(*(hdigis.
product
()), *pPads);
68
69
// store them in the event
70
e
.put(
std::move
(pPads));
71
}
72
73
void
ME0PadDigiProducer::buildPads
(
const
ME0DigiCollection
& det_digis,
ME0PadDigiCollection
& out_pads)
const
{
74
for
(
const
auto
&
p
:
geometry_
->
etaPartitions
()) {
75
// set of <pad, bx> pairs, sorted first by pad then by bx
76
std::set<std::pair<int, int> > proto_pads;
77
78
// walk over digis in this partition,
79
// and stuff them into a set of unique pads (equivalent of OR operation)
80
auto
digis = det_digis.get(
p
->id());
81
for
(
auto
d
= digis.first;
d
!= digis.second; ++
d
) {
82
int
pad_num = 1 + static_cast<int>(
p
->padOfStrip(
d
->strip()));
83
proto_pads.emplace(pad_num,
d
->bx());
84
}
85
86
// fill the output collections
87
for
(
const
auto
&
d
: proto_pads) {
88
ME0PadDigi
pad_digi(
d
.first,
d
.second);
89
out_pads.insertDigi(
p
->id(), pad_digi);
90
}
91
}
92
}
93
94
DEFINE_FWK_MODULE
(
ME0PadDigiProducer
);
ME0Geometry::etaPartitions
const std::vector< ME0EtaPartition const * > & etaPartitions() const
Return a vector of all ME0 eta partitions.
Definition:
ME0Geometry.cc:33
Handle.h
ME0DigiCollection.h
MessageLogger.h
edm::Handle::product
T const * product() const
Definition:
Handle.h:70
ME0PadDigiCollection
ESHandle.h
edm::Run
Definition:
Run.h:45
ME0PadDigiCollection
MuonDigiCollection< ME0DetId, ME0PadDigi > ME0PadDigiCollection
Definition:
ME0PadDigiCollection.h:13
edm::EDGetTokenT< ME0DigiCollection >
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
ME0Geometry
Definition:
ME0Geometry.h:12
EDProducer.h
edm::Handle
Definition:
AssociativeIterator.h:50
ME0DigiCollection
MakerMacros.h
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:73
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
ME0PadDigiProducer::digis_
edm::InputTag digis_
Definition:
ME0PadDigiProducer.cc:38
edm::ESHandle< ME0Geometry >
ME0PadDigiCollection.h
ME0PadDigiProducer::buildPads
void buildPads(const ME0DigiCollection &digis, ME0PadDigiCollection &out_pads) const
Definition:
ME0PadDigiProducer.cc:73
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
ME0PadDigiProducer::~ME0PadDigiProducer
~ME0PadDigiProducer() override
Definition:
ME0PadDigiProducer.cc:51
edm::stream::EDProducer
Definition:
EDProducer.h:38
edm::EventSetup
Definition:
EventSetup.h:57
get
#define get
InputTag.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ME0Geometry.h
ME0PadDigiProducer::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition:
ME0PadDigiProducer.cc:53
eostools.move
def move(src, dest)
Definition:
eostools.py:511
writedatasetfile.run
run
Definition:
writedatasetfile.py:27
ME0PadDigiProducer
Definition:
ME0PadDigiProducer.cc:23
ME0PadDigiProducer::ME0PadDigiProducer
ME0PadDigiProducer(const edm::ParameterSet &ps)
Definition:
ME0PadDigiProducer.cc:43
ME0PadDigiProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
ME0PadDigiProducer.cc:59
EventSetup.h
ME0PadDigiProducer::geometry_
const ME0Geometry * geometry_
Definition:
ME0PadDigiProducer.cc:40
Exception.h
ztail.d
d
Definition:
ztail.py:151
ConsumesCollector.h
ParameterSet.h
MuonGeometryRecord.h
ME0PadDigi
Definition:
ME0PadDigi.h:15
edm::Event
Definition:
Event.h:73
MuonGeometryRecord
Definition:
MuonGeometryRecord.h:34
edm::InputTag
Definition:
InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
ME0PadDigiProducer::digi_token_
edm::EDGetTokenT< ME0DigiCollection > digi_token_
Name of input digi Collection.
Definition:
ME0PadDigiProducer.cc:37
Generated for CMSSW Reference Manual by
1.8.16