CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
ThirdHitPredictionFromCircle::HelixRZ Class Reference

#include <ThirdHitPredictionFromCircle.h>

Public Types

using Scalar = ThirdHitPredictionFromCircle::Scalar
 
using Vector2D = ThirdHitPredictionFromCircle::Vector2D
 

Public Member Functions

 HelixRZ ()
 
 HelixRZ (const ThirdHitPredictionFromCircle *icircle, double iz1, double z2, double curv)
 
Scalar rAtZ (Scalar z) const
 
Scalar zAtR (Scalar r) const
 

Static Public Member Functions

static double maxCurvature (const ThirdHitPredictionFromCircle *circle, double z1, double z2, double z3)
 

Private Attributes

Vector2D center
 
const ThirdHitPredictionFromCirclecircle
 
Scalar curvature
 
Scalar dzdu
 
Scalar radius
 
Scalar seg
 
Scalar z1
 

Detailed Description

Definition at line 30 of file ThirdHitPredictionFromCircle.h.

Member Typedef Documentation

◆ Scalar

Definition at line 33 of file ThirdHitPredictionFromCircle.h.

◆ Vector2D

Definition at line 32 of file ThirdHitPredictionFromCircle.h.

Constructor & Destructor Documentation

◆ HelixRZ() [1/2]

ThirdHitPredictionFromCircle::HelixRZ::HelixRZ ( )
inline

Definition at line 37 of file ThirdHitPredictionFromCircle.h.

37 : circle(nullptr) {}

◆ HelixRZ() [2/2]

ThirdHitPredictionFromCircle::HelixRZ::HelixRZ ( const ThirdHitPredictionFromCircle icircle,
double  iz1,
double  z2,
double  curv 
)

Definition at line 208 of file ThirdHitPredictionFromCircle.cc.

212  : circle(icircle), curvature(curv), radius(1. / curv), z1(iz1) {
213  Scalar orthog = sgn(curv) * clamped_sqrt(radius * radius - circle->delta2);
214  center = circle->center + orthog * circle->axis;
215 
216  Scalar absCurv = std::abs(curv);
217  seg = circle->delta;
218  seg = arc(absCurv, seg);
219  dzdu = (z2 - z1) / seg;
220 }

References funct::abs(), ThirdHitPredictionFromCircle::axis, center, ThirdHitPredictionFromCircle::center, circle, ThirdHitPredictionFromCircle::delta, ThirdHitPredictionFromCircle::delta2, dzdu, radius, seg, FWPFMaths::sgn(), z1, and testProducerWithPsetDescEmpty_cfi::z2.

Member Function Documentation

◆ maxCurvature()

double ThirdHitPredictionFromCircle::HelixRZ::maxCurvature ( const ThirdHitPredictionFromCircle circle,
double  z1,
double  z2,
double  z3 
)
static

Definition at line 222 of file ThirdHitPredictionFromCircle.cc.

225  {
226  constexpr double maxAngle = M_PI;
227  double halfAngle = (0.5 * maxAngle) * (z2 - z1) / (z3 - z1);
228  if (UNLIKELY(halfAngle <= 0.0))
229  return 0.0;
230 
231  return std::sin(halfAngle) / circle->delta;
232 }

References ThirdHitPredictionFromCircle::delta, M_PI, funct::sin(), UNLIKELY, and testProducerWithPsetDescEmpty_cfi::z2.

Referenced by PixelTripletLargeTipGenerator::hitTriplets().

◆ rAtZ()

ThirdHitPredictionFromCircle::HelixRZ::Scalar ThirdHitPredictionFromCircle::HelixRZ::rAtZ ( Scalar  z) const

Definition at line 262 of file ThirdHitPredictionFromCircle.cc.

