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...

#include "PhysicsTools/PatAlgos/interface/PATElectronProducer.h"

Inheritance diagram for pat::PATElectronProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PATElectronProducer (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~PATElectronProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (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)
 

Private Attributes

const bool addEfficiencies_
 
const bool addElecID_
 
bool addGenMatch_
 
const bool addPFClusterIso_
 
const bool addPuppiIsolation_
 
const bool addResolutions_
 
const edm::EDGetTokenT< reco::BeamSpotbeamLineToken_
 
const edm::EDGetTokenT< edm::ValueMap< float > > ecalPFClusterIsoT_
 
const CaloTopologyecalTopology_
 
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_
 
const edm::EDGetTokenT< edm::ValueMap< reco::PFCandidatePtr > > pfCandidateMapToken_
 
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_
 mva input variables More...
 
const edm::EDGetTokenT< EcalRecHitCollectionreducedBarrelRecHitCollectionToken_
 
const edm::InputTag reducedEndcapRecHitCollection_
 
const edm::EDGetTokenT< EcalRecHitCollectionreducedEndcapRecHitCollectionToken_
 
pat::helper::KinResolutionsLoader resolutionLoader_
 
const bool useParticleFlow_
 pflow specific More...
 
pat::PATUserDataHelper< pat::ElectronuserDataHelper_
 
const bool useUserData_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

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 54 of file PATElectronProducer.h.

Member Typedef Documentation

Definition at line 110 of file PATElectronProducer.h.

Definition at line 84 of file PATElectronProducer.h.

Definition at line 111 of file PATElectronProducer.h.

Definition at line 143 of file PATElectronProducer.h.

Definition at line 144 of file PATElectronProducer.h.

typedef std::vector< edm::Handle< edm::ValueMap<double> > > pat::PATElectronProducer::IsolationValueMaps
private

Definition at line 112 of file PATElectronProducer.h.

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

Definition at line 154 of file PATElectronProducer.h.

Constructor & Destructor Documentation

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

Definition at line 52 of file PATElectronProducer.cc.

References addEfficiencies_, addElecID_, addGenMatch_, addPuppiIsolation_, addResolutions_, edm::EDConsumerBase::consumes(), edm::EDConsumerBase::consumesCollector(), efficiencyLoader_, elecIDSrcs_, elecIDTokens_, Exception, edm::ParameterSet::existsAs(), genMatchTokens_, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), isoDepositLabels_, isoDepositTokens_, isolationValueLabels_, isolationValueLabelsNoPFId_, isolationValueNoPFIdTokens_, isolationValueTokens_, cscdqm::h::names, PUPPIIsolation_charged_hadrons_, PUPPIIsolation_neutral_hadrons_, PUPPIIsolation_photons_, PUPPINoLeptonsIsolation_charged_hadrons_, PUPPINoLeptonsIsolation_neutral_hadrons_, PUPPINoLeptonsIsolation_photons_, readIsolationLabels(), resolutionLoader_, GlobalPosition_Frontier_DevDB_cff::tag, userDataHelper_, useUserData_, and edm::vector_transform().

