CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 PATElectronProducer (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
 ~PATElectronProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 

Private Types

typedef edm::RefToBase
< reco::GsfElectron
ElectronBaseRef
 
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::InputTag
IsolationLabel
 
typedef std::vector
< IsolationLabel
IsolationLabels
 
typedef std::vector
< edm::Handle< edm::ValueMap
< double > > > 
IsolationValueMaps
 
typedef std::pair< std::string,
edm::InputTag
NameTag
 

Private Member Functions

void fillElectron (Electron &aElectron, const ElectronBaseRef &electronRef, const reco::CandidateBaseRef &baseRef, const GenAssociations &genMatches, const IsoDepositMaps &deposits, const IsolationValueMaps &isolationValues) 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
 
void readIsolationLabels (const edm::ParameterSet &iConfig, const char *psetName, IsolationLabels &labels)
 

Private Attributes

bool addEfficiencies_
 
bool addElecID_
 
bool addGenMatch_
 
bool addResolutions_
 
edm::InputTag beamLineSrc_
 
pat::helper::EfficiencyLoader efficiencyLoader_
 
std::vector< NameTagelecIDSrcs_
 
edm::InputTag electronSrc_
 
bool embedGenMatch_
 
bool embedGsfElectronCore_
 
bool embedGsfTrack_
 
bool embedHighLevelSelection_
 embed high level selection variables? More...
 
bool embedPFCandidate_
 
bool embedSuperCluster_
 
bool embedTrack_
 
std::vector< edm::InputTaggenMatchSrc_
 
IsolationLabels isoDepositLabels_
 
IsolationLabels isolationValueLabels_
 
pat::helper::MultiIsolator isolator_
 
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
 
edm::InputTag pfElecSrc_
 
GreaterByPt< ElectronpTComparator_
 
edm::InputTag pvSrc_
 
pat::helper::KinResolutionsLoader resolutionLoader_
 
bool useParticleFlow_
 pflow specific More...
 
bool usePV_
 
pat::PATUserDataHelper
< pat::Electron
userDataHelper_
 
bool useUserData_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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.23 2010/04/20 16:09:29 srappocc Exp

Definition at line 52 of file PATElectronProducer.h.

Member Typedef Documentation

Definition at line 87 of file PATElectronProducer.h.

Definition at line 86 of file PATElectronProducer.h.

Definition at line 88 of file PATElectronProducer.h.

Definition at line 108 of file PATElectronProducer.h.

Definition at line 109 of file PATElectronProducer.h.

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

Definition at line 89 of file PATElectronProducer.h.

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

Definition at line 118 of file PATElectronProducer.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file PATElectronProducer.cc.

References addEfficiencies_, addElecID_, addGenMatch_, addResolutions_, beamLineSrc_, efficiencyLoader_, elecIDSrcs_, electronSrc_, embedGenMatch_, embedGsfElectronCore_, embedGsfTrack_, embedHighLevelSelection_, embedPFCandidate_, embedSuperCluster_, embedTrack_, edm::ParameterSet::existsAs(), genMatchSrc_, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), isoDepositLabels_, isolationValueLabels_, h::names, pfElecSrc_, pvSrc_, readIsolationLabels(), resolutionLoader_, useParticleFlow_, usePV_, userDataHelper_, and useUserData_.

