CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes
HitRCheck Class Referencefinal

#include <HitRCheck.h>

Inheritance diagram for HitRCheck:
HitRZCompatibility

Public Types

typedef
TkTrackingRegionsMargin< float > 
Margin
 
- Public Types inherited from HitRZCompatibility
enum  Algo { zAlgo = 0, rAlgo = 1, etaAlgo = 2 }
 
typedef PixelRecoRange< float > Range
 

Public Member Functions

HitRCheckclone () const override
 
 HitRCheck ()
 
bool operator() (const float &r, const float &z) const override
 
Range range (const float &z) const override
 
void setTolerance (const Margin &tolerance)
 
 theRZ (rz)
 
 theTolerance (margin)
 
- Public Member Functions inherited from HitRZCompatibility
Algo algo () const
 
 HitRZCompatibility (Algo a)
 
virtual ~HitRZCompatibility ()
 

Public Attributes

 __pad0__: HitRZCompatibility(me)
 
- Public Attributes inherited from HitRZCompatibility
Algo m_algo
 

Static Public Attributes

static constexpr Algo me = rAlgo
 

Private Attributes

HitRZConstraint theRZ
 
Margin theTolerance
 

Detailed Description

provides allowed range of radius R from HitRZConstraint at a given Z coordinate

Definition at line 10 of file HitRCheck.h.

Member Typedef Documentation

Definition at line 14 of file HitRCheck.h.

Constructor & Destructor Documentation

HitRCheck::HitRCheck ( )
inline

Definition at line 16 of file HitRCheck.h.

Referenced by clone().

static constexpr Algo me
Definition: HitRCheck.h:12

Member Function Documentation

HitRCheck* HitRCheck::clone ( void  ) const
inlineoverridevirtual

Implements HitRZCompatibility.

Definition at line 24 of file HitRCheck.h.

References HitRCheck().

24 { return new HitRCheck(*this); }
HitRCheck()
Definition: HitRCheck.h:16
bool HitRCheck::operator() ( const float &  r,
const float &  z 
) const
inlineoverridevirtual

Implements HitRZCompatibility.

Definition at line 20 of file HitRCheck.h.

References PixelRecoRange< T >::inside(), and range().

20 { return range(z).inside(r); }
bool inside(const T &value) const
Range range(const float &z) const override
Definition: HitRCheck.h:33
HitRCheck::Range HitRCheck::range ( const float &  z) const
inlineoverridevirtual

Implements HitRZCompatibility.

Definition at line 33 of file HitRCheck.h.

References TkTrackingRegionsMargin< T >::left(), HitRZConstraint::lineLeft(), HitRZConstraint::lineRight(), SimpleLineRZ::rAtZ(), TkTrackingRegionsMargin< T >::right(), theRZ, and theTolerance.

Referenced by operator()(), and HitEtaCheck::range().

33  {
34  constexpr float rBig = 150.; //something above the detector ranges
35  const auto& lineLeft = theRZ.lineLeft();
36  const auto& lineRight = theRZ.lineRight();
37 
38  float rR = lineRight.rAtZ(z);
39  float rL = lineLeft.rAtZ(z);
40  float rMin = (rR < rL) ? rR : rL;
41  float rMax = (rR < rL) ? rL : rR;
42  // in reality all this never happens!
43  float aMin = (rMin > 0) ? rMin : rMax;
44  float aMax = (rMin > 0) ? rMax : rBig;
45  aMin = (rMax > 0) ? aMin : rBig;
46  return Range(aMin - theTolerance.left(), aMax + theTolerance.right());
47 
48  /* check
49  Range v(aMin-theTolerance.left(),aMax+theTolerance.right());
50  Range ori;
51  if (z > 0.) {
52  if (lineRight.cotLine() <= 0.) ori = Range(rBig, 0); //empty
53  else {
54  float rMin = lineRight.rAtZ(z);
55  if (lineLeft.cotLine() <= 0) ori= Range(rMin-theTolerance.left(),rBig);
56  else {
57  float rMax = lineLeft.rAtZ(z);
58  ori = Range(rMin-theTolerance.left(),rMax+theTolerance.right());
59  }
60  }
61  } else {
62  if (lineLeft.cotLine() >= 0.) ori = Range(rBig, 0); //empty
63  else {
64  float rMin = lineLeft.rAtZ(z);
65  if (lineRight.cotLine()>= 0) ori = Range(rMin-theTolerance.left(),rBig);
66  else {
67  float rMax = lineRight.rAtZ(z);
68  ori= Range(rMin-theTolerance.left(),rMax+theTolerance.right());
69  }
70  }
71  }
72 
73  if (ori!=v)
74  std::cout << "v,ori " << v.first << ',' << v.second <<" "
75  << ori.first << ',' << ori.second << std::endl;
76  return ori;
77  */
78 
79  /* original code
80  if (z > 0.) {
81  if (lineRight.cotLine() <= 0.) return Range(rBig, 0); //empty
82  float rMin = lineRight.rAtZ(z);
83  if (lineLeft.cotLine() <= 0) return Range(rMin-theTolerance.left(),rBig);
84  float rMax = lineLeft.rAtZ(z);
85  return Range(rMin-theTolerance.left(),rMax+theTolerance.right());
86  } else {
87  if (lineLeft.cotLine() >= 0.) return Range(rBig, 0); //empty
88  float rMin = lineLeft.rAtZ(z);
89  if (lineRight.cotLine()>= 0) return Range(rMin-theTolerance.left(),rBig);
90  float rMax = lineRight.rAtZ(z);
91  return Range(rMin-theTolerance.left(),rMax+theTolerance.right());
92  }
93  */
94 }
HitRZConstraint theRZ
Definition: HitRCheck.h:29
const Line & lineRight() const
const Line & lineLeft() const
PixelRecoRange< float > Range
float rAtZ(float z) const
Margin theTolerance
Definition: HitRCheck.h:30
void HitRCheck::setTolerance ( const Margin tolerance)
inline

Definition at line 26 of file HitRCheck.h.

References theTolerance, and tolerance.

const double tolerance
Margin theTolerance
Definition: HitRCheck.h:30
HitRCheck::theRZ ( rz  )
HitRCheck::theTolerance ( margin  )
inline

Definition at line 18 of file HitRCheck.h.

HitRZConstraint theRZ
Definition: HitRCheck.h:29
static constexpr Algo me
Definition: HitRCheck.h:12
Double_t margin
Margin theTolerance
Definition: HitRCheck.h:30

Member Data Documentation

HitRCheck::__pad0__

Definition at line 18 of file HitRCheck.h.

constexpr Algo HitRCheck::me = rAlgo
static

Definition at line 12 of file HitRCheck.h.

HitRZConstraint HitRCheck::theRZ
private

Definition at line 29 of file HitRCheck.h.

Referenced by range().

Margin HitRCheck::theTolerance
private

Definition at line 30 of file HitRCheck.h.

Referenced by range(), and setTolerance().