test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PreId.h
Go to the documentation of this file.
1 #ifndef PreId_H
2 #define PreId_H
3 
4 // Author F. Beaudette. March 2010
5 
11 
12 namespace reco
13 {
14  class PreId{
15  public:
16  enum MatchingType {
17  NONE=0,
21  MVA=4,
22  FINAL=10
23  };
24 
25  public:
26  PreId(unsigned nselection=1):trackRef_(reco::TrackRef()),clusterRef_(reco::PFClusterRef()),
27  matchingEop_(-999.),EcalPos_(math::XYZPoint()),
28  meanShower_(math::XYZPoint()),gsfChi2_(-999.),
29  dpt_(0.),chi2Ratio_(0.){
30  matching_.resize(nselection,false);
31  mva_.resize(nselection,-999.);
32  geomMatching_.resize(5,-999.);
33  }
34  void setTrack(reco::TrackRef trackref) {
35  trackRef_ = trackref;
36  }
37 
38  void setECALMatchingProperties(PFClusterRef clusterRef, const math::XYZPoint & ecalpos, const math::XYZPoint &meanShower, float deta,float dphi,float chieta,float chiphi, float chi2, float eop){
40  EcalPos_ = ecalpos;
42  geomMatching_[0] = deta;
43  geomMatching_[1] = dphi;
44  geomMatching_[2] = chieta;
45  geomMatching_[3] = chiphi;
46  geomMatching_[4] = chi2;
47  matchingEop_= eop;
48  }
49 
50  void setTrackProperties(float newchi2, float chi2ratio,float dpt){
51  gsfChi2_=newchi2;
52  chi2Ratio_ = chi2ratio;
53  dpt_ = dpt;
54  }
55 
56  void setFinalDecision(bool accepted,unsigned n=0)
57  {
58  setMatching(FINAL,accepted,n);
59  }
60  void setECALMatching(bool accepted,unsigned n=0)
61  {
62  setMatching(ECALMATCH,accepted,n);
63  }
64  void setESMatching(bool accepted,unsigned n=0)
65  {
66  setMatching(ESMATCH,accepted,n);
67  }
68  void setTrackFiltering(bool accepted,unsigned n=0)
69  {
70  setMatching(TRACKFILTERING,accepted,n);
71  }
72  void setMVA(bool accepted,float mva,unsigned n=0)
73  {
74  setMatching(MVA,accepted,n);
75  if(n<mva_.size())
76  mva_[n]=mva;
77  }
78 
79  void setMatching(MatchingType type,bool result,unsigned n=0);
80  bool matching(MatchingType type, unsigned n=0) const
81  {
82  if(n<matching_.size())
83  {
84  return matching_[n] & (1 << type);
85  }
86  return false;
87  }
88 
90  inline const std::vector<float> & geomMatching() const {return geomMatching_;}
91  inline float eopMatch() const {return matchingEop_;}
92  inline float pt() const {return trackRef_->pt();}
93  inline float eta() const {return trackRef_->eta();}
94  inline float kfChi2() const {return trackRef_->normalizedChi2();}
95  inline float kfNHits() const {return trackRef_->found();}
96 
97  const math::XYZPoint & ecalPos() const {return EcalPos_;}
98  const math::XYZPoint & meanShower() const {return meanShower_;}
99 
100  inline float chi2Ratio() const {return chi2Ratio_;}
101  inline float gsfChi2() const {return gsfChi2_;}
102 
103  inline bool ecalMatching(unsigned n=0) const {return matching(ECALMATCH,n);}
104  inline bool esMatching(unsigned n=0) const {return matching(ESMATCH,n);}
105  inline bool trackFiltered(unsigned n=0) const {return matching(TRACKFILTERING,n);}
106  inline bool mvaSelected(unsigned n=0) const {return matching(MVA,n);}
107  inline bool preIded(unsigned n=0) const {return matching(FINAL,n);}
108 
109  float mva(unsigned n=0) const;
110  inline float dpt() const {return dpt_;}
113 
114  private:
117 
118 
119  std::vector<float> geomMatching_;
123 
124  float gsfChi2_;
125  float dpt_;
126  float chi2Ratio_;
127  std::vector<float> mva_;
128 
129 // bool goodpreid_;
130 // bool TkId_;
131 // bool EcalMatching_;
132 // bool PSMatching_;
133  std::vector<int> matching_;
134  };
135 }
136 #endif
type
Definition: HCALResponse.h:21
math::XYZPoint meanShower_
Definition: PreId.h:122
float matchingEop_
Definition: PreId.h:120
void setECALMatchingProperties(PFClusterRef clusterRef, const math::XYZPoint &ecalpos, const math::XYZPoint &meanShower, float deta, float dphi, float chieta, float chiphi, float chi2, float eop)
Definition: PreId.h:38
float eopMatch() const
Definition: PreId.h:91
reco::TrackRef trackRef() const
Definition: PreId.h:111
bool matching(MatchingType type, unsigned n=0) const
Definition: PreId.h:80
float eta() const
Definition: PreId.h:93
void setMatching(MatchingType type, bool result, unsigned n=0)
Definition: PreId.cc:6
std::vector< int > matching_
Definition: PreId.h:133
math::XYZPoint EcalPos_
Definition: PreId.h:121
float dpt_
Definition: PreId.h:125
float chi2Ratio_
Definition: PreId.h:126
void setTrack(reco::TrackRef trackref)
Definition: PreId.h:34
float gsfChi2_
Definition: PreId.h:124
void setMVA(bool accepted, float mva, unsigned n=0)
Definition: PreId.h:72
void setTrackFiltering(bool accepted, unsigned n=0)
Definition: PreId.h:68
tuple result
Definition: query.py:137
bool preIded(unsigned n=0) const
Definition: PreId.h:107
reco::TrackRef trackRef_
Definition: PreId.h:115
bool trackFiltered(unsigned n=0) const
Definition: PreId.h:105
float pt() const
Definition: PreId.h:92
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
const math::XYZPoint & ecalPos() const
Definition: PreId.h:97
bool ecalMatching(unsigned n=0) const
Definition: PreId.h:103
std::vector< float > mva_
Definition: PreId.h:127
const math::XYZPoint & meanShower() const
Definition: PreId.h:98
float mva(unsigned n=0) const
Definition: PreId.cc:25
std::vector< float > geomMatching_
Definition: PreId.h:119
PFClusterRef clusterRef() const
Definition: PreId.h:112
float gsfChi2() const
Definition: PreId.h:101
void setTrackProperties(float newchi2, float chi2ratio, float dpt)
Definition: PreId.h:50
PFClusterRef clusterRef_
Definition: PreId.h:116
void setECALMatching(bool accepted, unsigned n=0)
Definition: PreId.h:60
MatchingType
Definition: PreId.h:16
const std::vector< float > & geomMatching() const
Access methods.
Definition: PreId.h:90
float dpt() const
Definition: PreId.h:110
PreId(unsigned nselection=1)
Definition: PreId.h:26
void setESMatching(bool accepted, unsigned n=0)
Definition: PreId.h:64
float chi2Ratio() const
Definition: PreId.h:100
bool mvaSelected(unsigned n=0) const
Definition: PreId.h:106
float kfChi2() const
Definition: PreId.h:94
float kfNHits() const
Definition: PreId.h:95
bool esMatching(unsigned n=0) const
Definition: PreId.h:104
void setFinalDecision(bool accepted, unsigned n=0)
Definition: PreId.h:56