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
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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)
 
void setElectronMiniIso (pat::Electron &anElectron, const pat::PackedCandidateCollection *pc)
 

Private Attributes

const bool addEfficiencies_
 
const bool addElecID_
 
bool addGenMatch_
 
const bool addPFClusterIso_
 
const bool addPuppiIsolation_
 
const bool addResolutions_
 
const edm::EDGetTokenT< reco::BeamSpotbeamLineToken_
 
bool computeMiniIso_
 
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_
 
std::vector< double > miniIsoParamsB_
 
std::vector< double > miniIsoParamsE_
 
edm::EDGetTokenT< pat::PackedCandidateCollectionpcToken_
 
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 115 of file PATElectronProducer.h.

Definition at line 89 of file PATElectronProducer.h.

Definition at line 116 of file PATElectronProducer.h.

Definition at line 151 of file PATElectronProducer.h.

Definition at line 152 of file PATElectronProducer.h.

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

Definition at line 117 of file PATElectronProducer.h.

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

Definition at line 162 of file PATElectronProducer.h.

Constructor & Destructor Documentation

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

Definition at line 55 of file PATElectronProducer.cc.

References addEfficiencies_, addElecID_, addGenMatch_, addPuppiIsolation_, addResolutions_, computeMiniIso_, 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_, miniIsoParamsB_, miniIsoParamsE_, cscdqm::h::names, pcToken_, 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().

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

Definition at line 204 of file PATElectronProducer.cc.

205 {
206 }

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 1117 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().

1125 {
1126  // Correct to PV
1127 
1128  // PV2D
1129  std::pair<bool,Measurement1D> result =
1131  GlobalVector(track->px(),
1132  track->py(),
1133  track->pz()),
1134  primaryVertex);
1135  double d0_corr = result.second.value();
1136  double d0_err = primaryVertexIsValid ? result.second.error() : -1.0;
1137  anElectron.setDB( d0_corr, d0_err, pat::Electron::PV2D);
1138 
1139 
1140  // PV3D
1141  result =
1143  GlobalVector(track->px(),
1144  track->py(),
1145  track->pz()),
1146  primaryVertex);
1147  d0_corr = result.second.value();
1148  d0_err = primaryVertexIsValid ? result.second.error() : -1.0;
1149  anElectron.setDB( d0_corr, d0_err, pat::Electron::PV3D);
1150 
1151 
1152  // Correct to beam spot
1153  // make a fake vertex out of beam spot
1154  reco::Vertex vBeamspot(beamspot.position(), beamspot.covariance3D());
1155 
1156  // BS2D
1157  result =
1159  GlobalVector(track->px(),
1160  track->py(),
1161  track->pz()),
1162  vBeamspot);
1163  d0_corr = result.second.value();
1164  d0_err = beamspotIsValid ? result.second.error() : -1.0;
1165  anElectron.setDB( d0_corr, d0_err, pat::Electron::BS2D);
1166 
1167  // BS3D
1168  result =
1170  GlobalVector(track->px(),
1171  track->py(),
1172  track->pz()),
1173  vBeamspot);
1174  d0_corr = result.second.value();
1175  d0_err = beamspotIsValid ? result.second.error() : -1.0;
1176  anElectron.setDB( d0_corr, d0_err, pat::Electron::BS3D);
1177 }
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 970 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().

