14 template <
class T>
inline T sqr(
T t) {
return t*
t;}
16 inline T cropped_asin(
T x) {
22 inline double checked_asin(
double x,
const char *expr,
const char *
file,
int line) {
23 if (fabs(x) >= 1.0)
throw cms::Exception(
"CorruptData") <<
"asin(x) called with x = " << expr <<
" = " << x <<
"\n\tat " << file <<
":" << line <<
"\n";
33 bool precise,
float extraTolerance)
34 : thePrecise(precise),
35 ol( outlayer.seqNum()),
36 theROrigin(region.originRBound()),
39 theExtraTolerance(extraTolerance),
42 theVtxZ(region.origin().
z()),
43 thePtMin(region.
ptMin()),
44 theVtx(region.origin().x(),region.origin().
y()),
71 float zMinOrigin,
float zMaxOrigin)
78 theB = layerZ > 0 ? zMaxOrigin : zMinOrigin;
88 bool checkCrossing =
true;
92 auto dHitmag = dHit.
mag();
100 crossing = theVtx +
t*dHit;
101 rLayer = crossing.
mag();
102 dLayer =
t*dHitmag; dL =
dt * dHitmag;
103 checkCrossing =
false;
105 checkCrossing =
true;
123 auto vtxmag2 = theVtx.mag2();
124 if (vtxmag2 < 1.
e-10
f) {
129 double var_c = vtxmag2-
sqr(rLayer);
130 double var_b = theVtx.dot(dHit.
unit());
131 double var_delta =
sqr(var_b)-var_c;
132 if (var_delta <=0.) var_delta = 0;
135 crossing = theVtx+ dHit.
unit() * dLayer;
147 deltaPhi *= dLayer/(rLayer*cosCross);
151 Point2D crossing2 = theVtx + dHit.
unit()* (dLayer+dL);
152 auto phicross2 = crossing2.
barePhi();
153 auto phicross1 = crossing.
barePhi();
154 auto dphicross = phicross2-phicross1;
155 if (dphicross < -
float(
M_PI)) dphicross += float(2*
M_PI);
156 if (dphicross >
float(
M_PI)) dphicross -= float(2*
M_PI);
157 if (dphicross >
float(
M_PI/2)) dphicross = 0.;
158 phicross2 = phicross1 + dphicross;
162 auto deltaPhiOrig = cropped_asin(
theROrigin * (dHitmag-dLayer) / (dHitmag*dLayer));
163 deltaPhiOrig *= dLayer/(rLayer*cosCross);
170 auto deltaPhiHitOuter = errRPhi/hitXY.
mag();
172 auto margin =
deltaPhi+deltaPhiOrig+deltaPhiHit+deltaPhiHitOuter ;
194 float rmin = (
theA*hitR)/(hitZ-
theB);
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
T dot(const Basic2DVector &lh) const
Scalar product, or "dot" product, with a vector of same type.
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const Bounds & bounds() const
PixelRecoRange< float > phiRange(const Point2D &hitXY, float zHit, float errRPhi) const
Basic2DVector unit() const
virtual float thickness() const =0
float minRadius(float hitR, float hitZ) const
virtual const BoundDisk & specificSurface() const
Abs< T >::type abs(const T &t)
float originZBound() const
bounds the particle vertex in the longitudinal plane
virtual const Surface::PositionType & position() const
Returns position of the surface.
void initBarrelLayer(const DetLayer &layer)
void initForwardLayer(const DetLayer &layer, float zMinOrigin, float zMaxOrigin)
virtual const BoundCylinder & specificSurface() const
Extension of the interface.
T bendingRadius(T pt, const edm::EventSetup &iSetup)
Square< F >::type sqr(const F &f)
InnerDeltaPhi(const DetLayer &outlayer, const DetLayer &layer, const TrackingRegion ®ion, const edm::EventSetup &iSetup, bool precise=true, float extraTolerance=0.f)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
MultipleScatteringParametrisation sigma