CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
PFElectronTranslator Class Reference

#include <PFElectronTranslator.h>

Inheritance diagram for PFElectronTranslator:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef std::vector
< edm::Handle< edm::ValueMap
< double > > > 
IsolationValueMaps
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

 PFElectronTranslator (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 ~PFElectronTranslator ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

const reco::PFCandidatecorrespondingDaughterCandidate (const reco::PFCandidate &cand, const reco::PFBlockElement &pfbe) const
 
void createBasicCluster (const reco::PFBlockElement &, reco::BasicClusterCollection &basicClusters, std::vector< const reco::PFCluster * > &, const reco::PFCandidate &coCandidate) const
 
void createBasicClusterPtrs (const edm::OrphanHandle< reco::BasicClusterCollection > &basicClustersHandle)
 
void createGsfElectronCoreRefs (const edm::OrphanHandle< reco::GsfElectronCoreCollection > &gsfElectronCoreHandle)
 
void createGsfElectronCores (reco::GsfElectronCoreCollection &) const
 
void createGsfElectrons (const reco::PFCandidateCollection &, const IsolationValueMaps &isolationValues, reco::GsfElectronCollection &)
 
void createPreshowerCluster (const reco::PFBlockElement &PFBE, reco::PreshowerClusterCollection &preshowerClusters, unsigned plane) const
 
void createPreshowerClusterPtrs (const edm::OrphanHandle< reco::PreshowerClusterCollection > &preshowerClustersHandle)
 
void createSuperClusterGsfMapRefs (const edm::OrphanHandle< reco::SuperClusterCollection > &superClustersHandle)
 
void createSuperClusters (const reco::PFCandidateCollection &, reco::SuperClusterCollection &superClusters) const
 
bool fetchCandidateCollection (edm::Handle< reco::PFCandidateCollection > &c, const edm::InputTag &tag, const edm::Event &iEvent) const
 
void fetchGsfCollection (edm::Handle< reco::GsfTrackCollection > &c, const edm::InputTag &tag, const edm::Event &iEvent) const
 
void fillMVAValueMap (edm::Event &iEvent, edm::ValueMap< float >::Filler &filler)
 
void fillSCRefValueMap (edm::Event &iEvent, edm::ValueMap< reco::SuperClusterRef >::Filler &filler) const
 
void fillValueMap (edm::Event &iEvent, edm::ValueMap< float >::Filler &filler) const
 
void getAmbiguousGsfTracks (const reco::PFBlockElement &PFBE, std::vector< reco::GsfTrackRef > &) const
 

Private Attributes

std::vector< std::vector
< reco::GsfTrackRef > > 
ambiguousGsfTracks_
 
std::vector
< reco::CaloClusterPtrVector
basicClusterPtr_
 
std::vector
< reco::BasicClusterCollection
basicClusters_
 
std::vector< reco::CandidatePtrCandidatePtr_
 
bool checkStatusFlag_
 
bool emptyIsOk_
 
std::string GsfElectronCollection_
 
std::string GsfElectronCoreCollection_
 
std::vector
< reco::GsfElectronCoreRef
gsfElectronCoreRefs_
 
std::map< reco::GsfTrackRef,
float > 
gsfMvaMap_
 
std::vector< int > gsfPFCandidateIndex_
 
std::vector< reco::GsfTrackRefGsfTrackRef_
 
edm::InputTag inputTagGSFTracks_
 
std::vector< edm::InputTaginputTagIsoVals_
 
edm::InputTag inputTagPFCandidateElectrons_
 
edm::InputTag inputTagPFCandidates_
 
std::vector< reco::TrackRefkfTrackRef_
 
double MVACut_
 
std::string PFBasicClusterCollection_
 
std::vector< std::vector
< const reco::PFCluster * > > 
pfClusters_
 
std::string PFMVAValueMap_
 
std::string PFPreshowerClusterCollection_
 
std::string PFSCValueMap_
 
std::string PFSuperClusterCollection_
 
std::vector
< reco::CaloClusterPtrVector
preshowerClusterPtr_
 
std::vector
< reco::PreshowerClusterCollection
preshowerClusters_
 
std::map< reco::GsfTrackRef,
reco::SuperClusterRef
scMap_
 
std::vector
< reco::SuperClusterCollection
superClusters_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

Definition at line 23 of file PFElectronTranslator.h.

Member Typedef Documentation

Definition at line 31 of file PFElectronTranslator.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file PFElectronTranslator.cc.

References checkStatusFlag_, emptyIsOk_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), GsfElectronCollection_, GsfElectronCoreCollection_, inputTagGSFTracks_, inputTagIsoVals_, inputTagPFCandidateElectrons_, inputTagPFCandidates_, MVACut_, PFBasicClusterCollection_, PFMVAValueMap_, PFPreshowerClusterCollection_, PFSCValueMap_, PFSuperClusterCollection_, and AlCaHLTBitMon_QueryRunRegistry::string.

22  {
24  = iConfig.getParameter<edm::InputTag>("PFCandidate");
26  = iConfig.getParameter<edm::InputTag>("PFCandidateElectron");
28  = iConfig.getParameter<edm::InputTag>("GSFTracks");
29 
30  bool useIsolationValues = iConfig.getParameter<bool>("useIsolationValues") ;
31  if ( useIsolationValues ) {
32  if( ! iConfig.exists("isolationValues") )
33  throw cms::Exception("PFElectronTranslator|InternalError")
34  <<"Missing ParameterSet isolationValues" ;
35  else {
36  edm::ParameterSet isoVals =
37  iConfig.getParameter<edm::ParameterSet> ("isolationValues");
38  inputTagIsoVals_.push_back
39  (isoVals.getParameter<edm::InputTag>("pfChargedHadrons"));
40  inputTagIsoVals_.push_back
41  (isoVals.getParameter<edm::InputTag>("pfPhotons"));
42  inputTagIsoVals_.push_back
43  (isoVals.getParameter<edm::InputTag>("pfNeutralHadrons"));
44  }
45  }
46 
47  PFBasicClusterCollection_ = iConfig.getParameter<std::string>("PFBasicClusters");
48  PFPreshowerClusterCollection_ = iConfig.getParameter<std::string>("PFPreshowerClusters");
49  PFSuperClusterCollection_ = iConfig.getParameter<std::string>("PFSuperClusters");
50  GsfElectronCoreCollection_ = iConfig.getParameter<std::string>("PFGsfElectronCore");
51  GsfElectronCollection_ = iConfig.getParameter<std::string>("PFGsfElectron");
52 
53  PFMVAValueMap_ = iConfig.getParameter<std::string>("ElectronMVA");
54  PFSCValueMap_ = iConfig.getParameter<std::string>("ElectronSC");
55  MVACut_ = (iConfig.getParameter<edm::ParameterSet>("MVACutBlock")).getParameter<double>("MVACut");
56  checkStatusFlag_ = iConfig.getParameter<bool>("CheckStatusFlag");
57 
58  if (iConfig.exists("emptyIsOk")) emptyIsOk_ = iConfig.getParameter<bool>("emptyIsOk");
59  else emptyIsOk_=false;
60 
61  produces<reco::BasicClusterCollection>(PFBasicClusterCollection_);
62  produces<reco::PreshowerClusterCollection>(PFPreshowerClusterCollection_);
63  produces<reco::SuperClusterCollection>(PFSuperClusterCollection_);
64  produces<reco::GsfElectronCoreCollection>(GsfElectronCoreCollection_);
65  produces<reco::GsfElectronCollection>(GsfElectronCollection_);
66  produces<edm::ValueMap<float> >(PFMVAValueMap_);
67  produces<edm::ValueMap<reco::SuperClusterRef> >(PFSCValueMap_);
68 }
T getParameter(std::string const &) const
std::string PFPreshowerClusterCollection_
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::string GsfElectronCollection_
edm::InputTag inputTagPFCandidateElectrons_
edm::InputTag inputTagPFCandidates_
edm::InputTag inputTagGSFTracks_
std::string PFBasicClusterCollection_
std::string GsfElectronCoreCollection_
std::vector< edm::InputTag > inputTagIsoVals_
std::string PFSuperClusterCollection_
PFElectronTranslator::~PFElectronTranslator ( )