971 {
973  iDesc.setComment("PAT electron producer module");
974 
975  // input source
976  iDesc.add<edm::InputTag>("pfCandidateMap", edm::InputTag("no default"))->setComment("input collection");
977  iDesc.add<edm::InputTag>("electronSource", edm::InputTag("no default"))->setComment("input collection");
978 
979  iDesc.ifValue(edm::ParameterDescription<bool>("addPFClusterIso", false, true),
980  true >> (edm::ParameterDescription<edm::InputTag>("ecalPFClusterIsoMap", edm::InputTag("electronEcalPFClusterIsolationProducer"), true) and
981  edm::ParameterDescription<edm::InputTag>("hcalPFClusterIsoMap", edm::InputTag("electronHcalPFClusterIsolationProducer"),true)) or
982  false >> (edm::ParameterDescription<edm::InputTag>("ecalPFClusterIsoMap", edm::InputTag(""), true) and
983  edm::ParameterDescription<edm::InputTag>("hcalPFClusterIsoMap", edm::InputTag(""),true)));
984 
985  iDesc.ifValue(edm::ParameterDescription<bool>("addPuppiIsolation", false, true),
986  true >> (edm::ParameterDescription<edm::InputTag>("puppiIsolationChargedHadrons", edm::InputTag("egmElectronPUPPIIsolation","h+-DR030-BarVeto000-EndVeto001"), true) and
987  edm::ParameterDescription<edm::InputTag>("puppiIsolationNeutralHadrons", edm::InputTag("egmElectronPUPPIIsolation","h0-DR030-BarVeto000-EndVeto000"), true) and
988  edm::ParameterDescription<edm::InputTag>("puppiIsolationPhotons", edm::InputTag("egmElectronPUPPIIsolation","gamma-DR030-BarVeto000-EndVeto008"), true) and
989  edm::ParameterDescription<edm::InputTag>("puppiNoLeptonsIsolationChargedHadrons", edm::InputTag("egmElectronPUPPINoLeptonsIsolation","gamma-DR030-BarVeto000-EndVeto008"), true) and
990  edm::ParameterDescription<edm::InputTag>("puppiNoLeptonsIsolationNeutralHadrons", edm::InputTag("egmElectronPUPPINoLeptonsIsolation","gamma-DR030-BarVeto000-EndVeto008"), true) and
991  edm::ParameterDescription<edm::InputTag>("puppiNoLeptonsIsolationPhotons", edm::InputTag("egmElectronPUPPINoLeptonsIsolation","gamma-DR030-BarVeto000-EndVeto008"), true)) or
992  false >> edm::EmptyGroupDescription());
993 
994 
995  // embedding
996  iDesc.add<bool>("embedGsfElectronCore", true)->setComment("embed external gsf electron core");
997  iDesc.add<bool>("embedGsfTrack", true)->setComment("embed external gsf track");
998  iDesc.add<bool>("embedSuperCluster", true)->setComment("embed external super cluster");
999  iDesc.add<bool>("embedPflowSuperCluster", true)->setComment("embed external super cluster");
1000  iDesc.add<bool>("embedSeedCluster", true)->setComment("embed external seed cluster");
1001  iDesc.add<bool>("embedBasicClusters", true)->setComment("embed external basic clusters");
1002  iDesc.add<bool>("embedPreshowerClusters", true)->setComment("embed external preshower clusters");
1003  iDesc.add<bool>("embedPflowBasicClusters", true)->setComment("embed external pflow basic clusters");
1004  iDesc.add<bool>("embedPflowPreshowerClusters", true)->setComment("embed external pflow preshower clusters");
1005  iDesc.add<bool>("embedTrack", false)->setComment("embed external track");
1006  iDesc.add<bool>("embedRecHits", true)->setComment("embed external RecHits");
1007 
1008  // pf specific parameters
1009  iDesc.add<edm::InputTag>("pfElectronSource", edm::InputTag("pfElectrons"))->setComment("particle flow input collection");
1010  iDesc.add<bool>("useParticleFlow", false)->setComment("whether to use particle flow or not");
1011  iDesc.add<bool>("embedPFCandidate", false)->setComment("embed external particle flow object");
1012 
1013  // MC matching configurables
1014  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
1015  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
1016  std::vector<edm::InputTag> emptySourceVector;
1017  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
1018  edm::ParameterDescription<std::vector<edm::InputTag> >("genParticleMatch", emptySourceVector, true)
1019  )->setComment("input with MC match information");
1020 
1021  // electron ID configurables
1022  iDesc.add<bool>("addElectronID",true)->setComment("add electron ID variables");
1023  edm::ParameterSetDescription electronIDSourcesPSet;
1024  electronIDSourcesPSet.setAllowAnything();
1025  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("electronIDSource", edm::InputTag(), true) xor
1026  edm::ParameterDescription<edm::ParameterSetDescription>("electronIDSources", electronIDSourcesPSet, true)
1027  )->setComment("input with electron ID variables");
1028 
1029 
1030  // mini-iso
1031  iDesc.add<bool>("computeMiniIso", false)->setComment("whether or not to compute and store electron mini-isolation");
1032  iDesc.add<edm::InputTag>("pfCandsForMiniIso", edm::InputTag("packedPFCandidates"))->setComment("collection to use to compute mini-iso");
1033  iDesc.add<std::vector<double> >("miniIsoParamsE", std::vector<double>())->setComment("mini-iso parameters to use for endcap electrons");
1034  iDesc.add<std::vector<double> >("miniIsoParamsB", std::vector<double>())->setComment("mini-iso parameters to use for barrel electrons");
1035 
1036  // IsoDeposit configurables
1037  edm::ParameterSetDescription isoDepositsPSet;
1038  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
1039  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
1040  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
1041  isoDepositsPSet.addOptional<edm::InputTag>("pfAllParticles");
1042  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadrons");
1043  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedAll");
1044  isoDepositsPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
1045  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
1046  isoDepositsPSet.addOptional<edm::InputTag>("pfPhotons");
1047  isoDepositsPSet.addOptional<std::vector<edm::InputTag> >("user");
1048  iDesc.addOptional("isoDeposits", isoDepositsPSet);
1049 
1050  // isolation values configurables
1051  edm::ParameterSetDescription isolationValuesPSet;
1052  isolationValuesPSet.addOptional<edm::InputTag>("tracker");
1053  isolationValuesPSet.addOptional<edm::InputTag>("ecal");
1054  isolationValuesPSet.addOptional<edm::InputTag>("hcal");
1055  isolationValuesPSet.addOptional<edm::InputTag>("pfAllParticles");
1056  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedHadrons");
1057  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedAll");
1058  isolationValuesPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
1059  isolationValuesPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
1060  isolationValuesPSet.addOptional<edm::InputTag>("pfPhotons");
1061  isolationValuesPSet.addOptional<std::vector<edm::InputTag> >("user");
1062  iDesc.addOptional("isolationValues", isolationValuesPSet);
1063 
1064  // isolation values configurables
1065  edm::ParameterSetDescription isolationValuesNoPFIdPSet;
1066  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("tracker");
1067  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("ecal");
1068  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("hcal");
1069  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfAllParticles");
1070  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfChargedHadrons");
1071  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfChargedAll");
1072  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfPUChargedHadrons");
1073  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
1074  isolationValuesNoPFIdPSet.addOptional<edm::InputTag>("pfPhotons");
1075  isolationValuesNoPFIdPSet.addOptional<std::vector<edm::InputTag> >("user");
1076  iDesc.addOptional("isolationValuesNoPFId", isolationValuesNoPFIdPSet);
1077 
1078  // Efficiency configurables
1079  edm::ParameterSetDescription efficienciesPSet;
1080  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
1081  iDesc.add("efficiencies", efficienciesPSet);
1082  iDesc.add<bool>("addEfficiencies", false);
1083 
1084  // Check to see if the user wants to add user data
1085  edm::ParameterSetDescription userDataPSet;
1087  iDesc.addOptional("userData", userDataPSet);
1088 
1089 
1090  // electron shapes
1091  iDesc.add<bool>("addElectronShapes", true);
1092  iDesc.add<edm::InputTag>("reducedBarrelRecHitCollection", edm::InputTag("reducedEcalRecHitsEB"));
1093  iDesc.add<edm::InputTag>("reducedEndcapRecHitCollection", edm::InputTag("reducedEcalRecHitsEE"));
1094 
1095  edm::ParameterSetDescription isolationPSet;
1096  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
1097  iDesc.add("userIsolation", isolationPSet);
1098 
1099  // Resolution configurables
1101 
1102  iDesc.add<bool>("embedHighLevelSelection", true)->setComment("embed high level selection");
1103  edm::ParameterSetDescription highLevelPSet;
1104  highLevelPSet.setAllowAnything();
1105  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("beamLineSrc", edm::InputTag(), true)
1106  )->setComment("input with high level selection");
1108  )->setComment("input with high level selection");
1109 
1110  descriptions.add("PATElectronProducer", iDesc);
1111 
1112 }
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 773 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().

