CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
InnerDeltaPhi Class Reference

#include <InnerDeltaPhi.h>

Public Types

typedef Basic2DVector< float > Point2D
 

Public Member Functions

 InnerDeltaPhi (const DetLayer &outlayer, const DetLayer &layer, const TrackingRegion &region, const edm::EventSetup &iSetup, bool precise=true, float extraTolerance=0.f)
 
PixelRecoRange< float > operator() (float xHit, float yHit, float zHit, float errRPhi) const
 

Private Member Functions

void initBarrelLayer (const DetLayer &layer)
 
void initForwardLayer (const DetLayer &layer, float zMinOrigin, float zMaxOrigin)
 
float minRadius (float hitR, float hitZ) const
 
PixelRecoRange< float > phiRange (const Point2D &hitXY, float zHit, float errRPhi) const
 

Private Attributes

int ol
 
MultipleScatteringParametrisation sigma
 
float theA
 
float theB
 
float theExtraTolerance
 
bool thePrecise
 
float thePtMin
 
float theRCurvature
 
bool theRDefined
 
float theRLayer
 
float theROrigin
 
float theThickness
 
Point2D theVtx
 
float theVtxZ
 

Detailed Description

Definition at line 17 of file InnerDeltaPhi.h.

Member Typedef Documentation

Definition at line 20 of file InnerDeltaPhi.h.

Constructor & Destructor Documentation

InnerDeltaPhi::InnerDeltaPhi ( const DetLayer outlayer,
const DetLayer layer,
const TrackingRegion region,
const edm::EventSetup iSetup,
bool  precise = true,
float  extraTolerance = 0.f 
)

Definition at line 30 of file InnerDeltaPhi.cc.

References PixelRecoUtilities::bendingRadius(), initBarrelLayer(), initForwardLayer(), DetLayer::isBarrel(), TrackingRegion::originZBound(), thePtMin, theRCurvature, and theVtxZ.

35  ol( outlayer.seqNum()),
36  theROrigin(region.originRBound()),
37  theRLayer(0),
38  theThickness(0),
39  theExtraTolerance(extraTolerance),
40  theA(0),
41  theB(0),
42  theVtxZ(region.origin().z()),
43  thePtMin(region.ptMin()),
44  theVtx(region.origin().x(),region.origin().y()),
45  sigma(&layer,iSetup)
46 {
47  float zMinOrigin = theVtxZ-region.originZBound();
48  float zMaxOrigin = theVtxZ+region.originZBound();
50 
51 
52  if (layer.isBarrel()) initBarrelLayer( layer);
53  else initForwardLayer( layer, zMinOrigin, zMaxOrigin);
54 
55 }
float originRBound() const
bounds the particle vertex in the transverse plane
GlobalPoint const & origin() const
T y() const
Definition: PV3DBase.h:63
Point2D theVtx
Definition: InnerDeltaPhi.h:51
int seqNum() const
Definition: DetLayer.h:36
T z() const
Definition: PV3DBase.h:64
float originZBound() const
bounds the particle vertex in the longitudinal plane
bool isBarrel() const
Definition: DetLayer.h:32
float theThickness
Definition: InnerDeltaPhi.h:41
void initBarrelLayer(const DetLayer &layer)
float theRCurvature
Definition: InnerDeltaPhi.h:43
void initForwardLayer(const DetLayer &layer, float zMinOrigin, float zMaxOrigin)
float ptMin() const
minimal pt of interest
T bendingRadius(T pt, const edm::EventSetup &iSetup)
float theExtraTolerance
Definition: InnerDeltaPhi.h:44
T x() const
Definition: PV3DBase.h:62
MultipleScatteringParametrisation sigma
Definition: InnerDeltaPhi.h:54

Member Function Documentation

void InnerDeltaPhi::initBarrelLayer ( const DetLayer layer)
private

Definition at line 59 of file InnerDeltaPhi.cc.

References Surface::bounds(), BarrelDetLayer::specificSurface(), GeometricSearchDet::surface(), theRDefined, theRLayer, theThickness, and Bounds::thickness().

Referenced by InnerDeltaPhi().

60 {
61  const BarrelDetLayer& bl = static_cast<const BarrelDetLayer&>(layer);
62  float rLayer = bl.specificSurface().radius();
63 
64  // the maximal delta phi will be for the innermost hits
65  theThickness = layer.surface().bounds().thickness();
66  theRLayer = rLayer - 0.5f*theThickness;
67  theRDefined = true;
68 }
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
const Bounds & bounds() const
Definition: Surface.h:128
virtual float thickness() const =0
float theThickness
Definition: InnerDeltaPhi.h:41
virtual const BoundCylinder & specificSurface() const
Extension of the interface.
void InnerDeltaPhi::initForwardLayer ( const DetLayer layer,
float  zMinOrigin,
float  zMaxOrigin 
)
private

Definition at line 70 of file InnerDeltaPhi.cc.

