TrackingTools
TrajectoryState
src
ftsFromVertexToPoint.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
//
9
//
10
// Original Author: Ursula Berthon, Claude Charlot
11
// Created: Mon Mar 27 13:22:06 CEST 2006
12
//
13
//
14
#include "
TrackingTools/TrajectoryState/interface/ftsFromVertexToPoint.h
"
15
#include "
MagneticField/Engine/interface/MagneticField.h
"
16
17
FreeTrajectoryState
trackingTools::ftsFromVertexToPoint
(
MagneticField
const
& magField,
18
GlobalPoint
const
& xmeas,
19
GlobalPoint
const
& xvert,
20
float
momentum,
21
TrackCharge
charge
) {
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
}
Vector3DBase
Definition:
Vector3DBase.h:8
MagneticField::inTesla
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
dqmMemoryStats.float
float
Definition:
dqmMemoryStats.py:127
TrackCharge
int TrackCharge
Definition:
TrackCharge.h:4
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
DiDispStaMuonMonitor_cfi.pt
pt
Definition:
DiDispStaMuonMonitor_cfi.py:39
PV3DBase::z
T z() const
Definition:
PV3DBase.h:61
Vector3DBase::unit
Vector3DBase unit() const
Definition:
Vector3DBase.h:54
trackingTools::ftsFromVertexToPoint
FreeTrajectoryState ftsFromVertexToPoint(MagneticField const &magField, GlobalPoint const &xmeas, GlobalPoint const &xvert, float momentum, TrackCharge charge)
Definition:
ftsFromVertexToPoint.cc:17
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
GlobalTrajectoryParameters
Definition:
GlobalTrajectoryParameters.h:15
Point3DBase< float, GlobalTag >
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition:
ALCARECOTkAlJpsiMuMu_cff.py:47
runTauDisplay.gp
gp
Definition:
runTauDisplay.py:431
MagneticField.h
ftsFromVertexToPoint.h
eostools.move
def move(src, dest)
Definition:
eostools.py:511
FreeTrajectoryState
Definition:
FreeTrajectoryState.h:27
MagneticField
Definition:
MagneticField.h:19
PV3DBase::perp
T perp() const
Definition:
PV3DBase.h:69
Generated for CMSSW Reference Manual by
1.8.16