CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
pat::PATElectronProducer Class Reference

Produces pat::Electron's. More...

Inheritance diagram for pat::PATElectronProducer:
edm::stream::EDProducer<>

Public Member Functions

 PATElectronProducer (const edm::ParameterSet &iConfig)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~PATElectronProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Types

typedef edm::RefToBase< reco::GsfElectronElectronBaseRef
 
typedef std::vector< edm::Handle< edm::Association< reco::GenParticleCollection > > > GenAssociations
 
typedef std::vector< edm::Handle< edm::ValueMap< IsoDeposit > > > IsoDepositMaps
 
typedef std::pair< pat::IsolationKeys, edm::InputTagIsolationLabel
 
typedef std::vector< IsolationLabelIsolationLabels
 
typedef std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
 
typedef std::pair< std::string, edm::InputTagNameTag
 

Private Member Functions

void embedHighLevel (pat::Electron &anElectron, reco::GsfTrackRef track, reco::TransientTrack &tt, reco::Vertex &primaryVertex, bool primaryVertexIsValid, reco::BeamSpot &beamspot, bool beamspotIsValid)
 
void fillElectron (Electron &aElectron, const ElectronBaseRef &electronRef, const reco::CandidateBaseRef &baseRef, const GenAssociations &genMatches, const IsoDepositMaps &deposits, const bool pfId, const IsolationValueMaps &isolationValues, const IsolationValueMaps &isolationValuesNoPFId) const
 common electron filling, for both the standard and PF2PAT case More...
 
void fillElectron2 (Electron &anElectron, const reco::CandidatePtr &candPtrForIsolation, const reco::CandidatePtr &candPtrForGenMatch, const reco::CandidatePtr &candPtrForLoader, const GenAssociations &genMatches, const IsoDepositMaps &deposits, const IsolationValueMaps &isolationValues) const
 
template<typename T >
void readIsolationLabels (const edm::ParameterSet &iConfig, const char *psetName, IsolationLabels &labels, std::vector< edm::EDGetTokenT< edm::ValueMap< T >>> &tokens)
 
void setElectronMiniIso (pat::Electron &anElectron, const pat::PackedCandidateCollection *pc)
 

Private Attributes

const bool addEfficiencies_
 
const bool addElecID_
 
bool addGenMatch_
 
const bool addMVAVariables_
 mva input variables More...
 
const bool addPFClusterIso_
 
const bool addPuppiIsolation_
 
const bool addResolutions_
 
const edm::EDGetTokenT< reco::BeamSpotbeamLineToken_
 
bool computeMiniIso_
 
const EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_
 
const edm::EDGetTokenT< edm::ValueMap< float > > ecalPFClusterIsoT_
 
const CaloTopologyecalTopology_
 
const edm::ESGetToken< CaloTopology, CaloTopologyRecordecalTopologyToken_
 
pat::helper::EfficiencyLoader efficiencyLoader_
 
std::vector< NameTagelecIDSrcs_
 
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > elecIDTokens_
 
const edm::EDGetTokenT< edm::View< reco::GsfElectron > > electronToken_
 
const bool embedBasicClusters_
 
bool embedGenMatch_
 
const bool embedGsfElectronCore_
 
const bool embedGsfTrack_
 
const bool embedHighLevelSelection_
 embed high level selection variables? More...
 
const bool embedPFCandidate_
 
const bool embedPflowBasicClusters_
 
const bool embedPflowPreshowerClusters_
 
const bool embedPflowSuperCluster_
 
const bool embedPreshowerClusters_
 
const bool embedRecHits_
 
const bool embedSeedCluster_
 
const bool embedSuperCluster_
 
const bool embedTrack_
 
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
 
const edm::EDGetTokenT< edm::ValueMap< float > > hcalPFClusterIsoT_
 
const edm::EDGetTokenT< reco::ConversionCollectionhConversionsToken_
 
IsolationLabels isoDepositLabels_
 
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
 
IsolationLabels isolationValueLabels_
 
IsolationLabels isolationValueLabelsNoPFId_
 
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueNoPFIdTokens_
 
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueTokens_
 
pat::helper::MultiIsolator isolator_
 
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
 
std::vector< double > miniIsoParamsB_
 
std::vector< double > miniIsoParamsE_
 
edm::EDGetTokenT< pat::PackedCandidateCollectionpcToken_
 
const edm::EDGetTokenT< edm::ValueMap< reco::PFCandidatePtr > > pfCandidateMapToken_
 
const edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > pfCandidateMultiMapToken_
 
const edm::EDGetTokenT< reco::PFCandidateCollectionpfElecToken_
 
const GreaterByPt< ElectronpTComparator_
 
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_charged_hadrons_
 
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_neutral_hadrons_
 
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_photons_
 
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_charged_hadrons_
 
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_neutral_hadrons_
 
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_photons_
 
const edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
 
const edm::InputTag reducedBarrelRecHitCollection_
 
const edm::EDGetTokenT< EcalRecHitCollectionreducedBarrelRecHitCollectionToken_
 
const edm::InputTag reducedEndcapRecHitCollection_
 
const edm::EDGetTokenT< EcalRecHitCollectionreducedEndcapRecHitCollectionToken_
 
pat::helper::KinResolutionsLoader resolutionLoader_
 
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecordtrackBuilderToken_
 
const bool useParticleFlow_
 pflow specific More...
 
const bool usePfCandidateMultiMap_
 
pat::PATUserDataHelper< pat::ElectronuserDataHelper_
 
const bool useUserData_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Produces pat::Electron's.

The PATElectronProducer produces analysis-level pat::Electron's starting from a collection of objects of reco::GsfElectron.

Author
Steven Lowette, James Lamb\
Version
Id
PATElectronProducer.h,v 1.31 2013/02/27 23:26:56 wmtan Exp

Definition at line 68 of file PATElectronProducer.cc.

Member Typedef Documentation

◆ ElectronBaseRef

Definition at line 130 of file PATElectronProducer.cc.

◆ GenAssociations

Definition at line 100 of file PATElectronProducer.cc.

◆ IsoDepositMaps

Definition at line 131 of file PATElectronProducer.cc.

◆ IsolationLabel

Definition at line 165 of file PATElectronProducer.cc.

◆ IsolationLabels

Definition at line 166 of file PATElectronProducer.cc.

◆ IsolationValueMaps

Definition at line 132 of file PATElectronProducer.cc.

◆ NameTag

typedef std::pair<std::string, edm::InputTag> pat::PATElectronProducer::NameTag
private

Definition at line 177 of file PATElectronProducer.cc.

Constructor & Destructor Documentation

◆ PATElectronProducer()

PATElectronProducer::PATElectronProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 270 of file PATElectronProducer.cc.

