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
104{
106
107 // Passive Base configuration parameters
108 auto& passiveBaseParam = Alice3PassiveBaseParam::Instance();
109 const bool doCopperStabilizer = (passiveBaseParam.mLayout == o2::passive::MagnetLayout::CopperStabilizer);
110 if (doCopperStabilizer) {
111 mRestMaterialThickness -= 3.3; // cm Remove the Aluminium stabiliser
112 mRestMaterialThickness += 2.2; // cm Add the Copper stabiliser
113 LOG(debug) << "Alice 3 magnet: using Copper Stabilizer with thickness " << mRestMaterialThickness << " cm";
114 }
115
116 TGeoManager* geoManager = gGeoManager;
117 TGeoVolume* barrel = geoManager->GetVolume("barrel");
118 if (!barrel) {
119 LOGP(fatal, "Could not find barrel volume while constructing Alice 3 magnet geometry");
120 }
121
123 auto kMedAl = matmgr.getTGeoMedium("ALICE3_MAGNET_ALUMINIUM");
124 auto kMedCu = matmgr.getTGeoMedium("ALICE3_MAGNET_COPPER");
125 auto kMedVac = matmgr.getTGeoMedium("ALICE3_MAGNET_VACUUM");
126
127 // inner wrap
128 LOGP(debug, "Alice 3 magnet: creating inner wrap with inner radius {} cm and thickness {} cm", mInnerWrapInnerRadius, mInnerWrapThickness);
129 TGeoTube* innerLayer = new TGeoTube(mInnerWrapInnerRadius, mInnerWrapInnerRadius + mInnerWrapThickness, mZLength / 2);
130 TGeoTube* innerVacuum = new TGeoTube(mInnerWrapInnerRadius + mInnerWrapThickness, mCoilInnerRadius, mZLength / 2);
131 // coils layer
132 LOGP(debug, "Alice 3 magnet: creating coils layer with inner radius {} cm and thickness {} cm", mCoilInnerRadius, mCoilThickness);
133 TGeoTube* coilsLayer = new TGeoTube(mCoilInnerRadius, mCoilInnerRadius + mCoilThickness, mZLength / 2);
134 TGeoTube* restMaterial = new TGeoTube(mRestMaterialRadius, mRestMaterialRadius + mRestMaterialThickness, mZLength / 2);
135 TGeoTube* outerVacuum = new TGeoTube(mRestMaterialRadius + mRestMaterialThickness, mOuterWrapInnerRadius, mZLength / 2);
136 // outer wrap
137 LOGP(debug, "Alice 3 magnet: creating outer wrap with inner radius {} cm and thickness {} cm", mOuterWrapInnerRadius, mOuterWrapThickness);
138 TGeoTube* outerLayer = new TGeoTube(mOuterWrapInnerRadius, mOuterWrapInnerRadius + mOuterWrapThickness, mZLength / 2);
139
140 TGeoVolume* innerWrapVol = new TGeoVolume("innerWrap", innerLayer, kMedAl);
141 TGeoVolume* innerVacuumVol = new TGeoVolume("innerVacuum", innerVacuum, kMedVac);
142 TGeoVolume* coilsVol = new TGeoVolume("coils", coilsLayer, kMedCu);
143 TGeoVolume* restMaterialVol = new TGeoVolume("restMaterial", restMaterial, doCopperStabilizer ? kMedCu : kMedAl);
144 TGeoVolume* outerVacuumVol = new TGeoVolume("outerVacuum", outerVacuum, kMedVac);
145 TGeoVolume* outerWrapVol = new TGeoVolume("outerWrap", outerLayer, kMedAl);
146
147 innerWrapVol->SetLineColor(kRed + 2);
148 innerVacuumVol->SetLineColor(kRed + 2);
149 coilsVol->SetLineColor(kRed + 2);
150 restMaterialVol->SetLineColor(kRed + 2);
151 outerVacuumVol->SetLineColor(kRed + 2);
152 outerWrapVol->SetLineColor(kRed + 2);
153
154 new TGeoVolumeAssembly("magnet");
155 auto* magnet = gGeoManager->GetVolume("magnet");
156 magnet->AddNode(innerWrapVol, 1, nullptr);
157 magnet->AddNode(innerVacuumVol, 1, nullptr);
158 magnet->AddNode(coilsVol, 1, nullptr);
159 magnet->AddNode(restMaterialVol, 1, nullptr);
160 magnet->AddNode(outerVacuumVol, 1, nullptr);
161 magnet->AddNode(outerWrapVol, 1, nullptr);
162
163 magnet->SetVisibility(1);
164
165 barrel->AddNode(magnet, 1, new TGeoTranslation(0, 30.f, 0));
166}
167
169{
170 return new Alice3Magnet(*this);
171}
Definition of the Detector class.
ClassImp(IdPath)
std::ostringstream debug
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:168
void ConstructGeometry() override
Definition Magnet.cxx:103
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"