52  :
53  // general configurables
55  hConversionsToken_(consumes<reco::ConversionCollection>(edm::InputTag("allConversions"))),
56  embedGsfElectronCore_(iConfig.getParameter<bool>( "embedGsfElectronCore" )),
57  embedGsfTrack_(iConfig.getParameter<bool>( "embedGsfTrack" )),
58  embedSuperCluster_(iConfig.getParameter<bool> ( "embedSuperCluster" )),
59  embedPflowSuperCluster_(iConfig.getParameter<bool> ( "embedPflowSuperCluster" )),
60  embedSeedCluster_(iConfig.getParameter<bool>( "embedSeedCluster" )),
61  embedBasicClusters_(iConfig.getParameter<bool>( "embedBasicClusters" )),
62  embedPreshowerClusters_(iConfig.getParameter<bool>( "embedPreshowerClusters" )),
63  embedPflowBasicClusters_(iConfig.getParameter<bool>( "embedPflowBasicClusters" )),
64  embedPflowPreshowerClusters_(iConfig.getParameter<bool>( "embedPflowPreshowerClusters" )),
65  embedTrack_(iConfig.getParameter<bool>( "embedTrack" )),
66  addGenMatch_(iConfig.getParameter<bool>( "addGenMatch" )),
67  embedGenMatch_(addGenMatch_ ? iConfig.getParameter<bool>( "embedGenMatch" ) : false),
68  embedRecHits_(iConfig.getParameter<bool>( "embedRecHits" )),
69  // pflow configurables
70  useParticleFlow_(iConfig.getParameter<bool>( "useParticleFlow" )),
71  pfElecToken_(consumes<reco::PFCandidateCollection>(iConfig.getParameter<edm::InputTag>( "pfElectronSource" ))),
73  embedPFCandidate_(iConfig.getParameter<bool>( "embedPFCandidate" )),
74  // mva input variables
75  reducedBarrelRecHitCollection_(iConfig.getParameter<edm::InputTag>("reducedBarrelRecHitCollection")),
77  reducedEndcapRecHitCollection_(iConfig.getParameter<edm::InputTag>("reducedEndcapRecHitCollection")),
79  // PFCluster Isolation maps
80  addPFClusterIso_(iConfig.getParameter<bool>("addPFClusterIso")),
81  addPuppiIsolation_(iConfig.getParameter<bool>("addPuppiIsolation")),
84  // embed high level selection variables?
85  embedHighLevelSelection_(iConfig.getParameter<bool>("embedHighLevelSelection")),
86  beamLineToken_(consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamLineSrc"))),
87  pvToken_(mayConsume<std::vector<reco::Vertex> >(iConfig.getParameter<edm::InputTag>("pvSrc"))),
88  addElecID_(iConfig.getParameter<bool>( "addElectronID" )),
89  pTComparator_(),
90  isolator_(iConfig.exists("userIsolation") ? iConfig.getParameter<edm::ParameterSet>("userIsolation") : edm::ParameterSet(), consumesCollector(), false) ,
91  addEfficiencies_(iConfig.getParameter<bool>("addEfficiencies")),
92  addResolutions_(iConfig.getParameter<bool>( "addResolutions" )),
93  useUserData_(iConfig.exists("userData"))
94 
95 {
96  // MC matching configurables (scheduled mode)
97 
98  if (addGenMatch_) {
99  if (iConfig.existsAs<edm::InputTag>("genParticleMatch")) {
101  }
102  else {
103  genMatchTokens_ = edm::vector_transform(iConfig.getParameter<std::vector<edm::InputTag> >( "genParticleMatch" ), [this](edm::InputTag const & tag){return consumes<edm::Association<reco::GenParticleCollection> >(tag);});
104  }
105  }
106  // resolution configurables
107  if (addResolutions_) {
109  }
110  if(addPuppiIsolation_){
111  //puppi
112  PUPPIIsolation_charged_hadrons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiIsolationChargedHadrons"));
113  PUPPIIsolation_neutral_hadrons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiIsolationNeutralHadrons"));
114  PUPPIIsolation_photons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiIsolationPhotons"));
115  //puppiNoLeptons
116  PUPPINoLeptonsIsolation_charged_hadrons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiNoLeptonsIsolationChargedHadrons"));
117  PUPPINoLeptonsIsolation_neutral_hadrons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiNoLeptonsIsolationNeutralHadrons"));
118  PUPPINoLeptonsIsolation_photons_ = consumes<edm::ValueMap<float> >(iConfig.getParameter<edm::InputTag>("puppiNoLeptonsIsolationPhotons"));
119  }
120  // electron ID configurables
121  if (addElecID_) {
122  // it might be a single electron ID
123  if (iConfig.existsAs<edm::InputTag>("electronIDSource")) {
124  elecIDSrcs_.push_back(NameTag("", iConfig.getParameter<edm::InputTag>("electronIDSource")));
125  }
126  // or there might be many of them
127  if (iConfig.existsAs<edm::ParameterSet>("electronIDSources")) {
128  // please don't configure me twice
129  if (!elecIDSrcs_.empty()){
130  throw cms::Exception("Configuration") << "PATElectronProducer: you can't specify both 'electronIDSource' and 'electronIDSources'\n";
131  }
132  // read the different electron ID names
133  edm::ParameterSet idps = iConfig.getParameter<edm::ParameterSet>("electronIDSources");
134  std::vector<std::string> names = idps.getParameterNamesForType<edm::InputTag>();
135  for (std::vector<std::string>::const_iterator it = names.begin(), ed = names.end(); it != ed; ++it) {
136  elecIDSrcs_.push_back(NameTag(*it, idps.getParameter<edm::InputTag>(*it)));
137  }
138  }
139  // but in any case at least once
140  if (elecIDSrcs_.empty()){
141  throw cms::Exception("Configuration") <<
142  "PATElectronProducer: id addElectronID is true, you must specify either:\n" <<
143  "\tInputTag electronIDSource = <someTag>\n" << "or\n" <<
144  "\tPSet electronIDSources = { \n" <<
145  "\t\tInputTag <someName> = <someTag> // as many as you want \n " <<
146  "\t}\n";
147  }
148  }
149  elecIDTokens_ = edm::vector_transform(elecIDSrcs_, [this](NameTag const & tag){return mayConsume<edm::ValueMap<float> >(tag.second);});
150  // construct resolution calculator
151 
152  // // IsoDeposit configurables
153  // if (iConfig.exists("isoDeposits")) {
154  // edm::ParameterSet depconf = iConfig.getParameter<edm::ParameterSet>("isoDeposits");
155  // if (depconf.exists("tracker")) isoDepositLabels_.push_back(std::make_pair(TrackerIso, depconf.getParameter<edm::InputTag>("tracker")));
156  // if (depconf.exists("ecal")) isoDepositLabels_.push_back(std::make_pair(ECalIso, depconf.getParameter<edm::InputTag>("ecal")));
157  // if (depconf.exists("hcal")) isoDepositLabels_.push_back(std::make_pair(HCalIso, depconf.getParameter<edm::InputTag>("hcal")));
158 
159 
160  // if (depconf.exists("user")) {
161  // std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag> >("user");
162  // std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
163  // int key = UserBaseIso;
164  // for ( ; it != ed; ++it, ++key) {
165  // isoDepositLabels_.push_back(std::make_pair(IsolationKeys(key), *it));
166  // }
167  // }
168  // }
169  // isoDepositTokens_ = edm::vector_transform(isoDepositLabels_, [this](std::pair<IsolationKeys,edm::InputTag> const & label){return consumes<edm::ValueMap<IsoDeposit> >(label.second);});
170 
171  // read isoDeposit labels, for direct embedding
172  readIsolationLabels(iConfig, "isoDeposits", isoDepositLabels_, isoDepositTokens_);
173  // read isolation value labels, for direct embedding
175  // read isolation value labels for non PF identified electron, for direct embedding
177  // Efficiency configurables
178  if (addEfficiencies_) {
180  }
181  // Check to see if the user wants to add user data
182  if ( useUserData_ ) {
184  }
185 
186  // produces vector of muons
187  produces<std::vector<Electron> >();
188  }
void readIsolationLabels(const edm::ParameterSet &iConfig, const char *psetName, IsolationLabels &labels, std::vector< edm::EDGetTokenT< edm::ValueMap< T > > > &tokens)
T getParameter(std::string const &) const
Assists in assimilating all pat::UserData into pat objects.
const edm::EDGetTokenT< reco::ConversionCollection > hConversionsToken_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_charged_hadrons_
const GreaterByPt< Electron > pTComparator_
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_charged_hadrons_
const bool useParticleFlow_
pflow specific
static const HistoName names[]
const edm::EDGetTokenT< reco::PFCandidateCollection > pfElecToken_
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_
mva input variables
const edm::EDGetTokenT< edm::ValueMap< float > > hcalPFClusterIsoT_
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 edm::EDGetTokenT< edm::View< reco::GsfElectron > > electronToken_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:194
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?
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_neutral_hadrons_
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_
pat::PATUserDataHelper< pat::Electron > userDataHelper_
IsolationLabels isolationValueLabelsNoPFId_
IsolationLabels isolationValueLabels_
pat::helper::KinResolutionsLoader resolutionLoader_
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueTokens_
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
std::vector< NameTag > elecIDSrcs_
PATElectronProducer::~PATElectronProducer ( )

Definition at line 191 of file PATElectronProducer.cc.

192 {
193 }

Member Function Documentation

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 1071 of file PATElectronProducer.cc.

References pat::Electron::BS2D, pat::Electron::BS3D, reco::BeamSpot::covariance3D(), DEFINE_FWK_MODULE, reco::BeamSpot::position(), pat::Electron::PV2D, pat::Electron::PV3D, mps_fire::result, pat::Electron::setDB(), IPTools::signedImpactParameter3D(), and IPTools::signedTransverseImpactParameter().

Referenced by produce().

1079 {
1080  // Correct to PV
1081 
1082  // PV2D
1083  std::pair<bool,Measurement1D> result =
1085  GlobalVector(track->px(),
1086  track->py(),
1087  track->pz()),
1088  primaryVertex);
1089  double d0_corr = result.second.value();
1090  double d0_err = primaryVertexIsValid ? result.second.error() : -1.0;
1091  anElectron.setDB( d0_corr, d0_err, pat::Electron::PV2D);
1092 
1093 
1094  // PV3D
1095  result =
1097  GlobalVector(track->px(),
1098  track->py(),
1099  track->pz()),
1100  primaryVertex);
1101  d0_corr = result.second.value();
1102  d0_err = primaryVertexIsValid ? result.second.error() : -1.0;
1103  anElectron.setDB( d0_corr, d0_err, pat::Electron::PV3D);
1104 
1105 
1106  // Correct to beam spot
1107  // make a fake vertex out of beam spot
1108  reco::Vertex vBeamspot(beamspot.position(), beamspot.covariance3D());
1109 
1110  // BS2D
1111  result =
1113  GlobalVector(track->px(),
1114  track->py(),
1115  track->pz()),
1116  vBeamspot);
1117  d0_corr = result.second.value();
1118  d0_err = beamspotIsValid ? result.second.error() : -1.0;
1119  anElectron.setDB( d0_corr, d0_err, pat::Electron::BS2D);
1120 
1121  // BS3D
1122  result =
1124  GlobalVector(track->px(),
1125  track->py(),
1126  track->pz()),
1127  vBeamspot);
1128  d0_corr = result.second.value();
1129  d0_err = beamspotIsValid ? result.second.error() : -1.0;
1130  anElectron.setDB( d0_corr, d0_err, pat::Electron::BS3D);
1131 }
Covariance3DMatrix covariance3D() const
return only 3D position covariance matrix
Definition: BeamSpot.h:118
std::pair< bool, Measurement1D > signedTransverseImpactParameter(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:50
std::pair< bool, Measurement1D > signedImpactParameter3D(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:71
void setDB(double dB, double edB, IPTYPE type)
Set impact parameter of a certain type and its uncertainty.
const Point & position() const
position
Definition: BeamSpot.h:62
Global3DVector GlobalVector
Definition: GlobalVector.h:10
void PATElectronProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 930 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(), or, edm::ParameterSetDescription::setAllowAnything(), edm::ParameterSetDescription::setComment(), and edm::ParameterDescriptionNode::setComment().

931 {
933  iDesc.setComment("PAT electron producer module");
934 
935  // input source
936  iDesc.add<edm::InputTag>("pfCandidateMap", edm::InputTag("no default"))->setComment("input collection");
937  iDesc.add<edm::InputTag>("electronSource", edm::InputTag("no default"))->setComment("input collection");
938 
939  iDesc.ifValue(edm::ParameterDescription<bool>("addPFClusterIso", false, true),
940  true >> (edm::ParameterDescription<edm::InputTag>("ecalPFClusterIsoMap", edm::InputTag("electronEcalPFClusterIsolationProducer"), true) and
941  edm::ParameterDescription<edm::InputTag>("hcalPFClusterIsoMap", edm::InputTag("electronHcalPFClusterIsolationProducer"),true)) or
942  false >> (edm::ParameterDescription<edm::InputTag>("ecalPFClusterIsoMap", edm::InputTag(""), true) and
943  edm::ParameterDescription<edm::InputTag>("hcalPFClusterIsoMap", edm::InputTag(""),true)));
944 
945  iDesc.ifValue(edm::ParameterDescription<bool>("addPuppiIsolation", false, true),
946  true >> (edm::ParameterDescription<edm::InputTag>("puppiIsolationChargedHadrons", edm::InputTag("egmElectronPUPPIIsolation","h+-DR030-BarVeto000-EndVeto001"), true) and
947  edm::ParameterDescription<edm::InputTag>("puppiIsolationNeutralHadrons", edm::InputTag("egmElectronPUPPIIsolation","h0-DR030-BarVeto000-EndVeto000"), true) and
948  edm::ParameterDescription<edm::InputTag>("puppiIsolationPhotons", edm::InputTag("egmElectronPUPPIIsolation","gamma-DR030-BarVeto000-EndVeto008"), true) and
949  edm::ParameterDescription<edm::InputTag>("puppiNoLeptonsIsolationChargedHadrons", edm::InputTag("egmElectronPUPPINoLeptonsIsolation","gamma-DR030-BarVeto000-EndVeto008"), true) and
950  edm::ParameterDescription<edm::InputTag>("puppiNoLeptonsIsolationNeutralHadrons", edm::InputTag("egmElectronPUPPINoLeptonsIsolation","gamma-DR030-BarVeto000-EndVeto008"), true) and
951  edm::ParameterDescription<edm::InputTag>("puppiNoLeptonsIsolationPhotons", edm::InputTag("egmElectronPUPPINoLeptonsIsolation","gamma-DR030-BarVeto000-EndVeto008"), true)) or
952  false >> edm::EmptyGroupDescription());
953 
954 
955  // embedding
956  iDesc.add<bool>("embedGsfElectronCore", true)->setComment("embed external gsf electron core");
957  iDesc.add<bool>("embedGsfTrack", true)->setComment("embed external gsf track");
958  iDesc.add<bool>("embedSuperCluster", true)->setComment("embed external super cluster");
959  iDesc.add<bool>("embedPflowSuperCluster", true)->setComment("embed external super cluster");
960  iDesc.add<bool>("embedSeedCluster", true)->setComment("embed external seed cluster");
961  iDesc.add<bool>("embedBasicClusters", true)->setComment("embed external basic clusters");
962  iDesc.add<bool>("embedPreshowerClusters", true)->setComment("embed external preshower clusters");
963  iDesc.add<bool>("embedPflowBasicClusters", true)->setComment("embed external pflow basic clusters");
964  iDesc.add<bool>("embedPflowPreshowerClusters", true)->setComment("embed external pflow preshower clusters");
965  iDesc.add<bool>("embedTrack", false)->setComment("embed external track");
966  iDesc.add<bool>("embedRecHits", true)->setComment("embed external RecHits");
967 
968  // pf specific parameters
969  iDesc.add<edm::InputTag>("pfElectronSource", edm::InputTag("pfElectrons"))->setComment("particle flow input collection");
970  iDesc.add<bool>("useParticleFlow", false)->setComment("whether to use particle flow or not");
971  iDesc.add<bool>("embedPFCandidate", false)->setComment("embed external particle flow object");
972 
973  // MC matching configurables
974  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
975  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
976  std::vector<edm::InputTag> emptySourceVector;
977  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
978  edm::ParameterDescription<std::vector<edm::InputTag> >("genParticleMatch", emptySourceVector, true)
979  )->setComment("input with MC match information");
980 
981  // electron ID configurables
982  iDesc.add<bool>("addElectronID",true)->setComment("add electron ID variables");
983  edm::ParameterSetDescription electronIDSourcesPSet;
984  electronIDSourcesPSet.setAllowAnything();
985  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("electronIDSource", edm::InputTag(), true) xor
986  edm::ParameterDescription<edm::ParameterSetDescription>("electronIDSources", electronIDSourcesPSet, true)
987  )->setComment("input with electron ID variables");
988 
989 
990  // IsoDeposit configurables
991  edm::ParameterSetDescription isoDepositsPSet;
992  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
993  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
994  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
995  isoDepositsPSet.addOptional<edm::InputTag>("pfAllParticles");
996  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadrons");
997  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedAll");
998  isoDepositsPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
999  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
1000  isoDepositsPSet.addOptional<edm::InputTag>("pfPhotons");
1001  isoDepositsPSet.addOptional<std::vector<edm::InputTag> >("user");
1002  iDesc.addOptional("isoDeposits", isoDepositsPSet);
1003 
1004  // isolation values configurables
1005  edm::ParameterSetDescription isolationValuesPSet;
1006  isolationValuesPSet.addOptional<edm::InputTag>("tracker");
1007  isolationValuesPSet.addOptional<edm::InputTag>("ecal");
1008  isolationValuesPSet.addOptional<edm::InputTag>("hcal");
1009  isolationValuesPSet.addOptional<edm::InputTag>("pfAllParticles");
1010  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedHadrons");
1011  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedAll");
1012  isolationValuesPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
1013  isolationValuesPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
1014  isolationValuesPSet.addOptional<edm::InputTag>("pfPhotons");
1015  isolationValuesPSet.addOptional<std::vector<edm::InputTag> >("user");
1016  iDesc.addOptional("isolationValues", isolationValuesPSet);
1017 
1018  // isolation values configurables
1019  edm::ParameterSetDescription isolationValuesNoPFIdPSet;
1020  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("tracker");
1021  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("ecal");
1022  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("hcal");
1023  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfAllParticles");
1024  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfChargedHadrons");
1025  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfChargedAll");
1026  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
1027  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
1028  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfPhotons");
1029  isolationValuesNoPFIdPSet.addOptional<std::vector<edm::InputTag> >("user");
1030  iDesc.addOptional("isolationValuesNoPFId", isolationValuesNoPFIdPSet);
1031 
1032  // Efficiency configurables
1033  edm::ParameterSetDescription efficienciesPSet;
1034  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
1035  iDesc.add("efficiencies", efficienciesPSet);
1036  iDesc.add<bool>("addEfficiencies", false);
1037 
1038  // Check to see if the user wants to add user data
1039  edm::ParameterSetDescription userDataPSet;
1041  iDesc.addOptional("userData", userDataPSet);
1042 
1043 
1044  // electron shapes
1045  iDesc.add<bool>("addElectronShapes", true);
1046  iDesc.add<edm::InputTag>("reducedBarrelRecHitCollection", edm::InputTag("reducedEcalRecHitsEB"));
1047  iDesc.add<edm::InputTag>("reducedEndcapRecHitCollection", edm::InputTag("reducedEcalRecHitsEE"));
1048 
1049  edm::ParameterSetDescription isolationPSet;
1050  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
1051  iDesc.add("userIsolation", isolationPSet);
1052 
1053  // Resolution configurables
1055 
1056  iDesc.add<bool>("embedHighLevelSelection", true)->setComment("embed high level selection");
1057  edm::ParameterSetDescription highLevelPSet;
1058  highLevelPSet.setAllowAnything();
1059  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("beamLineSrc", edm::InputTag(), true)
1060  )->setComment("input with high level selection");
1062  )->setComment("input with high level selection");
1063 
1064  descriptions.add("PATElectronProducer", iDesc);
1065 
1066 }
void setComment(std::string const &value)
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
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::unique_ptr< ParameterDescriptionCases< T > > cases)
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)
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 749 of file PATElectronProducer.cc.

