forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMagnet.cxx
More file actions
172 lines (149 loc) · 8.12 KB
/
Magnet.cxx
File metadata and controls
172 lines (149 loc) · 8.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#include <DetectorsBase/Detector.h>
#include <DetectorsBase/MaterialManager.h>
#include <Alice3DetectorsPassive/Magnet.h>
#include <Alice3DetectorsPassive/PassiveBaseParam.h>
#include <TGeoCompositeShape.h>
#include <TGeoManager.h>
#include <TGeoMatrix.h>
#include <TGeoMedium.h>
#include <TGeoVolume.h>
#include <TGeoTube.h>
using namespace o2::passive;
Alice3Magnet::~Alice3Magnet() = default;
Alice3Magnet::Alice3Magnet() : Alice3PassiveBase("ALICE3_MAGNET", "") {}
Alice3Magnet::Alice3Magnet(const char* name, const char* title) : Alice3PassiveBase(name, title) {}
Alice3Magnet::Alice3Magnet(const Alice3Magnet& rhs) = default;
Alice3Magnet& Alice3Magnet::operator=(const Alice3Magnet& rhs)
{
if (this == &rhs) {
return *this;
}
Alice3PassiveBase::operator=(rhs);
return *this;
}
void Alice3Magnet::createMaterials()
{
auto& matmgr = o2::base::MaterialManager::Instance();
int isxfld = 2.;
float sxmgmx = 10.;
o2::base::Detector::initFieldTrackingParams(isxfld, sxmgmx);
// Current information is scarce, we have some X/X0 and thicknesses but no full material information
// We use then two main materials: Aluminium for insulation, cryostats, stabiliser, supports and strips.
// Copper for the coils.
// Latest updated reference table is, for the moment:
// +------------------+-------------------------+----------+--------+
// | layer | effective thickness [mm]| X0 [cm] | X0 [%] |
// +------------------+-------------------------+----------+--------+
// | Support cylinder | 20 | 8.896 | 0.225 |
// | Al-strip | 1 | 8.896 | 0.011 |
// | NbTi/Cu | 3 | 1.598 | 0.188 |
// | Insulation | 11 | 17.64 | 0.062 |
// | Al-stabiliser | 33 | 8.896 | 0.371 |
// | Inner cryostat | 10 | 8.896 | 0.112 |
// | Outer cryostat | 30 | 8.896 | 0.337 |
// +------------------+-------------------------+----------+--------+
// Update: 2025-06-16 enabledby setting Alice3PassiveBase.mLayout=1
// +------------------+-------------------------+----------+--------+
// | layer | effective thickness [mm]| X0 [cm] | X0 [%] |
// +------------------+-------------------------+----------+--------+
// | Support cylinder | 20 | 8.896 | 0.225 |
// | Al-strip | 1 | 8.896 | 0.011 |
// | NbTi/Cu | 3 | 1.598 | 0.188 |
// | Insulation | 11 | 17.64 | 0.062 |
// | Cu-stabiliser | 22 | 1.436 | 1.532 |
// | Inner cryostat | 10 | 8.896 | 0.112 |
// | Outer cryostat | 30 | 8.896 | 0.337 |
// | total | | | 2.468 |
// +------------------+-------------------------+----------+--------+
// Geometry will be oversimplified in two wrapping cylindrical Al layers (symmetric for the time being) with a Copper layer in between.
//
// Air
//
float aAir[4] = {12.0107, 14.0067, 15.9994, 39.948};
float zAir[4] = {6., 7., 8., 18.};
float wAir[4] = {0.000124, 0.755267, 0.231781, 0.012827};
float dAir = 1.20479E-3;
float dAir1 = 1.20479E-11;
float epsil, stmin, tmaxfd, deemax, stemax;
epsil = .001; // Tracking precision,
stemax = -0.01; // Maximum displacement for multiple scat
tmaxfd = -20.; // Maximum angle due to field deflection
deemax = -.3; // Maximum fractional energy loss, DLS
stmin = -.8;
matmgr.Mixture("ALICE3_MAGNET", 1, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir);
matmgr.Material("ALICE3_MAGNET", 9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
matmgr.Material("ALICE3_MAGNET", 19, "COPPER$", 63.55, 29., 8.96, 1.436, 15.1);
matmgr.Medium("ALICE3_MAGNET", 1, "VACUUM", 1, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
matmgr.Medium("ALICE3_MAGNET", 9, "ALUMINIUM", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
matmgr.Medium("ALICE3_MAGNET", 19, "COPPER", 19, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
}
void Alice3Magnet::ConstructGeometry()
{
createMaterials();
// Passive Base configuration parameters
auto& passiveBaseParam = Alice3PassiveBaseParam::Instance();
const bool doCopperStabilizer = (passiveBaseParam.mLayout == o2::passive::MagnetLayout::CopperStabilizer);
if (doCopperStabilizer) {
mRestMaterialThickness -= 3.3; // cm Remove the Aluminium stabiliser
mRestMaterialThickness += 2.2; // cm Add the Copper stabiliser
LOG(debug) << "Alice 3 magnet: using Copper Stabilizer with thickness " << mRestMaterialThickness << " cm";
}
TGeoManager* geoManager = gGeoManager;
TGeoVolume* barrel = geoManager->GetVolume("barrel");
if (!barrel) {
LOGP(fatal, "Could not find barrel volume while constructing Alice 3 magnet geometry");
}
auto& matmgr = o2::base::MaterialManager::Instance();
auto kMedAl = matmgr.getTGeoMedium("ALICE3_MAGNET_ALUMINIUM");
auto kMedCu = matmgr.getTGeoMedium("ALICE3_MAGNET_COPPER");
auto kMedVac = matmgr.getTGeoMedium("ALICE3_MAGNET_VACUUM");
// inner wrap
LOGP(debug, "Alice 3 magnet: creating inner wrap with inner radius {} cm and thickness {} cm", mInnerWrapInnerRadius, mInnerWrapThickness);
TGeoTube* innerLayer = new TGeoTube(mInnerWrapInnerRadius, mInnerWrapInnerRadius + mInnerWrapThickness, mZLength / 2);
TGeoTube* innerVacuum = new TGeoTube(mInnerWrapInnerRadius + mInnerWrapThickness, mCoilInnerRadius, mZLength / 2);
// coils layer
LOGP(debug, "Alice 3 magnet: creating coils layer with inner radius {} cm and thickness {} cm", mCoilInnerRadius, mCoilThickness);
TGeoTube* coilsLayer = new TGeoTube(mCoilInnerRadius, mCoilInnerRadius + mCoilThickness, mZLength / 2);
TGeoTube* restMaterial = new TGeoTube(mRestMaterialRadius, mRestMaterialRadius + mRestMaterialThickness, mZLength / 2);
TGeoTube* outerVacuum = new TGeoTube(mRestMaterialRadius + mRestMaterialThickness, mOuterWrapInnerRadius, mZLength / 2);
// outer wrap
LOGP(debug, "Alice 3 magnet: creating outer wrap with inner radius {} cm and thickness {} cm", mOuterWrapInnerRadius, mOuterWrapThickness);
TGeoTube* outerLayer = new TGeoTube(mOuterWrapInnerRadius, mOuterWrapInnerRadius + mOuterWrapThickness, mZLength / 2);
TGeoVolume* innerWrapVol = new TGeoVolume("innerWrap", innerLayer, kMedAl);
TGeoVolume* innerVacuumVol = new TGeoVolume("innerVacuum", innerVacuum, kMedVac);
TGeoVolume* coilsVol = new TGeoVolume("coils", coilsLayer, kMedCu);
TGeoVolume* restMaterialVol = new TGeoVolume("restMaterial", restMaterial, doCopperStabilizer ? kMedCu : kMedAl);
TGeoVolume* outerVacuumVol = new TGeoVolume("outerVacuum", outerVacuum, kMedVac);
TGeoVolume* outerWrapVol = new TGeoVolume("outerWrap", outerLayer, kMedAl);
innerWrapVol->SetLineColor(kRed + 2);
innerVacuumVol->SetLineColor(kRed + 2);
coilsVol->SetLineColor(kRed + 2);
restMaterialVol->SetLineColor(kRed + 2);
outerVacuumVol->SetLineColor(kRed + 2);
outerWrapVol->SetLineColor(kRed + 2);
new TGeoVolumeAssembly("magnet");
auto* magnet = gGeoManager->GetVolume("magnet");
magnet->AddNode(innerWrapVol, 1, nullptr);
magnet->AddNode(innerVacuumVol, 1, nullptr);
magnet->AddNode(coilsVol, 1, nullptr);
magnet->AddNode(restMaterialVol, 1, nullptr);
magnet->AddNode(outerVacuumVol, 1, nullptr);
magnet->AddNode(outerWrapVol, 1, nullptr);
magnet->SetVisibility(1);
barrel->AddNode(magnet, 1, new TGeoTranslation(0, 30.f, 0));
}
FairModule* Alice3Magnet::CloneModule() const
{
return new Alice3Magnet(*this);
}
ClassImp(o2::passive::Alice3Magnet)