271  : // general configurables
272  electronToken_(consumes<edm::View<reco::GsfElectron>>(iConfig.getParameter<edm::InputTag>("electronSource"))),
273  hConversionsToken_(consumes<reco::ConversionCollection>(edm::InputTag("allConversions"))),
274  embedGsfElectronCore_(iConfig.getParameter<bool>("embedGsfElectronCore")),
275  embedGsfTrack_(iConfig.getParameter<bool>("embedGsfTrack")),
276  embedSuperCluster_(iConfig.getParameter<bool>("embedSuperCluster")),
277  embedPflowSuperCluster_(iConfig.getParameter<bool>("embedPflowSuperCluster")),
278  embedSeedCluster_(iConfig.getParameter<bool>("embedSeedCluster")),
279  embedBasicClusters_(iConfig.getParameter<bool>("embedBasicClusters")),
280  embedPreshowerClusters_(iConfig.getParameter<bool>("embedPreshowerClusters")),
281  embedPflowBasicClusters_(iConfig.getParameter<bool>("embedPflowBasicClusters")),
282  embedPflowPreshowerClusters_(iConfig.getParameter<bool>("embedPflowPreshowerClusters")),
283  embedTrack_(iConfig.getParameter<bool>("embedTrack")),
284  addGenMatch_(iConfig.getParameter<bool>("addGenMatch")),
285  embedGenMatch_(addGenMatch_ ? iConfig.getParameter<bool>("embedGenMatch") : false),
286  embedRecHits_(iConfig.getParameter<bool>("embedRecHits")),
287  // pflow configurables
288  useParticleFlow_(iConfig.getParameter<bool>("useParticleFlow")),
289  usePfCandidateMultiMap_(iConfig.getParameter<bool>("usePfCandidateMultiMap")),
291  ? consumes<reco::PFCandidateCollection>(iConfig.getParameter<edm::InputTag>("pfElectronSource"))
294  iConfig.getParameter<edm::InputTag>("pfCandidateMap"))
297  ? consumes<edm::ValueMap<std::vector<reco::PFCandidateRef>>>(
298  iConfig.getParameter<edm::InputTag>("pfCandidateMultiMap"))
299  : edm::EDGetTokenT<edm::ValueMap<std::vector<reco::PFCandidateRef>>>()),
300  embedPFCandidate_(iConfig.getParameter<bool>("embedPFCandidate")),
301  // mva input variables
302  addMVAVariables_(iConfig.getParameter<bool>("addMVAVariables")),
303  reducedBarrelRecHitCollection_(iConfig.getParameter<edm::InputTag>("reducedBarrelRecHitCollection")),
304  reducedBarrelRecHitCollectionToken_(mayConsume<EcalRecHitCollection>(reducedBarrelRecHitCollection_)),
305  reducedEndcapRecHitCollection_(iConfig.getParameter<edm::InputTag>("reducedEndcapRecHitCollection")),
306  reducedEndcapRecHitCollectionToken_(mayConsume<EcalRecHitCollection>(reducedEndcapRecHitCollection_)),
307  ecalClusterToolsESGetTokens_{consumesCollector()},
308  // PFCluster Isolation maps
309  addPFClusterIso_(iConfig.getParameter<bool>("addPFClusterIso")),
310  addPuppiIsolation_(iConfig.getParameter<bool>("addPuppiIsolation")),
311  ecalPFClusterIsoT_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("ecalPFClusterIsoMap"))),
312  hcalPFClusterIsoT_(consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("hcalPFClusterIsoMap"))),
313  // embed high level selection variables?
314  embedHighLevelSelection_(iConfig.getParameter<bool>("embedHighLevelSelection")),
315  beamLineToken_(consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamLineSrc"))),
316  pvToken_(mayConsume<std::vector<reco::Vertex>>(iConfig.getParameter<edm::InputTag>("pvSrc"))),
317  addElecID_(iConfig.getParameter<bool>("addElectronID")),
318  pTComparator_(),
319  isolator_(iConfig.getParameter<edm::ParameterSet>("userIsolation"), consumesCollector(), false),
320  addEfficiencies_(iConfig.getParameter<bool>("addEfficiencies")),
321  addResolutions_(iConfig.getParameter<bool>("addResolutions")),
322  useUserData_(iConfig.exists("userData")),
324  trackBuilderToken_{esConsumes(edm::ESInputTag("", "TransientTrackBuilder"))} {
325  // MC matching configurables (scheduled mode)
326 
327  if (addGenMatch_) {
329  iConfig.getParameter<edm::InputTag>("genParticleMatch")));
330  }
331  // resolution configurables
332  if (addResolutions_) {
334  pat::helper::KinResolutionsLoader(iConfig.getParameter<edm::ParameterSet>("resolutions"), consumesCollector());
335  }
336  if (addPuppiIsolation_) {
337  //puppi
339  consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("puppiIsolationChargedHadrons"));
341  consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("puppiIsolationNeutralHadrons"));
343  consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("puppiIsolationPhotons"));
344  //puppiNoLeptons
346  consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("puppiNoLeptonsIsolationChargedHadrons"));
348  consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("puppiNoLeptonsIsolationNeutralHadrons"));
350  consumes<edm::ValueMap<float>>(iConfig.getParameter<edm::InputTag>("puppiNoLeptonsIsolationPhotons"));
351  }
352  // electron ID configurables
353  if (addElecID_) {
354  // it might be a single electron ID
355  if (iConfig.existsAs<edm::InputTag>("electronIDSource")) {
356  elecIDSrcs_.push_back(NameTag("", iConfig.getParameter<edm::InputTag>("electronIDSource")));
357  }
358  // or there might be many of them
359  if (iConfig.existsAs<edm::ParameterSet>("electronIDSources")) {
360  // please don't configure me twice
361  if (!elecIDSrcs_.empty()) {
362  throw cms::Exception("Configuration")
363  << "PATElectronProducer: you can't specify both 'electronIDSource' and 'electronIDSources'\n";
364  }
365  // read the different electron ID names
366  edm::ParameterSet idps = iConfig.getParameter<edm::ParameterSet>("electronIDSources");
367  std::vector<std::string> names = idps.getParameterNamesForType<edm::InputTag>();
368  for (std::vector<std::string>::const_iterator it = names.begin(), ed = names.end(); it != ed; ++it) {
369  elecIDSrcs_.push_back(NameTag(*it, idps.getParameter<edm::InputTag>(*it)));
370  }
371  }
372  // but in any case at least once
373  if (elecIDSrcs_.empty()) {
374  throw cms::Exception("Configuration")
375  << "PATElectronProducer: id addElectronID is true, you must specify either:\n"
376  << "\tInputTag electronIDSource = <someTag>\n"
377  << "or\n"
378  << "\tPSet electronIDSources = { \n"
379  << "\t\tInputTag <someName> = <someTag> // as many as you want \n "
380  << "\t}\n";
381  }
382  }
384  elecIDSrcs_, [this](NameTag const& tag) { return mayConsume<edm::ValueMap<float>>(tag.second); });
385  // construct resolution calculator
386 
387  // // IsoDeposit configurables
388  // if (iConfig.exists("isoDeposits")) {
389  // edm::ParameterSet depconf = iConfig.getParameter<edm::ParameterSet>("isoDeposits");
390  // if (depconf.exists("tracker")) isoDepositLabels_.push_back(std::make_pair(TrackerIso, depconf.getParameter<edm::InputTag>("tracker")));
391  // if (depconf.exists("ecal")) isoDepositLabels_.push_back(std::make_pair(ECalIso, depconf.getParameter<edm::InputTag>("ecal")));
392  // if (depconf.exists("hcal")) isoDepositLabels_.push_back(std::make_pair(HCalIso, depconf.getParameter<edm::InputTag>("hcal")));
393 
394  // if (depconf.exists("user")) {
395  // std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag> >("user");
396  // std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
397  // int key = UserBaseIso;
398  // for ( ; it != ed; ++it, ++key) {
399  // isoDepositLabels_.push_back(std::make_pair(IsolationKeys(key), *it));
400  // }
401  // }
402  // }
403  // isoDepositTokens_ = edm::vector_transform(isoDepositLabels_, [this](std::pair<IsolationKeys,edm::InputTag> const & label){return consumes<edm::ValueMap<IsoDeposit> >(label.second);});
404 
405  // for mini-iso
406  computeMiniIso_ = iConfig.getParameter<bool>("computeMiniIso");
407  miniIsoParamsE_ = iConfig.getParameter<std::vector<double>>("miniIsoParamsE");
408  miniIsoParamsB_ = iConfig.getParameter<std::vector<double>>("miniIsoParamsB");
409  if (computeMiniIso_ && (miniIsoParamsE_.size() != 9 || miniIsoParamsB_.size() != 9)) {
410  throw cms::Exception("ParameterError") << "miniIsoParams must have exactly 9 elements.\n";
411  }
412  if (computeMiniIso_)
413  pcToken_ = consumes<pat::PackedCandidateCollection>(iConfig.getParameter<edm::InputTag>("pfCandsForMiniIso"));
414 
415  // read isoDeposit labels, for direct embedding
416  readIsolationLabels(iConfig, "isoDeposits", isoDepositLabels_, isoDepositTokens_);
417  // read isolation value labels, for direct embedding
419  // read isolation value labels for non PF identified electron, for direct embedding
421  // Efficiency configurables
422  if (addEfficiencies_) {
424  pat::helper::EfficiencyLoader(iConfig.getParameter<edm::ParameterSet>("efficiencies"), consumesCollector());
425  }
426  // Check to see if the user wants to add user data
427  if (useUserData_) {
429  PATUserDataHelper<Electron>(iConfig.getParameter<edm::ParameterSet>("userData"), consumesCollector());
430  }
431 
432  // consistency check
434  throw cms::Exception("Configuration", "usePfCandidateMultiMap not supported when useParticleFlow is set to true");
435 
436  // produces vector of muons
437  produces<std::vector<Electron>>();
438 }
Assists in assimilating all pat::UserData into pat objects.
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::EDGetTokenT< reco::ConversionCollection > hConversionsToken_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_charged_hadrons_
const GreaterByPt< Electron > pTComparator_
void readIsolationLabels(const edm::ParameterSet &iConfig, const char *psetName, IsolationLabels &labels, std::vector< edm::EDGetTokenT< edm::ValueMap< T >>> &tokens)
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_charged_hadrons_
const bool useParticleFlow_
pflow specific
const edm::EDGetTokenT< reco::PFCandidateCollection > pfElecToken_
std::vector< double > miniIsoParamsE_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_neutral_hadrons_
const edm::EDGetTokenT< edm::ValueMap< float > > ecalPFClusterIsoT_
bool exists(std::string const &parameterName) const
checks if a parameter exists
const edm::InputTag reducedBarrelRecHitCollection_
const edm::EDGetTokenT< edm::ValueMap< float > > hcalPFClusterIsoT_
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:172
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > elecIDTokens_
const std::string names[nVars_]
const edm::ESGetToken< CaloTopology, CaloTopologyRecord > ecalTopologyToken_
const edm::EDGetTokenT< edm::View< reco::GsfElectron > > electronToken_
const bool addMVAVariables_
mva input variables
std::vector< double > miniIsoParamsB_
const edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
const edm::EDGetTokenT< edm::ValueMap< reco::PFCandidatePtr > > pfCandidateMapToken_
pat::helper::MultiIsolator isolator_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_photons_
const bool embedHighLevelSelection_
embed high level selection variables?
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:180
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_neutral_hadrons_
const EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_
const edm::EDGetTokenT< EcalRecHitCollection > reducedEndcapRecHitCollectionToken_
const edm::InputTag reducedEndcapRecHitCollection_
std::pair< std::string, edm::InputTag > NameTag
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_photons_
const edm::EDGetTokenT< reco::BeamSpot > beamLineToken_
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueNoPFIdTokens_
pat::helper::EfficiencyLoader efficiencyLoader_
const edm::EDGetTokenT< EcalRecHitCollection > reducedBarrelRecHitCollectionToken_
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > trackBuilderToken_
const edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > pfCandidateMultiMapToken_
pat::PATUserDataHelper< pat::Electron > userDataHelper_
IsolationLabels isolationValueLabelsNoPFId_
IsolationLabels isolationValueLabels_
pat::helper::KinResolutionsLoader resolutionLoader_
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueTokens_
edm::EDGetTokenT< pat::PackedCandidateCollection > pcToken_
std::vector< NameTag > elecIDSrcs_

◆ ~PATElectronProducer()

PATElectronProducer::~PATElectronProducer ( )
override

Definition at line 440 of file PATElectronProducer.cc.

440 {}

Member Function Documentation

◆ embedHighLevel()

void PATElectronProducer::embedHighLevel ( pat::Electron anElectron,
reco::GsfTrackRef  track,
reco::TransientTrack tt,
reco::Vertex primaryVertex,
bool  primaryVertexIsValid,
reco::BeamSpot beamspot,
bool  beamspotIsValid 
)
private

Definition at line 1412 of file PATElectronProducer.cc.

References pat::Electron::BS2D, pat::Electron::BS3D, Matriplex::hypot(), BeamMonitor_cff::primaryVertex, pat::Electron::PV2D, pat::Electron::PV3D, pat::Electron::PVDZ, mps_fire::result, pat::Electron::setDB(), IPTools::signedImpactParameter3D(), and HLT_2024v14_cff::track.

Referenced by produce().