References addGenMatch_, pat::PATObject< ObjectType >::addGenParticleRef(), 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(), plotBeamSpotDB::first, mps_fire::i, edm::Ref< C, T, F >::isNull(), isoDepositLabels_, isolationValueLabels_, isolationValueLabelsNoPFId_, gen::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().

757  {
758 
759  //COLIN: might want to use the PFCandidate 4-mom. Which one is in use now?
760  // if (useParticleFlow_)
761  // aMuon.setP4( aMuon.pfCandidateRef()->p4() );
762 
763  //COLIN:
764  //In the embedding case, the reference cannot be used to look into a value map.
765  //therefore, one has to had the PFCandidateRef to this function, which becomes a bit
766  //too much specific.
767 
768  // in fact, this function needs a baseref or ptr for genmatch
769  // and a baseref or ptr for isodeposits and isolationvalues.
770  // baseref is not needed
771  // the ptrForIsolation and ptrForMatching should be defined upstream.
772 
773  // is the concrete elecRef needed for the efficiency loader? what is this loader?
774  // how can we make it compatible with the particle flow electrons?
775 
776  if (embedGsfElectronCore_) anElectron.embedGsfElectronCore();
777  if (embedGsfTrack_) anElectron.embedGsfTrack();
778  if (embedSuperCluster_) anElectron.embedSuperCluster();
779  if (embedPflowSuperCluster_) anElectron.embedPflowSuperCluster();
780  if (embedSeedCluster_) anElectron.embedSeedCluster();
781  if (embedBasicClusters_) anElectron.embedBasicClusters();
782  if (embedPreshowerClusters_) anElectron.embedPreshowerClusters();
783  if (embedPflowBasicClusters_ ) anElectron.embedPflowBasicClusters();
784  if (embedPflowPreshowerClusters_ ) anElectron.embedPflowPreshowerClusters();
785  if (embedTrack_) anElectron.embedTrack();
786 
787  // store the match to the generated final state muons
788  if (addGenMatch_) {
789  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
790  if(useParticleFlow_) {
791  reco::GenParticleRef genElectron = (*genMatches[i])[anElectron.pfCandidateRef()];
792  anElectron.addGenParticleRef(genElectron);
793  }
794  else {
795  reco::GenParticleRef genElectron = (*genMatches[i])[elecRef];
796  anElectron.addGenParticleRef(genElectron);
797  }
798  }
799  if (embedGenMatch_) anElectron.embedGenParticle();
800  }
801 
802  if (efficiencyLoader_.enabled()) {
803  efficiencyLoader_.setEfficiencies( anElectron, elecRef );
804  }
805 
806  if (resolutionLoader_.enabled()) {
807  resolutionLoader_.setResolutions(anElectron);
808  }
809 
810  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
811  if(useParticleFlow_) {
812 
813  reco::PFCandidateRef pfcandref = anElectron.pfCandidateRef();
814  assert(!pfcandref.isNull());
815  reco::CandidatePtr source = pfcandref->sourceCandidatePtr(0);
816  anElectron.setIsoDeposit(isoDepositLabels_[j].first,
817  (*deposits[j])[source]);
818  }
819  else
820  anElectron.setIsoDeposit(isoDepositLabels_[j].first,
821  (*deposits[j])[elecRef]);
822  }
823 
824  for (size_t j = 0; j<isolationValues.size(); ++j) {
825  if(useParticleFlow_) {
826  reco::CandidatePtr source = anElectron.pfCandidateRef()->sourceCandidatePtr(0);
827  anElectron.setIsolation(isolationValueLabels_[j].first,
828  (*isolationValues[j])[source]);
829  }
830  else
831  if(pfId){
832  anElectron.setIsolation(isolationValueLabels_[j].first,(*isolationValues[j])[elecRef]);
833  }
834  }
835 
836  //for electrons not identified as PF electrons
837  for (size_t j = 0; j<isolationValuesNoPFId.size(); ++j) {
838  if( !pfId) {
839  anElectron.setIsolation(isolationValueLabelsNoPFId_[j].first,(*isolationValuesNoPFId[j])[elecRef]);
840  }
841  }
842 
843 }
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
const bool useParticleFlow_
pflow specific
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
bool isNull() const
Checks for null.
Definition: Ref.h:249
pat::helper::EfficiencyLoader efficiencyLoader_
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
IsolationLabels isolationValueLabelsNoPFId_
IsolationLabels isolationValueLabels_
pat::helper::KinResolutionsLoader resolutionLoader_
static std::string const source
Definition: EdmProvDump.cc:43
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 845 of file PATElectronProducer.cc.

