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