1418  {
1419  // Correct to PV
1420  // PV2D
1421  anElectron.setDB(track->dxy(primaryVertex.position()),
1422  track->dxyError(primaryVertex.position(), primaryVertex.covariance()),
1424 
1425  // PV3D
1426  std::pair<bool, Measurement1D> result =
1428  double d0_corr = result.second.value();
1429  double d0_err = primaryVertexIsValid ? result.second.error() : -1.0;
1430  anElectron.setDB(d0_corr, d0_err, pat::Electron::PV3D);
1431 
1432  // Correct to beam spot
1433  // BS2D
1434  anElectron.setDB(track->dxy(beamspot), track->dxyError(beamspot), pat::Electron::BS2D);
1435 
1436  // make a fake vertex out of beam spot
1437  reco::Vertex vBeamspot(beamspot.position(), beamspot.covariance3D());
1438 
1439  // BS3D
1440  result = IPTools::signedImpactParameter3D(tt, GlobalVector(track->px(), track->py(), track->pz()), vBeamspot);
1441  d0_corr = result.second.value();
1442  d0_err = beamspotIsValid ? result.second.error() : -1.0;
1443  anElectron.setDB(d0_corr, d0_err, pat::Electron::BS3D);
1444 
1445  // PVDZ
1446  anElectron.setDB(
1447  track->dz(primaryVertex.position()), std::hypot(track->dzError(), primaryVertex.zError()), pat::Electron::PVDZ);
1448 }
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Definition: Matriplex.h:436
std::pair< bool, Measurement1D > signedImpactParameter3D(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:81
void setDB(double dB, double edB, IPTYPE type)
Set impact parameter of a certain type and its uncertainty.
Definition: TTTypes.h:54
primaryVertex
hltOfflineBeamSpot for HLTMON
Global3DVector GlobalVector
Definition: GlobalVector.h:10

◆ fillDescriptions()

void PATElectronProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 1236 of file PATElectronProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addNode(), edm::ParameterSetDescription::addOptional(), pat::helper::KinResolutionsLoader::fillDescription(), pat::PATUserDataHelper< ObjectType >::fillDescription(), edm::ParameterSetDescription::ifValue(), ProducerED_cfi::InputTag, or, edm::ParameterSetDescription::setAllowAnything(), edm::ParameterSetDescription::setComment(), and edm::ParameterDescriptionNode::setComment().

1236  {
1238  iDesc.setComment("PAT electron producer module");
1239 
1240  // input source
1241  iDesc.add<edm::InputTag>("pfCandidateMap", edm::InputTag("no default"))->setComment("input collection");
1242  iDesc.add<edm::InputTag>("electronSource", edm::InputTag("no default"))->setComment("input collection");
1243 
1244  iDesc.ifValue(
1245  edm::ParameterDescription<bool>("addPFClusterIso", false, true),
1247  "ecalPFClusterIsoMap", edm::InputTag("electronEcalPFClusterIsolationProducer"), true) and
1249  "hcalPFClusterIsoMap", edm::InputTag("electronHcalPFClusterIsolationProducer"), true)) or
1250  false >> (edm::ParameterDescription<edm::InputTag>("ecalPFClusterIsoMap", edm::InputTag(""), true) and
1251  edm::ParameterDescription<edm::InputTag>("hcalPFClusterIsoMap", edm::InputTag(""), true)));
1252 
1253  iDesc.ifValue(edm::ParameterDescription<bool>("addPuppiIsolation", false, true),
1255  "puppiIsolationChargedHadrons",
1256  edm::InputTag("egmElectronPUPPIIsolation", "h+-DR030-BarVeto000-EndVeto001"),
1257  true) and
1259  "puppiIsolationNeutralHadrons",
1260  edm::InputTag("egmElectronPUPPIIsolation", "h0-DR030-BarVeto000-EndVeto000"),
1261  true) and
1263  "puppiIsolationPhotons",
1264  edm::InputTag("egmElectronPUPPIIsolation", "gamma-DR030-BarVeto000-EndVeto008"),
1265  true) and
1267  "puppiNoLeptonsIsolationChargedHadrons",
1268  edm::InputTag("egmElectronPUPPINoLeptonsIsolation", "gamma-DR030-BarVeto000-EndVeto008"),
1269  true) and
1271  "puppiNoLeptonsIsolationNeutralHadrons",
1272  edm::InputTag("egmElectronPUPPINoLeptonsIsolation", "gamma-DR030-BarVeto000-EndVeto008"),
1273  true) and
1275  "puppiNoLeptonsIsolationPhotons",
1276  edm::InputTag("egmElectronPUPPINoLeptonsIsolation", "gamma-DR030-BarVeto000-EndVeto008"),
1277  true)) or
1278  false >> edm::EmptyGroupDescription());
1279 
1280  // embedding
1281  iDesc.add<bool>("embedGsfElectronCore", true)->setComment("embed external gsf electron core");
1282  iDesc.add<bool>("embedGsfTrack", true)->setComment("embed external gsf track");
1283  iDesc.add<bool>("embedSuperCluster", true)->setComment("embed external super cluster");
1284  iDesc.add<bool>("embedPflowSuperCluster", true)->setComment("embed external super cluster");
1285  iDesc.add<bool>("embedSeedCluster", true)->setComment("embed external seed cluster");
1286  iDesc.add<bool>("embedBasicClusters", true)->setComment("embed external basic clusters");
1287  iDesc.add<bool>("embedPreshowerClusters", true)->setComment("embed external preshower clusters");
1288  iDesc.add<bool>("embedPflowBasicClusters", true)->setComment("embed external pflow basic clusters");
1289  iDesc.add<bool>("embedPflowPreshowerClusters", true)->setComment("embed external pflow preshower clusters");
1290  iDesc.add<bool>("embedTrack", false)->setComment("embed external track");
1291  iDesc.add<bool>("embedRecHits", true)->setComment("embed external RecHits");
1292 
1293  // pf specific parameters
1294  iDesc.add<edm::InputTag>("pfElectronSource", edm::InputTag("pfElectrons"))
1295  ->setComment("particle flow input collection");
1296  auto&& usePfCandidateMultiMap = edm::ParameterDescription<bool>("usePfCandidateMultiMap", false, true);
1297  usePfCandidateMultiMap.setComment(
1298  "take ParticleFlow candidates from pfCandidateMultiMap instead of matching to pfElectrons by Gsf track "
1299  "reference");
1300  iDesc.ifValue(usePfCandidateMultiMap,
1301  true >> edm::ParameterDescription<edm::InputTag>("pfCandidateMultiMap", true) or
1302  false >> edm::EmptyGroupDescription());
1303  iDesc.add<bool>("useParticleFlow", false)->setComment("whether to use particle flow or not");
1304  iDesc.add<bool>("embedPFCandidate", false)->setComment("embed external particle flow object");
1305 
1306  // MC matching configurables
1307  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
1308  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
1309  std::vector<edm::InputTag> emptySourceVector;
1310  iDesc
1311  .addNode(edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
1312  edm::ParameterDescription<std::vector<edm::InputTag>>("genParticleMatch", emptySourceVector, true))
1313  ->setComment("input with MC match information");
1314 
1315  // electron ID configurables
1316  iDesc.add<bool>("addElectronID", true)->setComment("add electron ID variables");
1317  edm::ParameterSetDescription electronIDSourcesPSet;
1318  electronIDSourcesPSet.setAllowAnything();
1319  iDesc
1320  .addNode(
1321  edm::ParameterDescription<edm::InputTag>("electronIDSource", edm::InputTag(), true) xor
1322  edm::ParameterDescription<edm::ParameterSetDescription>("electronIDSources", electronIDSourcesPSet, true))
1323  ->setComment("input with electron ID variables");
1324 
1325  // mini-iso
1326  iDesc.add<bool>("computeMiniIso", false)->setComment("whether or not to compute and store electron mini-isolation");
1327  iDesc.add<edm::InputTag>("pfCandsForMiniIso", edm::InputTag("packedPFCandidates"))
1328  ->setComment("collection to use to compute mini-iso");
1329  iDesc.add<std::vector<double>>("miniIsoParamsE", std::vector<double>())
1330  ->setComment("mini-iso parameters to use for endcap electrons");
1331  iDesc.add<std::vector<double>>("miniIsoParamsB", std::vector<double>())
1332  ->setComment("mini-iso parameters to use for barrel electrons");
1333 
1334  // IsoDeposit configurables
1335  edm::ParameterSetDescription isoDepositsPSet;
1336  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
1337  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
1338  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
1339  isoDepositsPSet.addOptional<edm::InputTag>("pfAllParticles");
1340  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadrons");
1341  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedAll");
1342  isoDepositsPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
1343  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
1344  isoDepositsPSet.addOptional<edm::InputTag>("pfPhotons");
1345  isoDepositsPSet.addOptional<std::vector<edm::InputTag>>("user");
1346  iDesc.addOptional("isoDeposits", isoDepositsPSet);
1347 
1348  // isolation values configurables
1349  edm::ParameterSetDescription isolationValuesPSet;
1350  isolationValuesPSet.addOptional<edm::InputTag>("tracker");
1351  isolationValuesPSet.addOptional<edm::InputTag>("ecal");
1352  isolationValuesPSet.addOptional<edm::InputTag>("hcal");
1353  isolationValuesPSet.addOptional<edm::InputTag>("pfAllParticles");
1354  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedHadrons");
1355  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedAll");
1356  isolationValuesPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
1357  isolationValuesPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
1358  isolationValuesPSet.addOptional<edm::InputTag>("pfPhotons");
1359  isolationValuesPSet.addOptional<std::vector<edm::InputTag>>("user");
1360  iDesc.addOptional("isolationValues", isolationValuesPSet);
1361 
1362  // isolation values configurables
1363  edm::ParameterSetDescription isolationValuesNoPFIdPSet;
1364  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("tracker");
1365  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("ecal");
1366  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("hcal");
1367  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfAllParticles");
1368  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfChargedHadrons");
1369  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfChargedAll");
1370  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
1371  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
1372  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfPhotons");
1373  isolationValuesNoPFIdPSet.addOptional<std::vector<edm::InputTag>>("user");
1374  iDesc.addOptional("isolationValuesNoPFId", isolationValuesNoPFIdPSet);
1375 
1376  // Efficiency configurables
1377  edm::ParameterSetDescription efficienciesPSet;
1378  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
1379  iDesc.add("efficiencies", efficienciesPSet);
1380  iDesc.add<bool>("addEfficiencies", false);
1381 
1382  // Check to see if the user wants to add user data
1383  edm::ParameterSetDescription userDataPSet;
1385  iDesc.addOptional("userData", userDataPSet);
1386 
1387  // electron shapes
1388  iDesc.add<bool>("addMVAVariables", true)->setComment("embed extra variables in pat::Electron : sip3d, sigmaIEtaIPhi");
1389  iDesc.add<edm::InputTag>("reducedBarrelRecHitCollection", edm::InputTag("reducedEcalRecHitsEB"));
1390  iDesc.add<edm::InputTag>("reducedEndcapRecHitCollection", edm::InputTag("reducedEcalRecHitsEE"));
1391 
1392  edm::ParameterSetDescription isolationPSet;
1393  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
1394  iDesc.add("userIsolation", isolationPSet);
1395 
1396  // Resolution configurables
1398 
1399  iDesc.add<bool>("embedHighLevelSelection", true)->setComment("embed high level selection");
1400  edm::ParameterSetDescription highLevelPSet;
1401  highLevelPSet.setAllowAnything();
1402  iDesc.addNode(edm::ParameterDescription<edm::InputTag>("beamLineSrc", edm::InputTag(), true))
1403  ->setComment("input with high level selection");
1405  ->setComment("input with high level selection");
1406 
1407  descriptions.add("PATElectronProducer", iDesc);
1408 }
void setComment(std::string const &value)
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::unique_ptr< ParameterDescriptionCases< T >> cases)
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
void setAllowAnything()
allow any parameter label/value pairs
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
static void fillDescription(edm::ParameterSetDescription &iDesc)
void setComment(std::string const &value)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ fillElectron()

void PATElectronProducer::fillElectron ( Electron aElectron,
const ElectronBaseRef electronRef,
const reco::CandidateBaseRef baseRef,
const GenAssociations genMatches,
const IsoDepositMaps deposits,
const bool  pfId,
const IsolationValueMaps isolationValues,
const IsolationValueMaps isolationValuesNoPFId 
) const
private

common electron filling, for both the standard and PF2PAT case

Definition at line 1031 of file PATElectronProducer.cc.

References addGenMatch_, pat::PATObject< ObjectType >::addGenParticleRef(), cms::cuda::assert(), CandIsolatorFromDeposits_cfi::deposits, efficiencyLoader_, pat::Electron::embedBasicClusters(), embedBasicClusters_, embedGenMatch_, pat::PATObject< ObjectType >::embedGenParticle(), pat::Electron::embedGsfElectronCore(), embedGsfElectronCore_, pat::Electron::embedGsfTrack(), embedGsfTrack_, pat::Electron::embedPflowBasicClusters(), embedPflowBasicClusters_, pat::Electron::embedPflowPreshowerClusters(), embedPflowPreshowerClusters_, pat::Electron::embedPflowSuperCluster(), embedPflowSuperCluster_, pat::Electron::embedPreshowerClusters(), embedPreshowerClusters_, pat::Electron::embedSeedCluster(), embedSeedCluster_, pat::Electron::embedSuperCluster(), embedSuperCluster_, pat::Electron::embedTrack(), embedTrack_, pat::helper::EfficiencyLoader::enabled(), pat::helper::KinResolutionsLoader::enabled(), dqmdumpme::first, mps_fire::i, edm::Ref< C, T, F >::isNull(), isoDepositLabels_, isolationValueLabels_, isolationValueLabelsNoPFId_, displacedMuonProducer_cff::isolationValues, electronProducer_cff::isolationValuesNoPFId, dqmiolumiharvest::j, dqmiodumpmetadata::n, pat::Electron::pfCandidateRef(), resolutionLoader_, pat::helper::EfficiencyLoader::setEfficiencies(), pat::Lepton< LeptonType >::setIsoDeposit(), pat::Lepton< LeptonType >::setIsolation(), pat::helper::KinResolutionsLoader::setResolutions(), source, and useParticleFlow_.

Referenced by produce().

1038  {
1039  //COLIN: might want to use the PFCandidate 4-mom. Which one is in use now?
1040  // if (useParticleFlow_)
1041  // aMuon.setP4( aMuon.pfCandidateRef()->p4() );
1042 
1043  //COLIN:
1044  //In the embedding case, the reference cannot be used to look into a value map.
1045  //therefore, one has to had the PFCandidateRef to this function, which becomes a bit
1046  //too much specific.
1047 
1048  // in fact, this function needs a baseref or ptr for genmatch
1049  // and a baseref or ptr for isodeposits and isolationvalues.
1050  // baseref is not needed
1051  // the ptrForIsolation and ptrForMatching should be defined upstream.
1052 
1053  // is the concrete elecRef needed for the efficiency loader? what is this loader?
1054  // how can we make it compatible with the particle flow electrons?
1055 
1057  anElectron.embedGsfElectronCore();
1058  if (embedGsfTrack_)
1059  anElectron.embedGsfTrack();
1060  if (embedSuperCluster_)
1061  anElectron.embedSuperCluster();
1063  anElectron.embedPflowSuperCluster();
1064  if (embedSeedCluster_)
1065  anElectron.embedSeedCluster();
1066  if (embedBasicClusters_)
1067  anElectron.embedBasicClusters();
1069  anElectron.embedPreshowerClusters();
1071  anElectron.embedPflowBasicClusters();
1073  anElectron.embedPflowPreshowerClusters();
1074  if (embedTrack_)
1075  anElectron.embedTrack();
1076 
1077  // store the match to the generated final state muons
1078  if (addGenMatch_) {
1079  for (size_t i = 0, n = genMatches.size(); i < n; ++i) {
1080  if (useParticleFlow_) {
1081  reco::GenParticleRef genElectron = (*genMatches[i])[anElectron.pfCandidateRef()];
1082  anElectron.addGenParticleRef(genElectron);
1083  } else {
1084  reco::GenParticleRef genElectron = (*genMatches[i])[elecRef];
1085  anElectron.addGenParticleRef(genElectron);
1086  }
1087  }
1088  if (embedGenMatch_)
1089  anElectron.embedGenParticle();
1090  }
1091 
1092  if (efficiencyLoader_.enabled()) {
1093  efficiencyLoader_.setEfficiencies(anElectron, elecRef);
1094  }
1095 
1096  if (resolutionLoader_.enabled()) {
1097  resolutionLoader_.setResolutions(anElectron);
1098  }
1099 
1100  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
1101  if (useParticleFlow_) {
1102  reco::PFCandidateRef pfcandref = anElectron.pfCandidateRef();
1103  assert(!pfcandref.isNull());
1104  reco::CandidatePtr source = pfcandref->sourceCandidatePtr(0);
1105  anElectron.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[source]);
1106  } else
1107  anElectron.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[elecRef]);
1108  }
1109 
1110  for (size_t j = 0; j < isolationValues.size(); ++j) {
1111  if (useParticleFlow_) {
1112  reco::CandidatePtr source = anElectron.pfCandidateRef()->sourceCandidatePtr(0);
1113  anElectron.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[source]);
1114  } else if (pfId) {
1115  anElectron.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[elecRef]);
1116  }
1117  }
1118 
1119  //for electrons not identified as PF electrons
1120  for (size_t j = 0; j < isolationValuesNoPFId.size(); ++j) {
1121  if (!pfId) {
1122  anElectron.setIsolation(isolationValueLabelsNoPFId_[j].first, (*isolationValuesNoPFId[j])[elecRef]);
1123  }
1124  }
1125 }
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
const bool useParticleFlow_
pflow specific
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
assert(be >=bs)
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
bool isNull() const
Checks for null.
Definition: Ref.h:235
pat::helper::EfficiencyLoader efficiencyLoader_
IsolationLabels isolationValueLabelsNoPFId_
IsolationLabels isolationValueLabels_
pat::helper::KinResolutionsLoader resolutionLoader_
static std::string const source
Definition: EdmProvDump.cc:49

