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

Member Typedef Documentation

◆ Point2D

Definition at line 21 of file InnerDeltaPhi.h.

Constructor & Destructor Documentation

◆ InnerDeltaPhi()

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

89  : innerIsBarrel(layer.isBarrel()),
90  outerIsBarrel(outlayer.isBarrel()),
92  ol(outlayer.seqNum()),
93  theROrigin(region.originRBound()),
94  theRLayer(0),
95  theThickness(0),
96  theExtraTolerance(extraTolerance),
97  theA(0),
98  theB(0),
99  theVtxZ(region.origin().z()),
100  thePtMin(region.ptMin()),
101  theVtx(region.origin().x(), region.origin().y()),
102  sigma(&layer, iSetup)
103 
104 {
105  float zMinOrigin = theVtxZ - region.originZBound();
106  float zMaxOrigin = theVtxZ + region.originZBound();
108 
109  if (innerIsBarrel)
111  else
112  initForwardLayer(layer, zMinOrigin, zMaxOrigin);
113 
114  if (outerIsBarrel)
115  initBarrelMS(outlayer);
116  else
117  initForwardMS(outlayer);
118 }

References PixelRecoUtilities::bendingRadius(), initBarrelLayer(), initBarrelMS(), initForwardLayer(), initForwardMS(), innerIsBarrel, phase1PixelTopology::layer, outerIsBarrel, HLT_FULL_cff::region, thePtMin, theRCurvature, and theVtxZ.

Member Function Documentation

◆ initBarrelLayer()

void InnerDeltaPhi::initBarrelLayer ( const DetLayer layer)
private

Definition at line 148 of file InnerDeltaPhi.cc.

148  {
149  const BarrelDetLayer& bl = static_cast<const BarrelDetLayer&>(layer);
150  float rLayer = bl.specificSurface().radius();
151 
152  // the maximal delta phi will be for the innermost hits
153  theThickness = layer.surface().bounds().thickness();
154  theRLayer = rLayer - 0.5f * theThickness;
155 }

References phase1PixelTopology::layer, BarrelDetLayer::specificSurface(), theRLayer, and theThickness.

Referenced by InnerDeltaPhi().

◆ initBarrelMS()

void InnerDeltaPhi::initBarrelMS ( const DetLayer outLayer)
private

Definition at line 120 of file InnerDeltaPhi.cc.

120  {
121  const BarrelDetLayer& bl = static_cast<const BarrelDetLayer&>(outLayer);
122  float rLayer = bl.specificSurface().radius();
123  auto zmax = 0.5f * outLayer.surface().bounds().length();
124  PixelRecoPointRZ zero(0., 0.);
125  PixelRecoPointRZ point1(rLayer, 0.);
126  PixelRecoPointRZ point2(rLayer, zmax);
127  auto scatt1 = 3.f * sigma(thePtMin, zero, point1, ol);
128  auto scatt2 = 3.f * sigma(thePtMin, zero, point2, ol);
129  theDeltaScatt = (scatt2 - scatt1) / zmax;
130  theScatt0 = scatt1;
131 }

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

Referenced by InnerDeltaPhi().

◆ initForwardLayer()

void InnerDeltaPhi::initForwardLayer ( const DetLayer layer,
float  zMinOrigin,
float  zMaxOrigin 
)
private

Definition at line 157 of file InnerDeltaPhi.cc.

157  {
158  const ForwardDetLayer& fl = static_cast<const ForwardDetLayer&>(layer);
159  theRLayer = fl.specificSurface().innerRadius();
160  float layerZ = layer.position().z();
161  theThickness = layer.surface().bounds().thickness();
162  float layerZmin = layerZ > 0 ? layerZ - 0.5f * theThickness : layerZ + 0.5f * theThickness;
163  theB = layerZ > 0 ? zMaxOrigin : zMinOrigin;
164  theA = layerZmin - theB;
165 }

References phase1PixelTopology::layer, ForwardDetLayer::specificSurface(), theA, theB, theRLayer, and theThickness.

Referenced by InnerDeltaPhi().

◆ initForwardMS()

void InnerDeltaPhi::initForwardMS ( const DetLayer outLayer)
private

Definition at line 133 of file InnerDeltaPhi.cc.

133  {
134  const ForwardDetLayer& fl = static_cast<const ForwardDetLayer&>(outLayer);
135  auto minR = fl.specificSurface().innerRadius();
136  auto maxR = fl.specificSurface().outerRadius();
137  auto layerZ = outLayer.position().z();
138  // compute min and max multiple scattering correction
140  PixelRecoPointRZ point1(minR, layerZ);
141  PixelRecoPointRZ point2(maxR, layerZ);
142  auto scatt1 = 3.f * sigma(thePtMin, zero, point1, ol);
143  auto scatt2 = 3.f * sigma(thePtMin, zero, point2, ol);
144  theDeltaScatt = (scatt2 - scatt1) / (maxR - minR);
145  theScatt0 = scatt1 - theDeltaScatt * minR;
146 }

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

