CMS 3D CMS Logo

EleTkIsolFromCands.h
Go to the documentation of this file.
1 #ifndef RECOEGAMMA_EGAMMAISOLATIONALGOS_ELETKISOLFROMCANDS_H
2 #define RECOEGAMMA_EGAMMAISOLATIONALGOS_ELETKISOLFROMCANDS_H
3 
10 
12 
13 private:
14  struct TrkCuts {
15  float minPt;
16  float minDR2;
17  float maxDR2;
18  float minDEta;
19  float maxDZ;
20  float minHits;
21  float minPixelHits;
22  float maxDPtPt;
23  std::vector<reco::TrackBase::TrackQuality> allowedQualities;
24  std::vector<reco::TrackBase::TrackAlgorithm> algosToReject;
25  explicit TrkCuts(const edm::ParameterSet& para);
27  };
28 
30 
31 public:
32  explicit EleTkIsolFromCands(const edm::ParameterSet& para);
33  EleTkIsolFromCands(const EleTkIsolFromCands&)=default;
34  ~EleTkIsolFromCands()=default;
36 
38 
39  std::pair<int,double> calIsol(const reco::TrackBase& trk,const pat::PackedCandidateCollection& cands,const edm::View<reco::GsfElectron>& eles);
40 
41  std::pair<int,double> calIsol(const double eleEta,const double elePhi,const double eleVZ,
42  const pat::PackedCandidateCollection& cands,
43  const edm::View<reco::GsfElectron>& eles);
44 
46  const edm::View<reco::GsfElectron>& eles){
47  return calIsol(trk,cands,eles).second;
48  }
49 
50  double calIsolPt(const double eleEta,const double elePhi,const double eleVZ,
51  const pat::PackedCandidateCollection& cands,
52  const edm::View<reco::GsfElectron>& eles){
53  return calIsol(eleEta,elePhi,eleVZ,cands,eles).second;
54  }
55 
56  static bool passTrkSel(const reco::Track& trk,
57  const double trkPt,
58  const TrkCuts& cuts,
59  const double eleEta,const double elePhi,
60  const double eleVZ);
61 
62 private:
63  //no qualities specified, accept all, ORed
64  static bool passQual(const reco::TrackBase& trk,
65  const std::vector<reco::TrackBase::TrackQuality>& quals);
66  static bool passAlgo(const reco::TrackBase& trk,
67  const std::vector<reco::TrackBase::TrackAlgorithm>& algosToRej);
68  //for PF electron candidates the "trk pt" is not the track pt
69  //its the trk-calo gsfele combination energy * trk sin(theta)
70  //so the idea is to match with the gsf electron and get the orginal
71  //gsftrack's pt
72  double getTrkPt(const reco::TrackBase& trk,
73  const edm::View<reco::GsfElectron>& eles);
74 };
75 
76 
77 #endif
TrkCuts(const edm::ParameterSet &para)
static bool passTrkSel(const reco::Track &trk, const double trkPt, const TrkCuts &cuts, const double eleEta, const double elePhi, const double eleVZ)
std::pair< int, double > calIsol(const reco::TrackBase &trk, const pat::PackedCandidateCollection &cands, const edm::View< reco::GsfElectron > &eles)
~EleTkIsolFromCands()=default
static edm::ParameterSetDescription pSetDescript()
std::vector< pat::PackedCandidate > PackedCandidateCollection
double calIsolPt(const double eleEta, const double elePhi, const double eleVZ, const pat::PackedCandidateCollection &cands, const edm::View< reco::GsfElectron > &eles)
double calIsolPt(const reco::TrackBase &trk, const pat::PackedCandidateCollection &cands, const edm::View< reco::GsfElectron > &eles)
static bool passAlgo(const reco::TrackBase &trk, const std::vector< reco::TrackBase::TrackAlgorithm > &algosToRej)
std::vector< reco::TrackBase::TrackQuality > allowedQualities
std::vector< reco::TrackBase::TrackAlgorithm > algosToReject
static bool passQual(const reco::TrackBase &trk, const std::vector< reco::TrackBase::TrackQuality > &quals)
EleTkIsolFromCands & operator=(const EleTkIsolFromCands &)=default
EleTkIsolFromCands(const edm::ParameterSet &para)
double getTrkPt(const reco::TrackBase &trk, const edm::View< reco::GsfElectron > &eles)