CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ElectronIDAnalyzer Class Reference

#include <ElectronIDAnalyzer.h>

Inheritance diagram for ElectronIDAnalyzer:
edm::EDAnalyzer

Public Member Functions

virtual void analyze (const edm::Event &e, const edm::EventSetup &c)
 
 ElectronIDAnalyzer (const edm::ParameterSet &conf)
 
virtual ~ElectronIDAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

edm::ParameterSet conf_
 
std::string electronLabelLoose_
 
std::string electronLabelRobustLoose_
 
std::string electronLabelRobustTight_
 
std::string electronLabelTight_
 
std::string electronProducer_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 10 of file ElectronIDAnalyzer.h.

Constructor & Destructor Documentation

ElectronIDAnalyzer::ElectronIDAnalyzer ( const edm::ParameterSet conf)
explicit

Definition at line 6 of file ElectronIDAnalyzer.cc.

References electronLabelLoose_, electronLabelRobustLoose_, electronLabelRobustTight_, electronLabelTight_, electronProducer_, and edm::ParameterSet::getParameter().

6  : conf_(conf) {
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 }
std::string electronLabelRobustTight_
std::string electronLabelTight_
T getParameter(std::string const &) const
std::string electronLabelLoose_
std::string electronProducer_
std::string electronLabelRobustLoose_
edm::ParameterSet conf_
virtual ElectronIDAnalyzer::~ElectronIDAnalyzer ( )
inlinevirtual

Definition at line 15 of file ElectronIDAnalyzer.h.

15 {};

Member Function Documentation

void ElectronIDAnalyzer::analyze ( const edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 14 of file ElectronIDAnalyzer.cc.

References gather_cfg::cout, electronLabelLoose_, electronLabelRobustLoose_, electronLabelRobustTight_, electronLabelTight_, electronProducer_, HI_PhotonSkim_cff::electrons, edm::Event::getByLabel(), i, and edm::EventBase::id().

14  {
15 
16  //Read selectrons
18  e.getByLabel(electronProducer_,electrons) ;
19 
20  //Read eID results
21  std::vector<edm::Handle<edm::ValueMap<float> > > eIDValueMap(4);
22  //Robust-Loose
23  e.getByLabel( electronLabelRobustLoose_ , eIDValueMap[0] );
24  const edm::ValueMap<float> & eIDmapRL = * eIDValueMap[0] ;
25  //Robust-Tight
26  e.getByLabel( electronLabelRobustTight_ , eIDValueMap[1] );
27  const edm::ValueMap<float> & eIDmapRT = * eIDValueMap[1] ;
28  //Loose
29  e.getByLabel( electronLabelLoose_ , eIDValueMap[2] );
30  const edm::ValueMap<float> & eIDmapL = * eIDValueMap[2] ;
31  //Tight
32  e.getByLabel( electronLabelTight_ , eIDValueMap[3] );
33  const edm::ValueMap<float> & eIDmapT = * eIDValueMap[3] ;
34 
35  // Loop over electrons
36  for (unsigned int i = 0; i < electrons->size(); i++){
37  edm::Ref<reco::GsfElectronCollection> electronRef(electrons,i);
38  std::cout << "Event " << e.id()
39  << " , electron " << i+1
40  << " , Robust Loose = " << eIDmapRL[electronRef]
41  << " , Robust Tight = " << eIDmapRT[electronRef]
42  << " , Loose = " << eIDmapL[electronRef]
43  << " , Tight = " << eIDmapT[electronRef]
44  << std::endl;
45  }
46 
47 }
std::string electronLabelRobustTight_
std::string electronLabelTight_
int i
Definition: DBlmapReader.cc:9
std::string electronLabelLoose_
std::string electronProducer_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
edm::EventID id() const
Definition: EventBase.h:56
tuple cout
Definition: gather_cfg.py:121
std::string electronLabelRobustLoose_

Member Data Documentation

edm::ParameterSet ElectronIDAnalyzer::conf_
private

Definition at line 21 of file ElectronIDAnalyzer.h.

std::string ElectronIDAnalyzer::electronLabelLoose_
private

Definition at line 27 of file ElectronIDAnalyzer.h.

Referenced by analyze(), and ElectronIDAnalyzer().

std::string ElectronIDAnalyzer::electronLabelRobustLoose_
private

Definition at line 25 of file ElectronIDAnalyzer.h.

Referenced by analyze(), and ElectronIDAnalyzer().

std::string ElectronIDAnalyzer::electronLabelRobustTight_
private

Definition at line 26 of file ElectronIDAnalyzer.h.

Referenced by analyze(), and ElectronIDAnalyzer().

std::string ElectronIDAnalyzer::electronLabelTight_
private

Definition at line 28 of file ElectronIDAnalyzer.h.

Referenced by analyze(), and ElectronIDAnalyzer().

std::string ElectronIDAnalyzer::electronProducer_
private

Definition at line 23 of file ElectronIDAnalyzer.h.

Referenced by analyze(), and ElectronIDAnalyzer().