Referenced by InnerDeltaPhi().

◆ operator()()

PixelRecoRange<float> InnerDeltaPhi::operator() ( float  xHit,
float  yHit,
float  zHit,
float  errRPhi 
) const
inline

Definition at line 32 of file InnerDeltaPhi.h.

32  {
33  return phiRange(Point2D(xHit, yHit), zHit, errRPhi);
34  }

◆ phiRange()

PixelRecoRange< float > InnerDeltaPhi::phiRange ( const Point2D hitXY,
float  zHit,
float  errRPhi 
) const
private

Definition at line 167 of file InnerDeltaPhi.cc.

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

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

◆ prefilter()

bool InnerDeltaPhi::prefilter ( float  xHit,
float  yHit 
) const
inline

Definition at line 30 of file InnerDeltaPhi.h.

30 { return xHit * xHit + yHit * yHit > theRLayer * theRLayer; }

Member Data Documentation

◆ innerIsBarrel

bool InnerDeltaPhi::innerIsBarrel
private

Definition at line 37 of file InnerDeltaPhi.h.

Referenced by InnerDeltaPhi(), and phiRange().

◆ ol

int InnerDeltaPhi::ol
private

Definition at line 40 of file InnerDeltaPhi.h.

Referenced by initBarrelMS(), and initForwardMS().

◆ outerIsBarrel

bool InnerDeltaPhi::outerIsBarrel
private

Definition at line 38 of file InnerDeltaPhi.h.

Referenced by InnerDeltaPhi(), and phiRange().

◆ sigma

MultipleScatteringParametrisation InnerDeltaPhi::sigma
private

Definition at line 58 of file InnerDeltaPhi.h.

Referenced by initBarrelMS(), and initForwardMS().

◆ theA

float InnerDeltaPhi::theA
private

Definition at line 50 of file InnerDeltaPhi.h.

Referenced by initForwardLayer(), and phiRange().

◆ theB

float InnerDeltaPhi::theB
private

Definition at line 51 of file InnerDeltaPhi.h.

Referenced by initForwardLayer(), and phiRange().

◆ theDeltaScatt

float InnerDeltaPhi::theDeltaScatt
private

Definition at line 46 of file InnerDeltaPhi.h.

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

◆ theExtraTolerance

float InnerDeltaPhi::theExtraTolerance
private

Definition at line 49 of file InnerDeltaPhi.h.

Referenced by phiRange().

◆ thePrecise

bool InnerDeltaPhi::thePrecise
private

Definition at line 39 of file InnerDeltaPhi.h.

Referenced by phiRange().

◆ thePtMin

float InnerDeltaPhi::thePtMin
private

Definition at line 54 of file InnerDeltaPhi.h.

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

◆ theRCurvature

float InnerDeltaPhi::theRCurvature
private

Definition at line 48 of file InnerDeltaPhi.h.

Referenced by InnerDeltaPhi(), and phiRange().

◆ theRLayer

float InnerDeltaPhi::theRLayer
private

Definition at line 43 of file InnerDeltaPhi.h.

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

◆ theROrigin

float InnerDeltaPhi::theROrigin
private

Definition at line 42 of file InnerDeltaPhi.h.

Referenced by phiRange().

◆ theScatt0

float InnerDeltaPhi::theScatt0
private

Definition at line 45 of file InnerDeltaPhi.h.

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

◆ theThickness

float InnerDeltaPhi::theThickness
private

Definition at line 44 of file InnerDeltaPhi.h.

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

◆ theVtx

Point2D InnerDeltaPhi::theVtx
private

Definition at line 56 of file InnerDeltaPhi.h.

Referenced by phiRange().

◆ theVtxZ

float InnerDeltaPhi::theVtxZ
private

Definition at line 53 of file InnerDeltaPhi.h.

Referenced by initForwardMS(), and InnerDeltaPhi().

dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
HLT_FULL_cff.minR
minR
Definition: HLT_FULL_cff.py:95122
hltPixelTracks_cff.precise
precise
Definition: hltPixelTracks_cff.py:32
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
min
T min(T a, T b)
Definition: MathUtil.h:58
InnerDeltaPhi::thePtMin
float thePtMin
Definition: InnerDeltaPhi.h:54
InnerDeltaPhi::theThickness
float theThickness
Definition: InnerDeltaPhi.h:44
InnerDeltaPhi::outerIsBarrel
bool outerIsBarrel
Definition: InnerDeltaPhi.h:38
InnerDeltaPhi::Point2D
Basic2DVector< float > Point2D
Definition: InnerDeltaPhi.h:21
sqr
int sqr(const T &t)
Definition: pfalgo_common_ref.h:9
SiPixelPI::zero
Definition: SiPixelPayloadInspectorHelper.h:39
Basic2DVector::mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: extBasic2DVector.h:73
GeometricSearchDet::position
virtual const Surface::PositionType & position() const
Returns position of the surface.
Definition: GeometricSearchDet.h:31
Bounds::length
virtual float length() const =0
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
dt
float dt
Definition: AMPTWrapper.h:136
InnerDeltaPhi::theRLayer
float theRLayer
Definition: InnerDeltaPhi.h:43
InnerDeltaPhi::initForwardMS
void initForwardMS(const DetLayer &outLayer)
Definition: InnerDeltaPhi.cc:133
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
InnerDeltaPhi::theRCurvature
float theRCurvature
Definition: InnerDeltaPhi.h:48
w
const double w
Definition: UKUtility.cc:23
Basic2DVector::dot
T dot(const Basic2DVector &lh) const
Scalar product, or "dot" product, with a vector of same type.
Definition: extBasic2DVector.h:126
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
InnerDeltaPhi::phiRange
PixelRecoRange< float > phiRange(const Point2D &hitXY, float zHit, float errRPhi) const
Definition: InnerDeltaPhi.cc:167
InnerDeltaPhi::thePrecise
bool thePrecise
Definition: InnerDeltaPhi.h:39
DetLayer::seqNum
int seqNum() const
Definition: DetLayer.h:35
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
Basic2DVector< double >
PixelRecoRange< float >
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
InnerDeltaPhi::theExtraTolerance
float theExtraTolerance
Definition: InnerDeltaPhi.h:49
InnerDeltaPhi::initBarrelMS
void initBarrelMS(const DetLayer &outLayer)
Definition: InnerDeltaPhi.cc:120
InnerDeltaPhi::initForwardLayer
void initForwardLayer(const DetLayer &layer, float zMinOrigin, float zMaxOrigin)
Definition: InnerDeltaPhi.cc:157
InnerDeltaPhi::theROrigin
float theROrigin
Definition: InnerDeltaPhi.h:42
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88267
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
InnerDeltaPhi::sigma
MultipleScatteringParametrisation sigma
Definition: InnerDeltaPhi.h:58
InnerDeltaPhi::theScatt0
float theScatt0
Definition: InnerDeltaPhi.h:45
Basic2DVector::unit
Basic2DVector unit() const
Definition: extBasic2DVector.h:88
BarrelDetLayer
Definition: BarrelDetLayer.h:22
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
PixelRecoPointRZ
Definition: PixelRecoPointRZ.h:6
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
ForwardDetLayer
Definition: ForwardDetLayer.h:22
InnerDeltaPhi::theDeltaScatt
float theDeltaScatt
Definition: InnerDeltaPhi.h:46
InnerDeltaPhi::theA
float theA
Definition: InnerDeltaPhi.h:50
InnerDeltaPhi::theB
float theB
Definition: InnerDeltaPhi.h:51
Basic2DVector::mag2
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Definition: extBasic2DVector.h:70
InnerDeltaPhi::initBarrelLayer
void initBarrelLayer(const DetLayer &layer)
Definition: InnerDeltaPhi.cc:148
InnerDeltaPhi::theVtx
Point2D theVtx
Definition: InnerDeltaPhi.h:56
InnerDeltaPhi::ol
int ol
Definition: InnerDeltaPhi.h:40
GeometricSearchDet::surface
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
InnerDeltaPhi::theVtxZ
float theVtxZ
Definition: InnerDeltaPhi.h:53
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
PixelRecoUtilities::bendingRadius
T bendingRadius(T pt, const edm::EventSetup &iSetup)
Definition: PixelRecoUtilities.h:34
BarrelDetLayer::specificSurface
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
Definition: BarrelDetLayer.h:39
InnerDeltaPhi::innerIsBarrel
bool innerIsBarrel
Definition: InnerDeltaPhi.h:37
DetLayer::isBarrel
bool isBarrel() const
Definition: DetLayer.h:31
ForwardDetLayer::specificSurface
virtual const BoundDisk & specificSurface() const final
Definition: ForwardDetLayer.h:39
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
margin
Double_t margin
Definition: trackSplitPlot.h:45