CMS 3D CMS Logo

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
 
bool prefilter (float xHit, float yHit) const
 

Private Member Functions

void initBarrelLayer (const DetLayer &layer)
 
void initBarrelMS (const DetLayer &outLayer)
 
void initForwardLayer (const DetLayer &layer, float zMinOrigin, float zMaxOrigin)
 
void initForwardMS (const DetLayer &outLayer)
 
PixelRecoRange< float > phiRange (const Point2D &hitXY, float zHit, float errRPhi) const
 

Private Attributes

bool innerIsBarrel
 
int ol
 
bool outerIsBarrel
 
MultipleScatteringParametrisation sigma
 
float theA
 
float theB
 
float theDeltaScatt
 
float theExtraTolerance
 
bool thePrecise
 
float thePtMin
 
float theRCurvature
 
float theRLayer
 
float theROrigin
 
float theScatt0
 
float theThickness
 
Point2D theVtx
 
float theVtxZ
 

Detailed Description

Definition at line 20 of file InnerDeltaPhi.h.

Member Typedef Documentation

Definition at line 23 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 91 of file InnerDeltaPhi.cc.

References PixelRecoUtilities::bendingRadius(), initBarrelLayer(), initBarrelMS(), initForwardLayer(), initForwardMS(), innerIsBarrel, TrackingRegion::originZBound(), outerIsBarrel, thePtMin, theRCurvature, and theVtxZ.

94  :
95  innerIsBarrel(layer.isBarrel()),
96  outerIsBarrel(outlayer.isBarrel()),
98  ol( outlayer.seqNum()),
99  theROrigin(region.originRBound()),
100  theRLayer(0),
101  theThickness(0),
102  theExtraTolerance(extraTolerance),
103  theA(0),
104  theB(0),
105  theVtxZ(region.origin().z()),
106  thePtMin(region.ptMin()),
107  theVtx(region.origin().x(),region.origin().y()),
108  sigma(&layer,iSetup)
109 
110 {
111  float zMinOrigin = theVtxZ-region.originZBound();
112  float zMaxOrigin = theVtxZ+region.originZBound();
114 
115 
116  if (innerIsBarrel) initBarrelLayer( layer);
117  else initForwardLayer( layer, zMinOrigin, zMaxOrigin);
118 
119  if(outerIsBarrel) initBarrelMS(outlayer);
120  else initForwardMS(outlayer);
121 
122 }
float originRBound() const
bounds the particle vertex in the transverse plane
GlobalPoint const & origin() const
void initBarrelMS(const DetLayer &outLayer)
T y() const
Definition: PV3DBase.h:63
Point2D theVtx
Definition: InnerDeltaPhi.h:61
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
void initForwardMS(const DetLayer &outLayer)
float theThickness
Definition: InnerDeltaPhi.h:49
void initBarrelLayer(const DetLayer &layer)
float theRCurvature
Definition: InnerDeltaPhi.h:53
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:54
T x() const
Definition: PV3DBase.h:62
MultipleScatteringParametrisation sigma
Definition: InnerDeltaPhi.h:64

Member Function Documentation

void InnerDeltaPhi::initBarrelLayer ( const DetLayer layer)
private

Definition at line 155 of file InnerDeltaPhi.cc.

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

Referenced by InnerDeltaPhi().

156 {
157  const BarrelDetLayer& bl = static_cast<const BarrelDetLayer&>(layer);
158  float rLayer = bl.specificSurface().radius();
159 
160  // the maximal delta phi will be for the innermost hits
161  theThickness = layer.surface().bounds().thickness();
162  theRLayer = rLayer - 0.5f*theThickness;
163 }
const Bounds & bounds() const
Definition: Surface.h:120
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
float theThickness
Definition: InnerDeltaPhi.h:49
virtual float thickness() const =0
void InnerDeltaPhi::initBarrelMS ( const DetLayer outLayer)
private

Definition at line 125 of file InnerDeltaPhi.cc.

References Surface::bounds(), Bounds::length(), ol, sigma, BarrelDetLayer::specificSurface(), GeometricSearchDet::surface(), theDeltaScatt, thePtMin, and theScatt0.

Referenced by InnerDeltaPhi().

