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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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_
ElectronIDAnalyzer::~ElectronIDAnalyzer ( )
inlineoverride

Definition at line 13 of file ElectronIDAnalyzer.h.

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

13 {};

Member Function Documentation

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

Definition at line 14 of file ElectronIDAnalyzer.cc.

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

Referenced by ~ElectronIDAnalyzer().

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++) {
36  edm::Ref<reco::GsfElectronCollection> electronRef(electrons, 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 }
std::string electronLabelRobustTight_
std::string electronLabelTight_
std::string electronLabelLoose_
std::string electronProducer_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
edm::EventID id() const
Definition: EventBase.h:59
std::string electronLabelRobustLoose_

Member Data Documentation

edm::ParameterSet ElectronIDAnalyzer::conf_
private

Definition at line 18 of file ElectronIDAnalyzer.h.

std::string ElectronIDAnalyzer::electronLabelLoose_
private

Definition at line 24 of file ElectronIDAnalyzer.h.

Referenced by analyze(), and ElectronIDAnalyzer().

std::string ElectronIDAnalyzer::electronLabelRobustLoose_
private

Definition at line 22 of file ElectronIDAnalyzer.h.

Referenced by analyze(), and ElectronIDAnalyzer().

std::string ElectronIDAnalyzer::electronLabelRobustTight_
private

Definition at line 23 of file ElectronIDAnalyzer.h.

Referenced by analyze(), and ElectronIDAnalyzer().

std::string ElectronIDAnalyzer::electronLabelTight_
private

Definition at line 25 of file ElectronIDAnalyzer.h.

Referenced by analyze(), and ElectronIDAnalyzer().

std::string ElectronIDAnalyzer::electronProducer_
private

Definition at line 20 of file ElectronIDAnalyzer.h.

Referenced by analyze(), and ElectronIDAnalyzer().