44  :
45  isolator_(iConfig.exists("userIsolation") ? iConfig.getParameter<edm::ParameterSet>("userIsolation") : edm::ParameterSet(), false) ,
46  useUserData_(iConfig.exists("userData"))
47 {
48 
49  // general configurables
50  electronSrc_ = iConfig.getParameter<edm::InputTag>( "electronSource" );
51  embedGsfElectronCore_ = iConfig.getParameter<bool> ( "embedGsfElectronCore" );
52  embedGsfTrack_ = iConfig.getParameter<bool> ( "embedGsfTrack" );
53  embedSuperCluster_= iConfig.getParameter<bool> ( "embedSuperCluster" );
54  embedTrack_ = iConfig.getParameter<bool> ( "embedTrack" );
55 
56  // pflow specific
57  pfElecSrc_ = iConfig.getParameter<edm::InputTag>( "pfElectronSource" );
58  useParticleFlow_ = iConfig.getParameter<bool>( "useParticleFlow" );
59  embedPFCandidate_ = iConfig.getParameter<bool>( "embedPFCandidate" );
60 
61 
62  // MC matching configurables
63  addGenMatch_ = iConfig.getParameter<bool> ( "addGenMatch" );
64  if (addGenMatch_) {
65  embedGenMatch_ = iConfig.getParameter<bool> ( "embedGenMatch" );
66  if (iConfig.existsAs<edm::InputTag>("genParticleMatch")) {
67  genMatchSrc_.push_back(iConfig.getParameter<edm::InputTag>( "genParticleMatch" ));
68  } else {
69  genMatchSrc_ = iConfig.getParameter<std::vector<edm::InputTag> >( "genParticleMatch" );
70  }
71  }
72 
73  // resolution configurables
74  addResolutions_ = iConfig.getParameter<bool> ( "addResolutions" );
75  if (addResolutions_) {
77  }
78 
79 
80  // electron ID configurables
81  addElecID_ = iConfig.getParameter<bool> ( "addElectronID" );
82  if (addElecID_) {
83  // it might be a single electron ID
84  if (iConfig.existsAs<edm::InputTag>("electronIDSource")) {
85  elecIDSrcs_.push_back(NameTag("", iConfig.getParameter<edm::InputTag>("electronIDSource")));
86  }
87  // or there might be many of them
88  if (iConfig.existsAs<edm::ParameterSet>("electronIDSources")) {
89  // please don't configure me twice
90  if (!elecIDSrcs_.empty()) throw cms::Exception("Configuration") <<
91  "PATElectronProducer: you can't specify both 'electronIDSource' and 'electronIDSources'\n";
92  // read the different electron ID names
93  edm::ParameterSet idps = iConfig.getParameter<edm::ParameterSet>("electronIDSources");
94  std::vector<std::string> names = idps.getParameterNamesForType<edm::InputTag>();
95  for (std::vector<std::string>::const_iterator it = names.begin(), ed = names.end(); it != ed; ++it) {
96  elecIDSrcs_.push_back(NameTag(*it, idps.getParameter<edm::InputTag>(*it)));
97  }
98  }
99  // but in any case at least once
100  if (elecIDSrcs_.empty()) throw cms::Exception("Configuration") <<
101  "PATElectronProducer: id addElectronID is true, you must specify either:\n" <<
102  "\tInputTag electronIDSource = <someTag>\n" << "or\n" <<
103  "\tPSet electronIDSources = { \n" <<
104  "\t\tInputTag <someName> = <someTag> // as many as you want \n " <<
105  "\t}\n";
106  }
107 
108  // construct resolution calculator
109 
110  // // IsoDeposit configurables
111  // if (iConfig.exists("isoDeposits")) {
112  // edm::ParameterSet depconf = iConfig.getParameter<edm::ParameterSet>("isoDeposits");
113  // if (depconf.exists("tracker")) isoDepositLabels_.push_back(std::make_pair(TrackerIso, depconf.getParameter<edm::InputTag>("tracker")));
114  // if (depconf.exists("ecal")) isoDepositLabels_.push_back(std::make_pair(ECalIso, depconf.getParameter<edm::InputTag>("ecal")));
115  // if (depconf.exists("hcal")) isoDepositLabels_.push_back(std::make_pair(HCalIso, depconf.getParameter<edm::InputTag>("hcal")));
116 
117 
118  // if (depconf.exists("user")) {
119  // std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag> >("user");
120  // std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
121  // int key = UserBaseIso;
122  // for ( ; it != ed; ++it, ++key) {
123  // isoDepositLabels_.push_back(std::make_pair(IsolationKeys(key), *it));
124  // }
125  // }
126  // }
127 
128  // read isoDeposit labels, for direct embedding
129  readIsolationLabels(iConfig, "isoDeposits", isoDepositLabels_);
130 
131  // read isolation value labels, for direct embedding
132  readIsolationLabels(iConfig, "isolationValues", isolationValueLabels_);
133 
134  // Efficiency configurables
135  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
136  if (addEfficiencies_) {
138  }
139 
140  // Check to see if the user wants to add user data
141  if ( useUserData_ ) {
143  }
144 
145  // embed high level selection variables?
146  embedHighLevelSelection_ = iConfig.getParameter<bool>("embedHighLevelSelection");
147  if ( embedHighLevelSelection_ ) {
148  beamLineSrc_ = iConfig.getParameter<edm::InputTag>("beamLineSrc");
149  usePV_ = iConfig.getParameter<bool>("usePV");
150  pvSrc_ = iConfig.getParameter<edm::InputTag>("pvSrc");
151  }
152 
153 
154  // produces vector of muons
155  produces<std::vector<Electron> >();
156 
157 }
T getParameter(std::string const &) const
Assists in assimilating all pat::UserData into pat objects.
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:180
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::vector< edm::InputTag > genMatchSrc_
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:188
pat::helper::MultiIsolator isolator_
bool embedHighLevelSelection_
embed high level selection variables?
std::pair< std::string, edm::InputTag > NameTag
pat::helper::EfficiencyLoader efficiencyLoader_
pat::PATUserDataHelper< pat::Electron > userDataHelper_
bool useParticleFlow_
pflow specific
IsolationLabels isolationValueLabels_
pat::helper::KinResolutionsLoader resolutionLoader_
void readIsolationLabels(const edm::ParameterSet &iConfig, const char *psetName, IsolationLabels &labels)
static const HistoName names[]
std::vector< NameTag > elecIDSrcs_
PATElectronProducer::~PATElectronProducer ( )

Definition at line 160 of file PATElectronProducer.cc.

160  {
161 }

Member Function Documentation

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

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

