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