CMS 3D CMS Logo

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

#include <ElectronIDAnalyzer.h>

Inheritance diagram for ElectronIDAnalyzer:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
 ElectronIDAnalyzer (const edm::ParameterSet &conf)
 
 ~ElectronIDAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 10 of file ElectronIDAnalyzer.h.

Constructor & Destructor Documentation

◆ ElectronIDAnalyzer()

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

Definition at line 6 of file ElectronIDAnalyzer.cc.

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 }

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

◆ ~ElectronIDAnalyzer()

ElectronIDAnalyzer::~ElectronIDAnalyzer ( )
inlineoverride

Definition at line 13 of file ElectronIDAnalyzer.h.

13 {};

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 14 of file ElectronIDAnalyzer.cc.

14  {
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 }

References gather_cfg::cout, MillePedeFileConverter_cfg::e, electronLabelLoose_, electronLabelRobustLoose_, electronLabelRobustTight_, electronLabelTight_, electronProducer_, pwdgSkimBPark_cfi::electrons, and mps_fire::i.

Member Data Documentation

◆ conf_

edm::ParameterSet ElectronIDAnalyzer::conf_
private

Definition at line 18 of file ElectronIDAnalyzer.h.

◆ electronLabelLoose_

std::string ElectronIDAnalyzer::electronLabelLoose_
private

Definition at line 24 of file ElectronIDAnalyzer.h.

Referenced by analyze(), and ElectronIDAnalyzer().

◆ electronLabelRobustLoose_

std::string ElectronIDAnalyzer::electronLabelRobustLoose_
private

Definition at line 22 of file ElectronIDAnalyzer.h.

Referenced by analyze(), and ElectronIDAnalyzer().

◆ electronLabelRobustTight_

std::string ElectronIDAnalyzer::electronLabelRobustTight_
private

Definition at line 23 of file ElectronIDAnalyzer.h.

Referenced by analyze(), and ElectronIDAnalyzer().

◆ electronLabelTight_

std::string ElectronIDAnalyzer::electronLabelTight_
private

Definition at line 25 of file ElectronIDAnalyzer.h.

Referenced by analyze(), and ElectronIDAnalyzer().

◆ electronProducer_

std::string ElectronIDAnalyzer::electronProducer_
private

Definition at line 20 of file ElectronIDAnalyzer.h.

Referenced by analyze(), and ElectronIDAnalyzer().

mps_fire.i
i
Definition: mps_fire.py:355
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::Handle< reco::GsfElectronCollection >
edm::Ref
Definition: AssociativeIterator.h:58
ElectronIDAnalyzer::electronLabelRobustTight_
std::string electronLabelRobustTight_
Definition: ElectronIDAnalyzer.h:23
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ElectronIDAnalyzer::conf_
edm::ParameterSet conf_
Definition: ElectronIDAnalyzer.h:18
ElectronIDAnalyzer::electronLabelTight_
std::string electronLabelTight_
Definition: ElectronIDAnalyzer.h:25
ElectronIDAnalyzer::electronProducer_
std::string electronProducer_
Definition: ElectronIDAnalyzer.h:20
ElectronIDAnalyzer::electronLabelRobustLoose_
std::string electronLabelRobustLoose_
Definition: ElectronIDAnalyzer.h:22
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
edm::ValueMap< float >
ElectronIDAnalyzer::electronLabelLoose_
std::string electronLabelLoose_
Definition: ElectronIDAnalyzer.h:24
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37