Definition at line 70 of file PFElectronTranslator.cc.

70 {}

Member Function Documentation

const reco::PFCandidate & PFElectronTranslator::correspondingDaughterCandidate ( const reco::PFCandidate cand,
const reco::PFBlockElement pfbe 
) const
private

Definition at line 532 of file PFElectronTranslator.cc.

References reco::CompositeCandidate::begin(), reco::PFCandidate::elementsInBlocks(), reco::CompositeCandidate::end(), and reco::PFBlockElement::index().

Referenced by produce().

533 {
534  unsigned refindex=pfbe.index();
535  // std::cout << " N daughters " << cand.numberOfDaughters() << std::endl;
536  reco::PFCandidate::const_iterator myDaughterCandidate=cand.begin();
538 
539  for(;myDaughterCandidate!=itend;++myDaughterCandidate)
540  {
541  const reco::PFCandidate * myPFCandidate = (const reco::PFCandidate*)&*myDaughterCandidate;
542  if(myPFCandidate->elementsInBlocks().size()!=1)
543  {
544  // std::cout << " Daughter with " << myPFCandidate.elementsInBlocks().size()<< " element in block " << std::endl;
545  return cand;
546  }
547  if(myPFCandidate->elementsInBlocks()[0].second==refindex)
548  {
549  // std::cout << " Found it " << cand << std::endl;
550  return *myPFCandidate;
551  }
552  }
553  return cand;
554 }
virtual const_iterator end() const
last daughter const_iterator
const ElementsInBlocks & elementsInBlocks() const
Definition: PFCandidate.h:365
unsigned index() const
virtual const_iterator begin() const
first daughter const_iterator
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:35
void PFElectronTranslator::createBasicCluster ( const reco::PFBlockElement PFBE,
reco::BasicClusterCollection basicClusters,
std::vector< const reco::PFCluster * > &  pfClusters,
const reco::PFCandidate coCandidate 
) const
private

Definition at line 289 of file PFElectronTranslator.cc.

References reco::CaloCluster::algo(), reco::CaloCluster::caloID(), reco::PFBlockElement::clusterRef(), reco::CaloCluster::hitsAndFractions(), edm::Ref< C, T, F >::isNull(), reco::CaloCluster::position(), reco::PFCandidate::rawEcalEnergy(), and reco::CaloCluster::seed().

Referenced by produce().

293 {
294  reco::PFClusterRef myPFClusterRef= PFBE.clusterRef();
295  if(myPFClusterRef.isNull()) return;
296 
297  const reco::PFCluster & myPFCluster (*myPFClusterRef);
298  pfClusters.push_back(&myPFCluster);
299 // std::cout << " Creating BC " << myPFCluster.energy() << " " << coCandidate.ecalEnergy() <<" "<< coCandidate.rawEcalEnergy() <<std::endl;
300 // std::cout << " # hits " << myPFCluster.hitsAndFractions().size() << std::endl;
301 
302 // basicClusters.push_back(reco::CaloCluster(myPFCluster.energy(),
303  basicClusters.push_back(reco::CaloCluster(
304  // myPFCluster.energy(),
305  coCandidate.rawEcalEnergy(),
306  myPFCluster.position(),
307  myPFCluster.caloID(),
308  myPFCluster.hitsAndFractions(),
309  myPFCluster.algo(),
310  myPFCluster.seed()));
311 }
double rawEcalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:199
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
bool isNull() const
Checks for null.
Definition: Ref.h:247
virtual PFClusterRef clusterRef() const
void PFElectronTranslator::createBasicClusterPtrs ( const edm::OrphanHandle< reco::BasicClusterCollection > &  basicClustersHandle)
private

Definition at line 321 of file PFElectronTranslator.cc.

References basicClusterPtr_, basicClusters_, GsfTrackRef_, and findQualityFiles::size.

Referenced by produce().

322 {
323  unsigned size=GsfTrackRef_.size();
324  unsigned basicClusterCounter=0;
325  basicClusterPtr_.resize(size);
326 
327  for(unsigned iGSF=0;iGSF<size;++iGSF) // loop on tracks
328  {
329  unsigned nbc=basicClusters_[iGSF].size();
330  for(unsigned ibc=0;ibc<nbc;++ibc) // loop on basic clusters
331  {
332  // std::cout << "Track "<< iGSF << " ref " << basicClusterCounter << std::endl;
333  reco::CaloClusterPtr bcPtr(basicClustersHandle,basicClusterCounter);
334  basicClusterPtr_[iGSF].push_back(bcPtr);
335  ++basicClusterCounter;
336  }
337  }
338 }
std::vector< reco::CaloClusterPtrVector > basicClusterPtr_
std::vector< reco::GsfTrackRef > GsfTrackRef_
std::vector< reco::BasicClusterCollection > basicClusters_
tuple size
Write out results.
void PFElectronTranslator::createGsfElectronCoreRefs ( const edm::OrphanHandle< reco::GsfElectronCoreCollection > &  gsfElectronCoreHandle)
private

Definition at line 570 of file PFElectronTranslator.cc.

References gsfElectronCoreRefs_, GsfTrackRef_, and findQualityFiles::size.

Referenced by produce().

570  {
571  unsigned size=GsfTrackRef_.size();
572 
573  for(unsigned iGSF=0;iGSF<size;++iGSF) // loop on tracks
574  {
575  edm::Ref<reco::GsfElectronCoreCollection> elecCoreRef(gsfElectronCoreHandle,iGSF);
576  gsfElectronCoreRefs_.push_back(elecCoreRef);
577  }
578 }
std::vector< reco::GsfElectronCoreRef > gsfElectronCoreRefs_
std::vector< reco::GsfTrackRef > GsfTrackRef_
tuple size
Write out results.
void PFElectronTranslator::createGsfElectronCores ( reco::GsfElectronCoreCollection gsfElectronCores) const
private