◆ fillElectron2()

void PATElectronProducer::fillElectron2 ( Electron anElectron,
const reco::CandidatePtr candPtrForIsolation,
const reco::CandidatePtr candPtrForGenMatch,
const reco::CandidatePtr candPtrForLoader,
const GenAssociations genMatches,
const IsoDepositMaps deposits,
const IsolationValueMaps isolationValues 
) const
private

Definition at line 1127 of file PATElectronProducer.cc.

References addGenMatch_, pat::PATObject< ObjectType >::addGenParticleRef(), edm::contains(), CandIsolatorFromDeposits_cfi::deposits, pat::EcalIso, efficiencyLoader_, pat::Electron::embedBasicClusters(), embedBasicClusters_, embedGenMatch_, pat::PATObject< ObjectType >::embedGenParticle(), pat::Electron::embedGsfElectronCore(), embedGsfElectronCore_, pat::Electron::embedGsfTrack(), embedGsfTrack_, pat::Electron::embedPflowBasicClusters(), embedPflowBasicClusters_, pat::Electron::embedPflowPreshowerClusters(), embedPflowPreshowerClusters_, pat::Electron::embedPflowSuperCluster(), embedPflowSuperCluster_, pat::Electron::embedPreshowerClusters(), embedPreshowerClusters_, pat::Electron::embedSeedCluster(), embedSeedCluster_, pat::Electron::embedSuperCluster(), embedSuperCluster_, pat::Electron::embedTrack(), embedTrack_, pat::helper::EfficiencyLoader::enabled(), pat::helper::KinResolutionsLoader::enabled(), dqmdumpme::first, pat::HcalIso, mps_fire::i, edm::Ptr< T >::id(), isoDepositLabels_, isolationValueLabels_, displacedMuonProducer_cff::isolationValues, dqmiolumiharvest::j, dqmiodumpmetadata::n, reco::GsfElectron::p4(), pat::Electron::pfCandidateRef(), resolutionLoader_, pat::Electron::setEcalDrivenMomentum(), pat::helper::EfficiencyLoader::setEfficiencies(), pat::Lepton< LeptonType >::setIsoDeposit(), pat::Lepton< LeptonType >::setIsolation(), reco::GsfElectron::setP4(), pat::helper::KinResolutionsLoader::setResolutions(), and pat::TrackIso.

Referenced by produce().

1133  {
1134  //COLIN/Florian: use the PFCandidate 4-mom.
1135  anElectron.setEcalDrivenMomentum(anElectron.p4());
1136  anElectron.setP4(anElectron.pfCandidateRef()->p4());
1137 
1138  // is the concrete elecRef needed for the efficiency loader? what is this loader?
1139  // how can we make it compatible with the particle flow electrons?
1140 
1142  anElectron.embedGsfElectronCore();
1143  if (embedGsfTrack_)
1144  anElectron.embedGsfTrack();
1145  if (embedSuperCluster_)
1146  anElectron.embedSuperCluster();
1148  anElectron.embedPflowSuperCluster();
1149  if (embedSeedCluster_)
1150  anElectron.embedSeedCluster();
1151  if (embedBasicClusters_)
1152  anElectron.embedBasicClusters();
1154  anElectron.embedPreshowerClusters();
1156  anElectron.embedPflowBasicClusters();
1158  anElectron.embedPflowPreshowerClusters();
1159  if (embedTrack_)
1160  anElectron.embedTrack();
1161 
1162  // store the match to the generated final state muons
1163 
1164  if (addGenMatch_) {
1165  for (size_t i = 0, n = genMatches.size(); i < n; ++i) {
1166  reco::GenParticleRef genElectron = (*genMatches[i])[candPtrForGenMatch];
1167  anElectron.addGenParticleRef(genElectron);
1168  }
1169  if (embedGenMatch_)
1170  anElectron.embedGenParticle();
1171  }
1172 
1173  //COLIN what's this? does it have to be GsfElectron specific?
1174  if (efficiencyLoader_.enabled()) {
1175  efficiencyLoader_.setEfficiencies(anElectron, candPtrForLoader);
1176  }
1177 
1178  if (resolutionLoader_.enabled()) {
1179  resolutionLoader_.setResolutions(anElectron);
1180  }
1181 
1182  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
1184  isoDepositLabels_[j].first == pat::HcalIso || deposits[j]->contains(candPtrForGenMatch.id())) {
1185  anElectron.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[candPtrForGenMatch]);
1186  } else if (deposits[j]->contains(candPtrForIsolation.id())) {
1187  anElectron.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[candPtrForIsolation]);
1188  } else {
1189  anElectron.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[candPtrForIsolation->sourceCandidatePtr(0)]);
1190  }
1191  }
1192 
1193  for (size_t j = 0; j < isolationValues.size(); ++j) {
1195  isolationValueLabels_[j].first == pat::HcalIso || isolationValues[j]->contains(candPtrForGenMatch.id())) {
1196  anElectron.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[candPtrForGenMatch]);
1197  } else if (isolationValues[j]->contains(candPtrForIsolation.id())) {
1198  anElectron.setIsolation(isolationValueLabels_[j].first, (*isolationValues[j])[candPtrForIsolation]);
1199  } else {
1201  (*isolationValues[j])[candPtrForIsolation->sourceCandidatePtr(0)]);
1202  }
1203  }
1204 }
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
void setP4(P4Kind kind, const LorentzVector &p4, float p4Error, bool setCandidate)
Definition: GsfElectron.cc:194
void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:115
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:37
ProductID id() const
Accessor for product ID.
Definition: Ptr.h:162
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
void embedSuperCluster()
method to store the electron&#39;s SuperCluster internally
void embedGsfElectronCore()
method to store the electron&#39;s core internally
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
void setEcalDrivenMomentum(const Candidate::LorentzVector &mom)
Definition: Electron.h:204
void embedPflowSuperCluster()
method to store the electron&#39;s PflowSuperCluster internally
reco::PFCandidateRef pfCandidateRef() const
reference to the source PFCandidates; null if this has been built from a standard electron ...
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
Definition: Lepton.h:191
void embedSeedCluster()
method to store the electron&#39;s seedcluster internally
void embedGenParticle()
Definition: PATObject.h:768
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
void embedPflowBasicClusters()
method to store the electron&#39;s pflow basic clusters
const LorentzVector & p4(P4Kind kind) const
Definition: GsfElectron.cc:217
void embedBasicClusters()
method to store the electron&#39;s basic clusters
void embedGsfTrack()
method to store the electron&#39;s GsfTrack internally
void addGenParticleRef(const reco::GenParticleRef &ref)
Definition: PATObject.h:751
pat::helper::EfficiencyLoader efficiencyLoader_
void embedPreshowerClusters()
method to store the electron&#39;s preshower clusters
IsolationLabels isolationValueLabels_
pat::helper::KinResolutionsLoader resolutionLoader_
void embedPflowPreshowerClusters()
method to store the electron&#39;s pflow preshower clusters
void embedTrack()
method to store the electron&#39;s Track internally

◆ produce()

void PATElectronProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 442 of file PATElectronProducer.cc.

