Skip to content

Commit 610b926

Browse files
authored
ALICE3: Improve beampipe geometry and fix position (#5548)
* alice3: fix beampipe Y coordinate * Improve ALICE 3 beampipe * Fix extrusions and overlaps
1 parent 48a2a59 commit 610b926

3 files changed

Lines changed: 81 additions & 39 deletions

File tree

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

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ class Alice3Pipe : public Alice3PassiveBase
2525
~Alice3Pipe() override;
2626
Alice3Pipe(const char* name,
2727
const char* title = "Alice 3 Pipe",
28-
const float innerRho = 0.f,
28+
const bool isTRKActivated = false,
29+
const float rMinInnerPipe = 0.f,
2930
const float innerThickness = 0.f,
3031
const float innerLength = 0.f,
31-
const float outerRho = 0.f,
32+
const float rMinOuterPipe = 0.f,
3233
const float outerThickness = 0.f,
3334
const float outerLength = 0.f);
3435

@@ -37,29 +38,33 @@ class Alice3Pipe : public Alice3PassiveBase
3738
/// Clone this object (used in MT mode only)
3839
FairModule* CloneModule() const override;
3940

40-
float getInnerRmin() const { return mBeInnerPipeRmax - mBeInnerPipeThick; }
41-
float getInnerRmax() const { return mBeInnerPipeRmax; }
41+
float getInnerRmin() const { return mBeInnerPipeRmin; }
42+
float getInnerRmax() const { return mBeInnerPipeRmin + mBeInnerPipeThick; }
4243
float getInnerWidth() const { return mBeInnerPipeThick; }
4344
float getInnerDz() const { return mInnerIpHLength; }
4445

45-
float getOuterRmin() const { return mBeOuterPipeRmax - mBeOuterPipeThick; }
46-
float getOuterRmax() const { return mBeOuterPipeRmax; }
46+
float getOuterRmin() const { return mBeOuterPipeRmin; }
47+
float getOuterRmax() const { return mBeOuterPipeRmin + mBeOuterPipeThick; }
4748
float getOuterWidth() const { return mBeOuterPipeThick; }
4849
float getOuterDz() const { return mOuterIpHLength; }
4950

51+
bool IsTRKActivated() const { return mIsTRKActivated; }
52+
5053
private:
5154
void createMaterials();
5255
Alice3Pipe(const Alice3Pipe& orig) = default;
5356
Alice3Pipe& operator=(const Alice3Pipe&);
5457

55-
float mBeInnerPipeRmax = 0.; // inner diameter of the Be section
56-
float mBeInnerPipeThick = 0.; // inner section thickness
58+
float mBeInnerPipeRmin = 0.; // inner diameter of the inner Be section
59+
float mBeInnerPipeThick = 0.; // inner beam pipe section thickness
5760
float mInnerIpHLength = 0.; // half length of the inner beampipe around the IP
5861

59-
float mBeOuterPipeRmax = 0.; // outer diameter of the Be section
60-
float mBeOuterPipeThick = 0.; // outer section thickness
62+
float mBeOuterPipeRmin = 0.; // inner diameter of the outer Be section
63+
float mBeOuterPipeThick = 0.; // outer beam pipe section thickness
6164
float mOuterIpHLength = 0.; // half length of the outer beampipe around the IP
6265

66+
bool mIsTRKActivated = true; // If TRK is not active don't create TRK layers allocations in the vacuum volume
67+
6368
ClassDefOverride(Alice3Pipe, 1);
6469
};
6570
} // namespace passive

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

Lines changed: 65 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
#include <DetectorsBase/MaterialManager.h>
1414
#include <TGeoTube.h>
1515
#include <TVirtualMC.h>
16-
#include "TGeoManager.h" // for TGeoManager, gGeoManager
17-
#include "TGeoMaterial.h" // for TGeoMaterial
18-
#include "TGeoMedium.h" // for TGeoMedium
19-
#include "TGeoVolume.h" // for TGeoVolume
16+
#include "TGeoManager.h" // for TGeoManager, gGeoManager
17+
#include "TGeoMaterial.h" // for TGeoMaterial
18+
#include "TGeoMedium.h" // for TGeoMedium
19+
#include "TGeoVolume.h" // for TGeoVolume
20+
#include "TGeoCompositeShape.h" // forTGeoCompositeShape
2021
// force availability of assert
2122
#ifdef NDEBUG
2223
#undef NDEBUG
@@ -28,17 +29,19 @@ using namespace o2::passive;
2829
Alice3Pipe::Alice3Pipe() : Alice3PassiveBase{"Alice3PIPE", ""} {}
2930
Alice3Pipe::Alice3Pipe(const char* name,
3031
const char* title,
31-
float innerRho,
32+
bool isTRKActivated,
33+
float rMinInnerPipe,
3234
float innerThickness,
3335
float innerLength,
34-
float outerRho,
36+
float rMinOuterPipe,
3537
float outerThickness,
3638
float outerLength)
3739
: Alice3PassiveBase{name, title},
38-
mBeInnerPipeRmax{innerRho},
40+
mIsTRKActivated{isTRKActivated},
41+
mBeInnerPipeRmin{rMinInnerPipe},
3942
mBeInnerPipeThick{innerThickness},
4043
mInnerIpHLength{innerLength},
41-
mBeOuterPipeRmax{outerRho},
44+
mBeOuterPipeRmin{rMinOuterPipe},
4245
mBeOuterPipeThick{outerThickness},
4346
mOuterIpHLength{outerLength}
4447
{
@@ -92,35 +95,69 @@ void Alice3Pipe::ConstructGeometry()
9295
LOG(FATAL) << "Could not find the top volume";
9396
}
9497

