CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LinTrackCache.cc
Go to the documentation of this file.
3 
4 using namespace std;
5 
6 namespace {
7  float maxRelinDistance() {
8  // maximum distance before relinearizing
9  static const float ret = 1e-2; /* SimpleConfigurable<float>
10  (0.01, "LinTrackCache:RelinearizeAfter").value();
11  */
12  return ret;
13  }
14 } // namespace
15 
17  const reco::TransientTrack& rt) {
18  if (theHasLinTrack[pos][rt]) {
19  return theLinTracks[pos][rt];
20  };
21 
22  LinearizedTrackStateFactory lTrackFactory;
23  RefCountedLinearizedTrackState lTrData = lTrackFactory.linearizedTrackState(pos, rt);
24 
25  theLinTracks[pos][rt] = lTrData;
26  theHasLinTrack[pos][rt] = true;
27  return lTrData;
28 }
29 
30 bool LinTrackCache::Comparer::operator()(const GlobalPoint& left, const GlobalPoint& right) const {
31  // if theyre closer than 1 micron, they're
32  // indistinguishable, i.e. the same
33  // static const double max = 1e-4 * 1e-4;
34  // if ( ( left - right ).mag2() < max ) return false;
35 
36  if (left.x() != right.x()) {
37  return (left.x() < right.x());
38  } else if (left.y() != right.y()) {
39  return (left.y() < right.y());
40  } else {
41  return (left.z() < right.z());
42  }
43 }
44 
46  if ((p1 - p2).mag() < maxRelinDistance()) {
47  return false;
48  };
49  return Comparer()(p1, p2);
50 }
51 
53 
55  theLinTracks.clear();
56  theHasLinTrack.clear();
57 }
bool operator()(const GlobalPoint &, const GlobalPoint &) const
RefCountedLinearizedTrackState linearizedTrackState(const GlobalPoint &linP, const reco::TransientTrack &track) const override
tuple ret
prodAgent to be discontinued
const TString p2
Definition: fwPaths.cc:13
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
activeDets clear()
T y() const
Definition: PV3DBase.h:60
list rt
Definition: hcal_runs.py:76
T z() const
Definition: PV3DBase.h:61
const TString p1
Definition: fwPaths.cc:12
RefCountedLinearizedTrackState linTrack(const GlobalPoint &, const reco::TransientTrack &)
bool operator()(const GlobalPoint &, const GlobalPoint &) const
T x() const
Definition: PV3DBase.h:59