References addGenMatch_, pat::PATObject< ObjectType >::addGenParticleRef(), edm::contains(), 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(), plotBeamSpotDB::first, pat::HcalIso, mps_fire::i, edm::Ptr< T >::id(), isoDepositLabels_, isolationValueLabels_, gen::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().

851  {
852 
853  //COLIN/Florian: use the PFCandidate 4-mom.
854  anElectron.setEcalDrivenMomentum(anElectron.p4()) ;
855  anElectron.setP4( anElectron.pfCandidateRef()->p4() );
856 
857 
858  // is the concrete elecRef needed for the efficiency loader? what is this loader?
859  // how can we make it compatible with the particle flow electrons?
860 
862  if (embedGsfTrack_) anElectron.embedGsfTrack();
863  if (embedSuperCluster_) anElectron.embedSuperCluster();
865  if (embedSeedCluster_) anElectron.embedSeedCluster();
866  if (embedBasicClusters_) anElectron.embedBasicClusters();
870  if (embedTrack_) anElectron.embedTrack();
871 
872  // store the match to the generated final state muons
873 
874  if (addGenMatch_) {
875  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
876  reco::GenParticleRef genElectron = (*genMatches[i])[candPtrForGenMatch];
877  anElectron.addGenParticleRef(genElectron);
878  }
879  if (embedGenMatch_) anElectron.embedGenParticle();
880  }
881 
882  //COLIN what's this? does it have to be GsfElectron specific?
883  if (efficiencyLoader_.enabled()) {
884  efficiencyLoader_.setEfficiencies( anElectron, candPtrForLoader );
885  }
886 
887  if (resolutionLoader_.enabled()) {
888  resolutionLoader_.setResolutions(anElectron);
889  }
890 
891  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
895  deposits[j]->contains(candPtrForGenMatch.id())) {
896  anElectron.setIsoDeposit(isoDepositLabels_[j].first,
897  (*deposits[j])[candPtrForGenMatch]);
898  }
899  else if (deposits[j]->contains(candPtrForIsolation.id())) {
900  anElectron.setIsoDeposit(isoDepositLabels_[j].first,
901  (*deposits[j])[candPtrForIsolation]);
902  }
903  else {
904  anElectron.setIsoDeposit(isoDepositLabels_[j].first,
905  (*deposits[j])[candPtrForIsolation->sourceCandidatePtr(0)]);
906  }
907  }
908 
909  for (size_t j = 0; j<isolationValues.size(); ++j) {
910  if( isolationValueLabels_[j].first==pat::TrackIso ||
913  isolationValues[j]->contains(candPtrForGenMatch.id())) {
914  anElectron.setIsolation(isolationValueLabels_[j].first,
915  (*isolationValues[j])[candPtrForGenMatch]);
916  }
917  else if (isolationValues[j]->contains(candPtrForIsolation.id())) {
918  anElectron.setIsolation(isolationValueLabels_[j].first,
919  (*isolationValues[j])[candPtrForIsolation]);
920  }
921  else {
922  anElectron.setIsolation(isolationValueLabels_[j].first,
923  (*isolationValues[j])[candPtrForIsolation->sourceCandidatePtr(0)]);
924  }
925  }
926 }
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:199
void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:98
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
const LorentzVector & p4(P4Kind kind) const
Definition: GsfElectron.cc:225
void embedSuperCluster()
method to store the electron&#39;s SuperCluster internally
void embedGsfElectronCore()
method to store the electron&#39;s core internally
void setEcalDrivenMomentum(const Candidate::LorentzVector &mom)
Definition: Electron.h:220
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
void embedPflowSuperCluster()
method to store the electron&#39;s PflowSuperCluster internally
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
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:175
void embedSeedCluster()
method to store the electron&#39;s seedcluster internally
reco::PFCandidateRef pfCandidateRef() const
reference to the source PFCandidates; null if this has been built from a standard electron ...
void embedGenParticle()
Definition: PATObject.h:694
void embedPflowBasicClusters()
method to store the electron&#39;s pflow basic clusters
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:678
pat::helper::EfficiencyLoader efficiencyLoader_
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
ProductID id() const
Accessor for product ID.
Definition: Ptr.h:181
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
void PATElectronProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Definition at line 196 of file PATElectronProducer.cc.

References IPTools::absoluteImpactParameter3D(), addElecID_, addGenMatch_, addPFClusterIso_, addPuppiIsolation_, Reference_intrackfit_cff::barrel, beamLineToken_, ecalDrivenElectronSeedsParameters_cff::beamSpot, pat::helper::MultiIsolator::beginEvent(), TransientTrackBuilder::build(), CandIsolatorFromDeposits_cfi::deposits, reco::PFCandidate::e, DetId::Ecal, EcalBarrel, EcalEndcap, ecalPFClusterIsoT_, ecalTopology_, efficiencyLoader_, elecIDSrcs_, elecIDTokens_, genericTrackCleaner_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(), edm::SortedCollection< T, SORT >::end(), pat::helper::MultiIsolator::endEvent(), pat::helper::MultiIsolator::fill(), fillElectron(), fillElectron2(), edm::SortedCollection< T, SORT >::find(), plotBeamSpotDB::first, genMatchTokens_, edm::EventSetup::get(), edm::Event::getByToken(), CaloTopology::getSubdetectorTopology(), CaloSubdetectorTopology::getWindow(), ConversionTools::hasMatchedConversion(), hcalPFClusterIsoT_, hConversionsToken_, mps_fire::i, training_settings::idx, diffTreeTool::index, edm::Ref< C, T, F >::isAvailable(), edm::Ptr< T >::isNonnull(), edm::Ref< C, T, F >::isNonnull(), isoDepositLabels_, isoDepositTokens_, isolationValueNoPFIdTokens_, electronProducer_cff::isolationValues, electronProducer_cff::isolationValuesNoPFId, isolationValueTokens_, isolator_, isolatorTmpStorage_, edm::EventBase::isRealData(), edm::HandleBase::isValid(), reco::Matched, reco::HitPattern::MISSING_INNER_HITS, eostools::move(), pat::helper::EfficiencyLoader::newEvent(), pat::helper::KinResolutionsLoader::newEvent(), electronProducer_cfi::patElectrons, pfCandidateMapToken_, pfElecToken_, reco::BeamSpot::position(), impactParameterTagInfos_cfi::primaryVertex, pTComparator_, PUPPIIsolation_charged_hadrons_, PUPPIIsolation_neutral_hadrons_, PUPPIIsolation_photons_, PUPPINoLeptonsIsolation_charged_hadrons_, PUPPINoLeptonsIsolation_neutral_hadrons_, PUPPINoLeptonsIsolation_photons_, edm::SortedCollection< T, SORT >::push_back(), edm::Event::put(), pvToken_, reducedBarrelRecHitCollectionToken_, reducedEndcapRecHitCollectionToken_, resolutionLoader_, SurveyInfoScenario_cff::seed, pat::Electron::setEcalPFClusterIso(), pat::Electron::setElectronIDs(), pat::Electron::setHcalPFClusterIso(), 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(), edm::SortedCollection< T, SORT >::size(), edm::SortedCollection< T, SORT >::sort(), HiIsolationCommonParameters_cff::track, groupFilesInBlocks::tt, tier0::unique(), useParticleFlow_, userDataHelper_, and useUserData_.