98+
//---------------- Outermost Be pipe around the IP ----------
99+
// Outer pipe has to be filled with vacuum. There we have also TRK layers, which we don't want to depend on the pipe volume.
100+
// Eventually, we will depend on some information passed from the outside.
101+
// For A3PIP-only simulations, we don't want TRK's shade.
102+
// Strategy used here is to use a composite shape where shapes of TRK layers are subtracted to the vacuum volume
103+
TGeoTube* outerBeTube = new TGeoTube("OUT_PIPEsh", mBeOuterPipeRmin, mBeOuterPipeRmin + mBeOuterPipeThick, mOuterIpHLength);
104+
TGeoVolume* outerBeTubeVolume = new TGeoVolume("OUT_PIPE", outerBeTube, kMedBe);
105+
outerBeTubeVolume->SetLineColor(kBlue);
106+
107+
TGeoTube* outerBerylliumTubeVacuumBase = new TGeoTube("OUT_PIPEVACUUM_BASEsh", mBeInnerPipeRmin + mBeInnerPipeThick, mBeOuterPipeRmin, mOuterIpHLength); // Vacuum filling for outer pipe
108+
TGeoCompositeShape* outerBerylliumTubeVacuumComposite; // Composite volume to subctract to vacuum
109+
TGeoVolume* outerBerylliumTubeVacuumVolume; // Final volume to be used
110+
111+
TString compositeFormula{"OUT_PIPEVACUUM_BASEsh"}; // If pipe is alone we won't subctract anything
112+
TString subtractorsFormula;
113+
114+
if (!mIsTRKActivated) {
115+
std::vector<TGeoTube*> trkLayerShapes;
116+
std::vector<std::array<float, 3>> layersQuotas = {std::array<float, 3>{0.5f, 15.f, 50.e-4}, // TODO: Set layers dynamically. {radius, zLen, thickness}
117+
std::array<float, 3>{1.2f, 15.f, 50.e-4},
118+
std::array<float, 3>{2.5f, 15.f, 50.e-4}};
119+
120+
subtractorsFormula = "TRKLAYER_0sh"; // First volume to be subctracted (at least one has to be provided)
121+
for (auto iLayer{0}; iLayer < layersQuotas.size(); ++iLayer) { // Create TRK layers shapes
122+
auto& layerData = layersQuotas[iLayer];
123+
trkLayerShapes.emplace_back(new TGeoTube(Form("TRKLAYER_%dsh", iLayer), layerData[0], layerData[0] + layerData[2], layerData[1] / 2));
124+
if (iLayer > 0) {
125+
subtractorsFormula += Form("+TRKLAYER_%dsh", iLayer);
126+
}
127+
}
128+
LOG(DEBUG) << "Subtractors formula before: " << subtractorsFormula;
129+
subtractorsFormula = Form("-(%s)", subtractorsFormula.Data());
130+
LOG(DEBUG) << "Subtractors formula after: " << subtractorsFormula;
131+
132+
outerBerylliumTubeVacuumComposite = new TGeoCompositeShape("OUT_PIPEVACUUMsh", (compositeFormula + subtractorsFormula).Data());
133+
outerBerylliumTubeVacuumVolume = new TGeoVolume("OUT_PIPEVACUUM", outerBerylliumTubeVacuumComposite, kMedVac);
134+
} else {
135+
outerBerylliumTubeVacuumVolume = new TGeoVolume("OUT_PIPEVACUUM", outerBerylliumTubeVacuumBase, kMedVac);
136+
}
137+
138+
outerBerylliumTubeVacuumVolume->SetVisibility(1);
139+
outerBerylliumTubeVacuumVolume->SetTransparency(50);
140+
outerBerylliumTubeVacuumVolume->SetLineColor(kGreen);
141+
142+
// outerBeTubeVolume->AddNode(outerBerylliumTubeVacuumVolume, 1, gGeoIdentity);
143+
barrel->AddNode(outerBerylliumTubeVacuumVolume, 1, new TGeoTranslation(0, 30.f, 0));
144+
145+
barrel->AddNode(outerBeTubeVolume, 1, new TGeoTranslation(0, 30.f, 0)); // Add to surrounding geometry
146+
95147
//---------------- Innermost Be pipe around the IP ----------
96148
TGeoTube* innerBeTube =
97-
new TGeoTube("INN_PIPEsh", mBeInnerPipeRmax - mBeInnerPipeThick, mBeInnerPipeRmax, mInnerIpHLength);
149+
new TGeoTube("INN_PIPEsh", mBeInnerPipeRmin, mBeInnerPipeRmin + mBeInnerPipeThick, mInnerIpHLength);
98150
TGeoVolume* innerBeTubeVolume = new TGeoVolume("INN_PIPE", innerBeTube, kMedBe);
99151
innerBeTubeVolume->SetLineColor(kRed);
100152

