CMS 3D CMS Logo

EPCuts.h
Go to the documentation of this file.
1 #ifndef RecoHI_HiEvtPlaneAlgos_EPCuts_h
2 #define RecoHI_HiEvtPlaneAlgos_EPCuts_h
3 
4 namespace hi {
5 
6  enum class EP_ERA { ppReco, HIReco, Pixel, GenMC };
7 
8  struct TrackStructure {
9  int centbin;
10  float eta;
11  float phi;
12  float et;
13  float pt;
14  int charge;
15  int pdgid;
16  int hits;
17  int algos;
19  float dz;
20  float dxy;
21  float dzError;
22  float dxyError;
23  float ptError;
24  bool highPurity;
25  float dzSig;
26  float dxySig;
28  float dzError_Pix;
29  float chi2layer;
31  int pixel;
32  };
33 
34  class EPCuts {
35  public:
37  double pterror = 0.1,
38  double dzerror = 3.0,
39  double dxyerror = 3.0,
40  double chi2perlayer = 0.18,
41  double dzError_Pix = 10.0,
42  double chi2Pix = 40.,
43  int numberOfValidHits = 11) {
44  cutera_ = cutEra;
45  pterror_ = pterror;
46  dzerror_ = dzerror;
47  dxyerror_ = dxyerror;
49  dzerror_Pix_ = dzError_Pix;
50  chi2Pix_ = chi2Pix;
52  }
53 
54  bool isGoodHF(const TrackStructure& track) const {
55  if (track.pdgid != 1 && track.pdgid != 2)
56  return false;
57  if (std::abs(track.eta) < 3 || std::abs(track.eta) > 5)
58  return false;
59  return true;
60  }
61 
62  bool isGoodCastor(const TrackStructure& track) const { return true; }
63 
64  bool isGoodTrack(const TrackStructure& track) const {
65  if (cutera_ == EP_ERA::ppReco)
66  return trackQuality_ppReco(track);
67  if (cutera_ == EP_ERA::HIReco)
68  return trackQuality_HIReco(track);
69  if (cutera_ == EP_ERA::Pixel)
70  return trackQuality_Pixel(track);
71  return false;
72  }
73 
75  if (track.charge == 0)
76  return false;
77  if (!track.highPurity)
78  return false;
79  if (track.ptError > pterror_ * track.pt)
80  return false;
81  if (track.numberOfValidHits < numberOfValidHits_)
82  return false;
83  if (track.chi2layer > chi2perlayer_)
84  return false;
85  if (std::abs(track.dxy) > dxyerror_ * track.dxyError)
86  return false;
87  if (std::abs(track.dz) > dzerror_ * track.dzError)
88  return false;
89  return true;
90  }
91 
93  if (track.charge == 0)
94  return false;
95  if (!track.highPurity)
96  return false;
97  if (track.numberOfValidHits < numberOfValidHits_)
98  return false;
99  if (track.ptError > pterror_ * track.pt)
100  return false;
101  if (std::abs(track.dxy) > dxyerror_ * track.dxyError)
102  return false;
103  if (std::abs(track.dz) > dzerror_ * track.dzError)
104  return false;
105  if (track.chi2layer > chi2perlayer_)
106  return false;
107  //if (track.algos != 4 && track.algos != 5 && track.algos != 6 && track.algos != 7)
110  return false;
111  return true;
112  }
113 
115  if (track.charge == 0)
116  return false;
117  if (!track.highPurity)
118  return false;
119  bool bPix = false;
120  int nHits = track.numberOfValidHits;
121  if (track.ptError > pterror_ * track.pt)
122  return false;
123  if (track.pt < 2.4 and (nHits <= 6))
124  bPix = true;
125  if (not bPix) {
126  if (nHits < numberOfValidHits_)
127  return false;
128  if (track.chi2layer > chi2perlayer_)
129  return false;
130  if (track.ptError > pterror_ * track.pt)
131  return false;
132  int algo = track.algos;
135  return false;
136  if (std::abs(track.dxy) > dxyerror_ * track.dxyError)
137  return false;
138  if (std::abs(track.dz) > dzerror_ * track.dzError)
139  return false;
140  } else {
141  if (track.chi2layer > chi2Pix_)
142  return false;
143  if (std::abs(track.dz) > dzerror_Pix_ * track.dzError)
144  return false;
145  }
146  return true;
147  }
148 
150  if (track.charge == 0)
151  return false;
152  if (std::abs(track.eta) > 2.4)
153  return false;
154  return true;
155  }
156 
157  private:
159  double pterror_;
160  double dzerror_;
161  double dxyerror_;
163  double dzerror_Pix_;
164  double chi2Pix_;
166  };
167 } // namespace hi
168 #endif
hi::EPCuts
Definition: EPCuts.h:34
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
hi::EPCuts::isGoodHF
bool isGoodHF(const TrackStructure &track) const
Definition: EPCuts.h:54
hi::EPCuts::dzerror_
double dzerror_
Definition: EPCuts.h:160
hi::TrackStructure::collection
int collection
Definition: EPCuts.h:18
hi::TrackStructure::phi
float phi
Definition: EPCuts.h:11
hi::EP_ERA::Pixel
hi::TrackStructure::dxyError
float dxyError
Definition: EPCuts.h:22
hi::TrackStructure::dxy
float dxy
Definition: EPCuts.h:20
hi::EPCuts::dxyerror_
double dxyerror_
Definition: EPCuts.h:161
TrackCollections2monitor_cff.numberOfValidHits
numberOfValidHits
Definition: TrackCollections2monitor_cff.py:248
hi::TrackStructure::dxySig
float dxySig
Definition: EPCuts.h:26
hi::TrackStructure::chi2layer
float chi2layer
Definition: EPCuts.h:29
reco::TrackBase::lowPtTripletStep
Definition: TrackBase.h:95
hi::EPCuts::isGoodTrack
bool isGoodTrack(const TrackStructure &track) const
Definition: EPCuts.h:64
hi::TrackStructure::dzSig
float dzSig
Definition: EPCuts.h:25
hi::TrackStructure::pixel
int pixel
Definition: EPCuts.h:31
hi::TrackStructure::algos
int algos
Definition: EPCuts.h:17
hi::EPCuts::pterror_
double pterror_
Definition: EPCuts.h:159
hi::TrackStructure::dzError
float dzError
Definition: EPCuts.h:21
hi::TrackStructure::eta
float eta
Definition: EPCuts.h:10
cmsdt::algo
algo
Definition: constants.h:164
hi::EPCuts::trackQuality_ppReco
bool trackQuality_ppReco(const TrackStructure &track) const
Definition: EPCuts.h:74
hi::EPCuts::chi2perlayer_
double chi2perlayer_
Definition: EPCuts.h:162
HiEvtPlane_cfi.chi2perlayer
chi2perlayer
Definition: HiEvtPlane_cfi.py:25
hi::TrackStructure
Definition: EPCuts.h:8
hi::TrackStructure::pdgid
int pdgid
Definition: EPCuts.h:15
hi::EPCuts::trackQuality_GenMC
bool trackQuality_GenMC(const TrackStructure &track) const
Definition: EPCuts.h:149
hi::TrackStructure::dzError_Pix
float dzError_Pix
Definition: EPCuts.h:28
HiEvtPlane_cfi.cutEra
cutEra
Definition: HiEvtPlane_cfi.py:34
hi::TrackStructure::hits
int hits
Definition: EPCuts.h:16
hi::TrackStructure::centbin
int centbin
Definition: EPCuts.h:9
hi::EPCuts::numberOfValidHits_
int numberOfValidHits_
Definition: EPCuts.h:165
hi::EPCuts::EPCuts
EPCuts(EP_ERA cutEra=EP_ERA::ppReco, double pterror=0.1, double dzerror=3.0, double dxyerror=3.0, double chi2perlayer=0.18, double dzError_Pix=10.0, double chi2Pix=40., int numberOfValidHits=11)
Definition: EPCuts.h:36
hi::EPCuts::cutera_
EP_ERA cutera_
Definition: EPCuts.h:158
hi::TrackStructure::ptError
float ptError
Definition: EPCuts.h:23
reco::TrackBase::detachedTripletStep
Definition: TrackBase.h:97
hi::TrackStructure::highPurity
bool highPurity
Definition: EPCuts.h:24
hi::EP_ERA::ppReco
hi::TrackStructure::normalizedChi2
float normalizedChi2
Definition: EPCuts.h:27
hi::TrackStructure::numberOfValidHits
int numberOfValidHits
Definition: EPCuts.h:30
hi::EP_ERA::HIReco
reco::TrackBase::initialStep
Definition: TrackBase.h:94
hi::TrackStructure::pt
float pt
Definition: EPCuts.h:13
hi::TrackStructure::dz
float dz
Definition: EPCuts.h:19
reco::TrackBase::pixelPairStep
Definition: TrackBase.h:96
hi
Definition: EPCuts.h:4
hi::EPCuts::trackQuality_Pixel
bool trackQuality_Pixel(const TrackStructure &track) const
Definition: EPCuts.h:114
hi::EPCuts::isGoodCastor
bool isGoodCastor(const TrackStructure &track) const
Definition: EPCuts.h:62
hi::EP_ERA
EP_ERA
Definition: EPCuts.h:6
hi::EPCuts::chi2Pix_
double chi2Pix_
Definition: EPCuts.h:164
hi::EP_ERA::GenMC
HiEvtPlane_cfi.pterror
pterror
Definition: HiEvtPlane_cfi.py:24
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
hi::EPCuts::trackQuality_HIReco
bool trackQuality_HIReco(const TrackStructure &track) const
Definition: EPCuts.h:92
hi::TrackStructure::charge
int charge
Definition: EPCuts.h:14
hi::TrackStructure::et
float et
Definition: EPCuts.h:12
hi::EPCuts::dzerror_Pix_
double dzerror_Pix_
Definition: EPCuts.h:163