References Surface::bounds(), GeometricSearchDet::position(), ForwardDetLayer::specificSurface(), GeometricSearchDet::surface(), theA, theB, theRDefined, theRLayer, theThickness, Bounds::thickness(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by InnerDeltaPhi().

72 {
73  const ForwardDetLayer &fl = static_cast<const ForwardDetLayer&>(layer);
74  theRLayer = fl.specificSurface().innerRadius();
75  float layerZ = layer.position().z();
76  theThickness = layer.surface().bounds().thickness();
77  float layerZmin = layerZ > 0 ? layerZ-0.5f*theThickness: layerZ+0.5f*theThickness;
78  theB = layerZ > 0 ? zMaxOrigin : zMinOrigin;
79  theA = layerZmin - theB;
80  theRDefined = false;
81 }
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
const Bounds & bounds() const
Definition: Surface.h:128
virtual float thickness() const =0
T z() const
Definition: PV3DBase.h:64
virtual const BoundDisk & specificSurface() const
float theThickness
Definition: InnerDeltaPhi.h:41
virtual const Surface::PositionType & position() const
Returns position of the surface.
float InnerDeltaPhi::minRadius ( float  hitR,
float  hitZ 
) const
private

Definition at line 190 of file InnerDeltaPhi.cc.

References bookConverter::max, theA, theB, theRDefined, and theRLayer.

191 {
192  if (theRDefined) return theRLayer;
193  else {
194  float rmin = (theA*hitR)/(hitZ-theB);
195  return ( rmin> 0) ? std::max( rmin, theRLayer) : theRLayer;
196  }
197 }
PixelRecoRange<float> InnerDeltaPhi::operator() ( float  xHit,
float  yHit,
float  zHit,
float  errRPhi 
) const
inline

Definition at line 29 of file InnerDeltaPhi.h.

29  {
30  return phiRange( Point2D(xHit,yHit), zHit, errRPhi);
31  }
PixelRecoRange< float > phiRange(const Point2D &hitXY, float zHit, float errRPhi) const
Basic2DVector< float > Point2D
Definition: InnerDeltaPhi.h:20
PixelRecoRange< float > InnerDeltaPhi::phiRange ( const Point2D hitXY,
float  zHit,
float  errRPhi 
) const
private

Definition at line 85 of file InnerDeltaPhi.cc.

References funct::abs(), Basic2DVector< T >::barePhi(), SiPixelRawToDigiRegional_cfi::deltaPhi, Basic2DVector< T >::dot(), dt, alignCSCRings::e, f, M_PI, Basic2DVector< T >::mag(), margin, bookConverter::max, min(), ol, point, sigma, funct::sqr(), mathSSE::sqrt(), edmStreamStallGrapher::t, theA, theB, theExtraTolerance, thePrecise, thePtMin, theRCurvature, theRDefined, theRLayer, theROrigin, theThickness, theVtx, theVtxZ, and Basic2DVector< T >::unit().

86 {
87  float rLayer = theRLayer;
88  bool checkCrossing = true;
89  Point2D crossing;
90 
91  Point2D dHit = hitXY-theVtx;
92  auto dHitmag = dHit.mag();
93  float dLayer = 0.;
94  float dL = 0.;
95  //
96  // compute crossing of stright track with inner layer
97  //
98  if (!theRDefined) {
99  auto t = theA/(hitZ-theB); auto dt = std::abs(theThickness/(hitZ-theB));
100  crossing = theVtx + t*dHit;
101  rLayer = crossing.mag();
102  dLayer = t*dHitmag; dL = dt * dHitmag;
103  checkCrossing = false;
104  if (rLayer < theRLayer) {
105  checkCrossing = true;
106  rLayer = theRLayer;
107  dL = 0.;
108  }
109  }
110 
111  //
112  // compute crossing of track with layer
113  // dHit - from VTX to outer hit
114  // rLayer - layer radius
115  // dLayer - distance from VTX to inner layer in direction of dHit
116  // vect(rLayer) = vect(rVTX) + vect(dHit).unit * dLayer
117  // rLayer^2 = (vect(rVTX) + vect(dHit).unit * dLayer)^2 and we have square eqation for dLayer
118  //
119  // barrel case
120  //
121 
122  if (checkCrossing) {
123  auto vtxmag2 = theVtx.mag2();
124  if (vtxmag2 < 1.e-10f) {
125  dLayer = rLayer;
126  }
127  else {
128  // there are cancellation here....
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;
133  dLayer = -var_b + std::sqrt(var_delta); //only the value along vector is OK.
134  }
135  crossing = theVtx+ dHit.unit() * dLayer;
136  float cosCross = std::abs( dHit.unit().dot(crossing.unit()));
137  dL = theThickness/cosCross;
138  }
139 
140 
141  // track is crossing layer with angle such as:
142  // this factor should be taken in computation of eror projection
143  auto cosCross = std::abs( dHit.unit().dot(crossing.unit()));
144 
145  auto alphaHit = cropped_asin( dHitmag/(2*theRCurvature));
146  auto deltaPhi = std::abs( alphaHit - cropped_asin( dLayer/(2*theRCurvature)));
147  deltaPhi *= dLayer/(rLayer*cosCross);
148 
149  // additinal angle due to not perpendicular stright line crossing (for displaced beam)
150  // double dPhiCrossing = (cosCross > 0.9999) ? 0 : dL * sqrt(1-sqr(cosCross))/ rLayer;
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.; // something wrong?
158  phicross2 = phicross1 + dphicross;
159 
160 
161  // compute additional delta phi due to origin radius
162  auto deltaPhiOrig = cropped_asin( theROrigin * (dHitmag-dLayer) / (dHitmag*dLayer));
163  deltaPhiOrig *= dLayer/(rLayer*cosCross);
164 
165  // inner hit error taken as constant
166  auto deltaPhiHit = theExtraTolerance / rLayer;
167 
168  // outer hit error
169 // double deltaPhiHitOuter = errRPhi/rLayer;
170  auto deltaPhiHitOuter = errRPhi/hitXY.mag();
171 
172  auto margin = deltaPhi+deltaPhiOrig+deltaPhiHit+deltaPhiHitOuter ;
173 
174  if (thePrecise) {
175  // add multiple scattering correction
176  PixelRecoPointRZ zero(0., theVtxZ);
177  PixelRecoPointRZ point(hitXY.mag(), hitZ);
178  auto scatt = 3.f*sigma(thePtMin,zero, point, ol) / rLayer;
179 
180  margin += scatt ;
181  }
182 
183  return PixelRecoRange<float>( std::min(phicross1,phicross2)-margin,
184  std::max(phicross1,phicross2)+margin);
185 }
float dt
Definition: AMPTWrapper.h:126
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
T barePhi() const
Point2D theVtx
Definition: InnerDeltaPhi.h:51
Basic2DVector unit() const
T sqrt(T t)
Definition: SSEVec.h:48
Double_t margin
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
T min(T a, T b)
Definition: MathUtil.h:58
#define M_PI
float theThickness
Definition: InnerDeltaPhi.h:41
float theRCurvature
Definition: InnerDeltaPhi.h:43
Square< F >::type sqr(const F &f)
Definition: Square.h:13
float theExtraTolerance
Definition: InnerDeltaPhi.h:44
*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
Definition: invegas.h:5
MultipleScatteringParametrisation sigma
Definition: InnerDeltaPhi.h:54

Member Data Documentation

int InnerDeltaPhi::ol
private

Definition at line 37 of file InnerDeltaPhi.h.

Referenced by phiRange().

MultipleScatteringParametrisation InnerDeltaPhi::sigma
private

Definition at line 54 of file InnerDeltaPhi.h.

Referenced by phiRange().

float InnerDeltaPhi::theA
private

Definition at line 45 of file InnerDeltaPhi.h.

Referenced by initForwardLayer(), minRadius(), and phiRange().

float InnerDeltaPhi::theB
private

Definition at line 46 of file InnerDeltaPhi.h.

Referenced by initForwardLayer(), minRadius(), and phiRange().

float InnerDeltaPhi::theExtraTolerance
private

Definition at line 44 of file InnerDeltaPhi.h.

Referenced by phiRange().

bool InnerDeltaPhi::thePrecise
private

Definition at line 36 of file InnerDeltaPhi.h.

Referenced by phiRange().

float InnerDeltaPhi::thePtMin
private

Definition at line 49 of file InnerDeltaPhi.h.

Referenced by InnerDeltaPhi(), and phiRange().

float InnerDeltaPhi::theRCurvature
private

Definition at line 43 of file InnerDeltaPhi.h.

Referenced by InnerDeltaPhi(), and phiRange().

bool InnerDeltaPhi::theRDefined
private

Definition at line 35 of file InnerDeltaPhi.h.

Referenced by initBarrelLayer(), initForwardLayer(), minRadius(), and phiRange().

float InnerDeltaPhi::theRLayer
private

Definition at line 40 of file InnerDeltaPhi.h.

Referenced by initBarrelLayer(), initForwardLayer(), minRadius(), and phiRange().

float InnerDeltaPhi::theROrigin
private

Definition at line 39 of file InnerDeltaPhi.h.

Referenced by phiRange().

float InnerDeltaPhi::theThickness
private

Definition at line 41 of file InnerDeltaPhi.h.

Referenced by initBarrelLayer(), initForwardLayer(), and phiRange().

Point2D InnerDeltaPhi::theVtx
private

Definition at line 51 of file InnerDeltaPhi.h.

Referenced by phiRange().

float InnerDeltaPhi::theVtxZ
private

Definition at line 48 of file InnerDeltaPhi.h.

Referenced by InnerDeltaPhi(), and phiRange().