607 {
609  iDesc.setComment("PAT electron producer module");
610 
611  // input source
612  iDesc.add<edm::InputTag>("electronSource", edm::InputTag("no default"))->setComment("input collection");
613 
614  // embedding
615  iDesc.add<bool>("embedGsfElectronCore", true)->setComment("embed external gsf electron core");
616  iDesc.add<bool>("embedGsfTrack", true)->setComment("embed external gsf track");
617  iDesc.add<bool>("embedSuperCluster", true)->setComment("embed external super cluster");
618  iDesc.add<bool>("embedTrack", false)->setComment("embed external track");
619 
620  // pf specific parameters
621  iDesc.add<edm::InputTag>("pfElectronSource", edm::InputTag("pfElectrons"))->setComment("particle flow input collection");
622  iDesc.add<bool>("useParticleFlow", false)->setComment("whether to use particle flow or not");
623  iDesc.add<bool>("embedPFCandidate", false)->setComment("embed external particle flow object");
624 
625  // MC matching configurables
626  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
627  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
628  std::vector<edm::InputTag> emptySourceVector;
629  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
630  edm::ParameterDescription<std::vector<edm::InputTag> >("genParticleMatch", emptySourceVector, true)
631  )->setComment("input with MC match information");
632 
633  // electron ID configurables
634  iDesc.add<bool>("addElectronID",true)->setComment("add electron ID variables");
635  edm::ParameterSetDescription electronIDSourcesPSet;
636  electronIDSourcesPSet.setAllowAnything();
637  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("electronIDSource", edm::InputTag(), true) xor
638  edm::ParameterDescription<edm::ParameterSetDescription>("electronIDSources", electronIDSourcesPSet, true)
639  )->setComment("input with electron ID variables");
640 
641 
642  // IsoDeposit configurables
643  edm::ParameterSetDescription isoDepositsPSet;
644  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
645  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
646  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
647  isoDepositsPSet.addOptional<edm::InputTag>("pfAllParticles");
648  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadrons");
649  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
650  isoDepositsPSet.addOptional<edm::InputTag>("pfPhotons");
651  isoDepositsPSet.addOptional<std::vector<edm::InputTag> >("user");
652  iDesc.addOptional("isoDeposits", isoDepositsPSet);
653 
654  // isolation values configurables
655  edm::ParameterSetDescription isolationValuesPSet;
656  isolationValuesPSet.addOptional<edm::InputTag>("tracker");
657  isolationValuesPSet.addOptional<edm::InputTag>("ecal");
658  isolationValuesPSet.addOptional<edm::InputTag>("hcal");
659  isolationValuesPSet.addOptional<edm::InputTag>("pfAllParticles");
660  isolationValuesPSet.addOptional<edm::InputTag>("pfChargedHadrons");
661  isolationValuesPSet.addOptional<edm::InputTag>("pfNeutralHadrons");
662  isolationValuesPSet.addOptional<edm::InputTag>("pfPhotons");
663  isolationValuesPSet.addOptional<std::vector<edm::InputTag> >("user");
664  iDesc.addOptional("isolationValues", isolationValuesPSet);
665 
666  // Efficiency configurables
667  edm::ParameterSetDescription efficienciesPSet;
668  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
669  iDesc.add("efficiencies", efficienciesPSet);
670  iDesc.add<bool>("addEfficiencies", false);
671 
672  // Check to see if the user wants to add user data
673  edm::ParameterSetDescription userDataPSet;
675  iDesc.addOptional("userData", userDataPSet);
676 
677  // electron shapes
678  iDesc.add<bool>("addElectronShapes", true);
679  iDesc.add<edm::InputTag>("reducedBarrelRecHitCollection", edm::InputTag("reducedEcalRecHitsEB"));
680  iDesc.add<edm::InputTag>("reducedEndcapRecHitCollection", edm::InputTag("reducedEcalRecHitsEE"));
681 
682  edm::ParameterSetDescription isolationPSet;
683  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
684  iDesc.add("userIsolation", isolationPSet);
685 
686  // Resolution configurables
688 
689  iDesc.add<bool>("embedHighLevelSelection", true)->setComment("embed high level selection");
690  edm::ParameterSetDescription highLevelPSet;
691  highLevelPSet.setAllowAnything();
692  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("beamLineSrc", edm::InputTag(), true)
693  )->setComment("input with high level selection");
695  )->setComment("input with high level selection");
696  iDesc.addNode( edm::ParameterDescription<bool>("usePV", bool(), true)
697  )->setComment("input with high level selection, use primary vertex (true) or beam line (false)");
698 
699  descriptions.add("PATElectronProducer", iDesc);
700 
701 }
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)
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 IsolationValueMaps isolationValues 
) const
private

common electron filling, for both the standard and PF2PAT case

Definition at line 445 of file PATElectronProducer.cc.

References addGenMatch_, pat::PATObject< ObjectType >::addGenParticleRef(), efficiencyLoader_, embedGenMatch_, pat::PATObject< ObjectType >::embedGenParticle(), pat::Electron::embedGsfElectronCore(), embedGsfElectronCore_, pat::Electron::embedGsfTrack(), embedGsfTrack_, pat::Electron::embedSuperCluster(), embedSuperCluster_, pat::Electron::embedTrack(), embedTrack_, pat::helper::EfficiencyLoader::enabled(), pat::helper::KinResolutionsLoader::enabled(), first, i, edm::Ref< C, T, F >::isNull(), isoDepositLabels_, isolationValueLabels_, j, n, pat::Electron::pfCandidateRef(), resolutionLoader_, pat::helper::EfficiencyLoader::setEfficiencies(), pat::Lepton< LeptonType >::setIsoDeposit(), pat::Lepton< LeptonType >::setIsolation(), pat::helper::KinResolutionsLoader::setResolutions(), LaserTracksInput_cfi::source, and useParticleFlow_.

Referenced by produce().

