CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
ElectronIDAnalyzer Class Reference
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
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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 selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 9 of file ElectronIDAnalyzer.cc.

Constructor & Destructor Documentation

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

Definition at line 30 of file ElectronIDAnalyzer.cc.

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

30  : conf_(conf) {
31  electronProducer_ = conf.getParameter<std::string>("electronProducer");
32  electronLabelRobustLoose_ = conf.getParameter<std::string>("electronLabelRobustLoose");
33  electronLabelRobustTight_ = conf.getParameter<std::string>("electronLabelRobustTight");
34  electronLabelLoose_ = conf.getParameter<std::string>("electronLabelLoose");
35  electronLabelTight_ = conf.getParameter<std::string>("electronLabelTight");
36 }
std::string electronLabelRobustTight_
std::string electronLabelTight_
std::string electronLabelLoose_
std::string electronProducer_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string electronLabelRobustLoose_
edm::ParameterSet conf_
ElectronIDAnalyzer::~ElectronIDAnalyzer ( )
inlineoverride

Definition at line 12 of file ElectronIDAnalyzer.cc.

12 {};

Member Function Documentation

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

Implements edm::one::EDAnalyzerBase.

Definition at line 38 of file ElectronIDAnalyzer.cc.

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

38  {
39  //Read selectrons
41  e.getByLabel(electronProducer_, electrons);
42 
43  //Read eID results
44  std::vector<edm::Handle<edm::ValueMap<float> > > eIDValueMap(4);
45  //Robust-Loose
46  e.getByLabel(electronLabelRobustLoose_, eIDValueMap[0]);
47  const edm::ValueMap<float>& eIDmapRL = *eIDValueMap[0];
48  //Robust-Tight
49  e.getByLabel(electronLabelRobustTight_, eIDValueMap[1]);
50  const edm::ValueMap<float>& eIDmapRT = *eIDValueMap[1];
51  //Loose
52  e.getByLabel(electronLabelLoose_, eIDValueMap[2]);
53  const edm::ValueMap<float>& eIDmapL = *eIDValueMap[2];
54  //Tight
55  e.getByLabel(electronLabelTight_, eIDValueMap[3]);
56  const edm::ValueMap<float>& eIDmapT = *eIDValueMap[3];
57 
58  // Loop over electrons
59  for (unsigned int i = 0; i < electrons->size(); i++) {
60  edm::Ref<reco::GsfElectronCollection> electronRef(electrons, i);
61  std::cout << "Event " << e.id() << " , electron " << i + 1 << " , Robust Loose = " << eIDmapRL[electronRef]
62  << " , Robust Tight = " << eIDmapRT[electronRef] << " , Loose = " << eIDmapL[electronRef]
63  << " , Tight = " << eIDmapT[electronRef] << std::endl;
64  }
65 }
std::string electronLabelRobustTight_
std::string electronLabelTight_
std::string electronLabelLoose_
std::string electronProducer_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:500
edm::EventID id() const
Definition: EventBase.h:59
tuple cout
Definition: gather_cfg.py:144
std::string electronLabelRobustLoose_

Member Data Documentation

edm::ParameterSet ElectronIDAnalyzer::conf_
private

Definition at line 17 of file ElectronIDAnalyzer.cc.

std::string ElectronIDAnalyzer::electronLabelLoose_
private

Definition at line 23 of file ElectronIDAnalyzer.cc.

Referenced by analyze(), and ElectronIDAnalyzer().

std::string ElectronIDAnalyzer::electronLabelRobustLoose_
private

Definition at line 21 of file ElectronIDAnalyzer.cc.

Referenced by analyze(), and ElectronIDAnalyzer().

std::string ElectronIDAnalyzer::electronLabelRobustTight_
private

Definition at line 22 of file ElectronIDAnalyzer.cc.

Referenced by analyze(), and ElectronIDAnalyzer().

std::string ElectronIDAnalyzer::electronLabelTight_
private

Definition at line 24 of file ElectronIDAnalyzer.cc.

Referenced by analyze(), and ElectronIDAnalyzer().

std::string ElectronIDAnalyzer::electronProducer_
private

Definition at line 19 of file ElectronIDAnalyzer.cc.

Referenced by analyze(), and ElectronIDAnalyzer().