197 {
198  // switch off embedding (in unschedules mode)
199  if (iEvent.isRealData()){
200  addGenMatch_ = false;
201  embedGenMatch_ = false;
202  }
203 
204  edm::ESHandle<CaloTopology> theCaloTopology;
205  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
206  ecalTopology_ = & (*theCaloTopology);
207 
208  // Get the collection of electrons from the event
210  iEvent.getByToken(electronToken_, electrons);
211 
212  // for additional mva variables
213  edm::InputTag reducedEBRecHitCollection(string("reducedEcalRecHitsEB"));
214  edm::InputTag reducedEERecHitCollection(string("reducedEcalRecHitsEE"));
215  //EcalClusterLazyTools lazyTools(iEvent, iSetup, reducedEBRecHitCollection, reducedEERecHitCollection);
217 
218  // for conversion veto selection
220  iEvent.getByToken(hConversionsToken_, hConversions);
221 
222  // Get the ESHandle for the transient track builder, if needed for
223  // high level selection embedding
225 
226  if (isolator_.enabled()) isolator_.beginEvent(iEvent,iSetup);
227 
229  if (resolutionLoader_.enabled()) resolutionLoader_.newEvent(iEvent, iSetup);
230 
232  for (size_t j = 0, nd = isoDepositTokens_.size(); j < nd; ++j) {
233  iEvent.getByToken(isoDepositTokens_[j], deposits[j]);
234  }
235 
237  for (size_t j = 0; j<isolationValueTokens_.size(); ++j) {
239  }
240 
242  for (size_t j = 0; j<isolationValueNoPFIdTokens_.size(); ++j) {
244  }
245 
246  // prepare the MC matching
247  GenAssociations genMatches(genMatchTokens_.size());
248  if (addGenMatch_) {
249  for (size_t j = 0, nd = genMatchTokens_.size(); j < nd; ++j) {
250  iEvent.getByToken(genMatchTokens_[j], genMatches[j]);
251  }
252  }
253 
254  // prepare ID extraction
255  std::vector<edm::Handle<edm::ValueMap<float> > > idhandles;
256  std::vector<pat::Electron::IdPair> ids;
257  if (addElecID_) {
258  idhandles.resize(elecIDSrcs_.size());
259  ids.resize(elecIDSrcs_.size());
260  for (size_t i = 0; i < elecIDSrcs_.size(); ++i) {
261  iEvent.getByToken(elecIDTokens_[i], idhandles[i]);
262  ids[i].first = elecIDSrcs_[i].first;
263  }
264  }
265 
266 
267  // prepare the high level selection:
268  // needs beamline
269  reco::TrackBase::Point beamPoint(0,0,0);
272  bool beamSpotIsValid = false;
273  bool primaryVertexIsValid = false;
274 
275  // Get the beamspot
276  edm::Handle<reco::BeamSpot> beamSpotHandle;
277  iEvent.getByToken(beamLineToken_, beamSpotHandle);
278 
279  if ( embedHighLevelSelection_ ) {
280  // Get the primary vertex
282  iEvent.getByToken( pvToken_, pvHandle );
283 
284  // This is needed by the IPTools methods from the tracking group
285  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", trackBuilder);
286 
287  if ( pvHandle.isValid() && !pvHandle->empty() ) {
288  primaryVertex = pvHandle->at(0);
289  primaryVertexIsValid = true;
290  } else {
291  edm::LogError("DataNotAvailable")
292  << "No primary vertex available from EventSetup, not adding high level selection \n";
293  }
294  }
295  //value maps for puppi isolation
296  edm::Handle<edm::ValueMap<float>> PUPPIIsolation_charged_hadrons;
297  edm::Handle<edm::ValueMap<float>> PUPPIIsolation_neutral_hadrons;
298  edm::Handle<edm::ValueMap<float>> PUPPIIsolation_photons;
299  //value maps for puppiNoLeptons isolation
300  edm::Handle<edm::ValueMap<float>> PUPPINoLeptonsIsolation_charged_hadrons;
301  edm::Handle<edm::ValueMap<float>> PUPPINoLeptonsIsolation_neutral_hadrons;
302  edm::Handle<edm::ValueMap<float>> PUPPINoLeptonsIsolation_photons;
303  if(addPuppiIsolation_){
304  //puppi
305  iEvent.getByToken(PUPPIIsolation_charged_hadrons_, PUPPIIsolation_charged_hadrons);
306  iEvent.getByToken(PUPPIIsolation_neutral_hadrons_, PUPPIIsolation_neutral_hadrons);
307  iEvent.getByToken(PUPPIIsolation_photons_, PUPPIIsolation_photons);
308  //puppiNoLeptons
309  iEvent.getByToken(PUPPINoLeptonsIsolation_charged_hadrons_, PUPPINoLeptonsIsolation_charged_hadrons);
310  iEvent.getByToken(PUPPINoLeptonsIsolation_neutral_hadrons_, PUPPINoLeptonsIsolation_neutral_hadrons);
311  iEvent.getByToken(PUPPINoLeptonsIsolation_photons_, PUPPINoLeptonsIsolation_photons);
312  }
313 
314 
315  std::vector<Electron> * patElectrons = new std::vector<Electron>();
316 
317  if( useParticleFlow_ ) {
319  iEvent.getByToken(pfElecToken_, pfElectrons);
320  unsigned index=0;
321 
322  for( reco::PFCandidateConstIterator i = pfElectrons->begin();
323  i != pfElectrons->end(); ++i, ++index) {
324 
325  reco::PFCandidateRef pfRef(pfElectrons, index);
326  reco::PFCandidatePtr ptrToPFElectron(pfElectrons,index);
327 // reco::CandidateBaseRef pfBaseRef( pfRef );
328 
329  reco::GsfTrackRef PfTk= i->gsfTrackRef();
330 
331  bool Matched=false;
332  bool MatchedToAmbiguousGsfTrack=false;
333  for (edm::View<reco::GsfElectron>::const_iterator itElectron = electrons->begin(); itElectron != electrons->end(); ++itElectron) {
334  unsigned int idx = itElectron - electrons->begin();
335  auto elePtr = electrons -> ptrAt(idx);
336  if (Matched || MatchedToAmbiguousGsfTrack) continue;
337 
338  reco::GsfTrackRef EgTk= itElectron->gsfTrack();
339 
340  if (itElectron->gsfTrack()==i->gsfTrackRef()){
341  Matched=true;
342  }
343  else {
344  for( reco::GsfTrackRefVector::const_iterator it = itElectron->ambiguousGsfTracksBegin() ;
345  it!=itElectron->ambiguousGsfTracksEnd(); it++ ){
346  MatchedToAmbiguousGsfTrack |= (bool)(i->gsfTrackRef()==(*it));
347  }
348  }
349 
350  if (Matched || MatchedToAmbiguousGsfTrack){
351 
352  // ptr needed for finding the matched gen particle
353  reco::CandidatePtr ptrToGsfElectron(electrons,idx);
354 
355  // ref to base needed for the construction of the pat object
356  const edm::RefToBase<reco::GsfElectron>& elecsRef = electrons->refAt(idx);
357  Electron anElectron(elecsRef);
358  anElectron.setPFCandidateRef( pfRef );
359  if (addPuppiIsolation_) {
360  anElectron.setIsolationPUPPI((*PUPPIIsolation_charged_hadrons)[elePtr], (*PUPPIIsolation_neutral_hadrons)[elePtr], (*PUPPIIsolation_photons)[elePtr]);
361  anElectron.setIsolationPUPPINoLeptons((*PUPPINoLeptonsIsolation_charged_hadrons)[elePtr], (*PUPPINoLeptonsIsolation_neutral_hadrons)[elePtr], (*PUPPINoLeptonsIsolation_photons)[elePtr]);
362  }
363  else {
364  anElectron.setIsolationPUPPI(-999., -999.,-999.);
365  anElectron.setIsolationPUPPINoLeptons(-999., -999.,-999.);
366  }
367 
368  //it should be always true when particleFlow electrons are used.
369  anElectron.setIsPF( true );
370 
371  if( embedPFCandidate_ ) anElectron.embedPFCandidate();
372 
373  if ( useUserData_ ) {
374  userDataHelper_.add( anElectron, iEvent, iSetup );
375  }
376 
377  double ip3d = -999; // for mva variable
378 
379  // embed high level selection
380  if ( embedHighLevelSelection_ ) {
381  // get the global track
382  reco::GsfTrackRef track = PfTk;
383 
384  // Make sure the collection it points to is there
385  if ( track.isNonnull() && track.isAvailable() ) {
386 
387  reco::TransientTrack tt = trackBuilder->build(track);
388  embedHighLevel( anElectron,
389  track,
390  tt,
391  primaryVertex,
392  primaryVertexIsValid,
393  beamSpot,
394  beamSpotIsValid );
395 
396  std::pair<bool,Measurement1D> ip3dpv = IPTools::absoluteImpactParameter3D(tt, primaryVertex);
397  ip3d = ip3dpv.second.value(); // for mva variable
398  }
399  }
400 
401  //Electron Id
402 
403  if (addElecID_) {
404  //STANDARD EL ID
405  for (size_t i = 0; i < elecIDSrcs_.size(); ++i) {
406  ids[i].second = (*idhandles[i])[elecsRef];
407  }
408  //SPECIFIC PF ID
409  ids.push_back(std::make_pair("pf_evspi",pfRef->mva_e_pi()));
410  ids.push_back(std::make_pair("pf_evsmu",pfRef->mva_e_mu()));
411  anElectron.setElectronIDs(ids);
412  }
413 
414  // add missing mva variables
415  std::vector<float> vCov = lazyTools.localCovariances(*( itElectron->superCluster()->seed()));
416  anElectron.setMvaVariables(vCov[1], ip3d);
417  // PFClusterIso
418  if (addPFClusterIso_) {
419  // Get PFCluster Isolation
420  edm::Handle<edm::ValueMap<float> > ecalPFClusterIsoMapH;
421  iEvent.getByToken(ecalPFClusterIsoT_, ecalPFClusterIsoMapH);
422  edm::Handle<edm::ValueMap<float> > hcalPFClusterIsoMapH;
423  iEvent.getByToken(hcalPFClusterIsoT_, hcalPFClusterIsoMapH);
424 
425  anElectron.setEcalPFClusterIso((*ecalPFClusterIsoMapH)[elecsRef]);
426  anElectron.setHcalPFClusterIso((*hcalPFClusterIsoMapH)[elecsRef]);
427  } else {
428  anElectron.setEcalPFClusterIso(-999.);
429  anElectron.setHcalPFClusterIso(-999.);
430  }
431 
432  std::vector<DetId> selectedCells;
433  bool barrel = itElectron->isEB();
434  //loop over sub clusters
435  if (embedBasicClusters_) {
436  for (reco::CaloCluster_iterator clusIt = itElectron->superCluster()->clustersBegin(); clusIt!=itElectron->superCluster()->clustersEnd(); ++clusIt) {
437  //get seed (max energy xtal)
438  DetId seed = lazyTools.getMaximum(**clusIt).first;
439  //get all xtals in 5x5 window around the seed
440  std::vector<DetId> dets5x5 = (barrel) ? ecalTopology_->getSubdetectorTopology(DetId::Ecal,EcalBarrel)->getWindow(seed,5,5):
442  selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
443 
444  //get all xtals belonging to cluster
445  for (const std::pair<DetId, float> &hit : (*clusIt)->hitsAndFractions()) {
446  selectedCells.push_back(hit.first);
447  }
448  }
449  }
450 
451  if (embedPflowBasicClusters_ && itElectron->parentSuperCluster().isNonnull()) {
452  for (reco::CaloCluster_iterator clusIt = itElectron->parentSuperCluster()->clustersBegin(); clusIt!=itElectron->parentSuperCluster()->clustersEnd(); ++clusIt) {
453  //get seed (max energy xtal)
454  DetId seed = lazyTools.getMaximum(**clusIt).first;
455  //get all xtals in 5x5 window around the seed
456  std::vector<DetId> dets5x5 = (barrel) ? ecalTopology_->getSubdetectorTopology(DetId::Ecal,EcalBarrel)->getWindow(seed,5,5):
458  selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
459 
460  //get all xtals belonging to cluster
461  for (const std::pair<DetId, float> &hit : (*clusIt)->hitsAndFractions()) {
462  selectedCells.push_back(hit.first);
463  }
464  }
465  }
466 
467  //remove duplicates
468  std::sort(selectedCells.begin(),selectedCells.end());
469  std::unique(selectedCells.begin(),selectedCells.end());
470 
471 
472  // Retrieve the corresponding RecHits
473 
475  if(barrel)
477  else
479 
480  EcalRecHitCollection selectedRecHits;
481  const EcalRecHitCollection *recHits = rechitsH.product();
482 
483  unsigned nSelectedCells = selectedCells.size();
484  for (unsigned icell = 0 ; icell < nSelectedCells ; ++icell) {
485  EcalRecHitCollection::const_iterator it = recHits->find( selectedCells[icell] );
486  if ( it != recHits->end() ) {
487  selectedRecHits.push_back(*it);
488  }
489  }
490  selectedRecHits.sort();
491  if (embedRecHits_) anElectron.embedRecHits(& selectedRecHits);
492 
493  // set conversion veto selection
494  bool passconversionveto = false;
495  if( hConversions.isValid()){
496  // this is recommended method
497  passconversionveto = !ConversionTools::hasMatchedConversion( *itElectron, hConversions, beamSpotHandle->position());
498  }else{
499  // use missing hits without vertex fit method
500  passconversionveto = itElectron->gsfTrack()->hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS) < 1;
501  }
502 
503  anElectron.setPassConversionVeto( passconversionveto );
504 
505 
506 // fillElectron(anElectron,elecsRef,pfBaseRef,
507 // genMatches, deposits, isolationValues);
508 
509  //COLIN small warning !
510  // we are currently choosing to take the 4-momentum of the PFCandidate;
511  // the momentum of the GsfElectron is saved though
512  // we must therefore match the GsfElectron.
513  // because of this, we should not change the source of the electron matcher
514  // to the collection of PFElectrons in the python configuration
515  // I don't know what to do with the efficiencyLoader, since I don't know
516  // what this class is for.
517  fillElectron2( anElectron,
518  ptrToPFElectron,
519  ptrToGsfElectron,
520  ptrToGsfElectron,
521  genMatches, deposits, isolationValues );
522 
523  //COLIN need to use fillElectron2 in the non-pflow case as well, and to test it.
524 
525  patElectrons->push_back(anElectron);
526  }
527  }
528  //if( !Matched && !MatchedToAmbiguousGsfTrack) std::cout << "!!!!A pf electron could not be matched to a gsf!!!!" << std::endl;
529  }
530  }
531 
532  else{
533  // Try to access PF electron collection
535  bool valMapPresent = iEvent.getByToken(pfCandidateMapToken_,ValMapH);
536  // Try to access a PFCandidate collection, as supplied by the user
538  bool pfCandsPresent = iEvent.getByToken(pfElecToken_, pfElectrons);
539 
540  for (edm::View<reco::GsfElectron>::const_iterator itElectron = electrons->begin(); itElectron != electrons->end(); ++itElectron) {
541  // construct the Electron from the ref -> save ref to original object
542  //FIXME: looks like a lot of instances could be turned into const refs
543  unsigned int idx = itElectron - electrons->begin();
544  edm::RefToBase<reco::GsfElectron> elecsRef = electrons->refAt(idx);
545  reco::CandidateBaseRef elecBaseRef(elecsRef);
546  Electron anElectron(elecsRef);
547  auto elePtr = electrons -> ptrAt(idx);
548 
549  // Is this GsfElectron also identified as an e- in the particle flow?
550  bool pfId = false;
551 
552  if ( pfCandsPresent ) {
553  // PF electron collection not available.
554  const reco::GsfTrackRef& trkRef = itElectron->gsfTrack();
555  int index = 0;
556  for( reco::PFCandidateConstIterator ie = pfElectrons->begin();
557  ie != pfElectrons->end(); ++ie, ++index) {
558  if(ie->particleId()!=reco::PFCandidate::e) continue;
559  const reco::GsfTrackRef& pfTrkRef= ie->gsfTrackRef();
560  if( trkRef == pfTrkRef ) {
561  pfId = true;
562  reco::PFCandidateRef pfRef(pfElectrons, index);
563  anElectron.setPFCandidateRef( pfRef );
564  break;
565  }
566  }
567  }
568  else if( valMapPresent ) {
569  // use value map if PF collection not available
570  const edm::ValueMap<reco::PFCandidatePtr> & myValMap(*ValMapH);
571  // Get the PFCandidate
572  const reco::PFCandidatePtr& pfElePtr(myValMap[elecsRef]);
573  pfId= pfElePtr.isNonnull();
574  }
575  // set PFId function
576  anElectron.setIsPF( pfId );
577 
578  // add resolution info
579 
580  // Isolation
581  if (isolator_.enabled()) {
582  isolator_.fill(*electrons, idx, isolatorTmpStorage_);
583  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
584  // better to loop backwards, so the vector is resized less times
585  for (IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(), ed = isolatorTmpStorage_.rend(); it != ed; ++it) {
586  anElectron.setIsolation(it->first, it->second);
587  }
588  }
589 
590  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
591  anElectron.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[elecsRef]);
592  }
593 
594  // add electron ID info
595  if (addElecID_) {
596  for (size_t i = 0; i < elecIDSrcs_.size(); ++i) {
597  ids[i].second = (*idhandles[i])[elecsRef];
598  }
599  anElectron.setElectronIDs(ids);
600  }
601 
602 
603  if ( useUserData_ ) {
604  userDataHelper_.add( anElectron, iEvent, iSetup );
605  }
606 
607 
608  double ip3d = -999; //for mva variable
609 
610  // embed high level selection
611  if ( embedHighLevelSelection_ ) {
612  // get the global track
613  reco::GsfTrackRef track = itElectron->gsfTrack();
614 
615  // Make sure the collection it points to is there
616  if ( track.isNonnull() && track.isAvailable() ) {
617 
618  reco::TransientTrack tt = trackBuilder->build(track);
619  embedHighLevel( anElectron,
620  track,
621  tt,
622  primaryVertex,
623  primaryVertexIsValid,
624  beamSpot,
625  beamSpotIsValid );
626 
627  std::pair<bool,Measurement1D> ip3dpv = IPTools::absoluteImpactParameter3D(tt, primaryVertex);
628  ip3d = ip3dpv.second.value(); // for mva variable
629 
630  }
631  }
632 
633  // add mva variables
634  std::vector<float> vCov = lazyTools.localCovariances(*( itElectron->superCluster()->seed()));
635  anElectron.setMvaVariables(vCov[1], ip3d);
636  // PFCluster Isolation
637  if (addPFClusterIso_) {
638  // Get PFCluster Isolation
639  edm::Handle<edm::ValueMap<float> > ecalPFClusterIsoMapH;
640  iEvent.getByToken(ecalPFClusterIsoT_, ecalPFClusterIsoMapH);
641  edm::Handle<edm::ValueMap<float> > hcalPFClusterIsoMapH;
642  iEvent.getByToken(hcalPFClusterIsoT_, hcalPFClusterIsoMapH);
643 
644  anElectron.setEcalPFClusterIso((*ecalPFClusterIsoMapH)[elecsRef]);
645  anElectron.setHcalPFClusterIso((*hcalPFClusterIsoMapH)[elecsRef]);
646  } else {
647  anElectron.setEcalPFClusterIso(-999.);
648  anElectron.setHcalPFClusterIso(-999.);
649  }
650  if (addPuppiIsolation_) {
651  anElectron.setIsolationPUPPI((*PUPPIIsolation_charged_hadrons)[elePtr], (*PUPPIIsolation_neutral_hadrons)[elePtr], (*PUPPIIsolation_photons)[elePtr]);
652  anElectron.setIsolationPUPPINoLeptons((*PUPPINoLeptonsIsolation_charged_hadrons)[elePtr], (*PUPPINoLeptonsIsolation_neutral_hadrons)[elePtr], (*PUPPINoLeptonsIsolation_photons)[elePtr]);
653  }
654  else {
655  anElectron.setIsolationPUPPI(-999., -999.,-999.);
656  anElectron.setIsolationPUPPINoLeptons(-999., -999.,-999.);
657  }
658 
659  std::vector<DetId> selectedCells;
660  bool barrel = itElectron->isEB();
661  //loop over sub clusters
662  if (embedBasicClusters_) {
663  for (reco::CaloCluster_iterator clusIt = itElectron->superCluster()->clustersBegin(); clusIt!=itElectron->superCluster()->clustersEnd(); ++clusIt) {
664  //get seed (max energy xtal)
665  DetId seed = lazyTools.getMaximum(**clusIt).first;
666  //get all xtals in 5x5 window around the seed
667  std::vector<DetId> dets5x5 = (barrel) ? ecalTopology_->getSubdetectorTopology(DetId::Ecal,EcalBarrel)->getWindow(seed,5,5):
669  selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
670 
671  //get all xtals belonging to cluster
672  for (const std::pair<DetId, float> &hit : (*clusIt)->hitsAndFractions()) {
673  selectedCells.push_back(hit.first);
674  }
675  }
676  }
677 
678  if (embedPflowBasicClusters_ && itElectron->parentSuperCluster().isNonnull()) {
679  for (reco::CaloCluster_iterator clusIt = itElectron->parentSuperCluster()->clustersBegin(); clusIt!=itElectron->parentSuperCluster()->clustersEnd(); ++clusIt) {
680  //get seed (max energy xtal)
681  DetId seed = lazyTools.getMaximum(**clusIt).first;
682  //get all xtals in 5x5 window around the seed
683  std::vector<DetId> dets5x5 = (barrel) ? ecalTopology_->getSubdetectorTopology(DetId::Ecal,EcalBarrel)->getWindow(seed,5,5):
685  selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
686 
687  //get all xtals belonging to cluster
688  for (const std::pair<DetId, float> &hit : (*clusIt)->hitsAndFractions()) {
689  selectedCells.push_back(hit.first);
690  }
691  }
692  }
693 
694  //remove duplicates
695  std::sort(selectedCells.begin(),selectedCells.end());
696  std::unique(selectedCells.begin(),selectedCells.end());
697 
698  // Retrieve the corresponding RecHits
699 
701  if(barrel)
703  else
705 
706  EcalRecHitCollection selectedRecHits;
707  const EcalRecHitCollection *recHits = rechitsH.product();
708 
709  unsigned nSelectedCells = selectedCells.size();
710  for (unsigned icell = 0 ; icell < nSelectedCells ; ++icell) {
711  EcalRecHitCollection::const_iterator it = recHits->find( selectedCells[icell] );
712  if ( it != recHits->end() ) {
713  selectedRecHits.push_back(*it);
714  }
715  }
716  selectedRecHits.sort();
717  if (embedRecHits_) anElectron.embedRecHits(& selectedRecHits);
718 
719  // set conversion veto selection
720  bool passconversionveto = false;
721  if( hConversions.isValid()){
722  // this is recommended method
723  passconversionveto = !ConversionTools::hasMatchedConversion( *itElectron, hConversions, beamSpotHandle->position());
724  }else{
725  // use missing hits without vertex fit method
726  passconversionveto = itElectron->gsfTrack()->hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS) < 1;
727  }
728  anElectron.setPassConversionVeto( passconversionveto );
729 
730  // add sel to selected
731  fillElectron( anElectron, elecsRef,elecBaseRef,
732  genMatches, deposits, pfId, isolationValues, isolationValuesNoPFId);
733  patElectrons->push_back(anElectron);
734  }
735  }
736 
737  // sort electrons in pt
738  std::sort(patElectrons->begin(), patElectrons->end(), pTComparator_);
739 
740  // add the electrons to the event output
741  std::unique_ptr<std::vector<Electron> > ptr(patElectrons);
742  iEvent.put(std::move(ptr));
743 
744  // clean up
746 
747 }
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
bool isAvailable() const
Definition: Ref.h:576
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
const edm::EDGetTokenT< reco::ConversionCollection > hConversionsToken_
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_charged_hadrons_
const GreaterByPt< Electron > pTComparator_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_charged_hadrons_
const bool useParticleFlow_
pflow specific
const edm::EDGetTokenT< reco::PFCandidateCollection > pfElecToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_neutral_hadrons_
const edm::EDGetTokenT< edm::ValueMap< float > > ecalPFClusterIsoT_
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
reco::TransientTrack build(const reco::Track *p) const
std::pair< bool, Measurement1D > absoluteImpactParameter3D(const reco::TransientTrack &transientTrack, const reco::Vertex &vertex)
Definition: IPTools.cc:37
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
void push_back(T const &t)
const edm::EDGetTokenT< edm::ValueMap< float > > hcalPFClusterIsoT_
PFCandidateCollection::const_iterator PFCandidateConstIterator
iterator
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > elecIDTokens_
bool isRealData() const
Definition: EventBase.h:64
const edm::EDGetTokenT< edm::View< reco::GsfElectron > > electronToken_
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
const edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
bool enabled() const
True if it has a non null configuration.
Definition: MultiIsolator.h:50
const edm::EDGetTokenT< edm::ValueMap< reco::PFCandidatePtr > > pfCandidateMapToken_
pat::helper::MultiIsolator isolator_
std::vector< edm::Handle< edm::Association< reco::GenParticleCollection > > > GenAssociations
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_photons_
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_
def unique(seq, keepstr=True)
Definition: tier0.py:24
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_neutral_hadrons_
const edm::EDGetTokenT< EcalRecHitCollection > reducedEndcapRecHitCollectionToken_
math::XYZPoint Point
point in the space
Definition: TrackBase.h:83
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< edm::ValueMap< float > > PUPPINoLeptonsIsolation_photons_
static bool hasMatchedConversion(const reco::GsfElectron &ele, const edm::Handle< reco::ConversionCollection > &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0)
const_iterator end() const
Definition: DetId.h:18
const edm::EDGetTokenT< reco::BeamSpot > beamLineToken_
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
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueNoPFIdTokens_
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
pat::helper::EfficiencyLoader efficiencyLoader_
const edm::EDGetTokenT< EcalRecHitCollection > reducedBarrelRecHitCollectionToken_
const T & get() const
Definition: EventSetup.h:56
pat::PATUserDataHelper< pat::Electron > userDataHelper_
const CaloTopology * ecalTopology_
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:26
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
Definition: MultiIsolator.h:16
iterator find(key_type k)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
size_type size() const
pat::helper::KinResolutionsLoader resolutionLoader_
const Point & position() const
position
Definition: BeamSpot.h:62
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueTokens_
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
def move(src, dest)
Definition: eostools.py:510
std::vector< NameTag > elecIDSrcs_
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
Definition: MultiIsolator.h:82
std::vector< edm::Handle< edm::ValueMap< IsoDeposit > > > IsoDepositMaps
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 193 of file PATElectronProducer.h.

