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

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
HitRCheck::HitRCheck ( const HitRZConstraint rz,
Margin  margin = Margin(0,0) 
)
inline

Definition at line 17 of file HitRCheck.h.

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

Member Function Documentation

HitRCheck* HitRCheck::clone ( void  ) const
inlineoverridevirtual

Implements HitRZCompatibility.

Definition at line 25 of file HitRCheck.h.

References HitRCheck().

25 { 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(), range(), and z.

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

Implements HitRZCompatibility.

Definition at line 36 of file HitRCheck.h.

References constexpr, TkTrackingRegionsMargin< T >::left(), HitRZConstraint::lineLeft(), HitRZConstraint::lineRight(), SimpleLineRZ::rAtZ(), TkTrackingRegionsMargin< T >::right(), conversionPostprocessing_cfi::rMax, conversionPostprocessing_cfi::rMin, 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, and RecoTauCleanerPlugins::tolerance.

Member Data Documentation

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