Project
Loading...
Searching...
No Matches
Magnet.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
16#include <TGeoCompositeShape.h>
17#include <TGeoManager.h>
18#include <TGeoMatrix.h>
19#include <TGeoMedium.h>
20#include <TGeoVolume.h>
21#include <TGeoTube.h>
22
23using namespace o2::passive;
24
27Alice3Magnet::Alice3Magnet(const char* name, const char* title) : Alice3PassiveBase(name, title) {}
28Alice3Magnet::Alice3Magnet(const Alice3Magnet& rhs) = default;
29
30Alice3Magnet& Alice3Magnet::operator=(const Alice3Magnet& rhs)
31{
32 if (this == &rhs) {
33 return *this;
34 }
35
36 Alice3PassiveBase::operator=(rhs);
37
38 return *this;
39}
40
42{
44 int isxfld = 2.;
45 float sxmgmx = 10.;
47
48 // Current information is scarce, we have some X/X0 and thicknesses but no full material information
49 // We use then two main materials: Aluminium for insulation, cryostats, stabiliser, supports and strips.
50 // Copper for the coils.
51 // Latest updated reference table is, for the moment:
52 // +------------------+-------------------------+----------+--------+
53 // | layer | effective thickness [mm]| X0 [cm] | X0 [%] |
54 // +------------------+-------------------------+----------+--------+
55 // | Support cylinder | 20 | 8.896 | 0.225 |
56 // | Al-strip | 1 | 8.896 | 0.011 |
57 // | NbTi/Cu | 3 | 1.598 | 0.188 |
58 // | Insulation | 11 | 17.64 | 0.062 |
59 // | Al-stabiliser | 33 | 8.896 | 0.371 |
60 // | Inner cryostat | 10 | 8.896 | 0.112 |
61 // | Outer cryostat | 30 | 8.896 | 0.337 |
62 // +------------------+-------------------------+----------+--------+
63 // Update: 2025-06-16 enabledby setting Alice3PassiveBase.mLayout=1
64 // +------------------+-------------------------+----------+--------+
65 // | layer | effective thickness [mm]| X0 [cm] | X0 [%] |
66 // +------------------+-------------------------+----------+--------+
67 // | Support cylinder | 20 | 8.896 | 0.225 |
68 // | Al-strip | 1 | 8.896 | 0.011 |
69 // | NbTi/Cu | 3 | 1.598 | 0.188 |
70 // | Insulation | 11 | 17.64 | 0.062 |
71 // | Cu-stabiliser | 22 | 1.436 | 1.532 |
72 // | Inner cryostat | 10 | 8.896 | 0.112 |
73 // | Outer cryostat | 30 | 8.896 | 0.337 |
74 // | total | | | 2.468 |
75 // +------------------+-------------------------+----------+--------+
76 // Geometry will be oversimplified in two wrapping cylindrical Al layers (symmetric for the time being) with a Copper layer in between.
77
78 //
79 // Air
80 //
81 float aAir[4] = {12.0107, 14.0067, 15.9994, 39.948};
82 float zAir[4] = {6., 7., 8., 18.};
83 float wAir[4] = {0.000124, 0.755267, 0.231781, 0.012827};
84 float dAir = 1.20479E-3;
85 float dAir1 = 1.20479E-11;
86
87 float epsil, stmin, tmaxfd, deemax, stemax;
88 epsil = .001; // Tracking precision,
89 stemax = -0.01; // Maximum displacement for multiple scat
90 tmaxfd = -20.; // Maximum angle due to field deflection
91 deemax = -.3; // Maximum fractional energy loss, DLS
92 stmin = -.8;
93
94 matmgr.Mixture("ALICE3_MAGNET", 1, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir);
95 matmgr.Material("ALICE3_MAGNET", 9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
96 matmgr.Material("ALICE3_MAGNET", 19, "COPPER$", 63.55, 29., 8.96, 1.436, 15.1);
97
98 matmgr.Medium("ALICE3_MAGNET", 1, "VACUUM", 1, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
99 matmgr.Medium("ALICE3_MAGNET", 9, "ALUMINIUM", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
100 matmgr.Medium("ALICE3_MAGNET", 19, "COPPER", 19, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
101
102 // WindingPack: effective composite material (NbTi:Cu:Al = 1:1:24 by area)
103 // Combines NbTi/Cu superconducting cable and Al stabiliser as a single effective medium
104 // Based on ICN-UNAM standalone simulation (I. Perez Garcia)
105 // Mass fractions: NbTi=8.10% (Nb=4.05%, Ti=4.05%), Cu=11.18%, Al=80.72%
106 // Density: 2.96 g/cm3
107 float aWP[4] = {92.90638f, 47.867f, 63.546f, 26.982f};
108 float zWP[4] = {41.f, 22.f, 29.f, 13.f};
109 float wWP[4] = {0.0405f, 0.0405f, 0.1118f, 0.8072f};
110 float dWP = 2.96f;
111 matmgr.Mixture("ALICE3_MAGNET", 29, "WINDINGPACK", aWP, zWP, dWP, 4, wWP);
112 matmgr.Medium("ALICE3_MAGNET", 29, "WINDINGPACK", 29, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
113}
114
116{
118
119 // Passive Base configuration parameters
120 auto& passiveBaseParam = Alice3PassiveBaseParam::Instance();
121
122 switch (passiveBaseParam.mMagAbsLayout) {
124 // Defined in the header file
125 break;
126 case o2::passive::MagnetAbsorberLayout::SteppedAbsorber: // Ian absorber uses ReducedRadius magnet
128 mInnerWrapInnerRadius = 125.f; // cm
129 mInnerWrapThickness = 1.f; // cm
130 mCoilInnerRadius = 145.f; // cm
131 mCoilThickness = 0.3f; // cm
132 mRestMaterialRadius = 145.3f; // cm
133 mRestMaterialThickness = 6.8f; // cm
134 mOuterWrapInnerRadius = 165.f; // cm
135 mOuterWrapThickness = 3.f; // cm
136 mZLength = 800.f; // cm
137 break;
138 default:
139 LOG(fatal) << "Unknown detector layout " << passiveBaseParam.mMagAbsLayout;
140 break;
141 }
142
143 bool doCopperStabilizer = false;
144 bool doWindingPack = false;
145 switch (passiveBaseParam.mMagType) {
147 // Handled in the header file
148 break;
150 doCopperStabilizer = true;
151 mRestMaterialThickness -= 3.3; // cm Remove the Aluminium stabiliser
152 mRestMaterialThickness += 2.2; // cm Add the Copper stabiliser
153 LOG(debug) << "Alice 3 magnet: using Copper Stabilizer with thickness " << mRestMaterialThickness << " cm";
154 break;
156 doWindingPack = true;
157 LOG(debug) << "Alice 3 magnet: using WindingPack (NbTi+Cu+Al) coil";
158 break;
160 // Ian Perez Garcia design (ICN-UNAM) — radios desde DetectorConstruction.cc
161 doWindingPack = true; // usa WindingPack como material del coil
162 mInnerWrapInnerRadius = 140.f; // cm — pared interna criostato
163 mInnerWrapThickness = 1.0f; // cm — Al
164 mCoilInnerRadius = 160.f; // cm — bobina (tras gap de vacío)
165 mCoilThickness = 0.3f; // cm — NbTi/Cu
166 mRestMaterialRadius = 160.3f; // cm — soporte bobina
167 mRestMaterialThickness = 15.7f; // cm — Al
168 mOuterWrapInnerRadius = 197.f; // cm — soporte restante (6 cm Al) + pared externa
169 mOuterWrapThickness = 3.0f; // cm — pared externa Al, R=197-200
170 mZLength = 800.f; // cm
171 LOG(debug) << "Alice 3 magnet: using Ian Perez Garcia design (ICN-UNAM)";
172 break;
173 default:
174 LOG(fatal) << "Unknown magnet layout " << passiveBaseParam.mMagType;
175 break;
176 }
177
178 TGeoManager* geoManager = gGeoManager;
179 TGeoVolume* barrel = geoManager->GetVolume("barrel");
180 if (!barrel) {
181 LOGP(fatal, "Could not find barrel volume while constructing Alice 3 magnet geometry");
182 }
183
185 auto kMedAl = matmgr.getTGeoMedium("ALICE3_MAGNET_ALUMINIUM");
186 auto kMedCu = matmgr.getTGeoMedium("ALICE3_MAGNET_COPPER");
187 auto kMedWP = matmgr.getTGeoMedium("ALICE3_MAGNET_WINDINGPACK");
188 auto kMedVac = matmgr.getTGeoMedium("ALICE3_MAGNET_VACUUM");
189
190 // inner wrap
191 LOGP(debug, "Alice 3 magnet: creating inner wrap with inner radius {} cm and thickness {} cm", mInnerWrapInnerRadius, mInnerWrapThickness);
192 TGeoTube* innerLayer = new TGeoTube(mInnerWrapInnerRadius, mInnerWrapInnerRadius + mInnerWrapThickness, mZLength / 2);
193 TGeoTube* innerVacuum = new TGeoTube(mInnerWrapInnerRadius + mInnerWrapThickness, mCoilInnerRadius, mZLength / 2);
194 // coils layer
195 LOGP(debug, "Alice 3 magnet: creating coils layer with inner radius {} cm and thickness {} cm", mCoilInnerRadius, mCoilThickness);
196 TGeoTube* coilsLayer = new TGeoTube(mCoilInnerRadius, mCoilInnerRadius + mCoilThickness, mZLength / 2);
197 TGeoTube* restMaterial = new TGeoTube(mRestMaterialRadius, mRestMaterialRadius + mRestMaterialThickness, mZLength / 2);
198 TGeoTube* outerVacuum = new TGeoTube(mRestMaterialRadius + mRestMaterialThickness, mOuterWrapInnerRadius, mZLength / 2);
199 // outer wrap
200 LOGP(debug, "Alice 3 magnet: creating outer wrap with inner radius {} cm and thickness {} cm", mOuterWrapInnerRadius, mOuterWrapThickness);
201 TGeoTube* outerLayer = new TGeoTube(mOuterWrapInnerRadius, mOuterWrapInnerRadius + mOuterWrapThickness, mZLength / 2);
202
203 TGeoVolume* innerWrapVol = new TGeoVolume("innerWrap", innerLayer, kMedAl);
204 TGeoVolume* innerVacuumVol = new TGeoVolume("innerVacuum", innerVacuum, kMedVac);
205 TGeoVolume* coilsVol = new TGeoVolume("coils", coilsLayer, doWindingPack ? kMedWP : kMedCu);
206 TGeoVolume* restMaterialVol = new TGeoVolume("restMaterial", restMaterial, doCopperStabilizer ? kMedCu : kMedAl);
207 TGeoVolume* outerVacuumVol = new TGeoVolume("outerVacuum", outerVacuum, kMedVac);
208 TGeoVolume* outerWrapVol = new TGeoVolume("outerWrap", outerLayer, kMedAl);
209
210 innerWrapVol->SetLineColor(kRed + 2);
211 innerVacuumVol->SetLineColor(kRed + 2);
212 coilsVol->SetLineColor(kRed + 2);
213 restMaterialVol->SetLineColor(kRed + 2);
214 outerVacuumVol->SetLineColor(kRed + 2);
215 outerWrapVol->SetLineColor(kRed + 2);
216
217 new TGeoVolumeAssembly("magnet");
218 auto* magnet = gGeoManager->GetVolume("magnet");
219 magnet->AddNode(innerWrapVol, 1, nullptr);
220 magnet->AddNode(innerVacuumVol, 1, nullptr);
221 magnet->AddNode(coilsVol, 1, nullptr);
222 magnet->AddNode(restMaterialVol, 1, nullptr);
223 magnet->AddNode(outerVacuumVol, 1, nullptr);
224 magnet->AddNode(outerWrapVol, 1, nullptr);
225
226 magnet->SetVisibility(1);
227
228 barrel->AddNode(magnet, 1, new TGeoTranslation(0, 30.f, 0));
229}
230
232{
233 return new Alice3Magnet(*this);
234}
Definition of the Detector class.
std::ostringstream debug
ClassImp(IdPath)
static void initFieldTrackingParams(int &mode, float &maxfield)
Definition Detector.cxx:143
static MaterialManager & Instance()
FairModule * CloneModule() const override
Clone this object (used in MT mode only)
Definition Magnet.cxx:231
void ConstructGeometry() override
Definition Magnet.cxx:115
a common base class for passive modules - implementing generic functions
Definition PassiveBase.h:24
GLuint const GLchar * name
Definition glcorearb.h:781
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"