451  {
452 
453  //COLIN: might want to use the PFCandidate 4-mom. Which one is in use now?
454  // if (useParticleFlow_)
455  // aMuon.setP4( aMuon.pfCandidateRef()->p4() );
456 
457  //COLIN:
458  //In the embedding case, the reference cannot be used to look into a value map.
459  //therefore, one has to had the PFCandidateRef to this function, which becomes a bit
460  //too much specific.
461 
462  // in fact, this function needs a baseref or ptr for genmatch
463  // and a baseref or ptr for isodeposits and isolationvalues.
464  // baseref is not needed
465  // the ptrForIsolation and ptrForMatching should be defined upstream.
466 
467  // is the concrete elecRef needed for the efficiency loader? what is this loader?
468  // how can we make it compatible with the particle flow electrons?
469 
470  if (embedGsfElectronCore_) anElectron.embedGsfElectronCore();
471  if (embedGsfTrack_) anElectron.embedGsfTrack();
472  if (embedSuperCluster_) anElectron.embedSuperCluster();
473  if (embedTrack_) anElectron.embedTrack();
474 
475  // store the match to the generated final state muons
476  if (addGenMatch_) {
477  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
478  if(useParticleFlow_) {
479  reco::GenParticleRef genElectron = (*genMatches[i])[anElectron.pfCandidateRef()];
480  anElectron.addGenParticleRef(genElectron);
481  }
482  else {
483  reco::GenParticleRef genElectron = (*genMatches[i])[elecRef];
484  anElectron.addGenParticleRef(genElectron);
485  }
486  }
487  if (embedGenMatch_) anElectron.embedGenParticle();
488  }
489 
490  if (efficiencyLoader_.enabled()) {
491  efficiencyLoader_.setEfficiencies( anElectron, elecRef );
492  }
493 
494  if (resolutionLoader_.enabled()) {
495  resolutionLoader_.setResolutions(anElectron);
496  }
497 
498  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
499  if(useParticleFlow_) {
500 
501  reco::PFCandidateRef pfcandref = anElectron.pfCandidateRef();
502  assert(!pfcandref.isNull());
503  reco::CandidatePtr source = pfcandref->sourceCandidatePtr(0);
504  anElectron.setIsoDeposit(isoDepositLabels_[j].first,
505  (*deposits[j])[source]);
506  }
507  else
508  anElectron.setIsoDeposit(isoDepositLabels_[j].first,
509  (*deposits[j])[elecRef]);
510  }
511 
512  for (size_t j = 0; j<isolationValues.size(); ++j) {
513  if(useParticleFlow_) {
514  reco::CandidatePtr source = anElectron.pfCandidateRef()->sourceCandidatePtr(0);
515  anElectron.setIsolation(isolationValueLabels_[j].first,
516  (*isolationValues[j])[source]);
517  }
518  else
519  anElectron.setIsolation(isolationValueLabels_[j].first,
520  (*isolationValues[j])[elecRef]);
521  }
522 
523 
524 
525 }
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
int i
Definition: DBlmapReader.cc:9
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:244
int j
Definition: DBlmapReader.cc:9
bool first
Definition: L1TdeRCT.cc:79
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.
bool useParticleFlow_
pflow specific
IsolationLabels isolationValueLabels_
pat::helper::KinResolutionsLoader resolutionLoader_
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 527 of file PATElectronProducer.cc.

References addGenMatch_, pat::PATObject< ObjectType >::addGenParticleRef(), edm::contains(), pat::EcalIso, efficiencyLoader_, embedGenMatch_, pat::PATObject< ObjectType >::embedGenParticle(), pat::Electron::embedGsfElectronCore(), embedGsfElectronCore_, pat::Electron::embedGsfTrack(), embedGsfTrack_, pat::Electron::embedSuperCluster(), embedSuperCluster_, pat::Electron::embedTrack(), embedTrack_, pat::helper::EfficiencyLoader::enabled(), pat::helper::KinResolutionsLoader::enabled(), first, pat::HcalIso, i, edm::Ptr< T >::id(), isoDepositLabels_, isolationValueLabels_, j, n, reco::LeafCandidate::p4(), pat::Electron::pfCandidateRef(), resolutionLoader_, pat::Electron::setEcalDrivenMomentum(), pat::helper::EfficiencyLoader::setEfficiencies(), pat::Lepton< LeptonType >::setIsoDeposit(), pat::Lepton< LeptonType >::setIsolation(), reco::GsfElectron::setMva(), reco::LeafCandidate::setP4(), pat::helper::KinResolutionsLoader::setResolutions(), and pat::TrackIso.

Referenced by produce().

