Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
CommonTools
CandAlgos
plugins
CandCollectionExistFilter.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/EDFilter.h
"
2
#include "
FWCore/Framework/interface/Event.h
"
3
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
4
#include "
DataFormats/Common/interface/Handle.h
"
5
#include "
DataFormats/Candidate/interface/Candidate.h
"
6
7
using namespace
edm;
8
using namespace
reco
;
9
10
class
CandCollectionExistFilter
:
public
EDFilter
{
11
public
:
12
CandCollectionExistFilter
(
const
ParameterSet
&
cfg
) :
13
srcToken_(consumes<
CandidateView
>(cfg.getParameter<
InputTag
>(
"src"
))) { }
14
private
:
15
bool
filter
(
Event
& evt,
const
EventSetup
&)
override
{
16
Handle<CandidateView>
src
;
17
bool
exists =
true
;
18
evt.
getByToken
(srcToken_, src);
19
if
(!src.
isValid
()) exists =
false
;
20
return
exists;
21
}
22
EDGetTokenT<CandidateView>
srcToken_
;
23
};
24
25
#include "
FWCore/Framework/interface/MakerMacros.h
"
26
27
DEFINE_FWK_MODULE
(
CandCollectionExistFilter
);
28
looper.cfg
tuple cfg
Definition:
looper.py:293
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:464
CandCollectionExistFilter::CandCollectionExistFilter
CandCollectionExistFilter(const ParameterSet &cfg)
Definition:
CandCollectionExistFilter.cc:12
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:17
Event.h
MakerMacros.h
edm::Handle
Definition:
AssociativeIterator.h:47
Handle.h
dt_dqm_sourceclient_common_cff.reco
tuple reco
Definition:
dt_dqm_sourceclient_common_cff.py:106
edm::EDGetTokenT
Definition:
EDGetToken.h:32
CandCollectionExistFilter::srcToken_
EDGetTokenT< CandidateView > srcToken_
Definition:
CandCollectionExistFilter.cc:22
CandCollectionExistFilter
Definition:
CandCollectionExistFilter.cc:10
ParameterSet.h
Candidate.h
edm::View
Definition:
CaloClusterFwd.h:14
EDFilter.h
CandCollectionExistFilter::filter
bool filter(Event &evt, const EventSetup &) override
Definition:
CandCollectionExistFilter.cc:15
edm::EventSetup
Definition:
EventSetup.h:45
alcazmumu_cfi.src
tuple src
Definition:
alcazmumu_cfi.py:30
edm::HandleBase::isValid
bool isValid() const
Definition:
HandleBase.h:75
edm::EDFilter
Definition:
EDFilter.h:37
edm::InputTag
Definition:
InputTag.h:18
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::Event
Definition:
Event.h:64
Generated for CMSSW Reference Manual by
1.8.5