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.

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()().

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 }
T perp() const
Definition: PV3DBase.h:69
T sqrt(T t)
Definition: SSEVec.h:19
double f[11][100]
Vector3DBase unit() const
Definition: Vector3DBase.h:54
def move(src, dest)
Definition: eostools.py:511