Project
Loading...
Searching...
No Matches
V3Cage.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
15
19
20#include <fairlogger/Logger.h> // for LOG
21
22#include <TGeoArb8.h> // for TGeoArb8
23#include <TGeoBBox.h> // for TGeoBBox
24#include <TGeoCone.h> // for TGeoConeSeg, TGeoCone
25#include <TGeoPcon.h> // for TGeoPcon
26#include <TGeoManager.h> // for TGeoManager, gGeoManager
27#include <TGeoMatrix.h> // for TGeoCombiTrans, TGeoRotation, etc
28// #include <TGeoTrd1.h> // for TGeoTrd1
29#include <TGeoTube.h> // for TGeoTube, TGeoTubeSeg
30#include <TGeoVolume.h> // for TGeoVolume, TGeoVolumeAssembly
31#include <TGeoXtru.h> // for TGeoXtru
32#include <TGeoCompositeShape.h> // for TGeoCompositeShape
33#include <TMathBase.h> // for Abs
34#include <TMath.h> // for Sin, RadToDeg, DegToRad, Cos, Tan, etc
35
36#include <cstdio> // for snprintf
37
38class TGeoMedium;
39
40using namespace TMath;
41using namespace o2::its;
42
43// Parameters
44const Double_t V3Cage::sCageYInBarrel = 30. * sCm; // This is hardcoded in Detector.cxx
45
46// Cover element (each)
47const Double_t V3Cage::sCageCoverZLength = 586.0 * sMm;
48const Double_t V3Cage::sCageCoverRint = 540.0 * sMm;
49const Double_t V3Cage::sCageCoverRext = 550.0 * sMm;
50const Double_t V3Cage::sCageCoverXWidth = 982.0 * sMm;
51const Double_t V3Cage::sCageCoverXBaseInt = 944.0 * sMm;
52const Double_t V3Cage::sCageCoverXBaseExt = 948.0 * sMm;
53const Double_t V3Cage::sCageCoverYBaseHeight = 245.0 * sMm;
54const Double_t V3Cage::sCageCoverCoreRint = 541.0 * sMm;
55const Double_t V3Cage::sCageCoverCoreRext = 549.0 * sMm;
56const Double_t V3Cage::sCageCoverSheetThick = 2 * sMm;
57const Double_t V3Cage::sCageCoverRibZLength = 25.0 * sMm;
58const Double_t V3Cage::sCageCoverRibRint = 540.0 * sMm;
59const Double_t V3Cage::sCageCoverRibRext = 548.0 * sMm;
60const Double_t V3Cage::sCageCoverRibXWidth = 984.8 * sMm;
61const Double_t V3Cage::sCageCoverRibXBaseInt = 944.0 * sMm;
62const Double_t V3Cage::sCageCoverRibYBaseHi = 245.0 * sMm;
63const Double_t V3Cage::sCageCoverRibFoldHi = 31.5 * sMm;
64
65const Double_t V3Cage::sCageSidePanelLength = 3457.0 * sMm;
66const Double_t V3Cage::sCageSidePanelWidth = 490.0 * sMm;
67const Double_t V3Cage::sCageSidePanelFoilThick = 1.0 * sMm;
68const Double_t V3Cage::sCageSidePanelCoreThick = 20.0 * sMm;
69const Double_t V3Cage::sCageSidePanelXDist = 988.0 * sMm;
70const Double_t V3Cage::sCageSidePanelRail1Len = 3320.0 * sMm;
71const Double_t V3Cage::sCageSidePanelRail2Len = 1550.0 * sMm;
72const Double_t V3Cage::sCageSidePanelRail3Len = 302.0 * sMm;
73const Double_t V3Cage::sCageSidePanelRailWidth = 25.0 * sMm;
74const Double_t V3Cage::sCageSidePanelRailSpan = 20.0 * sMm;
75const Double_t V3Cage::sCageSidePanelRailHThik = 5.0 * sMm;
76const Double_t V3Cage::sCageSidePanelRailVThik = 2.5 * sMm;
77const Double_t V3Cage::sCageSidePanelGuideLen = 3587.0 * sMm;
78const Double_t V3Cage::sCageSidePanelGuideInHi = 204.0 * sMm;
79const Double_t V3Cage::sCageSidePanelGuideWide = 44.0 * sMm;
80const Double_t V3Cage::sCageSidePanelGuidThik1 = 6.0 * sMm;
81const Double_t V3Cage::sCageSidePanelGuidThik2 = 8.0 * sMm;
82const Double_t V3Cage::sCageSidePanelMidBarWid = 15.0 * sMm;
83const Double_t V3Cage::sCageSidePanelSidBarWid = 15.0 * sMm;
84
85const Double_t V3Cage::sCageSidePanelRail1Ypos[2] = {226.5 * sMm, 147.5 * sMm};
86const Double_t V3Cage::sCageSidePanelRail2Ypos = 74.5 * sMm;
87const Double_t V3Cage::sCageSidePanelRail3Ypos[3] = {180.0 * sMm, 107.0 * sMm, 24.0 * sMm};
88
89const Double_t V3Cage::sCageEndCapDext = 1096.0 * sMm;
90const Double_t V3Cage::sCageEndCapDint = 304.0 * sMm;
91const Double_t V3Cage::sCageEndCapFoamThick = 8.0 * sMm;
92const Double_t V3Cage::sCageEndCapFabThick = 1.0 * sMm;
93const Double_t V3Cage::sCageEndCapXWidth = 988.0 * sMm;
94const Double_t V3Cage::sCageEndCapSideHoleR = 32.0 * sMm;
95const Double_t V3Cage::sCageEndCapSideHoleX = 532.0 * sMm;
96const Double_t V3Cage::sCageEndCapCableCutWid = 268.0 * sMm;
97const Double_t V3Cage::sCageEndCapCableCutR = 408.5 * sMm;
98const Double_t V3Cage::sCageEndCapCableCutPhi = 25.0; // Deg
99const Double_t V3Cage::sCageECRoundCrossDmin = 300 * sMm;
100const Double_t V3Cage::sCageECRoundCrossDmid = 303 * sMm;
101const Double_t V3Cage::sCageECRoundCrossDmax = 312 * sMm;
102const Double_t V3Cage::sCageECRoundCrossZext = 6 * sMm;
103const Double_t V3Cage::sCageECRoundCrossZint = 5 * sMm;
104const Double_t V3Cage::sCageECCableCrosTotHi = 139.0 * sMm;
105const Double_t V3Cage::sCageECCableCrosTotZ = 12 * sMm;
106const Double_t V3Cage::sCageECCableCrosInXWid = 266.8 * sMm;
107const Double_t V3Cage::sCageECCableCrosInThik = 4 * sMm;
108const Double_t V3Cage::sCageECCableCrosInZLen = 10.2 * sMm;
109const Double_t V3Cage::sCageECCableCrosSidWid = 8 * sMm;
110
111const Double_t V3Cage::sBPSuppCollarIntD = 53 * sMm;
112const Double_t V3Cage::sBPSuppCollarExtD = 57 * sMm;
113const Double_t V3Cage::sBPSuppCollarBushD = 52 * sMm;
114const Double_t V3Cage::sBPSuppUpperCollarLen = 78 * sMm;
115const Double_t V3Cage::sBPSuppUpperCollarHei = 4 * sMm;
116const Double_t V3Cage::sBPSuppLowerCollarLen = 151 * sMm;
117const Double_t V3Cage::sBPSuppLowerCollarTlX = 40.5 * sMm;
118const Double_t V3Cage::sBPSuppLowCollHolDist = 100 * sMm;
119const Double_t V3Cage::sBPSuppLowCollTailHei = 6 * sMm;
120const Double_t V3Cage::sBPSuppCollarBeamLen = 370 * sMm;
121const Double_t V3Cage::sBPSuppCollarBeamWid = 40 * sMm;
122const Double_t V3Cage::sBPSuppCollarBeamHei = 12 * sMm;
123const Double_t V3Cage::sBPSuppBracketTotLen = 57 * sMm;
124const Double_t V3Cage::sBPSuppBracketWidth = 25 * sMm;
125const Double_t V3Cage::sBPSuppBracketInLen = 20 * sMm;
126const Double_t V3Cage::sBPSuppBracketInHei = 8 * sMm;
127const Double_t V3Cage::sBPSuppBracketTailLen = 18.5 * sMm;
128const Double_t V3Cage::sBPSuppBracketTailHei = 3 * sMm;
129const Double_t V3Cage::sBPSuppBrktCentHoleX = 31.5 * sMm;
130const Double_t V3Cage::sBPSuppBrktCentHoleD = 6 * sMm;
131const Double_t V3Cage::sBPSuppBrktLatHoleX = 24.5 * sMm;
132const Double_t V3Cage::sBPSuppBrktLatHoleD = 3.2 * sMm;
133const Double_t V3Cage::sBPSuppBrktLatHoleW = 4 * sMm;
134const Double_t V3Cage::sBPSuppBrktLatHoleH = 2.5 * sMm;
135const Double_t V3Cage::sBPSuppBrktHolesY = 0.5 * sMm;
136const Double_t V3Cage::sBPSuppCollarM4High = 2.2 * sMm;
137const Double_t V3Cage::sBPSuppCollarM4Diam = 7.5 * sMm;
138const Double_t V3Cage::sBPSuppCollarM4XDist = 68 * sMm;
139const Double_t V3Cage::sBPSuppCollarM4ZPos = 7 * sMm;
140const Double_t V3Cage::sBPSuppClampTotLen = 55 * sMm;
141const Double_t V3Cage::sBPSuppClampTotWid = 23 * sMm;
142const Double_t V3Cage::sBPSuppClampTotHei = 13 * sMm;
143const Double_t V3Cage::sBPSuppClampLatThick = 5 * sMm;
144const Double_t V3Cage::sBPSuppClampShelfLen = 25 * sMm;
145const Double_t V3Cage::sBPSuppClampShelfHei = 4.5 * sMm;
146const Double_t V3Cage::sBPSuppClampsXDist = 944 * sMm;
147const Double_t V3Cage::sBPSuppClampInsDmin = 7 * sMm;
148const Double_t V3Cage::sBPSuppClampInsDmax = 11 * sMm;
149const Double_t V3Cage::sBPSuppClampInsH = 2.9 * sMm;
150const Double_t V3Cage::sBPSuppClampInsXPos = 15 * sMm;
151const Double_t V3Cage::sBPSuppClampInsZPos = 7 * sMm;
152const Double_t V3Cage::sBPSuppClampShimLen = 26 * sMm;
153const Double_t V3Cage::sBPSuppClampShimWid = 15 * sMm;
154const Double_t V3Cage::sBPSuppClampShimThick = 2.5 * sMm;
155const Double_t V3Cage::sBPSuppClampM5High = 2.7 * sMm;
156const Double_t V3Cage::sBPSuppClampM5Diam = 8.5 * sMm;
157const Double_t V3Cage::sBPSuppClampM5ZPos = 20 * sMm;
158const Double_t V3Cage::sBPSuppZPos = 1801 * sMm;
159
160const Double_t V3Cage::sCageCrossXWidthTot = 973 * sMm;
161const Double_t V3Cage::sCageCrossXWidthExt = 944 * sMm;
162const Double_t V3Cage::sCageCrossXWidthInt = 904 * sMm;
163const Double_t V3Cage::sCageCrossYHeightTot = 244 * sMm;
164const Double_t V3Cage::sCageCrossYHeightInt = 220 * sMm;
165const Double_t V3Cage::sCageCrossYMid = (126 + 5.5) * sMm;
166const Double_t V3Cage::sCageCrossZLength = 8 * sMm;
167const Double_t V3Cage::sCageCrossBarThick = 20 * sMm;
168const Double_t V3Cage::sCageCrossBarPhi = 25; // Deg
169
170const Double_t V3Cage::sCageMFTRailZLen = 1807 * sMm;
171const Double_t V3Cage::sCageMFTRailTotWidth = 27 * sMm;
172const Double_t V3Cage::sCageMFTRailExtWidth = 24 * sMm;
173const Double_t V3Cage::sCageMFTRailIntWidth = 17.5 * sMm;
174const Double_t V3Cage::sCageMFTRailBaseWidth = 22 * sMm;
175const Double_t V3Cage::sCageMFTRailTotHeight = 8.9 * sMm;
176const Double_t V3Cage::sCageMFTRailExtHeight = 5.9 * sMm;
177const Double_t V3Cage::sCageMFTRailIntHeight = 3.5 * sMm;
178const Double_t V3Cage::sCageMFTRailsXDist = 44 * sMm;
179
181
183 : V11Geometry()
184{
185}
186
188 : V11Geometry(0, name)
189{
190}
191
192V3Cage::~V3Cage() = default;
193
194void V3Cage::createAndPlaceCage(TGeoVolume* mother, const TGeoManager* mgr)
195{
196 //
197 // Creates the Cage elements and place them into the mother volume
198 //
199 // Input:
200 // mother : the mother volume hosting the whole Cage
201 // mgr : the GeoManager (used only to get the proper material)
202 //
203 // Output:
204 //
205 // Return:
206 //
207 // Created: 22 Apr 2022 Mario Sitta
208 //
209
210 // Local variables
211 Double_t zunit, xpos, ypos, zpos;
212
213 // Create the cover elements
214 TGeoVolume* cageCover = createCageCover(mgr);
215 TGeoVolume* cageCoverRib = createCageCoverRib(mgr);
216 TGeoVolume* cageEndCap = createCageEndCap(mgr);
217 TGeoVolume* cageSidePanel = createCageSidePanel(mgr);
218 TGeoVolume* cageBPSupport = createBeamPipeSupport(mgr);
219 TGeoVolume* cageClosingCross = createCageClosingCross(mgr);
220
221 // Now place all elements
222 mother->AddNode(cageCover, 1, new TGeoTranslation(0, sCageYInBarrel, 0));
223 mother->AddNode(cageCover, 2, new TGeoCombiTrans(0, sCageYInBarrel, 0, new TGeoRotation("", 180, 0, 0)));
224
225 zunit = (sCageCoverZLength + sCageCoverRibZLength) / 2.;
226
227 zpos = zunit;
228 mother->AddNode(cageCoverRib, 1, new TGeoTranslation(0, sCageYInBarrel, zpos));
229 mother->AddNode(cageCoverRib, 2, new TGeoCombiTrans(0, sCageYInBarrel, zpos, new TGeoRotation("", 180, 0, 0)));
230 mother->AddNode(cageCoverRib, 3, new TGeoTranslation(0, sCageYInBarrel, -zpos));
231 mother->AddNode(cageCoverRib, 4, new TGeoCombiTrans(0, sCageYInBarrel, -zpos, new TGeoRotation("", 180, 0, 0)));
232
233 zpos = 2 * zunit;
234 mother->AddNode(cageCover, 3, new TGeoTranslation(0, sCageYInBarrel, zpos));
235 mother->AddNode(cageCover, 4, new TGeoCombiTrans(0, sCageYInBarrel, zpos, new TGeoRotation("", 180, 0, 0)));
236 mother->AddNode(cageCover, 5, new TGeoTranslation(0, sCageYInBarrel, -zpos));
237 mother->AddNode(cageCover, 6, new TGeoCombiTrans(0, sCageYInBarrel, -zpos, new TGeoRotation("", 180, 0, 0)));
238
239 zpos += sCageCoverZLength / 2;
240
241 Double_t zposSP = -zpos + sCageSidePanelLength / 2;
242 xpos = sCageSidePanelXDist / 2 - sCageSidePanelCoreThick / 2 - sCageSidePanelFoilThick;
243 mother->AddNode(cageSidePanel, 1, new TGeoTranslation(xpos, sCageYInBarrel, zposSP));
244 mother->AddNode(cageSidePanel, 2, new TGeoCombiTrans(-xpos, sCageYInBarrel, zposSP, new TGeoRotation("", 180, 0, 0)));
245
246 Double_t zposCC = -zpos + sCageSidePanelLength + sCageCrossZLength / 2;
247 mother->AddNode(cageClosingCross, 1, new TGeoTranslation(0, sCageYInBarrel, zposCC));
248 mother->AddNode(cageClosingCross, 2, new TGeoCombiTrans(0, sCageYInBarrel, zposCC, new TGeoRotation("", 0, 180, 0)));
249
250 // The end cap is only on C side
251 zpos += sCageECCableCrosTotZ / 2;
252 mother->AddNode(cageEndCap, 1, new TGeoTranslation(0, sCageYInBarrel, -zpos));
253
254 // Third ribs are only on A side
255 zpos = 3 * zunit;
256 mother->AddNode(cageCoverRib, 5, new TGeoTranslation(0, sCageYInBarrel, zpos));
257 mother->AddNode(cageCoverRib, 6, new TGeoCombiTrans(0, sCageYInBarrel, zpos, new TGeoRotation("", 180, 0, 0)));
258
259 // The Beam Pipe Support on A side
260 ypos = sCageYInBarrel - sBPSuppLowCollTailHei / 2;
261 zpos = sBPSuppZPos + sBPSuppCollarBeamWid / 2;
262 mother->AddNode(cageBPSupport, 1, new TGeoTranslation(0, ypos, zpos));
263
264 // The MFT Rails inside the Cage
265 createAndPlaceMFTRailsInsideCage(mother, mgr);
266
267 return;
268}
269
270TGeoVolume* V3Cage::createCageCover(const TGeoManager* mgr)
271{
272 //
273 // Creates a Cage cover element (from drawings ALIITSUP0226, ALIITSUP0225)
274 //
275 // Input:
276 // mgr : the GeoManager (used only to get the proper material)
277 //
278 // Output:
279 //
280 // Return:
281 // The cover as a TGeoVolume
282 //
283 // Created: 22 Apr 2022 Mario Sitta
284 //
285
286 // Local variables
287 static const Int_t coverFoldNVert = 6;
288
289 Double_t xvert[coverFoldNVert], yvert[coverFoldNVert];
290 Double_t halfBase, zlen, alpha;
291
292 zlen = 0.5 * sCageCoverZLength;
293
294 // The cover core: a TGeoTubeSeg
295 halfBase = 0.5 * sCageCoverXBaseInt - sCageCoverSheetThick;
296 alpha = TMath::ACos(halfBase / sCageCoverCoreRext) * TMath::RadToDeg();
297 TGeoTubeSeg* coreSh = new TGeoTubeSeg("coverCore", sCageCoverCoreRint, sCageCoverCoreRext, zlen, alpha, 180. - alpha);
298
299 // The upper and lower sheets: a TGeoTubeSeg
300 // (as a whole volume - will become a sheet when the core is inserted inside)
301 halfBase = 0.5 * sCageCoverXBaseInt;
302 alpha = TMath::ACos(halfBase / sCageCoverRint) * TMath::RadToDeg();
303 TGeoTubeSeg* sheet = new TGeoTubeSeg("coverSheet", sCageCoverRint, sCageCoverCoreRext, zlen, alpha, 180. - alpha);
304
305 // The lateral fold: a Xtru
306 xvert[0] = sCageCoverXBaseExt / 2.;
307 yvert[0] = sCageCoverYBaseHeight + sCageCoverSheetThick;
308 xvert[1] = sCageCoverXWidth / 2.;
309 yvert[1] = yvert[0];
310 xvert[2] = xvert[1];
311 yvert[2] = sCageCoverYBaseHeight;
312 xvert[3] = sCageCoverXBaseInt / 2.;
313 yvert[3] = yvert[2];
314 xvert[4] = xvert[3];
315 yvert[4] = TMath::Sqrt(sCageCoverRint * sCageCoverRint - sCageCoverXBaseInt * sCageCoverXBaseInt / 4) + sCageCoverSheetThick;
316 xvert[5] = xvert[0];
317 yvert[5] = yvert[4];
318
319 TGeoXtru* fold = new TGeoXtru(2);
320 fold->SetName("coverFold");
321 fold->DefinePolygon(coverFoldNVert, xvert, yvert);
322 fold->DefineSection(0, -zlen);
323 fold->DefineSection(1, zlen);
324
325 // A BBox to cut away the curved portion above the fold
326 TGeoBBox* cutfold = new TGeoBBox("cutFold", xvert[1] - xvert[0], yvert[5] - yvert[1], 1.05 * zlen);
327
328 // Some matrices to create the composite shape
329 TGeoRotation* rotfold = new TGeoRotation("rotFold", 180, 180, 0);
330 rotfold->RegisterYourself();
331
332 TGeoTranslation* cutbox1 = new TGeoTranslation("cutBox1", xvert[1], yvert[5], 0);
333 cutbox1->RegisterYourself();
334
335 TGeoTranslation* cutbox2 = new TGeoTranslation("cutBox2", -xvert[1], yvert[5], 0);
336 cutbox2->RegisterYourself();
337
338 // The cover shape: a CompositeShape
339 TGeoCompositeShape* coverSh = new TGeoCompositeShape("coverSheet-cutFold:cutBox1-cutFold:cutBox2+coverFold+coverFold:rotFold");
340
341 // We have all shapes: now create the real volumes
342 TGeoMedium* medRohacell = mgr->GetMedium(Form("%s_ROHACELL$", GetDetName()));
343 TGeoMedium* medPrepreg = mgr->GetMedium(Form("%s_M46J6K$", GetDetName()));
344
345 TGeoVolume* coverVol = new TGeoVolume("CageCover", coverSh, medPrepreg);
346 coverVol->SetFillColor(kBlue);
347 coverVol->SetLineColor(kBlue);
348
349 TGeoVolume* coverCoreVol = new TGeoVolume("CageCoverCore", coreSh, medRohacell);
350 coverCoreVol->SetFillColor(kYellow);
351 coverCoreVol->SetLineColor(kYellow);
352
353 coverVol->AddNode(coverCoreVol, 1, nullptr);
354
355 // Finally return the cover volume
356 return coverVol;
357}
358
359TGeoVolume* V3Cage::createCageCoverRib(const TGeoManager* mgr)
360{
361 //
362 // Creates a Cage cover rib element (from drawing ALIITSUP0228)
363 //
364 // Input:
365 // mgr : the GeoManager (used only to get the proper material)
366 //
367 // Output:
368 //
369 // Return:
370 // The cover rib as a TGeoVolume
371 //
372 // Created: 22 Apr 2022 Mario Sitta
373 //
374
375 // Local variables
376 static const Int_t ribFoldNVert = 3;
377
378 Double_t xvert[ribFoldNVert], yvert[ribFoldNVert];
379 Double_t halfBase, zlen, alpha;
380
381 zlen = 0.5 * sCageCoverRibZLength;
382
383 // The rib main segment: a TGeoTubeSeg
384 halfBase = 0.5 * sCageCoverRibXBaseInt;
385 alpha = TMath::ACos(halfBase / sCageCoverRibRint) * TMath::RadToDeg();
386 TGeoTubeSeg* mainSh = new TGeoTubeSeg("coverRibMain", sCageCoverRibRint, sCageCoverRibRext, zlen, alpha, 180. - alpha);
387
388 // The lateral fold: a Xtru
389 xvert[0] = sCageCoverRibXWidth / 2.;
390 yvert[0] = sCageCoverRibYBaseHi;
391 xvert[1] = sCageCoverRibXBaseInt / 2.;
392 yvert[1] = yvert[0];
393 xvert[2] = xvert[1];
394 yvert[2] = yvert[1] + sCageCoverRibFoldHi;
395
396 TGeoXtru* fold = new TGeoXtru(2);
397 fold->SetName("coverRibFold");
398 fold->DefinePolygon(ribFoldNVert, xvert, yvert);
399 fold->DefineSection(0, -zlen);
400 fold->DefineSection(1, zlen);
401
402 // Some matrices to create the composite shape
403 TGeoRotation* rotfold = new TGeoRotation("rotRibFold", 180, 180, 0);
404 rotfold->RegisterYourself();
405
406 // The cover rib shape: a CompositeShape
407 TGeoCompositeShape* ribSh = new TGeoCompositeShape("coverRibMain+coverRibFold+coverRibFold:rotRibFold");
408
409 // We have all shapes: now create the real volume
410 TGeoMedium* medAl = mgr->GetMedium(Form("%s_ALUMINUM$", GetDetName()));
411
412 TGeoVolume* ribVol = new TGeoVolume("CageCoverRib", ribSh, medAl);
413 ribVol->SetFillColor(kGray);
414 ribVol->SetLineColor(kGray);
415
416 // Finally return the cover rib volume
417 return ribVol;
418}
419
420TGeoVolume* V3Cage::createCageSidePanel(const TGeoManager* mgr)
421{
422 //
423 // Creates the Cage Side Panel (from drawings ALIITSUP0247, ALIITSUP0248,
424 // ALIITSUP0243, ALIITSUP0244, ALIITSUP0280, ALIITSUP0245)
425 //
426 // Input:
427 // mgr : the GeoManager (used only to get the proper material)
428 //
429 // Output:
430 //
431 // Return:
432 // The side panel as a TGeoVolumeAssembly
433 //
434 // Created: 30 Sep 2022 Mario Sitta
435 // Updated: 20 May 2023 Mario Sitta Mid and side bars added
436 //
437
438 // Local variables
439 Double_t xlen, ylen, zlen;
440 Double_t xpos, ypos, zpos;
441
442 // The TGeoVolumeAssembly holding all elements
443 TGeoVolumeAssembly* sidePanelVol = new TGeoVolumeAssembly("CageSidePanel");
444
445 // The inner foil: a TGeoCompositeShape
446 TGeoCompositeShape* inFoilSh = createCageSidePanelCoreFoil(sCageSidePanelFoilThick, "foil");
447
448 // The outer foil: a BBox (each)
449 xlen = sCageSidePanelFoilThick / 2;
450 ylen = sCageSidePanelWidth / 2;
451 zlen = sCageSidePanelLength / 2;
452 TGeoBBox* outFoilSh = new TGeoBBox(xlen, ylen, zlen);
453
454 // The intermediate core layer: a TGeoCompositeShape
455 TGeoCompositeShape* coreSh = createCageSidePanelCoreFoil(sCageSidePanelCoreThick, "core");
456
457 // The longest rails
458 TGeoCompositeShape* rail1Sh = createCageSidePanelRail(sCageSidePanelRail1Len, 1);
459
460 // The intermediate rails
461 TGeoCompositeShape* rail2Sh = createCageSidePanelRail(sCageSidePanelRail2Len, 2);
462
463 // The shortest rails
464 TGeoCompositeShape* rail3Sh = createCageSidePanelRail(sCageSidePanelRail3Len, 3);
465
466 // The middle bar: a BBox
467 xlen = sCageSidePanelCoreThick / 2;
468 ylen = sCageSidePanelMidBarWid / 2;
469 zlen = (sCageSidePanelLength - sCageSidePanelRail3Len - sCageSidePanelSidBarWid) / 2;
470 TGeoBBox* midBarSh = new TGeoBBox(xlen, ylen, zlen);
471
472 // The side bar: a BBox
473 xlen = sCageSidePanelCoreThick / 2;
474 ylen = sCageSidePanelWidth / 2;
475 zlen = sCageSidePanelSidBarWid / 2;
476 TGeoBBox* sidBarSh = new TGeoBBox(xlen, ylen, zlen);
477
478 // The elements of the guide:
479 // - the vertical part: a BBox
480 xlen = sCageSidePanelGuidThik2 / 2;
481 ylen = sCageSidePanelGuideInHi / 2;
482 zlen = sCageSidePanelGuideLen / 2;
483 TGeoBBox* guideVert = new TGeoBBox(xlen, ylen, zlen);
484 guideVert->SetName("guidevert");
485
486 // - the horizontal part: a BBox
487 xlen = sCageSidePanelGuideWide / 2;
488 ylen = sCageSidePanelGuidThik1 / 2;
489 TGeoBBox* guideHor = new TGeoBBox(xlen, ylen, zlen);
490 guideHor->SetName("guidehor");
491
492 xpos = (sCageSidePanelGuideWide - sCageSidePanelGuidThik2) / 2;
493 ypos = (sCageSidePanelGuidThik1 + sCageSidePanelGuideInHi) / 2;
494 TGeoTranslation* guideHorMat1 = new TGeoTranslation(xpos, ypos, 0);
495 guideHorMat1->SetName("guidehormat1");
496 guideHorMat1->RegisterYourself();
497
498 TGeoTranslation* guideHorMat2 = new TGeoTranslation(xpos, -ypos, 0);
499 guideHorMat2->SetName("guidehormat2");
500 guideHorMat2->RegisterYourself();
501
502 // The actual guide: a CompositeShape
503 TGeoCompositeShape* guideSh = new TGeoCompositeShape("guidevert+guidehor:guidehormat1+guidehor:guidehormat2");
504
505 // We have all shapes: now create the real volume
506 TGeoMedium* medFabric = mgr->GetMedium(Form("%s_M46J6K$", GetDetName()));
507 TGeoMedium* medFoam = mgr->GetMedium(Form("%s_ROHACELL$", GetDetName()));
508 TGeoMedium* medAlAlloy = mgr->GetMedium(Form("%s_ENAW7075$", GetDetName()));
509
510 TGeoVolume* inFoilVol = new TGeoVolume("CageSidePanelInFoil", inFoilSh, medFabric);
511 inFoilVol->SetFillColor(kBlue);
512 inFoilVol->SetLineColor(kBlue);
513
514 TGeoVolume* outFoilVol = new TGeoVolume("CageSidePanelOutFoil", outFoilSh, medFabric);
515 outFoilVol->SetFillColor(kBlue);
516 outFoilVol->SetLineColor(kBlue);
517
518 TGeoVolume* coreVol = new TGeoVolume("CageSidePanelCore", coreSh, medFoam);
519 coreVol->SetFillColor(kYellow);
520 coreVol->SetLineColor(kYellow);
521
522 TGeoVolume* rail1Vol = new TGeoVolume("CageSidePanelRail1st", rail1Sh, medAlAlloy);
523 rail1Vol->SetFillColor(kGray);
524 rail1Vol->SetLineColor(kGray);
525
526 TGeoVolume* rail2Vol = new TGeoVolume("CageSidePanelRail2nd", rail2Sh, medAlAlloy);
527 rail2Vol->SetFillColor(kGray);
528 rail2Vol->SetLineColor(kGray);
529
530 TGeoVolume* rail3Vol = new TGeoVolume("CageSidePanelRail3rd", rail3Sh, medAlAlloy);
531 rail3Vol->SetFillColor(kGray);
532 rail3Vol->SetLineColor(kGray);
533
534 TGeoVolume* midBarVol = new TGeoVolume("CageSidePanelMiddleBar", midBarSh, medAlAlloy);
535 midBarVol->SetFillColor(kGray);
536 midBarVol->SetLineColor(kGray);
537
538 TGeoVolume* sidBarVol = new TGeoVolume("CageSidePanelSideBar", sidBarSh, medAlAlloy);
539 sidBarVol->SetFillColor(kGray);
540 sidBarVol->SetLineColor(kGray);
541
542 TGeoVolume* guideVol = new TGeoVolume("CageSidePanelGuide", guideSh, medFabric);
543 guideVol->SetFillColor(kViolet);
544 guideVol->SetLineColor(kViolet);
545
546 // Then build up the panel
547 sidePanelVol->AddNode(coreVol, 1, nullptr);
548
549 xpos = (sCageSidePanelCoreThick + sCageSidePanelFoilThick) / 2;
550 sidePanelVol->AddNode(inFoilVol, 1, new TGeoTranslation(-xpos, 0, 0));
551 sidePanelVol->AddNode(outFoilVol, 1, new TGeoTranslation(xpos, 0, 0));
552
553 xpos = (sCageSidePanelCoreThick - sCageSidePanelRailVThik) / 2;
554 zpos = (sCageSidePanelLength - sCageSidePanelRail1Len) / 2;
555 for (Int_t j = 0; j < 2; j++) {
556 ypos = sCageSidePanelRail1Ypos[j];
557 sidePanelVol->AddNode(rail1Vol, j + 1, new TGeoTranslation(xpos, ypos, zpos));
558 sidePanelVol->AddNode(rail1Vol, j + 3, new TGeoTranslation(xpos, -ypos, zpos));
559 }
560
561 zpos = (sCageSidePanelLength - sCageSidePanelRail2Len) / 2;
562 ypos = sCageSidePanelRail2Ypos;
563 sidePanelVol->AddNode(rail2Vol, 1, new TGeoTranslation(xpos, ypos, zpos));
564 sidePanelVol->AddNode(rail2Vol, 2, new TGeoTranslation(xpos, -ypos, zpos));
565
566 zpos = (sCageSidePanelLength - sCageSidePanelRail3Len) / 2;
567 for (Int_t j = 0; j < 3; j++) {
568 ypos = sCageSidePanelRail3Ypos[j];
569 sidePanelVol->AddNode(rail3Vol, j + 1, new TGeoTranslation(xpos, ypos, zpos));
570 sidePanelVol->AddNode(rail3Vol, j + 4, new TGeoTranslation(xpos, -ypos, zpos));
571 }
572
573 zpos = sCageSidePanelLength / 2 - midBarSh->GetDZ() - sCageSidePanelSidBarWid;
574 sidePanelVol->AddNode(midBarVol, 1, new TGeoTranslation(0, 0, -zpos));
575
576 zpos = sCageSidePanelLength / 2 - sidBarSh->GetDZ();
577 sidePanelVol->AddNode(sidBarVol, 1, new TGeoTranslation(0, 0, -zpos));
578
579 xpos = sCageSidePanelCoreThick / 2 + sCageSidePanelFoilThick + sCageSidePanelGuidThik2 / 2;
580 zpos = (sCageSidePanelLength - sCageSidePanelGuideLen) / 2;
581 sidePanelVol->AddNode(guideVol, 1, new TGeoTranslation(xpos, 0, -zpos));
582
583 // Finally return the side panel volume
584 return sidePanelVol;
585}
586
587TGeoCompositeShape* V3Cage::createCageSidePanelCoreFoil(const Double_t xthick, const char* shpref)
588{
589 //
590 // Creates the shape of the core and the internal foil of the
591 // Cage Side Panel, which contain proper cuts to host the rails
592 //
593 // Input:
594 // xthick : the shape thickness along X
595 // shpref : prefix of the shape name
596 //
597 // Output:
598 //
599 // Return:
600 // The side panel core or foil as a TGeoCompositeShape
601 //
602 // Created: 07 Oct 2022 Mario Sitta
603 // Updated: 20 May 2023 Mario Sitta Mid and side bars added
604 //
605
606 // Local variables
607 Double_t xlen, ylen, zlen;
608 Double_t ypos, zpos;
609
610 // The main body: a BBox
611 xlen = xthick / 2;
612 ylen = sCageSidePanelWidth / 2;
613 zlen = sCageSidePanelLength / 2;
614 TGeoBBox* bodySh = new TGeoBBox(xlen, ylen, zlen);
615 bodySh->SetName(Form("%sbodyshape", shpref));
616
617 // The hole for the longest rails (approx): a BBox
618 xlen = 1.1 * xthick / 2;
619 ylen = sCageSidePanelRailWidth / 2;
620 zlen = sCageSidePanelRail1Len;
621 TGeoBBox* rail1Sh = new TGeoBBox(xlen, ylen, zlen);
622 rail1Sh->SetName(Form("%slongrail", shpref));
623
624 zpos = sCageSidePanelLength / 2;
625 TGeoTranslation* rail1Mat[4];
626 for (Int_t j = 0; j < 2; j++) {
627 ypos = sCageSidePanelRail1Ypos[j];
628 rail1Mat[j] = new TGeoTranslation(0, ypos, zpos);
629 rail1Mat[j]->SetName(Form("longrailmat%d", j));
630 rail1Mat[j]->RegisterYourself();
631 rail1Mat[j + 2] = new TGeoTranslation(0, -ypos, zpos);
632 rail1Mat[j + 2]->SetName(Form("longrailmat%d", j + 2));
633 rail1Mat[j + 2]->RegisterYourself();
634 }
635
636 // The hole for the intermediate rails (approx): a BBox
637 zlen = sCageSidePanelRail2Len;
638 TGeoBBox* rail2Sh = new TGeoBBox(xlen, ylen, zlen);
639 rail2Sh->SetName(Form("%smedrail", shpref));
640
641 ypos = sCageSidePanelRail2Ypos;
642 TGeoTranslation* rail2Mat[2];
643 rail2Mat[0] = new TGeoTranslation(0, ypos, zpos);
644 rail2Mat[0]->SetName("medrailmat0");
645 rail2Mat[0]->RegisterYourself();
646 rail2Mat[1] = new TGeoTranslation(0, -ypos, zpos);
647 rail2Mat[1]->SetName("medrailmat1");
648 rail2Mat[1]->RegisterYourself();
649
650 // The hole for the shortest rails (approx): a BBox
651 zlen = sCageSidePanelRail3Len;
652 TGeoBBox* rail3Sh = new TGeoBBox(xlen, ylen, zlen);
653 rail3Sh->SetName(Form("%sshortrail", shpref));
654
655 TGeoTranslation* rail3Mat[6];
656 for (Int_t j = 0; j < 3; j++) {
657 ypos = sCageSidePanelRail3Ypos[j];
658 rail3Mat[j] = new TGeoTranslation(0, ypos, zpos);
659 rail3Mat[j]->SetName(Form("shortrailmat%d", j));
660 rail3Mat[j]->RegisterYourself();
661 rail3Mat[j + 3] = new TGeoTranslation(0, -ypos, zpos);
662 rail3Mat[j + 3]->SetName(Form("shortrailmat%d", j + 3));
663 rail3Mat[j + 3]->RegisterYourself();
664 }
665
666 // The hole for the middle bar: a BBox
667 xlen = 1.1 * sCageSidePanelCoreThick / 2;
668 ylen = sCageSidePanelMidBarWid / 2;
669 zlen = (sCageSidePanelLength - sCageSidePanelRail3Len) / 2;
670 TGeoBBox* midBarHol = new TGeoBBox(xlen, ylen, zlen);
671 midBarHol->SetName("midbar");
672
673 zpos = sCageSidePanelRail3Len / 2;
674 TGeoTranslation* midBarMat = new TGeoTranslation(0, 0, -zpos);
675 midBarMat->SetName("midbarmat");
676 midBarMat->RegisterYourself();
677
678 // The hole for the side bar: a BBox
679 xlen = 1.1 * sCageSidePanelCoreThick / 2;
680 ylen = 1.1 * sCageSidePanelWidth / 2;
681 zlen = sCageSidePanelSidBarWid;
682 TGeoBBox* sidBarHol = new TGeoBBox(xlen, ylen, zlen);
683 sidBarHol->SetName("sidebar");
684
685 zpos = sCageSidePanelLength / 2;
686 TGeoTranslation* sidBarMat = new TGeoTranslation(0, 0, -zpos);
687 sidBarMat->SetName("sidebarmat");
688 sidBarMat->RegisterYourself();
689
690 // The actual shape: a CompositeShape
691 TString compoShape = Form("%sbodyshape", shpref);
692 for (Int_t j = 0; j < 4; j++) {
693 compoShape += Form("-%slongrail:longrailmat%d", shpref, j);
694 }
695 for (Int_t j = 0; j < 2; j++) {
696 compoShape += Form("-%smedrail:medrailmat%d", shpref, j);
697 }
698 for (Int_t j = 0; j < 6; j++) {
699 compoShape += Form("-%sshortrail:shortrailmat%d", shpref, j);
700 }
701
702 // The mid and side bar holes are present only in the core shape
703 if (strcmp(shpref, "core") == 0) {
704 compoShape += "-midbar:midbarmat-sidebar:sidebarmat";
705 }
706
707 TGeoCompositeShape* corefoilSh = new TGeoCompositeShape(compoShape);
708
709 // Now return the shape
710 return corefoilSh;
711}
712
713TGeoCompositeShape* V3Cage::createCageSidePanelRail(const Double_t zlength, const Int_t index)
714{
715 //
716 // Creates the shape of a Cage Side Panel rail
717 // (slightly approximated as a linear structure)
718 //
719 // Input:
720 // zlength : the rail length along Z
721 // index : an integer to distinguish subvolume names
722 //
723 // Output:
724 //
725 // Return:
726 // The side panel rail as a TGeoCompositeShape
727 //
728 // Created: 08 Oct 2022 Mario Sitta
729 //
730
731 // Local variables
732 Double_t xlen, ylen;
733 Double_t xpos, ypos;
734
735 // The elements of the rail:
736 // - the vertical part: a BBox
737 xlen = sCageSidePanelRailVThik / 2;
738 ylen = (sCageSidePanelRailWidth - 2 * sCageSidePanelRailHThik) / 2;
739 TGeoBBox* railVert = new TGeoBBox(xlen, ylen, zlength / 2);
740 railVert->SetName(Form("railvert%d", index));
741
742 // - the horizontal part: a BBox
743 xlen = sCageSidePanelRailSpan / 2;
744 ylen = sCageSidePanelRailHThik / 2;
745 TGeoBBox* railHor = new TGeoBBox(xlen, ylen, zlength / 2);
746 railHor->SetName(Form("railhor%d", index));
747
748 // The relative matrices
749 xpos = (sCageSidePanelRailVThik - sCageSidePanelRailSpan) / 2;
750 ypos = (sCageSidePanelRailWidth - sCageSidePanelRailHThik) / 2;
751 TGeoTranslation* railHorMat1 = new TGeoTranslation(xpos, ypos, 0);
752 railHorMat1->SetName("railhormat1");
753 railHorMat1->RegisterYourself();
754
755 TGeoTranslation* railHorMat2 = new TGeoTranslation(xpos, -ypos, 0);
756 railHorMat2->SetName("railhormat2");
757 railHorMat2->RegisterYourself();
758
759 // The actual guide: a CompositeShape
760 TString compoShape = Form("railvert%d", index);
761 compoShape += Form("+railhor%d:railhormat1", index);
762 compoShape += Form("+railhor%d:railhormat2", index);
763
764 TGeoCompositeShape* railSh = new TGeoCompositeShape(compoShape);
765
766 // Now return the shape
767 return railSh;
768}
769
770TGeoVolume* V3Cage::createCageEndCap(const TGeoManager* mgr)
771{
772 //
773 // Creates the Cage End Cap (from drawings ALIITSUP0235, ALIITSUP0229)
774 //
775 // Input:
776 // mgr : the GeoManager (used only to get the proper material)
777 //
778 // Output:
779 //
780 // Return:
781 // The end cap as a TGeoVolumeAssembly
782 //
783 // Created: 30 Jun 2022 Mario Sitta
784 //
785
786 // Local variables
787 Double_t rmin, rmid, rmax;
788 Double_t xlen, ylen, zlen;
789 Double_t xpos, ypos, zpos;
790
791 // The TGeoVolumeAssembly holding all elements
792 TGeoVolumeAssembly* endCapVol = new TGeoVolumeAssembly("CageEndCap");
793
794 // The basic fabric disk: a Tube
795 rmin = sCageEndCapDint / 2;
796 rmax = sCageEndCapDext / 2;
797 zlen = sCageEndCapFabThick / 2;
798
799 TGeoTube* baseFabric = new TGeoTube(rmin, rmax, zlen);
800 baseFabric->SetName("endCapBaseFabric");
801
802 // The basic foam disk: a Tube
803 zlen = sCageEndCapFoamThick / 2;
804
805 TGeoTube* baseFoam = new TGeoTube(rmin, rmax, zlen);
806 baseFoam->SetName("endCapBaseFoam");
807
808 // Common cut-out shapes
809 xlen = (sCageEndCapDext - sCageEndCapXWidth) / 2;
810 ylen = 0.6 * rmax;
811
812 TGeoBBox* sideCut = new TGeoBBox(xlen, ylen, 2 * zlen);
813 sideCut->SetName("endCapBoxCut");
814
815 TGeoTube* sideHole = new TGeoTube(0, sCageEndCapSideHoleR, 2 * zlen);
816 sideHole->SetName("endCapSideHole");
817
818 xlen = sCageEndCapCableCutWid / 2;
819 ylen = rmax - sCageEndCapCableCutR;
820
821 TGeoBBox* cableCut = new TGeoBBox(xlen, ylen, 2 * zlen);
822 cableCut->SetName("endCapCableCut");
823
824 // Some matrices to create the composite shapes
825 xpos = rmax;
826
827 TGeoTranslation* boxCutTr1 = new TGeoTranslation("boxCutTr1", xpos, 0, 0);
828 boxCutTr1->RegisterYourself();
829
830 TGeoTranslation* boxCutTr2 = new TGeoTranslation("boxCutTr2", -xpos, 0, 0);
831 boxCutTr2->RegisterYourself();
832
833 xpos = sCageEndCapSideHoleX / 2;
834
835 TGeoTranslation* sidHolTr1 = new TGeoTranslation("sideHoleTr1", xpos, 0, 0);
836 sidHolTr1->RegisterYourself();
837
838 TGeoTranslation* sidHolTr2 = new TGeoTranslation("sideHoleTr2", -xpos, 0, 0);
839 sidHolTr2->RegisterYourself();
840
841 xpos = rmax * TMath::Sin(sCageEndCapCableCutPhi * TMath::DegToRad());
842 ypos = rmax * TMath::Cos(sCageEndCapCableCutPhi * TMath::DegToRad());
843
844 TGeoCombiTrans* cableMat1 = new TGeoCombiTrans(xpos, ypos, 0, new TGeoRotation("", -sCageEndCapCableCutPhi, 0, 0));
845 cableMat1->SetName("cableMat1");
846 cableMat1->RegisterYourself();
847
848 TGeoCombiTrans* cableMat2 = new TGeoCombiTrans(-xpos, ypos, 0, new TGeoRotation("", sCageEndCapCableCutPhi, 0, 0));
849 cableMat2->SetName("cableMat2");
850 cableMat2->RegisterYourself();
851
852 TGeoCombiTrans* cableMat3 = new TGeoCombiTrans(xpos, -ypos, 0, new TGeoRotation("", -180 + sCageEndCapCableCutPhi, 0, 0));
853 cableMat3->SetName("cableMat3");
854 cableMat3->RegisterYourself();
855
856 TGeoCombiTrans* cableMat4 = new TGeoCombiTrans(-xpos, -ypos, 0, new TGeoRotation("", 180 - sCageEndCapCableCutPhi, 0, 0));
857 cableMat4->SetName("cableMat4");
858 cableMat4->RegisterYourself();
859
860 // The external fabric panel (each): a CompositeShape
861 TGeoCompositeShape* fabricSh = new TGeoCompositeShape("endCapBaseFabric-endCapBoxCut:boxCutTr1-endCapBoxCut:boxCutTr2-endCapSideHole:sideHoleTr1-endCapSideHole:sideHoleTr2-endCapCableCut:cableMat1-endCapCableCut:cableMat2-endCapCableCut:cableMat3-endCapCableCut:cableMat4");
862
863 // The internal foam panel: a CompositeShape
864 TGeoCompositeShape* foamSh = new TGeoCompositeShape("endCapBaseFoam-endCapBoxCut:boxCutTr1-endCapBoxCut:boxCutTr2-endCapSideHole:sideHoleTr1-endCapSideHole:sideHoleTr2-endCapCableCut:cableMat1-endCapCableCut:cableMat2-endCapCableCut:cableMat3-endCapCableCut:cableMat4");
865
866 // The round crossing ring: a Pcon (ALIITSUP0281)
867 // (in real world it is made of two rimmed rings placed face-to-face;
868 // for simplicity and to spare volumes it is implemented as a single
869 // Pcon encompassing both rings as mounted in the final setup)
870 TGeoPcon* rndCrosSh = new TGeoPcon(0, 360, 6);
871
872 rmin = sCageECRoundCrossDmin / 2;
873 rmid = sCageECRoundCrossDmid / 2;
874 rmax = sCageECRoundCrossDmax / 2;
875
876 rndCrosSh->DefineSection(0, -sCageECRoundCrossZext, rmin, rmax);
877 rndCrosSh->DefineSection(1, -sCageECRoundCrossZint, rmin, rmax);
878 rndCrosSh->DefineSection(2, -sCageECRoundCrossZint, rmin, rmid);
879 rndCrosSh->DefineSection(3, sCageECRoundCrossZint, rmin, rmid);
880 rndCrosSh->DefineSection(4, sCageECRoundCrossZint, rmin, rmax);
881 rndCrosSh->DefineSection(5, sCageECRoundCrossZext, rmin, rmax);
882
883 // The (weirdly shaped) cable crossing: a CompositeShape
884 TGeoCompositeShape* cblCrosSh = createCageEndCapCableCross(mgr);
885
886 // We have all shapes: now create the real volume
887 TGeoMedium* medFabric = mgr->GetMedium(Form("%s_M46J6K$", GetDetName()));
888 TGeoMedium* medFoam = mgr->GetMedium(Form("%s_ROHACELL$", GetDetName()));
889 TGeoMedium* medAl = mgr->GetMedium(Form("%s_ALUMINUM$", GetDetName()));
890
891 TGeoVolume* fabVol = new TGeoVolume("CageEndCapFabric", fabricSh, medFabric);
892 fabVol->SetFillColor(kBlue);
893 fabVol->SetLineColor(kBlue);
894
895 TGeoVolume* foamVol = new TGeoVolume("CageEndCapFoam", foamSh, medFoam);
896 foamVol->SetFillColor(kYellow);
897 foamVol->SetLineColor(kYellow);
898
899 TGeoVolume* rndCrosVol = new TGeoVolume("CageEndCapRoundCross", rndCrosSh, medAl);
900 rndCrosVol->SetFillColor(kGray);
901 rndCrosVol->SetLineColor(kGray);
902
903 TGeoVolume* cblCrosVol = new TGeoVolume("CageEndCapCableCross", cblCrosSh, medAl);
904 cblCrosVol->SetFillColor(kGray);
905 cblCrosVol->SetLineColor(kGray);
906
907 // Then build up the end cap
908 endCapVol->AddNode(foamVol, 1, nullptr);
909
910 zpos = (sCageEndCapFoamThick + sCageEndCapFabThick) / 2;
911 endCapVol->AddNode(fabVol, 1, new TGeoTranslation(0, 0, zpos));
912 endCapVol->AddNode(fabVol, 2, new TGeoTranslation(0, 0, -zpos));
913
914 endCapVol->AddNode(rndCrosVol, 1, nullptr);
915
916 rmax = sCageEndCapDext / 2 - sCageECCableCrosTotHi;
917 xpos = rmax * TMath::Sin(sCageEndCapCableCutPhi * TMath::DegToRad());
918 ypos = rmax * TMath::Cos(sCageEndCapCableCutPhi * TMath::DegToRad());
919 endCapVol->AddNode(cblCrosVol, 1, new TGeoCombiTrans(xpos, ypos, 0, new TGeoRotation("", -sCageEndCapCableCutPhi, 0, 0)));
920 endCapVol->AddNode(cblCrosVol, 2, new TGeoCombiTrans(-xpos, ypos, 0, new TGeoRotation("", sCageEndCapCableCutPhi, 0, 0)));
921 endCapVol->AddNode(cblCrosVol, 3, new TGeoCombiTrans(xpos, -ypos, 0, new TGeoRotation("", -180 + sCageEndCapCableCutPhi, 0, 0)));
922 endCapVol->AddNode(cblCrosVol, 4, new TGeoCombiTrans(-xpos, -ypos, 0, new TGeoRotation("", 180 - sCageEndCapCableCutPhi, 0, 0)));
923
924 // Finally return the end cap volume
925 return endCapVol;
926}
927
928TGeoCompositeShape* V3Cage::createCageEndCapCableCross(const TGeoManager* mgr)
929{
930 //
931 // Creates the Cable Crossing frame for the Cage End Cap (ALIITSUP0282)
932 // Since it is pretty cumbersome, we create it in a separate method
933 //
934 // Input:
935 // mgr : the GeoManager (used only to get the proper material)
936 //
937 // Output:
938 //
939 // Return:
940 // The cable crossing frame as a TGeoCompositeShape
941 //
942 // Created: 01 Jul 2022 Mario Sitta
943 //
944
945 // Local variables
946 Double_t rmin, rmid, rmax;
947 Double_t xlen, ylen, zlen;
948 Double_t xpos, ypos, zpos;
949
950 // The string holding the complex crossing cable structure
951 TString crossShape = "";
952
953 // The inner lower part: a BBox and its matrix
954 xlen = sCageECCableCrosInXWid / 2;
955 ylen = sCageECCableCrosInThik / 2;
956 zlen = sCageECCableCrosInZLen / 2;
957 TGeoBBox* cabCrosLow = new TGeoBBox(xlen, ylen, zlen);
958 cabCrosLow->SetName("CabCrosLow");
959
960 TGeoTranslation* matCrosLow = new TGeoTranslation("MatCrosLow", 0, ylen, 0);
961 matCrosLow->RegisterYourself();
962
963 crossShape = "CabCrosLow:MatCrosLow";
964
965 // The side wall of lower part: a BBox and its two matrices
966 xlen = (sCageECCableCrosInXWid + 2 * (sCageECCableCrosSidWid - sCageECCableCrosInThik)) / 2;
967 ylen = sCageECCableCrosSidWid / 2;
968 zlen = (sCageECCableCrosTotZ - sCageECCableCrosInZLen) / 4; // We have 2 sides
969 TGeoBBox* cabCrosSide = new TGeoBBox(xlen, ylen, zlen);
970 cabCrosSide->SetName("CabCrosSide");
971
972 ypos = 2 * cabCrosLow->GetDY() - cabCrosSide->GetDY();
973 zpos = cabCrosLow->GetDZ() + cabCrosSide->GetDZ();
974 TGeoTranslation* matCrosSid1 = new TGeoTranslation("MatCrosSid1", 0, ypos, zpos);
975 matCrosSid1->RegisterYourself();
976 TGeoTranslation* matCrosSid2 = new TGeoTranslation("MatCrosSid2", 0, ypos, -zpos);
977 matCrosSid2->RegisterYourself();
978
979 crossShape += "+CabCrosSide:MatCrosSid1+CabCrosSide:MatCrosSid2";
980
981 // The inner lateral part: a BBox and its two matrices
982 // (in blueprint the lateral height is not specified, we have to compute it)
983 rmax = sCageEndCapDext / 2;
984 xlen = sCageECCableCrosInXWid / 2;
985
986 Double_t apothem = TMath::Sqrt(rmax * rmax - xlen * xlen);
987 Double_t sagitta = rmax - apothem;
988
989 xlen = sCageECCableCrosInThik / 2;
990 ylen = (sCageECCableCrosTotHi - sagitta - sCageECCableCrosInThik) / 2;
991 zlen = sCageECCableCrosInZLen / 2;
992 TGeoBBox* cabCrosLat = new TGeoBBox(xlen, ylen, zlen);
993 cabCrosLat->SetName("CabCrosLateral");
994
995 xpos = 0.5 * sCageECCableCrosInXWid - cabCrosLat->GetDX();
996 ypos = cabCrosLat->GetDY() + sCageECCableCrosInThik;
997 TGeoTranslation* matCrosLat1 = new TGeoTranslation("MatCrosLat1", xpos, ypos, 0);
998 matCrosLat1->RegisterYourself();
999 TGeoTranslation* matCrosLat2 = new TGeoTranslation("MatCrosLat2", -xpos, ypos, 0);
1000 matCrosLat2->RegisterYourself();
1001
1002 crossShape += "+CabCrosLateral:MatCrosLat1+CabCrosLateral:MatCrosLat2";
1003
1004 // The side wall of lateral part: a BBox and its four matrices
1005 xlen = sCageECCableCrosSidWid / 2;
1006 zlen = cabCrosSide->GetDZ();
1007 TGeoBBox* cabCrosLatSide = new TGeoBBox(xlen, ylen, zlen);
1008 cabCrosLatSide->SetName("CabCrosLatSide");
1009
1010 xpos = cabCrosSide->GetDX() - cabCrosLatSide->GetDX();
1011 zpos = cabCrosLat->GetDZ() + cabCrosLatSide->GetDZ();
1012 TGeoTranslation* matCrosLatSid1 = new TGeoTranslation("MatCrosLatSid1", xpos, ypos, zpos);
1013 matCrosLatSid1->RegisterYourself();
1014 TGeoTranslation* matCrosLatSid2 = new TGeoTranslation("MatCrosLatSid2", xpos, ypos, -zpos);
1015 matCrosLatSid2->RegisterYourself();
1016 TGeoTranslation* matCrosLatSid3 = new TGeoTranslation("MatCrosLatSid3", -xpos, ypos, zpos);
1017 matCrosLatSid3->RegisterYourself();
1018 TGeoTranslation* matCrosLatSid4 = new TGeoTranslation("MatCrosLatSid4", -xpos, ypos, -zpos);
1019 matCrosLatSid4->RegisterYourself();
1020
1021 crossShape += "+CabCrosLatSide:MatCrosLatSid1+CabCrosLatSide:MatCrosLatSid2+CabCrosLatSide:MatCrosLatSid3+CabCrosLatSide:MatCrosLatSid4";
1022
1023 // The top rounded part: a TubeSeg and its matrix
1024 xlen = sCageECCableCrosInXWid / 2;
1025 Double_t phi = TMath::ASin(xlen / rmax) * TMath::RadToDeg();
1026 rmin = rmax - sCageECCableCrosSidWid;
1027 zlen = sCageECCableCrosTotZ / 2;
1028 TGeoTubeSeg* cabCrosRnd = new TGeoTubeSeg(rmin, rmax, zlen, 90 - phi, 90 + phi);
1029 cabCrosRnd->SetName("CabCrosRoundTop");
1030
1031 ypos = -rmax + sCageECCableCrosTotHi;
1032 TGeoTranslation* matCrosRnd = new TGeoTranslation("MatCrosRound", 0, ypos, 0);
1033 matCrosRnd->RegisterYourself();
1034
1035 crossShape += "+CabCrosRoundTop:MatCrosRound";
1036
1037 // Finally create and return the cable crossing shape
1038 // (the origin of its reference system is below the lower face of cabCrosLow)
1039 TGeoCompositeShape* cableCross = new TGeoCompositeShape(crossShape.Data());
1040
1041 return cableCross;
1042}
1043
1044TGeoVolume* V3Cage::createBeamPipeSupport(const TGeoManager* mgr)
1045{
1046 //
1047 // Creates the Beam Pipe Support inside the Cage on the A side
1048 // (from drawings ALIITSUP1064, ALIITSUP1059, ALIITSUP1057, ALIITSUP1058,
1049 // ALIITSUP1056, ALIITSUP0823, ALIITSUP0273, ALIITSUP1060, ALIITSUP1062)
1050 //
1051 // Input:
1052 // mgr : the GeoManager (used only to get the proper material)
1053 //
1054 // Output:
1055 //
1056 // Return:
1057 // The beam pipe support as a TGeoVolumeAssembly
1058 //
1059 // Created: 03 Jun 2023 Mario Sitta
1060 //
1061
1062 // Local variables
1063 const Int_t nv = 8;
1064 Double_t xv[nv], yv[nv];
1065 Double_t xpos, ypos, zpos;
1066
1067 // The TGeoVolumeAssembly holding all elements
1068 TGeoVolumeAssembly* bpSuppVol = new TGeoVolumeAssembly("CageBeamPipeSupport");
1069
1070 // The lower collar
1071 TGeoCompositeShape* lowCollarSh = createBPSuppLowerCollar();
1072
1073 // The upper collar
1074 TGeoCompositeShape* upCollarSh = createBPSuppUpperCollar();
1075
1076 // Each one of the collar beams
1077 TGeoCompositeShape* collarBeamSh = createBPSuppCollarBeam();
1078
1079 // Each one of the lateral brackets
1080 TGeoCompositeShape* bracketSh = createBPSuppBracket();
1081
1082 // Each one of the lateral clamps
1083 TGeoCompositeShape* clampSh = createBPSuppClamp();
1084
1085 // The Vespel bushing: a Tube
1086 TGeoTube* bushSh = new TGeoTube(0.5 * sBPSuppCollarBushD, 0.5 * sBPSuppCollarIntD, 0.5 * sBPSuppBracketWidth);
1087
1088 // The clamp shim: a BBox
1089 TGeoBBox* shimSh = new TGeoBBox(0.5 * sBPSuppClampShimWid, 0.5 * sBPSuppClampShimThick, 0.5 * sBPSuppClampShimLen);
1090
1091 // The M4 screw head: a Tube
1092 TGeoTube* m4ScrewSh = new TGeoTube(0, 0.5 * sBPSuppCollarM4Diam, 0.5 * sBPSuppCollarM4High);
1093
1094 // The M5 screw head: a Tube
1095 TGeoTube* m5ScrewSh = new TGeoTube(0, 0.5 * sBPSuppClampM5Diam, 0.5 * sBPSuppClampM5High);
1096
1097 // The threaded insert head: a Cone
1098 TGeoCone* insHeadSh = new TGeoCone(0.5 * sBPSuppClampInsH, 0, 0.5 * sBPSuppClampInsDmin, 0, 0.5 * sBPSuppClampInsDmax);
1099
1100 // We have all the shapes: now create the real volumes
1101 TGeoMedium* medCFRP = mgr->GetMedium(Form("%s_CFRP$", GetDetName()));
1102 TGeoMedium* medTitanium = mgr->GetMedium(Form("%s_TITANIUM$", GetDetName()));
1103 TGeoMedium* medSteel = mgr->GetMedium(Form("%s_INOX304$", GetDetName()));
1104 TGeoMedium* medBrass = mgr->GetMedium(Form("%s_BRASS$", GetDetName()));
1105 TGeoMedium* medVespel = mgr->GetMedium(Form("%s_VESPEL$", GetDetName()));
1106
1107 Color_t kTitanium = kGray + 1; // Darker gray
1108
1109 TGeoVolume* lowCollarVol = new TGeoVolume("BPSupportLowerCollar", lowCollarSh, medTitanium);
1110 lowCollarVol->SetFillColor(kTitanium);
1111 lowCollarVol->SetLineColor(kTitanium);
1112
1113 TGeoVolume* upCollarVol = new TGeoVolume("BPSupportUpperCollar", upCollarSh, medTitanium);
1114 upCollarVol->SetFillColor(kTitanium);
1115 upCollarVol->SetLineColor(kTitanium);
1116
1117 TGeoVolume* bushVol = new TGeoVolume("BPSupportCollarBushing", bushSh, medVespel);
1118 bushVol->SetFillColor(kGreen);
1119 bushVol->SetLineColor(kGreen);
1120
1121 TGeoVolume* collarBeamVol = new TGeoVolume("BPSupportCollarBeam", collarBeamSh, medCFRP);
1122 collarBeamVol->SetFillColor(kBlue);
1123 collarBeamVol->SetLineColor(kBlue);
1124
1125 TGeoVolume* bracketVol = new TGeoVolume("BPSupportBracket", bracketSh, medTitanium);
1126 bracketVol->SetFillColor(kTitanium);
1127 bracketVol->SetLineColor(kTitanium);
1128
1129 TGeoVolume* clampVol = new TGeoVolume("BPSupportClamp", clampSh, medTitanium);
1130 clampVol->SetFillColor(kTitanium);
1131 clampVol->SetLineColor(kTitanium);
1132
1133 TGeoVolume* shimVol = new TGeoVolume("BPSupportClampShim", shimSh, medBrass);
1134 shimVol->SetFillColor(kOrange - 4); // Brownish
1135 shimVol->SetLineColor(kOrange - 4);
1136
1137 TGeoVolume* m4ScrewVol = new TGeoVolume("BPSupportCollarScrew", m4ScrewSh, medTitanium);
1138 m4ScrewVol->SetFillColor(kTitanium);
1139 m4ScrewVol->SetLineColor(kTitanium);
1140
1141 TGeoVolume* m5ScrewVol = new TGeoVolume("BPSupportClampScrew", m5ScrewSh, medSteel);
1142 m5ScrewVol->SetFillColor(kGray);
1143 m5ScrewVol->SetLineColor(kGray);
1144
1145 TGeoVolume* insHeadVol = new TGeoVolume("BPSupportClampInsert", insHeadSh, medSteel);
1146 insHeadVol->SetFillColor(kGray);
1147 insHeadVol->SetLineColor(kGray);
1148
1149 // Then build up the beam support
1150 bpSuppVol->AddNode(lowCollarVol, 1, nullptr);
1151
1152 ypos = sBPSuppLowCollTailHei / 2;
1153 bpSuppVol->AddNode(upCollarVol, 1, new TGeoTranslation(0, ypos, 0));
1154
1155 bpSuppVol->AddNode(bushVol, 1, new TGeoTranslation(0, ypos, 0));
1156
1157 xpos = sBPSuppCollarM4XDist / 2;
1158 ypos += (sBPSuppUpperCollarHei + m4ScrewSh->GetDz());
1159 zpos = sBPSuppCollarM4ZPos;
1160 bpSuppVol->AddNode(m4ScrewVol, 1, new TGeoCombiTrans(xpos, ypos, zpos, new TGeoRotation("", 0, 90, 0)));
1161 bpSuppVol->AddNode(m4ScrewVol, 2, new TGeoCombiTrans(-xpos, ypos, zpos, new TGeoRotation("", 0, 90, 0)));
1162 bpSuppVol->AddNode(m4ScrewVol, 3, new TGeoCombiTrans(xpos, ypos, -zpos, new TGeoRotation("", 0, 90, 0)));
1163 bpSuppVol->AddNode(m4ScrewVol, 4, new TGeoCombiTrans(-xpos, ypos, -zpos, new TGeoRotation("", 0, 90, 0)));
1164
1165 xpos = sBPSuppLowerCollarLen / 2 - sBPSuppBracketInLen + sBPSuppCollarBeamLen / 2;
1166 bpSuppVol->AddNode(collarBeamVol, 1, new TGeoCombiTrans(xpos, 0, 0, new TGeoRotation("", 0, 90, 0)));
1167 bpSuppVol->AddNode(collarBeamVol, 2, new TGeoCombiTrans(-xpos, 0, 0, new TGeoRotation("", 0, 90, 0)));
1168
1169 xpos += (sBPSuppCollarBeamLen / 2 - sBPSuppBracketInLen);
1170 bpSuppVol->AddNode(bracketVol, 1, new TGeoTranslation(xpos, 0, 0));
1171 bpSuppVol->AddNode(bracketVol, 2, new TGeoCombiTrans(-xpos, 0, 0, new TGeoRotation("", 90, 180, -90)));
1172
1173 xpos = 0.5 * sBPSuppClampsXDist - sBPSuppClampTotWid + shimSh->GetDX();
1174 ypos = -shimSh->GetDY();
1175 bpSuppVol->AddNode(shimVol, 1, new TGeoTranslation(xpos, ypos, 0));
1176 bpSuppVol->AddNode(shimVol, 2, new TGeoTranslation(-xpos, ypos, 0));
1177
1178 xpos = 0.5 * sBPSuppClampsXDist - sBPSuppClampLatThick;
1179 ypos -= shimSh->GetDY();
1180 bpSuppVol->AddNode(clampVol, 1, new TGeoTranslation(-xpos, ypos, 0));
1181 bpSuppVol->AddNode(clampVol, 2, new TGeoCombiTrans(xpos, ypos, 0, new TGeoRotation("", 90, 180, -90)));
1182
1183 xpos -= m5ScrewSh->GetDz();
1184 ypos += (0.5 * sBPSuppClampTotHei - sBPSuppClampShelfHei);
1185 zpos = sBPSuppClampM5ZPos;
1186 bpSuppVol->AddNode(m5ScrewVol, 1, new TGeoCombiTrans(xpos, ypos, zpos, new TGeoRotation("", 90, 90, -90)));
1187 bpSuppVol->AddNode(m5ScrewVol, 2, new TGeoCombiTrans(xpos, ypos, -zpos, new TGeoRotation("", 90, 90, -90)));
1188 bpSuppVol->AddNode(m5ScrewVol, 3, new TGeoCombiTrans(-xpos, ypos, zpos, new TGeoRotation("", 90, 90, -90)));
1189 bpSuppVol->AddNode(m5ScrewVol, 4, new TGeoCombiTrans(-xpos, ypos, -zpos, new TGeoRotation("", 90, 90, -90)));
1190
1191 xpos = 0.5 * sBPSuppClampsXDist - sBPSuppClampInsXPos;
1192 ypos = sBPSuppBracketTailHei + insHeadSh->GetDz();
1193 zpos = sBPSuppClampInsZPos;
1194 bpSuppVol->AddNode(insHeadVol, 1, new TGeoCombiTrans(xpos, ypos, zpos, new TGeoRotation("", 0, 90, 0)));
1195 bpSuppVol->AddNode(insHeadVol, 2, new TGeoCombiTrans(-xpos, ypos, zpos, new TGeoRotation("", 0, 90, 0)));
1196 bpSuppVol->AddNode(insHeadVol, 3, new TGeoCombiTrans(xpos, ypos, -zpos, new TGeoRotation("", 0, 90, 0)));
1197 bpSuppVol->AddNode(insHeadVol, 4, new TGeoCombiTrans(-xpos, ypos, -zpos, new TGeoRotation("", 0, 90, 0)));
1198
1199 // Finally return the beam pipe support volume
1200 return bpSuppVol;
1201}
1202
1203TGeoCompositeShape* V3Cage::createBPSuppLowerCollar()
1204{
1205 //
1206 // Creates the lower collar which actually supports the Beam Pipe
1207 // (ALIITSUP1056)
1208 //
1209 // Input:
1210 //
1211 // Output:
1212 //
1213 // Return:
1214 // The lower collar as a TGeoCompositeShape
1215 //
1216 // Created: 06 Jun 2023 Mario Sitta
1217 //
1218
1219 // Local variables
1220 const Int_t nv = 12;
1221 Double_t xv[nv], yv[nv], xy8[16];
1222 Double_t zlen;
1223 Double_t xpos, ypos;
1224
1225 // The lateral bracket: a Xtru
1226 Double_t totlen = (sBPSuppLowerCollarLen - sBPSuppCollarIntD) / 2;
1227 Double_t xtail = (sBPSuppLowCollHolDist - sBPSuppCollarIntD) / 2;
1228 Double_t taillen = sBPSuppLowerCollarTlX - sBPSuppCollarIntD / 2;
1229
1230 xv[0] = 0;
1231 yv[0] = -sBPSuppCollarBeamHei / 2;
1232 xv[1] = totlen - xtail;
1233 yv[1] = yv[0];
1234 xv[2] = totlen - taillen;
1235 yv[2] = -sBPSuppLowCollTailHei / 2;
1236 xv[3] = totlen;
1237 yv[3] = yv[2];
1238 xv[4] = xv[3];
1239 yv[4] = sBPSuppLowCollTailHei / 2;
1240 xv[5] = xv[2];
1241 yv[5] = yv[4];
1242 xv[6] = xv[1];
1243 yv[6] = -yv[1];
1244 xv[7] = xv[0];
1245 yv[7] = yv[6];
1246 xv[8] = xv[7];
1247 yv[8] = sBPSuppBracketInHei / 2;
1248 xv[9] = sBPSuppBracketInLen;
1249 yv[9] = yv[8];
1250 xv[10] = xv[9];
1251 yv[10] = -yv[9];
1252 xv[11] = xv[0];
1253 yv[11] = yv[10];
1254
1255 zlen = sBPSuppBracketWidth / 2;
1256 TGeoXtru* brktlat = new TGeoXtru(2);
1257 brktlat->DefinePolygon(nv, xv, yv);
1258 brktlat->DefineSection(0, -zlen);
1259 brktlat->DefineSection(1, zlen);
1260 brktlat->SetName("latBrackBody");
1261
1262 // The central hole in lateral bracket: a Tube
1263 zlen = sBPSuppBracketWidth / 2 + 0.001;
1264 TGeoTube* brktcenthole = new TGeoTube(0, sBPSuppBrktCentHoleD / 2, zlen);
1265 brktcenthole->SetName("latBrackCentHole");
1266
1267 xpos = totlen - xtail;
1268 TGeoTranslation* brktcenthmat = new TGeoTranslation(xpos, 0, 0);
1269 brktcenthmat->SetName("latCentHoleMat");
1270 brktcenthmat->RegisterYourself();
1271
1272 // The lateral hole in lateral bracket: an Arb8
1273 // (array of vertices is in the form (x0, y0, x1, y1, ..., x7, y7) )
1274 xy8[0] = 0;
1275 xy8[1] = 0;
1276 xy8[2] = -sBPSuppBrktLatHoleW;
1277 xy8[3] = -sBPSuppBrktLatHoleH / 2;
1278 xy8[4] = xy8[2];
1279 xy8[5] = -xy8[3];
1280 xy8[6] = xy8[0];
1281 xy8[7] = xy8[1];
1282 for (Int_t i = 0; i < 8; i++) { // The opposite face
1283 xy8[8 + i] = xy8[i];
1284 }
1285 TGeoArb8* brktlathole = new TGeoArb8(zlen, xy8);
1286 brktlathole->SetName("latBrackLatHole");
1287
1288 xpos = totlen - taillen;
1289 TGeoTranslation* brktlathmat = new TGeoTranslation(xpos, 0, 0);
1290 brktlathmat->SetName("latLatHoleMat");
1291 brktlathmat->RegisterYourself();
1292
1293 // The lateral bracket: a CompositeShape
1294 TGeoCompositeShape* latbrkt = new TGeoCompositeShape("latBrackBody-latBrackCentHole:latCentHoleMat-latBrackLatHole:latLatHoleMat");
1295 latbrkt->SetName("lateralBracket");
1296
1297 // The lateral bracket matrices
1298 xpos = sBPSuppLowerCollarLen / 2;
1299 TGeoTranslation* latmat1 = new TGeoTranslation(-xpos, 0, 0);
1300 latmat1->SetName("latBrackMat1");
1301 latmat1->RegisterYourself();
1302
1303 TGeoCombiTrans* latmat2 = new TGeoCombiTrans(xpos, 0, 0, new TGeoRotation("", 90, 180, -90));
1304 latmat2->SetName("latBrackMat2");
1305 latmat2->RegisterYourself();
1306
1307 // The collar: a TubeSeg
1308 TGeoTubeSeg* collar = new TGeoTubeSeg(0.5 * sBPSuppCollarIntD, 0.5 * sBPSuppCollarExtD, 0.5 * sBPSuppBracketWidth, 180, 360);
1309 collar->SetName("lowerCollar");
1310
1311 ypos = brktlat->GetY(4); // The upper face of the tail
1312 TGeoTranslation* collmat = new TGeoTranslation(0, ypos, 0);
1313 collmat->SetName("lowerCollMat");
1314 collmat->RegisterYourself();
1315
1316 // Finally create and return the lower collar
1317 // (the origin of its reference system is at its center)
1318 TGeoCompositeShape* collarShape = new TGeoCompositeShape("lowerCollar:lowerCollMat+lateralBracket:latBrackMat1+lateralBracket:latBrackMat2");
1319
1320 return collarShape;
1321}
1322
1323TGeoCompositeShape* V3Cage::createBPSuppUpperCollar()
1324{
1325 //
1326 // Creates the upper collar of the Beam Pipe Support (ALIITSUP0823)
1327 //
1328 // Input:
1329 //
1330 // Output:
1331 //
1332 // Return:
1333 // The upper collar as a TGeoCompositeShape
1334 //
1335 // Created: 07 Jun 2023 Mario Sitta
1336 //
1337
1338 // Local variables
1339 Double_t xlen;
1340 Double_t xpos, ypos;
1341
1342 // The lateral plate: a BBox
1343 xlen = (sBPSuppUpperCollarLen - sBPSuppCollarIntD) / 2;
1344 TGeoBBox* plate = new TGeoBBox(0.5 * xlen, 0.5 * sBPSuppUpperCollarHei, 0.5 * sBPSuppBracketWidth);
1345 plate->SetName("lateralPlate");
1346
1347 xpos = sBPSuppUpperCollarLen / 2 - plate->GetDX();
1348 ypos = plate->GetDY();
1349 TGeoTranslation* latplmat1 = new TGeoTranslation(xpos, ypos, 0);
1350 latplmat1->SetName("lateralPlateMat1");
1351 latplmat1->RegisterYourself();
1352
1353 TGeoTranslation* latplmat2 = new TGeoTranslation(-xpos, ypos, 0);
1354 latplmat2->SetName("lateralPlateMat2");
1355 latplmat2->RegisterYourself();
1356
1357 // The collar: a TubeSeg
1358 TGeoTubeSeg* collar = new TGeoTubeSeg(0.5 * sBPSuppCollarIntD, 0.5 * sBPSuppCollarExtD, 0.5 * sBPSuppBracketWidth, 0, 180);
1359 collar->SetName("upperCollar");
1360
1361 // Finally create and return the upper collar
1362 // (the origin of its reference system is at its center)
1363 TGeoCompositeShape* collarShape = new TGeoCompositeShape("upperCollar+lateralPlate:lateralPlateMat1+lateralPlate:lateralPlateMat2");
1364
1365 return collarShape;
1366}
1367
1368TGeoCompositeShape* V3Cage::createBPSuppCollarBeam()
1369{
1370 //
1371 // Creates the collar beam (i.e. the lateral support bar) of the
1372 // Beam Pipe Support (ALIITSUP1057)
1373 //
1374 // Input:
1375 //
1376 // Output:
1377 //
1378 // Return:
1379 // The collar beam as a TGeoCompositeShape
1380 //
1381 // Created: 03 Jun 2023 Mario Sitta
1382 //
1383
1384 // Local variables
1385 const Int_t nv = 8;
1386 Double_t xv[nv], yv[nv];
1387 Double_t xlen, xwid, ylen, zlen;
1388 Double_t xpos;
1389
1390 // The central part: a Xtru
1391 xlen = (sBPSuppCollarBeamLen - 2 * sBPSuppBracketInLen) / 2;
1392 xwid = (sBPSuppCollarBeamWid - sBPSuppBracketWidth) / 2;
1393 xv[0] = -xlen;
1394 yv[0] = -sBPSuppBracketWidth / 2;
1395 xv[1] = xv[0] + xwid;
1396 yv[1] = -sBPSuppCollarBeamWid / 2;
1397 xv[2] = -xv[1];
1398 yv[2] = yv[1];
1399 xv[3] = -xv[0];
1400 yv[3] = yv[0];
1401 for (Int_t i = 0; i < 4; i++) { // Reflect the lower half to the upper half
1402 xv[4 + i] = xv[3 - i];
1403 yv[4 + i] = -yv[3 - i];
1404 }
1405
1406 zlen = sBPSuppCollarBeamHei / 2;
1407 TGeoXtru* colcent = new TGeoXtru(2);
1408 colcent->SetName("collarCentral");
1409 colcent->DefinePolygon(nv, xv, yv);
1410 colcent->DefineSection(0, -zlen);
1411 colcent->DefineSection(1, zlen);
1412
1413 // Each bracket insert: a BBox
1414 xlen = sBPSuppBracketInLen / 2;
1415 ylen = sBPSuppBracketWidth / 2;
1416 zlen = sBPSuppBracketInHei / 2;
1417 TGeoBBox* colins = new TGeoBBox("collarInsert", xlen, ylen, zlen);
1418
1419 xpos = colcent->GetX(0) - colins->GetDX();
1420 TGeoTranslation* insmat1 = new TGeoTranslation(-xpos, 0, 0);
1421 insmat1->SetName("colInsMat1");
1422 insmat1->RegisterYourself();
1423
1424 TGeoTranslation* insmat2 = new TGeoTranslation(xpos, 0, 0);
1425 insmat2->SetName("colInsMat2");
1426 insmat2->RegisterYourself();
1427
1428 // Finally create and return the collar beam
1429 // (the origin of its reference system is at its center)
1430 TGeoCompositeShape* beamShape = new TGeoCompositeShape("collarCentral+collarInsert:colInsMat1+collarInsert:colInsMat2");
1431
1432 return beamShape;
1433}
1434
1435TGeoCompositeShape* V3Cage::createBPSuppBracket()
1436{
1437 //
1438 // Creates the lateral Titanium bracket of the Beam Pipe Support
1439 // (ALIITSUP1058)
1440 //
1441 // Input:
1442 //
1443 // Output:
1444 //
1445 // Return:
1446 // The bracket as a TGeoCompositeShape
1447 //
1448 // Created: 04 Jun 2023 Mario Sitta
1449 //
1450
1451 // Local variables
1452 const Int_t nv = 12;
1453 Double_t xv[nv], yv[nv];
1454 Double_t zlen;
1455 Double_t xpos;
1456
1457 // The main body: a Xtru
1458 xv[0] = 0;
1459 yv[0] = -sBPSuppCollarBeamHei / 2;
1460 xv[1] = sBPSuppBracketTotLen - sBPSuppBrktCentHoleX;
1461 yv[1] = yv[0];
1462 xv[2] = sBPSuppBracketTotLen - sBPSuppBracketTailLen;
1463 yv[2] = 0;
1464 xv[3] = sBPSuppBracketTotLen;
1465 yv[3] = yv[2];
1466 xv[4] = xv[3];
1467 yv[4] = sBPSuppBracketTailHei;
1468 xv[5] = xv[2];
1469 yv[5] = yv[4];
1470 xv[6] = xv[1];
1471 yv[6] = -yv[1];
1472 xv[7] = xv[0];
1473 yv[7] = yv[6];
1474 xv[8] = xv[7];
1475 yv[8] = sBPSuppBracketInHei / 2;
1476 xv[9] = sBPSuppBracketInLen;
1477 yv[9] = yv[8];
1478 xv[10] = xv[9];
1479 yv[10] = -yv[9];
1480 xv[11] = xv[0];
1481 yv[11] = yv[10];
1482
1483 zlen = sBPSuppBracketWidth / 2;
1484 TGeoXtru* brktbody = new TGeoXtru(2);
1485 brktbody->DefinePolygon(nv, xv, yv);
1486 brktbody->DefineSection(0, -zlen);
1487 brktbody->DefineSection(1, zlen);
1488 brktbody->SetName("bracketBody");
1489
1490 // The central hole: a Tube
1491 zlen = sBPSuppBracketWidth / 2 + 0.001;
1492 TGeoTube* brktcenthole = new TGeoTube(0, sBPSuppBrktCentHoleD / 2, zlen);
1493 brktcenthole->SetName("bracketCentHole");
1494
1495 xpos = sBPSuppBracketTotLen - sBPSuppBrktCentHoleX;
1496 TGeoTranslation* brktcenthmat = new TGeoTranslation(xpos, -sBPSuppBrktHolesY, 0);
1497 brktcenthmat->SetName("bracketCentHMat");
1498 brktcenthmat->RegisterYourself();
1499
1500 // The lateral hole: a Tube
1501 TGeoTube* brktlathole = new TGeoTube(0, sBPSuppBrktLatHoleD / 2, zlen);
1502 brktlathole->SetName("bracketLatHole");
1503
1504 xpos = sBPSuppBracketTotLen - sBPSuppBrktLatHoleX;
1505 TGeoTranslation* brktlathmat = new TGeoTranslation(xpos, sBPSuppBrktHolesY, 0);
1506 brktlathmat->SetName("bracketLatHMat");
1507 brktlathmat->RegisterYourself();
1508
1509 // Finally create and return the bracket
1510 // (the origin of its reference system is opposite to its tail)
1511 TGeoCompositeShape* bracketShape = new TGeoCompositeShape("bracketBody-bracketCentHole:bracketCentHMat-bracketLatHole:bracketLatHMat");
1512
1513 return bracketShape;
1514}
1515
1516TGeoCompositeShape* V3Cage::createBPSuppClamp()
1517{
1518 //
1519 // Creates the lateral Titanium clamp holding the Beam Pipe Support
1520 // to the ITS Cage (ALIITSUP1060)
1521 //
1522 // Input:
1523 //
1524 // Output:
1525 //
1526 // Return:
1527 // The clamp as a TGeoCompositeShape
1528 //
1529 // Created: 08 Jun 2023 Mario Sitta
1530 //
1531
1532 // Local variables
1533 Double_t xlen, ylen, zlen;
1534 Double_t xpos, ypos;
1535
1536 // The vertical wall: a BBox
1537 xlen = sBPSuppClampLatThick / 2;
1538 ylen = sBPSuppClampTotHei / 2;
1539 zlen = sBPSuppClampTotLen / 2;
1540 TGeoBBox* clampwall = new TGeoBBox(xlen, ylen, zlen);
1541 clampwall->SetName("clampWall");
1542
1543 xpos = -clampwall->GetDX();
1544 ypos = clampwall->GetDY() - sBPSuppClampShelfHei;
1545 TGeoTranslation* clampwallmat = new TGeoTranslation(xpos, ypos, 0);
1546 clampwallmat->SetName("clampWallMat");
1547 clampwallmat->RegisterYourself();
1548
1549 // The horizontal shelf: a BBox
1550 xlen = (sBPSuppClampTotWid - sBPSuppClampLatThick) / 2;
1551 ylen = sBPSuppClampShelfHei / 2;
1552 zlen = sBPSuppClampShelfLen / 2;
1553 TGeoBBox* clampshelf = new TGeoBBox(xlen, ylen, zlen);
1554 clampshelf->SetName("clampShelf");
1555
1556 xpos = clampshelf->GetDX();
1557 ypos = -clampshelf->GetDY();
1558 TGeoTranslation* clampshelfmat = new TGeoTranslation(xpos, ypos, 0);
1559 clampshelfmat->SetName("clampShelfMat");
1560 clampshelfmat->RegisterYourself();
1561
1562 // Finally create and return the clamp
1563 // (the origin of its reference system is at the conjunction
1564 // of the vertical wall with the horizontal shelf)
1565 TGeoCompositeShape* clampShape = new TGeoCompositeShape("clampWall:clampWallMat+clampShelf:clampShelfMat");
1566
1567 return clampShape;
1568}
1569
1570TGeoVolume* V3Cage::createCageClosingCross(const TGeoManager* mgr)
1571{
1572 //
1573 // Creates the Cage Closing Cross (from drawings ALIITSUP0242)
1574 //
1575 // Input:
1576 // mgr : the GeoManager (used only to get the proper material)
1577 //
1578 // Output:
1579 //
1580 // Return:
1581 // The closing cross as a TGeoVolume
1582 //
1583 // Created: 29 May 2023 Mario Sitta
1584 //
1585
1586 // Local variables
1587 const Int_t nv = 8;
1588 Double_t xv[nv], yv[nv];
1589 Double_t xlen, ylen, zlen;
1590 Double_t xpos, ypos;
1591
1592 TString compoShape;
1593
1594 // A single vertical post: a Xtru
1595 xv[0] = 0.;
1596 yv[0] = 0.;
1597 xv[1] = (sCageCrossXWidthTot - sCageCrossXWidthInt) / 2;
1598 yv[1] = yv[0];
1599 xv[2] = xv[1];
1600 yv[2] = (sCageCrossYHeightTot - sCageCrossYHeightInt) / 2;
1601 xv[3] = (sCageCrossXWidthExt - sCageCrossXWidthInt) / 2;
1602 yv[3] = yv[2];
1603 xv[4] = xv[3];
1604 yv[4] = yv[3] + sCageCrossYHeightInt;
1605 xv[5] = xv[2];
1606 yv[5] = yv[4];
1607 xv[6] = xv[5];
1608 yv[6] = sCageCrossYHeightTot;
1609 xv[7] = xv[0];
1610 yv[7] = yv[6];
1611
1612 zlen = sCageCrossZLength / 2;
1613
1614 TGeoXtru* vpost = new TGeoXtru(2);
1615 vpost->SetName("crossvertpost");
1616 vpost->DefinePolygon(nv, xv, yv);
1617 vpost->DefineSection(0, -zlen);
1618 vpost->DefineSection(1, zlen);
1619
1620 // The vertical post matrices
1621 xpos = sCageCrossXWidthInt / 2;
1622 TGeoTranslation* vpostmat1 = new TGeoTranslation("vertpostmat1", xpos, 0, 0);
1623 vpostmat1->RegisterYourself();
1624
1625 TGeoCombiTrans* vpostmat2 = new TGeoCombiTrans(-xpos, 0, 0, new TGeoRotation("", 90, 180, -90));
1626 vpostmat2->SetName("vertpostmat2");
1627 vpostmat2->RegisterYourself();
1628
1629 compoShape = Form("crossvertpost:vertpostmat1+crossvertpost:vertpostmat2");
1630
1631 // A single oblique post: a BBox
1632 Double_t leg = vpost->GetY(4);
1633 xlen = TMath::Sqrt(sCageCrossXWidthInt * sCageCrossXWidthInt + leg * leg) / 2;
1634 ylen = sCageCrossBarThick / 2;
1635 TGeoBBox* xpost = new TGeoBBox("crossoblqpost", xlen, ylen, zlen);
1636
1637 // The oblique post matrices
1638 Double_t phi = sCageCrossBarPhi / 2;
1639 ypos = sCageCrossYHeightTot - sCageCrossYMid;
1640
1641 TGeoCombiTrans* xpostmat1 = new TGeoCombiTrans(0, ypos, 0, new TGeoRotation("", phi, 0, 0));
1642 xpostmat1->SetName("oblqpostmat1");
1643 xpostmat1->RegisterYourself();
1644
1645 TGeoCombiTrans* xpostmat2 = new TGeoCombiTrans(0, ypos, 0, new TGeoRotation("", -phi, 0, 0));
1646 xpostmat2->SetName("oblqpostmat2");
1647 xpostmat2->RegisterYourself();
1648
1649 compoShape += Form("+crossoblqpost:oblqpostmat1+crossoblqpost:oblqpostmat2");
1650
1651 // The actual closing cross shape: a CompositeShape
1652 TGeoCompositeShape* closCrossSh = new TGeoCompositeShape(compoShape);
1653
1654 // We have the shape: now create the real volume
1655 TGeoMedium* medAl = mgr->GetMedium(Form("%s_ALUMINUM$", GetDetName()));
1656
1657 TGeoVolume* closCrossVol = new TGeoVolume("CageClosingCross", closCrossSh, medAl);
1658 closCrossVol->SetFillColor(kGray);
1659 closCrossVol->SetLineColor(kGray);
1660
1661 // Finally return the closing cross volume
1662 return closCrossVol;
1663}
1664
1665void V3Cage::createAndPlaceMFTRailsInsideCage(TGeoVolume* mother, const TGeoManager* mgr)
1666{
1667 //
1668 // Creates the MFT Rails located inside the Cage and place them
1669 //
1670 // Input:
1671 // motmat : the material of the mother volume (for the container box)
1672 // mgr : the GeoManager (used only to get the proper material)
1673 //
1674 // Output:
1675 //
1676 // Return:
1677 //
1678 // Created: 10 May 2025 Mario Sitta
1679 //
1680
1681 // Local variables
1682 Double_t rdist, rpos, xpos, ypos, alpha;
1683 Double_t xbox, ybox;
1684
1685 // Create a pair of rails (a BBox container is returned)
1686 TGeoVolume* cageMFTRails = createMFTRailsPair(mother->GetMedium(), mgr);
1687
1688 // Now compute the radial distance and the XY position of the box
1689 xbox = (static_cast<TGeoBBox*>(cageMFTRails->GetShape()))->GetDX();
1690 ybox = (static_cast<TGeoBBox*>(cageMFTRails->GetShape()))->GetDY();
1691
1692 rdist = TMath::Sqrt(sCageCoverRint * sCageCoverRint - xbox * xbox);
1693 rpos = rdist - ybox;
1694
1695 // Finally place the four pairs of rails inside the mother volume
1696 xpos = rpos * TMath::Sin(sCageEndCapCableCutPhi * TMath::DegToRad());
1697 ypos = rpos * TMath::Cos(sCageEndCapCableCutPhi * TMath::DegToRad()) + sCageYInBarrel;
1698
1699 alpha = -sCageEndCapCableCutPhi + 180;
1700 mother->AddNode(cageMFTRails, 1, new TGeoCombiTrans(xpos, ypos, 0, new TGeoRotation("", alpha, 0, 0)));
1701 alpha = sCageEndCapCableCutPhi + 180;
1702 mother->AddNode(cageMFTRails, 2, new TGeoCombiTrans(-xpos, ypos, 0, new TGeoRotation("", alpha, 0, 0)));
1703
1704 ypos = rpos * TMath::Cos(sCageEndCapCableCutPhi * TMath::DegToRad()) - sCageYInBarrel;
1705
1706 alpha = sCageEndCapCableCutPhi;
1707 mother->AddNode(cageMFTRails, 3, new TGeoCombiTrans(xpos, -ypos, 0, new TGeoRotation("", alpha, 0, 0)));
1708 alpha = -sCageEndCapCableCutPhi;
1709 mother->AddNode(cageMFTRails, 4, new TGeoCombiTrans(-xpos, -ypos, 0, new TGeoRotation("", alpha, 0, 0)));
1710
1711 return;
1712}
1713
1714TGeoVolume* V3Cage::createMFTRailsPair(const TGeoMedium* motmed, const TGeoManager* mgr)
1715{
1716 //
1717 // Creates a pair of MFT Rails located inside the Cage (from drawings
1718 // ALI-MFT-DF-0057 and elements therein)
1719 // A box containing a pair of rails is returned (a physical box
1720 // is preferred over an Assembly for better performance)
1721 //
1722 // Input:
1723 // motmat : the material of the mother volume (for the container box)
1724 // mgr : the GeoManager (used only to get the proper material)
1725 //
1726 // Output:
1727 //
1728 // Return:
1729 // A rail pair as a TGeoVolume
1730 //
1731 // Created: 10 May 2025 Mario Sitta
1732 //
1733
1734 // Local variables
1735 const Int_t nv = 16;
1736 Double_t xv[nv], yv[nv];
1737 Double_t deltah, xlen, ylen, zlen;
1738 Double_t xpos, ypos;
1739
1740 // The shape of a single rail: a Xtru
1741 xv[0] = sCageMFTRailBaseWidth / 2;
1742 yv[0] = 0.;
1743 xv[1] = xv[0];
1744 yv[1] = sCageMFTRailTotHeight - sCageMFTRailExtHeight;
1745 xv[2] = sCageMFTRailTotWidth / 2;
1746 yv[2] = yv[1];
1747 xv[3] = xv[2];
1748 yv[3] = sCageMFTRailTotHeight;
1749 xv[4] = sCageMFTRailIntWidth / 2;
1750 yv[4] = yv[3];
1751 deltah = (sCageMFTRailExtHeight - sCageMFTRailIntHeight) / 2;
1752 xv[5] = xv[4];
1753 yv[5] = yv[4] - deltah;
1754 xv[6] = sCageMFTRailExtWidth / 2;
1755 yv[6] = yv[5];
1756 xv[7] = xv[6];
1757 yv[7] = yv[6] - sCageMFTRailIntHeight;
1758
1759 for (Int_t i = 8; i < nv; i++) {
1760 xv[i] = -xv[15 - i];
1761 yv[i] = yv[15 - i];
1762 }
1763
1764 zlen = sCageMFTRailZLen / 2;
1765
1766 TGeoXtru* mftRailSh = new TGeoXtru(2);
1767 mftRailSh->SetName("mftrailshape");
1768 mftRailSh->DefinePolygon(nv, xv, yv);
1769 mftRailSh->DefineSection(0, -zlen);
1770 mftRailSh->DefineSection(1, zlen);
1771
1772 // The air container: a BBox
1773 xlen = 2 * sCageMFTRailTotWidth + sCageMFTRailsXDist;
1774 ylen = sCageMFTRailTotHeight / 2;
1775 zlen = sCageMFTRailZLen / 2;
1776 TGeoBBox* mftRailBoxSh = new TGeoBBox(xlen / 2, ylen, zlen);
1777
1778 // We have the shape: now create the real volume
1779 TGeoMedium* medAl = mgr->GetMedium(Form("%s_ALUMINUM$", GetDetName()));
1780
1781 TGeoVolume* mftRailVol = new TGeoVolume("MFTRailInsideCage", mftRailSh, medAl);
1782 mftRailVol->SetFillColor(kGray);
1783 mftRailVol->SetLineColor(kGray);
1784
1785 TGeoVolume* mftRailBoxVol = new TGeoVolume("MFTRailPairInsideCage", mftRailBoxSh, motmed);
1786
1787 // Put the two rails inside the holding box
1788 // (rail Y origin is on its lower face)
1789 xpos = mftRailBoxSh->GetDX() - 0.5 * sCageMFTRailTotWidth;
1790 ypos = mftRailBoxSh->GetDY();
1791 mftRailBoxVol->AddNode(mftRailVol, 1, new TGeoTranslation(xpos, -ypos, 0));
1792 mftRailBoxVol->AddNode(mftRailVol, 2, new TGeoTranslation(-xpos, -ypos, 0));
1793
1794 // Finally return the rails volume
1795 return mftRailBoxVol;
1796}
int32_t i
int16_t Color_t
Definition GPUQA.h:32
uint8_t leg
Definition of the GeometryTGeo class.
uint32_t j
Definition RawData.h:0
Definition of the V11Geometry class.
ClassImp(V3Cage)
Definition of the V3Cage class.
const char * GetDetName() const
Get detector name.
Definition V11Geometry.h:58
This class defines the Geometry for the Cage of the ITS Upgrade using TGeo.
Definition V3Cage.h:38
~V3Cage() override
Default destructor.
void createAndPlaceCage(TGeoVolume *mother, const TGeoManager *mgr=gGeoManager)
Definition V3Cage.cxx:194
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
GLuint index
Definition glcorearb.h:781
GLuint const GLchar * name
Definition glcorearb.h:781