CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HitRCheck.cc
Go to the documentation of this file.
1 #include <cmath>
3 
4 HitRCheck::Range HitRCheck::range(const float & z) const
5 {
6  const float rBig = 150.; //something above the detector ranges
7  const PixelRecoLineRZ & lineLeft = theRZ.lineLeft();
8  const PixelRecoLineRZ & lineRight = theRZ.lineRight();
9 
10  if (z > 0.) {
11  if (lineRight.cotLine() <= 0.) return Range(rBig, 0); //empty
12  float rMin = lineRight.rAtZ(z);
13  if (lineLeft.cotLine() <= 0) return Range(rMin-theTolerance.left(),rBig);
14  float rMax = lineLeft.rAtZ(z);
15  return Range(rMin-theTolerance.left(),rMax+theTolerance.right());
16  } else {
17  if (lineLeft.cotLine() >= 0.) return Range(rBig, 0); //empty
18  float rMin = lineLeft.rAtZ(z);
19  if (lineRight.cotLine()>= 0) return Range(rMin-theTolerance.left(),rBig);
20  float rMax = lineRight.rAtZ(z);
21  return Range(rMin-theTolerance.left(),rMax+theTolerance.right());
22  }
23 }
HitRZConstraint theRZ
Definition: HitRCheck.h:29
virtual Range range(const float &z) const
Definition: HitRCheck.cc:4
double double double z
float cotLine() const
const PixelRecoLineRZ & lineRight() const
PixelRecoRange< float > Range
float rAtZ(float z) const
Margin theTolerance
Definition: HitRCheck.h:30
const PixelRecoLineRZ & lineLeft() const