262  {
263  if (UNLIKELY(std::abs(dzdu) < 1.0e-5))
264  return 99999.0;
265 
266  if (UNLIKELY(std::abs(curvature) < 1.0e-5)) {
267  Scalar tip = circle->axis * circle->p1;
268  Scalar lip = circle->axis.y() * circle->p1.x() - circle->axis.x() * circle->p1.y();
269  return std::sqrt(sqr(tip) + sqr(lip + (z - z1) / dzdu));
270  }
271 
272  // we won't go below that (see comment below)
273  Scalar minR2 = (2. * circle->center - circle->p1).mag2();
274 
275  float phi = curvature * (z - z1) / dzdu;
276 
277  if (UNLIKELY(std::abs(phi) > 2. * M_PI)) {
278  // with a helix we can get problems here - this is used to get the limits
279  // however, if phi gets large, we get into the regions where we loop back
280  // to smaller r's. The question is - do we care about these tracks?
281  // The answer is probably no: Too much pain, and the rest of the
282  // tracking won't handle looping tracks anyway.
283  // So, what we do here is to return nothing smaller than the radius
284  // than any of the two hits, i.e. the second hit, which is presumably
285  // outside of the 1st hit.
286 
287  return std::sqrt(minR2);
288  }
289 
290  Vector2D rel = circle->p1 - center;
291 
292  float c;
293  float s;
294  vdt::fast_sincosf(phi, s, c);
295 
296  Vector2D p(center.x() + c * rel.x() - s * rel.y(), center.y() + s * rel.x() + c * rel.y());
297 
298  return std::sqrt(std::max(minR2, p.mag2()));
299 }

References funct::abs(), c, ThirdHitPredictionFromCircle::center, ThirdHitPredictionFromCircle::curvature(), MillePedeFileConverter_cfg::e, qcdUeDQM_cfi::lip, M_PI, mag2(), SiStripPI::max, AlCaHLTBitMon_ParallelJobs::p, ThirdHitPredictionFromCircle::phi(), RefreshWebPage::rel, alignCSCRings::s, sqr(), mathSSE::sqrt(), qcdUeDQM_cfi::tip, UNLIKELY, Basic2DVector< T >::x(), Basic2DVector< T >::y(), and z.

◆ zAtR()

ThirdHitPredictionFromCircle::HelixRZ::Scalar ThirdHitPredictionFromCircle::HelixRZ::zAtR ( Scalar  r) const

Definition at line 234 of file ThirdHitPredictionFromCircle.cc.

234  {
235  if (UNLIKELY(std::abs(curvature) < 1.0e-5)) {
236  Scalar tip = circle->axis * circle->p1;
237  Scalar lip = circle->axis.y() * circle->p1.x() - circle->axis.x() * circle->p1.y();
238  return z1 + (std::sqrt(sqr(r) - sqr(tip)) - lip) * dzdu;
239  }
240 
241  Scalar radius2 = sqr(radius);
242 
243  Scalar b2 = center.mag2();
244  Scalar b = std::sqrt(b2);
245 
246  Scalar cos1 = 0.5 * curvature * (radius2 + b2 - sqr(r)) / b;
247  Scalar cos2 = 0.5 * curvature * (radius2 + b2 - circle->p1.mag2()) / b;
248 
249  Scalar phi1 = clamped_acos(cos1);
250  Scalar phi2 = clamped_acos(cos2);
251 
252  // more plausbility checks needed...
253  // the two circles can have two possible intersections
254  Scalar u1 = std::abs((phi1 - phi2) * radius);
255  Scalar u2 = std::abs((phi1 + phi2) * radius);
256 
257  return z1 + ((u1 >= seg && u1 < u2) ? u1 : u2) * dzdu;
258 }

References funct::abs(), b, b2, ThirdHitPredictionFromCircle::center, ThirdHitPredictionFromCircle::curvature(), MillePedeFileConverter_cfg::e, qcdUeDQM_cfi::lip, Basic2DVector< T >::mag2(), alignCSCRings::r, CosmicsPD_Skims::radius, sqr(), mathSSE::sqrt(), qcdUeDQM_cfi::tip, testProducerWithPsetDescEmpty_cfi::u1, MetAnalyzer::u2, and UNLIKELY.

Member Data Documentation

◆ center

Vector2D ThirdHitPredictionFromCircle::HelixRZ::center
private

Definition at line 47 of file ThirdHitPredictionFromCircle.h.

Referenced by HelixRZ().

◆ circle

const ThirdHitPredictionFromCircle* ThirdHitPredictionFromCircle::HelixRZ::circle
private

Definition at line 46 of file ThirdHitPredictionFromCircle.h.

Referenced by HelixRZ().

◆ curvature

Scalar ThirdHitPredictionFromCircle::HelixRZ::curvature
private

Definition at line 48 of file ThirdHitPredictionFromCircle.h.

◆ dzdu

Scalar ThirdHitPredictionFromCircle::HelixRZ::dzdu
private

