CMS 3D CMS Logo

Selectors.cc
Go to the documentation of this file.
3 
4 // system include files
5 #include <memory>
6 
7 // user include files
10 
13 
15 
17 
22 
25 
28 
31 
34 
37 
38 #include <vector>
39 #include <iostream>
40 
52 
59 
61 public:
62  explicit ElectronIdFilter(const edm::ParameterSet&);
63  ~ElectronIdFilter() override;
64 
65 private:
66  void beginJob() override;
67  bool filter(edm::Event&, const edm::EventSetup&) override;
68  void endJob() override;
69 
72  int eid_;
73  // ----------member data ---------------------------
74 };
75 
77  : recoGsfElectronCollectionToken_(
78  consumes<reco::GsfElectronCollection>(iConfig.getParameter<edm::InputTag>("src"))),
79  edmValueMapFloatToken_(consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("eidsrc"))),
80  eid_(iConfig.getParameter<int>("eid")) {
81  produces<reco::GsfElectronCollection>();
82 }
84 // ------------ method called to produce the data ------------
85 
87  //cout << "NonVertexingLeptonFilter:: entering filter" << endl;
88 
91 
93  iEvent.getByToken(edmValueMapFloatToken_, eIDValueMap);
94  const edm::ValueMap<float>& eIDmap = *eIDValueMap;
96 
97  // Loop over electrons
98  for (unsigned int i = 0; i < electrons->size(); i++) {
100  if ((eIDmap[electronRef]) == eid_)
101  product->push_back((*electrons)[i]);
102  }
103 
104  //cout << "Putting in the event" << endl;
105  std::unique_ptr<reco::GsfElectronCollection> collection(product);
107  return true;
108 }
109 
112 
mps_fire.i
i
Definition: mps_fire.py:428
ObjectCountFilter.h
Muon.h
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
StringCutObjectSelector.h
edm::EDGetTokenT< reco::GsfElectronCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
PFJet.h
SingleObjectSelector.h
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
PFJetCollection.h
TauValJetSelector
SingleObjectSelector< std::vector< reco::Jet >, StringCutObjectSelector< reco::Jet > > TauValJetSelector
Definition: Selectors.cc:41
TauValGenPSelector
SingleObjectSelector< reco::GenParticleCollection, StringCutObjectSelector< reco::GenParticle > > TauValGenPSelector
Definition: Selectors.cc:44
EDFilter.h
Jet.h
TauValGenPRefSelector
SingleObjectSelector< reco::GenParticleRefVector, StringCutObjectSelector< reco::GenParticleRef > > TauValGenPRefSelector
Definition: Selectors.cc:46
reco::GsfElectronCollection
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
Definition: GsfElectronFwd.h:14
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle< reco::GsfElectronCollection >
edm::Ref
Definition: AssociativeIterator.h:58
ElectronIdFilter::filter
bool filter(edm::Event &, const edm::EventSetup &) override
Definition: Selectors.cc:86
GenParticle.h
ElectronIdFilter::recoGsfElectronCollectionToken_
edm::EDGetTokenT< reco::GsfElectronCollection > recoGsfElectronCollectionToken_
Definition: Selectors.cc:70
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
MuonFwd.h
GenParticleFwd.h
JetCollection.h
GsfElectron.h
SingleElementCollectionSelector.h
GsfElectronFwd.h
edm::ParameterSet
Definition: ParameterSet.h:47
RefVector.h
Event.h
ElectronIdFilter
Definition: Selectors.cc:60
ElectronIdFilter::eid_
int eid_
Definition: Selectors.cc:72
ModuleDef.h
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
universalConfigTemplate.collection
collection
Definition: universalConfigTemplate.py:81
ElectronIdFilter::beginJob
void beginJob() override
Definition: Selectors.cc:110
edm::EDFilter
Definition: EDFilter.h:38
ElectronIdFilter::edmValueMapFloatToken_
edm::EDGetTokenT< edm::ValueMap< float > > edmValueMapFloatToken_
Definition: Selectors.cc:71
edm::EventSetup
Definition: EventSetup.h:57
TauValMuonSelector
SingleObjectSelector< reco::MuonCollection, StringCutObjectSelector< reco::Muon > > TauValMuonSelector
Definition: Selectors.cc:42
SingleObjectSelectorBase
Definition: SingleObjectSelector.h:26
eostools.move
def move(src, dest)
Definition: eostools.py:511
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
Frameworkfwd.h
ElectronIdFilter::ElectronIdFilter
ElectronIdFilter(const edm::ParameterSet &)
Definition: Selectors.cc:76
edm::ValueMap< float >
StringCutObjectSelector< reco::Jet >
ElectronIdFilter::endJob
void endJob() override
Definition: Selectors.cc:111
ParameterSet.h
edm::Event
Definition: Event.h:73
ElectronIdFilter::~ElectronIdFilter
~ElectronIdFilter() override
Definition: Selectors.cc:83
TauValPFJetSelector
SingleObjectSelector< reco::PFJetCollection, StringCutObjectSelector< reco::PFJet > > TauValPFJetSelector
Definition: Selectors.cc:47
TauValElectronSelector
SingleObjectSelector< edm::View< reco::GsfElectron >, StringCutObjectSelector< reco::GsfElectron >, reco::GsfElectronCollection > TauValElectronSelector
Definition: Selectors.cc:51