Project
Loading...
Searching...
No Matches
SpaceFrame.cxx
Go to the documentation of this file.
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 <fairlogger/Logger.h>
13#include <TGeoCompositeShape.h>
14#include <TGeoCone.h>
15#include <TGeoManager.h>
16#include <TGeoMatrix.h>
17#include <TGeoMedium.h>
18#include <TGeoPcon.h>
19#include <TGeoTube.h>
20#include <TGeoVolume.h>
21#include <TVirtualMC.h>
22
24
25using namespace o2::emcal;
26
28{
29 LOG(debug) << "Create CalFrame Geometry" << std::endl;
30
31 /************ Definition of constants *****************************/
32
33 // space frame parameters from "SINGLE FRAME ASSEMBLY 27D624H.pdf"
34 // provided by Lawrence Berkeley Labs, USA
35 const int NUMCROSS = 12;
36 const int NUMSUBSETS = 3;
37 const double TOTALHALFWIDTH = 152.3; // Half Width of a Half Frame
38 // (CalFrame comes in 2 sections)
39 const double BEGINPHI = 76.8;
40 const double ENDPHI = 193.03;
41 const double BEGINRADIUS = 490.;
42
43 const double HALFFRAMETRANS = TOTALHALFWIDTH + 57.2 / 2.; // Half Frame Connector is 57.2cm wide,
44 // Supermodule is 340cm wide
45 // Sources: HALF-FRAME-CONNECTOR-27E226A.pdf
46 // provided by LBL
47
48 const double FLAGEWIDTH = 15.2;
49 const double RIBWIDTH = 1.5;
50 const double CROSSBOTTOMHEIGHT = 15.2;
51 const double CROSSBOTTOMRADTHICK = 1.5;
52 const double CROSSTOPHEIGHT = 1.5;
53 const double CROSSTOPRADTHICK = 35. / 2.;
54
55 //const double TOTALPHI = ENDPHI - BEGINPHI;
56 const double FLAGEHEIGHT = BEGINRADIUS + 3.;
57 const double RIBHEIGHT = FLAGEHEIGHT + 35;
58 const double CROSSBOTTOMWIDTH = 0.5 / (Double_t)NUMSUBSETS * (2. * TOTALHALFWIDTH - 8. * FLAGEWIDTH);
59 const double CROSSTOPWIDTH = CROSSBOTTOMWIDTH; // mCrossBottomWidth + mFlangeWidth - mRibWidth;
60 // for future release pending
61 // overlap correction - new TGeoVolume creation
62
63 const double CROSSBEAMARCLENGTH = (112.62597) / (NUMCROSS - 1) - .001; // To account for shape of TGeoBBox
64 const double CROSSBOTTOMSTARTRADIUS = BEGINRADIUS + CROSSBOTTOMRADTHICK;
65 const double CROSSTOPSTART =
66 BEGINRADIUS + 2. * CROSSBOTTOMRADTHICK + CROSSTOPRADTHICK + 0.015; // 0.015 is a
67 // bubblegum and duct tape
68 // fix for an overlap problem
69 // will be worked out in future releases
70 const double ENDRADIUS = RIBHEIGHT + 1.15;
71 const double ENDBEAMRADTHICK = CROSSBOTTOMRADTHICK + CROSSTOPRADTHICK;
72 const double ENDBEAMBEGINRADIUS = BEGINRADIUS + ENDBEAMRADTHICK;
73
74 /************ End efinition of constants **************************/
75
77 TGeoVolume* top = gGeoManager->GetVolume("barrel");
78 TGeoMedium* steel = gGeoManager->GetMedium("EMC_S steel$");
79 TGeoMedium* air = gGeoManager->GetMedium("EMC_Air$");
80
82 TGeoVolume* calFrameMO = gGeoManager->MakeTubs("CalFrame", air, BEGINRADIUS - 2.1, ENDRADIUS, TOTALHALFWIDTH * 3,
83 BEGINPHI - 3, ENDPHI + 3); // Mother Volume
84
85 calFrameMO->SetVisibility(kFALSE);
86
87 // Half Frame Mother Volume
88 TGeoVolume* calHalfFrameMO = gGeoManager->MakeTubs("HalfFrame", air, BEGINRADIUS - 2, ENDRADIUS, TOTALHALFWIDTH,
89 BEGINPHI - 2.9, ENDPHI + 2.9);
90
91 calHalfFrameMO->SetVisibility(kFALSE);
92
93 TGeoVolume* endBeams =
94 gGeoManager->MakeBox("End Beams", steel, ENDBEAMRADTHICK, CROSSTOPHEIGHT, TOTALHALFWIDTH); // End Beams
95
96 TGeoVolume* skin = gGeoManager->MakeTubs("skin", steel, RIBHEIGHT + 0.15, ENDRADIUS, TOTALHALFWIDTH, BEGINPHI,
97 ENDPHI); // back frame
98
99 TGeoVolume* flangeVolume = gGeoManager->MakeTubs("supportBottom", steel, BEGINRADIUS, FLAGEHEIGHT, FLAGEWIDTH,
100 BEGINPHI, ENDPHI); // FlangeVolume Beams
101
102 TGeoVolume* ribVolume =
103 gGeoManager->MakeTubs("RibVolume", steel, FLAGEHEIGHT, RIBHEIGHT, RIBWIDTH, BEGINPHI, ENDPHI);
104
105 TGeoVolume* subSetCross = gGeoManager->MakeTubs(
106 "subSetCross", air, BEGINRADIUS - 1, BEGINRADIUS + 2 * CROSSBOTTOMRADTHICK + 2 * CROSSTOPRADTHICK + 0.15,
107 CROSSBOTTOMWIDTH, BEGINPHI, ENDPHI); // Cross Beam Containers
108 subSetCross->SetVisibility(kFALSE);
109 /* // Obsolete for now
110 TGeoVolume *subSetCrossTop =
111 gGeoManager->MakeTubs("SubSetCrossTop", air, mBeginRadius+2*mCrossBottomRadThick-1,
112 mBeginRadius+2*mCrossBottomRadThick+ 2*mCrossTopRadThick+1, mCrossTopWidth, mBeginPhi, mEndPhi); // Cross
113 subSetCrossTop->SetVisibility(kFALSE);
114 */
115 TGeoVolume* crossBottomBeams = gGeoManager->MakeBox("crossBottom", steel, CROSSBOTTOMRADTHICK, CROSSBOTTOMHEIGHT,
116 CROSSBOTTOMWIDTH); // Cross Beams
117
118 TGeoVolume* crossTopBeams =
119 gGeoManager->MakeBox("crossTop", steel, CROSSTOPRADTHICK, CROSSTOPHEIGHT, CROSSTOPWIDTH); // Cross Beams
120
121 TGeoTranslation* trTEST = new TGeoTranslation();
122 TGeoRotation* rotTEST = new TGeoRotation();
123
124 Double_t conv = TMath::Pi() / 180.;
125 Double_t radAngle = 0;
126 Double_t endBeamParam = .4;
127 // cout<<"\nmCrossBottomStartRadius: "<<mCrossBottomStartRadius<<"\n";
128
129 for (Int_t i = 0; i < NUMCROSS; i++) {
130 Double_t loopPhi = BEGINPHI + 1.8;
131
132 // Cross Bottom Beams
133
134 radAngle = (loopPhi + i * CROSSBEAMARCLENGTH) * conv;
135
136 rotTEST->SetAngles(BEGINPHI + i * CROSSBEAMARCLENGTH, 0,
137 0); // SetTranslation(Double_t dx, Double_t dy, Double_t dz);
138 trTEST->SetTranslation(cos(radAngle) * CROSSBOTTOMSTARTRADIUS, sin(radAngle) * CROSSBOTTOMSTARTRADIUS, 0);
139
140 TGeoCombiTrans* combo = new TGeoCombiTrans(*trTEST, *rotTEST); // TGeoTranslation &tr, const TGeoRotation &rot);
141 combo->RegisterYourself();
142 crossBottomBeams->SetVisibility(1);
143 subSetCross->AddNode(crossBottomBeams, i + 1, combo);
144 if (i != 0 && i != NUMCROSS - 1) {
145 // Cross Bottom Beams
146 rotTEST->SetAngles(BEGINPHI + i * CROSSBEAMARCLENGTH, 0,
147 0); // SetTranslation(Double_t dx, Double_t dy, Double_t dz);
148 trTEST->SetTranslation(cos(radAngle) * CROSSTOPSTART, sin(radAngle) * CROSSTOPSTART, 0);
149 crossTopBeams->SetVisibility(1);
150 subSetCross->AddNode(crossTopBeams, i + 1, new TGeoCombiTrans(*trTEST, *rotTEST));
151 }
152
153 else if (i == 0) {
154 rotTEST->SetAngles(BEGINPHI + i * CROSSBEAMARCLENGTH, 0,
155 0); // SetTranslation(Double_t dx, Double_t dy, Double_t dz);
156 trTEST->SetTranslation(cos((77 - endBeamParam) * conv) * (ENDBEAMBEGINRADIUS),
157 sin((77 - endBeamParam) * conv) * (ENDBEAMBEGINRADIUS), 0);
158 endBeams->SetVisibility(1);
159 calHalfFrameMO->AddNode(endBeams, 1, new TGeoCombiTrans(*trTEST, *rotTEST));
160 } else {
161 rotTEST->SetAngles(193.03, 0, 0); // SetTranslation(Double_t dx, Double_t dy, Double_t dz);
162 trTEST->SetTranslation(cos((193.03 + endBeamParam) * conv) * (ENDBEAMBEGINRADIUS) /*more duct tape*/,
163 sin((193.03 + endBeamParam) * conv) * (ENDBEAMBEGINRADIUS), 0);
164 endBeams->SetVisibility(1);
165 calHalfFrameMO->AddNode(endBeams, 2, new TGeoCombiTrans(*trTEST, *rotTEST));
166 }
167 }
168
169 // Beam Containers
170
171 // Translations
172
173 TGeoTranslation* origin1 = new TGeoTranslation(0, 0, 0); // Equivalent to gGeoIdentity
174 TGeoTranslation* origin2 = new TGeoTranslation(0, 0, 2 * (CROSSBOTTOMWIDTH + FLAGEWIDTH));
175 TGeoTranslation* origin3 = new TGeoTranslation(0, 0, -2 * (CROSSBOTTOMWIDTH + FLAGEWIDTH));
176
177 // FlangeVolume translations
178 TGeoTranslation* str1 = new TGeoTranslation(0, 0, -3 * (CROSSBOTTOMWIDTH + FLAGEWIDTH));
179 TGeoTranslation* str2 = new TGeoTranslation(0, 0, -(CROSSBOTTOMWIDTH + FLAGEWIDTH));
180 TGeoTranslation* str3 = new TGeoTranslation(0, 0, (CROSSBOTTOMWIDTH + FLAGEWIDTH));
181 TGeoTranslation* str4 = new TGeoTranslation(0, 0, 3 * (CROSSBOTTOMWIDTH + FLAGEWIDTH));
182
183 // Half Frame Translations
184 TGeoTranslation* halfTrans1 = new TGeoTranslation(0, 0, HALFFRAMETRANS);
185 TGeoTranslation* halfTrans2 = new TGeoTranslation(0, 0, -HALFFRAMETRANS);
186
187 // Beams Volume
188 calHalfFrameMO->AddNode(flangeVolume, 1, str1);
189 calHalfFrameMO->AddNode(flangeVolume, 2, str2);
190 calHalfFrameMO->AddNode(flangeVolume, 3, str3);
191 calHalfFrameMO->AddNode(flangeVolume, 4, str4);
192
193 calHalfFrameMO->AddNode(ribVolume, 1, str1);
194 calHalfFrameMO->AddNode(ribVolume, 2, str2);
195 calHalfFrameMO->AddNode(ribVolume, 3, str3);
196 calHalfFrameMO->AddNode(ribVolume, 4, str4);
197
198 // Cross Beams
199 calHalfFrameMO->AddNode(subSetCross, 1, origin1);
200 calHalfFrameMO->AddNode(subSetCross, 2, origin2);
201 calHalfFrameMO->AddNode(subSetCross, 3, origin3);
202 /* // Obsolete for now
203 calHalfFrameMO->AddNode(subSetCrossTop, 1, origin1);
204 calHalfFrameMO->AddNode(subSetCrossTop, 2, origin2);
205 calHalfFrameMO->AddNode(subSetCrossTop, 3, origin3);
206 */
207
208 calHalfFrameMO->AddNode(skin, 1, gGeoIdentity);
209
210 calFrameMO->AddNode(calHalfFrameMO, 1, halfTrans1);
211 calFrameMO->AddNode(calHalfFrameMO, 2, halfTrans2);
212
213 top->AddNode(calFrameMO, 1, new TGeoTranslation(0., 30., 0.));
214 LOG(debug) << "**********************************\nmEndRadius:\t" << ENDRADIUS << std::endl;
215}
int32_t i
std::ostringstream debug
void CreateGeometry()
Assembles the Geometries and places them into the Alice master volume.
GLdouble GLdouble GLdouble GLdouble top
Definition glcorearb.h:4077
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"