Definition at line 556 of file PFElectronTranslator.cc.

References GsfTrackRef_, kfTrackRef_, scMap_, reco::GsfElectronCore::setCtfTrack(), and reco::GsfElectronCore::setPflowSuperCluster().

Referenced by produce().

556  {
557  unsigned nGSF=GsfTrackRef_.size();
558  for(unsigned iGSF=0;iGSF<nGSF;++iGSF)
559  {
560  reco::GsfElectronCore myElectronCore(GsfTrackRef_[iGSF]);
561  myElectronCore.setCtfTrack(kfTrackRef_[iGSF],-1.);
562  std::map<reco::GsfTrackRef,reco::SuperClusterRef>::const_iterator
563  itcheck=scMap_.find(GsfTrackRef_[iGSF]);
564  if(itcheck!=scMap_.end())
565  myElectronCore.setPflowSuperCluster(itcheck->second);
566  gsfElectronCores.push_back(myElectronCore);
567  }
568 }
std::vector< reco::GsfTrackRef > GsfTrackRef_
std::map< reco::GsfTrackRef, reco::SuperClusterRef > scMap_
std::vector< reco::TrackRef > kfTrackRef_
void PFElectronTranslator::createGsfElectrons ( const reco::PFCandidateCollection pfcand,
const IsolationValueMaps isolationValues,
reco::GsfElectronCollection gsfelectrons 
)
private

Definition at line 591 of file PFElectronTranslator.cc.

References reco::GsfElectron::addAmbiguousGsfTrack(), ambiguousGsfTracks_, CandidatePtr_, reco::GsfElectron::PflowIsolationVariables::chargedHadronIso, reco::GsfElectron::MvaInput::deltaEta, reco::PFCandidate::deltaP(), reco::GsfElectron::MvaInput::earlyBrem, reco::PFCandidate::electronExtraRef(), reco::GsfElectron::MvaInput::etOutsideMustache, gsfElectronCoreRefs_, gsfPFCandidateIndex_, GsfTrackRef_, reco::GsfElectron::MvaInput::hadEnergy, reco::GsfElectron::MvaInput::lateBrem, reco::Mustache::MustacheID(), reco::GsfElectron::MvaOutput::mva, reco::PFCandidateElectronExtra::MVA_DeltaEtaTrackCluster, reco::PFCandidate::mva_e_pi(), reco::PFCandidateElectronExtra::MVA_FirstBrem, reco::PFCandidateElectronExtra::MVA_LateBrem, reco::GsfElectron::MvaInput::nClusterOutsideMustache, reco::GsfElectron::PflowIsolationVariables::neutralHadronIso, reco::LeafCandidate::p4(), reco::GsfElectron::P4_PFLOW_COMBINATION, reco::GsfElectron::PflowIsolationVariables::photonIso, reco::GsfElectron::setMvaInput(), reco::GsfElectron::setMvaOutput(), reco::GsfElectron::setP4(), reco::GsfElectron::setPfIsolationVariables(), reco::GsfElectron::MvaInput::sigmaEtaEta, findQualityFiles::size, and reco::GsfElectron::MvaOutput::status.

Referenced by produce().