References pat::EcalIso, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), pat::HcalIso, crabWrapper::key, diffTwoXMLs::label, pat::PfAllParticleIso, pat::PfChargedAllIso, pat::PfChargedHadronIso, pat::PfGammaIso, pat::PfNeutralHadronIso, pat::PfPUChargedHadronIso, pat::TrackIso, pat::UserBaseIso, and edm::vector_transform().

Referenced by PATElectronProducer().

196  {
197 
198  labels.clear();
199 
200  if (iConfig.exists( psetName )) {
201  edm::ParameterSet depconf
202  = iConfig.getParameter<edm::ParameterSet>(psetName);
203 
204  if (depconf.exists("tracker")) labels.push_back(std::make_pair(pat::TrackIso, depconf.getParameter<edm::InputTag>("tracker")));
205  if (depconf.exists("ecal")) labels.push_back(std::make_pair(pat::EcalIso, depconf.getParameter<edm::InputTag>("ecal")));
206  if (depconf.exists("hcal")) labels.push_back(std::make_pair(pat::HcalIso, depconf.getParameter<edm::InputTag>("hcal")));
207  if (depconf.exists("pfAllParticles")) {
208  labels.push_back(std::make_pair(pat::PfAllParticleIso, depconf.getParameter<edm::InputTag>("pfAllParticles")));
209  }
210  if (depconf.exists("pfChargedHadrons")) {
211  labels.push_back(std::make_pair(pat::PfChargedHadronIso, depconf.getParameter<edm::InputTag>("pfChargedHadrons")));
212  }
213  if (depconf.exists("pfChargedAll")) {
214  labels.push_back(std::make_pair(pat::PfChargedAllIso, depconf.getParameter<edm::InputTag>("pfChargedAll")));
215  }
216  if (depconf.exists("pfPUChargedHadrons")) {
217  labels.push_back(std::make_pair(pat::PfPUChargedHadronIso, depconf.getParameter<edm::InputTag>("pfPUChargedHadrons")));
218  }
219  if (depconf.exists("pfNeutralHadrons")) {
220  labels.push_back(std::make_pair(pat::PfNeutralHadronIso, depconf.getParameter<edm::InputTag>("pfNeutralHadrons")));
221  }
222  if (depconf.exists("pfPhotons")) {
223  labels.push_back(std::make_pair(pat::PfGammaIso, depconf.getParameter<edm::InputTag>("pfPhotons")));
224  }
225  if (depconf.exists("user")) {
226  std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag> >("user");
227  std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
229  for ( ; it != ed; ++it, ++key) {
230  labels.push_back(std::make_pair(pat::IsolationKeys(key), *it));
231  }
232  }
233  }
234  tokens = edm::vector_transform(labels, [this](IsolationLabel const & label){return consumes<edm::ValueMap<T> >(label.second);});
235 }
T getParameter(std::string const &) const
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
std::pair< pat::IsolationKeys, edm::InputTag > IsolationLabel

