Skip to content

Commit afef751

Browse files
committed
Add macros
Add magnet
1 parent f045ccf commit afef751

6 files changed

Lines changed: 166 additions & 8 deletions

File tree

Detectors/Upgrades/ALICE3/Passive/include/Alice3DetectorsPassive/PassiveBaseParam.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,16 @@ enum MagnetLayout : int {
3131

3232
enum DetLayout : int {
3333
StandardRadius = 0,
34-
ReducedRadius = 1
34+
ReducedRadius = 1,
35+
Version2 = 2 // Specs from engineering note 2026-05-06
3536
};
3637

3738
struct Alice3PassiveBaseParam : public o2::conf::ConfigurableParamHelper<Alice3PassiveBaseParam> {
3839
// Geometry Builder parameters
3940

40-
int mLayout = MagnetLayout::AluminiumStabilizer;
41-
int mDetLayout = DetLayout::StandardRadius;
41+
MagnetLayout mLayout = MagnetLayout::AluminiumStabilizer; // Magnet layout: Aluminium or Copper stabilizer
42+
// DetLayout mDetLayout = DetLayout::StandardRadius; // Detector layout: Standard or Reduced radius
43+
DetLayout mDetLayout = o2::passive::DetLayout::Version2; // Detector layout: Standard or Reduced radius
4244

4345
O2ParamDef(Alice3PassiveBaseParam, "Alice3PassiveBase");
4446
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ void Alice3Absorber::ConstructGeometry()
154154
absorings->DefineSection(17, -500, 236, 274);
155155
break;
156156
case o2::passive::DetLayout::ReducedRadius:
157+
case o2::passive::DetLayout::Version2:
157158
absorings->DefineSection(0, 500, 201, 239);
158159
absorings->DefineSection(1, 400, 201, 239);
159160
absorings->DefineSection(2, 400, 197.5, 242.5);

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ void Alice3Magnet::ConstructGeometry()
107107
// Passive Base configuration parameters
108108
auto& passiveBaseParam = Alice3PassiveBaseParam::Instance();
109109

110+
const bool isVersion2 = (passiveBaseParam.mDetLayout == o2::passive::DetLayout::Version2);
111+
110112
switch (passiveBaseParam.mDetLayout) {
111113
case o2::passive::DetLayout::StandardRadius:
112114
// Defined in the header file
@@ -122,6 +124,19 @@ void Alice3Magnet::ConstructGeometry()
122124
mOuterWrapThickness = 3.f; // cm
123125
mZLength = 800.f; // cm
124126
break;
127+
case o2::passive::DetLayout::Version2:
128+
// Engineering note 2026-05-06 baseline stack (radial):
129+
// inner wall 3 mm + winding pack 48 mm + support cylinder 20 mm + MLI 2 mm + outer wall 3 mm.
130+
mInnerWrapInnerRadius = 125.f; // cm
131+
mInnerWrapThickness = 0.3f; // cm
132+
mCoilInnerRadius = mInnerWrapInnerRadius + mInnerWrapThickness; // cm
133+
mCoilThickness = 4.8f; // cm
134+
mRestMaterialRadius = mCoilInnerRadius + mCoilThickness; // cm
135+
mRestMaterialThickness = 2.2f; // cm
136+
mOuterWrapInnerRadius = mRestMaterialRadius + mRestMaterialThickness; // cm
137+
mOuterWrapThickness = 0.3f; // cm
138+
mZLength = 800.f; // cm
139+
break;
125140
default:
126141
LOG(fatal) << "Unknown detector layout " << passiveBaseParam.mDetLayout;
127142
break;
@@ -133,6 +148,10 @@ void Alice3Magnet::ConstructGeometry()
133148
// Handled in the header file
134149
break;
135150
case o2::passive::MagnetLayout::CopperStabilizer:
151+
if (isVersion2) {
152+
LOG(warn) << "Alice 3 magnet: CopperStabilizer override ignored for Version2 (engineering-note stack)";
153+
break;
154+
}
136155
doCopperStabilizer = true;
137156
mRestMaterialThickness -= 3.3; // cm Remove the Aluminium stabiliser
138157
mRestMaterialThickness += 2.2; // cm Add the Copper stabiliser

Detectors/Upgrades/ALICE3/macros/ALICE3Field.C

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ std::function<void(const double*, double*)> field()
1717
double Rc;
1818
double R1;
1919
double R2;
20-
double B1;
20+
const double B1 = 0.5; // [T]
2121
double B2;
22-
double beamStart = 500.; //[cm]
23-
double tokGauss = 1. / 0.1; // conversion from Tesla to kGauss
22+
const double beamStart = 500.; // [cm]
23+
static constexpr double tokGauss = 1. / 0.1; // conversion from Tesla to kGauss
2424

2525
bool isMagAbs = true;
2626

@@ -34,7 +34,6 @@ std::function<void(const double*, double*)> field()
3434
R2 = 290.; //[cm]
3535

3636
// To set the B2
37-
B1 = 2.; //[T]
3837
B2 = -Rc * Rc / ((R2 * R2 - R1 * R1) * B1); //[T]
3938

4039
if ((abs(x[2]) <= beamStart) && (sqrt(x[0] * x[0] + x[1] * x[1]) < Rc)) {
@@ -63,4 +62,47 @@ std::function<void(const double*, double*)> field()
6362
b[2] = 0.;
6463
}
6564
};
65+
}
66+
67+
void ALICE3Field()
68+
{
69+
auto fieldFunc = field();
70+
// RZ plane visualization
71+
TCanvas* cRZ = new TCanvas("cRZ", "Field in RZ plane", 800, 800);
72+
gPad->SetRightMargin(0.15);
73+
TH2F* hRZ = new TH2F("hRZ", "Magnetic Field B_z in RZ plane;Z [m];R [m];B_{z} [kGauss]", 100, -10, 10, 100, -5, 5);
74+
hRZ->SetBit(TH1::kNoStats); // disable stats box
75+
for (int i = 1; i <= hRZ->GetNbinsX(); i++) {
76+
const double Z = hRZ->GetXaxis()->GetBinCenter(i);
77+
for (int j = 1; j <= hRZ->GetNbinsY(); j++) {
78+
const double R = hRZ->GetYaxis()->GetBinCenter(j);
79+
const double pos[3] = {R * 100, 0, Z * 100}; // convert to cm
80+
double b[3] = {0, 0, 0};
81+
fieldFunc(pos, b);
82+
hRZ->SetBinContent(i, j, b[2]);
83+
}
84+
}
85+
86+
hRZ->Draw("COLZ");
87+
cRZ->Update();
88+
89+
// XY plane visualization
90+
TCanvas* cXY = new TCanvas("cXY", "Field in XY plane", 800, 800);
91+
gPad->SetRightMargin(0.15);
92+
TH2F* hXY = new TH2F("hXY", "Magnetic Field B_z in XY plane;X [m];Y [m];B_{z} [kGauss]", 100, -5, 5, 100, -5, 5);
93+
hXY->SetBit(TH1::kNoStats); // disable stats box
94+
95+
for (int i = 1; i <= hXY->GetNbinsX(); i++) {
96+
const double X = hXY->GetXaxis()->GetBinCenter(i);
97+
for (int j = 1; j <= hXY->GetNbinsY(); j++) {
98+
const double Y = hXY->GetYaxis()->GetBinCenter(j);
99+
const double pos[3] = {X * 100, Y * 100, 0}; // convert to cm
100+
double b[3] = {0, 0, 0};
101+
fieldFunc(pos, b);
102+
hXY->SetBinContent(i, j, b[2]);
103+
}
104+
}
105+
106+
hXY->Draw("COLZ");
107+
cXY->Update();
66108
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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+
// Author: J. E. Munoz Mendez jesus.munoz@cern.ch
13+
14+
std::function<void(const double*, double*)> field()
15+
{
16+
return [](const double* x, double* b) {
17+
const double Rc = 185.; //[cm]
18+
const double R1 = 220.; //[cm]
19+
const double R2 = 290.; //[cm]
20+
const double B1 = 2.; //[T]
21+
const double B2 = -Rc * Rc / ((R2 * R2 - R1 * R1) * B1); //[T]
22+
const double beamStart = 370.; //[cm]
23+
const double tokGauss = 1. / 0.1; // conversion from Tesla to kGauss
24+
25+
const bool isMagAbs = true;
26+
27+
const double r = sqrt(x[0] * x[0] + x[1] * x[1]);
28+
if ((abs(x[2]) <= beamStart) && (r < Rc)) { // We are inside of the central region
29+
b[0] = 0.;
30+
b[1] = 0.;
31+
b[2] = B1 * tokGauss;
32+
} else if ((abs(x[2]) <= beamStart) && (r >= Rc && r < R1)) { // We are in the transition region
33+
b[0] = 0.;
34+
b[1] = 0.;
35+
b[2] = 0.;
36+
} else if ((abs(x[2]) <= beamStart) && (r >= R1 && r < R2)) { // We are within the magnet
37+
b[0] = 0.;
38+
b[1] = 0.;
39+
if (isMagAbs) {
40+
b[2] = B2 * tokGauss;
41+
} else {
42+
b[2] = 0.;
43+
}
44+
} else { // We are outside of the magnet
45+
b[0] = 0.;
46+
b[1] = 0.;
47+
b[2] = 0.;
48+
}
49+
};
50+
}
51+
52+
void ALICE3V3Magnet()
53+
{
54+
auto fieldFunc = field();
55+
// RZ plane visualization
56+
TCanvas* cRZ = new TCanvas("cRZ", "Field in RZ plane", 800, 600);
57+
TH2F* hRZ = new TH2F("hRZ", "Magnetic Field B_z in RZ plane;Z [m];R [m]", 100, -10, 10, 100, -5, 5);
58+
hRZ->SetBit(TH1::kNoStats); // disable stats box
59+
for (int i = 1; i <= hRZ->GetNbinsX(); i++) {
60+
const double Z = hRZ->GetXaxis()->GetBinCenter(i);
61+
for (int j = 1; j <= hRZ->GetNbinsY(); j++) {
62+
const double R = hRZ->GetYaxis()->GetBinCenter(j);
63+
const double pos[3] = {R * 100, 0, Z * 100}; // convert to cm
64+
double b[3] = {0, 0, 0};
65+
fieldFunc(pos, b);
66+
hRZ->SetBinContent(i, j, b[2]);
67+
}
68+
}
69+
70+
hRZ->Draw("COLZ");
71+
cRZ->Update();
72+
73+
// XY plane visualization
74+
TCanvas* cXY = new TCanvas("cXY", "Field in XY plane", 800, 600);
75+
TH2F* hXY = new TH2F("hXY", "Magnetic Field B_z in XY plane;X [m];Y [m]", 100, -5, 5, 100, -5, 5);
76+
hXY->SetBit(TH1::kNoStats); // disable stats box
77+
78+
for (int i = 1; i <= hXY->GetNbinsX(); i++) {
79+
const double X = hXY->GetXaxis()->GetBinCenter(i);
80+
for (int j = 1; j <= hXY->GetNbinsY(); j++) {
81+
const double Y = hXY->GetYaxis()->GetBinCenter(j);
82+
const double pos[3] = {X * 100, Y * 100, 0}; // convert to cm
83+
double b[3] = {0, 0, 0};
84+
fieldFunc(pos, b);
85+
hXY->SetBinContent(i, j, b[2]);
86+
}
87+
}
88+
89+
hXY->Draw("COLZ");
90+
cXY->Update();
91+
}

Detectors/Upgrades/ALICE3/macros/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ o2_add_test_root_macro(scanXX0.C
1313
LABELS alice3)
1414

1515
o2_add_test_root_macro(plotHits.C
16-
LABELS alice3)
16+
LABELS alice3)
17+
18+
o2_add_test_root_macro(ALICE3FieldShortMagnet.C
19+
LABELS alice3)

0 commit comments

Comments
 (0)