781  {
782 
783  //COLIN: might want to use the PFCandidate 4-mom. Which one is in use now?
784  // if (useParticleFlow_)
785  // aMuon.setP4( aMuon.pfCandidateRef()->p4() );
786 
787  //COLIN:
788  //In the embedding case, the reference cannot be used to look into a value map.
789  //therefore, one has to had the PFCandidateRef to this function, which becomes a bit
790  //too much specific.
791 
792  // in fact, this function needs a baseref or ptr for genmatch
793  // and a baseref or ptr for isodeposits and isolationvalues.
794  // baseref is not needed
795  // the ptrForIsolation and ptrForMatching should be defined upstream.
796 
797  // is the concrete elecRef needed for the efficiency loader? what is this loader?
798  // how can we make it compatible with the particle flow electrons?
799 
800  if (embedGsfElectronCore_) anElectron.embedGsfElectronCore();
801  if (embedGsfTrack_) anElectron.embedGsfTrack();
802  if (embedSuperCluster_) anElectron.embedSuperCluster();
803  if (embedPflowSuperCluster_) anElectron.embedPflowSuperCluster();
804  if (embedSeedCluster_) anElectron.embedSeedCluster();
805  if (embedBasicClusters_) anElectron.embedBasicClusters();
806  if (embedPreshowerClusters_) anElectron.embedPreshowerClusters();
807  if (embedPflowBasicClusters_ ) anElectron.embedPflowBasicClusters();
808  if (embedPflowPreshowerClusters_ ) anElectron.embedPflowPreshowerClusters();
809  if (embedTrack_) anElectron.embedTrack();
810 
811  // store the match to the generated final state muons
812  if (addGenMatch_) {
813  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
814  if(useParticleFlow_) {
815  reco::GenParticleRef genElectron = (*genMatches[i])[anElectron.pfCandidateRef()];
816  anElectron.addGenParticleRef(genElectron);
817  }
818  else {
819  reco::GenParticleRef genElectron = (*genMatches[i])[elecRef];
820  anElectron.addGenParticleRef(genElectron);
821  }
822  }
823  if (embedGenMatch_) anElectron.embedGenParticle();
824  }
825 
826  if (efficiencyLoader_.enabled()) {
827  efficiencyLoader_.setEfficiencies( anElectron, elecRef );
828  }
829 
830  if (resolutionLoader_.enabled()) {
831  resolutionLoader_.setResolutions(anElectron);
832  }
833 
834  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
835  if(useParticleFlow_) {
836 
837  reco::PFCandidateRef pfcandref = anElectron.pfCandidateRef();
838  assert(!pfcandref.isNull());
839  reco::CandidatePtr source = pfcandref->sourceCandidatePtr(0);
840  anElectron.setIsoDeposit(isoDepositLabels_[j].first,
841  (*deposits[j])[source]);
842  }
843  else
844  anElectron.setIsoDeposit(isoDepositLabels_[j].first,
845  (*deposits[j])[elecRef]);
846  }
847 
848  for (size_t j = 0; j<isolationValues.size(); ++j) {
849  if(useParticleFlow_) {
850  reco::CandidatePtr source = anElectron.pfCandidateRef()->sourceCandidatePtr(0);
851  anElectron.setIsolation(isolationValueLabels_[j].first,
852  (*isolationValues[j])[source]);
853  }
854  else
855  if(pfId){
856  anElectron.setIsolation(isolationValueLabels_[j].first,(*isolationValues[j])[elecRef]);
857  }
858  }
859 
860  //for electrons not identified as PF electrons
861  for (size_t j = 0; j<isolationValuesNoPFId.size(); ++j) {
862  if( !pfId) {
863  anElectron.setIsolation(isolationValueLabelsNoPFId_[j].first,(*isolationValuesNoPFId[j])[elecRef]);
864  }
865  }
866 
867 }
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 869 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().

