CMS 3D CMS Logo

List of all members | Static Public Member Functions
FTSFromVertexToPointFactory Class Reference

#include <FTSFromVertexToPointFactory.h>

Static Public Member Functions

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

Detailed Description

Description: Utility class to create FTS from supercluster

Implementation: should go somewhere else in the future

Definition at line 29 of file FTSFromVertexToPointFactory.h.

Member Function Documentation

FreeTrajectoryState FTSFromVertexToPointFactory::get ( MagneticField const &  magField,
GlobalPoint const &  xmeas,
GlobalPoint const &  xvert,
float  momentum,
TrackCharge  charge 
)
static

Definition at line 21 of file FTSFromVertexToPointFactory.cc.

References 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 Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), ElectronSeedAnalyzer::analyze(), HLTPMMassFilter::approxMomAtVtx(), TrackingRegionsFromSuperClustersProducer::createTrackingRegion(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), TrajSeedMatcher::getNrValidLayersAlongTraj(), betterConfigParser.BetterConfigParser::getResultingSection(), TrajSeedMatcher::makeTrajStateOnSurface(), PixelHitMatcher::operator()(), TrajSeedMatcher::processSeed(), and SeedFilter::seeds().

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