CMS 3D CMS Logo

Functions
barrelUtil Namespace Reference

Functions

float calculatePhiWindow (float Xmax, const GeomDet &det, const TrajectoryStateOnSurface &state)
 
float computeWindowSize (const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
 
bool overlap (float phi, const GeometricSearchDet &gsdet, float phiWin)
 

Function Documentation

◆ calculatePhiWindow()

float barrelUtil::calculatePhiWindow ( float  Xmax,
const GeomDet det,
const TrajectoryStateOnSurface state 
)
inline

Definition at line 15 of file BarrelUtil.h.

References funct::abs(), PV3DBase< T, PVType, FrameType >::barePhi(), SiStripPI::min, edm::shift, GeomDet::surface(), Surface::toGlobal(), and PixelVTXMonitor_cfi::Xmax.

Referenced by computeWindowSize().

15  {
16  LocalPoint startPoint = state.localPosition();
17  LocalVector shift(Xmax, 0., 0.);
18  LocalPoint shift1 = startPoint + shift;
19  LocalPoint shift2 = startPoint + (-shift);
20  //LocalPoint shift2( startPoint); //original code;
21  //shift2 -= shift;
22 
23  auto phi1 = det.surface().toGlobal(shift1).barePhi();
24  auto phi2 = det.surface().toGlobal(shift2).barePhi();
25  auto phiStart = state.globalPosition().barePhi();
26  auto phiWin = std::min(std::abs(phiStart - phi1), std::abs(phiStart - phi2));
27 
28  return phiWin;
29  }
T barePhi() const
Definition: PV3DBase.h:65
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
static unsigned int const shift

◆ computeWindowSize()

float barrelUtil::computeWindowSize ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
)
inline

Definition at line 31 of file BarrelUtil.h.

References calculatePhiWindow(), MeasurementEstimator::maximalLocalDisplacement(), GeomDet::surface(), x, and TrackerOfflineValidation_Dqm_cff::xmax.

Referenced by TBPLayer::computeWindowSize().

33  {
34  auto xmax = est.maximalLocalDisplacement(tsos, det->surface()).x();
35  return calculatePhiWindow(xmax, *det, tsos);
36  }
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
float calculatePhiWindow(float Xmax, const GeomDet &det, const TrajectoryStateOnSurface &state)
Definition: BarrelUtil.h:15
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
float x

◆ overlap()

bool barrelUtil::overlap ( float  phi,
const GeometricSearchDet gsdet,
float  phiWin 
)
inline

Definition at line 38 of file BarrelUtil.h.

References ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), Geom::phiLess(), gmtStubs_cfi::phiOffset, Surface::phiSpan(), rangesIntersect(), GeometricSearchDet::surface(), and x.

Referenced by TBPLayer::searchNeighbors().

38  {
39  // introduce offset (extrapolated point and true propagated point differ by 0.0003 - 0.00033,
40  // due to thickness of Rod of 1 cm)
41  constexpr float phiOffset = 0.00034; //...TOBE CHECKED LATER...
42  phiWin += phiOffset;
43 
44  // detector phi range
45  std::pair<float, float> phiRange(phi - phiWin, phi + phiWin);
46 
47  return rangesIntersect(phiRange, gsdet.surface().phiSpan(), [](auto x, auto y) { return Geom::phiLess(x, y); });
48  }
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
std::pair< float, float > const & phiSpan() const
Definition: Surface.h:90
bool phiLess(float phi1, float phi2)
Definition: VectorUtil.h:18
bool rangesIntersect(const Range &a, const Range &b)
float x