References IPTools::absoluteImpactParameter3D(), pat::PATUserDataHelper< ObjectType >::add(), addElecID_, addGenMatch_, addMVAVariables_, addPFClusterIso_, addPuppiIsolation_, Reference_intrackfit_cff::barrel, beamLineToken_, pwdgSkimBPark_cfi::beamSpot, pat::helper::MultiIsolator::beginEvent(), nano_mu_local_reco_cff::bool, TransientTrackBuilder::build(), computeMiniIso_, CandIsolatorFromDeposits_cfi::deposits, reco::PFCandidate::e, DetId::Ecal, EcalBarrel, ecalClusterToolsESGetTokens_, EcalEndcap, ecalPFClusterIsoT_, ecalTopology_, ecalTopologyToken_, efficiencyLoader_, elecIDSrcs_, elecIDTokens_, pwdgSkimBPark_cfi::electrons, electronToken_, embedBasicClusters_, embedGenMatch_, embedHighLevel(), embedHighLevelSelection_, pat::Electron::embedPFCandidate(), embedPFCandidate_, embedPflowBasicClusters_, pat::Electron::embedRecHits(), embedRecHits_, pat::helper::EfficiencyLoader::enabled(), pat::helper::KinResolutionsLoader::enabled(), pat::helper::MultiIsolator::enabled(), pat::helper::MultiIsolator::endEvent(), pat::helper::MultiIsolator::fill(), fillElectron(), fillElectron2(), dqmdumpme::first, genMatchTokens_, EcalClusterLazyToolsBase::ESGetTokens::get(), edm::EventSetup::getData(), edm::EventSetup::getHandle(), CaloTopology::getSubdetectorTopology(), CaloSubdetectorTopology::getWindow(), ConversionTools::hasMatchedConversion(), hcalPFClusterIsoT_, hConversionsToken_, mps_fire::i, heavyIonCSV_trainingSettings::idx, iEvent, electrons_cff::ip3d, edm::Ptr< T >::isNonnull(), isoDepositLabels_, isoDepositTokens_, isolationValueNoPFIdTokens_, displacedMuonProducer_cff::isolationValues, electronProducer_cff::isolationValuesNoPFId, isolationValueTokens_, isolator_, isolatorTmpStorage_, edm::HandleBase::isValid(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmiolumiharvest::j, reco::Matched, reco::HitPattern::MISSING_INNER_HITS, eostools::move(), pat::helper::EfficiencyLoader::newEvent(), pat::helper::KinResolutionsLoader::newEvent(), patElectronEAIsoCorrectionProducer_cfi::patElectrons, pcToken_, packedPFCandidateRefMixer_cfi::pf, pfCandidateMapToken_, pfCandidateMultiMapToken_, pfElecToken_, electronIsolatorFromEffectiveArea_cfi::pfElectrons, reco::GsfElectron::pfIsolationVariables(), reco::BeamSpot::position(), BeamMonitor_cff::primaryVertex, edm::Handle< T >::product(), pTComparator_, PUPPIIsolation_charged_hadrons_, PUPPIIsolation_neutral_hadrons_, PUPPIIsolation_photons_, PUPPINoLeptonsIsolation_charged_hadrons_, PUPPINoLeptonsIsolation_neutral_hadrons_, PUPPINoLeptonsIsolation_photons_, edm::SortedCollection< T, SORT >::push_back(), pvToken_, FastTrackerRecHitMaskProducer_cfi::recHits, reducedBarrelRecHitCollectionToken_, electronIdMVAProducer_cfi::reducedEBRecHitCollection, electronIdMVAProducer_cfi::reducedEERecHitCollection, reducedEndcapRecHitCollectionToken_, resolutionLoader_, fileCollector::seed, pat::Electron::setElectronIDs(), setElectronMiniIso(), pat::Lepton< LeptonType >::setIsoDeposit(), pat::Lepton< LeptonType >::setIsolation(), pat::Electron::setIsolationPUPPI(), pat::Electron::setIsolationPUPPINoLeptons(), pat::Electron::setIsPF(), pat::Electron::setMvaVariables(), pat::Electron::setPassConversionVeto(), pat::Electron::setPFCandidateRef(), reco::GsfElectron::setPfIsolationVariables(), jetUpdater_cfi::sort, edm::SortedCollection< T, SORT >::sort(), reco::GsfElectron::PflowIsolationVariables::sumEcalClusterEt, reco::GsfElectron::PflowIsolationVariables::sumHcalClusterEt, HLT_2024v14_cff::track, trackBuilderToken_, tier0::unique(), useParticleFlow_, usePfCandidateMultiMap_, userDataHelper_, and useUserData_.

442  {
443  // switch off embedding (in unschedules mode)
444  if (iEvent.isRealData()) {
445  addGenMatch_ = false;
446  embedGenMatch_ = false;
447  }
448 
450 
451  // Get the collection of electrons from the event
453  iEvent.getByToken(electronToken_, electrons);
454 
456  if (computeMiniIso_)
457  iEvent.getByToken(pcToken_, pc);
458 
459  // for additional mva variables
460  edm::InputTag reducedEBRecHitCollection(string("reducedEcalRecHitsEB"));
461  edm::InputTag reducedEERecHitCollection(string("reducedEcalRecHitsEE"));
462  //EcalClusterLazyTools lazyTools(iEvent, iSetup, reducedEBRecHitCollection, reducedEERecHitCollection);
463  EcalClusterLazyTools lazyTools(iEvent,
467 
468  // for conversion veto selection
470  iEvent.getByToken(hConversionsToken_, hConversions);
471 
472  // Get the ESHandle for the transient track builder, if needed for
473  // high level selection embedding
475 
476  if (isolator_.enabled())
477  isolator_.beginEvent(iEvent, iSetup);
478 
483 
485  for (size_t j = 0, nd = isoDepositTokens_.size(); j < nd; ++j) {
486  iEvent.getByToken(isoDepositTokens_[j], deposits[j]);
487  }
488 
490  for (size_t j = 0; j < isolationValueTokens_.size(); ++j) {
492  }
493 
495  for (size_t j = 0; j < isolationValueNoPFIdTokens_.size(); ++j) {
497  }
498 
499  // prepare the MC matching
500  GenAssociations genMatches(genMatchTokens_.size());
501  if (addGenMatch_) {
502  for (size_t j = 0, nd = genMatchTokens_.size(); j < nd; ++j) {
503  iEvent.getByToken(genMatchTokens_[j], genMatches[j]);
504  }
505  }
506 
507  // prepare ID extraction
508  std::vector<edm::Handle<edm::ValueMap<float>>> idhandles;
509  std::vector<pat::Electron::IdPair> ids;
510  if (addElecID_) {
511  idhandles.resize(elecIDSrcs_.size());
512  ids.resize(elecIDSrcs_.size());
513  for (size_t i = 0; i < elecIDSrcs_.size(); ++i) {
514  iEvent.getByToken(elecIDTokens_[i], idhandles[i]);
515  ids[i].first = elecIDSrcs_[i].first;
516  }
517  }
518 
519  // prepare the high level selection:
520  // needs beamline
521  reco::TrackBase::Point beamPoint(0, 0, 0);
524  bool beamSpotIsValid = false;
525  bool primaryVertexIsValid = false;
526 
527  // Get the beamspot
528  edm::Handle<reco::BeamSpot> beamSpotHandle;
529  iEvent.getByToken(beamLineToken_, beamSpotHandle);
530 
532  // Get the primary vertex
534  iEvent.getByToken(pvToken_, pvHandle);
535 
536  // This is needed by the IPTools methods from the tracking group
537  trackBuilder = iSetup.getHandle(trackBuilderToken_);
538 
539  if (beamSpotHandle.isValid()) {
540  beamSpot = *beamSpotHandle;
541  beamSpotIsValid = true;
542  } else {
543  edm::LogError("DataNotAvailable") << "No beam spot available from EventSetup, not adding high level selection \n";
544  }
545 
546  if (pvHandle.isValid() && !pvHandle->empty()) {
547  primaryVertex = pvHandle->at(0);
548  primaryVertexIsValid = true;
549  } else {
550  edm::LogError("DataNotAvailable")
551  << "No primary vertex available from EventSetup, not adding high level selection \n";
552  }
553  }
554  //value maps for puppi isolation
555  edm::Handle<edm::ValueMap<float>> PUPPIIsolation_charged_hadrons;
556  edm::Handle<edm::ValueMap<float>> PUPPIIsolation_neutral_hadrons;
557  edm::Handle<edm::ValueMap<float>> PUPPIIsolation_photons;
558  //value maps for puppiNoLeptons isolation
559  edm::Handle<edm::ValueMap<float>> PUPPINoLeptonsIsolation_charged_hadrons;
560  edm::Handle<edm::ValueMap<float>> PUPPINoLeptonsIsolation_neutral_hadrons;
561  edm::Handle<edm::ValueMap<float>> PUPPINoLeptonsIsolation_photons;
562  if (addPuppiIsolation_) {
563  //puppi
564  iEvent.getByToken(PUPPIIsolation_charged_hadrons_, PUPPIIsolation_charged_hadrons);
565  iEvent.getByToken(PUPPIIsolation_neutral_hadrons_, PUPPIIsolation_neutral_hadrons);
566  iEvent.getByToken(PUPPIIsolation_photons_, PUPPIIsolation_photons);
567  //puppiNoLeptons
568  iEvent.getByToken(PUPPINoLeptonsIsolation_charged_hadrons_, PUPPINoLeptonsIsolation_charged_hadrons);
569  iEvent.getByToken(PUPPINoLeptonsIsolation_neutral_hadrons_, PUPPINoLeptonsIsolation_neutral_hadrons);
570  iEvent.getByToken(PUPPINoLeptonsIsolation_photons_, PUPPINoLeptonsIsolation_photons);
571  }
572 
573  std::vector<Electron>* patElectrons = new std::vector<Electron>();
574 
575  if (useParticleFlow_) {
577  iEvent.getByToken(pfElecToken_, pfElectrons);
578  unsigned index = 0;
579 
580  for (reco::PFCandidateConstIterator i = pfElectrons->begin(); i != pfElectrons->end(); ++i, ++index) {
582  reco::PFCandidatePtr ptrToPFElectron(pfElectrons, index);
583  // reco::CandidateBaseRef pfBaseRef( pfRef );
584 
585  reco::GsfTrackRef PfTk = i->gsfTrackRef();
586 
587  bool Matched = false;
588  bool MatchedToAmbiguousGsfTrack = false;
589  for (edm::View<reco::GsfElectron>::const_iterator itElectron = electrons->begin(); itElectron != electrons->end();
590  ++itElectron) {
591  unsigned int idx = itElectron - electrons->begin();
592  auto elePtr = electrons->ptrAt(idx);
593  if (Matched || MatchedToAmbiguousGsfTrack)
594  continue;
595 
596  reco::GsfTrackRef EgTk = itElectron->gsfTrack();
597 
598  if (itElectron->gsfTrack() == i->gsfTrackRef()) {
599  Matched = true;
600  } else {
601  for (auto const& it : itElectron->ambiguousGsfTracks()) {
602  MatchedToAmbiguousGsfTrack |= (bool)(i->gsfTrackRef() == it);
603  }
604  }
605 
606  if (Matched || MatchedToAmbiguousGsfTrack) {
607  // ptr needed for finding the matched gen particle
608  reco::CandidatePtr ptrToGsfElectron(electrons, idx);
609 
610  // ref to base needed for the construction of the pat object
611  const edm::RefToBase<reco::GsfElectron>& elecsRef = electrons->refAt(idx);
612  Electron anElectron(elecsRef);
613  anElectron.setPFCandidateRef(pfRef);
614  if (addPuppiIsolation_) {
615  anElectron.setIsolationPUPPI((*PUPPIIsolation_charged_hadrons)[elePtr],
616  (*PUPPIIsolation_neutral_hadrons)[elePtr],
617  (*PUPPIIsolation_photons)[elePtr]);
618  anElectron.setIsolationPUPPINoLeptons((*PUPPINoLeptonsIsolation_charged_hadrons)[elePtr],
619  (*PUPPINoLeptonsIsolation_neutral_hadrons)[elePtr],
620  (*PUPPINoLeptonsIsolation_photons)[elePtr]);
621  } else {
622  anElectron.setIsolationPUPPI(-999., -999., -999.);
623  anElectron.setIsolationPUPPINoLeptons(-999., -999., -999.);
624  }
625 
626  //it should be always true when particleFlow electrons are used.
627  anElectron.setIsPF(true);
628 
629  if (embedPFCandidate_)
630  anElectron.embedPFCandidate();
631 
632  if (useUserData_) {
633  userDataHelper_.add(anElectron, iEvent, iSetup);
634  }
635 
636  double ip3d = -999; // for mva variable
637 
638  // embed high level selection
640  // get the global track
641  const reco::GsfTrackRef& track = PfTk;
642 
643  // Make sure the collection it points to is there
644  if (track.isNonnull() && track.isAvailable()) {
645  reco::TransientTrack tt = trackBuilder->build(track);
646  embedHighLevel(anElectron, track, tt, primaryVertex, primaryVertexIsValid, beamSpot, beamSpotIsValid);
647 
648  std::pair<bool, Measurement1D> ip3dpv = IPTools::absoluteImpactParameter3D(tt, primaryVertex);
649  ip3d = ip3dpv.second.value(); // for mva variable
650  }
651  }
652 
653  //Electron Id
654 
655  if (addElecID_) {
656  //STANDARD EL ID
657  for (size_t i = 0; i < elecIDSrcs_.size(); ++i) {
658  ids[i].second = (*idhandles[i])[elecsRef];
659  }
660  //SPECIFIC PF ID
661  ids.push_back(std::make_pair("pf_evspi", pfRef->mva_e_pi()));
662  ids.push_back(std::make_pair("pf_evsmu", pfRef->mva_e_mu()));
663  anElectron.setElectronIDs(ids);
664  }
665 
666  if (addMVAVariables_) {
667  // add missing mva variables
668  const auto& vCov = lazyTools.localCovariances(*(itElectron->superCluster()->seed()));
669  anElectron.setMvaVariables(vCov[1], ip3d);
670  }
671  // PFClusterIso
672  if (addPFClusterIso_) {
673  // Get PFCluster Isolation
674  edm::Handle<edm::ValueMap<float>> ecalPFClusterIsoMapH;
675  iEvent.getByToken(ecalPFClusterIsoT_, ecalPFClusterIsoMapH);
676  edm::Handle<edm::ValueMap<float>> hcalPFClusterIsoMapH;
677  iEvent.getByToken(hcalPFClusterIsoT_, hcalPFClusterIsoMapH);
678  reco::GsfElectron::PflowIsolationVariables newPFIsol = anElectron.pfIsolationVariables();
679  newPFIsol.sumEcalClusterEt = (*ecalPFClusterIsoMapH)[elecsRef];
680  newPFIsol.sumHcalClusterEt = (*hcalPFClusterIsoMapH)[elecsRef];
681  anElectron.setPfIsolationVariables(newPFIsol);
682  }
683 
684  std::vector<DetId> selectedCells;
685  bool barrel = itElectron->isEB();
686  //loop over sub clusters
687  if (embedBasicClusters_) {
688  for (reco::CaloCluster_iterator clusIt = itElectron->superCluster()->clustersBegin();
689  clusIt != itElectron->superCluster()->clustersEnd();
690  ++clusIt) {
691  //get seed (max energy xtal)
692  DetId seed = lazyTools.getMaximum(**clusIt).first;
693  //get all xtals in 5x5 window around the seed
694  std::vector<DetId> dets5x5 =
697  selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
698 
699  //get all xtals belonging to cluster
700  for (const std::pair<DetId, float>& hit : (*clusIt)->hitsAndFractions()) {
701  selectedCells.push_back(hit.first);
702  }
703  }
704  }
705 
706  if (embedPflowBasicClusters_ && itElectron->parentSuperCluster().isNonnull()) {
707  for (reco::CaloCluster_iterator clusIt = itElectron->parentSuperCluster()->clustersBegin();
708  clusIt != itElectron->parentSuperCluster()->clustersEnd();
709  ++clusIt) {
710  //get seed (max energy xtal)
711  DetId seed = lazyTools.getMaximum(**clusIt).first;
712  //get all xtals in 5x5 window around the seed
713  std::vector<DetId> dets5x5 =
716  selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
717 
718  //get all xtals belonging to cluster
719  for (const std::pair<DetId, float>& hit : (*clusIt)->hitsAndFractions()) {
720  selectedCells.push_back(hit.first);
721  }
722  }
723  }
724 
725  //remove duplicates
726  std::sort(selectedCells.begin(), selectedCells.end());
727  std::unique(selectedCells.begin(), selectedCells.end());
728 
729  // Retrieve the corresponding RecHits
730 
732  if (barrel)
733  iEvent.getByToken(reducedBarrelRecHitCollectionToken_, rechitsH);
734  else
735  iEvent.getByToken(reducedEndcapRecHitCollectionToken_, rechitsH);
736 
737  EcalRecHitCollection selectedRecHits;
738  const EcalRecHitCollection* recHits = rechitsH.product();
739 
740  unsigned nSelectedCells = selectedCells.size();
741  for (unsigned icell = 0; icell < nSelectedCells; ++icell) {
742  EcalRecHitCollection::const_iterator it = recHits->find(selectedCells[icell]);
743  if (it != recHits->end()) {
744  selectedRecHits.push_back(*it);
745  }
746  }
747  selectedRecHits.sort();
748  if (embedRecHits_)
749  anElectron.embedRecHits(&selectedRecHits);
750 
751  // set conversion veto selection
752  bool passconversionveto = false;
753  if (hConversions.isValid()) {
754  // this is recommended method
755  passconversionveto =
756  !ConversionTools::hasMatchedConversion(*itElectron, *hConversions, beamSpotHandle->position());
757  } else {
758  // use missing hits without vertex fit method
759  passconversionveto =
760  itElectron->gsfTrack()->hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS) < 1;
761  }
762 
763  anElectron.setPassConversionVeto(passconversionveto);
764 
765  // fillElectron(anElectron,elecsRef,pfBaseRef,
766  // genMatches, deposits, isolationValues);
767 
768  //COLIN small warning !
769  // we are currently choosing to take the 4-momentum of the PFCandidate;
770  // the momentum of the GsfElectron is saved though
771  // we must therefore match the GsfElectron.
772  // because of this, we should not change the source of the electron matcher
773  // to the collection of PFElectrons in the python configuration
774  // I don't know what to do with the efficiencyLoader, since I don't know
775  // what this class is for.
777  anElectron, ptrToPFElectron, ptrToGsfElectron, ptrToGsfElectron, genMatches, deposits, isolationValues);
778 
779  //COLIN need to use fillElectron2 in the non-pflow case as well, and to test it.
780 
781  if (computeMiniIso_)
782  setElectronMiniIso(anElectron, pc.product());
783 
784  patElectrons->push_back(anElectron);
785  }
786  }
787  //if( !Matched && !MatchedToAmbiguousGsfTrack) std::cout << "!!!!A pf electron could not be matched to a gsf!!!!" << std::endl;
788  }
789  }
790 
791  else {
795  bool pfCandsPresent = false, valMapPresent = false;
797  iEvent.getByToken(pfCandidateMultiMapToken_, ValMultiMapH);
798  } else {
799  pfCandsPresent = iEvent.getByToken(pfElecToken_, pfElectrons);
800  valMapPresent = iEvent.getByToken(pfCandidateMapToken_, ValMapH);
801  }
802 
803  for (edm::View<reco::GsfElectron>::const_iterator itElectron = electrons->begin(); itElectron != electrons->end();
804  ++itElectron) {
805  // construct the Electron from the ref -> save ref to original object
806  //FIXME: looks like a lot of instances could be turned into const refs
807  unsigned int idx = itElectron - electrons->begin();
809  reco::CandidateBaseRef elecBaseRef(elecsRef);
810  Electron anElectron(elecsRef);
811  auto elePtr = electrons->ptrAt(idx);
812 
813  // Is this GsfElectron also identified as an e- in the particle flow?
814  bool pfId = false;
815 
817  for (const reco::PFCandidateRef& pf : (*ValMultiMapH)[elePtr]) {
818  if (pf->particleId() == reco::PFCandidate::e) {
819  pfId = true;
820  anElectron.setPFCandidateRef(pf);
821  break;
822  }
823  }
824  } else if (pfCandsPresent) {
825  // PF electron collection not available.
826  const reco::GsfTrackRef& trkRef = itElectron->gsfTrack();
827  int index = 0;
828  for (reco::PFCandidateConstIterator ie = pfElectrons->begin(); ie != pfElectrons->end(); ++ie, ++index) {
829  if (ie->particleId() != reco::PFCandidate::e)
830  continue;
831  const reco::GsfTrackRef& pfTrkRef = ie->gsfTrackRef();
832  if (trkRef == pfTrkRef) {
833  pfId = true;
835  anElectron.setPFCandidateRef(pfRef);
836  break;
837  }
838  }
839  } else if (valMapPresent) {
840  // use value map if PF collection not available
841  const edm::ValueMap<reco::PFCandidatePtr>& myValMap(*ValMapH);
842  // Get the PFCandidate
843  const reco::PFCandidatePtr& pfElePtr(myValMap[elecsRef]);
844  pfId = pfElePtr.isNonnull();
845  }
846  // set PFId function
847  anElectron.setIsPF(pfId);
848 
849  // add resolution info
850 
851  // Isolation
852  if (isolator_.enabled()) {
854  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
855  // better to loop backwards, so the vector is resized less times
856  for (IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(),
857  ed = isolatorTmpStorage_.rend();
858  it != ed;
859  ++it) {
860  anElectron.setIsolation(it->first, it->second);
861  }
862  }
863 
864  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
865  anElectron.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[elecsRef]);
866  }
867 
868  // add electron ID info
869  if (addElecID_) {
870  for (size_t i = 0; i < elecIDSrcs_.size(); ++i) {
871  ids[i].second = (*idhandles[i])[elecsRef];
872  }
873  anElectron.setElectronIDs(ids);
874  }
875 
876  if (useUserData_) {
877  userDataHelper_.add(anElectron, iEvent, iSetup);
878  }
879 
880  double ip3d = -999; //for mva variable
881 
882  // embed high level selection
884  // get the global track
885  reco::GsfTrackRef track = itElectron->gsfTrack();
886 
887  // Make sure the collection it points to is there
888  if (track.isNonnull() && track.isAvailable()) {
889  reco::TransientTrack tt = trackBuilder->build(track);
890  embedHighLevel(anElectron, track, tt, primaryVertex, primaryVertexIsValid, beamSpot, beamSpotIsValid);
891 
892  std::pair<bool, Measurement1D> ip3dpv = IPTools::absoluteImpactParameter3D(tt, primaryVertex);
893  ip3d = ip3dpv.second.value(); // for mva variable
894  }
895  }
896 
897  if (addMVAVariables_) {
898  // add mva variables
899  const auto& vCov = lazyTools.localCovariances(*(itElectron->superCluster()->seed()));
900  anElectron.setMvaVariables(vCov[1], ip3d);
901  }
902 
903  // PFCluster Isolation
904  if (addPFClusterIso_) {
905  // Get PFCluster Isolation
906  edm::Handle<edm::ValueMap<float>> ecalPFClusterIsoMapH;
907  iEvent.getByToken(ecalPFClusterIsoT_, ecalPFClusterIsoMapH);
908  edm::Handle<edm::ValueMap<float>> hcalPFClusterIsoMapH;
909  iEvent.getByToken(hcalPFClusterIsoT_, hcalPFClusterIsoMapH);
910  reco::GsfElectron::PflowIsolationVariables newPFIsol = anElectron.pfIsolationVariables();
911  newPFIsol.sumEcalClusterEt = (*ecalPFClusterIsoMapH)[elecsRef];
912  newPFIsol.sumHcalClusterEt = (*hcalPFClusterIsoMapH)[elecsRef];
913  anElectron.setPfIsolationVariables(newPFIsol);
914  }
915 
916  if (addPuppiIsolation_) {
917  anElectron.setIsolationPUPPI((*PUPPIIsolation_charged_hadrons)[elePtr],
918  (*PUPPIIsolation_neutral_hadrons)[elePtr],
919  (*PUPPIIsolation_photons)[elePtr]);
920  anElectron.setIsolationPUPPINoLeptons((*PUPPINoLeptonsIsolation_charged_hadrons)[elePtr],
921  (*PUPPINoLeptonsIsolation_neutral_hadrons)[elePtr],
922  (*PUPPINoLeptonsIsolation_photons)[elePtr]);
923  } else {
924  anElectron.setIsolationPUPPI(-999., -999., -999.);
925  anElectron.setIsolationPUPPINoLeptons(-999., -999., -999.);
926  }
927 
928  std::vector<DetId> selectedCells;
929  bool barrel = itElectron->isEB();
930  //loop over sub clusters
931  if (embedBasicClusters_) {
932  for (reco::CaloCluster_iterator clusIt = itElectron->superCluster()->clustersBegin();
933  clusIt != itElectron->superCluster()->clustersEnd();
934  ++clusIt) {
935  //get seed (max energy xtal)
936  DetId seed = lazyTools.getMaximum(**clusIt).first;
937  //get all xtals in 5x5 window around the seed
938  std::vector<DetId> dets5x5 =
941  selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
942 
943  //get all xtals belonging to cluster
944  for (const std::pair<DetId, float>& hit : (*clusIt)->hitsAndFractions()) {
945  selectedCells.push_back(hit.first);
946  }
947  }
948  }
949 
950  if (embedPflowBasicClusters_ && itElectron->parentSuperCluster().isNonnull()) {
951  for (reco::CaloCluster_iterator clusIt = itElectron->parentSuperCluster()->clustersBegin();
952  clusIt != itElectron->parentSuperCluster()->clustersEnd();
953  ++clusIt) {
954  //get seed (max energy xtal)
955  DetId seed = lazyTools.getMaximum(**clusIt).first;
956  //get all xtals in 5x5 window around the seed
957  std::vector<DetId> dets5x5 =
960  selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
961 
962  //get all xtals belonging to cluster
963  for (const std::pair<DetId, float>& hit : (*clusIt)->hitsAndFractions()) {
964  selectedCells.push_back(hit.first);
965  }
966  }
967  }
968 
969  //remove duplicates
970  std::sort(selectedCells.begin(), selectedCells.end());
971  std::unique(selectedCells.begin(), selectedCells.end());
972 
973  // Retrieve the corresponding RecHits
974 
976  if (barrel)
977  iEvent.getByToken(reducedBarrelRecHitCollectionToken_, rechitsH);
978  else
979  iEvent.getByToken(reducedEndcapRecHitCollectionToken_, rechitsH);
980 
981  EcalRecHitCollection selectedRecHits;
982  const EcalRecHitCollection* recHits = rechitsH.product();
983 
984  unsigned nSelectedCells = selectedCells.size();
985  for (unsigned icell = 0; icell < nSelectedCells; ++icell) {
986  EcalRecHitCollection::const_iterator it = recHits->find(selectedCells[icell]);
987  if (it != recHits->end()) {
988  selectedRecHits.push_back(*it);
989  }
990  }
991  selectedRecHits.sort();
992  if (embedRecHits_)
993  anElectron.embedRecHits(&selectedRecHits);
994 
995  // set conversion veto selection
996  bool passconversionveto = false;
997  if (hConversions.isValid()) {
998  // this is recommended method
999  passconversionveto =
1000  !ConversionTools::hasMatchedConversion(*itElectron, *hConversions, beamSpotHandle->position());
1001  } else {
1002  // use missing hits without vertex fit method
1003  passconversionveto =
1004  itElectron->gsfTrack()->hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS) < 1;
1005  }
1006  anElectron.setPassConversionVeto(passconversionveto);
1007 
1008  // add sel to selected
1009  fillElectron(
1010  anElectron, elecsRef, elecBaseRef, genMatches, deposits, pfId, isolationValues, isolationValuesNoPFId);
1011 
1012  if (computeMiniIso_)
1013  setElectronMiniIso(anElectron, pc.product());
1014 
1015  patElectrons->push_back(anElectron);
1016  }
1017  }
1018 
1019  // sort electrons in pt
1020  std::sort(patElectrons->begin(), patElectrons->end(), pTComparator_);
1021 
1022  // add the electrons to the event output
1023  std::unique_ptr<std::vector<Electron>> ptr(patElectrons);
1024  iEvent.put(std::move(ptr));
1025 
1026  // clean up
1027  if (isolator_.enabled())
1028  isolator_.endEvent();
1029 }
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
const edm::EDGetTokenT< reco::ConversionCollection > hConversionsToken_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_charged_hadrons_
const GreaterByPt< Electron > pTComparator_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_charged_hadrons_
bool enabled() const
True if it has a non null configuration.
Definition: MultiIsolator.h:55
const bool useParticleFlow_
pflow specific
const edm::EDGetTokenT< reco::PFCandidateCollection > pfElecToken_
const Point & position() const
position
Definition: BeamSpot.h:59
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_neutral_hadrons_
const edm::EDGetTokenT< edm::ValueMap< float > > ecalPFClusterIsoT_
T const * product() const
Definition: Handle.h:70
void embedHighLevel(pat::Electron &anElectron, reco::GsfTrackRef track, reco::TransientTrack &tt, reco::Vertex &primaryVertex, bool primaryVertexIsValid, reco::BeamSpot &beamspot, bool beamspotIsValid)
std::vector< EcalRecHit >::const_iterator const_iterator
std::pair< bool, Measurement1D > absoluteImpactParameter3D(const reco::TransientTrack &transientTrack, const reco::Vertex &vertex)
Definition: IPTools.cc:38
void push_back(T const &t)
const edm::EDGetTokenT< edm::ValueMap< float > > hcalPFClusterIsoT_
Log< level::Error, false > LogError
PFCandidateCollection::const_iterator PFCandidateConstIterator
iterator
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > elecIDTokens_
const edm::ESGetToken< CaloTopology, CaloTopologyRecord > ecalTopologyToken_
const edm::EDGetTokenT< edm::View< reco::GsfElectron > > electronToken_
const bool addMVAVariables_
mva input variables
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
Definition: MultiIsolator.h:84
reco::TransientTrack build(const reco::Track *p) const
const edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
const edm::EDGetTokenT< edm::ValueMap< reco::PFCandidatePtr > > pfCandidateMapToken_
ESData get(edm::EventSetup const &eventSetup) const
pat::helper::MultiIsolator isolator_
std::vector< edm::Handle< edm::Association< reco::GenParticleCollection > > > GenAssociations
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_photons_
int iEvent
Definition: GenABIO.cc:224
Definition: TTTypes.h:54
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
const bool embedHighLevelSelection_
embed high level selection variables?
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
static bool hasMatchedConversion(const reco::GsfElectron &ele, const reco::ConversionCollection &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0)
def unique(seq, keepstr=True)
Definition: tier0.py:24
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
std::vector< edm::Handle< edm::ValueMap< IsoDeposit > > > IsoDepositMaps
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_neutral_hadrons_
const EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_
const edm::EDGetTokenT< EcalRecHitCollection > reducedEndcapRecHitCollectionToken_
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
math::XYZPoint Point
point in the space
Definition: TrackBase.h:80
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_photons_
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
void add(ObjectType &patObject, edm::Event const &iEvent, edm::EventSetup const &iSetup)
Definition: DetId.h:17
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
Definition: MultiIsolator.h:17
const edm::EDGetTokenT< reco::BeamSpot > beamLineToken_
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueNoPFIdTokens_
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:17
pat::helper::EfficiencyLoader efficiencyLoader_
const edm::EDGetTokenT< EcalRecHitCollection > reducedBarrelRecHitCollectionToken_
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > trackBuilderToken_
const edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > pfCandidateMultiMapToken_
pat::PATUserDataHelper< pat::Electron > userDataHelper_
void fillElectron2(Electron &anElectron, const reco::CandidatePtr &candPtrForIsolation, const reco::CandidatePtr &candPtrForGenMatch, const reco::CandidatePtr &candPtrForLoader, const GenAssociations &genMatches, const IsoDepositMaps &deposits, const IsolationValueMaps &isolationValues) const
const CaloTopology * ecalTopology_
void setElectronMiniIso(pat::Electron &anElectron, const pat::PackedCandidateCollection *pc)
bool isValid() const
Definition: HandleBase.h:70
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:88
pat::helper::KinResolutionsLoader resolutionLoader_
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueTokens_
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
primaryVertex
hltOfflineBeamSpot for HLTMON
edm::EDGetTokenT< pat::PackedCandidateCollection > pcToken_
def move(src, dest)
Definition: eostools.py:511
void fillElectron(Electron &aElectron, const ElectronBaseRef &electronRef, const reco::CandidateBaseRef &baseRef, const GenAssociations &genMatches, const IsoDepositMaps &deposits, const bool pfId, const IsolationValueMaps &isolationValues, const IsolationValueMaps &isolationValuesNoPFId) const
common electron filling, for both the standard and PF2PAT case
std::vector< NameTag > elecIDSrcs_

