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
22
FreeTrajectoryState
FTSFromVertexToPointFactory::get
(
MagneticField
const
& magField,
23
GlobalPoint
const
& xmeas,
24
GlobalPoint
const
& xvert,
25
float
momentum,
26
TrackCharge
charge
)
27
{
28
auto
magFieldAtPoint = magField.
inTesla
(xmeas);
29
auto
BInTesla = magFieldAtPoint.
z
();
30
GlobalVector
xdiff = xmeas - xvert;
31
auto
mom = momentum*xdiff.
unit
();
32
auto
pt
= mom.perp();
33
auto
pz = mom.z();
34
auto
pxOld = mom.x();
35
auto
pyOld = mom.y();
36
37
38
auto
curv = (BInTesla*0.29979f*0.01f)/
pt
;
39
40
// stays as doc...
41
// auto alpha = std::asin(0.5f*xdiff.perp()*curv);
42
// auto ca = std::cos(float(charge)*alpha);
43
// auto sa = std::sin(float(charge)*alpha);
44
45
auto
sa = 0.5f*xdiff.
perp
()*curv*
float
(charge);
46
auto
ca =
sqrt
(1.
f
-sa*sa);
47
48
auto
pxNew = ca*pxOld + sa*pyOld;
49
auto
pyNew = -sa*pxOld + ca*pyOld;
50
GlobalVector
pNew(pxNew, pyNew, pz);
51
52
GlobalTrajectoryParameters
gp
(xmeas, pNew, charge, & magField,
std::move
(magFieldAtPoint));
53
54
return
FreeTrajectoryState
(gp);
55
}
FTSFromVertexToPointFactory::get
static FreeTrajectoryState get(MagneticField const &magField, GlobalPoint const &xmeas, GlobalPoint const &xvert, float momentum, TrackCharge charge)
Definition:
FTSFromVertexToPointFactory.cc:22
PV3DBase::perp
T perp() const
Definition:
PV3DBase.h:72
Vector3DBase< float, GlobalTag >
GlobalTrajectoryParameters
Definition:
GlobalTrajectoryParameters.h:15
MagneticField
Definition:
MagneticField.h:19
EnergyCorrector.pt
pt
Definition:
EnergyCorrector.py:45
MagneticField.h
runTauDisplay.gp
gp
Definition:
runTauDisplay.py:428
TrackCharge
int TrackCharge
Definition:
TrackCharge.h:4
FreeTrajectoryState
Definition:
FreeTrajectoryState.h:29
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:18
PV3DBase::z
T z() const
Definition:
PV3DBase.h:64
FTSFromVertexToPointFactory.h
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
objects.autophobj.float
float
Definition:
autophobj.py:147
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:57
Point3DBase< float, GlobalTag >
eostools.move
def move(src, dest)
Definition:
eostools.py:510
Generated for CMSSW Reference Manual by
1.8.11