593  {
594  unsigned size=GsfTrackRef_.size();
595 
596  for(unsigned iGSF=0;iGSF<size;++iGSF) // loop on tracks
597  {
598  const reco::PFCandidate& pfCandidate(pfcand[gsfPFCandidateIndex_[iGSF]]);
599  // Electron
600  reco::GsfElectron myElectron(gsfElectronCoreRefs_[iGSF]);
601  // Warning set p4 error !
602  myElectron.setP4(reco::GsfElectron::P4_PFLOW_COMBINATION, pfCandidate.p4(),pfCandidate.deltaP(), true);
603 
604  // MVA inputs
605  reco::GsfElectron::MvaInput myMvaInput;
606  myMvaInput.earlyBrem = pfCandidate.electronExtraRef()->mvaVariable(reco::PFCandidateElectronExtra::MVA_FirstBrem);
607  myMvaInput.lateBrem = pfCandidate.electronExtraRef()->mvaVariable(reco::PFCandidateElectronExtra::MVA_LateBrem);
608  myMvaInput.deltaEta = pfCandidate.electronExtraRef()->mvaVariable(reco::PFCandidateElectronExtra::MVA_DeltaEtaTrackCluster);
609  myMvaInput.sigmaEtaEta = pfCandidate.electronExtraRef()->sigmaEtaEta();
610  myMvaInput.hadEnergy = pfCandidate.electronExtraRef()->hadEnergy();
611 
612  // Mustache
613  reco::Mustache myMustache;
614  myMustache.MustacheID(*(myElectron. pflowSuperCluster()), myMvaInput.nClusterOutsideMustache, myMvaInput.etOutsideMustache );
615 
616  myElectron.setMvaInput(myMvaInput);
617 
618  // MVA output
619  reco::GsfElectron::MvaOutput myMvaOutput;
620  myMvaOutput.status = pfCandidate.electronExtraRef()->electronStatus();
621  myMvaOutput.mva = pfCandidate.mva_e_pi();
622  myElectron.setMvaOutput(myMvaOutput);
623 
624  // ambiguous tracks
625  unsigned ntracks=ambiguousGsfTracks_[iGSF].size();
626  for(unsigned it=0;it<ntracks;++it) {
627  myElectron.addAmbiguousGsfTrack(ambiguousGsfTracks_[iGSF][it]);
628  }
629 
630  // isolation
631  if( isolationValues.size() != 0 ) {
633  myPFIso.chargedHadronIso=(*isolationValues[0])[CandidatePtr_[iGSF]];
634  myPFIso.photonIso=(*isolationValues[1])[CandidatePtr_[iGSF]];
635  myPFIso.neutralHadronIso=(*isolationValues[2])[CandidatePtr_[iGSF]];
636  myElectron.setPfIsolationVariables(myPFIso);
637  }
638 
639  gsfelectrons.push_back(myElectron);
640  }
641 
642 }
void MustacheID(const CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
Definition: Mustache.cc:114
std::vector< reco::GsfElectronCoreRef > gsfElectronCoreRefs_
std::vector< reco::GsfTrackRef > GsfTrackRef_
std::vector< int > gsfPFCandidateIndex_
std::vector< reco::CandidatePtr > CandidatePtr_
std::vector< std::vector< reco::GsfTrackRef > > ambiguousGsfTracks_
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:35
tuple size
Write out results.
void PFElectronTranslator::createPreshowerCluster ( const reco::PFBlockElement PFBE,
reco::PreshowerClusterCollection preshowerClusters,
unsigned  plane 
) const
private

Definition at line 314 of file PFElectronTranslator.cc.

References reco::PFBlockElement::clusterRef().

Referenced by produce().

315 {
316  reco::PFClusterRef myPFClusterRef= PFBE.clusterRef();
317  preshowerClusters.push_back(reco::PreshowerCluster(myPFClusterRef->energy(),myPFClusterRef->position(),
318  myPFClusterRef->hitsAndFractions(),plane));
319 }
virtual PFClusterRef clusterRef() const
void PFElectronTranslator::createPreshowerClusterPtrs ( const edm::OrphanHandle< reco::PreshowerClusterCollection > &  preshowerClustersHandle)
private

Definition at line 340 of file PFElectronTranslator.cc.

References GsfTrackRef_, preshowerClusterPtr_, preshowerClusters_, and findQualityFiles::size.

Referenced by produce().

341 {
342  unsigned size=GsfTrackRef_.size();
343  unsigned psClusterCounter=0;
344  preshowerClusterPtr_.resize(size);
345 
346  for(unsigned iGSF=0;iGSF<size;++iGSF) // loop on tracks
347  {
348  unsigned nbc=preshowerClusters_[iGSF].size();
349  for(unsigned ibc=0;ibc<nbc;++ibc) // loop on basic clusters
350  {
351  // std::cout << "Track "<< iGSF << " ref " << basicClusterCounter << std::endl;
352  reco::CaloClusterPtr psPtr(preshowerClustersHandle,psClusterCounter);
353  preshowerClusterPtr_[iGSF].push_back(psPtr);
354  ++psClusterCounter;
355  }
356  }
357 }
std::vector< reco::GsfTrackRef > GsfTrackRef_
std::vector< reco::PreshowerClusterCollection > preshowerClusters_
std::vector< reco::CaloClusterPtrVector > preshowerClusterPtr_
tuple size
Write out results.
void PFElectronTranslator::createSuperClusterGsfMapRefs ( const edm::OrphanHandle< reco::SuperClusterCollection > &  superClustersHandle)
private

Definition at line 359 of file PFElectronTranslator.cc.

References GsfTrackRef_, scMap_, and findQualityFiles::size.

Referenced by produce().

360 {
361  unsigned size=GsfTrackRef_.size();
362 
363  for(unsigned iGSF=0;iGSF<size;++iGSF) // loop on tracks
364  {
365  edm::Ref<reco::SuperClusterCollection> scRef(superClustersHandle,iGSF);
366  scMap_[GsfTrackRef_[iGSF]]=scRef;
367  }
368 }
std::vector< reco::GsfTrackRef > GsfTrackRef_
std::map< reco::GsfTrackRef, reco::SuperClusterRef > scMap_
tuple size
Write out results.
void PFElectronTranslator::createSuperClusters ( const reco::PFCandidateCollection pfCand,
reco::SuperClusterCollection superClusters 
) const
private

Definition at line 442 of file PFElectronTranslator.cc.

References reco::SuperCluster::addCluster(), reco::CaloCluster::addHitAndFraction(), reco::SuperCluster::addPreshowerCluster(), basicClusterPtr_, basicClusters_, alignCSCRings::e, gsfPFCandidateIndex_, GsfTrackRef_, pfClusters_, PFClusterWidthAlgo::pflowEtaWidth(), PFClusterWidthAlgo::pflowPhiWidth(), preshowerClusterPtr_, reco::SuperCluster::rawEnergy(), reco::SuperCluster::setEtaWidth(), reco::SuperCluster::setPhiWidth(), reco::SuperCluster::setPreshowerEnergy(), and reco::SuperCluster::setSeed().

Referenced by produce().

444 {
445  unsigned nGSF=GsfTrackRef_.size();
446  for(unsigned iGSF=0;iGSF<nGSF;++iGSF)
447  {
448 
449  // Computes energy position a la e/gamma
450  double sclusterE=0;
451  double posX=0.;
452  double posY=0.;
453  double posZ=0.;
454 
455  unsigned nbasics=basicClusters_[iGSF].size();
456  for(unsigned ibc=0;ibc<nbasics;++ibc)
457  {
458  double e = basicClusters_[iGSF][ibc].energy();
459  sclusterE += e;
460  posX += e * basicClusters_[iGSF][ibc].position().X();
461  posY += e * basicClusters_[iGSF][ibc].position().Y();
462  posZ += e * basicClusters_[iGSF][ibc].position().Z();
463  }
464  posX /=sclusterE;
465  posY /=sclusterE;
466  posZ /=sclusterE;
467 
468  if(pfCand[gsfPFCandidateIndex_[iGSF]].gsfTrackRef()!=GsfTrackRef_[iGSF])
469  {
470  edm::LogError("PFElectronTranslator") << " Major problem in PFElectron Translator" << std::endl;
471  }
472 
473  // compute the width
474  PFClusterWidthAlgo pfwidth(pfClusters_[iGSF]);
475 
476  double correctedEnergy=pfCand[gsfPFCandidateIndex_[iGSF]].ecalEnergy();
477  reco::SuperCluster mySuperCluster(correctedEnergy,math::XYZPoint(posX,posY,posZ));
478  // protection against empty basic cluster collection ; the value is -2 in this case
479  if(nbasics)
480  {
481 // std::cout << "SuperCluster creation; energy " << pfCand[gsfPFCandidateIndex_[iGSF]].ecalEnergy();
482 // std::cout << " " << pfCand[gsfPFCandidateIndex_[iGSF]].rawEcalEnergy() << std::endl;
483 // std::cout << "Seed energy from basic " << basicClusters_[iGSF][0].energy() << std::endl;
484  mySuperCluster.setSeed(basicClusterPtr_[iGSF][0]);
485  }
486  else
487  {
488  // std::cout << "SuperCluster creation ; seed energy " << 0 << std::endl;
489 // std::cout << "SuperCluster creation ; energy " << pfCand[gsfPFCandidateIndex_[iGSF]].ecalEnergy();
490 // std::cout << " " << pfCand[gsfPFCandidateIndex_[iGSF]].rawEcalEnergy() << std::endl;
491 // std::cout << " No seed found " << 0 << std::endl;
492 // std::cout << " MVA " << pfCand[gsfPFCandidateIndex_[iGSF]].mva_e_pi() << std::endl;
493  mySuperCluster.setSeed(reco::CaloClusterPtr());
494  }
495  // the seed should be the first basic cluster
496 
497  for(unsigned ibc=0;ibc<nbasics;++ibc)
498  {
499  mySuperCluster.addCluster(basicClusterPtr_[iGSF][ibc]);
500  // std::cout <<"Adding Ref to SC " << basicClusterPtr_[iGSF][ibc].index() << std::endl;
501  const std::vector< std::pair<DetId, float> > & v1 = basicClusters_[iGSF][ibc].hitsAndFractions();
502  // std::cout << " Number of cells " << v1.size() << std::endl;
503  for( std::vector< std::pair<DetId, float> >::const_iterator diIt = v1.begin();
504  diIt != v1.end();
505  ++diIt ) {
506  // std::cout << " Adding DetId " << (diIt->first).rawId() << " " << diIt->second << std::endl;
507  mySuperCluster.addHitAndFraction(diIt->first,diIt->second);
508  } // loop over rechits
509  }
510 
511  unsigned nps=preshowerClusterPtr_[iGSF].size();
512  for(unsigned ips=0;ips<nps;++ips)
513  {
514  mySuperCluster.addPreshowerCluster(preshowerClusterPtr_[iGSF][ips]);
515  }
516 
517 
518  // Set the preshower energy
519  mySuperCluster.setPreshowerEnergy(pfCand[gsfPFCandidateIndex_[iGSF]].pS1Energy()+
520  pfCand[gsfPFCandidateIndex_[iGSF]].pS2Energy());
521 
522  // Set the cluster width
523  mySuperCluster.setEtaWidth(pfwidth.pflowEtaWidth());
524  mySuperCluster.setPhiWidth(pfwidth.pflowPhiWidth());
525  // Force the computation of rawEnergy_ of the reco::SuperCluster
526  mySuperCluster.rawEnergy();
527  superClusters.push_back(mySuperCluster);
528  }
529 }
std::vector< std::vector< const reco::PFCluster * > > pfClusters_
std::vector< reco::CaloClusterPtrVector > basicClusterPtr_
std::vector< reco::GsfTrackRef > GsfTrackRef_
std::vector< int > gsfPFCandidateIndex_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
std::vector< reco::CaloClusterPtrVector > preshowerClusterPtr_
std::vector< reco::BasicClusterCollection > basicClusters_
bool PFElectronTranslator::fetchCandidateCollection ( edm::Handle< reco::PFCandidateCollection > &  c,
const edm::InputTag tag,
const edm::Event iEvent 
) const
private

Definition at line 256 of file PFElectronTranslator.cc.

References emptyIsOk_, newFWLiteAna::found, and edm::Event::getByLabel().

Referenced by fillMVAValueMap(), and produce().

258  {
259  bool found = iEvent.getByLabel(tag, c);
260 
261  if(!found && !emptyIsOk_)
262  {
263  std::ostringstream err;
264  err<<" cannot get PFCandidates: "
265  <<tag<<std::endl;
266  edm::LogError("PFElectronTranslator")<<err.str();
267  }
268  return found;
269 
270 }
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
void PFElectronTranslator::fetchGsfCollection ( edm::Handle< reco::GsfTrackCollection > &  c,
const edm::InputTag tag,
const edm::Event iEvent 
) const
private

Definition at line 272 of file PFElectronTranslator.cc.

References edm::hlt::Exception, newFWLiteAna::found, and edm::Event::getByLabel().

Referenced by fillMVAValueMap(), and fillSCRefValueMap().

274  {
275  bool found = iEvent.getByLabel(tag, c);
276 
277  if(!found ) {
278  std::ostringstream err;
279  err<<" cannot get GSFTracks: "
280  <<tag<<std::endl;
281  edm::LogError("PFElectronTranslator")<<err.str();
282  throw cms::Exception( "MissingProduct", err.str());
283  }
284 }
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
void PFElectronTranslator::fillMVAValueMap ( edm::Event iEvent,
edm::ValueMap< float >::Filler &  filler 
)
private

Definition at line 371 of file PFElectronTranslator.cc.

References reco::PFCandidate::e, fetchCandidateCollection(), fetchGsfCollection(), gsfMvaMap_, reco::PFCandidate::gsfTrackRef(), i, inputTagGSFTracks_, inputTagPFCandidateElectrons_, edm::helper::Filler< Map >::insert(), edm::Ref< C, T, F >::isNull(), reco::PFCandidate::mva_e_pi(), reco::PFCandidate::particleId(), reco::tau::pfCandidates(), ntuplemaker::status, and makeHLTPrescaleTable::values.

Referenced by produce().

372 {
373  gsfMvaMap_.clear();
375  bool status=fetchCandidateCollection(pfCandidates,
377  iEvent );
378 
379  unsigned ncand=(status)?pfCandidates->size():0;
380  for( unsigned i=0; i<ncand; ++i ) {
381 
382  const reco::PFCandidate& cand = (*pfCandidates)[i];
383  if(cand.particleId()!=reco::PFCandidate::e) continue;
384  if(cand.gsfTrackRef().isNull()) continue;
385  // Fill the MVA map
386  gsfMvaMap_[cand.gsfTrackRef()]=cand.mva_e_pi();
387  }
388 
390  fetchGsfCollection(gsfTracks,
392  iEvent);
393  unsigned ngsf=gsfTracks->size();
394  std::vector<float> values;
395  for(unsigned igsf=0;igsf<ngsf;++igsf)
396  {
397  reco::GsfTrackRef theTrackRef(gsfTracks, igsf);
398  std::map<reco::GsfTrackRef,float>::const_iterator itcheck=gsfMvaMap_.find(theTrackRef);
399  if(itcheck==gsfMvaMap_.end())
400  {
401  // edm::LogWarning("PFElectronTranslator") << "MVA Map, missing GSF track ref " << std::endl;
402  values.push_back(-99.);
403  // std::cout << " Push_back -99. " << std::endl;
404  }
405  else
406  {
407  // std::cout << " Value " << itcheck->second << std::endl;
408  values.push_back(itcheck->second);
409  }
410  }
411  filler.insert(gsfTracks,values.begin(),values.end());
412 }
int i
Definition: DBlmapReader.cc:9
bool fetchCandidateCollection(edm::Handle< reco::PFCandidateCollection > &c, const edm::InputTag &tag, const edm::Event &iEvent) const
std::map< reco::GsfTrackRef, float > gsfMvaMap_
void insert(const H &h, I begin, I end)
Definition: ValueMap.h:53
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
bool isNull() const
Checks for null.
Definition: Ref.h:247
edm::InputTag inputTagPFCandidateElectrons_
edm::InputTag inputTagGSFTracks_
float mva_e_pi() const
mva for electron-pion discrimination
Definition: PFCandidate.h:286
void fetchGsfCollection(edm::Handle< reco::GsfTrackCollection > &c, const edm::InputTag &tag, const edm::Event &iEvent) const
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:35
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:387
tuple status
Definition: ntuplemaker.py:245
virtual ParticleType particleId() const
Definition: PFCandidate.h:347
void PFElectronTranslator::fillSCRefValueMap ( edm::Event iEvent,
edm::ValueMap< reco::SuperClusterRef >::Filler &  filler 
) const
private

Definition at line 415 of file PFElectronTranslator.cc.

References fetchGsfCollection(), inputTagGSFTracks_, edm::helper::Filler< Map >::insert(), scMap_, and makeHLTPrescaleTable::values.

Referenced by produce().

417 {
419  fetchGsfCollection(gsfTracks,
421  iEvent);
422  unsigned ngsf=gsfTracks->size();
423  std::vector<reco::SuperClusterRef> values;
424  for(unsigned igsf=0;igsf<ngsf;++igsf)
425  {
426  reco::GsfTrackRef theTrackRef(gsfTracks, igsf);
427  std::map<reco::GsfTrackRef,reco::SuperClusterRef>::const_iterator itcheck=scMap_.find(theTrackRef);
428  if(itcheck==scMap_.end())
429  {
430  // edm::LogWarning("PFElectronTranslator") << "SCRef Map, missing GSF track ref" << std::endl;
431  values.push_back(reco::SuperClusterRef());
432  }
433  else
434  {
435  values.push_back(itcheck->second);
436  }
437  }
438  filler.insert(gsfTracks,values.begin(),values.end());
439 }
void insert(const H &h, I begin, I end)
Definition: ValueMap.h:53
std::map< reco::GsfTrackRef, reco::SuperClusterRef > scMap_
edm::InputTag inputTagGSFTracks_
void fetchGsfCollection(edm::Handle< reco::GsfTrackCollection > &c, const edm::InputTag &tag, const edm::Event &iEvent) const
void PFElectronTranslator::fillValueMap ( edm::Event iEvent,
edm::ValueMap< float >::Filler &  filler 
) const
private
void PFElectronTranslator::getAmbiguousGsfTracks ( const reco::PFBlockElement PFBE,
std::vector< reco::GsfTrackRef > &  tracks 
) const
private

Definition at line 580 of file PFElectronTranslator.cc.

References reco::PFBlockElementGsfTrack::GsftrackRefPF().

Referenced by produce().

580  {
581  const reco::PFBlockElementGsfTrack * GsfEl = dynamic_cast<const reco::PFBlockElementGsfTrack*>(&PFBE);
582  if(GsfEl==0) return;
583  const std::vector<reco::GsfPFRecTrackRef>& ambPFRecTracks(GsfEl->GsftrackRefPF()->convBremGsfPFRecTrackRef());
584  unsigned ntracks=ambPFRecTracks.size();
585  for(unsigned it=0;it<ntracks;++it) {
586  tracks.push_back(ambPFRecTracks[it]->gsfTrackRef());
587  }
588 }
tuple tracks
Definition: testEve_cfg.py:39
GsfPFRecTrackRef GsftrackRefPF() const
void PFElectronTranslator::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 72 of file PFElectronTranslator.cc.

References ambiguousGsfTracks_, basicClusterPtr_, basicClusters_, CandidatePtr_, checkStatusFlag_, correspondingDaughterCandidate(), createBasicCluster(), createBasicClusterPtrs(), createGsfElectronCoreRefs(), createGsfElectronCores(), createGsfElectrons(), createPreshowerCluster(), createPreshowerClusterPtrs(), createSuperClusterGsfMapRefs(), createSuperClusters(), reco::PFCandidate::e, reco::PFBlockElement::ECAL, reco::PFCandidate::electronExtraRef(), asciidump::elements, reco::PFCandidate::elementsInBlocks(), fetchCandidateCollection(), edm::helper::Filler< Map >::fill(), fillMVAValueMap(), fillSCRefValueMap(), getAmbiguousGsfTracks(), edm::Event::getByLabel(), reco::PFBlockElement::GSF, GsfElectronCollection_, GsfElectronCoreCollection_, gsfElectronCoreRefs_, gsfPFCandidateIndex_, reco::PFCandidate::gsfTrackRef(), GsfTrackRef_, i, inputTagIsoVals_, inputTagPFCandidates_, edm::Ref< C, T, F >::isNull(), j, kfTrackRef_, reco::PFCandidate::mva_e_pi(), MVACut_, reco::PFCandidate::particleId(), PFBasicClusterCollection_, reco::tau::pfCandidates(), pfClusters_, PFMVAValueMap_, PFPreshowerClusterCollection_, PFSCValueMap_, PFSuperClusterCollection_, preshowerClusterPtr_, preshowerClusters_, reco::PFBlockElement::PS1, reco::PFBlockElement::PS2, edm::Event::put(), scMap_, reco::PFCandidateElectronExtra::Selected, ntuplemaker::status, superClusters_, reco::PFCandidate::trackRef(), and reco::PFBlockElement::type().

73  {
74 
75  std::auto_ptr<reco::GsfElectronCoreCollection>
76  gsfElectronCores_p(new reco::GsfElectronCoreCollection);
77 
78  std::auto_ptr<reco::GsfElectronCollection>
79  gsfElectrons_p(new reco::GsfElectronCollection);
80 
81  std::auto_ptr<reco::SuperClusterCollection>
82  superClusters_p(new reco::SuperClusterCollection);
83 
84  std::auto_ptr<reco::BasicClusterCollection>
85  basicClusters_p(new reco::BasicClusterCollection);
86 
87  std::auto_ptr<reco::PreshowerClusterCollection>
88  psClusters_p(new reco::PreshowerClusterCollection);
89 
90  std::auto_ptr<edm::ValueMap<float> > mvaMap_p(new edm::ValueMap<float>());
91  edm::ValueMap<float>::Filler mvaFiller(*mvaMap_p);
92 
93  std::auto_ptr<edm::ValueMap<reco::SuperClusterRef> >
96 
97 
99  bool status=fetchCandidateCollection(pfCandidates,
101  iEvent );
102 
103  IsolationValueMaps isolationValues(inputTagIsoVals_.size());
104  for (size_t j = 0; j<inputTagIsoVals_.size(); ++j) {
105  iEvent.getByLabel(inputTagIsoVals_[j], isolationValues[j]);
106  }
107 
108 
109  // clear the vectors
110  GsfTrackRef_.clear();
111  CandidatePtr_.clear();
112  ambiguousGsfTracks_.clear();
113  kfTrackRef_.clear();
114  basicClusters_.clear();
115  pfClusters_.clear();
116  preshowerClusters_.clear();
117  superClusters_.clear();
118  basicClusterPtr_.clear();
119  preshowerClusterPtr_.clear();
120  gsfPFCandidateIndex_.clear();
121  gsfElectronCoreRefs_.clear();
122  scMap_.clear();
123 
124 
125  // loop on the candidates
126  //CC@@
127  // we need first to create AND put the SuperCluster,
128  // basic clusters and presh clusters collection
129  // in order to get a working Handle
130  unsigned ncand=(status)?pfCandidates->size():0;
131  unsigned iGSF=0;
132  for( unsigned i=0; i<ncand; ++i ) {
133 
134  const reco::PFCandidate& cand = (*pfCandidates)[i];
135  if(cand.particleId()!=reco::PFCandidate::e) continue;
136  if(cand.gsfTrackRef().isNull()) continue;
137  // Note that -1 will still cut some total garbage candidates
138  // Fill the MVA map
139  if(cand.mva_e_pi()<MVACut_) continue;
140 
141  // Check the status flag
143  continue;
144  }
145 
146  GsfTrackRef_.push_back(cand.gsfTrackRef());
147  kfTrackRef_.push_back(cand.trackRef());
148  gsfPFCandidateIndex_.push_back(i);
149 
150  reco::PFCandidatePtr ptrToPFElectron(pfCandidates,i);
151  //CandidatePtr_.push_back(ptrToPFElectron->sourceCandidatePtr(0));
152  CandidatePtr_.push_back(ptrToPFElectron);
153 
155  pfClusters_.push_back(std::vector<const reco::PFCluster *>());
157  ambiguousGsfTracks_.push_back(std::vector<reco::GsfTrackRef>());
158 
159  for(unsigned iele=0; iele<cand.elementsInBlocks().size(); ++iele) {
160  // first get the block
161  reco::PFBlockRef blockRef = cand.elementsInBlocks()[iele].first;
162  //
163  unsigned elementIndex = cand.elementsInBlocks()[iele].second;
164  // check it actually exists
165  if(blockRef.isNull()) continue;
166 
167  // then get the elements of the block
168  const edm::OwnVector< reco::PFBlockElement >& elements = (*blockRef).elements();
169 
170  const reco::PFBlockElement & pfbe (elements[elementIndex]);
171  // The first ECAL element should be the cluster associated to the GSF; defined as the seed
172  if(pfbe.type()==reco::PFBlockElement::ECAL)
173  {
174  // const reco::PFCandidate * coCandidate = &cand;
175  // the Brem photons are saved as daughter PFCandidate; this
176  // is convenient to access the corrected energy
177  // std::cout << " Found candidate " << correspondingDaughterCandidate(coCandidate,pfbe) << " " << coCandidate << std::endl;
179  }
180  if(pfbe.type()==reco::PFBlockElement::PS1)
181  {
183  }
184  if(pfbe.type()==reco::PFBlockElement::PS2)
185  {
187  }
188  if(pfbe.type()==reco::PFBlockElement::GSF)
189  {
191  }
192 
193  } // loop on the elements
194 
195  // save the basic clusters
196  basicClusters_p->insert(basicClusters_p->end(),basicClusters_[iGSF].begin(), basicClusters_[iGSF].end());
197  // save the preshower clusters
198  psClusters_p->insert(psClusters_p->end(),preshowerClusters_[iGSF].begin(),preshowerClusters_[iGSF].end());
199 
200  ++iGSF;
201  } // loop on PFCandidates
202 
203 
204  //Save the basic clusters and get an handle as to be able to create valid Refs (thanks to Claude)
205  // std::cout << " Number of basic clusters " << basicClusters_p->size() << std::endl;
207  iEvent.put(basicClusters_p,PFBasicClusterCollection_);
208 
209  //preshower clusters
211  iEvent.put(psClusters_p,PFPreshowerClusterCollection_);
212 
213  // now that the Basic clusters are in the event, the Ref can be created
214  createBasicClusterPtrs(bcRefProd);
215  // now that the preshower clusters are in the event, the Ref can be created
216  createPreshowerClusterPtrs(psRefProd);
217 
218  // and now the Super cluster can be created with valid references
219  if(status) createSuperClusters(*pfCandidates,*superClusters_p);
220 
221  // Let's put the super clusters in the event
222  const edm::OrphanHandle<reco::SuperClusterCollection> scRefProd = iEvent.put(superClusters_p,PFSuperClusterCollection_);
223  // create the super cluster Ref
224  createSuperClusterGsfMapRefs(scRefProd);
225 
226  // Now create the GsfElectronCoers
227  createGsfElectronCores(*gsfElectronCores_p);
228  // Put them in the as to get to be able to build a Ref
229  const edm::OrphanHandle<reco::GsfElectronCoreCollection> gsfElectronCoreRefProd =
230  iEvent.put(gsfElectronCores_p,GsfElectronCoreCollection_);
231 
232  // now create the Refs
233  createGsfElectronCoreRefs(gsfElectronCoreRefProd);
234 
235  // now make the GsfElectron
236  createGsfElectrons(*pfCandidates,isolationValues,*gsfElectrons_p);
237  iEvent.put(gsfElectrons_p,GsfElectronCollection_);
238 
239  fillMVAValueMap(iEvent,mvaFiller);
240  mvaFiller.fill();
241 
242  fillSCRefValueMap(iEvent,scRefFiller);
243  scRefFiller.fill();
244 
245  // MVA map
246  iEvent.put(mvaMap_p,PFMVAValueMap_);
247  // Gsf-SC map
248  iEvent.put(scMap_p,PFSCValueMap_);
249 
250 
251 
252 }
std::vector< std::vector< const reco::PFCluster * > > pfClusters_
std::string PFPreshowerClusterCollection_
Abstract base class for a PFBlock element (track, cluster...)
int i
Definition: DBlmapReader.cc:9
bool fetchCandidateCollection(edm::Handle< reco::PFCandidateCollection > &c, const edm::InputTag &tag, const edm::Event &iEvent) const
void createGsfElectronCoreRefs(const edm::OrphanHandle< reco::GsfElectronCoreCollection > &gsfElectronCoreHandle)
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
std::vector< reco::CaloClusterPtrVector > basicClusterPtr_
std::vector< reco::GsfElectronCoreRef > gsfElectronCoreRefs_
void createBasicClusterPtrs(const edm::OrphanHandle< reco::BasicClusterCollection > &basicClustersHandle)
list elements
Definition: asciidump.py:414
std::string GsfElectronCollection_
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
void fillSCRefValueMap(edm::Event &iEvent, edm::ValueMap< reco::SuperClusterRef >::Filler &filler) const
const ElementsInBlocks & elementsInBlocks() const
Definition: PFCandidate.h:365
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:349
std::vector< reco::GsfTrackRef > GsfTrackRef_
bool isNull() const
Checks for null.
Definition: Ref.h:247
void fillMVAValueMap(edm::Event &iEvent, edm::ValueMap< float >::Filler &filler)
const reco::PFCandidate & correspondingDaughterCandidate(const reco::PFCandidate &cand, const reco::PFBlockElement &pfbe) const
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
std::vector< GsfElectronCore > GsfElectronCoreCollection
std::vector< reco::PreshowerClusterCollection > preshowerClusters_
void createSuperClusterGsfMapRefs(const edm::OrphanHandle< reco::SuperClusterCollection > &superClustersHandle)
int j
Definition: DBlmapReader.cc:9
std::vector< PreshowerCluster > PreshowerClusterCollection
collection of PreshowerCluster objects
std::vector< int > gsfPFCandidateIndex_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
std::vector< reco::CandidatePtr > CandidatePtr_
edm::InputTag inputTagPFCandidates_
std::vector< std::vector< reco::GsfTrackRef > > ambiguousGsfTracks_
std::map< reco::GsfTrackRef, reco::SuperClusterRef > scMap_
float mva_e_pi() const
mva for electron-pion discrimination
Definition: PFCandidate.h:286
reco::PFCandidateElectronExtraRef electronExtraRef() const
return a reference to the electron extra
Definition: PFCandidate.cc:500
std::string PFBasicClusterCollection_
void createBasicCluster(const reco::PFBlockElement &, reco::BasicClusterCollection &basicClusters, std::vector< const reco::PFCluster * > &, const reco::PFCandidate &coCandidate) const
std::vector< reco::SuperClusterCollection > superClusters_
std::vector< reco::CaloClusterPtrVector > preshowerClusterPtr_
void createSuperClusters(const reco::PFCandidateCollection &, reco::SuperClusterCollection &superClusters) const
void getAmbiguousGsfTracks(const reco::PFBlockElement &PFBE, std::vector< reco::GsfTrackRef > &) const
std::string GsfElectronCoreCollection_
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
std::vector< edm::InputTag > inputTagIsoVals_
std::vector< reco::BasicClusterCollection > basicClusters_
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:35
std::vector< reco::TrackRef > kfTrackRef_
void createPreshowerCluster(const reco::PFBlockElement &PFBE, reco::PreshowerClusterCollection &preshowerClusters, unsigned plane) const
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:387
std::string PFSuperClusterCollection_
void createGsfElectronCores(reco::GsfElectronCoreCollection &) const
tuple status
Definition: ntuplemaker.py:245
virtual ParticleType particleId() const
Definition: PFCandidate.h:347
void createGsfElectrons(const reco::PFCandidateCollection &, const IsolationValueMaps &isolationValues, reco::GsfElectronCollection &)
void createPreshowerClusterPtrs(const edm::OrphanHandle< reco::PreshowerClusterCollection > &preshowerClustersHandle)

