Skip to content

Commit 069d639

Browse files
mconcassawenzel
authored andcommitted
Add separate class to describe Alice 3 (A3) Beampipe
1 parent 7e284ee commit 069d639

File tree

12 files changed

+380
-67
lines changed

12 files changed

+380
-67
lines changed

Detectors/Upgrades/ALICE3/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
# granted to it by virtue of its status as an Intergovernmental Organization or
99
# submit itself to any jurisdiction.
1010

11+
add_subdirectory(Passive)
1112
add_subdirectory(TRK)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright CERN and copyright holders of ALICE O2. This software is distributed
2+
# under the terms of the GNU General Public License v3 (GPL Version 3), copied
3+
# verbatim in the file "COPYING".
4+
#
5+
# See http://alice-o2.web.cern.ch/license for full licensing information.
6+
#
7+
# In applying this license CERN does not waive the privileges and immunities
8+
# granted to it by virtue of its status as an Intergovernmental Organization or
9+
# submit itself to any jurisdiction.
10+
11+
o2_add_library(A3DetectorsPassive
12+
SOURCES src/A3Pipe.cxx
13+
src/A3PassiveBase.cxx
14+
PUBLIC_LINK_LIBRARIES O2::Field O2::DetectorsBase O2::SimConfig)
15+
16+
o2_target_root_dictionary(A3DetectorsPassive
17+
HEADERS include/A3DetectorsPassive/A3Pipe.h
18+
include/A3DetectorsPassive/A3PassiveBase.h
19+
LINKDEF src/A3PassiveLinkDef.h)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
#ifndef ALICE3_PASSIVE_BASE_H
12+
#define ALICE3_PASSIVE_BASE_H
13+
14+
#include "FairModule.h" // for FairModule
15+
16+
namespace o2
17+
{
18+
namespace passive
19+
{
20+
21+
/// a common base class for passive modules - implementing generic functions
22+
class A3PassiveBase : public FairModule
23+
{
24+
public:
25+
using FairModule::FairModule;
26+
void SetSpecialPhysicsCuts() override;
27+
28+
ClassDefOverride(A3PassiveBase, 1);
29+
};
30+
31+
} // namespace passive
32+
} // namespace o2
33+
34+
#endif
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
#ifndef ALICE3_PASSIVE_PIPE_H
12+
#define ALICE3_PASSIVE_PIPE_H
13+
14+
#include "Rtypes.h"
15+
#include "A3DetectorsPassive/A3PassiveBase.h"
16+
17+
namespace o2
18+
{
19+
namespace passive
20+
{
21+
class A3Pipe : public A3PassiveBase
22+
{
23+
public:
24+
A3Pipe();
25+
~A3Pipe() = default;
26+
A3Pipe(const char* name,
27+
const char* title = "Alice 3 Pipe",
28+
const float innerRho = 0.f,
29+
const float innerThickness = 0.f,
30+
const float innerLength = 0.f,
31+
const float outerRho = 0.f,
32+
const float outerThickness = 0.f,
33+
const float outerLength = 0.f);
34+
35+
void ConstructGeometry() override;
36+
37+
/// Clone this object (used in MT mode only)
38+
FairModule* CloneModule() const override;
39+
40+
float getInnerRmin() const { return mBeInnerPipeRmax - mBeInnerPipeThick; }
41+
float getInnerRmax() const { return mBeInnerPipeRmax; }
42+
float getInnerWidth() const { return mBeInnerPipeThick; }
43+
float getInnerDz() const { return mInnerIpHLength; }
44+
45+
float getOuterRmin() const { return mBeOuterPipeRmax - mBeOuterPipeThick; }
46+
float getOuterRmax() const { return mBeOuterPipeRmax; }
47+
float getOuterWidth() const { return mBeOuterPipeThick; }
48+
float getOuterDz() const { return mOuterIpHLength; }
49+
50+
private:
51+
void createMaterials();
52+
A3Pipe(const A3Pipe& orig) = default;
53+
A3Pipe& operator=(const A3Pipe&);
54+
55+
float mBeInnerPipeRmax = 0.; // inner diameter of the Be section
56+
float mBeInnerPipeThick = 0.; // inner section thickness
57+
float mInnerIpHLength = 0.; // half length of the inner beampipe around the IP
58+
59+
float mBeOuterPipeRmax = 0.; // outer diameter of the Be section
60+
float mBeOuterPipeThick = 0.; // outer section thickness
61+
float mOuterIpHLength = 0.; // half length of the outer beampipe around the IP
62+
63+
ClassDefOverride(A3Pipe, 1);
64+
};
65+
} // namespace passive
66+
} // namespace o2
67+
#endif
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
#include "DetectorsBase/MaterialManager.h"
12+
#include "A3DetectorsPassive/A3PassiveBase.h"
13+
14+
using namespace o2::passive;
15+
16+
void A3PassiveBase::SetSpecialPhysicsCuts()
17+
{
18+
// default implementation for physics cuts setting (might still be overriden by detectors)
19+
// we try to read an external text file supposed to be installed
20+
// in a standard directory
21+
// ${O2_ROOT}/share/Detectors/DETECTORNAME/simulation/data/simcuts.dat
22+
LOG(INFO) << "Setting special cuts for passive module " << GetName();
23+
const char* aliceO2env = std::getenv("O2_ROOT");
24+
std::string inputFile;
25+
if (aliceO2env) {
26+
inputFile = std::string(aliceO2env);
27+
}
28+
inputFile += "/share/Detectors/Upgrades/Passive/simulation/data/simcuts_" + std::string(GetName()) + ".dat";
29+
auto& matmgr = o2::base::MaterialManager::Instance();
30+
matmgr.loadCutsAndProcessesFromFile(GetName(), inputFile.c_str());
31+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
#ifdef __CLING__
12+
13+
#pragma link off all globals;
14+
#pragma link off all classes;
15+
#pragma link off all functions;
16+
17+
#pragma link C++ class o2::passive::A3PassiveBase + ;
18+
#pragma link C++ class o2::passive::A3Pipe + ;
19+
20+
#endif
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
#include "A3DetectorsPassive/A3Pipe.h"
12+
#include <DetectorsBase/Detector.h>
13+
#include <DetectorsBase/MaterialManager.h>
14+
#include <TGeoTube.h>
15+
#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
20+
// force availability of assert
21+
#ifdef NDEBUG
22+
#undef NDEBUG
23+
#endif
24+
#include <cassert>
25+
26+
using namespace o2::passive;
27+
28+
A3Pipe::A3Pipe() : A3PassiveBase{"Alice3PIPE", ""} {}
29+
A3Pipe::A3Pipe(const char* name,
30+
const char* title,
31+
float innerRho,
32+
float innerThickness,
33+
float innerLength,
34+
float outerRho,
35+
float outerThickness,
36+
float outerLength)
37+
: A3PassiveBase{name, title},
38+
mBeInnerPipeRmax{innerRho},
39+
mBeInnerPipeThick{innerThickness},
40+
mInnerIpHLength{innerLength},
41+
mBeOuterPipeRmax{outerRho},
42+
mBeOuterPipeThick{outerThickness},
43+
mOuterIpHLength{outerLength}
44+
{
45+
}
46+
47+
A3Pipe& A3Pipe::operator=(const A3Pipe& rhs)
48+
{
49+
// self assignment
50+
if (this == &rhs) {
51+
return *this;
52+
}
53+
54+
// base class assignment
55+
A3PassiveBase::operator=(rhs);
56+
57+
return *this;
58+
}
59+
60+
void A3Pipe::ConstructGeometry()
61+
{
62+
createMaterials();
63+
//
64+
// Class describing the beam A3Pipe geometry
65+
//
66+
float z, zsh, z0;
67+
//
68+
// Rotation Matrices
69+
//
70+
const float kDegRad = TMath::Pi() / 180.;
71+
// Rotation by 180 deg
72+
TGeoRotation* rot180 = new TGeoRotation("rot180", 90., 180., 90., 90., 180., 0.);
73+
TGeoRotation* rotyz = new TGeoRotation("rotyz", 90., 180., 0., 180., 90., 90.);
74+
TGeoRotation* rotxz = new TGeoRotation("rotxz", 0., 0., 90., 90., 90., 180.);
75+
//
76+
77+
//
78+
// Media
79+
auto& matmgr = o2::base::MaterialManager::Instance();
80+
81+
const TGeoMedium* kMedBe = matmgr.getTGeoMedium("A3PIPE_BE");
82+
const TGeoMedium* kMedVac = matmgr.getTGeoMedium("A3PIPE_VACUUM");
83+
const TGeoMedium* kMedVacNF = matmgr.getTGeoMedium("A3PIPE_VACUUM_NF");
84+
const TGeoMedium* kMedVacHC = matmgr.getTGeoMedium("A3PIPE_VACUUM_HC");
85+
const TGeoMedium* kMedVacNFHC = matmgr.getTGeoMedium("A3PIPE_VACUUM_NFHC");
86+
87+
// Top volume
88+
TGeoVolume* top = gGeoManager->GetVolume("cave");
89+
TGeoVolume* barrel = gGeoManager->GetVolume("barrel");
90+
if (!barrel) {
91+
LOG(FATAL) << "Could not find the top volume";
92+
}
93+
94+
//---------------- Innermost Be pipe around the IP ----------
95+
TGeoTube* innerBeTube =
96+
new TGeoTube("INN_PIPEsh", mBeInnerPipeRmax - mBeInnerPipeThick, mBeInnerPipeRmax, mInnerIpHLength);
97+
TGeoVolume* innerBeTubeVolume = new TGeoVolume("INN_PIPE", innerBeTube, kMedBe);
98+
innerBeTubeVolume->SetLineColor(kRed);
99+
100+
TGeoTube* berylliumTubeVacuum =
101+
new TGeoTube("INN_PIPEVACUUMsh", 0., mBeInnerPipeRmax, mInnerIpHLength);
102+
TGeoVolume* innerBerylliumTubeVacuumVolume = new TGeoVolume("INN_PIPEMOTHER", berylliumTubeVacuum, kMedVac);
103+
innerBerylliumTubeVacuumVolume->AddNode(innerBeTubeVolume, 1, gGeoIdentity);
104+
innerBerylliumTubeVacuumVolume->SetVisibility(0);
105+
innerBerylliumTubeVacuumVolume->SetLineColor(kGreen);
106+
107+
barrel->AddNode(innerBerylliumTubeVacuumVolume, 1, gGeoIdentity);
108+
109+
//---------------- Outermost Be pipe around the IP ----------
110+
TGeoTube* outerBeTube =
111+
new TGeoTube("OUT_PIPEsh", mBeOuterPipeRmax - mBeOuterPipeThick, mBeOuterPipeRmax, mOuterIpHLength);
112+
TGeoVolume* outerBeTubeVolume = new TGeoVolume("OUT_PIPE", outerBeTube, kMedBe);
113+
outerBeTubeVolume->SetLineColor(kBlue);
114+
115+
TGeoTube* outerBerylliumTubeVacuum =
116+
new TGeoTube("OUT_PIPEVACUUMsh", 0., mBeOuterPipeRmax, mOuterIpHLength);
117+
TGeoVolume* outerBerylliumTubeVacuumVolume = new TGeoVolume("OUT_PIPEMOTHER", outerBerylliumTubeVacuum, kMedVac);
118+
outerBerylliumTubeVacuumVolume->AddNode(outerBeTubeVolume, 1, gGeoIdentity);
119+
outerBerylliumTubeVacuumVolume->SetVisibility(0);
120+
outerBerylliumTubeVacuumVolume->SetLineColor(kGreen);
121+
122+
barrel->AddNode(outerBerylliumTubeVacuumVolume, 1, gGeoIdentity);
123+
}
124+
125+
void A3Pipe::createMaterials()
126+
{
127+
//
128+
// Define materials for beam A3Pipe
129+
//
130+
Int_t isxfld = 2.;
131+
float sxmgmx = 10.;
132+
o2::base::Detector::initFieldTrackingParams(isxfld, sxmgmx);
133+
134+
//
135+
// Air
136+
//
137+
float aAir[4] = {12.0107, 14.0067, 15.9994, 39.948};
138+
float zAir[4] = {6., 7., 8., 18.};
139+
float wAir[4] = {0.000124, 0.755267, 0.231781, 0.012827};
140+
float dAir = 1.20479E-3;
141+
float dAir1 = 1.20479E-11;
142+
143+
// ****************
144+
// Defines tracking media parameters.
145+
//
146+
float epsil = .1; // Tracking precision,
147+
float stemax = -0.01; // Maximum displacement for multiple scat
148+
float tmaxfd = -20.; // Maximum angle due to field deflection
149+
float deemax = -.3; // Maximum fractional energy loss, DLS
150+
float stmin = -.8;
151+
// ***************
152+
153+
auto& matmgr = o2::base::MaterialManager::Instance();
154+
155+
// Beryllium
156+
matmgr.Material("A3PIPE", 5, "BERILLIUM$", 9.01, 4., 1.848, 35.3, 36.7);
157+
matmgr.Medium("A3PIPE", 5, "BE", 5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
158+
159+
// Vacuum
160+
matmgr.Mixture("A3PIPE", 16, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir);
161+
matmgr.Mixture("A3PIPE", 36, "VACUUM$_NF", aAir, zAir, dAir1, 4, wAir);
162+
matmgr.Mixture("A3PIPE", 56, "VACUUM$_HC ", aAir, zAir, dAir1, 4, wAir);
163+
matmgr.Mixture("A3PIPE", 76, "VACUUM$_NFHC", aAir, zAir, dAir1, 4, wAir);
164+
165+
matmgr.Medium("A3PIPE", 16, "VACUUM", 16, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
166+
matmgr.Medium("A3PIPE", 36, "VACUUM_NF", 36, 0, 0, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
167+
matmgr.Medium("A3PIPE", 56, "VACUUM_HC", 56, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
168+
matmgr.Medium("A3PIPE", 76, "VACUUM_NFHC", 76, 0, 0, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
169+
}
170+
171+
// ----------------------------------------------------------------------------
172+
FairModule* A3Pipe::CloneModule() const { return new A3Pipe(*this); }
173+
ClassImp(o2::passive::A3Pipe);

Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/Detector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Detector : public o2::base::DetImpl<Detector>
7979
kOBModel2 = 9
8080
};
8181

82-
static constexpr Int_t sNumberLayers = 10; ///< Number of layers in ITSU
82+
static constexpr Int_t sNumberLayers = 12; ///< Number of layers in ITSU
8383
static constexpr Int_t sNumberInnerLayers = 10; ///< Number of inner layers in ITSU
8484
static constexpr Int_t sNumberOfWrapperVolumes = 3; ///< Number of wrapper volumes
8585

0 commit comments

Comments
 (0)