CMS 3D CMS Logo

trackingParametersAtClosestApproachToBeamSpot.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: TrackingTools/PatternTools
4 // Class : trackingParametersAtClosestApproachToBeamSpot
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Christopher Jones
10 // Created: Fri, 02 Jan 2015 19:32:37 GMT
11 //
12 
13 // system include files
14 
15 // user include files
20 
21 std::pair<bool, reco::TrackBase::ParameterVector> reco::trackingParametersAtClosestApproachToBeamSpot(
23  const Basic3DVector<double>& momAtVtx,
24  float charge,
25  const MagneticField& magField,
26  const BeamSpot& bs) {
27  TrackBase::ParameterVector sParameters;
28  try {
29  FreeTrajectoryState ftsAtProduction(GlobalPoint(vertex.x(), vertex.y(), vertex.z()),
30  GlobalVector(momAtVtx.x(), momAtVtx.y(), momAtVtx.z()),
32  &magField);
33  TSCBLBuilderNoMaterial tscblBuilder;
34  TrajectoryStateClosestToBeamLine tsAtClosestApproach =
35  tscblBuilder(ftsAtProduction, bs); //as in TrackProducerAlgorithm
36 
37  GlobalPoint v = tsAtClosestApproach.trackStateAtPCA().position();
38  GlobalVector p = tsAtClosestApproach.trackStateAtPCA().momentum();
39  sParameters[0] = tsAtClosestApproach.trackStateAtPCA().charge() / p.mag();
40  sParameters[1] = Geom::halfPi() - p.theta();
41  sParameters[2] = p.phi();
42  sParameters[3] = (-v.x() * sin(p.phi()) + v.y() * cos(p.phi()));
43  sParameters[4] = v.z() * p.perp() / p.mag() - (v.x() * p.x() + v.y() * p.y()) / p.perp() * p.z() / p.mag();
44 
45  return std::make_pair(true, sParameters);
46  } catch (cms::Exception const&) {
47  return std::make_pair(false, sParameters);
48  }
49 }
TSCBLBuilderNoMaterial.h
FreeTrajectoryState::momentum
GlobalVector momentum() const
Definition: FreeTrajectoryState.h:68
TrajectoryStateClosestToBeamLine
Definition: TrajectoryStateClosestToBeamLine.h:15
FreeTrajectoryState.h
TrackCharge
int TrackCharge
Definition: TrackCharge.h:4
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
FreeTrajectoryState::charge
TrackCharge charge() const
Definition: FreeTrajectoryState.h:69
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
findQualityFiles.v
v
Definition: findQualityFiles.py:179
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
cms::cuda::bs
bs
Definition: HistoContainer.h:127
Basic3DVector::y
T y() const
Cartesian y coordinate.
Definition: extBasic3DVector.h:97
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
reco::BeamSpot
Definition: BeamSpot.h:21
reco::TrackBase::ParameterVector
math::Vector< dimension >::type ParameterVector
parameter vector
Definition: TrackBase.h:71
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
Pi.h
math::GlobalVector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalVector
vector in glovbal coordinate system
Definition: Vector3D.h:28
reco::trackingParametersAtClosestApproachToBeamSpot
std::pair< bool, reco::TrackBase::ParameterVector > trackingParametersAtClosestApproachToBeamSpot(const Basic3DVector< double > &vertex, const Basic3DVector< double > &momAtVtx, float charge, const MagneticField &magField, const BeamSpot &bs)
Definition: trackingParametersAtClosestApproachToBeamSpot.cc:21
Geom::halfPi
constexpr double halfPi()
Definition: Pi.h:33
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
TSCBLBuilderNoMaterial
Definition: TSCBLBuilderNoMaterial.h:13
Basic3DVector::x
T x() const
Cartesian x coordinate.
Definition: extBasic3DVector.h:94
math::GlobalPoint
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalPoint
point in global coordinate system
Definition: Point3D.h:18
cms::Exception
Definition: Exception.h:70
TrajectoryStateClosestToBeamLine::trackStateAtPCA
FTS const & trackStateAtPCA() const
Definition: TrajectoryStateClosestToBeamLine.h:32
MagneticField
Definition: MagneticField.h:19
Basic3DVector::z
T z() const
Cartesian z coordinate.
Definition: extBasic3DVector.h:100
Basic3DVector
Definition: extBasic3DVector.h:30
trackingParametersAtClosestApproachToBeamSpot.h