101153
TGeoTube* berylliumTubeVacuum =
102-
new TGeoTube("INN_PIPEVACUUMsh", 0., mBeInnerPipeRmax, mInnerIpHLength);
103-
TGeoVolume* innerBerylliumTubeVacuumVolume = new TGeoVolume("INN_PIPEMOTHER", berylliumTubeVacuum, kMedVac);
104-
innerBerylliumTubeVacuumVolume->AddNode(innerBeTubeVolume, 1, gGeoIdentity);
154+
new TGeoTube("INN_PIPEVACUUMsh", 0., mBeInnerPipeRmin, mInnerIpHLength);
155+
TGeoVolume* innerBerylliumTubeVacuumVolume = new TGeoVolume("INN_PIPEVACUUM", berylliumTubeVacuum, kMedVac);
105156
innerBerylliumTubeVacuumVolume->SetVisibility(0);
106157
innerBerylliumTubeVacuumVolume->SetLineColor(kGreen);
107158

108-
barrel->AddNode(innerBerylliumTubeVacuumVolume, 1, gGeoIdentity);
109-
110-
//---------------- Outermost Be pipe around the IP ----------
111-
TGeoTube* outerBeTube =
112-
new TGeoTube("OUT_PIPEsh", mBeOuterPipeRmax - mBeOuterPipeThick, mBeOuterPipeRmax, mOuterIpHLength);
113-
TGeoVolume* outerBeTubeVolume = new TGeoVolume("OUT_PIPE", outerBeTube, kMedBe);
114-
outerBeTubeVolume->SetLineColor(kBlue);
115-
116-
TGeoTube* outerBerylliumTubeVacuum =
117-
new TGeoTube("OUT_PIPEVACUUMsh", 0., mBeOuterPipeRmax, mOuterIpHLength);
118-
TGeoVolume* outerBerylliumTubeVacuumVolume = new TGeoVolume("OUT_PIPEMOTHER", outerBerylliumTubeVacuum, kMedVac);
119-
outerBerylliumTubeVacuumVolume->AddNode(outerBeTubeVolume, 1, gGeoIdentity);
120-
outerBerylliumTubeVacuumVolume->SetVisibility(0);
121-
outerBerylliumTubeVacuumVolume->SetLineColor(kGreen);
122-
123-
barrel->AddNode(outerBerylliumTubeVacuumVolume, 1, gGeoIdentity);
159+
innerBeTubeVolume->AddNode(innerBerylliumTubeVacuumVolume, 1, gGeoIdentity);
160+
barrel->AddNode(innerBeTubeVolume, 1, new TGeoTranslation(0, 30.f, 0));
124161
}
125162

126163
void Alice3Pipe::createMaterials()

macro/build_geometry.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void build_geometry(FairRunSim* run = nullptr)
141141
#ifdef ENABLE_UPGRADES
142142
// upgraded beampipe at the interaction point (IP)
143143
if (isActivated("A3IP")) {
144-
run->AddModule(new o2::passive::Alice3Pipe("A3IP", "Alice 3 beam pipe", 0.48f, 0.015f, 44.4f, 3.7f, 0.1f, 44.4f));
144+
run->AddModule(new o2::passive::Alice3Pipe("A3IP", "Alice 3 beam pipe", !isActivated("TRK"), 0.48f, 0.015f, 44.4f, 3.7f, 0.05f, 44.4f));
145145
}
146146
#endif
147147

0 commit comments

Comments
 (0)