Member Data Documentation

std::vector<std::vector<reco::GsfTrackRef> > PFElectronTranslator::ambiguousGsfTracks_
private

Definition at line 110 of file PFElectronTranslator.h.

Referenced by createGsfElectrons(), and produce().

std::vector<reco::CaloClusterPtrVector> PFElectronTranslator::basicClusterPtr_
private

Definition at line 120 of file PFElectronTranslator.h.

Referenced by createBasicClusterPtrs(), createSuperClusters(), and produce().

std::vector<reco::BasicClusterCollection> PFElectronTranslator::basicClusters_
private

Definition at line 112 of file PFElectronTranslator.h.

Referenced by createBasicClusterPtrs(), createSuperClusters(), and produce().

std::vector<reco::CandidatePtr> PFElectronTranslator::CandidatePtr_
private

Definition at line 106 of file PFElectronTranslator.h.

Referenced by createGsfElectrons(), and produce().

bool PFElectronTranslator::checkStatusFlag_
private

Definition at line 100 of file PFElectronTranslator.h.

Referenced by PFElectronTranslator(), and produce().

bool PFElectronTranslator::emptyIsOk_
private

Definition at line 131 of file PFElectronTranslator.h.

Referenced by fetchCandidateCollection(), and PFElectronTranslator().

