CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/RecoTracker/TkTrackingRegions/src/HitRCheck.cc

Go to the documentation of this file.
00001 #include <cmath>
00002 #include "RecoTracker/TkTrackingRegions/interface/HitRCheck.h"
00003 
00004 HitRCheck::Range HitRCheck::range(const float & z) const
00005 {
00006   const float rBig = 150.; //something above the detector ranges
00007   const PixelRecoLineRZ & lineLeft = theRZ.lineLeft();
00008   const PixelRecoLineRZ & lineRight = theRZ.lineRight();
00009 
00010   if (z > 0.) {
00011     if (lineRight.cotLine() <= 0.) return Range(rBig, 0); //empty
00012     float rMin = lineRight.rAtZ(z);
00013     if (lineLeft.cotLine() <= 0) return Range(rMin-theTolerance.left(),rBig);
00014     float rMax = lineLeft.rAtZ(z);
00015     return Range(rMin-theTolerance.left(),rMax+theTolerance.right()); 
00016   } else {
00017     if (lineLeft.cotLine() >= 0.) return Range(rBig, 0); //empty 
00018     float rMin = lineLeft.rAtZ(z);
00019     if (lineRight.cotLine()>= 0) return Range(rMin-theTolerance.left(),rBig);
00020     float rMax = lineRight.rAtZ(z);
00021     return Range(rMin-theTolerance.left(),rMax+theTolerance.right());
00022   }
00023 }