CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
FastHelix Class Reference

#include <FastHelix.h>

Public Member Functions

const FastCirclecircle () const
 
 FastHelix (const GlobalPoint &oHit, const GlobalPoint &mHit, const GlobalPoint &aVertex, double nomField, MagneticField const *ibField)
 
 FastHelix (const GlobalPoint &oHit, const GlobalPoint &mHit, const GlobalPoint &aVertex, double nomField, MagneticField const *ibField, const GlobalPoint &bVertex)
 
bool isValid () const
 
GlobalTrajectoryParameters stateAtVertex () const
 
 ~FastHelix ()
 

Private Member Functions

void compute ()
 
void helixStateAtVertex ()
 
GlobalPoint const & middleHit () const
 
GlobalPoint const & outerHit () const
 
void straightLineStateAtVertex ()
 
GlobalPoint const & vertex () const
 

Private Attributes

GlobalTrajectoryParameters atVertex
 
GlobalPoint basisVertex
 
MagneticField const * bField
 
float maxRho
 
float tesla0
 
FastCircle theCircle
 
bool useBasisVertex
 

Static Private Attributes

static constexpr float maxPt = 10000
 

Detailed Description

Definition at line 26 of file FastHelix.h.

Constructor & Destructor Documentation

◆ FastHelix() [1/2]

FastHelix::FastHelix ( const GlobalPoint oHit,
const GlobalPoint mHit,
const GlobalPoint aVertex,
double  nomField,
MagneticField const *  ibField 
)
inline

Definition at line 29 of file FastHelix.h.

34  : bField(ibField), theCircle(oHit, mHit, aVertex) {
35  tesla0 = 0.1 * nomField;
36  maxRho = maxPt / (0.01 * 0.3 * tesla0);
37  useBasisVertex = false;
38  compute();
39  }

References compute(), maxPt, maxRho, tesla0, and useBasisVertex.

◆ FastHelix() [2/2]

FastHelix::FastHelix ( const GlobalPoint oHit,
const GlobalPoint mHit,
const GlobalPoint aVertex,
double  nomField,
MagneticField const *  ibField,
const GlobalPoint bVertex 
)
inline

Definition at line 42 of file FastHelix.h.

48  : bField(ibField), basisVertex(bVertex), theCircle(oHit, mHit, aVertex) {
49  tesla0 = 0.1 * nomField;
50  maxRho = maxPt / (0.01 * 0.3 * tesla0);
51  useBasisVertex = true;
52  compute();
53  }

References compute(), maxPt, maxRho, tesla0, and useBasisVertex.

◆ ~FastHelix()

FastHelix::~FastHelix ( )
inline

Definition at line 55 of file FastHelix.h.

55 {}

Member Function Documentation

◆ circle()

const FastCircle& FastHelix::circle ( ) const
inline

Definition at line 61 of file FastHelix.h.

61 { return theCircle; }

References theCircle.

Referenced by PixelClusterShapeSeedComparitor::compatible(), and StripSubClusterShapeSeedFilter::compatible().

◆ compute()

void FastHelix::compute ( )
private

◆ helixStateAtVertex()

void FastHelix::helixStateAtVertex ( )
private

Definition at line 11 of file FastHelix.cc.

11  {
12  // given the above rho>0.
13  double rho = theCircle.rho();
14  //remember (radius rho in cm):
15  //rho =
16  //100. * pt *
17  //(10./(3.*MagneticField::inTesla(GlobalPoint(0., 0., 0.)).z()));
18 
19  // pt = 0.01 * rho * (0.3*MagneticField::inTesla(GlobalPoint(0.,0.,0.)).z());
20  double cm2GeV = 0.01 * 0.3 * tesla0;
21  double pt = cm2GeV * rho;
22 
23  // verify that rho is not toooo large
24  double dcphi = ((outerHit().x() - theCircle.x0()) * (middleHit().x() - theCircle.x0()) +
25  (outerHit().y() - theCircle.y0()) * (middleHit().y() - theCircle.y0())) /
26  (rho * rho);
27  if (std::abs(dcphi) >= 1.f) {
29  return;
30  }
31 
32  GlobalPoint pMid(middleHit());
33  GlobalPoint v(vertex());
34 
35  // tangent in v (or the opposite...)
36  double px = -cm2GeV * (v.y() - theCircle.y0());
37  double py = cm2GeV * (v.x() - theCircle.x0());
38  // check sign with scalar product
39  if (px * (pMid.x() - v.x()) + py * (pMid.y() - v.y()) < 0.) {
40  px = -px;
41  py = -py;
42  }
43 
44  //calculate z0, pz
45  //(z, R*phi) linear relation in a helix
46  //with R, phi defined as radius and angle w.r.t. centre of circle
47  //in transverse plane
48  //pz = pT*(dz/d(R*phi)))
49 
50  // VI 23/01/2012
51  double dzdrphi = outerHit().z() - middleHit().z();
52  dzdrphi /= rho * acos(dcphi);
53  double pz = pt * dzdrphi;
54 
55  TrackCharge q = 1;
56  if (theCircle.x0() * py - theCircle.y0() * px < 0)
57  q = -q;
58  if (tesla0 < 0.)
59  q = -q;
60 
61  //VI
62  if (useBasisVertex) {
64  } else {
65  double z_0 = middleHit().z();
66  // assume v is before middleHit (opposite to outer)
67  double ds = ((v.x() - theCircle.x0()) * (middleHit().x() - theCircle.x0()) +
68  (v.y() - theCircle.y0()) * (middleHit().y() - theCircle.y0())) /
69  (rho * rho);
70  if (std::abs(ds) < 1.f) {
71  ds = rho * acos(ds);
72  z_0 -= ds * dzdrphi;
73  } else { // line????
74  z_0 -= std::sqrt((middleHit() - v).perp2() / (outerHit() - middleHit()).perp2()) *
75  (outerHit().z() - middleHit().z());
76  }
77 
78  //double z_old = -flfit.c()/flfit.n2();
79  // std::cout << "v:xyz, z,old,new " << v << " " << z_old << " " << z_0 << std::endl;
80 
82  }
83 }