◆ readIsolationLabels()

template<typename T >
void pat::PATElectronProducer::readIsolationLabels ( const edm::ParameterSet iConfig,
const char *  psetName,
IsolationLabels labels,
std::vector< edm::EDGetTokenT< edm::ValueMap< T >>> &  tokens 
)
private

fill the labels vector from the contents of the parameter set, for the isodeposit or isolation values embedding

Definition at line 218 of file PATElectronProducer.cc.

References pat::EcalIso, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), pat::HcalIso, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, submitPVResolutionJobs::key, label, SummaryClient_cfi::labels, pat::PfAllParticleIso, pat::PfChargedAllIso, pat::PfChargedHadronIso, pat::PfGammaIso, pat::PfNeutralHadronIso, pat::PfPUChargedHadronIso, crabTemplate::psetName, pat::TrackIso, pat::UserBaseIso, and edm::vector_transform().

221  {
222  labels.clear();
223 
224  if (iConfig.exists(psetName)) {
226 
227  if (depconf.exists("tracker"))
228  labels.push_back(std::make_pair(pat::TrackIso, depconf.getParameter<edm::InputTag>("tracker")));
229  if (depconf.exists("ecal"))
230  labels.push_back(std::make_pair(pat::EcalIso, depconf.getParameter<edm::InputTag>("ecal")));
231  if (depconf.exists("hcal"))
232  labels.push_back(std::make_pair(pat::HcalIso, depconf.getParameter<edm::InputTag>("hcal")));
233  if (depconf.exists("pfAllParticles")) {
234  labels.push_back(std::make_pair(pat::PfAllParticleIso, depconf.getParameter<edm::InputTag>("pfAllParticles")));
235  }
236  if (depconf.exists("pfChargedHadrons")) {
237  labels.push_back(
238  std::make_pair(pat::PfChargedHadronIso, depconf.getParameter<edm::InputTag>("pfChargedHadrons")));
239  }
240  if (depconf.exists("pfChargedAll")) {
241  labels.push_back(std::make_pair(pat::PfChargedAllIso, depconf.getParameter<edm::InputTag>("pfChargedAll")));
242  }
243  if (depconf.exists("pfPUChargedHadrons")) {
244  labels.push_back(
245  std::make_pair(pat::PfPUChargedHadronIso, depconf.getParameter<edm::InputTag>("pfPUChargedHadrons")));
246  }
247  if (depconf.exists("pfNeutralHadrons")) {
248  labels.push_back(
249  std::make_pair(pat::PfNeutralHadronIso, depconf.getParameter<edm::InputTag>("pfNeutralHadrons")));
250  }
251  if (depconf.exists("pfPhotons")) {
252  labels.push_back(std::make_pair(pat::PfGammaIso, depconf.getParameter<edm::InputTag>("pfPhotons")));
253  }
254  if (depconf.exists("user")) {
255  std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag>>("user");
256  std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
258  for (; it != ed; ++it, ++key) {
259  labels.push_back(std::make_pair(pat::IsolationKeys(key), *it));
260  }
261  }
262  }
263  tokens = edm::vector_transform(
264  labels, [this](IsolationLabel const& label) { return consumes<edm::ValueMap<T>>(label.second); });
265 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::pair< pat::IsolationKeys, edm::InputTag > IsolationLabel
bool exists(std::string const &parameterName) const
checks if a parameter exists
IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
char const * label
key
prepare the HTCondor submission files and eventually submit them

◆ setElectronMiniIso()

void PATElectronProducer::setElectronMiniIso ( pat::Electron anElectron,
const pat::PackedCandidateCollection pc 
)
private

Definition at line 1206 of file PATElectronProducer.cc.

References pat::getMiniPFIsolation(), reco::GsfElectron::isEE(), miniIsoParamsB_, miniIsoParamsE_, reco::LeafCandidate::polarP4(), and pat::Lepton< LeptonType >::setMiniPFIsolation().

Referenced by produce().

1206  {
1207  pat::PFIsolation miniiso;
1208  if (anElectron.isEE())
1209  miniiso = pat::getMiniPFIsolation(pc,
1210  anElectron.polarP4(),
1211  miniIsoParamsE_[0],
1212  miniIsoParamsE_[1],
1213  miniIsoParamsE_[2],
1214  miniIsoParamsE_[3],
1215  miniIsoParamsE_[4],
1216  miniIsoParamsE_[5],
1217  miniIsoParamsE_[6],
1218  miniIsoParamsE_[7],
1219  miniIsoParamsE_[8]);
1220  else
1221  miniiso = pat::getMiniPFIsolation(pc,
1222  anElectron.polarP4(),
1223  miniIsoParamsB_[0],
1224  miniIsoParamsB_[1],
1225  miniIsoParamsB_[2],
1226  miniIsoParamsB_[3],
1227  miniIsoParamsB_[4],
1228  miniIsoParamsB_[5],
1229  miniIsoParamsB_[6],
1230  miniIsoParamsB_[7],
1231  miniIsoParamsB_[8]);
1232  anElectron.setMiniPFIsolation(miniiso);
1233 }
std::vector< double > miniIsoParamsE_
std::vector< double > miniIsoParamsB_
const PolarLorentzVector & polarP4() const final
four-momentum Lorentz vector
bool isEE() const
Definition: GsfElectron.h:329
void setMiniPFIsolation(PFIsolation const &iso)
Definition: Lepton.h:217
PFIsolation getMiniPFIsolation(const pat::PackedCandidateCollection *pfcands, const reco::Candidate::PolarLorentzVector &p4, float mindr=0.05, float maxdr=0.2, float kt_scale=10.0, float ptthresh=0.5, float deadcone_ch=0.0001, float deadcone_pu=0.01, float deadcone_ph=0.01, float deadcone_nh=0.01, float dZ_cut=0.0)

Member Data Documentation

◆ addEfficiencies_

const bool pat::PATElectronProducer::addEfficiencies_
private

Definition at line 193 of file PATElectronProducer.cc.

◆ addElecID_

const bool pat::PATElectronProducer::addElecID_
private

Definition at line 176 of file PATElectronProducer.cc.

Referenced by produce().

◆ addGenMatch_

bool pat::PATElectronProducer::addGenMatch_
private

Definition at line 91 of file PATElectronProducer.cc.

Referenced by fillElectron(), fillElectron2(), and produce().

◆ addMVAVariables_

const bool pat::PATElectronProducer::addMVAVariables_
private

mva input variables

Definition at line 113 of file PATElectronProducer.cc.

Referenced by produce().

◆ addPFClusterIso_

const bool pat::PATElectronProducer::addPFClusterIso_
private

Definition at line 120 of file PATElectronProducer.cc.

Referenced by produce().

◆ addPuppiIsolation_

const bool pat::PATElectronProducer::addPuppiIsolation_
private

Definition at line 121 of file PATElectronProducer.cc.

Referenced by produce().

◆ addResolutions_

const bool pat::PATElectronProducer::addResolutions_
private

Definition at line 196 of file PATElectronProducer.cc.

◆ beamLineToken_

const edm::EDGetTokenT<reco::BeamSpot> pat::PATElectronProducer::beamLineToken_
private

Definition at line 127 of file PATElectronProducer.cc.

Referenced by produce().

◆ computeMiniIso_

bool pat::PATElectronProducer::computeMiniIso_
private

Definition at line 96 of file PATElectronProducer.cc.

Referenced by produce().

◆ ecalClusterToolsESGetTokens_

const EcalClusterLazyTools::ESGetTokens pat::PATElectronProducer::ecalClusterToolsESGetTokens_
private

Definition at line 118 of file PATElectronProducer.cc.

Referenced by produce().

◆ ecalPFClusterIsoT_

const edm::EDGetTokenT<edm::ValueMap<float> > pat::PATElectronProducer::ecalPFClusterIsoT_
private

Definition at line 122 of file PATElectronProducer.cc.

Referenced by produce().

◆ ecalTopology_

const CaloTopology* pat::PATElectronProducer::ecalTopology_
private

Definition at line 213 of file PATElectronProducer.cc.

Referenced by produce().

◆ ecalTopologyToken_

const edm::ESGetToken<CaloTopology, CaloTopologyRecord> pat::PATElectronProducer::ecalTopologyToken_
private

Definition at line 210 of file PATElectronProducer.cc.

Referenced by produce().

◆ efficiencyLoader_

pat::helper::EfficiencyLoader pat::PATElectronProducer::efficiencyLoader_
private

Definition at line 194 of file PATElectronProducer.cc.

Referenced by fillElectron(), fillElectron2(), and produce().

◆ elecIDSrcs_

std::vector<NameTag> pat::PATElectronProducer::elecIDSrcs_
private

Definition at line 178 of file PATElectronProducer.cc.

Referenced by produce().

◆ elecIDTokens_

std::vector<edm::EDGetTokenT<edm::ValueMap<float> > > pat::PATElectronProducer::elecIDTokens_
private

Definition at line 179 of file PATElectronProducer.cc.

Referenced by produce().

◆ electronToken_

const edm::EDGetTokenT<edm::View<reco::GsfElectron> > pat::PATElectronProducer::electronToken_
private

Definition at line 79 of file PATElectronProducer.cc.

Referenced by produce().

◆ embedBasicClusters_

const bool pat::PATElectronProducer::embedBasicClusters_
private

Definition at line 86 of file PATElectronProducer.cc.

Referenced by fillElectron(), fillElectron2(), and produce().

◆ embedGenMatch_

bool pat::PATElectronProducer::embedGenMatch_
private

Definition at line 92 of file PATElectronProducer.cc.

Referenced by fillElectron(), fillElectron2(), and produce().

◆ embedGsfElectronCore_

const bool pat::PATElectronProducer::embedGsfElectronCore_
private

Definition at line 81 of file PATElectronProducer.cc.

Referenced by fillElectron(), and fillElectron2().

◆ embedGsfTrack_

const bool pat::PATElectronProducer::embedGsfTrack_
private

Definition at line 82 of file PATElectronProducer.cc.

Referenced by fillElectron(), and fillElectron2().

◆ embedHighLevelSelection_

const bool pat::PATElectronProducer::embedHighLevelSelection_
private

embed high level selection variables?

Definition at line 126 of file PATElectronProducer.cc.

Referenced by produce().

◆ embedPFCandidate_

const bool pat::PATElectronProducer::embedPFCandidate_
private

Definition at line 110 of file PATElectronProducer.cc.

Referenced by produce().

◆ embedPflowBasicClusters_

const bool pat::PATElectronProducer::embedPflowBasicClusters_
private

Definition at line 88 of file PATElectronProducer.cc.

Referenced by fillElectron(), fillElectron2(), and produce().

◆ embedPflowPreshowerClusters_

const bool pat::PATElectronProducer::embedPflowPreshowerClusters_
private

Definition at line 89 of file PATElectronProducer.cc.

Referenced by fillElectron(), and fillElectron2().

◆ embedPflowSuperCluster_

const bool pat::PATElectronProducer::embedPflowSuperCluster_
private

Definition at line 84 of file PATElectronProducer.cc.

Referenced by fillElectron(), and fillElectron2().

◆ embedPreshowerClusters_

const bool pat::PATElectronProducer::embedPreshowerClusters_
private

Definition at line 87 of file PATElectronProducer.cc.

Referenced by fillElectron(), and fillElectron2().

◆ embedRecHits_

const bool pat::PATElectronProducer::embedRecHits_
private

Definition at line 93 of file PATElectronProducer.cc.

Referenced by produce().

◆ embedSeedCluster_

const bool pat::PATElectronProducer::embedSeedCluster_
private

Definition at line 85 of file PATElectronProducer.cc.

Referenced by fillElectron(), and fillElectron2().

◆ embedSuperCluster_

const bool pat::PATElectronProducer::embedSuperCluster_
private

Definition at line 83 of file PATElectronProducer.cc.

Referenced by fillElectron(), and fillElectron2().

◆ embedTrack_

const bool pat::PATElectronProducer::embedTrack_
private

Definition at line 90 of file PATElectronProducer.cc.

Referenced by fillElectron(), and fillElectron2().

◆ genMatchTokens_

std::vector<edm::EDGetTokenT<edm::Association<reco::GenParticleCollection> > > pat::PATElectronProducer::genMatchTokens_
private

Definition at line 102 of file PATElectronProducer.cc.

Referenced by produce().

◆ hcalPFClusterIsoT_

const edm::EDGetTokenT<edm::ValueMap<float> > pat::PATElectronProducer::hcalPFClusterIsoT_
private

Definition at line 123 of file PATElectronProducer.cc.

Referenced by produce().

◆ hConversionsToken_

const edm::EDGetTokenT<reco::ConversionCollection> pat::PATElectronProducer::hConversionsToken_
private

Definition at line 80 of file PATElectronProducer.cc.

Referenced by produce().

◆ isoDepositLabels_

IsolationLabels pat::PATElectronProducer::isoDepositLabels_
private

Definition at line 186 of file PATElectronProducer.cc.

Referenced by fillElectron(), fillElectron2(), and produce().

◆ isoDepositTokens_

std::vector<edm::EDGetTokenT<edm::ValueMap<IsoDeposit> > > pat::PATElectronProducer::isoDepositTokens_
private

Definition at line 187 of file PATElectronProducer.cc.

Referenced by produce().

◆ isolationValueLabels_

IsolationLabels pat::PATElectronProducer::isolationValueLabels_
private

Definition at line 188 of file PATElectronProducer.cc.

Referenced by fillElectron(), and fillElectron2().

◆ isolationValueLabelsNoPFId_

IsolationLabels pat::PATElectronProducer::isolationValueLabelsNoPFId_
private

Definition at line 190 of file PATElectronProducer.cc.

Referenced by fillElectron().

◆ isolationValueNoPFIdTokens_

std::vector<edm::EDGetTokenT<edm::ValueMap<double> > > pat::PATElectronProducer::isolationValueNoPFIdTokens_
private

Definition at line 191 of file PATElectronProducer.cc.

Referenced by produce().

◆ isolationValueTokens_

std::vector<edm::EDGetTokenT<edm::ValueMap<double> > > pat::PATElectronProducer::isolationValueTokens_
private

Definition at line 189 of file PATElectronProducer.cc.

Referenced by produce().

◆ isolator_

pat::helper::MultiIsolator pat::PATElectronProducer::isolator_
private

Definition at line 184 of file PATElectronProducer.cc.

Referenced by produce().

◆ isolatorTmpStorage_

pat::helper::MultiIsolator::IsolationValuePairs pat::PATElectronProducer::isolatorTmpStorage_
private

Definition at line 185 of file PATElectronProducer.cc.

Referenced by produce().

◆ miniIsoParamsB_

std::vector<double> pat::PATElectronProducer::miniIsoParamsB_
private

Definition at line 98 of file PATElectronProducer.cc.

Referenced by setElectronMiniIso().

◆ miniIsoParamsE_

std::vector<double> pat::PATElectronProducer::miniIsoParamsE_
private

Definition at line 97 of file PATElectronProducer.cc.

Referenced by setElectronMiniIso().

◆ pcToken_

edm::EDGetTokenT<pat::PackedCandidateCollection> pat::PATElectronProducer::pcToken_
private

Definition at line 95 of file PATElectronProducer.cc.

Referenced by produce().

◆ pfCandidateMapToken_

const edm::EDGetTokenT<edm::ValueMap<reco::PFCandidatePtr> > pat::PATElectronProducer::pfCandidateMapToken_
private

Definition at line 108 of file PATElectronProducer.cc.

Referenced by produce().

◆ pfCandidateMultiMapToken_

const edm::EDGetTokenT<edm::ValueMap<std::vector<reco::PFCandidateRef> > > pat::PATElectronProducer::pfCandidateMultiMapToken_
private

Definition at line 109 of file PATElectronProducer.cc.

Referenced by produce().

◆ pfElecToken_

const edm::EDGetTokenT<reco::PFCandidateCollection> pat::PATElectronProducer::pfElecToken_
private

Definition at line 107 of file PATElectronProducer.cc.

Referenced by produce().

◆ pTComparator_

const GreaterByPt<Electron> pat::PATElectronProducer::pTComparator_
private

Definition at line 182 of file PATElectronProducer.cc.

Referenced by produce().

◆ PUPPIIsolation_charged_hadrons_

edm::EDGetTokenT<edm::ValueMap<float> > pat::PATElectronProducer::PUPPIIsolation_charged_hadrons_
private

Definition at line 201 of file PATElectronProducer.cc.

Referenced by produce().

◆ PUPPIIsolation_neutral_hadrons_

edm::EDGetTokenT<edm::ValueMap<float> > pat::PATElectronProducer::PUPPIIsolation_neutral_hadrons_
private

Definition at line 202 of file PATElectronProducer.cc.

Referenced by produce().

◆ PUPPIIsolation_photons_

edm::EDGetTokenT<edm::ValueMap<float> > pat::PATElectronProducer::PUPPIIsolation_photons_
private

Definition at line 203 of file PATElectronProducer.cc.

Referenced by produce().

◆ PUPPINoLeptonsIsolation_charged_hadrons_

edm::EDGetTokenT<edm::ValueMap<float> > pat::PATElectronProducer::PUPPINoLeptonsIsolation_charged_hadrons_
private

Definition at line 205 of file PATElectronProducer.cc.

Referenced by produce().

◆ PUPPINoLeptonsIsolation_neutral_hadrons_

edm::EDGetTokenT<edm::ValueMap<float> > pat::PATElectronProducer::PUPPINoLeptonsIsolation_neutral_hadrons_
private

Definition at line 206 of file PATElectronProducer.cc.

Referenced by produce().

◆ PUPPINoLeptonsIsolation_photons_

edm::EDGetTokenT<edm::ValueMap<float> > pat::PATElectronProducer::PUPPINoLeptonsIsolation_photons_
private

Definition at line 207 of file PATElectronProducer.cc.

Referenced by produce().

◆ pvToken_

const edm::EDGetTokenT<std::vector<reco::Vertex> > pat::PATElectronProducer::pvToken_
private

Definition at line 128 of file PATElectronProducer.cc.

Referenced by produce().

◆ reducedBarrelRecHitCollection_

const edm::InputTag pat::PATElectronProducer::reducedBarrelRecHitCollection_
private

Definition at line 114 of file PATElectronProducer.cc.

◆ reducedBarrelRecHitCollectionToken_

const edm::EDGetTokenT<EcalRecHitCollection> pat::PATElectronProducer::reducedBarrelRecHitCollectionToken_
private

Definition at line 115 of file PATElectronProducer.cc.

Referenced by produce().

◆ reducedEndcapRecHitCollection_

const edm::InputTag pat::PATElectronProducer::reducedEndcapRecHitCollection_
private

Definition at line 116 of file PATElectronProducer.cc.

◆ reducedEndcapRecHitCollectionToken_

const edm::EDGetTokenT<EcalRecHitCollection> pat::PATElectronProducer::reducedEndcapRecHitCollectionToken_
private

Definition at line 117 of file PATElectronProducer.cc.

Referenced by produce().

◆ resolutionLoader_

pat::helper::KinResolutionsLoader pat::PATElectronProducer::resolutionLoader_
private

Definition at line 197 of file PATElectronProducer.cc.

Referenced by fillElectron(), fillElectron2(), and produce().

◆ trackBuilderToken_

const edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> pat::PATElectronProducer::trackBuilderToken_
private

Definition at line 211 of file PATElectronProducer.cc.

Referenced by produce().

◆ useParticleFlow_

const bool pat::PATElectronProducer::useParticleFlow_
private

pflow specific

Definition at line 105 of file PATElectronProducer.cc.

Referenced by fillElectron(), and produce().

◆ usePfCandidateMultiMap_

const bool pat::PATElectronProducer::usePfCandidateMultiMap_
private

Definition at line 106 of file PATElectronProducer.cc.

Referenced by produce().

◆ userDataHelper_

pat::PATUserDataHelper<pat::Electron> pat::PATElectronProducer::userDataHelper_
private

Definition at line 208 of file PATElectronProducer.cc.

Referenced by produce().

◆ useUserData_

const bool pat::PATElectronProducer::useUserData_
private

Definition at line 199 of file PATElectronProducer.cc.

Referenced by produce().