CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | 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 ()
 
 HitRCheck (const HitRZConstraint &rz, Margin margin=Margin(0, 0))
 
bool operator() (const float &r, const float &z) const override
 
Range range (const float &z) const override
 
void setTolerance (const Margin &tolerance)
 
- Public Member Functions inherited from HitRZCompatibility
Algo algo () const
 
 HitRZCompatibility (Algo a)
 
virtual ~HitRZCompatibility ()
 

Static Public Attributes

static constexpr Algo me = rAlgo
 

Private Attributes

HitRZConstraint theRZ
 
Margin theTolerance
 

Additional Inherited Members

- Public Attributes inherited from HitRZCompatibility
Algo m_algo
 

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

◆ Margin

Definition at line 14 of file HitRCheck.h.

Constructor & Destructor Documentation

◆ HitRCheck() [1/2]

HitRCheck::HitRCheck ( )
inline

Definition at line 16 of file HitRCheck.h.

Referenced by clone().

static constexpr Algo me
Definition: HitRCheck.h:12

◆ HitRCheck() [2/2]

HitRCheck::HitRCheck ( const HitRZConstraint rz,
Margin  margin = Margin(0, 0) 
)
inline

Definition at line 17 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 Function Documentation

◆ clone()

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

◆ operator()()

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(), alignCSCRings::r, range(), and z.

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

◆ range()

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(), photonAnalyzer_cfi::rMax, photonAnalyzer_cfi::rMin, theRZ, theTolerance, and z.

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 & lineLeft() const
float rAtZ(float z) const
PixelRecoRange< float > Range
const Line & lineRight() const
Margin theTolerance
Definition: HitRCheck.h:30

◆ setTolerance()

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

Member Data Documentation

◆ me

constexpr Algo HitRCheck::me = rAlgo
static

Definition at line 12 of file HitRCheck.h.

◆ theRZ

HitRZConstraint HitRCheck::theRZ
private

Definition at line 29 of file HitRCheck.h.

Referenced by range().

◆ theTolerance

Margin HitRCheck::theTolerance
private

Definition at line 30 of file HitRCheck.h.

Referenced by range(), and setTolerance().