CMS 3D CMS Logo

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;
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
bool operator()(const GlobalPoint &, const GlobalPoint &) const
T z() const
Definition: PV3DBase.h:61
ret
prodAgent to be discontinued
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
RefCountedLinearizedTrackState linTrack(const GlobalPoint &, const reco::TransientTrack &)
void clear(HadCaloObj &c)
Definition: data.h:124