#include <RecoTracker/TkHitPairs/src/InnerDeltaPhi.h>
Public Types | |
typedef Basic2DVector< double > | Point2D |
Public Member Functions | |
InnerDeltaPhi (const DetLayer &layer, const TrackingRegion ®ion, const edm::EventSetup &iSetup, bool precise=true) | |
PixelRecoRange< float > | operator() (float rHit, float phiHit, float zHit, float errRPhi) const |
float | operator() (float rHit, float zHit, float errRPhi) const |
~InnerDeltaPhi () | |
Private Member Functions | |
void | initBarrelLayer (const DetLayer &layer) |
void | initForwardLayer (const DetLayer &layer, float zMinOrigin, float zMaxOrigin) |
float | innerRadius (float hitX, float hitY, float hitZ) const |
float | minRadius (float hitR, float hitZ) const |
PixelRecoRange< float > | phiRange (const Point2D &hitXY, float zHit, float errRPhi) const |
Private Attributes | |
MultipleScatteringParametrisation * | sigma |
float | theA |
float | theB |
float | theHitError |
bool | thePrecise |
float | thePtMin |
float | theRCurvature |
bool | theRDefined |
float | theRLayer |
float | theROrigin |
float | theThickness |
Point2D | theVtx |
float | theVtxZ |
Definition at line 16 of file InnerDeltaPhi.h.
typedef Basic2DVector<double> InnerDeltaPhi::Point2D |
Definition at line 19 of file InnerDeltaPhi.h.
InnerDeltaPhi::InnerDeltaPhi | ( | const DetLayer & | layer, | |
const TrackingRegion & | region, | |||
const edm::EventSetup & | iSetup, | |||
bool | precise = true | |||
) |
Definition at line 19 of file InnerDeltaPhi.cc.
References GeomDetEnumerators::barrel, PixelRecoUtilities::bendingRadius(), initBarrelLayer(), initForwardLayer(), DetLayer::location(), TrackingRegion::originZBound(), sigma, thePtMin, theRCurvature, and theVtxZ.
00023 : theROrigin(region.originRBound()), 00024 theRLayer(0), 00025 theThickness(0), 00026 theA(0), 00027 theB(0), 00028 theVtx(region.origin().x(),region.origin().y()), 00029 theVtxZ(region.origin().z()), 00030 thePtMin(region.ptMin()), 00031 sigma(0), 00032 thePrecise(precise) 00033 { 00034 float zMinOrigin = theVtxZ-region.originZBound(); 00035 float zMaxOrigin = theVtxZ+region.originZBound(); 00036 theRCurvature = PixelRecoUtilities::bendingRadius(thePtMin,iSetup); 00037 00038 sigma = new MultipleScatteringParametrisation(&layer,iSetup); 00039 00040 if (layer.location() == GeomDetEnumerators::barrel) initBarrelLayer( layer); 00041 else initForwardLayer( layer, zMinOrigin, zMaxOrigin); 00042 00043 }
InnerDeltaPhi::~InnerDeltaPhi | ( | ) |
Definition at line 48 of file InnerDeltaPhi.cc.
References BoundSurface::bounds(), TrackingRegionBase::hitErrRPhi(), Cylinder::radius(), BarrelDetLayer::specificSurface(), GeometricSearchDet::surface(), theHitError, theRDefined, theRLayer, theThickness, and Bounds::thickness().
Referenced by InnerDeltaPhi().
00049 { 00050 const BarrelDetLayer& bl = dynamic_cast<const BarrelDetLayer&>(layer); 00051 float rLayer = bl.specificSurface().radius(); 00052 00053 // the maximal delta phi will be for the innermost hits 00054 theThickness = layer.surface().bounds().thickness(); 00055 theRLayer = rLayer - theThickness/2; 00056 theHitError = TrackingRegionBase::hitErrRPhi( &bl); 00057 theRDefined = true; 00058 }
void InnerDeltaPhi::initForwardLayer | ( | const DetLayer & | layer, | |
float | zMinOrigin, | |||
float | zMaxOrigin | |||
) | [private] |
Definition at line 60 of file InnerDeltaPhi.cc.
References BoundSurface::bounds(), TrackingRegionBase::hitErrRPhi(), BoundDisk::innerRadius(), GeometricSearchDet::position(), ForwardDetLayer::specificSurface(), GeometricSearchDet::surface(), theA, theB, theHitError, theRDefined, theRLayer, theThickness, Bounds::thickness(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by InnerDeltaPhi().
00062 { 00063 const ForwardDetLayer &fl = dynamic_cast<const ForwardDetLayer&>(layer); 00064 theRLayer = fl.specificSurface().innerRadius(); 00065 float layerZ = layer.position().z(); 00066 theThickness = layer.surface().bounds().thickness(); 00067 float layerZmin = layerZ > 0 ? layerZ-theThickness/2.: layerZ+theThickness/2.; 00068 theB = layerZ > 0 ? zMaxOrigin : zMinOrigin; 00069 theA = layerZmin - theB; 00070 theRDefined = false; 00071 theHitError = TrackingRegionBase::hitErrRPhi(&fl); 00072 }
float InnerDeltaPhi::innerRadius | ( | float | hitX, | |
float | hitY, | |||
float | hitZ | |||
) | const [private] |
Definition at line 76 of file InnerDeltaPhi.cc.
References max, sqr(), funct::sqrt(), t, theA, theB, theRDefined, theRLayer, theVtx, Basic2DVector< T >::x(), and Basic2DVector< T >::y().
00077 { 00078 float theVtxX = theVtx.x(); 00079 float theVtxY = theVtx.y(); 00080 // cout <<"--------------------------------"<<endl; 00081 // cout <<"HIT (x,y,z) :"<<" ("<<hitX<<", "<<hitY<<", "<<hitZ<<") "<<endl; 00082 if (theRDefined) { 00083 // cout <<" return defined R layer!"<<theRLayer<<endl; 00084 return theRLayer; 00085 } 00086 else { 00087 float t = theA/(hitZ-theB); 00088 float layer_X = theVtxX + (hitX-theVtxX)*t; 00089 float layer_Y = theVtxY + (hitY-theVtxY)*t; 00090 00091 // cout <<" t from line:"<<t<<endl; 00092 00093 float layer_R = sqrt( sqr(layer_X)+ sqr(layer_Y) ); 00094 00095 00096 // cout << " crossing in TR: "<<" (x,y):"<<layer_X<<","<<layer_Y <<" radius: "<<layer_R<< endl; 00097 return std::max(layer_R, theRLayer); 00098 00099 // float hitR = sqrt( sqr(hitX)+sqr(hitY)); 00100 // float invRmin = (hitZ-theB)/theA/(hitR-theVtxR); 00101 // << " result2: " <<1./invRmin+theVtxR << endl; 00102 // return ( invRmin> 0) ? std::max( 1./invRmin, (double)theRLayer) : theRLayer; 00103 } 00104 }
float InnerDeltaPhi::minRadius | ( | float | hitR, | |
float | hitZ | |||
) | const [inline, private] |
Definition at line 62 of file InnerDeltaPhi.h.
References max, theA, theB, theRDefined, and theRLayer.
Referenced by operator()().
00062 { 00063 if (theRDefined) return theRLayer; 00064 else { 00065 float invRmin = (hitZ-theB)/theA/hitR; 00066 return ( invRmin> 0) ? std::max( 1./invRmin, (double)theRLayer) : theRLayer; 00067 } 00068 }
PixelRecoRange<float> InnerDeltaPhi::operator() | ( | float | rHit, | |
float | phiHit, | |||
float | zHit, | |||
float | errRPhi | |||
) | const [inline] |
Definition at line 30 of file InnerDeltaPhi.h.
References funct::cos(), phiRange(), and funct::sin().
00031 { 00032 // float phiM = operator()( rHit,zHit,errRPhi); 00033 // return PixelRecoRange<float>(phiHit-phiM,phiHit+phiM); 00034 00035 Point2D hitXY( rHit*cos(phiHit), rHit*sin(phiHit)); 00036 return phiRange(hitXY,zHit,errRPhi); 00037 }
float InnerDeltaPhi::operator() | ( | float | rHit, | |
float | zHit, | |||
float | errRPhi | |||
) | const |
Definition at line 209 of file InnerDeltaPhi.cc.
References deltaPhi(), minRadius(), theHitError, thePrecise, thePtMin, theRCurvature, theROrigin, and theVtxZ.
00210 { 00211 // alpha - angle between particle direction at vertex and position of hit. 00212 // (pi/2 - alpha) - angle hit-vertex-cernter_of_curvature 00213 // cos (pi/2 - alpha) = (hRhi/2) / theRCurvature 00214 // so: 00215 00216 float alphaHit = asin( rHit/(2*theRCurvature)); 00217 00218 00219 float rMin = minRadius( rHit, zHit); 00220 float deltaPhi = fabs( alphaHit - asin( rMin/(2*theRCurvature))); 00221 00222 // compute additional delta phi due to origin radius 00223 float deltaPhiOrig = asin( theROrigin * (rHit-rMin) / (rHit*rMin)); 00224 00225 // hit error taken as constant 00226 float deltaPhiHit = theHitError / rMin; 00227 00228 if (!thePrecise) { 00229 return deltaPhi+deltaPhiOrig+deltaPhiHit; 00230 } else { 00231 // add multiple scattering correction 00232 PixelRecoPointRZ zero(0., theVtxZ); 00233 PixelRecoPointRZ point(rHit, zHit); 00234 float scatt = 3*(*sigma)(thePtMin,zero, point) / rMin; 00235 float deltaPhiHitOuter = errRPhi/rMin; 00236 00237 return deltaPhi+deltaPhiOrig+deltaPhiHit + scatt + deltaPhiHitOuter; 00238 } 00239 00240 }
PixelRecoRange< float > InnerDeltaPhi::phiRange | ( | const Point2D & | hitXY, | |
float | zHit, | |||
float | errRPhi | |||
) | const [private] |
Definition at line 107 of file InnerDeltaPhi.cc.
References deltaPhi(), Basic2DVector< T >::dot(), e, Basic2DVector< T >::mag(), max, min, Basic2DVector< T >::phi(), sqr(), funct::sqrt(), t, theA, theB, theHitError, thePrecise, thePtMin, theRCurvature, theRDefined, theRLayer, theROrigin, theThickness, theVtx, theVtxZ, and Basic2DVector< T >::unit().
Referenced by operator()().
00108 { 00109 double rLayer = theRLayer; 00110 bool checkCrossing = true; 00111 Point2D crossing; 00112 00113 Point2D dHit = hitXY-theVtx; 00114 double dHitmag = dHit.mag(); 00115 double dLayer = 0.; 00116 double dL = 0.; 00117 // 00118 // compute crossing of stright track with inner layer 00119 // 00120 if (!theRDefined) { 00121 double t = theA/(hitZ-theB); double dt = fabs(theThickness/(hitZ-theB)); 00122 crossing = theVtx + t*dHit; 00123 rLayer = crossing.mag(); 00124 dLayer = t*dHitmag; dL = dt * dHitmag; 00125 checkCrossing = false; 00126 if (rLayer < theRLayer) { 00127 checkCrossing = true; 00128 rLayer = theRLayer; 00129 dL = 0.; 00130 } 00131 } 00132 00133 // 00134 // compute crossing of track with layer 00135 // dHit - from VTX to outer hit 00136 // rLayer - layer radius 00137 // dLayer - distance from VTX to inner layer in direction of dHit 00138 // vect(rLayer) = vect(rVTX) + vect(dHit).unit * dLayer 00139 // rLayer^2 = (ect(rVTX) + vect(dHit).unit * dLayer)^2 and we have square eqation for dLayer 00140 // 00141 // barrel case 00142 // 00143 00144 if (checkCrossing) { 00145 double vtxmag2 = theVtx.mag2(); 00146 if (vtxmag2 < 1.e-10) { 00147 dLayer = rLayer; 00148 } 00149 else { 00150 double var_c = theVtx.mag2()-sqr(rLayer); 00151 double var_b = 2*theVtx.dot(dHit.unit()); 00152 double var_delta = sqr(var_b)-4*var_c; 00153 if (var_delta <=0.) var_delta = 0; 00154 dLayer = (-var_b + sqrt(var_delta))/2.; //only the value along vector is OK. 00155 } 00156 crossing = theVtx+ dHit.unit() * dLayer; 00157 double cosCross = fabs( dHit.unit().dot(crossing.unit())); 00158 dL = theThickness/cosCross; 00159 } 00160 00161 00162 // track is crossing layer with angle such as: 00163 // this factor should be taken in computation of eror projection 00164 double cosCross = fabs( dHit.unit().dot(crossing.unit())); 00165 00166 00167 double alphaHit = asin( dHitmag/(2*theRCurvature)); 00168 double deltaPhi = fabs( alphaHit - asin( dLayer/(2*theRCurvature))); 00169 deltaPhi *= (dLayer/rLayer/cosCross); 00170 00171 // additinal angle due to not perpendicular stright line crossing (for displaced beam) 00172 double dPhiCrossing = (cosCross > 0.9999) ? 0 : dL * sqrt(1-sqr(cosCross))/ rLayer; 00173 Point2D crossing2 = theVtx + dHit.unit()* (dLayer+dL); 00174 double phicross2 = crossing2.phi(); 00175 double phicross1 = crossing.phi(); 00176 double dphicross = phicross2-phicross1; 00177 if (dphicross < -M_PI) dphicross += 2*M_PI; 00178 if (dphicross > M_PI) dphicross -= 2*M_PI; 00179 if (dphicross > M_PI/2) dphicross = 0.; // something wrong? 00180 phicross2 = phicross1 + dphicross; 00181 00182 00183 // compute additional delta phi due to origin radius 00184 double deltaPhiOrig = asin( theROrigin * (dHitmag-dLayer) / (dHitmag*dLayer)); 00185 deltaPhiOrig *= (dLayer/rLayer/cosCross); 00186 00187 // inner hit error taken as constant 00188 double deltaPhiHit = theHitError / rLayer; 00189 00190 // outer hit error 00191 // double deltaPhiHitOuter = errRPhi/rLayer; 00192 double deltaPhiHitOuter = errRPhi/hitXY.mag(); 00193 00194 double margin = deltaPhi+deltaPhiOrig+deltaPhiHit+deltaPhiHitOuter ; 00195 00196 if (thePrecise) { 00197 // add multiple scattering correction 00198 PixelRecoPointRZ zero(0., theVtxZ); 00199 PixelRecoPointRZ point(hitXY.mag(), hitZ); 00200 double scatt = 3*(*sigma)(thePtMin,zero, point) / rLayer; 00201 00202 margin += scatt ; 00203 } 00204 00205 return PixelRecoRange<float>( std::min(phicross1,phicross2)-margin, 00206 std::max(phicross1,phicross2)+margin); 00207 }
float InnerDeltaPhi::theA [private] |
Definition at line 47 of file InnerDeltaPhi.h.
Referenced by initForwardLayer(), innerRadius(), minRadius(), and phiRange().
float InnerDeltaPhi::theB [private] |
Definition at line 48 of file InnerDeltaPhi.h.
Referenced by initForwardLayer(), innerRadius(), minRadius(), and phiRange().
float InnerDeltaPhi::theHitError [private] |
Definition at line 46 of file InnerDeltaPhi.h.
Referenced by initBarrelLayer(), initForwardLayer(), operator()(), and phiRange().
bool InnerDeltaPhi::thePrecise [private] |
float InnerDeltaPhi::thePtMin [private] |
Definition at line 53 of file InnerDeltaPhi.h.
Referenced by InnerDeltaPhi(), operator()(), and phiRange().
float InnerDeltaPhi::theRCurvature [private] |
Definition at line 45 of file InnerDeltaPhi.h.
Referenced by InnerDeltaPhi(), operator()(), and phiRange().
bool InnerDeltaPhi::theRDefined [private] |
Definition at line 49 of file InnerDeltaPhi.h.
Referenced by initBarrelLayer(), initForwardLayer(), innerRadius(), minRadius(), and phiRange().
float InnerDeltaPhi::theRLayer [private] |
Definition at line 42 of file InnerDeltaPhi.h.
Referenced by initBarrelLayer(), initForwardLayer(), innerRadius(), minRadius(), and phiRange().
float InnerDeltaPhi::theROrigin [private] |
float InnerDeltaPhi::theThickness [private] |
Definition at line 43 of file InnerDeltaPhi.h.
Referenced by initBarrelLayer(), initForwardLayer(), and phiRange().
Point2D InnerDeltaPhi::theVtx [private] |
float InnerDeltaPhi::theVtxZ [private] |
Definition at line 52 of file InnerDeltaPhi.h.
Referenced by InnerDeltaPhi(), operator()(), and phiRange().