std::string PFElectronTranslator::GsfElectronCollection_
private

Definition at line 98 of file PFElectronTranslator.h.

Referenced by PFElectronTranslator(), and produce().

std::string PFElectronTranslator::GsfElectronCoreCollection_
private

Definition at line 97 of file PFElectronTranslator.h.

Referenced by PFElectronTranslator(), and produce().

std::vector<reco::GsfElectronCoreRef> PFElectronTranslator::gsfElectronCoreRefs_
private

Definition at line 124 of file PFElectronTranslator.h.

Referenced by createGsfElectronCoreRefs(), createGsfElectrons(), and produce().

std::map<reco::GsfTrackRef,float> PFElectronTranslator::gsfMvaMap_
private

Definition at line 129 of file PFElectronTranslator.h.

Referenced by fillMVAValueMap().

std::vector<int> PFElectronTranslator::gsfPFCandidateIndex_
private

Definition at line 126 of file PFElectronTranslator.h.

Referenced by createGsfElectrons(), createSuperClusters(), and produce().

std::vector<reco::GsfTrackRef> PFElectronTranslator::GsfTrackRef_
private
edm::InputTag PFElectronTranslator::inputTagGSFTracks_
private

Definition at line 90 of file PFElectronTranslator.h.

Referenced by fillMVAValueMap(), fillSCRefValueMap(), and PFElectronTranslator().

