Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
TopQuarkAnalysis
TopSkimming
interface
TopDecayChannelFilter.h
Go to the documentation of this file.
1
#include "
AnalysisDataFormats/TopObjects/interface/TtGenEvent.h
"
2
#include "
FWCore/Framework/interface/Event.h
"
3
#include "
FWCore/Framework/interface/EDFilter.h
"
4
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
5
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
6
#include "
DataFormats/HepMCCandidate/interface/GenParticle.h
"
7
8
template
<
typename
S>
9
class
TopDecayChannelFilter
:
public
edm::EDFilter
{
10
public
:
11
TopDecayChannelFilter
(
const
edm::ParameterSet
&);
12
~TopDecayChannelFilter
();
13
14
private
:
15
virtual
bool
filter
(
edm::Event
&,
const
edm::EventSetup
&);
16
edm::InputTag
src_
;
17
edm::EDGetTokenT<TtGenEvent>
genEvt_
;
18
edm::EDGetTokenT<reco::GenParticleCollection>
parts_
;
19
S
sel_
;
20
bool
checkedSrcType_
;
21
bool
useTtGenEvent_
;
22
};
23
24
template
<
typename
S>
25
TopDecayChannelFilter<S>::TopDecayChannelFilter
(
const
edm::ParameterSet
&
cfg
):
26
src_( cfg.
template
getParameter<edm::
InputTag
>(
"src"
) ),
27
genEvt_
( mayConsume<
TtGenEvent
>( src_ ) ),
28
parts_( mayConsume<
reco
::
GenParticleCollection
>( src_ ) ),
29
sel_( cfg ),
30
checkedSrcType_(0), useTtGenEvent_(0)
31
{ }
32
33
template
<
typename
S>
34
TopDecayChannelFilter<S>::~TopDecayChannelFilter
()
35
{ }
36
37
template
<
typename
S>
38
bool
39
TopDecayChannelFilter<S>::filter
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup)
40
{
41
edm::Handle<reco::GenParticleCollection>
parts
;
42
edm::Handle<TtGenEvent>
genEvt
;
43
44
if
(!checkedSrcType_) {
45
checkedSrcType_ =
true
;
46
if
(iEvent.
getByToken
(
genEvt_
, genEvt )) {
47
useTtGenEvent_ =
true
;
48
return
sel_( genEvt->particles(), src_.label() );
49
}
50
}
51
else
{
52
if
(useTtGenEvent_) {
53
iEvent.
getByToken
(
genEvt_
, genEvt );
54
return
sel_( genEvt->particles(), src_.label() );
55
}
56
}
57
iEvent.
getByToken
( parts_, parts );
58
return
sel_( *parts, src_.label() );
59
}
reco::GenParticleCollection
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
Definition:
GenParticleFwd.h:10
TopDecayChannelFilter::useTtGenEvent_
bool useTtGenEvent_
Definition:
TopDecayChannelFilter.h:21
TopDecayChannelFilter::src_
edm::InputTag src_
Definition:
TopDecayChannelFilter.h:16
looper.cfg
tuple cfg
Definition:
looper.py:293
TopDecayChannelFilter::~TopDecayChannelFilter
~TopDecayChannelFilter()
Definition:
TopDecayChannelFilter.h:34
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:464
GenParticle.h
Event.h
edm::Handle< reco::GenParticleCollection >
TtGenEvent.h
dt_dqm_sourceclient_common_cff.reco
tuple reco
Definition:
dt_dqm_sourceclient_common_cff.py:106
HLT_25ns14e33_v1_cff.InputTag
tuple InputTag
Definition:
HLT_25ns14e33_v1_cff.py:45333
edm::EDGetTokenT< TtGenEvent >
Frameworkfwd.h
contentValuesFiles.parts
parts
Definition:
contentValuesFiles.py:58
ParameterSet.h
TtGenEvtProducer_cfi.genEvt
tuple genEvt
Definition:
TtGenEvtProducer_cfi.py:7
iEvent
int iEvent
Definition:
GenABIO.cc:230
TtGenEvent
Class derived from the TopGenEvent for ttbar events.
Definition:
TtGenEvent.h:18
TopDecayChannelFilter::checkedSrcType_
bool checkedSrcType_
Definition:
TopDecayChannelFilter.h:20
TopDecayChannelFilter::TopDecayChannelFilter
TopDecayChannelFilter(const edm::ParameterSet &)
Definition:
TopDecayChannelFilter.h:25
EDFilter.h
TopDecayChannelFilter
Definition:
TopDecayChannelFilter.h:9
TopDecayChannelFilter::parts_
edm::EDGetTokenT< reco::GenParticleCollection > parts_
Definition:
TopDecayChannelFilter.h:18
edm::EventSetup
Definition:
EventSetup.h:45
edm::EDFilter
Definition:
EDFilter.h:37
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition:
Particle.cc:99
TopDecayChannelFilter::sel_
S sel_
Definition:
TopDecayChannelFilter.h:19
edm::InputTag
Definition:
InputTag.h:18
TopDecayChannelFilter::genEvt_
edm::EDGetTokenT< TtGenEvent > genEvt_
Definition:
TopDecayChannelFilter.h:17
edm::ParameterSet
Definition:
ParameterSet.h:36
genEvt_
genEvt_(cfg.getParameter< edm::InputTag >("genEvent"))
edm::Event
Definition:
Event.h:64
svgfig.template
def template
Definition:
svgfig.py:520
TopDecayChannelFilter::filter
virtual bool filter(edm::Event &, const edm::EventSetup &)
Definition:
TopDecayChannelFilter.h:39
Generated for CMSSW Reference Manual by
1.8.5