125  {
126  const BarrelDetLayer& bl = static_cast<const BarrelDetLayer&>(outLayer);
127  float rLayer = bl.specificSurface().radius();
128  auto zmax = 0.5f*outLayer.surface().bounds().length();
129  PixelRecoPointRZ zero(0., 0.);
130  PixelRecoPointRZ point1(rLayer, 0.);
131  PixelRecoPointRZ point2(rLayer, zmax);
132  auto scatt1 = 3.f*sigma(thePtMin,zero, point1, ol);
133  auto scatt2 = 3.f*sigma(thePtMin,zero, point2, ol);
134  theDeltaScatt = (scatt2-scatt1)/zmax;
135  theScatt0 = scatt1;
136 }
virtual float length() const =0
const Bounds & bounds() const
Definition: Surface.h:120
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
float theDeltaScatt
Definition: InnerDeltaPhi.h:51
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
MultipleScatteringParametrisation sigma
Definition: InnerDeltaPhi.h:64
void InnerDeltaPhi::initForwardLayer ( const DetLayer layer,
float  zMinOrigin,
float  zMaxOrigin 
)
private

Definition at line 165 of file InnerDeltaPhi.cc.

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

Referenced by InnerDeltaPhi().

167 {
168  const ForwardDetLayer &fl = static_cast<const ForwardDetLayer&>(layer);
169  theRLayer = fl.specificSurface().innerRadius();
170  float layerZ = layer.position().z();
171  theThickness = layer.surface().bounds().thickness();
172  float layerZmin = layerZ > 0 ? layerZ-0.5f*theThickness: layerZ+0.5f*theThickness;
173  theB = layerZ > 0 ? zMaxOrigin : zMinOrigin;
174  theA = layerZmin - theB;
175 }
const Bounds & bounds() const
Definition: Surface.h:120
T z() const
Definition: PV3DBase.h:64
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
virtual const BoundDisk & specificSurface() const final
float theThickness
Definition: InnerDeltaPhi.h:49
virtual float thickness() const =0
virtual const Surface::PositionType & position() const
Returns position of the surface.
void InnerDeltaPhi::initForwardMS ( const DetLayer outLayer)
private

Definition at line 138 of file InnerDeltaPhi.cc.

References ol, GeometricSearchDet::position(), sigma, ForwardDetLayer::specificSurface(), theDeltaScatt, thePtMin, theScatt0, theVtxZ, and PV3DBase< T, PVType, FrameType >::z().

Referenced by InnerDeltaPhi().

138  {
139  const ForwardDetLayer &fl = static_cast<const ForwardDetLayer&>(outLayer);
140  auto minR = fl.specificSurface().innerRadius();
141  auto maxR = fl.specificSurface().outerRadius();
142  auto layerZ = outLayer.position().z();
143  // compute min and max multiple scattering correction
144  PixelRecoPointRZ zero(0., theVtxZ);
145  PixelRecoPointRZ point1(minR, layerZ);
146  PixelRecoPointRZ point2(maxR, layerZ);
147  auto scatt1 = 3.f*sigma(thePtMin,zero, point1, ol);
148  auto scatt2 = 3.f*sigma(thePtMin,zero, point2, ol);
149  theDeltaScatt = (scatt2-scatt1)/(maxR-minR);
150  theScatt0 = scatt1 - theDeltaScatt*minR;
151 }
float theDeltaScatt
Definition: InnerDeltaPhi.h:51
T z() const
Definition: PV3DBase.h:64
virtual const BoundDisk & specificSurface() const final
virtual const Surface::PositionType & position() const
Returns position of the surface.
MultipleScatteringParametrisation sigma
Definition: InnerDeltaPhi.h:64
PixelRecoRange<float> InnerDeltaPhi::operator() ( float  xHit,
float  yHit,
float  zHit,
float  errRPhi 
) const
inline

Definition at line 36 of file InnerDeltaPhi.h.

36  {
37  return phiRange( Point2D(xHit,yHit), zHit, errRPhi);
38  }
PixelRecoRange< float > phiRange(const Point2D &hitXY, float zHit, float errRPhi) const
Basic2DVector< float > Point2D
Definition: InnerDeltaPhi.h:23
PixelRecoRange< float > InnerDeltaPhi::phiRange ( const Point2D hitXY,
float  zHit,
float  errRPhi 
) const
private

Definition at line 179 of file InnerDeltaPhi.cc.

References funct::abs(), hiPixelPairStep_cff::deltaPhi, Basic2DVector< T >::dot(), dt, MillePedeFileConverter_cfg::e, f, objects.autophobj::float, innerIsBarrel, M_PI, Basic2DVector< T >::mag(), margin, SiStripPI::max, min(), pileupDistInMC::num, outerIsBarrel, funct::sqr(), mathSSE::sqrt(), lumiQTWidget::t, theA, theB, theDeltaScatt, theExtraTolerance, thePrecise, theRCurvature, theRLayer, theROrigin, theScatt0, theThickness, theVtx, Basic2DVector< T >::unit(), and w.

