CMS 3D CMS Logo

ThirdHitRZPrediction.h
Go to the documentation of this file.
1 #ifndef ThirdHitRZPrediction_H
2 #define ThirdHitRZPrediction_H
3 
9 #include <algorithm>
10 
12 
13 template <class Propagator>
15 public:
19 
20  inline Range operator()(const DetLayer *layer = nullptr);
21  inline Range operator()(float rORz) const { return (*this)(rORz, *thePropagator); }
22  inline Range operator()(float rORz, const Propagator &propagator) const;
23 
25 
26 private:
27  float transform(const Propagator &propagator, float rOrZ) const {
28  return theBarrel ? propagator.zAtR(rOrZ) : propagator.rAtZ(rOrZ);
29  }
30 
32 };
33 
34 template <class Propagator>
36  if (layer)
37  initLayer(layer);
38  if (!theBarrel && !theForward)
39  return Range(0., 0.);
40  float v1 = transform(*thePropagator, theDetRange.min());
41  float v2 = transform(*thePropagator, theDetRange.max());
42  if (v1 > v2)
43  std::swap(v1, v2);
44  return Range(v1 - theTolerance.left(), v2 + theTolerance.right());
45 }
46 
47 template <class Propagator>
49  float rOrZ, const Propagator &propagator) const {
50  float v = transform(propagator, rOrZ);
51  return Range(v - theTolerance.left(), v + theTolerance.right());
52 }
53 
54 #endif
void initPropagator(const Propagator *propagator)
PixelRecoRange< float > Range
const double tolerance
PixelRecoRange< float > Range
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
ThirdHitRZPrediction(const Propagator *propagator, float tolerance, const DetLayer *layer=nullptr)
float transform(const Propagator &propagator, float rOrZ) const
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Range operator()(float rORz) const
const Propagator * thePropagator
Range operator()(const DetLayer *layer=nullptr)
unsigned transform(const HcalDetId &id, unsigned transformCode)