Definition at line 48 of file ThirdHitPredictionFromCircle.h.

Referenced by HelixRZ().

◆ radius

Scalar ThirdHitPredictionFromCircle::HelixRZ::radius
private

Definition at line 48 of file ThirdHitPredictionFromCircle.h.

Referenced by HelixRZ().

◆ seg

Scalar ThirdHitPredictionFromCircle::HelixRZ::seg
private

Definition at line 48 of file ThirdHitPredictionFromCircle.h.

Referenced by HelixRZ().

◆ z1

Scalar ThirdHitPredictionFromCircle::HelixRZ::z1
private

Definition at line 48 of file ThirdHitPredictionFromCircle.h.

Referenced by HelixRZ().

ThirdHitPredictionFromCircle::HelixRZ::circle
const ThirdHitPredictionFromCircle * circle
Definition: ThirdHitPredictionFromCircle.h:46
ThirdHitPredictionFromCircle::delta2
Scalar delta2
Definition: ThirdHitPredictionFromCircle.h:57
ThirdHitPredictionFromCircle::HelixRZ::dzdu
Scalar dzdu
Definition: ThirdHitPredictionFromCircle.h:48
ThirdHitPredictionFromCircle::HelixRZ::radius
Scalar radius
Definition: ThirdHitPredictionFromCircle.h:48
sqr
int sqr(const T &t)
Definition: pfalgo_common_ref.h:9
ThirdHitPredictionFromCircle::p1
Vector2D p1
Definition: ThirdHitPredictionFromCircle.h:56
ThirdHitPredictionFromCircle::delta
Scalar delta
Definition: ThirdHitPredictionFromCircle.h:57
FWPFMaths::sgn
float sgn(float val)
Definition: FWPFMaths.cc:9
ThirdHitPredictionFromCircle::center
Vector2D center
Definition: ThirdHitPredictionFromCircle.h:56
b2
static constexpr float b2
Definition: L1EGammaCrystalsEmulatorProducer.cc:83
qcdUeDQM_cfi.lip
lip
Definition: qcdUeDQM_cfi.py:25
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
testProducerWithPsetDescEmpty_cfi.z2
z2
Definition: testProducerWithPsetDescEmpty_cfi.py:41
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
alignCSCRings.s
s
Definition: alignCSCRings.py:92
Basic2DVector::y
T y() const
Cartesian y coordinate.
Definition: extBasic2DVector.h:67
ThirdHitPredictionFromCircle::HelixRZ::center
Vector2D center
Definition: ThirdHitPredictionFromCircle.h:47
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DDAxes::z
Basic2DVector::x
T x() const
Cartesian x coordinate.
Definition: extBasic2DVector.h:64
ThirdHitPredictionFromCircle::HelixRZ::curvature
Scalar curvature
Definition: ThirdHitPredictionFromCircle.h:48
b
double b
Definition: hdecay.h:118
ThirdHitPredictionFromCircle::phi
float phi(float curvature, float radius) const
Definition: ThirdHitPredictionFromCircle.cc:61
qcdUeDQM_cfi.tip
tip
Definition: qcdUeDQM_cfi.py:23
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
Vector2D
Basic2DVector< double >::MathVector Vector2D
Definition: LinkByRecHit.cc:7
ThirdHitPredictionFromCircle::HelixRZ::Scalar
ThirdHitPredictionFromCircle::Scalar Scalar
Definition: ThirdHitPredictionFromCircle.h:33
testProducerWithPsetDescEmpty_cfi.u1
u1
Definition: testProducerWithPsetDescEmpty_cfi.py:49
mag2
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Definition: Basic3DVectorLD.h:124
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
alignCSCRings.r
r
Definition: alignCSCRings.py:93
RefreshWebPage.rel
rel
Definition: RefreshWebPage.py:66
Basic2DVector::mag2
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Definition: extBasic2DVector.h:70
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
ThirdHitPredictionFromCircle::HelixRZ::seg
Scalar seg
Definition: ThirdHitPredictionFromCircle.h:48
MetAnalyzer.u2
u2
Definition: MetAnalyzer.py:61
ThirdHitPredictionFromCircle::axis
Vector2D axis
Definition: ThirdHitPredictionFromCircle.h:56
ThirdHitPredictionFromCircle::HelixRZ::z1
Scalar z1
Definition: ThirdHitPredictionFromCircle.h:48
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37