180 {
181  float rLayer = theRLayer;
182  Point2D crossing;
183 
184  Point2D dHit = hitXY-theVtx;
185  auto dHitmag = dHit.mag();
186  float dLayer = 0.;
187  float dL = 0.;
188 
189  // track is crossing layer with angle such as:
190  // this factor should be taken in computation of eror projection
191  float cosCross = 0;
192 
193 
194  //
195  // compute crossing of stright track with inner layer
196  //
197  if (!innerIsBarrel) {
198  auto t = theA/(hitZ-theB); auto dt = std::abs(theThickness/(hitZ-theB));
199  crossing = theVtx + t*dHit;
200  rLayer = crossing.mag();
201  dLayer = t*dHitmag; dL = dt * dHitmag;
202  cosCross = std::abs( dHit.unit().dot(crossing.unit()));
203  } else {
204 
205  //
206  // compute crossing of track with layer
207  // dHit - from VTX to outer hit
208  // rLayer - layer radius
209  // dLayer - distance from VTX to inner layer in direction of dHit
210  // vect(rLayer) = vect(rVTX) + vect(dHit).unit * dLayer
211  // rLayer^2 = (vect(rVTX) + vect(dHit).unit * dLayer)^2 and we have square eqation for dLayer
212  //
213  // barrel case
214  //
215  auto vtxmag2 = theVtx.mag2();
216  if (vtxmag2 < 1.e-10f) {
217  dLayer = rLayer;
218  }
219  else {
220  // there are cancellation here....
221  double var_c = vtxmag2-sqr(rLayer);
222  double var_b = theVtx.dot(dHit.unit());
223  double var_delta = sqr(var_b)-var_c;
224  if (var_delta <=0.) var_delta = 0;
225  dLayer = -var_b + std::sqrt(var_delta); //only the value along vector is OK.
226  }
227  crossing = theVtx+ dHit.unit() * dLayer;
228  cosCross = std::abs( dHit.unit().dot(crossing.unit()));
229  dL = theThickness/cosCross;
230  }
231 
232 #ifdef USE_VECTORS_HERE
233  cms_float32x4_t num{dHitmag,dLayer,theROrigin * (dHitmag-dLayer),1.f};
234  cms_float32x4_t den{2*theRCurvature,2*theRCurvature,dHitmag*dLayer,1.f};
235  auto phis = f_asin07f(num/den);
236  phis = phis*dLayer/(rLayer*cosCross);
237  auto deltaPhi = std::abs(phis[0]-phis[1]);
238  auto deltaPhiOrig = phis[2];
239 #else
240 #warning no vector!
241  auto alphaHit = cropped_asin( dHitmag/(2*theRCurvature));
242  auto OdeltaPhi = std::abs( alphaHit - cropped_asin( dLayer/(2*theRCurvature)));
243  OdeltaPhi *= dLayer/(rLayer*cosCross);
244  // compute additional delta phi due to origin radius
245  auto OdeltaPhiOrig = cropped_asin( theROrigin * (dHitmag-dLayer) / (dHitmag*dLayer));
246  OdeltaPhiOrig *= dLayer/(rLayer*cosCross);
247  // std::cout << "dphi " << OdeltaPhi<<'/'<<OdeltaPhiOrig << ' ' << deltaPhi<<'/'<<deltaPhiOrig << std::endl;
248 
249  auto deltaPhi = OdeltaPhi;
250  auto deltaPhiOrig = OdeltaPhiOrig;
251 #endif
252 
253  // additinal angle due to not perpendicular stright line crossing (for displaced beam)
254  // double dPhiCrossing = (cosCross > 0.9999) ? 0 : dL * sqrt(1-sqr(cosCross))/ rLayer;
255  Point2D crossing2 = theVtx + dHit.unit()* (dLayer+dL);
256  auto phicross2 = f_phi(crossing2);
257  auto phicross1 = f_phi(crossing);
258  auto dphicross = phicross2-phicross1;
259  if (dphicross < -float(M_PI)) dphicross += float(2*M_PI);
260  if (dphicross > float(M_PI)) dphicross -= float(2*M_PI);
261  if (dphicross > float(M_PI/2)) dphicross = 0.; // something wrong?
262  phicross2 = phicross1 + dphicross;
263 
264 
265 
266  // inner hit error taken as constant
267  auto deltaPhiHit = theExtraTolerance / rLayer;
268 
269  // outer hit error
270  // double deltaPhiHitOuter = errRPhi/rLayer;
271  auto deltaPhiHitOuter = errRPhi/hitXY.mag();
272 
273  auto margin = deltaPhi+deltaPhiOrig+deltaPhiHit+deltaPhiHitOuter ;
274 
275  if (thePrecise) {
276  // add multiple scattering correction
277 
278  /*
279  PixelRecoPointRZ zero(0., theVtxZ);
280  PixelRecoPointRZ point(hitXY.mag(), hitZ);
281  auto scatt = 3.f*sigma(thePtMin,zero, point, ol);
282  */
283 
284  auto w = outerIsBarrel ? std::abs(hitZ) : hitXY.mag();
285  auto nscatt = theScatt0 + theDeltaScatt*w;
286 
287  // std::cout << "scatt " << (outerIsBarrel ? "B" : "F") << (innerIsBarrel ? "B " : "F ")
288  // << scatt << ' ' << nscatt << ' ' << nscatt/scatt << std::endl;
289 
290  margin += nscatt/ rLayer ;
291  }
292 
293  return PixelRecoRange<float>( std::min(phicross1,phicross2)-margin,
294  std::max(phicross1,phicross2)+margin);
295 }
float dt
Definition: AMPTWrapper.h:126
const double w
Definition: UKUtility.cc:23
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Point2D theVtx
Definition: InnerDeltaPhi.h:61
Basic2DVector unit() const
float theDeltaScatt
Definition: InnerDeltaPhi.h:51
T sqrt(T t)
Definition: SSEVec.h:18
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:49
float theRCurvature
Definition: InnerDeltaPhi.h:53
Square< F >::type sqr(const F &f)
Definition: Square.h:13
float theExtraTolerance
Definition: InnerDeltaPhi.h:54
bool InnerDeltaPhi::prefilter ( float  xHit,
float  yHit 
) const
inline