Member Data Documentation

const bool pat::PATElectronProducer::addEfficiencies_
private

Definition at line 170 of file PATElectronProducer.h.

Referenced by PATElectronProducer().

const bool pat::PATElectronProducer::addElecID_
private

Definition at line 153 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

bool pat::PATElectronProducer::addGenMatch_
private

Definition at line 80 of file PATElectronProducer.h.

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

const bool pat::PATElectronProducer::addPFClusterIso_
private

Definition at line 100 of file PATElectronProducer.h.

Referenced by produce().

const bool pat::PATElectronProducer::addPuppiIsolation_
private

Definition at line 101 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

const bool pat::PATElectronProducer::addResolutions_
private

Definition at line 173 of file PATElectronProducer.h.

Referenced by PATElectronProducer().

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

Definition at line 107 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 102 of file PATElectronProducer.h.

Referenced by produce().

const CaloTopology* pat::PATElectronProducer::ecalTopology_
private

Definition at line 187 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 171 of file PATElectronProducer.h.

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

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

Definition at line 155 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 156 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 68 of file PATElectronProducer.h.

Referenced by produce().

const bool pat::PATElectronProducer::embedBasicClusters_
private

Definition at line 75 of file PATElectronProducer.h.

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

bool pat::PATElectronProducer::embedGenMatch_
private

