CMS 3D CMS Logo

HitRCheck.h
Go to the documentation of this file.
1 #ifndef HitRCheck_H
2 #define HitRCheck_H
3 
9 
10 class HitRCheck final : public HitRZCompatibility {
11 public:
12  static constexpr Algo me = rAlgo;
13 
15 
19 
20  bool operator()(const float& r, const float& z) const override { return range(z).inside(r); }
21 
22  inline Range range(const float& z) const override;
23 
24  HitRCheck* clone() const override { return new HitRCheck(*this); }
25 
27 
28 private:
31 };
32 
33 HitRCheck::Range HitRCheck::range(const float& z) const {
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 }
95 #endif
photonAnalyzer_cfi.rMax
rMax
Definition: photonAnalyzer_cfi.py:91
HitRCheck::me
static constexpr Algo me
Definition: HitRCheck.h:12
detailsBasic3DVector::z
float float float z
Definition: extBasic3DVector.h:14
SimpleLineRZ::rAtZ
float rAtZ(float z) const
Definition: PixelRecoLineRZ.h:78
HitRZConstraint.h
HitRCheck::clone
HitRCheck * clone() const override
Definition: HitRCheck.h:24
HitRCheck::operator()
bool operator()(const float &r, const float &z) const override
Definition: HitRCheck.h:20
TkTrackingRegionsMargin::left
const T & left() const
Definition: TkTrackingRegionsMargin.h:18
HitRZCompatibility.h
DDAxes::z
HitRZConstraint
Definition: HitRZConstraint.h:8
Algo
Definition: fakeMenu.h:6
HitRZCompatibility
Definition: HitRZCompatibility.h:8
HitRCheck::setTolerance
void setTolerance(const Margin &tolerance)
Definition: HitRCheck.h:26
HitRCheck::HitRCheck
HitRCheck(const HitRZConstraint &rz, Margin margin=Margin(0, 0))
Definition: HitRCheck.h:17
PixelRecoRange< float >
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< float >
TkTrackingRegionsMargin::right
const T & right() const
Definition: TkTrackingRegionsMargin.h:19
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HitRCheck
Definition: HitRCheck.h:10
HitRCheck::theTolerance
Margin theTolerance
Definition: HitRCheck.h:30
HitRCheck::Margin
TkTrackingRegionsMargin< float > Margin
Definition: HitRCheck.h:14
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
HitRZCompatibility::rAlgo
Definition: HitRZCompatibility.h:11
HitRZConstraint::lineRight
const Line & lineRight() const
Definition: HitRZConstraint.h:19
margin
Double_t margin
Definition: trackSplitPlot.h:45