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 32 of file InnerDeltaPhi.cc.

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

37  ol( outlayer.seqNum()),
38  theROrigin(region.originRBound()),
39  theRLayer(0),
40  theThickness(0),
41  theExtraTolerance(extraTolerance),
42  theA(0),
43  theB(0),
44  theVtxZ(region.origin().z()),
45  thePtMin(region.ptMin()),
46  theVtx(region.origin().x(),region.origin().y()),
47  sigma(&layer,iSetup)
48 {
49  float zMinOrigin = theVtxZ-region.originZBound();
50  float zMaxOrigin = theVtxZ+region.originZBound();
52 
53 
54  if (layer.isBarrel()) initBarrelLayer( layer);
55  else initForwardLayer( layer, zMinOrigin, zMaxOrigin);
56 
57 }
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 61 of file InnerDeltaPhi.cc.

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

Referenced by InnerDeltaPhi().

62 {
63  const BarrelDetLayer& bl = static_cast<const BarrelDetLayer&>(layer);
64  float rLayer = bl.specificSurface().radius();
65 
66  // the maximal delta phi will be for the innermost hits
67  theThickness = layer.surface().bounds().thickness();
68  theRLayer = rLayer - 0.5f*theThickness;
69  theRDefined = true;
70 }
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 GCC11_FINAL
Extension of the interface.
void InnerDeltaPhi::initForwardLayer ( const DetLayer layer,
float  zMinOrigin,
float  zMaxOrigin 
)
private

Definition at line 72 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().

74 {
75  const ForwardDetLayer &fl = static_cast<const ForwardDetLayer&>(layer);
76  theRLayer = fl.specificSurface().innerRadius();
77  float layerZ = layer.position().z();
78  theThickness = layer.surface().bounds().thickness();
79  float layerZmin = layerZ > 0 ? layerZ-0.5f*theThickness: layerZ+0.5f*theThickness;
80  theB = layerZ > 0 ? zMaxOrigin : zMinOrigin;
81  theA = layerZmin - theB;
82  theRDefined = false;
83 }
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
float theThickness
Definition: InnerDeltaPhi.h:41
virtual const Surface::PositionType & position() const
Returns position of the surface.
virtual const BoundDisk & specificSurface() const GCC11_FINAL
float InnerDeltaPhi::minRadius ( float  hitR,
float  hitZ 
) const
private

Definition at line 192 of file InnerDeltaPhi.cc.

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

193 {
194  if (theRDefined) return theRLayer;
195  else {
196  float rmin = (theA*hitR)/(hitZ-theB);
197  return ( rmin> 0) ? std::max( rmin, theRLayer) : theRLayer;
198  }
199 }
const T & max(const T &a, const T &b)
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 87 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, max(), bookConverter::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().

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