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
15#include <TGeoCompositeShape.h>
16#include <TGeoManager.h>
17#include <TGeoMatrix.h>
18#include <TGeoMedium.h>
19#include <TGeoVolume.h>
20#include <TGeoTube.h>
21
22using namespace o2::passive;
23
26Alice3Magnet::Alice3Magnet(const char* name, const char* title) : Alice3PassiveBase(name, title) {}
27Alice3Magnet::Alice3Magnet(const Alice3Magnet& rhs) = default;
28
29Alice3Magnet& Alice3Magnet::operator=(const Alice3Magnet& rhs)
30{
31 if (this == &rhs) {
32 return *this;
33 }
34
35 Alice3PassiveBase::operator=(rhs);
36
37 return *this;
38}
39
41{
43 int isxfld = 2.;
44 float sxmgmx = 10.;
46
47 // Current information is scarce, we have some X/X0 and thicknesses but no full material information
48 // We use then two main materials: Aluminium for insulation, cryostats, stabiliser, supports and strips.
49 // Copper for the coils.
50 // Latest updated reference table is, for the moment:
51 // +------------------+-------------------------+----------+--------+
52 // | layer | effective thickness [mm]| X0 [cm] | X0 [%] |
53 // +------------------+-------------------------+----------+--------+
54 // | Support cylinder | 20 | 8.896 | 0.225 |
55 // | Al-strip | 1 | 8.896 | 0.011 |
56 // | NbTi/Cu | 3 | 1.598 | 0.188 |
57 // | Insulation | 11 | 17.64 | 0.062 |
58 // | Al-stabiliser | 33 | 8.896 | 0.371 |
59 // | Inner cryostat | 10 | 8.896 | 0.112 |
60 // | Outer cryostat | 30 | 8.896 | 0.337 |
61 // +------------------+-------------------------+----------+--------+
62 // Geometry will be oversimplified in two wrapping cylindrical Al layers (symmetric for the time being) with a Copper layer in between.
63
64 //
65 // Air
66 //
67 float aAir[4] = {12.0107, 14.0067, 15.9994, 39.948};
68 float zAir[4] = {6., 7., 8., 18.};
69 float wAir[4] = {0.000124, 0.755267, 0.231781, 0.012827};
70 float dAir = 1.20479E-3;
71 float dAir1 = 1.20479E-11;
72
73 float epsil, stmin, tmaxfd, deemax, stemax;
74 epsil = .001; // Tracking precision,
75 stemax = -0.01; // Maximum displacement for multiple scat
76 tmaxfd = -20.; // Maximum angle due to field deflection
77 deemax = -.3; // Maximum fractional energy loss, DLS
78 stmin = -.8;
79
80 matmgr.Mixture("ALICE3_MAGNET", 1, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir);
81 matmgr.Material("ALICE3_MAGNET", 9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
82 matmgr.Material("ALICE3_MAGNET", 19, "COPPER$", 63.55, 29., 8.96, 1.436, 15.1);
83
84 matmgr.Medium("ALICE3_MAGNET", 1, "VACUUM", 1, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
85 matmgr.Medium("ALICE3_MAGNET", 9, "ALUMINIUM", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
86 matmgr.Medium("ALICE3_MAGNET", 19, "COPPER", 19, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
87}
88
90{
92
93 TGeoManager* geoManager = gGeoManager;
94 TGeoVolume* barrel = geoManager->GetVolume("barrel");
95 if (!barrel) {
96 LOGP(fatal, "Could not find barrel volume while constructing Alice 3 magnet geometry");
97 }
98
100 auto kMedAl = matmgr.getTGeoMedium("ALICE3_MAGNET_ALUMINIUM");
101 auto kMedCu = matmgr.getTGeoMedium("ALICE3_MAGNET_COPPER");
102 auto kMedVac = matmgr.getTGeoMedium("ALICE3_MAGNET_VACUUM");
103
104 // inner wrap
105 LOGP(debug, "Alice 3 magnet: creating inner wrap with inner radius {} and thickness {}", mInnerWrapInnerRadius, mInnerWrapThickness);
106 TGeoTube* innerLayer = new TGeoTube(mInnerWrapInnerRadius, mInnerWrapInnerRadius + mInnerWrapThickness, mZLength / 2);
107 TGeoTube* innerVacuum = new TGeoTube(mInnerWrapInnerRadius + mInnerWrapThickness, mCoilInnerRadius, mZLength / 2);
108 // coils layer
109 LOGP(debug, "Alice 3 magnet: creating coils layer with inner radius {} and thickness {}", mCoilInnerRadius, mCoilThickness);
110 TGeoTube* coilsLayer = new TGeoTube(mCoilInnerRadius, mCoilInnerRadius + mCoilThickness, mZLength / 2);
111 TGeoTube* restMaterial = new TGeoTube(mRestMaterialRadius, mRestMaterialRadius + mRestMaterialThickness, mZLength / 2);
112 TGeoTube* outerVacuum = new TGeoTube(mRestMaterialRadius + mRestMaterialThickness, mOuterWrapInnerRadius, mZLength / 2);
113 // outer wrap
114 LOGP(debug, "Alice 3 magnet: creating outer wrap with inner radius {} and thickness {}", mOuterWrapInnerRadius, mOuterWrapThickness);
115 TGeoTube* outerLayer = new TGeoTube(mOuterWrapInnerRadius, mOuterWrapInnerRadius + mOuterWrapThickness, mZLength / 2);
116
117 TGeoVolume* innerWrapVol = new TGeoVolume("innerWrap", innerLayer, kMedAl);
118 TGeoVolume* innerVacuumVol = new TGeoVolume("innerVacuum", innerVacuum, kMedVac);
119 TGeoVolume* coilsVol = new TGeoVolume("coils", coilsLayer, kMedCu);
120 TGeoVolume* restMaterialVol = new TGeoVolume("restMaterial", restMaterial, kMedAl);
121 TGeoVolume* outerVacuumVol = new TGeoVolume("outerVacuum", outerVacuum, kMedVac);
122 TGeoVolume* outerWrapVol = new TGeoVolume("outerWrap", outerLayer, kMedAl);
123
124 innerWrapVol->SetLineColor(kRed + 2);
125 innerVacuumVol->SetLineColor(kRed + 2);
126 coilsVol->SetLineColor(kRed + 2);
127 restMaterialVol->SetLineColor(kRed + 2);
128 outerVacuumVol->SetLineColor(kRed + 2);
129 outerWrapVol->SetLineColor(kRed + 2);
130
131 new TGeoVolumeAssembly("magnet");
132 auto* magnet = gGeoManager->GetVolume("magnet");
133 magnet->AddNode(innerWrapVol, 1, nullptr);
134 magnet->AddNode(innerVacuumVol, 1, nullptr);
135 magnet->AddNode(coilsVol, 1, nullptr);
136 magnet->AddNode(restMaterialVol, 1, nullptr);
137 magnet->AddNode(outerVacuumVol, 1, nullptr);
138 magnet->AddNode(outerWrapVol, 1, nullptr);
139
140 magnet->SetVisibility(1);
141
142 barrel->AddNode(magnet, 1, new TGeoTranslation(0, 30.f, 0));
143}
144
146{
147 return new Alice3Magnet(*this);
148}
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:145
void ConstructGeometry() override
Definition Magnet.cxx:89
a common base class for passive modules - implementing generic functions
Definition PassiveBase.h:24
GLuint const GLchar * name
Definition glcorearb.h:781