ATLAS Offline Software
ForwardDetectors
FPTracker
src
magnetFactory.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
FPTracker/magnetFactory.h
"
6
#include "
FPTracker/Magnet.h
"
7
#include "
FPTracker/IBender.h
"
8
#include "
FPTracker/DipoleBender.h
"
9
#include "
FPTracker/NullBender.h
"
10
#include "
FPTracker/QuadrupoleBender.h
"
11
#include "
FPTracker/QuadFocuserVertical.h
"
12
#include "
FPTracker/QuadFocuserHorizontal.h
"
13
#include "
FPTracker/QuadFocuserNull.h
"
14
#include "
FPTracker/FPTrackerConstants.h
"
15
#include <string>
16
#include <stdexcept>
17
18
namespace
FPTracker
{
19
20
std::string
typeToString
(
Magnet::Type
type
)
21
{
22
if
(
type
==
Magnet::hbDipole
) {
return
"hbDipole"
; }
23
if
(
type
==
Magnet::vbDipole
) {
return
"vbDipole"
; }
24
if
(
type
==
Magnet::hfQuadrupole
){
return
"hfQuad"
; }
25
if
(
type
==
Magnet::vfQuadrupole
) {
return
"vfQuad"
; }
26
throw
std::logic_error(
"unknown magnet type"
);
27
}
28
29
IQuadFocuser::Ptr_t
quadFocuserFactory
(
Magnet::Type
type
)
30
{
31
32
if
(
type
==
Magnet::hfQuadrupole
){
return
IQuadFocuser::Ptr_t
(
new
QuadFocuserHorizontal
);}
33
if
(
type
==
Magnet::vfQuadrupole
){
return
IQuadFocuser::Ptr_t
(
new
QuadFocuserVertical
);}
34
35
throw
std::logic_error(
"bad magnet type for QuadFocuser"
);
36
}
37
38
39
IBender::ConstPtr_t
benderFactory
(
Magnet::Type
type
,
40
double
length
,
41
double
strength,
42
double
pbeam0,
43
int
side
44
)
45
{
46
if
(
type
==
Magnet::hbDipole
)
47
{
48
return
IBender::ConstPtr_t
(
new
DipoleBender
(
hBendplane
,
49
length
,
50
strength,
51
pbeam0,
52
side
)
53
);
54
}
55
56
if
(
type
==
Magnet::vbDipole
)
57
{
58
return
IBender::ConstPtr_t
(
new
DipoleBender
(
vBendplane
,
59
length
,
60
strength,
61
pbeam0,
62
side
)
63
);
64
}
65
66
if
(
type
==
Magnet::hfQuadrupole
)
67
{
68
return
IBender::ConstPtr_t
(
new
QuadrupoleBender
(
quadFocuserFactory
(
type
),
69
length
,
70
strength,
71
side
)
72
);
73
}
74
75
if
(
type
==
Magnet::vfQuadrupole
)
76
{
77
return
IBender::ConstPtr_t
(
new
QuadrupoleBender
(
quadFocuserFactory
(
type
),
78
length
,
79
strength,
80
side
)
81
);
82
}
83
84
throw
std::logic_error(
"unknown magnet type"
);
85
}
86
87
Magnet::Ptr_t
magnetFactory
(
88
double
x
,
89
double
y
,
90
double
center,
91
double
strength,
92
double
length
,
93
int
apertype,
94
double
A1,
95
double
A2,
96
double
A3,
97
double
A4,
98
double
X
,
99
double
pbeam0,
100
Side
side
,
101
Magnet::Type
type
){
102
103
IBender::ConstPtr_t
bender(
benderFactory
(
type
,
length
, strength, pbeam0,
side
) );
104
std::string
label
(
typeToString
(
type
) );
105
106
return
Magnet::Ptr_t
(
new
Magnet
(
x
,
107
y
,
108
center,
109
strength,
110
length
,
111
apertype,
112
A1,
113
A2,
114
A3,
115
A4,
116
X
,
117
side
,
118
bender,
119
label
120
)
121
);
122
123
}
124
125
}
FPTracker::Magnet
Definition:
FPTracker/FPTracker/Magnet.h:20
FPTracker::IBender::ConstPtr_t
std::shared_ptr< IBender > ConstPtr_t
Definition:
FPTracker/FPTracker/IBender.h:18
PlotCalibFromCool.label
label
Definition:
PlotCalibFromCool.py:78
FPTracker::Magnet::vbDipole
@ vbDipole
Definition:
FPTracker/FPTracker/Magnet.h:64
QuadFocuserNull.h
FPTracker::benderFactory
IBender::ConstPtr_t benderFactory(Magnet::Type type, double length, double strength, double pbeam0, int side)
Definition:
magnetFactory.cxx:39
FPTracker::Magnet::hfQuadrupole
@ hfQuadrupole
Definition:
FPTracker/FPTracker/Magnet.h:64
FPTracker::QuadFocuserHorizontal
Definition:
QuadFocuserHorizontal.h:11
FPTracker::Magnet::hbDipole
@ hbDipole
Definition:
FPTracker/FPTracker/Magnet.h:64
x
#define x
QuadFocuserVertical.h
Monitored::X
@ X
Definition:
HistogramFillerUtils.h:24
TRT::Hit::side
@ side
Definition:
HitInfo.h:83
IBender.h
FPTracker::hBendplane
@ hBendplane
Definition:
FPTrackerConstants.h:11
FPTrackerConstants.h
magnetFactory.h
FPTracker::IQuadFocuser::Ptr_t
std::shared_ptr< IQuadFocuser > Ptr_t
Definition:
IQuadFocuser.h:30
FPTracker::DipoleBender
Definition:
DipoleBender.h:15
Side
Definition:
WaferTree.h:36
FPTracker::quadFocuserFactory
IQuadFocuser::Ptr_t quadFocuserFactory(Magnet::Type type)
Definition:
magnetFactory.cxx:29
FPTracker::vBendplane
@ vBendplane
Definition:
FPTrackerConstants.h:11
FPTracker::Magnet::vfQuadrupole
@ vfQuadrupole
Definition:
FPTracker/FPTracker/Magnet.h:64
FPTracker::magnetFactory
Magnet::Ptr_t magnetFactory(double x, double y, double center, double strength, double length, int apertype, double A1, double A2, double A3, double A4, double X, double pbeam0, Side side, Magnet::Type type)
Definition:
magnetFactory.cxx:87
FPTracker::typeToString
std::string typeToString(Magnet::Type type)
Definition:
magnetFactory.cxx:20
FPTracker::QuadFocuserVertical
Definition:
QuadFocuserVertical.h:12
FPTracker::Magnet::Ptr_t
std::shared_ptr< Magnet > Ptr_t
Definition:
FPTracker/FPTracker/Magnet.h:61
y
#define y
python.CaloScaleNoiseConfig.type
type
Definition:
CaloScaleNoiseConfig.py:78
QuadFocuserHorizontal.h
DipoleBender.h
FPTracker
Definition:
FPTracker/FPTracker/Beamline.h:12
Magnet.h
QuadrupoleBender.h
length
double length(const pvec &v)
Definition:
FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
NullBender.h
FPTracker::QuadrupoleBender
Definition:
QuadrupoleBender.h:15
FPTracker::Magnet::Type
Type
Definition:
FPTracker/FPTracker/Magnet.h:64
Generated on Thu Nov 7 2024 21:20:22 for ATLAS Offline Software by
1.8.18