std::vector<edm::InputTag> PFElectronTranslator::inputTagIsoVals_
private

Definition at line 91 of file PFElectronTranslator.h.

Referenced by PFElectronTranslator(), and produce().

edm::InputTag PFElectronTranslator::inputTagPFCandidateElectrons_
private

Definition at line 89 of file PFElectronTranslator.h.

Referenced by fillMVAValueMap(), and PFElectronTranslator().

edm::InputTag PFElectronTranslator::inputTagPFCandidates_
private

Definition at line 88 of file PFElectronTranslator.h.

Referenced by PFElectronTranslator(), and produce().

std::vector<reco::TrackRef> PFElectronTranslator::kfTrackRef_
private

Definition at line 108 of file PFElectronTranslator.h.

Referenced by createGsfElectronCores(), and produce().

double PFElectronTranslator::MVACut_
private

Definition at line 99 of file PFElectronTranslator.h.

Referenced by PFElectronTranslator(), and produce().

std::string PFElectronTranslator::PFBasicClusterCollection_
private

Definition at line 92 of file PFElectronTranslator.h.

Referenced by PFElectronTranslator(), and produce().

std::vector<std::vector<const reco::PFCluster *> > PFElectronTranslator::pfClusters_
private

Definition at line 114 of file PFElectronTranslator.h.

