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().

◆ HitRCheck() [2/2]

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

Definition at line 17 of file HitRCheck.h.

Member Function Documentation

◆ clone()

HitRCheck* HitRCheck::clone ( void  ) const
inlineoverridevirtual

Implements HitRZCompatibility.

Definition at line 24 of file HitRCheck.h.

24 { return new HitRCheck(*this); }

References HitRCheck().

◆ operator()()

bool HitRCheck::operator() ( const float &  r,
const float &  z 
) const
inlineoverridevirtual

Implements HitRZCompatibility.

Definition at line 20 of file HitRCheck.h.

20 { return range(z).inside(r); }

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

◆ range()

HitRCheck::Range HitRCheck::range ( const float &  z) const
inlineoverridevirtual

Implements HitRZCompatibility.

Definition at line 33 of file HitRCheck.h.

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 }

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().

◆ setTolerance()

void HitRCheck::setTolerance ( const Margin tolerance)
inline

Definition at line 26 of file HitRCheck.h.

References theTolerance, and tolerance.

Member Data Documentation

◆ me

constexpr Algo HitRCheck::me = rAlgo
staticconstexpr

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().

photonAnalyzer_cfi.rMax
rMax
Definition: photonAnalyzer_cfi.py:91
HitRCheck::me
static constexpr Algo me
Definition: HitRCheck.h:12
SimpleLineRZ::rAtZ
float rAtZ(float z) const
Definition: PixelRecoLineRZ.h:78
TkTrackingRegionsMargin::left
const T & left() const
Definition: TkTrackingRegionsMargin.h:18
DDAxes::z
HitRZConstraint::lineLeft
const Line & lineLeft() const
Definition: HitRZConstraint.h:18
HitRZCompatibility::Range
PixelRecoRange< float > Range
Definition: HitRZCompatibility.h:14
tolerance
const double tolerance
Definition: HGCalGeomParameters.cc:27
TkTrackingRegionsMargin::right
const T & right() const
Definition: TkTrackingRegionsMargin.h:19
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HitRZCompatibility::HitRZCompatibility
HitRZCompatibility(Algo a)
Definition: HitRZCompatibility.h:16
HitRCheck::theTolerance
Margin theTolerance
Definition: HitRCheck.h:30
HitRCheck::range
Range range(const float &z) const override
Definition: HitRCheck.h:33
photonAnalyzer_cfi.rMin
rMin
Definition: photonAnalyzer_cfi.py:90
HitRCheck::HitRCheck
HitRCheck()
Definition: HitRCheck.h:16
HitRCheck::theRZ
HitRZConstraint theRZ
Definition: HitRCheck.h:29
PixelRecoRange::inside
bool inside(const T &value) const
Definition: PixelRecoRange.h:36
HitRZConstraint::lineRight
const Line & lineRight() const
Definition: HitRZConstraint.h:19
margin
Double_t margin
Definition: trackSplitPlot.h:45