875  {
876 
877  //COLIN/Florian: use the PFCandidate 4-mom.
878  anElectron.setEcalDrivenMomentum(anElectron.p4()) ;
879  anElectron.setP4( anElectron.pfCandidateRef()->p4() );
880 
881 
882  // is the concrete elecRef needed for the efficiency loader? what is this loader?
883  // how can we make it compatible with the particle flow electrons?
884 
886  if (embedGsfTrack_) anElectron.embedGsfTrack();
887  if (embedSuperCluster_) anElectron.embedSuperCluster();
889  if (embedSeedCluster_) anElectron.embedSeedCluster();
890  if (embedBasicClusters_) anElectron.embedBasicClusters();
894  if (embedTrack_) anElectron.embedTrack();
895 
896  // store the match to the generated final state muons
897 
898  if (addGenMatch_) {
899  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
900  reco::GenParticleRef genElectron = (*genMatches[i])[candPtrForGenMatch];
901  anElectron.addGenParticleRef(genElectron);
902  }
903  if (embedGenMatch_) anElectron.embedGenParticle();
904  }
905 
906  //COLIN what's this? does it have to be GsfElectron specific?
907  if (efficiencyLoader_.enabled()) {
908  efficiencyLoader_.setEfficiencies( anElectron, candPtrForLoader );
909  }
910 
911  if (resolutionLoader_.enabled()) {
912  resolutionLoader_.setResolutions(anElectron);
913  }
914 
915  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
919  deposits[j]->contains(candPtrForGenMatch.id())) {
920  anElectron.setIsoDeposit(isoDepositLabels_[j].first,
921  (*deposits[j])[candPtrForGenMatch]);
922  }
923  else if (deposits[j]->contains(candPtrForIsolation.id())) {
924  anElectron.setIsoDeposit(isoDepositLabels_[j].first,
925  (*deposits[j])[candPtrForIsolation]);
926  }
927  else {
928  anElectron.setIsoDeposit(isoDepositLabels_[j].first,
929  (*deposits[j])[candPtrForIsolation->sourceCandidatePtr(0)]);
930  }
931  }
932 
933  for (size_t j = 0; j<isolationValues.size(); ++j) {
934  if( isolationValueLabels_[j].first==pat::TrackIso ||
937  isolationValues[j]->contains(candPtrForGenMatch.id())) {
938  anElectron.setIsolation(isolationValueLabels_[j].first,
939  (*isolationValues[j])[candPtrForGenMatch]);
940  }
941  else if (isolationValues[j]->contains(candPtrForIsolation.id())) {
942  anElectron.setIsolation(isolationValueLabels_[j].first,
943  (*isolationValues[j])[candPtrForIsolation]);
944  }
945  else {
946  anElectron.setIsolation(isolationValueLabels_[j].first,
947  (*isolationValues[j])[candPtrForIsolation->sourceCandidatePtr(0)]);
948  }
949  }
950 }
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:99
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:176
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 209 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(), computeMiniIso_, 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, pcToken_, pfCandidateMapToken_, pfElecToken_, reco::BeamSpot::position(), impactParameterTagInfos_cfi::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(), edm::Event::put(), pvToken_, reducedBarrelRecHitCollectionToken_, reducedEndcapRecHitCollectionToken_, resolutionLoader_, SurveyInfoScenario_cff::seed, pat::Electron::setEcalPFClusterIso(), pat::Electron::setElectronIDs(), setElectronMiniIso(), 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_.

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

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