Referenced by createSuperClusters(), and produce().

std::string PFElectronTranslator::PFMVAValueMap_
private

Definition at line 95 of file PFElectronTranslator.h.

Referenced by PFElectronTranslator(), and produce().

std::string PFElectronTranslator::PFPreshowerClusterCollection_
private

Definition at line 93 of file PFElectronTranslator.h.

Referenced by PFElectronTranslator(), and produce().

std::string PFElectronTranslator::PFSCValueMap_
private

Definition at line 96 of file PFElectronTranslator.h.

Referenced by PFElectronTranslator(), and produce().

std::string PFElectronTranslator::PFSuperClusterCollection_
private

Definition at line 94 of file PFElectronTranslator.h.

Referenced by PFElectronTranslator(), and produce().

std::vector<reco::CaloClusterPtrVector> PFElectronTranslator::preshowerClusterPtr_
private
std::vector<reco::PreshowerClusterCollection> PFElectronTranslator::preshowerClusters_
private

Definition at line 116 of file PFElectronTranslator.h.

Referenced by createPreshowerClusterPtrs(), and produce().

std::map<reco::GsfTrackRef,reco::SuperClusterRef> PFElectronTranslator::scMap_
private
std::vector<reco::SuperClusterCollection> PFElectronTranslator::superClusters_
private

Definition at line 118 of file PFElectronTranslator.h.

Referenced by produce().