533  {
534 
535  //COLIN/Florian: use the PFCandidate 4-mom.
536  anElectron.setEcalDrivenMomentum(anElectron.p4()) ;
537  anElectron.setP4( anElectron.pfCandidateRef()->p4() );
538  // Safer to take the mva from the PFCandidate in case of ambiguosity
539  anElectron.setMva( anElectron.pfCandidateRef()->mva_e_pi() );
540 
541  // is the concrete elecRef needed for the efficiency loader? what is this loader?
542  // how can we make it compatible with the particle flow electrons?
543 
545  if (embedGsfTrack_) anElectron.embedGsfTrack();
546  if (embedSuperCluster_) anElectron.embedSuperCluster();
547  if (embedTrack_) anElectron.embedTrack();
548 
549  // store the match to the generated final state muons
550 
551  if (addGenMatch_) {
552  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
553  reco::GenParticleRef genElectron = (*genMatches[i])[candPtrForGenMatch];
554  anElectron.addGenParticleRef(genElectron);
555  }
556  if (embedGenMatch_) anElectron.embedGenParticle();
557  }
558 
559  //COLIN what's this? does it have to be GsfElectron specific?
560  if (efficiencyLoader_.enabled()) {
561  efficiencyLoader_.setEfficiencies( anElectron, candPtrForLoader );
562  }
563 
564  if (resolutionLoader_.enabled()) {
565  resolutionLoader_.setResolutions(anElectron);
566  }
567 
568  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
572 
574  (*deposits[j])[candPtrForGenMatch]);
575  }
576  else if (deposits[j]->contains(candPtrForIsolation.id())) {
577  anElectron.setIsoDeposit(isoDepositLabels_[j].first,
578  (*deposits[j])[candPtrForIsolation]);
579  }
580  else {
581  anElectron.setIsoDeposit(isoDepositLabels_[j].first,
582  (*deposits[j])[candPtrForIsolation->sourceCandidatePtr(0)]);
583  }
584  }
585 
586  for (size_t j = 0; j<isolationValues.size(); ++j) {
587  if( isolationValueLabels_[j].first==pat::TrackIso ||
590  anElectron.setIsolation(isolationValueLabels_[j].first,
591  (*isolationValues[j])[candPtrForGenMatch]);
592  }
593  else if (isolationValues[j]->contains(candPtrForIsolation.id())) {
594  anElectron.setIsolation(isolationValueLabels_[j].first,
595  (*isolationValues[j])[candPtrForIsolation]);
596  }
597  else {
598  anElectron.setIsolation(isolationValueLabels_[j].first,
599  (*isolationValues[j])[candPtrForIsolation->sourceCandidatePtr(0)]);
600  }
601  }
602 }
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
int i
Definition: DBlmapReader.cc:9
void embedTrack()
method to store the electron&#39;s Track internally
Definition: Electron.cc:149
void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:99
void embedGsfElectronCore()
method to store the electron&#39;s core internally
Definition: Electron.cc:120
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
void embedSuperCluster()
method to store the electron&#39;s SuperCluster internally
Definition: Electron.cc:139
virtual void setP4(const LorentzVector &p4)
set 4-momentum
void setEcalDrivenMomentum(const Candidate::LorentzVector &mom)
Definition: Electron.h:152
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
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:173
void embedGenParticle()
Definition: PATObject.h:665
ProductID id() const
Accessor for product ID.
Definition: Ptr.h:168
int j
Definition: DBlmapReader.cc:9
reco::PFCandidateRef pfCandidateRef() const
reference to the source PFCandidates
Definition: Electron.cc:181
bool first
Definition: L1TdeRCT.cc:79
void embedGsfTrack()
method to store the electron&#39;s GsfTrack internally
Definition: Electron.cc:129
void addGenParticleRef(const reco::GenParticleRef &ref)
Definition: PATObject.h:649
pat::helper::EfficiencyLoader efficiencyLoader_
void setMva(float mva)
Definition: GsfElectron.h:506
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
IsolationLabels isolationValueLabels_
pat::helper::KinResolutionsLoader resolutionLoader_
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
void PATElectronProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 164 of file PATElectronProducer.cc.

References IPTools::absoluteTransverseImpactParameter(), addElecID_, addGenMatch_, beamLineSrc_, ExpressReco_HICollisions_FallBack::beamSpot, pat::helper::MultiIsolator::beginEvent(), ExpressReco_HICollisions_FallBack::deposits, efficiencyLoader_, elecIDSrcs_, electronSrc_, embedGenMatch_, embedHighLevelSelection_, pat::Electron::embedPFCandidate(), embedPFCandidate_, pat::helper::EfficiencyLoader::enabled(), pat::helper::KinResolutionsLoader::enabled(), pat::helper::MultiIsolator::enabled(), pat::helper::MultiIsolator::endEvent(), pat::helper::MultiIsolator::fill(), fillElectron(), fillElectron2(), first, genMatchSrc_, edm::EventSetup::get(), edm::Event::getByLabel(), i, getHLTprescales::index, edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), isoDepositLabels_, isolationValueLabels_, isolator_, isolatorTmpStorage_, edm::EventBase::isRealData(), edm::HandleBase::isValid(), j, reco::Matched, pat::helper::EfficiencyLoader::newEvent(), pat::helper::KinResolutionsLoader::newEvent(), electronProducer_cfi::patElectrons, pfElecSrc_, pTComparator_, edm::Event::put(), pvSrc_, resolutionLoader_, query::result, edm::second(), pat::Electron::setDB(), pat::Electron::setElectronIDs(), pat::Lepton< LeptonType >::setIsoDeposit(), pat::Lepton< LeptonType >::setIsolation(), pat::Electron::setPFCandidateRef(), python.multivaluedict::sort(), ExpressReco_HICollisions_FallBack::track, useParticleFlow_, usePV_, userDataHelper_, useUserData_, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

