CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

HitRCheck Class Reference

#include <HitRCheck.h>

Inheritance diagram for HitRCheck:
HitRZCompatibility

List of all members.

Public Types

typedef
TkTrackingRegionsMargin< float > 
Margin

Public Member Functions

virtual HitRCheckclone () const
 HitRCheck ()
 HitRCheck (const HitRZConstraint &rz, Margin margin=Margin(0, 0))
virtual bool operator() (const float &r, const float &z) const
virtual Range range (const float &z) const
void setTolerance (const Margin &tolerance)

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 13 of file HitRCheck.h.


Constructor & Destructor Documentation

HitRCheck::HitRCheck ( ) [inline]

Definition at line 15 of file HitRCheck.h.

Referenced by clone().

{ }
HitRCheck::HitRCheck ( const HitRZConstraint rz,
Margin  margin = Margin(0,0) 
) [inline]

Definition at line 16 of file HitRCheck.h.

    : theRZ(rz), theTolerance(margin) { } 

Member Function Documentation

virtual HitRCheck* HitRCheck::clone ( void  ) const [inline, virtual]

Implements HitRZCompatibility.

Definition at line 24 of file HitRCheck.h.

References HitRCheck().

{ return new HitRCheck(*this); }
virtual bool HitRCheck::operator() ( const float &  r,
const float &  z 
) const [inline, virtual]

Implements HitRZCompatibility.

Definition at line 19 of file HitRCheck.h.

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

    { return range(z).inside(r); }
HitRCheck::Range HitRCheck::range ( const float &  z) const [virtual]

Implements HitRZCompatibility.

Definition at line 4 of file HitRCheck.cc.

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

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

{
  const float rBig = 150.; //something above the detector ranges
  const PixelRecoLineRZ & lineLeft = theRZ.lineLeft();
  const PixelRecoLineRZ & lineRight = theRZ.lineRight();

  if (z > 0.) {
    if (lineRight.cotLine() <= 0.) return Range(rBig, 0); //empty
    float rMin = lineRight.rAtZ(z);
    if (lineLeft.cotLine() <= 0) return Range(rMin-theTolerance.left(),rBig);
    float rMax = lineLeft.rAtZ(z);
    return Range(rMin-theTolerance.left(),rMax+theTolerance.right()); 
  } else {
    if (lineLeft.cotLine() >= 0.) return Range(rBig, 0); //empty 
    float rMin = lineLeft.rAtZ(z);
    if (lineRight.cotLine()>= 0) return Range(rMin-theTolerance.left(),rBig);
    float rMax = lineRight.rAtZ(z);
    return Range(rMin-theTolerance.left(),rMax+theTolerance.right());
  }
}
void HitRCheck::setTolerance ( const Margin tolerance) [inline]

Definition at line 26 of file HitRCheck.h.

References theTolerance.

{ theTolerance = tolerance; }

Member Data Documentation

Definition at line 29 of file HitRCheck.h.

Referenced by range().

Definition at line 30 of file HitRCheck.h.

Referenced by range(), and setTolerance().