CMS 3D CMS Logo

Functions
trackingTools Namespace Reference

Functions

FreeTrajectoryState ftsFromVertexToPoint (MagneticField const &magField, GlobalPoint const &xmeas, GlobalPoint const &xvert, float momentum, TrackCharge charge)
 

Function Documentation

◆ ftsFromVertexToPoint()

FreeTrajectoryState trackingTools::ftsFromVertexToPoint ( MagneticField const &  magField,
GlobalPoint const &  xmeas,
GlobalPoint const &  xvert,
float  momentum,
TrackCharge  charge 
)

Description: Utility class to create FTS from supercluster

Definition at line 17 of file ftsFromVertexToPoint.cc.

21  {
22  auto magFieldAtPoint = magField.inTesla(xmeas);
23  auto BInTesla = magFieldAtPoint.z();
24  GlobalVector xdiff = xmeas - xvert;
25  auto mom = momentum * xdiff.unit();
26  auto pt = mom.perp();
27  auto pz = mom.z();
28  auto pxOld = mom.x();
29  auto pyOld = mom.y();
30 
31  auto curv = (BInTesla * 0.29979f * 0.01f) / pt;
32 
33  // stays as doc...
34  // auto alpha = std::asin(0.5f*xdiff.perp()*curv);
35  // auto ca = std::cos(float(charge)*alpha);
36  // auto sa = std::sin(float(charge)*alpha);
37 
38  auto sa = 0.5f * xdiff.perp() * curv * float(charge);
39  auto ca = sqrt(1.f - sa * sa);
40 
41  auto pxNew = ca * pxOld + sa * pyOld;
42  auto pyNew = -sa * pxOld + ca * pyOld;
43  GlobalVector pNew(pxNew, pyNew, pz);
44 
45  GlobalTrajectoryParameters gp(xmeas, pNew, charge, &magField, std::move(magFieldAtPoint));
46 
47  return FreeTrajectoryState(gp);
48 }

References ALCARECOTkAlJpsiMuMu_cff::charge, f, dqmMemoryStats::float, runTauDisplay::gp, MagneticField::inTesla(), eostools::move(), PV3DBase< T, PVType, FrameType >::perp(), DiDispStaMuonMonitor_cfi::pt, mathSSE::sqrt(), Vector3DBase< T, FrameTag >::unit(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by ElectronSeedAnalyzer::analyze(), HLTPMMassFilter::approxMomAtVtx(), TrackingRegionsFromSuperClustersProducer::createTrackingRegion(), TrajSeedMatcher::ftsFromVertexToPoint(), and PixelHitMatcher::operator()().

Vector3DBase
Definition: Vector3DBase.h:8
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
Vector3DBase::unit
Vector3DBase unit() const
Definition: Vector3DBase.h:54
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
eostools.move
def move(src, dest)
Definition: eostools.py:511
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69