164  {
165 
166  // Get the collection of electrons from the event
168  iEvent.getByLabel(electronSrc_, electrons);
169 
170  if (iEvent.isRealData()){
171  addGenMatch_ = false;
172  embedGenMatch_ = false;
173  }
174 
175  // Get the ESHandle for the transient track builder, if needed for
176  // high level selection embedding
178 
179  if (isolator_.enabled()) isolator_.beginEvent(iEvent,iSetup);
180 
182  if (resolutionLoader_.enabled()) resolutionLoader_.newEvent(iEvent, iSetup);
183 
185  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
187  }
188 
189  IsolationValueMaps isolationValues(isolationValueLabels_.size());
190  for (size_t j = 0; j<isolationValueLabels_.size(); ++j) {
191  iEvent.getByLabel(isolationValueLabels_[j].second, isolationValues[j]);
192  }
193 
194  // prepare the MC matching
195  GenAssociations genMatches(genMatchSrc_.size());
196  if (addGenMatch_) {
197  for (size_t j = 0, nd = genMatchSrc_.size(); j < nd; ++j) {
198  iEvent.getByLabel(genMatchSrc_[j], genMatches[j]);
199  }
200  }
201 
202  // prepare ID extraction
203  std::vector<edm::Handle<edm::ValueMap<float> > > idhandles;
204  std::vector<pat::Electron::IdPair> ids;
205  if (addElecID_) {
206  idhandles.resize(elecIDSrcs_.size());
207  ids.resize(elecIDSrcs_.size());
208  for (size_t i = 0; i < elecIDSrcs_.size(); ++i) {
209  iEvent.getByLabel(elecIDSrcs_[i].second, idhandles[i]);
210  ids[i].first = elecIDSrcs_[i].first;
211  }
212  }
213 
214 
215  // prepare the high level selection:
216  // needs beamline
217  reco::TrackBase::Point beamPoint(0,0,0);
218  reco::Vertex primaryVertex;
219  if ( embedHighLevelSelection_ ) {
220  // Get the beamspot
222  edm::Handle<reco::BeamSpot> beamSpotHandle;
223  iEvent.getByLabel(beamLineSrc_, beamSpotHandle);
224 
225 
226  // Get the primary vertex
228  iEvent.getByLabel( pvSrc_, pvHandle );
229 
230  if ( ! usePV_ ) {
231  if ( beamSpotHandle.isValid() ){
232  beamSpot = *beamSpotHandle;
233  } else{
234  edm::LogError("DataNotAvailable")
235  << "No beam spot available from EventSetup, not adding high level selection \n";
236  }
237 
238  double x0 = beamSpot.x0();
239  double y0 = beamSpot.y0();
240  double z0 = beamSpot.z0();
241 
242  beamPoint = reco::TrackBase::Point ( x0, y0, z0 );
243  } else {
244  if ( pvHandle.isValid() ) {
245  primaryVertex = pvHandle->at(0);
246  } else {
247  edm::LogError("DataNotAvailable")
248  << "No primary vertex available from EventSetup, not adding high level selection \n";
249  }
250 
251  // This is needed by the IPTools methods from the tracking group
252  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", trackBuilder);
253  }
254  }
255 
256  std::vector<Electron> * patElectrons = new std::vector<Electron>();
257 
258  if( useParticleFlow_ ) {
260  iEvent.getByLabel(pfElecSrc_, pfElectrons);
261  unsigned index=0;
262 
263  for( reco::PFCandidateConstIterator i = pfElectrons->begin();
264  i != pfElectrons->end(); ++i, ++index) {
265 
266  reco::PFCandidateRef pfRef(pfElectrons, index);
267  reco::PFCandidatePtr ptrToPFElectron(pfElectrons,index);
268 // reco::CandidateBaseRef pfBaseRef( pfRef );
269 
270  reco::GsfTrackRef PfTk= i->gsfTrackRef();
271 
272  bool Matched=false;
273  bool MatchedToAmbiguousGsfTrack=false;
274  for (edm::View<reco::GsfElectron>::const_iterator itElectron = electrons->begin(); itElectron != electrons->end(); ++itElectron) {
275  unsigned int idx = itElectron - electrons->begin();
276  if (Matched || MatchedToAmbiguousGsfTrack) continue;
277 
278  reco::GsfTrackRef EgTk= itElectron->gsfTrack();
279 
280  if (itElectron->gsfTrack()==i->gsfTrackRef()){
281  Matched=true;
282  }
283  else {
284  for( reco::GsfTrackRefVector::const_iterator it = itElectron->ambiguousGsfTracksBegin() ;
285  it!=itElectron->ambiguousGsfTracksEnd(); it++ ){
286  MatchedToAmbiguousGsfTrack |= (bool)(i->gsfTrackRef()==(*it));
287  }
288  }
289 
290  if (Matched || MatchedToAmbiguousGsfTrack){
291 
292  // ptr needed for finding the matched gen particle
293  reco::CandidatePtr ptrToGsfElectron(electrons,idx);
294 
295  // ref to base needed for the construction of the pat object
296  const edm::RefToBase<reco::GsfElectron>& elecsRef = electrons->refAt(idx);
297  Electron anElectron(elecsRef);
298  anElectron.setPFCandidateRef( pfRef );
299 
300  if( embedPFCandidate_ ) anElectron.embedPFCandidate();
301 
302  if ( useUserData_ ) {
303  userDataHelper_.add( anElectron, iEvent, iSetup );
304  }
305 
306 
307  // embed high level selection
308  if ( embedHighLevelSelection_ ) {
309  // get the global track
310  reco::GsfTrackRef track = PfTk;
311 
312  // Make sure the collection it points to is there
313  if ( track.isNonnull() && track.isAvailable() ) {
314 
315  if ( !usePV_ ) {
316  double corr_d0 = track->dxy( beamPoint );
317  anElectron.setDB( corr_d0, -1.0 );
318  } else {
319  reco::TransientTrack tt = trackBuilder->build(track);
320  std::pair<bool,Measurement1D> result = IPTools::absoluteTransverseImpactParameter(tt, primaryVertex);
321  double d0_corr = result.second.value();
322  double d0_err = result.second.error();
323  anElectron.setDB( d0_corr, d0_err );
324  }
325  }
326  }
327 
328  //Electron Id
329 
330  if (addElecID_) {
331  //STANDARD EL ID
332  for (size_t i = 0; i < elecIDSrcs_.size(); ++i) {
333  ids[i].second = (*idhandles[i])[elecsRef];
334  }
335  //SPECIFIC PF ID
336  ids.push_back(std::make_pair("pf_evspi",pfRef->mva_e_pi()));
337  ids.push_back(std::make_pair("pf_evsmu",pfRef->mva_e_mu()));
338  anElectron.setElectronIDs(ids);
339  }
340 
341 // fillElectron(anElectron,elecsRef,pfBaseRef,
342 // genMatches, deposits, isolationValues);
343 
344  //COLIN small warning !
345  // we are currently choosing to take the 4-momentum of the PFCandidate;
346  // the momentum of the GsfElectron is saved though
347  // we must therefore match the GsfElectron.
348  // because of this, we should not change the source of the electron matcher
349  // to the collection of PFElectrons in the python configuration
350  // I don't know what to do with the efficiencyLoader, since I don't know
351  // what this class is for.
352  fillElectron2( anElectron,
353  ptrToPFElectron,
354  ptrToGsfElectron,
355  ptrToGsfElectron,
356  genMatches, deposits, isolationValues );
357 
358  //COLIN need to use fillElectron2 in the non-pflow case as well, and to test it.
359 
360  patElectrons->push_back(anElectron);
361  }
362  }
363  //if( !Matched && !MatchedToAmbiguousGsfTrack) std::cout << "!!!!A pf electron could not be matched to a gsf!!!!" << std::endl;
364  }
365  }
366 
367  else{
368  for (edm::View<reco::GsfElectron>::const_iterator itElectron = electrons->begin(); itElectron != electrons->end(); ++itElectron) {
369  // construct the Electron from the ref -> save ref to original object
370  unsigned int idx = itElectron - electrons->begin();
371  edm::RefToBase<reco::GsfElectron> elecsRef = electrons->refAt(idx);
372  reco::CandidateBaseRef elecBaseRef(elecsRef);
373  Electron anElectron(elecsRef);
374 
375  // add resolution info
376 
377  // Isolation
378  if (isolator_.enabled()) {
379  isolator_.fill(*electrons, idx, isolatorTmpStorage_);
380  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
381  // better to loop backwards, so the vector is resized less times
382  for (IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(), ed = isolatorTmpStorage_.rend(); it != ed; ++it) {
383  anElectron.setIsolation(it->first, it->second);
384  }
385  }
386 
387  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
388  anElectron.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[elecsRef]);
389  }
390 
391  // add electron ID info
392  if (addElecID_) {
393  for (size_t i = 0; i < elecIDSrcs_.size(); ++i) {
394  ids[i].second = (*idhandles[i])[elecsRef];
395  }
396  anElectron.setElectronIDs(ids);
397  }
398 
399 
400  if ( useUserData_ ) {
401  userDataHelper_.add( anElectron, iEvent, iSetup );
402  }
403 
404 
405  // embed high level selection
406  if ( embedHighLevelSelection_ ) {
407  // get the global track
408  reco::GsfTrackRef track = itElectron->gsfTrack();
409 
410  // Make sure the collection it points to is there
411  if ( track.isNonnull() && track.isAvailable() ) {
412 
413  if ( !usePV_ ) {
414  double corr_d0 = track->dxy( beamPoint );
415  anElectron.setDB( corr_d0, -1.0 );
416  } else {
417  reco::TransientTrack tt = trackBuilder->build(track);
418  std::pair<bool,Measurement1D> result = IPTools::absoluteTransverseImpactParameter(tt, primaryVertex);
419  double d0_corr = result.second.value();
420  double d0_err = result.second.error();
421  anElectron.setDB( d0_corr, d0_err );
422  }
423  }
424  }
425 
426  // add sel to selected
427  fillElectron( anElectron, elecsRef,elecBaseRef,
428  genMatches, deposits, isolationValues);
429  patElectrons->push_back(anElectron);
430  }
431  }
432 
433  // sort electrons in pt
434  std::sort(patElectrons->begin(), patElectrons->end(), pTComparator_);
435 
436  // add the electrons to the event output
437  std::auto_ptr<std::vector<Electron> > ptr(patElectrons);
438  iEvent.put(ptr);
439 
440  // clean up
442 
443 }
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
double z0() const
z coordinate
Definition: BeamSpot.h:69
int i
Definition: DBlmapReader.cc:9
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
void fillElectron(Electron &aElectron, const ElectronBaseRef &electronRef, const reco::CandidateBaseRef &baseRef, const GenAssociations &genMatches, const IsoDepositMaps &deposits, const IsolationValueMaps &isolationValues) const
common electron filling, for both the standard and PF2PAT case
bool isAvailable() const
Definition: Ref.h:278
PFCandidateCollection::const_iterator PFCandidateConstIterator
iterator
bool isRealData() const
Definition: EventBase.h:60
std::vector< edm::InputTag > genMatchSrc_
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
U second(std::pair< T, U > const &p)
bool enabled() const
True if it has a non null configuration.
Definition: MultiIsolator.h:50
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:248
GreaterByPt< Electron > pTComparator_
pat::helper::MultiIsolator isolator_
std::vector< edm::Handle< edm::Association< reco::GenParticleCollection > > > GenAssociations
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
tuple result
Definition: query.py:137
int j
Definition: DBlmapReader.cc:9
math::XYZPoint Point
point in the space
Definition: TrackBase.h:75
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
bool embedHighLevelSelection_
embed high level selection variables?
bool first
Definition: L1TdeRCT.cc:79
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
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
pat::helper::EfficiencyLoader efficiencyLoader_
const T & get() const
Definition: EventSetup.h:55
pat::PATUserDataHelper< pat::Electron > userDataHelper_
bool useParticleFlow_
pflow specific
Analysis-level electron class.
Definition: Electron.h:46
std::pair< bool, Measurement1D > absoluteTransverseImpactParameter(const reco::TransientTrack &transientTrack, const reco::Vertex &vertex)
Definition: IPTools.cc:43
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
Definition: MultiIsolator.h:16
IsolationLabels isolationValueLabels_
double y0() const
y coordinate
Definition: BeamSpot.h:67
pat::helper::KinResolutionsLoader resolutionLoader_
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
void newEvent(const edm::Event &event, const edm::EventSetup &setup) const
To be called for each new event, reads in the EventSetup object.
void newEvent(const edm::Event &event) const
To be called for each new event, reads in the ValueMaps for efficiencies.
std::vector< NameTag > elecIDSrcs_
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
Definition: MultiIsolator.h:82
double x0() const
x coordinate
Definition: BeamSpot.h:65
std::vector< edm::Handle< edm::ValueMap< IsoDeposit > > > IsoDepositMaps
void PATElectronProducer::readIsolationLabels ( const edm::ParameterSet iConfig,
const char *  psetName,
IsolationLabels labels 
)
private

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

