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);
0 commit comments