Definition at line 952 of file PATElectronProducer.cc.

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

Referenced by produce().

953 {
954  pat::PFIsolation miniiso;
955  if(anElectron.isEE())
956  miniiso = pat::getMiniPFIsolation(pc, anElectron.p4(),
957  miniIsoParamsE_[0], miniIsoParamsE_[1], miniIsoParamsE_[2],
958  miniIsoParamsE_[3], miniIsoParamsE_[4], miniIsoParamsE_[5],
959  miniIsoParamsE_[6], miniIsoParamsE_[7], miniIsoParamsE_[8]);
960  else
961  miniiso = pat::getMiniPFIsolation(pc, anElectron.p4(),
962  miniIsoParamsB_[0], miniIsoParamsB_[1], miniIsoParamsB_[2],
963  miniIsoParamsB_[3], miniIsoParamsB_[4], miniIsoParamsB_[5],
964  miniIsoParamsB_[6], miniIsoParamsB_[7], miniIsoParamsB_[8]);
965  anElectron.setMiniPFIsolation(miniiso);
966 
967 }
const LorentzVector & p4(P4Kind kind) const
Definition: GsfElectron.cc:225
std::vector< double > miniIsoParamsE_
bool isEE() const
Definition: GsfElectron.h:353
std::vector< double > miniIsoParamsB_
void setMiniPFIsolation(PFIsolation const &iso)
Definition: Lepton.h:197
PFIsolation getMiniPFIsolation(const pat::PackedCandidateCollection *pfcands, const math::XYZTLorentzVector &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

const bool pat::PATElectronProducer::addEfficiencies_
private

Definition at line 178 of file PATElectronProducer.h.

Referenced by PATElectronProducer().

const bool pat::PATElectronProducer::addElecID_
private

Definition at line 161 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 105 of file PATElectronProducer.h.

Referenced by produce().

const bool pat::PATElectronProducer::addPuppiIsolation_
private

Definition at line 106 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

const bool pat::PATElectronProducer::addResolutions_
private

Definition at line 181 of file PATElectronProducer.h.

Referenced by PATElectronProducer().

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

Definition at line 112 of file PATElectronProducer.h.

Referenced by produce().

bool pat::PATElectronProducer::computeMiniIso_
private

Definition at line 85 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 107 of file PATElectronProducer.h.

Referenced by produce().

const CaloTopology* pat::PATElectronProducer::ecalTopology_
private

Definition at line 195 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 179 of file PATElectronProducer.h.

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

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

Definition at line 163 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 164 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 111 of file PATElectronProducer.h.

Referenced by produce().

const bool pat::PATElectronProducer::embedPFCandidate_
private

Definition at line 97 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 91 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 108 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 171 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 172 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

IsolationLabels pat::PATElectronProducer::isolationValueLabels_
private

Definition at line 173 of file PATElectronProducer.h.

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

IsolationLabels pat::PATElectronProducer::isolationValueLabelsNoPFId_
private

Definition at line 175 of file PATElectronProducer.h.

Referenced by fillElectron(), and PATElectronProducer().

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

Definition at line 176 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 174 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 169 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 170 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 87 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and setElectronMiniIso().

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

Definition at line 86 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and setElectronMiniIso().

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

Definition at line 84 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 96 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 95 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 167 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 186 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 187 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 188 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 190 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 191 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 192 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 113 of file PATElectronProducer.h.

Referenced by produce().

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

mva input variables

Definition at line 100 of file PATElectronProducer.h.

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

Definition at line 101 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 102 of file PATElectronProducer.h.

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

Definition at line 103 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 182 of file PATElectronProducer.h.

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

const bool pat::PATElectronProducer::useParticleFlow_
private

pflow specific

Definition at line 94 of file PATElectronProducer.h.

Referenced by fillElectron(), and produce().

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

Definition at line 193 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

const bool pat::PATElectronProducer::useUserData_
private

Definition at line 184 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().