CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ElectronIDAnalyzer Class Reference

#include <ElectronIDAnalyzer.h>

Inheritance diagram for ElectronIDAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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_, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

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.

References analyze(), EnergyCorrector::c, and MillePedeFileConverter_cfg::e.

15 {};

Member Function Documentation

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

Definition at line 14 of file ElectronIDAnalyzer.cc.

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

Referenced by ~ElectronIDAnalyzer().

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_
std::string electronLabelLoose_
std::string electronProducer_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:416
edm::EventID id() const
Definition: EventBase.h:60
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().