Definition at line 32 of file InnerDeltaPhi.h.

Referenced by HitPairGeneratorFromLayerPair::doublets().

32  {
33  return xHit*xHit + yHit*yHit > theRLayer*theRLayer;
34  }

Member Data Documentation

bool InnerDeltaPhi::innerIsBarrel
private

Definition at line 42 of file InnerDeltaPhi.h.

Referenced by InnerDeltaPhi(), and phiRange().

int InnerDeltaPhi::ol
private

Definition at line 45 of file InnerDeltaPhi.h.

Referenced by initBarrelMS(), and initForwardMS().

bool InnerDeltaPhi::outerIsBarrel
private

Definition at line 43 of file InnerDeltaPhi.h.

Referenced by InnerDeltaPhi(), and phiRange().

MultipleScatteringParametrisation InnerDeltaPhi::sigma
private

Definition at line 64 of file InnerDeltaPhi.h.

Referenced by initBarrelMS(), and initForwardMS().

float InnerDeltaPhi::theA
private

Definition at line 55 of file InnerDeltaPhi.h.

Referenced by initForwardLayer(), and phiRange().

float InnerDeltaPhi::theB
private

Definition at line 56 of file InnerDeltaPhi.h.

Referenced by initForwardLayer(), and phiRange().

float InnerDeltaPhi::theDeltaScatt
private

Definition at line 51 of file InnerDeltaPhi.h.

Referenced by initBarrelMS(), initForwardMS(), and phiRange().

float InnerDeltaPhi::theExtraTolerance
private

Definition at line 54 of file InnerDeltaPhi.h.

Referenced by phiRange().

bool InnerDeltaPhi::thePrecise
private

Definition at line 44 of file InnerDeltaPhi.h.

Referenced by phiRange().

float InnerDeltaPhi::thePtMin
private

Definition at line 59 of file InnerDeltaPhi.h.

Referenced by initBarrelMS(), initForwardMS(), and InnerDeltaPhi().

float InnerDeltaPhi::theRCurvature
private

Definition at line 53 of file InnerDeltaPhi.h.

Referenced by InnerDeltaPhi(), and phiRange().

float InnerDeltaPhi::theRLayer
private

Definition at line 48 of file InnerDeltaPhi.h.

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

float InnerDeltaPhi::theROrigin
private

Definition at line 47 of file InnerDeltaPhi.h.

Referenced by phiRange().

float InnerDeltaPhi::theScatt0
private

Definition at line 50 of file InnerDeltaPhi.h.

Referenced by initBarrelMS(), initForwardMS(), and phiRange().

float InnerDeltaPhi::theThickness
private

Definition at line 49 of file InnerDeltaPhi.h.

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

Point2D InnerDeltaPhi::theVtx
private

Definition at line 61 of file InnerDeltaPhi.h.

Referenced by phiRange().

float InnerDeltaPhi::theVtxZ
private

Definition at line 58 of file InnerDeltaPhi.h.

Referenced by initForwardMS(), and InnerDeltaPhi().