CMS 3D CMS Logo

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

#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

virtual HitRCheckclone () const
 
 HitRCheck ()
 
virtual bool operator() (const float &r, const float &z) const
 
Range range (const float &z) const
 
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 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 Algo me
Definition: HitRCheck.h:12

Member Function Documentation

virtual HitRCheck* HitRCheck::clone ( void  ) const
inlinevirtual

Implements HitRZCompatibility.

Definition at line 25 of file HitRCheck.h.

References HitRCheck().

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

Implements HitRZCompatibility.

Definition at line 20 of file HitRCheck.h.

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

21  { return range(z).inside(r); }
Range range(const float &z) const
Definition: HitRCheck.h:36
bool inside(const T &value) const
HitRCheck::Range HitRCheck::range ( const float &  z) const
inlinevirtual

Implements HitRZCompatibility.

Definition at line 36 of file HitRCheck.h.

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

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

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

Definition at line 27 of file HitRCheck.h.

References theTolerance.

27 { theTolerance = tolerance; }
Margin theTolerance
Definition: HitRCheck.h:31
HitRCheck::theRZ ( rz  )
HitRCheck::theTolerance ( margin  )
inline

Definition at line 18 of file HitRCheck.h.

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

Member Data Documentation

HitRCheck::__pad0__

Definition at line 18 of file HitRCheck.h.

Algo HitRCheck::me =rAlgo
static

Definition at line 12 of file HitRCheck.h.

HitRZConstraint HitRCheck::theRZ
private

Definition at line 30 of file HitRCheck.h.

Referenced by range().

Margin HitRCheck::theTolerance
private

Definition at line 31 of file HitRCheck.h.

Referenced by range(), and setTolerance().