References funct::abs(), atVertex, basisVertex, bField, middleHit(), outerHit(), perp2(), DiDispStaMuonMonitor_cfi::pt, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, data-class-funcs::q, rho, FastCircle::rho(), mathSSE::sqrt(), straightLineStateAtVertex(), tesla0, theCircle, useBasisVertex, findQualityFiles::v, vertex(), PV3DBase< T, PVType, FrameType >::x(), FastCircle::x0(), PV3DBase< T, PVType, FrameType >::y(), FastCircle::y0(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by compute().

◆ isValid()

bool FastHelix::isValid ( void  ) const
inline

◆ middleHit()

GlobalPoint const& FastHelix::middleHit ( ) const
inlineprivate

Definition at line 65 of file FastHelix.h.

65 { return theCircle.innerPoint(); }

References FastCircle::innerPoint(), and theCircle.

Referenced by helixStateAtVertex(), and straightLineStateAtVertex().

◆ outerHit()

GlobalPoint const& FastHelix::outerHit ( ) const
inlineprivate

Definition at line 64 of file FastHelix.h.

64 { return theCircle.outerPoint(); }

References FastCircle::outerPoint(), and theCircle.

Referenced by helixStateAtVertex(), and straightLineStateAtVertex().

◆ stateAtVertex()

GlobalTrajectoryParameters FastHelix::stateAtVertex ( ) const
inline

Definition at line 59 of file FastHelix.h.

59 { return atVertex; }

References atVertex.

Referenced by ConvBremSeedProducer::produce().

◆ straightLineStateAtVertex()

void FastHelix::straightLineStateAtVertex ( )
private

Definition at line 85 of file FastHelix.cc.

85  {
86  //calculate GlobalTrajectoryParameters assuming straight line...
87 
88  GlobalPoint pMid(middleHit());
89  GlobalPoint v(vertex());
90 
91  double dydx = 0.;
92  double pt = 0., px = 0., py = 0.;
93 
94  if (fabs(theCircle.n1()) > 0. || fabs(theCircle.n2()) > 0.)
95  pt = maxPt; // 10 TeV //else no pt
96  if (fabs(theCircle.n2()) > 0.) {
97  dydx = -theCircle.n1() / theCircle.n2(); //else px = 0
98  }
99  px = pt / sqrt(1. + dydx * dydx);
100  py = px * dydx;
101  // check sign with scalar product
102  if (px * (pMid.x() - v.x()) + py * (pMid.y() - v.y()) < 0.) {
103  px *= -1.;
104  py *= -1.;
105  }
106 
107  //calculate z_0 and pz at vertex using weighted mean
108  //z = z(r) = z0 + (dz/dr)*r
109  //tan(theta) = dr/dz = (dz/dr)^-1
110  //theta = atan(1./dzdr)
111  //p = pt/sin(theta)
112  //pz = p*cos(theta) = pt/tan(theta)
113 
114  FastLine flfit(outerHit(), middleHit());
115  double dzdr = -flfit.n1() / flfit.n2();
116  double pz = pt * dzdr;
117 
118  TrackCharge q = 1;
119  //VI
120 
121  if (useBasisVertex) {
123  } else {
124  double z_0 = -flfit.c() / flfit.n2();
126  }
127 }

References atVertex, basisVertex, bField, FastLine::c(), maxPt, middleHit(), FastLine::n1(), FastCircle::n1(), FastLine::n2(), FastCircle::n2(), outerHit(), DiDispStaMuonMonitor_cfi::pt, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, data-class-funcs::q, mathSSE::sqrt(), theCircle, useBasisVertex, findQualityFiles::v, vertex(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by compute(), and helixStateAtVertex().

◆ vertex()

GlobalPoint const& FastHelix::vertex ( ) const
inlineprivate

Definition at line 66 of file FastHelix.h.

66 { return theCircle.vertexPoint(); }

References theCircle, and FastCircle::vertexPoint().

Referenced by Tau.Tau::dxy(), helixStateAtVertex(), and straightLineStateAtVertex().

Member Data Documentation

◆ atVertex

GlobalTrajectoryParameters FastHelix::atVertex
private

Definition at line 76 of file FastHelix.h.

Referenced by helixStateAtVertex(), stateAtVertex(), and straightLineStateAtVertex().

◆ basisVertex

GlobalPoint FastHelix::basisVertex
private

Definition at line 77 of file FastHelix.h.

Referenced by helixStateAtVertex(), and straightLineStateAtVertex().

◆ bField

MagneticField const* FastHelix::bField
private

Definition at line 75 of file FastHelix.h.

Referenced by helixStateAtVertex(), and straightLineStateAtVertex().

◆ maxPt

constexpr float FastHelix::maxPt = 10000
staticconstexprprivate

Definition at line 73 of file FastHelix.h.

Referenced by FastHelix(), and straightLineStateAtVertex().

◆ maxRho

float FastHelix::maxRho
private

Definition at line 80 of file FastHelix.h.

Referenced by compute(), and FastHelix().

◆ tesla0

float FastHelix::tesla0
private

Definition at line 79 of file FastHelix.h.

Referenced by compute(), FastHelix(), and helixStateAtVertex().

◆ theCircle

FastCircle FastHelix::theCircle
private

◆ useBasisVertex

bool FastHelix::useBasisVertex
private

Definition at line 81 of file FastHelix.h.

Referenced by FastHelix(), helixStateAtVertex(), and straightLineStateAtVertex().

FastHelix::atVertex
GlobalTrajectoryParameters atVertex
Definition: FastHelix.h:76
TrackCharge
int TrackCharge
Definition: TrackCharge.h:4
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
FastCircle::y0
double y0() const
Definition: FastCircle.h:45
data-class-funcs.q
q
Definition: data-class-funcs.py:169
FastHelix::helixStateAtVertex
void helixStateAtVertex()
Definition: FastHelix.cc:11
FastCircle::n1
double n1() const
Definition: FastCircle.h:55
FastLine
Definition: FastLine.h:15
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
findQualityFiles.v
v
Definition: findQualityFiles.py:179
FastHelix::useBasisVertex
bool useBasisVertex
Definition: FastHelix.h:81
FastCircle::outerPoint
GlobalPoint const & outerPoint() const
Definition: FastCircle.h:61
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
FastCircle::rho
double rho() const
Definition: FastCircle.h:47
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
FastHelix::middleHit
GlobalPoint const & middleHit() const
Definition: FastHelix.h:65
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
FastHelix::bField
MagneticField const * bField
Definition: FastHelix.h:75
DDAxes::rho
FastCircle::x0
double x0() const
Definition: FastCircle.h:43
FastHelix::maxPt
static constexpr float maxPt
Definition: FastHelix.h:73
FastHelix::compute
void compute()
Definition: FastHelix.cc:4
FastHelix::outerHit
GlobalPoint const & outerHit() const
Definition: FastHelix.h:64
FastHelix::vertex
GlobalPoint const & vertex() const
Definition: FastHelix.h:66
FastCircle::vertexPoint
GlobalPoint const & vertexPoint() const
Definition: FastCircle.h:63
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
perp2
T perp2() const
Squared magnitude of transverse component.
Definition: Basic3DVectorLD.h:130
FastCircle::innerPoint
GlobalPoint const & innerPoint() const
Definition: FastCircle.h:62
FastHelix::isValid
bool isValid() const
Definition: FastHelix.h:57
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
FastHelix::straightLineStateAtVertex
void straightLineStateAtVertex()
Definition: FastHelix.cc:85
FastHelix::theCircle
FastCircle theCircle
Definition: FastHelix.h:78
FastHelix::maxRho
float maxRho
Definition: FastHelix.h:80
FastCircle::isValid
bool isValid() const
Definition: FastCircle.h:49
FastHelix::tesla0
float tesla0
Definition: FastHelix.h:79
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
FastCircle::n2
double n2() const
Definition: FastCircle.h:57
FastHelix::basisVertex
GlobalPoint basisVertex
Definition: FastHelix.h:77
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37