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< double > Point2D
 

Public Member Functions

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

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

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 16 of file InnerDeltaPhi.h.

Member Typedef Documentation

Definition at line 19 of file InnerDeltaPhi.h.

Constructor & Destructor Documentation

InnerDeltaPhi::InnerDeltaPhi ( 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 GeomDetEnumerators::barrel, PixelRecoUtilities::bendingRadius(), initBarrelLayer(), initForwardLayer(), DetLayer::location(), TrackingRegion::originZBound(), thePtMin, theRCurvature, and theVtxZ.

35  theROrigin(region.originRBound()),
36  theRLayer(0),
37  theThickness(0),
38  theExtraTolerance(extraTolerance),
39  theA(0),
40  theB(0),
41  theVtxZ(region.origin().z()),
42  thePtMin(region.ptMin()),
43  theVtx(region.origin().x(),region.origin().y()),
44  sigma(&layer,iSetup)
45 {
46  float zMinOrigin = theVtxZ-region.originZBound();
47  float zMaxOrigin = theVtxZ+region.originZBound();
49 
50 
51  if (layer.location() == GeomDetEnumerators::barrel) initBarrelLayer( layer);
52  else initForwardLayer( layer, zMinOrigin, zMaxOrigin);
53 
54 }
virtual float ptMin() const =0
minimal pt of interest
virtual GlobalPoint origin() const =0
virtual Location location() const =0
Which part of the detector (barrel, endcap)
T y() const
Definition: PV3DBase.h:62
Point2D theVtx
Definition: InnerDeltaPhi.h:51
T z() const
Definition: PV3DBase.h:63
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)
virtual float originRBound() const =0
bounds the particle vertex in the transverse plane
T bendingRadius(T pt, const edm::EventSetup &iSetup)
virtual float originZBound() const =0
bounds the particle vertex in the longitudinal plane
float theExtraTolerance
Definition: InnerDeltaPhi.h:44
T x() const
Definition: PV3DBase.h:61
MultipleScatteringParametrisation sigma
Definition: InnerDeltaPhi.h:54
InnerDeltaPhi::~InnerDeltaPhi ( )

Definition at line 57 of file InnerDeltaPhi.cc.

57 {}

Member Function Documentation

void InnerDeltaPhi::initBarrelLayer ( const DetLayer layer)
private

Definition at line 59 of file InnerDeltaPhi.cc.

References BoundSurface::bounds(), Cylinder::radius(), 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.
virtual float thickness() const =0
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:55
const Bounds & bounds() const
Definition: BoundSurface.h:89
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 BoundSurface::bounds(), BoundDisk::innerRadius(), 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);
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.
virtual float thickness() const =0
T z() const
Definition: PV3DBase.h:63
virtual const BoundDisk & specificSurface() const
const Bounds & bounds() const
Definition: BoundSurface.h:89
float theThickness
Definition: InnerDeltaPhi.h:41
virtual const Surface::PositionType & position() const
Returns position of the surface.
float innerRadius() const
The inner radius of the disk.
Definition: BoundDisk.h:72
float InnerDeltaPhi::minRadius ( float  hitR,
float  hitZ 
) const
private

Definition at line 229 of file InnerDeltaPhi.cc.

References max(), theA, theB, theRDefined, and theRLayer.

Referenced by operator()().

230 {
231  if (theRDefined) return theRLayer;
232  else {
233  float rmin = (theA*hitR)/(hitZ-theB);
234  return ( rmin> 0) ? std::max( rmin, theRLayer) : theRLayer;
235  }
236 }
const T & max(const T &a, const T &b)
float InnerDeltaPhi::operator() ( float  rHit,
float  zHit,
float  errRPhi 
) const

Definition at line 186 of file InnerDeltaPhi.cc.

References abs, SiPixelRawToDigiRegional_cfi::deltaPhi, minRadius(), point, sigma, theExtraTolerance, thePrecise, thePtMin, theRCurvature, theROrigin, theVtxZ, and zero.

187 {
188  // alpha - angle between particle direction at vertex and position of hit.
189  // (pi/2 - alpha) - angle hit-vertex-cernter_of_curvature
190  // cos (pi/2 - alpha) = (hRhi/2) / theRCurvature
191  // so:
192 
193  float alphaHit = std::asin( rHit/(2*theRCurvature));
194 
195 
196  float rMin = minRadius( rHit, zHit);
197  float deltaPhi = std::abs( alphaHit - std::asin( rMin/(2*theRCurvature)));
198 
199  // compute additional delta phi due to origin radius
200  float deltaPhiOrig = asin( theROrigin * (rHit-rMin) / (rHit*rMin));
201 
202  // hit error taken as constant
203  float deltaPhiHit = theExtraTolerance / rMin;
204 
205  if (!thePrecise) {
206  return deltaPhi+deltaPhiOrig+deltaPhiHit;
207  } else {
208  // add multiple scattering correction
210  PixelRecoPointRZ point(rHit, zHit);
211  float scatt = 3.f*sigma(thePtMin,zero, point) / rMin;
212  float deltaPhiHitOuter = errRPhi/rMin;
213 
214  return deltaPhi+deltaPhiOrig+deltaPhiHit + scatt + deltaPhiHitOuter;
215  }
216 
217 }
#define abs(x)
Definition: mlp_lapack.h:159
float minRadius(float hitR, float hitZ) const
float theRCurvature
Definition: InnerDeltaPhi.h:43
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
PixelRecoRange< float > InnerDeltaPhi::operator() ( float  rHit,
float  phiHit,
float  zHit,
float  errRPhi 
) const

Definition at line 219 of file InnerDeltaPhi.cc.

