CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFElectronTranslator.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_PFProducer_PFElectronTranslator_H
2 #define RecoParticleFlow_PFProducer_PFElectronTranslator_H
17 #include <iostream>
18 #include <string>
19 #include <map>
20 
21 
22 
24 {
25  public:
26  explicit PFElectronTranslator(const edm::ParameterSet&);
28 
29  virtual void produce(edm::Event &, const edm::EventSetup&);
30  virtual void beginRun(edm::Run & run,const edm::EventSetup & c);
31 
32  typedef std::vector< edm::Handle< edm::ValueMap<double> > > IsolationValueMaps;
33 
34 
35  private:
36  // to retrieve the collection from the event
38  const edm::InputTag& tag,
39  const edm::Event& iEvent) const;
40  // to retrieve the collection from the event
42  const edm::InputTag& tag,
43  const edm::Event& iEvent) const ;
44 
45  // makes a basic cluster from PFBlockElement and add it to the collection ; the corrected energy is taken
46  // from the PFCandidate
48  std::vector<const reco::PFCluster *> &,
49  const reco::PFCandidate & coCandidate) const;
50  // makes a preshower cluster from of PFBlockElement and add it to the collection
52  reco::PreshowerClusterCollection& preshowerClusters,
53  unsigned plane) const;
54 
55  // make a super cluster from its ingredients and add it to the collection
57  reco::SuperClusterCollection &superClusters) const;
58 
59  // make GsfElectronCores from ingredients
61 
62  // create the basic cluster Ptr
64 
65  // create the preshower cluster Refs
67 
68  // create the super cluster Refs
70 
71  // create the GsfElectronCore Refs
73 
74  // create the GsfElectrons
76  const IsolationValueMaps& isolationValues,
78 
79  // The following methods are used to fill the value maps
84  void getAmbiguousGsfTracks(const reco::PFBlockElement & PFBE, std::vector<reco::GsfTrackRef>& ) const ;
85 
86 
88  private:
92  std::vector<edm::InputTag> inputTagIsoVals_;
96  std::string PFMVAValueMap_;
97  std::string PFSCValueMap_;
100  double MVACut_;
102 
103  // The following vectors correspond to a GSF track, but the order is not
104  // the order of the tracks in the GSF track collection
105  std::vector<reco::GsfTrackRef> GsfTrackRef_;
106  // the list of candidatePtr
107  std::vector<reco::CandidatePtr> CandidatePtr_;
108  //the list of KfTrackRef
109  std::vector<reco::TrackRef> kfTrackRef_;
110  // the list of ambiguous tracks
111  std::vector<std::vector<reco::GsfTrackRef> > ambiguousGsfTracks_;
112  // the collection of basic clusters associated to a GSF track
113  std::vector<reco::BasicClusterCollection> basicClusters_;
114  // the correcsponding PFCluster ref
115  std::vector<std::vector<const reco::PFCluster *> > pfClusters_;
116  // the collection of preshower clusters associated to a GSF track
117  std::vector<reco::PreshowerClusterCollection> preshowerClusters_;
118  // the super cluster collection (actually only one) associated to a GSF track
119  std::vector<reco::SuperClusterCollection> superClusters_;
120  // the references to the basic clusters associated to a GSF track
121  std::vector<reco::CaloClusterPtrVector> basicClusterPtr_;
122  // the references to the basic clusters associated to a GSF track
123  std::vector<reco::CaloClusterPtrVector> preshowerClusterPtr_;
124  // the references to the GsfElectonCore associated to a GSF track
125  std::vector<reco::GsfElectronCoreRef> gsfElectronCoreRefs_;
126  // keep track of the index of the PF Candidate
127  std::vector<int> gsfPFCandidateIndex_;
128  // maps to ease the creation of the Value Maps
129  std::map<reco::GsfTrackRef,reco::SuperClusterRef> scMap_;
130  std::map<reco::GsfTrackRef,float> gsfMvaMap_;
131 
133 
134 };
135 #endif
std::vector< std::vector< const reco::PFCluster * > > pfClusters_
std::string PFPreshowerClusterCollection_
Abstract base class for a PFBlock element (track, cluster...)
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::map< reco::GsfTrackRef, float > gsfMvaMap_
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)
std::string GsfElectronCollection_
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
void fillSCRefValueMap(edm::Event &iEvent, edm::ValueMap< reco::SuperClusterRef >::Filler &filler) const
std::vector< reco::GsfTrackRef > GsfTrackRef_
int iEvent
Definition: GenABIO.cc:243
void fillMVAValueMap(edm::Event &iEvent, edm::ValueMap< float >::Filler &filler)
const reco::PFCandidate & correspondingDaughterCandidate(const reco::PFCandidate &cand, const reco::PFBlockElement &pfbe) const
void fillValueMap(edm::Event &iEvent, edm::ValueMap< float >::Filler &filler) const
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
std::vector< GsfElectronCore > GsfElectronCoreCollection
std::vector< reco::PreshowerClusterCollection > preshowerClusters_
void createSuperClusterGsfMapRefs(const edm::OrphanHandle< reco::SuperClusterCollection > &superClustersHandle)
std::vector< PreshowerCluster > PreshowerClusterCollection
collection of PreshowerCluster objects
virtual void produce(edm::Event &, const edm::EventSetup &)
std::vector< int > gsfPFCandidateIndex_
edm::InputTag inputTagPFCandidateElectrons_
std::vector< reco::CandidatePtr > CandidatePtr_
edm::InputTag inputTagPFCandidates_
std::vector< std::vector< reco::GsfTrackRef > > ambiguousGsfTracks_
std::map< reco::GsfTrackRef, reco::SuperClusterRef > scMap_
edm::InputTag inputTagGSFTracks_
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
void fetchGsfCollection(edm::Handle< reco::GsfTrackCollection > &c, const edm::InputTag &tag, const edm::Event &iEvent) const
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:33
std::vector< reco::TrackRef > kfTrackRef_
void createPreshowerCluster(const reco::PFBlockElement &PFBE, reco::PreshowerClusterCollection &preshowerClusters, unsigned plane) const
PFElectronTranslator(const edm::ParameterSet &)
std::string PFSuperClusterCollection_
void createGsfElectronCores(reco::GsfElectronCoreCollection &) const
void createGsfElectrons(const reco::PFCandidateCollection &, const IsolationValueMaps &isolationValues, reco::GsfElectronCollection &)
void createPreshowerClusterPtrs(const edm::OrphanHandle< reco::PreshowerClusterCollection > &preshowerClustersHandle)
virtual void beginRun(edm::Run &run, const edm::EventSetup &c)
Definition: Run.h:33