ATLAS Offline Software
ForwardDetectors
FPTracker
src
QuadrupoleBender.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
FPTracker/QuadrupoleBender.h
"
6
#include "
FPTracker/IParticle.h
"
7
#include "
FPTracker/Point.h
"
8
#include "
FPTracker/TransversePoint.h
"
9
#include "
FPTracker/FPTrackerConstants.h
"
10
11
#include <utility>
// for std::swap...
12
#include <cmath>
13
14
namespace
FPTracker
{
15
QuadrupoleBender::QuadrupoleBender
(
IQuadFocuser::Ptr_t
focuser,
16
double
magnetLength,
17
double
magnetStrength
,
18
int
side
):
19
m_focuser(std::move(focuser)),
20
m_length(magnetLength),
21
m_bendConstant(
FPTrackerConstants
::qkConst*
magnetStrength
),
22
m_dside(
FPTrackerConstants
::aside[
side
]){
23
}
24
25
26
void
QuadrupoleBender::swap
(
QuadrupoleBender
&
other
){
27
std::swap
(
m_focuser
,
other
.m_focuser);
28
std::swap
(
m_length
,
other
.m_length);
29
std::swap
(
m_bendConstant
,
other
.m_bendConstant);
30
std::swap
(
m_dside
,
other
.m_dside);
31
}
32
33
34
void
QuadrupoleBender::bend
(
IParticle
&
particle
)
const
{
35
// calculates new x, y coordinates and direction after deflection
36
37
//particle is at magnet front face. This method moves it to the rear face.
38
39
40
double
qk = std::sqrt(
m_bendConstant
/
particle
.momentum()) ;
// ---- basic formula is m Te GeV
41
//qk = 0.2997925* Magnet_strength[magnet][side]/p ;
42
43
44
Point
& direction =
particle
.direction();
45
//
46
double
qkl = qk *
m_length
*
m_dside
;
47
double
qkc = qk *direction[2] ;
48
49
m_focuser
->focus(qk, qkl, qkc,
particle
.displacement(), direction);
50
51
particle
.updatePositionFromDisplacement(
TransversePoint
(
m_focuser
->xe(),
m_focuser
->ye()));
52
53
direction[0] =
m_focuser
->xae();
54
direction[1] =
m_focuser
->yae();
55
56
direction[2] = std::sqrt(1. - (direction[0]*direction[0]) - (direction[1]*direction[1]))*
m_dside
;
57
direction[0] = direction[0]*direction[2] ;
58
direction[1] = direction[1]*direction[2] ;
59
60
}
61
62
63
const
std::string
QuadrupoleBender::s_label
=
"QuadBender"
;
64
std::string
QuadrupoleBender::label
()
const
{
65
return
s_label
+
":"
+
m_focuser
->label();
66
}
67
}
FPTracker::QuadrupoleBender::m_focuser
IQuadFocuser::Ptr_t m_focuser
Definition:
QuadrupoleBender.h:31
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition:
ParticleHypothesis.h:79
FPTracker::QuadrupoleBender::m_bendConstant
double m_bendConstant
Definition:
QuadrupoleBender.h:33
FPTracker::QuadrupoleBender::s_label
static const std::string s_label
Definition:
QuadrupoleBender.h:29
Point.h
TransversePoint.h
FPTracker::QuadrupoleBender::label
std::string label() const
Definition:
QuadrupoleBender.cxx:64
TRT::Hit::side
@ side
Definition:
HitInfo.h:83
IParticle.h
FPTrackerConstants.h
FPTracker::IQuadFocuser::Ptr_t
std::shared_ptr< IQuadFocuser > Ptr_t
Definition:
IQuadFocuser.h:30
FPTracker::QuadrupoleBender::QuadrupoleBender
QuadrupoleBender(IQuadFocuser::Ptr_t focuser, double magnetLength, double magnetStrength, int side)
Definition:
QuadrupoleBender.cxx:15
FPTracker::QuadrupoleBender::m_dside
double m_dside
Definition:
QuadrupoleBender.h:34
WriteCalibToCool.swap
swap
Definition:
WriteCalibToCool.py:94
FPTracker::Point
Definition:
FPTracker/FPTracker/Point.h:14
FPTracker::FPTrackerConstants
Definition:
FPTrackerConstants.h:13
InDetDD::other
@ other
Definition:
InDetDD_Defs.h:16
FPTracker::QuadrupoleBender::bend
void bend(IParticle &) const
Definition:
QuadrupoleBender.cxx:34
FPTracker::QuadrupoleBender::swap
void swap(QuadrupoleBender &)
Definition:
QuadrupoleBender.cxx:26
FPTracker::QuadrupoleBender::m_length
double m_length
Definition:
QuadrupoleBender.h:32
FPTracker
Definition:
FPTracker/FPTracker/Beamline.h:12
QuadrupoleBender.h
FPTracker::magnetStrength
double magnetStrength(int type, double length, double strength, double Brho)
Definition:
magnetStrength.cxx:8
FPTracker::IParticle
Definition:
ForwardDetectors/FPTracker/FPTracker/IParticle.h:17
FPTracker::TransversePoint
Definition:
FPTracker/FPTracker/TransversePoint.h:12
FPTracker::QuadrupoleBender
Definition:
QuadrupoleBender.h:16
Generated on Mon Nov 3 2025 21:17:11 for ATLAS Offline Software by
1.8.18