References funct::cos(), phiRange(), and funct::sin().

221 {
222 // float phiM = operator()( rHit,zHit,errRPhi);
223 // return PixelRecoRange<float>(phiHit-phiM,phiHit+phiM);
224 
225  Point2D hitXY( rHit*std::cos(phiHit), rHit*std::sin(phiHit));
226  return phiRange(hitXY,zHit,errRPhi);
227 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
PixelRecoRange< float > phiRange(const Point2D &hitXY, float zHit, float errRPhi) const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
PixelRecoRange< float > InnerDeltaPhi::phiRange ( const Point2D hitXY,
float  zHit,
float  errRPhi 
) const
private

Definition at line 85 of file InnerDeltaPhi.cc.

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

Referenced by operator()().

86 {
87  double rLayer = theRLayer;
88  bool checkCrossing = true;
89  Point2D crossing;
90 
91  Point2D dHit = hitXY-theVtx;
92  double dHitmag = dHit.mag();
93  double dLayer = 0.;
94  double dL = 0.;
95  //
96  // compute crossing of stright track with inner layer
97  //
98  if (!theRDefined) {
99  double t = theA/(hitZ-theB); double 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 = (ect(rVTX) + vect(dHit).unit * dLayer)^2 and we have square eqation for dLayer
118  //
119  // barrel case
120  //
121 
122  if (checkCrossing) {
123  double vtxmag2 = theVtx.mag2();
124  if (vtxmag2 < 1.e-10) {
125  dLayer = rLayer;
126  }
127  else {
128  double var_c = theVtx.mag2()-sqr(rLayer);
129  double var_b = 2*theVtx.dot(dHit.unit());
130  double var_delta = sqr(var_b)-4*var_c;
131  if (var_delta <=0.) var_delta = 0;
132  dLayer = 0.5*(-var_b + std::sqrt(var_delta)); //only the value along vector is OK.
133  }
134  crossing = theVtx+ dHit.unit() * dLayer;
135  double cosCross = std::abs( dHit.unit().dot(crossing.unit()));
136  dL = theThickness/cosCross;
137  }
138 
139 
140  // track is crossing layer with angle such as:
141  // this factor should be taken in computation of eror projection
142  double cosCross = std::abs( dHit.unit().dot(crossing.unit()));
143 
144  double alphaHit = cropped_asin( dHitmag/(2*theRCurvature));
145  double deltaPhi = fabs( alphaHit - cropped_asin( dLayer/(2*theRCurvature)));
146  deltaPhi *= dLayer/(rLayer*cosCross);
147 
148  // additinal angle due to not perpendicular stright line crossing (for displaced beam)
149  // double dPhiCrossing = (cosCross > 0.9999) ? 0 : dL * sqrt(1-sqr(cosCross))/ rLayer;
150  Point2D crossing2 = theVtx + dHit.unit()* (dLayer+dL);
151  double phicross2 = crossing2.phi();
152  double phicross1 = crossing.phi();
153  double dphicross = phicross2-phicross1;
154  if (dphicross < -M_PI) dphicross += 2*M_PI;
155  if (dphicross > M_PI) dphicross -= 2*M_PI;
156  if (dphicross > M_PI/2) dphicross = 0.; // something wrong?
157  phicross2 = phicross1 + dphicross;
158 
159 
160  // compute additional delta phi due to origin radius
161  double deltaPhiOrig = cropped_asin( theROrigin * (dHitmag-dLayer) / (dHitmag*dLayer));
162  deltaPhiOrig *= dLayer/(rLayer*cosCross);
163 
164  // inner hit error taken as constant
165  double deltaPhiHit = theExtraTolerance / rLayer;
166 
167  // outer hit error
168 // double deltaPhiHitOuter = errRPhi/rLayer;
169  double deltaPhiHitOuter = errRPhi/hitXY.mag();
170 
171  double margin = deltaPhi+deltaPhiOrig+deltaPhiHit+deltaPhiHitOuter ;
172 
173  if (thePrecise) {
174  // add multiple scattering correction
176  PixelRecoPointRZ point(hitXY.mag(), hitZ);
177  double scatt = 3.f*sigma(thePtMin,zero, point) / rLayer;
178 
179  margin += scatt ;
180  }
181 
182  return PixelRecoRange<float>( std::min(phicross1,phicross2)-margin,
183  std::max(phicross1,phicross2)+margin);
184 }
float dt
Definition: AMPTWrapper.h:126
#define abs(x)
Definition: mlp_lapack.h:159
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
#define min(a, b)
Definition: mlp_lapack.h:161
Point2D theVtx
Definition: InnerDeltaPhi.h:51
double cropped_asin(double x)
Basic2DVector unit() const
const T & max(const T &a, const T &b)
T sqrt(T t)
Definition: SSEVec.h:46
#define M_PI
Definition: BFit3D.cc:3
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
Geom::Phi< T > phi() const
*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

MultipleScatteringParametrisation InnerDeltaPhi::sigma
private

Definition at line 54 of file InnerDeltaPhi.h.

Referenced by operator()(), and 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 operator()(), and phiRange().

bool InnerDeltaPhi::thePrecise
private

Definition at line 36 of file InnerDeltaPhi.h.

Referenced by operator()(), and phiRange().

float InnerDeltaPhi::thePtMin
private

Definition at line 49 of file InnerDeltaPhi.h.

Referenced by InnerDeltaPhi(), operator()(), and phiRange().

float InnerDeltaPhi::theRCurvature
private

Definition at line 43 of file InnerDeltaPhi.h.

Referenced by InnerDeltaPhi(), operator()(), 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 operator()(), and 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(), operator()(), and phiRange().