Definition at line 705 of file PATElectronProducer.cc.

References pat::EcalIso, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), pat::HcalIso, combine::key, pat::PfAllParticleIso, pat::PfChargedHadronIso, pat::PfGammaIso, pat::PfNeutralHadronIso, pat::TrackIso, and pat::UserBaseIso.

Referenced by PATElectronProducer().

707  {
708 
709  labels.clear();
710 
711  if (iConfig.exists( psetName )) {
712  edm::ParameterSet depconf
713  = iConfig.getParameter<edm::ParameterSet>(psetName);
714 
715  if (depconf.exists("tracker")) labels.push_back(std::make_pair(pat::TrackIso, depconf.getParameter<edm::InputTag>("tracker")));
716  if (depconf.exists("ecal")) labels.push_back(std::make_pair(pat::EcalIso, depconf.getParameter<edm::InputTag>("ecal")));
717  if (depconf.exists("hcal")) labels.push_back(std::make_pair(pat::HcalIso, depconf.getParameter<edm::InputTag>("hcal")));
718  if (depconf.exists("pfAllParticles")) {
719  labels.push_back(std::make_pair(pat::PfAllParticleIso, depconf.getParameter<edm::InputTag>("pfAllParticles")));
720  }
721  if (depconf.exists("pfChargedHadrons")) {
722  labels.push_back(std::make_pair(pat::PfChargedHadronIso, depconf.getParameter<edm::InputTag>("pfChargedHadrons")));
723  }
724  if (depconf.exists("pfNeutralHadrons")) {
725  labels.push_back(std::make_pair(pat::PfNeutralHadronIso, depconf.getParameter<edm::InputTag>("pfNeutralHadrons")));
726  }
727  if (depconf.exists("pfPhotons")) {
728  labels.push_back(std::make_pair(pat::PfGammaIso, depconf.getParameter<edm::InputTag>("pfPhotons")));
729  }
730  if (depconf.exists("user")) {
731  std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag> >("user");
732  std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
733  int key = UserBaseIso;
734  for ( ; it != ed; ++it, ++key) {
735  labels.push_back(std::make_pair(IsolationKeys(key), *it));
736  }
737  }
738  }
739 
740 
741 }
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
tuple labels
Definition: L1TDQM_cfg.py:62
list key
Definition: combine.py:13

