CMS 3D CMS Logo

Public Member Functions

FTSFromVertexToPointFactory Class Reference

#include <FTSFromVertexToPointFactory.h>

List of all members.

Public Member Functions

 FTSFromVertexToPointFactory ()
FreeTrajectoryState operator() (const MagneticField *magField, const GlobalPoint &xmeas, const GlobalPoint &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 28 of file FTSFromVertexToPointFactory.h.


Constructor & Destructor Documentation

FTSFromVertexToPointFactory::FTSFromVertexToPointFactory ( ) [inline]

Definition at line 30 of file FTSFromVertexToPointFactory.h.

{ };

Member Function Documentation

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

Definition at line 23 of file FTSFromVertexToPointFactory.cc.

References alpha, funct::C, funct::cos(), MagneticField::inTesla(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), phi, funct::sin(), theta(), PV3DBase< T, PVType, FrameType >::theta(), and PV3DBase< T, PVType, FrameType >::z().

{
  double BInTesla = magField->inTesla(xmeas).z();
  GlobalVector xdiff = xmeas -xvert;
  double theta = xdiff.theta();
  double phi= xdiff.phi();
  double pt = momentum*sin(theta);
  double pz = momentum*cos(theta);
  double pxOld = pt*cos(phi);
  double pyOld = pt*sin(phi);

  double RadCurv = 100*pt/(BInTesla*0.29979);
  double alpha = asin(0.5*xdiff.perp()/RadCurv);

  float ca = cos(charge*alpha);
  float sa = sin(charge*alpha);
  double pxNew =   ca*pxOld + sa*pyOld;
  double pyNew =  -sa*pxOld + ca*pyOld;
  GlobalVector pNew(pxNew, pyNew, pz);  

  GlobalTrajectoryParameters gp(xmeas, pNew, charge, magField);
  
  AlgebraicSymMatrix55 C = AlgebraicMatrixID();
  FreeTrajectoryState VertexToPoint(gp,CurvilinearTrajectoryError(C));

  return VertexToPoint;
}