CMS 3D CMS Logo

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&);
27  ~PFElectronTranslator() override;
28 
29  void produce(edm::Event &, const edm::EventSetup&) override;
30 
31  typedef std::vector< edm::Handle< edm::ValueMap<double> > > IsolationValueMaps;
32 
33 
34  private:
35  // to retrieve the collection from the event
37  const edm::InputTag& tag,
38  const edm::Event& iEvent) const;
39  // to retrieve the collection from the event
41  const edm::InputTag& tag,
42  const edm::Event& iEvent) const ;
43 
44  // makes a basic cluster from PFBlockElement and add it to the collection ; the corrected energy is taken
45  // from the PFCandidate
47  std::vector<const reco::PFCluster *> &,
48  const reco::PFCandidate & coCandidate) const;
49  // makes a preshower cluster from of PFBlockElement and add it to the collection
51  reco::PreshowerClusterCollection& preshowerClusters,
52  unsigned plane) const;
53 
54  // make a super cluster from its ingredients and add it to the collection
56  reco::SuperClusterCollection &superClusters) const;
57 
58  // make GsfElectronCores from ingredients
60 
61  // create the basic cluster Ptr
63 
64  // create the preshower cluster Refs
66 
67  // create the super cluster Refs
69 
70  // create the GsfElectronCore Refs
72 
73  // create the GsfElectrons
75  const IsolationValueMaps& isolationValues,
77 
78  // The following methods are used to fill the value maps
83  void getAmbiguousGsfTracks(const reco::PFBlockElement & PFBE, std::vector<reco::GsfTrackRef>& ) const ;
84 
85 
87  private:
91  std::vector<edm::InputTag> inputTagIsoVals_;
99  double MVACut_;
101 
102  // The following vectors correspond to a GSF track, but the order is not
103  // the order of the tracks in the GSF track collection
104  std::vector<reco::GsfTrackRef> GsfTrackRef_;
105  // the list of candidatePtr
106  std::vector<reco::CandidatePtr> CandidatePtr_;
107  //the list of KfTrackRef
108  std::vector<reco::TrackRef> kfTrackRef_;
109  // the list of ambiguous tracks
110  std::vector<std::vector<reco::GsfTrackRef> > ambiguousGsfTracks_;
111  // the collection of basic clusters associated to a GSF track
112  std::vector<reco::BasicClusterCollection> basicClusters_;
113  // the correcsponding PFCluster ref
114  std::vector<std::vector<const reco::PFCluster *> > pfClusters_;
115  // the collection of preshower clusters associated to a GSF track
116  std::vector<reco::PreshowerClusterCollection> preshowerClusters_;
117  // the super cluster collection (actually only one) associated to a GSF track
118  std::vector<reco::SuperClusterCollection> superClusters_;
119  // the references to the basic clusters associated to a GSF track
120  std::vector<reco::CaloClusterPtrVector> basicClusterPtr_;
121  // the references to the basic clusters associated to a GSF track
122  std::vector<reco::CaloClusterPtrVector> preshowerClusterPtr_;
123  // the references to the GsfElectonCore associated to a GSF track
124  std::vector<reco::GsfElectronCoreRef> gsfElectronCoreRefs_;
125  // keep track of the index of the PF Candidate
126  std::vector<int> gsfPFCandidateIndex_;
127  // maps to ease the creation of the Value Maps
128  std::map<reco::GsfTrackRef,reco::SuperClusterRef> scMap_;
129  std::map<reco::GsfTrackRef,float> gsfMvaMap_;
130 
132 
133 };
134 
136 
137 #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 produce(edm::Event &, const edm::EventSetup &) override
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:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
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
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:40
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)