CMS 3D CMS Logo

EgammaTrackSelector.cc
Go to the documentation of this file.
4 
5 using namespace egammaisolation;
6 using namespace reco;
7 
8 namespace {
9  template <class T>
10  bool inside(const T& value, std::pair<T, T> const& range) {
11  return value >= range.first && range.second >= value;
12  }
13 } // namespace
14 
16  static const std::string metname = "EgammaIsolationAlgos|EgammaTrackSelector";
18  for (input_type::const_iterator it = tracks.begin(); it != tracks.end(); it++) {
22 
23  float tZ;
24  switch (thePars.dzOption) {
25  case dz:
26  tZ = it->dz();
27  break;
28  case vz:
29  tZ = it->vz();
30  break;
31  case bs:
32  tZ = it->dz(thePars.beamPoint);
33  break;
34  default:
35  tZ = it->vz();
36  break;
37  }
38 
39  float tPt = it->pt();
40  //float tD0 = fabs(it->d0()); //currently not used.
41  float tD0Cor = fabs(it->dxy(thePars.beamPoint));
42  float tEta = it->eta();
43  float tPhi = it->phi();
44  float tChi2Ndof = it->normalizedChi2();
45 
47 
48  if (!inside(tZ, thePars.zRange))
49  continue;
50  if (tPt < thePars.ptMin)
51  continue;
52  if (!inside(tD0Cor, thePars.rRange))
53  continue;
54  if (thePars.dir.deltaR(reco::isodeposit::Direction(tEta, tPhi)) > thePars.drMax)
55  continue;
56  if (tChi2Ndof > thePars.chi2NdofMax)
57  continue;
58 
60  if (thePars.nHitsMin > 0) {
61  unsigned int tHits = it->numberOfValidHits();
62  if (tHits < thePars.nHitsMin)
63  continue;
64  }
65 
67  if (thePars.chi2ProbMin > 0) {
68  float tChi2Prob = ChiSquaredProbability(it->chi2(), it->ndof());
69  if (tChi2Prob < thePars.chi2ProbMin)
70  continue;
71  }
72  result.push_back(&*it);
73  }
74  return result;
75 }
const std::string metname
result_type operator()(const input_type &tracks) const
float ChiSquaredProbability(double chiSquared, double nrDOF)
Definition: value.py:1
fixed size matrix
std::list< const reco::Track * > result_type
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:88
long double T