Skip to content

Commit 22e9cff

Browse files
mconcassawenzel
authored andcommitted
Add simplified magnet for Alice 3
1 parent 63e2915 commit 22e9cff

7 files changed

Lines changed: 185 additions & 1 deletion

File tree

Common/SimConfig/src/SimConfig.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ void SimConfig::determineActiveModules(std::vector<std::string> const& inputargs
9999
}
100100
activeModules.emplace_back("A3IP");
101101
activeModules.emplace_back("A3ABSO");
102+
activeModules.emplace_back("A3MAG");
102103
} else {
103104
#endif
104105
// add passive components manually (make a PassiveDetID for them!)

Detectors/Upgrades/ALICE3/Passive/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ o2_add_library(Alice3DetectorsPassive
1313
SOURCES src/Pipe.cxx
1414
src/PassiveBase.cxx
1515
src/Absorber.cxx
16+
src/Magnet.cxx
1617
PUBLIC_LINK_LIBRARIES O2::Field O2::DetectorsBase O2::SimConfig)
1718

1819
o2_target_root_dictionary(Alice3DetectorsPassive
1920
HEADERS include/Alice3DetectorsPassive/Pipe.h
2021
include/Alice3DetectorsPassive/PassiveBase.h
2122
include/Alice3DetectorsPassive/Absorber.h
23+
include/Alice3DetectorsPassive/Magnet.h
2224
LINKDEF src/PassiveLinkDef.h)
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
12+
#ifndef ALICE3_PASSIVE_MAGNET_H
13+
#define ALICE3_PASSIVE_MAGNET_H
14+
15+
#include "Alice3DetectorsPassive/PassiveBase.h"
16+
17+
namespace o2
18+
{
19+
namespace passive
20+
{
21+
22+
class Alice3Magnet : public Alice3PassiveBase
23+
{
24+
public:
25+
Alice3Magnet(const char* name, const char* Title = "ALICE3 Magnet");
26+
Alice3Magnet();
27+
~Alice3Magnet() override;
28+
void ConstructGeometry() override;
29+
void createMaterials();
30+
31+
/// Clone this object (used in MT mode only)
32+
FairModule* CloneModule() const override;
33+
34+
private:
35+
Alice3Magnet(const Alice3Magnet& orig);
36+
Alice3Magnet& operator=(const Alice3Magnet&);
37+
38+
float mInnerWrapInnerRadius{160.f}; // cm
39+
float mTotalThickness{10.8f}; // cm
40+
float mCoilThickness{0.3f}; // cm
41+
float mZLength{800.f}; // cm
42+
43+
ClassDefOverride(o2::passive::Alice3Magnet, 1);
44+
};
45+
} // namespace passive
46+
} // namespace o2
47+
#endif

Detectors/Upgrades/ALICE3/Passive/src/Absorber.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void Alice3Absorber::ConstructGeometry()
120120
TGeoVolume* top = gGeoManager->GetVolume("cave");
121121
TGeoVolume* barrel = gGeoManager->GetVolume("barrel");
122122
if (!barrel) {
123-
LOG(fatal) << "Could not find the top volume";
123+
LOG(fatal) << "Could not find the barrel volume while constructing absorber geometry";
124124
}
125125

126126
TGeoPcon* absorings = new TGeoPcon(0., 360., 18);
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
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+
12+
#include <DetectorsBase/Detector.h>
13+
#include <DetectorsBase/MaterialManager.h>
14+
#include <Alice3DetectorsPassive/Magnet.h>
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+
22+
using namespace o2::passive;
23+
24+
Alice3Magnet::~Alice3Magnet() = default;
25+
Alice3Magnet::Alice3Magnet() : Alice3PassiveBase("A3MAG", "") {}
26+
Alice3Magnet::Alice3Magnet(const char* name, const char* title) : Alice3PassiveBase(name, title) {}
27+
Alice3Magnet::Alice3Magnet(const Alice3Magnet& rhs) = default;
28+
29+
Alice3Magnet& 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+
40+
void Alice3Magnet::createMaterials()
41+
{
42+
auto& matmgr = o2::base::MaterialManager::Instance();
43+
int isxfld = 2.;
44+
float sxmgmx = 10.;
45+
o2::base::Detector::initFieldTrackingParams(isxfld, sxmgmx);
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+
float epsil, stmin, tmaxfd, deemax, stemax;
65+
epsil = .001; // Tracking precision,
66+
stemax = -0.01; // Maximum displacement for multiple scat
67+
tmaxfd = -20.; // Maximum angle due to field deflection
68+
deemax = -.3; // Maximum fractional energy loss, DLS
69+
stmin = -.8;
70+
71+
matmgr.Material("A3MAG", 9, "Al1$", 26.98, 13., 2.7, 8.9, 37.2);
72+
matmgr.Material("A3MAG", 19, "Cu1$", 63.55, 29., 8.96, 1.6, 18.8);
73+
74+
matmgr.Medium("A3MAG", 9, "ALU_C0", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
75+
matmgr.Medium("A3MAG", 19, "CU_C0", 19, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
76+
}
77+
78+
void Alice3Magnet::ConstructGeometry()
79+
{
80+
createMaterials();
81+
82+
TGeoManager* geoManager = gGeoManager;
83+
TGeoVolume* barrel = geoManager->GetVolume("barrel");
84+
if (!barrel) {
85+
LOGP(fatal, "Could not find barrel volume while constructing Alice 3 magnet geometry");
86+
}
87+
88+
auto& matmgr = o2::base::MaterialManager::Instance();
89+
auto kMedAl = matmgr.getTGeoMedium("A3MAG_ALU_C0");
90+
auto kMedCu = matmgr.getTGeoMedium("A3MAG_CU_C0");
91+
92+
float wrapThickness = (mTotalThickness - mCoilThickness) / 2; // Thickness of the Al wraps
93+
float innerCoilsRadius = mInnerWrapInnerRadius + wrapThickness; // Inner radius of the Cu coils
94+
float externalWrapInnerRadius = innerCoilsRadius + mCoilThickness; // Inner radius of the external wrapping Al cylinder
95+
96+
// inner wrap
97+
LOGP(debug, "Alice 3 magnet: creating inner wrap with inner radius {} and thickness {}", mInnerWrapInnerRadius, wrapThickness);
98+
TGeoTube* innerLayer = new TGeoTube(mInnerWrapInnerRadius, mInnerWrapInnerRadius + wrapThickness, mZLength / 2);
99+
// coils layer
100+
LOGP(debug, "Alice 3 magnet: creating coils layer with inner radius {} and thickness {}", innerCoilsRadius, mCoilThickness);
101+
TGeoTube* coilsLayer = new TGeoTube(innerCoilsRadius, innerCoilsRadius + mCoilThickness, mZLength / 2);
102+
// outer wrap
103+
LOGP(debug, "Alice 3 magnet: creating outer wrap with inner radius {} and thickness {}", externalWrapInnerRadius, wrapThickness);
104+
TGeoTube* outerLayer = new TGeoTube(externalWrapInnerRadius, externalWrapInnerRadius + wrapThickness, mZLength / 2);
105+
106+
TGeoVolume* innerWrap = new TGeoVolume("innerWrap", innerLayer, kMedAl);
107+
TGeoVolume* coils = new TGeoVolume("coils", coilsLayer, kMedCu);
108+
TGeoVolume* outerWrap = new TGeoVolume("outerWrap", outerLayer, kMedAl);
109+
innerWrap->SetLineColor(kRed);
110+
coils->SetLineColor(kOrange);
111+
outerWrap->SetLineColor(kRed);
112+
113+
new TGeoVolumeAssembly("magnet");
114+
auto* magnet = gGeoManager->GetVolume("magnet");
115+
magnet->AddNode(innerWrap, 1, nullptr);
116+
magnet->AddNode(coils, 1, nullptr);
117+
magnet->AddNode(outerWrap, 1, nullptr);
118+
119+
magnet->SetVisibility(1);
120+
121+
barrel->AddNode(magnet, 1, new TGeoTranslation(0, 30.f, 0));
122+
}
123+
124+
FairModule* Alice3Magnet::CloneModule() const
125+
{
126+
return new Alice3Magnet(*this);
127+
}
128+
ClassImp(o2::passive::Alice3Magnet)

Detectors/Upgrades/ALICE3/Passive/src/PassiveLinkDef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
#pragma link C++ class o2::passive::Alice3PassiveBase + ;
1919
#pragma link C++ class o2::passive::Alice3Pipe + ;
2020
#pragma link C++ class o2::passive::Alice3Absorber + ;
21+
#pragma link C++ class o2::passive::Alice3Magnet + ;
2122

2223
#endif

macro/build_geometry.C

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#include <FCTSimulation/Detector.h>
5656
#include <Alice3DetectorsPassive/Pipe.h>
5757
#include <Alice3DetectorsPassive/Absorber.h>
58+
#include <Alice3DetectorsPassive/Magnet.h>
5859
#endif
5960

6061
void finalize_geometry(FairRunSim* run);
@@ -168,6 +169,10 @@ void build_geometry(FairRunSim* run = nullptr)
168169
run->AddModule(new o2::passive::Alice3Absorber("A3ABSO", "ALICE3 Absorber"));
169170
}
170171

172+
// the magnet
173+
if (isActivated("A3MAG")) {
174+
run->AddModule(new o2::passive::Alice3Magnet("A3MAG", "ALICE3 Magnet"));
175+
}
171176
#endif
172177

173178
// the absorber

0 commit comments

Comments
 (0)