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 }
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:543
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
LinearizedTrackStateFactory.h
LinTrackCache::Vicinity::operator()
bool operator()(const GlobalPoint &, const GlobalPoint &) const
Definition: LinTrackCache.cc:45
hcal_runs.rt
rt
Definition: hcal_runs.py:76
pos
Definition: PixelAliasList.h:18
LinTrackCache.h
ReferenceCountingPointer< LinearizedTrackState< 5 > >
LinearizedTrackStateFactory::linearizedTrackState
RefCountedLinearizedTrackState linearizedTrackState(const GlobalPoint &linP, const reco::TransientTrack &track) const override
Definition: LinearizedTrackStateFactory.cc:9
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
LinearizedTrackStateFactory
Definition: LinearizedTrackStateFactory.h:14
p2
double p2[4]
Definition: TauolaWrapper.h:90
Point3DBase< float, GlobalTag >
clear
void clear(HadCaloObj &c)
Definition: data.h:124
LinTrackCache::linTrack
RefCountedLinearizedTrackState linTrack(const GlobalPoint &, const reco::TransientTrack &)
Definition: LinTrackCache.cc:16
LinTrackCache::clear
void clear()
Definition: LinTrackCache.cc:54
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
p1
double p1[4]
Definition: TauolaWrapper.h:89
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
LinTrackCache::Comparer::operator()
bool operator()(const GlobalPoint &, const GlobalPoint &) const
Definition: LinTrackCache.cc:30
std
Definition: JetResolutionObject.h:76
reco::TransientTrack
Definition: TransientTrack.h:19
LinTrackCache::~LinTrackCache
~LinTrackCache()
Definition: LinTrackCache.cc:52
LinTrackCache::Comparer
Definition: LinTrackCache.h:12
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37