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) {
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
bool trackQuality_GenMC(const TrackStructure &track) const
Definition: EPCuts.h:149
EP_ERA cutera_
Definition: EPCuts.h:158
int numberOfValidHits_
Definition: EPCuts.h:165
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
float dzError_Pix
Definition: EPCuts.h:28
float chi2layer
Definition: EPCuts.h:29
bool trackQuality_HIReco(const TrackStructure &track) const
Definition: EPCuts.h:92
bool isGoodTrack(const TrackStructure &track) const
Definition: EPCuts.h:64
double dzerror_Pix_
Definition: EPCuts.h:163
float dxyError
Definition: EPCuts.h:22
Definition: EPCuts.h:4
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isGoodHF(const TrackStructure &track) const
Definition: EPCuts.h:54
int numberOfValidHits
Definition: EPCuts.h:30
bool trackQuality_Pixel(const TrackStructure &track) const
Definition: EPCuts.h:114
double pterror_
Definition: EPCuts.h:159
float normalizedChi2
Definition: EPCuts.h:27
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const GPUCACell::OuterHitOfCell const int32_t nHits
bool trackQuality_ppReco(const TrackStructure &track) const
Definition: EPCuts.h:74
EP_ERA
Definition: EPCuts.h:6
double chi2perlayer_
Definition: EPCuts.h:162
bool isGoodCastor(const TrackStructure &track) const
Definition: EPCuts.h:62
double dzerror_
Definition: EPCuts.h:160
double dxyerror_
Definition: EPCuts.h:161
double chi2Pix_
Definition: EPCuts.h:164