Member Data Documentation

bool pat::PATElectronProducer::addEfficiencies_
private

Definition at line 129 of file PATElectronProducer.h.

Referenced by PATElectronProducer().

bool pat::PATElectronProducer::addElecID_
private

Definition at line 117 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

bool pat::PATElectronProducer::addGenMatch_
private

Definition at line 71 of file PATElectronProducer.h.

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

bool pat::PATElectronProducer::addResolutions_
private

Definition at line 132 of file PATElectronProducer.h.

Referenced by PATElectronProducer().

edm::InputTag pat::PATElectronProducer::beamLineSrc_
private

Definition at line 82 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 130 of file PATElectronProducer.h.

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

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

Definition at line 119 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

edm::InputTag pat::PATElectronProducer::electronSrc_
private

Definition at line 66 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

bool pat::PATElectronProducer::embedGenMatch_
private

Definition at line 72 of file PATElectronProducer.h.

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

bool pat::PATElectronProducer::embedGsfElectronCore_
private

Definition at line 67 of file PATElectronProducer.h.

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

bool pat::PATElectronProducer::embedGsfTrack_
private

Definition at line 68 of file PATElectronProducer.h.

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

bool pat::PATElectronProducer::embedHighLevelSelection_
private

embed high level selection variables?

Definition at line 81 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

bool pat::PATElectronProducer::embedPFCandidate_
private

Definition at line 78 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

bool pat::PATElectronProducer::embedSuperCluster_
private

Definition at line 69 of file PATElectronProducer.h.

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

bool pat::PATElectronProducer::embedTrack_
private

Definition at line 70 of file PATElectronProducer.h.

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

std::vector<edm::InputTag> pat::PATElectronProducer::genMatchSrc_
private

Definition at line 73 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

IsolationLabels pat::PATElectronProducer::isoDepositLabels_
private

Definition at line 126 of file PATElectronProducer.h.

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

IsolationLabels pat::PATElectronProducer::isolationValueLabels_
private

Definition at line 127 of file PATElectronProducer.h.

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

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

Definition at line 124 of file PATElectronProducer.h.

Referenced by produce().

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

Definition at line 125 of file PATElectronProducer.h.

Referenced by produce().

edm::InputTag pat::PATElectronProducer::pfElecSrc_
private

Definition at line 77 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 122 of file PATElectronProducer.h.

Referenced by produce().

edm::InputTag pat::PATElectronProducer::pvSrc_
private

Definition at line 84 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 133 of file PATElectronProducer.h.

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

bool pat::PATElectronProducer::useParticleFlow_
private

pflow specific

Definition at line 76 of file PATElectronProducer.h.

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

bool pat::PATElectronProducer::usePV_
private

Definition at line 83 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

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

Definition at line 136 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().

bool pat::PATElectronProducer::useUserData_
private

Definition at line 135 of file PATElectronProducer.h.

Referenced by PATElectronProducer(), and produce().