Definition at line 81 of file PATElectronProducer.h.

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

const bool pat::PATElectronProducer::embedGsfElectronCore_
private

Definition at line 70 of file PATElectronProducer.h.

Referenced by fillElectron(), and fillElectron2().

const bool pat::PATElectronProducer::embedGsfTrack_
private

Definition at line 71 of file PATElectronProducer.h.

Referenced by fillElectron(), and fillElectron2().

const bool pat::PATElectronProducer::embedHighLevelSelection_
private

embed high level selection variables?

Definition at line 106 of file PATElectronProducer.h.

Referenced by produce().

const bool pat::PATElectronProducer::embedPFCandidate_
private

Definition at line 92 of file PATElectronProducer.h.

Referenced by produce().

const bool pat::PATElectronProducer::embedPflowBasicClusters_
private

Definition at line 77 of file PATElectronProducer.h.

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

const bool pat::PATElectronProducer::embedPflowPreshowerClusters_
private

Definition at line 78 of file PATElectronProducer.h.

Referenced by fillElectron(), and fillElectron2().

const bool pat::PATElectronProducer::embedPflowSuperCluster_
private

Definition at line 73 of file PATElectronProducer.h.

Referenced by fillElectron(), and fillElectron2().

const bool pat::PATElectronProducer::embedPreshowerClusters_
private

Definition at line 76 of file PATElectronProducer.h.

Referenced by fillElectron(), and fillElectron2().

const bool pat::PATElectronProducer::embedRecHits_
private

Definition at line 82 of file PATElectronProducer.h.

Referenced by produce().

const bool pat::PATElectronProducer::embedSeedCluster_
private

Definition at line 74 of file PATElectronProducer.h.

Referenced by fillElectron(), and fillElectron2().

const bool pat::PATElectronProducer::embedSuperCluster_
private

Definition at line 72 of file PATElectronProducer.h.

Referenced by fillElectron(), and fillElectron2().

const bool pat::PATElectronProducer::embedTrack_
private

Definition at line 79 of file PATElectronProducer.h.

Referenced by fillElectron(), and fillElectron2().

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

Definition at line 86 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 103 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 69 of file PATElectronProducer.h.

Referenced by produce().

IsolationLabels pat::PATElectronProducer::isoDepositLabels_
private

Definition at line 163 of file PATElectronProducer.h.

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

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

Definition at line 164 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

IsolationLabels pat::PATElectronProducer::isolationValueLabels_
private

Definition at line 165 of file PATElectronProducer.h.

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

IsolationLabels pat::PATElectronProducer::isolationValueLabelsNoPFId_
private

Definition at line 167 of file PATElectronProducer.h.

Referenced by fillElectron(), and PATElectronProducer().

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

Definition at line 168 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 166 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 161 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 162 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 91 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 90 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 159 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 178 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 179 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 180 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 182 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 183 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 184 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 108 of file PATElectronProducer.h.

Referenced by produce().

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

mva input variables

Definition at line 95 of file PATElectronProducer.h.

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

Definition at line 96 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 97 of file PATElectronProducer.h.

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

Definition at line 98 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 174 of file PATElectronProducer.h.

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

const bool pat::PATElectronProducer::useParticleFlow_
private

pflow specific

Definition at line 89 of file PATElectronProducer.h.

Referenced by fillElectron(), and produce().

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

Definition at line 185 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

const bool pat::PATElectronProducer::useUserData_
private

Definition at line 176 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().