CMS 3D CMS Logo

ElectronIDAnalyzer.cc
Go to the documentation of this file.
5 
7  electronProducer_ = conf.getParameter<std::string>("electronProducer");
8  electronLabelRobustLoose_ = conf.getParameter<std::string>("electronLabelRobustLoose");
9  electronLabelRobustTight_ = conf.getParameter<std::string>("electronLabelRobustTight");
10  electronLabelLoose_ = conf.getParameter<std::string>("electronLabelLoose");
11  electronLabelTight_ = conf.getParameter<std::string>("electronLabelTight");
12 }
13 
15  //Read selectrons
17  e.getByLabel(electronProducer_, electrons);
18 
19  //Read eID results
20  std::vector<edm::Handle<edm::ValueMap<float> > > eIDValueMap(4);
21  //Robust-Loose
22  e.getByLabel(electronLabelRobustLoose_, eIDValueMap[0]);
23  const edm::ValueMap<float>& eIDmapRL = *eIDValueMap[0];
24  //Robust-Tight
25  e.getByLabel(electronLabelRobustTight_, eIDValueMap[1]);
26  const edm::ValueMap<float>& eIDmapRT = *eIDValueMap[1];
27  //Loose
28  e.getByLabel(electronLabelLoose_, eIDValueMap[2]);
29  const edm::ValueMap<float>& eIDmapL = *eIDValueMap[2];
30  //Tight
31  e.getByLabel(electronLabelTight_, eIDValueMap[3]);
32  const edm::ValueMap<float>& eIDmapT = *eIDValueMap[3];
33 
34  // Loop over electrons
35  for (unsigned int i = 0; i < electrons->size(); i++) {
37  std::cout << "Event " << e.id() << " , electron " << i + 1 << " , Robust Loose = " << eIDmapRL[electronRef]
38  << " , Robust Tight = " << eIDmapRT[electronRef] << " , Loose = " << eIDmapL[electronRef]
39  << " , Tight = " << eIDmapT[electronRef] << std::endl;
40  }
41 }
mps_fire.i
i
Definition: mps_fire.py:428
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::Handle< reco::GsfElectronCollection >
edm::Ref
Definition: AssociativeIterator.h:58
ElectronIDAnalyzer.h
ElectronIDAnalyzer::ElectronIDAnalyzer
ElectronIDAnalyzer(const edm::ParameterSet &conf)
Definition: ElectronIDAnalyzer.cc:6
ElectronIDAnalyzer::electronLabelRobustTight_
std::string electronLabelRobustTight_
Definition: ElectronIDAnalyzer.h:23
GsfElectron.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ElectronIDAnalyzer::electronLabelTight_
std::string electronLabelTight_
Definition: ElectronIDAnalyzer.h:25
GsfElectronFwd.h
edm::ParameterSet
Definition: ParameterSet.h:47
ElectronIDAnalyzer::electronProducer_
std::string electronProducer_
Definition: ElectronIDAnalyzer.h:20
ElectronIDAnalyzer::electronLabelRobustLoose_
std::string electronLabelRobustLoose_
Definition: ElectronIDAnalyzer.h:22
edm::EventSetup
Definition: EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
ElectronIDAnalyzer::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: ElectronIDAnalyzer.cc:14
ValueMap.h
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
edm::ValueMap< float >
ElectronIDAnalyzer::electronLabelLoose_
std::string electronLabelLoose_
Definition: ElectronIDAnalyzer.h:24
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::Event
Definition: Event.h:73
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37