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
TopQuarkAnalysis
TopEventProducers
src
TopInitSubset.cc
Go to the documentation of this file.
1
#include "
TopQuarkAnalysis/TopEventProducers/interface/TopInitSubset.h
"
2
3
TopInitSubset::TopInitSubset
(
const
edm::ParameterSet
&
cfg
)
4
: srcToken_(consumes<
reco
::
GenParticleCollection
>(
cfg
.getParameter<
edm
::
InputTag
>(
"src"
))) {
5
produces<reco::GenParticleCollection>();
6
}
7
8
TopInitSubset::~TopInitSubset
() {}
9
10
void
TopInitSubset::produce
(
edm::Event
& evt,
const
edm::EventSetup
&
setup
) {
11
edm::Handle<reco::GenParticleCollection>
src
;
12
evt.
getByToken
(
srcToken_
,
src
);
13
14
const
reco::GenParticleRefProd
ref = evt.
getRefBeforePut
<
reco::GenParticleCollection
>();
15
std::unique_ptr<reco::GenParticleCollection>
sel
(
new
reco::GenParticleCollection
);
16
17
//fill output collection
18
fillOutput
(*
src
, *
sel
);
19
20
evt.
put
(
std::move
(
sel
));
21
}
22
23
void
TopInitSubset::fillOutput
(
const
reco::GenParticleCollection
&
src
,
reco::GenParticleCollection
&
sel
) {
24
for
(reco::GenParticleCollection::const_iterator
t
=
src
.begin();
t
!=
src
.end(); ++
t
) {
25
if
(
std::abs
(
t
->pdgId()) ==
TopInitID::tID
) {
26
bool
hasTopMother =
false
;
27
for
(
unsigned
idx
= 0;
idx
<
t
->numberOfMothers(); ++
idx
)
28
if
(
std::abs
(
t
->mother(
idx
)->pdgId()) ==
TopInitID::tID
)
29
hasTopMother =
true
;
30
if
(hasTopMother)
31
continue
;
32
for
(
unsigned
idx
= 0;
idx
<
t
->numberOfMothers(); ++
idx
) {
33
reco::GenParticle
*
cand
=
new
reco::GenParticle
(
t
->mother(
idx
)->threeCharge(),
34
t
->mother(
idx
)->p4(),
35
t
->mother(
idx
)->vertex(),
36
t
->mother(
idx
)->pdgId(),
37
t
->mother(
idx
)->status(),
38
false
);
39
std::unique_ptr<reco::GenParticle> ptr(
cand
);
40
sel
.push_back(*ptr);
41
}
42
break
;
43
}
44
}
45
}
edm::RefProd< GenParticleCollection >
edm::Event::getRefBeforePut
RefProd< PROD > getRefBeforePut()
Definition:
Event.h:157
TopInitSubset::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
TopInitSubset.cc:10
reco::GenParticle
Definition:
GenParticle.h:21
TopInitSubset::srcToken_
edm::EDGetTokenT< reco::GenParticleCollection > srcToken_
Definition:
TopInitSubset.h:22
edm
HLT enums.
Definition:
AlignableModifier.h:19
reco::GenParticleCollection
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
Definition:
GenParticleFwd.h:13
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
edm::Handle< reco::GenParticleCollection >
training_settings.idx
idx
Definition:
training_settings.py:16
singleTopDQM_cfi.setup
setup
Definition:
singleTopDQM_cfi.py:37
TopInitSubset.h
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:528
OrderedSet.t
t
Definition:
OrderedSet.py:90
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
cand
Definition:
decayParser.h:34
TopInitSubset::TopInitSubset
TopInitSubset(const edm::ParameterSet &)
Definition:
TopInitSubset.cc:3
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition:
Event.h:132
edm::EventSetup
Definition:
EventSetup.h:57
looper.cfg
cfg
Definition:
looper.py:297
GenParticle.GenParticle
GenParticle
Definition:
GenParticle.py:18
eostools.move
def move(src, dest)
Definition:
eostools.py:511
TopInitID::tID
static const int tID
Definition:
TopInitSubset.h:10
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
EgammaValidation_Wenu_cff.sel
sel
Definition:
EgammaValidation_Wenu_cff.py:33
TopInitSubset::fillOutput
void fillOutput(const reco::GenParticleCollection &, reco::GenParticleCollection &)
Definition:
TopInitSubset.cc:23
edm::Event
Definition:
Event.h:73
TopInitSubset::~TopInitSubset
~TopInitSubset() override
Definition:
TopInitSubset.cc:8
Generated for CMSSW Reference Manual by
1.8.16