Project
Loading...
Searching...
No Matches
V3Layer.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
16
21
22#include <fairlogger/Logger.h> // for LOG
23
24#include <TGeoArb8.h> // for TGeoArb8
25#include <TGeoBBox.h> // for TGeoBBox
26#include <TGeoCone.h> // for TGeoConeSeg, TGeoCone
27#include <TGeoPcon.h> // for TGeoPcon
28#include <TGeoManager.h> // for TGeoManager, gGeoManager
29#include <TGeoMatrix.h> // for TGeoCombiTrans, TGeoRotation, etc
30#include <TGeoTrd1.h> // for TGeoTrd1
31#include <TGeoTube.h> // for TGeoTube, TGeoTubeSeg
32#include <TGeoVolume.h> // for TGeoVolume, TGeoVolumeAssembly
33#include <TGeoXtru.h> // for TGeoXtru
34#include <TGeoCompositeShape.h> // for TGeoCompositeShape
35#include "TMathBase.h" // for Abs
36#include <TMath.h> // for Sin, RadToDeg, DegToRad, Cos, Tan, etc
37
38#include <cstdio> // for snprintf
39
40class TGeoMedium;
41
42using namespace TMath;
43using namespace o2::its;
44using namespace o2::itsmft;
46
47// General Parameters
48const Int_t V3Layer::sNumberOfInnerLayers = 3;
49
50// Inner Barrel Parameters
51const Int_t V3Layer::sIBChipsPerRow = 9;
52const Int_t V3Layer::sIBNChipRows = 1;
53const Double_t V3Layer::sIBChipZGap = 150.0 * sMicron;
54
55const Double_t V3Layer::sIBModuleZLength = 27.12 * sCm;
56const Double_t V3Layer::sIBFPCWiderXPlus = 950.0 * sMicron;
57const Double_t V3Layer::sIBFPCWiderXNeg = 400.0 * sMicron;
58const Double_t V3Layer::sIBFlexCableAlThick = 25.0 * sMicron;
59const Double_t V3Layer::sIBFPCAlGNDWidth = (4.1 + 11.15) * sMm;
60const Double_t V3Layer::sIBFPCAlAnodeWidth1 = 13.0 * sMm;
61const Double_t V3Layer::sIBFPCAlAnodeWidth2 = 14.7 * sMm;
62const Double_t V3Layer::sIBFlexCableKapThick = 75.0 * sMicron;
63const Double_t V3Layer::sIBFlexCablePolyThick = 20.0 * sMicron;
64const Double_t V3Layer::sIBFlexCapacitor1XWid = 0.5 * sMm;
65const Double_t V3Layer::sIBFlexCapacitor1YHi = 0.5 * sMm;
66const Double_t V3Layer::sIBFlexCapacitor1ZLen = 1.0 * sMm;
67const Double_t V3Layer::sIBFlexCapacitor22XWid = 0.7 * sMm;
68const Double_t V3Layer::sIBFlexCapacitor22YHi = 0.6 * sMm;
69const Double_t V3Layer::sIBFlexCapacitor22ZLen = 1.1 * sMm;
70const Double_t V3Layer::sIBFlexResistorXWid = 0.2 * sMm;
71const Double_t V3Layer::sIBFlexResistorYHi = 0.2 * sMm;
72const Double_t V3Layer::sIBFlexResistorZLen = 0.4 * sMm;
73const Double_t V3Layer::sIBColdPlateWidth = 15.4 * sMm;
74const Double_t V3Layer::sIBColdPlateZLen = 290.0 * sMm;
75const Double_t V3Layer::sIBGlueThick = 50.0 * sMicron;
76const Double_t V3Layer::sIBCarbonFleeceThick = 20.0 * sMicron;
77const Double_t V3Layer::sIBCarbonPaperThick = 30.0 * sMicron;
78const Double_t V3Layer::sIBCarbonPaperWidth = 12.5 * sMm;
79const Double_t V3Layer::sIBCarbonPaperZLen = 280.0 * sMm;
80const Double_t V3Layer::sIBK13D2UThick = 70.0 * sMicron;
81const Double_t V3Layer::sIBCoolPipeInnerD = 1.024 * sMm;
82const Double_t V3Layer::sIBCoolPipeThick = 25.4 * sMicron;
83const Double_t V3Layer::sIBCoolPipeXDist = 5.0 * sMm;
84const Double_t V3Layer::sIBCoolPipeZLen = 302.0 * sMm;
85const Double_t V3Layer::sIBTopVertexWidth1 = 0.258 * sMm;
86const Double_t V3Layer::sIBTopVertexWidth2 = 0.072 * sCm;
87const Double_t V3Layer::sIBTopVertexHeight = 0.04 * sCm;
88const Double_t V3Layer::sIBTopVertexAngle = 60.0; // Deg
89const Double_t V3Layer::sIBSideVertexWidth = 0.05 * sCm;
90const Double_t V3Layer::sIBSideVertexHeight = 0.074 * sCm;
91const Double_t V3Layer::sIBTopFilamentSide = 0.04 * sCm;
92const Double_t V3Layer::sIBTopFilamentAlpha = 109.8; // Deg
93const Double_t V3Layer::sIBTopFilamentInterZ = 15.0 * sMm;
94const Double_t V3Layer::sIBEndSupportThick = 0.149 * sMm;
95const Double_t V3Layer::sIBEndSupportZLen = 2.5 * sMm;
96const Double_t V3Layer::sIBEndSupportXUp = 1.0 * sMm;
97const Double_t V3Layer::sIBEndSupportOpenPhi = 120.0; // Deg
98
99const Double_t V3Layer::sIBConnectorXWidth = 10.0 * sMm;
100const Double_t V3Layer::sIBConnectorYTot = 4.7 * sMm;
101const Double_t V3Layer::sIBConnectBlockZLen = 16.5 * sMm;
102const Double_t V3Layer::sIBConnBodyYHeight = 2.5 * sMm;
103const Double_t V3Layer::sIBConnTailYShift = 0.9 * sMm;
104const Double_t V3Layer::sIBConnTailYMid = 2.5 * sMm;
105const Double_t V3Layer::sIBConnTailZLen = 2.5 * sMm;
106const Double_t V3Layer::sIBConnTailOpenPhi = 120.0; // Deg
107const Double_t V3Layer::sIBConnRoundHoleD = 2.0 * sMm;
108const Double_t V3Layer::sIBConnRoundHoleZ = (9.0 - 4.0) * sMm;
109const Double_t V3Layer::sIBConnSquareHoleX = 2.0 * sMm;
110const Double_t V3Layer::sIBConnSquareHoleZ = 2.8 * sMm;
111const Double_t V3Layer::sIBConnSquareHoleZPos = 9.0 * sMm;
112const Double_t V3Layer::sIBConnInsertHoleD = 2.0 * sMm;
113const Double_t V3Layer::sIBConnInsertHoleZPos = 9.0 * sMm;
114const Double_t V3Layer::sIBConnTubeHole1D = 1.6 * sMm;
115const Double_t V3Layer::sIBConnTubeHole1ZLen = 3.0 * sMm;
116const Double_t V3Layer::sIBConnTubeHole1ZLen2 = 2.7 * sMm;
117const Double_t V3Layer::sIBConnTubeHole2D = 1.2 * sMm;
118const Double_t V3Layer::sIBConnTubeHole3XPos = 1.0 * sMm;
119const Double_t V3Layer::sIBConnTubeHole3ZPos = 14.5 * sMm;
120const Double_t V3Layer::sIBConnTubesXDist = 5.0 * sMm;
121const Double_t V3Layer::sIBConnTubesYPos = 1.25 * sMm;
122const Double_t V3Layer::sIBConnInsertD = 2.0 * sMm;
123const Double_t V3Layer::sIBConnInsertHeight = 2.3 * sMm;
124const Double_t V3Layer::sIBConnSideHole1D = 1.0 * sMm;
125const Double_t V3Layer::sIBConnSideHole1YPos = 1.25 * sMm;
126const Double_t V3Layer::sIBConnSideHole1ZPos = 11.5 * sMm;
127const Double_t V3Layer::sIBConnSideHole1XWid = 1.0 * sMm;
128const Double_t V3Layer::sIBConnSideHole2YPos = 1.25 * sMm;
129const Double_t V3Layer::sIBConnSideHole2ZPos = 11.0 * sMm;
130const Double_t V3Layer::sIBConnSideHole2XWid = 1.0 * sMm;
131const Double_t V3Layer::sIBConnSideHole2YWid = 1.0 * sMm;
132const Double_t V3Layer::sIBConnSideHole2ZWid = 1.0 * sMm;
133const Double_t V3Layer::sIBConnectAFitExtD = 1.65 * sMm;
134const Double_t V3Layer::sIBConnectAFitIntD = 1.19 * sMm;
135const Double_t V3Layer::sIBConnectAFitZLen = 12.5 * sMm;
136const Double_t V3Layer::sIBConnectAFitZOut = 10.0 * sMm;
137const Double_t V3Layer::sIBConnPlugInnerD = 0.8 * sMm;
138const Double_t V3Layer::sIBConnPlugTotLen = 1.7 * sMm;
139const Double_t V3Layer::sIBConnPlugInnerLen = 1.0 * sMm;
140
141const Double_t V3Layer::sIBStaveHeight = 0.5 * sCm;
142
143// Outer Barrel Parameters
144const Int_t V3Layer::sOBChipsPerRow = 7;
145const Int_t V3Layer::sOBNChipRows = 2;
146
147const Double_t V3Layer::sOBChipThickness = 100.0 * sMicron;
148
149const Double_t V3Layer::sOBHalfStaveWidth = 3.01 * sCm;
150const Double_t V3Layer::sOBModuleGap = 200.0 * sMicron;
151const Double_t V3Layer::sOBChipXGap = 150.0 * sMicron;
152const Double_t V3Layer::sOBChipZGap = 150.0 * sMicron;
153const Double_t V3Layer::sOBFlexCableXWidth = 3.3 * sCm;
154const Double_t V3Layer::sOBFlexCableAlThick = 0.005 * sCm;
155const Double_t V3Layer::sOBFlexCableKapThick = 75.0 * sMicron;
156const Double_t V3Layer::sOBFPCSoldMaskThick = 30.0 * sMicron;
157const Double_t V3Layer::sOBFPCCopperThick = 18.0 * sMicron;
158const Double_t V3Layer::sOBFPCCuAreaFracGnd = 0.954; // F.Benotto
159const Double_t V3Layer::sOBFPCCuAreaFracSig = 0.617; // F.Benotto
160const Double_t V3Layer::sOBFPCCapacitorXWid = 0.5 * sMm;
161const Double_t V3Layer::sOBFPCCapacitorYHi = 0.5 * sMm;
162const Double_t V3Layer::sOBFPCCapacitorZLen = 1.0 * sMm;
163const Double_t V3Layer::sOBGlueFPCThick = 50 * sMicron;
164const Double_t V3Layer::sOBGlueColdPlThick = 80 * sMicron;
165const Double_t V3Layer::sOBPowerBusXWidth = 3.04 * sCm;
166const Double_t V3Layer::sOBPowerBusAlThick = 100.0 * sMicron;
167const Double_t V3Layer::sOBPowerBusAlFrac = 0.90; // L.Greiner
168const Double_t V3Layer::sOBPowerBusDielThick = 50.0 * sMicron;
169const Double_t V3Layer::sOBPowerBusKapThick = 27.5 * sMicron;
170const Double_t V3Layer::sOBBiasBusXWidth = 7.7 * sMm;
171const Double_t V3Layer::sOBBiasBusAlThick = 25.0 * sMicron;
172const Double_t V3Layer::sOBBiasBusAlFrac = 0.90; // L.Greiner
173const Double_t V3Layer::sOBBiasBusDielThick = 50.0 * sMicron;
174const Double_t V3Layer::sOBBiasBusKapThick = 25.0 * sMicron;
175const Double_t V3Layer::sOBColdPlateXWidth = 3.04 * sCm;
176const Double_t V3Layer::sOBColdPlateZLenML = 87.55 * sCm;
177const Double_t V3Layer::sOBColdPlateZLenOL = 150.15 * sCm;
178const Double_t V3Layer::sOBColdPlateThick = 0.012 * sCm;
179const Double_t V3Layer::sOBHalfStaveYPos = 2.067 * sCm;
180const Double_t V3Layer::sOBHalfStaveYTrans = 3.6 * sMm;
181const Double_t V3Layer::sOBHalfStaveXOverlap = 7.2 * sMm;
182const Double_t V3Layer::sOBGraphiteFoilThick = 30.0 * sMicron;
183const Double_t V3Layer::sOBCarbonFleeceThick = 20.0 * sMicron;
184const Double_t V3Layer::sOBCoolTubeInnerD = 2.05 * sMm;
185const Double_t V3Layer::sOBCoolTubeThick = 32.0 * sMicron;
186const Double_t V3Layer::sOBCoolTubeXDist = 10.0 * sMm;
187
188const Double_t V3Layer::sOBCPConnectorXWidth = 16.0 * sMm;
189const Double_t V3Layer::sOBCPConnBlockZLen = 15.0 * sMm;
190const Double_t V3Layer::sOBCPConnBlockYHei = 3.6 * sMm;
191const Double_t V3Layer::sOBCPConnHollowZLen = 3.0 * sMm;
192const Double_t V3Layer::sOBCPConnHollowYHei = 0.9 * sMm;
193const Double_t V3Layer::sOBCPConnSquareHoleX = 4.0 * sMm;
194const Double_t V3Layer::sOBCPConnSquareHoleZ = 5.0 * sMm;
195const Double_t V3Layer::sOBCPConnSqrHoleZPos = 4.0 * sMm;
196const Double_t V3Layer::sOBCPConnSqrInsertRZ = 3.5 * sMm;
197const Double_t V3Layer::sOBCPConnRoundHoleD = 4.0 * sMm;
198const Double_t V3Layer::sOBCPConnRndHoleZPos = 7.0 * sMm;
199const Double_t V3Layer::sOBCPConnTubesXDist = 10.0 * sMm;
200const Double_t V3Layer::sOBCPConnTubesYPos = 1.8 * sMm;
201const Double_t V3Layer::sOBCPConnTubeHole1D = 2.6 * sMm;
202const Double_t V3Layer::sOBCPConnTubeHole1Z = 3.5 * sMm;
203const Double_t V3Layer::sOBCPConnTubeHole2D = 2.2 * sMm;
204const Double_t V3Layer::sOBCPConnFitHoleD = 2.8 * sMm;
205const Double_t V3Layer::sOBCPConnTubeHole3XP = 1.0 * sMm;
206const Double_t V3Layer::sOBCPConnTubeHole3ZP = 2.0 * sMm;
207const Double_t V3Layer::sOBCPConnInstZThick = 1.0 * sMm;
208const Double_t V3Layer::sOBCPConnInsertYHei = 3.4 * sMm;
209const Double_t V3Layer::sOBCPConnAFitExtD = 2.8 * sMm;
210const Double_t V3Layer::sOBCPConnAFitThick = 0.3 * sMm;
211const Double_t V3Layer::sOBCPConnAFitZLen = 17.0 * sMm;
212const Double_t V3Layer::sOBCPConnAFitZIn = 3.0 * sMm;
213const Double_t V3Layer::sOBCPConnPlugInnerD = 0.8 * sMm;
214const Double_t V3Layer::sOBCPConnPlugTotLen = 1.7 * sMm;
215const Double_t V3Layer::sOBCPConnPlugThick = 0.5 * sMm;
216
217const Double_t V3Layer::sOBSpaceFrameZLen[2] = {900.0 * sMm, 1526.0 * sMm};
218const Int_t V3Layer::sOBSpaceFrameNUnits[2] = {23, 39};
219const Double_t V3Layer::sOBSpaceFrameUnitLen = 39.1 * sMm;
220const Double_t V3Layer::sOBSpaceFrameWidth = 42.44 * sMm;
221const Double_t V3Layer::sOBSpaceFrameHeight = 36.45 * sMm;
222const Double_t V3Layer::sOBSpaceFrameTopVL = 4.0 * sMm;
223const Double_t V3Layer::sOBSpaceFrameTopVH = 0.35 * sMm;
224const Double_t V3Layer::sOBSpaceFrameSideVL = 4.5 * sMm;
225const Double_t V3Layer::sOBSpaceFrameSideVH = 0.35 * sMm;
226const Double_t V3Layer::sOBSpaceFrameVAlpha = 60.0; // deg
227const Double_t V3Layer::sOBSpaceFrameVBeta = 68.0; // deg
228const Double_t V3Layer::sOBSFrameBaseRibDiam = 1.33 * sMm;
229const Double_t V3Layer::sOBSFrameBaseRibPhi = 54.0; // deg
230const Double_t V3Layer::sOBSFrameSideRibDiam = 1.25 * sMm;
231const Double_t V3Layer::sOBSFrameSideRibPhi = 70.0; // deg
232const Double_t V3Layer::sOBSFrameULegLen = 14.2 * sMm;
233const Double_t V3Layer::sOBSFrameULegWidth = 1.5 * sMm;
234const Double_t V3Layer::sOBSFrameULegHeight1 = 6.3 * sMm;
235const Double_t V3Layer::sOBSFrameULegHeight2 = 2.7 * sMm;
236const Double_t V3Layer::sOBSFrameULegThick = 0.3 * sMm;
237const Double_t V3Layer::sOBSFrameULegXPos = 12.9 * sMm;
238const Double_t V3Layer::sOBSFrameConnWidth = 42.0 * sMm;
239const Double_t V3Layer::sOBSFrameConnTotLen = 29.0 * sMm;
240const Double_t V3Layer::sOBSFrameConnTotHei = 4.8 * sMm;
241const Double_t V3Layer::sOBSFrameConnTopLen = 14.0 * sMm;
242const Double_t V3Layer::sOBSFrameConnInsWide = 36.869 * sMm;
243const Double_t V3Layer::sOBSFrameConnInsBase = 39.6 * sMm;
244const Double_t V3Layer::sOBSFrameConnInsHei = 2.8 * sMm;
245const Double_t V3Layer::sOBSFrameConnHoleZPos = 7.0 * sMm;
246const Double_t V3Layer::sOBSFrameConnHoleZDist = 15.0 * sMm;
247const Double_t V3Layer::sOBSFrameConnTopHoleD = 3.0 * sMm;
248const Double_t V3Layer::sOBSFrConnTopHoleXDist = 24.0 * sMm;
249const Double_t V3Layer::sOBSFrameConnAHoleWid = 4.0 * sMm;
250const Double_t V3Layer::sOBSFrameConnAHoleLen = 5.0 * sMm;
251const Double_t V3Layer::sOBSFrConnASideHoleD = 3.0 * sMm;
252const Double_t V3Layer::sOBSFrConnASideHoleL = 2.5 * sMm;
253const Double_t V3Layer::sOBSFrConnASideHoleY = 2.3 * sMm;
254const Double_t V3Layer::sOBSFrameConnCHoleZPos = 3.0 * sMm;
255const Double_t V3Layer::sOBSFrConnCHoleXDist = 32.0 * sMm;
256const Double_t V3Layer::sOBSFrConnCTopHoleD = 4.0 * sMm;
257const Double_t V3Layer::sOBSFrameConnInsHoleD = 5.0 * sMm;
258const Double_t V3Layer::sOBSFrameConnInsHoleX = 25.8 * sMm;
259
261
262#define SQ(A) (A) * (A)
263
265 : V11Geometry(0, "ITS"),
266 mLayerNumber(0),
267 mPhi0(0),
268 mLayerRadius(0),
269 mSensorThickness(0),
270 mChipThickness(0),
271 mStaveWidth(0),
272 mStaveTilt(0),
273 mNumberOfStaves(0),
274 mNumberOfModules(0),
275 mNumberOfChips(0),
276 mChipTypeID(0),
277 mIsTurbo(0),
278 mBuildLevel(0),
279 mStaveModel(kIBModelDummy),
280 mIBModuleZLength(0),
281 mOBModuleZLength(0)
282{
283 for (int i = kNHLevels; i--;) {
284 mHierarchy[i] = 0;
285 }
286}
287
288V3Layer::V3Layer(Int_t lay, Bool_t turbo, Int_t debug, const char* name)
290 mLayerNumber(lay),
291 mPhi0(0),
292 mLayerRadius(0),
293 mSensorThickness(0),
294 mChipThickness(0),
295 mStaveWidth(0),
296 mStaveTilt(0),
297 mNumberOfStaves(0),
298 mNumberOfModules(0),
299 mNumberOfChips(0),
300 mChipTypeID(0),
301 mIsTurbo(turbo),
302 mBuildLevel(0),
303 mStaveModel(kIBModelDummy),
304 mIBModuleZLength(0),
305 mOBModuleZLength(0)
306{
307 for (int i = kNHLevels; i--;) {
308 mHierarchy[i] = 0;
309 }
310}
311
312V3Layer::~V3Layer() = default;
313
314void V3Layer::createLayer(TGeoVolume* motherVolume)
315{
316 std::string volumeName;
317
318 volumeName = fmt::format("{:s}{:d}", GeometryTGeo::getITSLayerPattern(), mLayerNumber);
319 TGeoVolume* layerVolume = new TGeoVolumeAssembly(volumeName.c_str());
320
321 // Call for creation of a single Half Barrel
322 // and put two copies in the Layer volume
323 TGeoVolume* halfBarrel;
324
325 // If a Turbo layer is requested, do it
326 if (mIsTurbo) {
327 halfBarrel = createHalfBarrelTurbo();
328 } else {
329 halfBarrel = createHalfBarrel();
330 }
331
332 layerVolume->AddNode(halfBarrel, 0, nullptr);
333 layerVolume->AddNode(halfBarrel, 1, new TGeoRotation("", 180, 0, 0));
334 mHierarchy[kHalfBarrel] = 2;
335
336 // Finally put everything in the mother volume
337 motherVolume->AddNode(layerVolume, 1, nullptr);
338
339 // geometry is served
340 return;
341}
342
343TGeoVolume* V3Layer::createHalfBarrel()
344{
345 const Int_t nameLen = 30;
346 char volumeName[nameLen];
347 Double_t xpos, ypos, zpos;
348 Double_t alpha;
349
350 // Check if the user set the proper parameters
351 if (mLayerRadius <= 0) {
352 LOG(fatal) << "Wrong layer radius " << mLayerRadius;
353 }
354
355 if (mNumberOfStaves <= 0) {
356 LOG(fatal) << "Wrong number of staves " << mNumberOfStaves;
357 }
358
359 if (mNumberOfChips <= 0) {
360 LOG(fatal) << "Wrong number of chips " << mNumberOfChips;
361 }
362
363 if (mLayerNumber >= sNumberOfInnerLayers && mNumberOfModules <= 0) {
364 LOG(fatal) << "Wrong number of modules " << mNumberOfModules;
365 }
366
367 if (mChipThickness <= 0) {
368 LOG(fatal) << "Chip thickness wrong or not set " << mChipThickness;
369 }
370
371 if (mSensorThickness <= 0) {
372 LOG(fatal) << "Sensor thickness wrong or not set " << mSensorThickness;
373 }
374
375 if (mSensorThickness > mChipThickness) {
376 LOG(fatal) << "Sensor thickness " << mSensorThickness << " is greater than chip thickness " << mChipThickness;
377 }
378
379 // First create the stave container
380 alpha = (360. / (2 * mNumberOfStaves)) * DegToRad();
381
382 // mStaveWidth = mLayerRadius*Tan(alpha);
383
384 snprintf(volumeName, nameLen, "%s%d", GeometryTGeo::getITSHalfBarrelPattern(), mLayerNumber);
385 TGeoVolume* halfBarrelVolume = new TGeoVolumeAssembly(volumeName);
386 halfBarrelVolume->SetUniqueID(mChipTypeID);
387
388 // halfBarrelVolume->SetVisibility(kFALSE);
389 halfBarrelVolume->SetVisibility(kTRUE);
390 halfBarrelVolume->SetLineColor(1);
391
392 TGeoVolume* stavVol = createStave();
393
394 // Now build up the layer
395 alpha = 360. / mNumberOfStaves;
396 Double_t r = mLayerRadius + (static_cast<TGeoBBox*>(stavVol->GetShape()))->GetDY();
397 mHierarchy[kStave] = 0;
398 for (Int_t j = 0; j < mNumberOfStaves / 2; j++) {
399 Double_t phi = j * alpha + mPhi0;
400 xpos = r * cosD(phi); // r*sinD(-phi);
401 ypos = r * sinD(phi); // r*cosD(-phi);
402 zpos = 0.;
403 phi += 90;
404 halfBarrelVolume->AddNode(stavVol, j, new TGeoCombiTrans(xpos, ypos, zpos, new TGeoRotation("", phi, 0, 0)));
405 mHierarchy[kStave]++;
406 }
407
408 // geometry is served
409 return halfBarrelVolume;
410}
411
412TGeoVolume* V3Layer::createHalfBarrelTurbo()
413{
414 const Int_t nameLen = 30;
415 char volumeName[nameLen];
416 Double_t xpos, ypos, zpos;
417 Double_t alpha;
418
419 // Check if the user set the proper (remaining) parameters
420 if (mStaveWidth <= 0) {
421 LOG(fatal) << "Wrong stave width " << mStaveWidth;
422 }
423
424 if (Abs(mStaveTilt) > 45) {
425 LOG(warning) << "Stave tilt angle (" << mStaveTilt << ") greater than 45deg";
426 }
427
428 snprintf(volumeName, nameLen, "%s%d", GeometryTGeo::getITSHalfBarrelPattern(), mLayerNumber);
429 TGeoVolume* halfBarrelVolume = new TGeoVolumeAssembly(volumeName);
430 halfBarrelVolume->SetUniqueID(mChipTypeID);
431 halfBarrelVolume->SetVisibility(kTRUE);
432 halfBarrelVolume->SetLineColor(1);
433 TGeoVolume* stavVol = createStave();
434
435 // Now build up the layer
436 alpha = 360. / mNumberOfStaves;
437 Double_t r = mLayerRadius /* +chip thick ?! */;
438 mHierarchy[kStave] = 0;
439 for (Int_t j = 0; j < mNumberOfStaves / 2; j++) {
440 Double_t phi = j * alpha + mPhi0;
441 xpos = r * cosD(phi); // r*sinD(-phi);
442 ypos = r * sinD(phi); // r*cosD(-phi);
443 zpos = 0.;
444 phi += 90;
445 halfBarrelVolume->AddNode(stavVol, j,
446 new TGeoCombiTrans(xpos, ypos, zpos, new TGeoRotation("", phi - mStaveTilt, 0, 0)));
447 mHierarchy[kStave]++;
448 }
449
450 return halfBarrelVolume;
451}
452
453TGeoVolume* V3Layer::createStave(const TGeoManager* /*mgr*/)
454{
455 //
456 // Creates the actual Stave
457 //
458 // Input:
459 // mgr : the GeoManager (used only to get the proper material)
460 //
461 // Output:
462 //
463 // Return:
464 //
465 // Created: 22 Jun 2011 Mario Sitta
466 // Updated: 18 Dec 2013 Mario Sitta Handle IB and OB
467 // Updated: 12 Jan 2015 Mario Sitta Fix overlap with new OB space frame
468 // (by moving the latter, not the sensors to avoid
469 // spoiling their position in space)
470 // Updated: 03 Mar 2015 Mario Sitta Fix chip position
471 // Updated: 16 Mar 2017 Mario Sitta AliceO2 version
472 // Updated: 10 Jan 2018 Mario Sitta Compute all dimensions using
473 // AlpideChip as basis
474 // Updated: 10 Mar 2021 Mario Sitta Get rid of fake IB HS and Module
475 //
476
477 const Int_t nameLen = 30;
478 char volumeName[nameLen];
479
480 Double_t xpos, ypos, ymod;
481
482 // The stave
483 snprintf(volumeName, nameLen, "%s%d", GeometryTGeo::getITSStavePattern(), mLayerNumber);
484 TGeoVolume* staveVol = new TGeoVolumeAssembly(volumeName);
485 staveVol->SetVisibility(kTRUE);
486 staveVol->SetLineColor(2);
487
488 TGeoVolume* mechStaveVol = nullptr;
489
490 // Now build up the stave
491 if (mLayerNumber < sNumberOfInnerLayers) {
492 ymod = createStaveInnerB(staveVol);
493 ypos = ymod - mChipThickness; // = 0 if not kIBModel4
494 mHierarchy[kHalfStave] = 0;
495 mHierarchy[kModule] = 0;
496
497 // Mechanical stave structure
498 mechStaveVol = createStaveStructInnerB();
499 if (mechStaveVol) {
500 ypos = ymod - ypos;
501 if (mStaveModel != kIBModel4) {
502 ypos += (static_cast<TGeoBBox*>(mechStaveVol->GetShape()))->GetDY();
503 }
504 staveVol->AddNode(mechStaveVol, 1, new TGeoCombiTrans(0, -ypos, 0, new TGeoRotation("", 0, 0, 180)));
505 }
506 } else {
507 TGeoVolume* hstaveVol = createStaveOuterB();
508 if (mStaveModel == kOBModel0) { // Create simplified stave struct as in v0
509 staveVol->AddNode(hstaveVol, 0);
510 mHierarchy[kHalfStave] = 1;
511 } else { // (if mStaveModel) Create new stave struct as in TDR
512 xpos = (static_cast<TGeoBBox*>(hstaveVol->GetShape()))->GetDX() - sOBHalfStaveXOverlap / 2;
513 // ypos is now a parameter to avoid HS displacement wrt nominal radii
514 ypos = sOBHalfStaveYPos;
515 staveVol->AddNode(hstaveVol, 0, new TGeoTranslation(-xpos, ypos + sOBHalfStaveYTrans, 0));
516 staveVol->AddNode(hstaveVol, 1, new TGeoTranslation(xpos, ypos, 0));
517 mHierarchy[kHalfStave] = 2; // RS
518 mechStaveVol = createSpaceFrameOuterB();
519
520 if (mechStaveVol) {
521 if (mBuildLevel < 6) { // Carbon
522 staveVol->AddNode(mechStaveVol, 1,
523 new TGeoCombiTrans(0, -sOBSFrameULegHeight2, 0, new TGeoRotation("", 180, 0, 0)));
524 }
525 }
526 }
527 }
528
529 staveVol->GetShape()->ComputeBBox(); // RS: enfore recompting of BBox
530
531 // Done, return the stave
532 return staveVol;
533}
534
535Double_t V3Layer::createStaveInnerB(TGeoVolume* mother, const TGeoManager* mgr)
536{
537 Double_t xtot, ytot, ztot, xchip, zchip, ymod;
538 Double_t xpos, ypos, zpos;
539 Bool_t dummyChip;
540 const Int_t nameLen = 30;
541 char chipName[nameLen], sensName[nameLen], volumeName[nameLen];
542
543 // For material budget studies
544 if (mBuildLevel < 6) {
545 dummyChip = kFALSE; // will be made of Si
546 } else {
547 dummyChip = kTRUE; // will be made of Air
548 }
549
550 // First create the single chip
551 snprintf(chipName, nameLen, "%s%d", GeometryTGeo::getITSChipPattern(), mLayerNumber);
552 snprintf(sensName, nameLen, "%s%d", GeometryTGeo::getITSSensorPattern(), mLayerNumber);
553
554 ymod = 0.5 * mChipThickness;
555
556 TGeoVolume* chipVol = AlpideChip::createChip(ymod, mSensorThickness / 2, chipName, sensName, dummyChip);
557
558 xchip = (static_cast<TGeoBBox*>(chipVol->GetShape()))->GetDX();
559 zchip = (static_cast<TGeoBBox*>(chipVol->GetShape()))->GetDZ();
560
561 mIBModuleZLength = 2 * zchip * sIBChipsPerRow + (sIBChipsPerRow - 1) * sIBChipZGap;
562
563 xtot = xchip + (sIBFPCWiderXPlus + sIBFPCWiderXNeg) / 2;
564 ztot = mIBModuleZLength / 2;
565
566 // Then create all other elements (glue and FPC)
567 TGeoVolume* ibModule = createModuleInnerB(xchip, zchip);
568
569 // Build up the stave
570 // Chips are rotated by 180deg around Y axis
571 // in order to have the correct X and Z axis orientation
572 ypos = ymod - mChipThickness;
573
574 for (Int_t j = 0; j < sIBChipsPerRow; j++) {
575 zpos = ztot - j * (2 * zchip + sIBChipZGap) - zchip;
576 mother->AddNode(chipVol, j, new TGeoCombiTrans(0, ypos, zpos, new TGeoRotation("", 0, 180, 180)));
577 mHierarchy[kChip]++;
578 }
579 ytot = ymod;
580
581 // Place the FPC and glue
582 if (mStaveModel == kIBModel4) {
583 Double_t yvol = (static_cast<TGeoBBox*>(ibModule->GetShape()))->GetDY();
584 xpos = 0.5 * (xtot - xchip);
585 ypos += (ymod + yvol);
586 mother->AddNode(ibModule, 1, new TGeoTranslation(xpos, ypos, 0));
587 ytot += yvol;
588 }
589
590 // Done, return the total thickness (used to properly place the services)
591 return ytot;
592}
593
594TGeoVolume* V3Layer::createModuleInnerB(const Double_t xchip, const Double_t zchip, const TGeoManager* mgr)
595{
596 //
597 // Creates the FPC and glue volumes
598 // (zimilar to previous method, except the Chips)
599 //
600 // Input:
601 // xchip : the Chip width
602 // zchip : the Chip length
603 // mgr : the GeoManager (used only to get the proper material)
604 //
605 // Output:
606 //
607 // Return:
608 // the module as a TGeoVolume
609 //
610 // Updated: 03 Apr 2021
611 // Updated: 03 Nov 2025 Change volume from BBox to Xtru to avoid fake overlaps
612
613 Double_t xtot, ytot, ztot;
614 Double_t ymid, shrinkFactor = 0.73;
615 Double_t xv[5], yv[5];
616 Double_t xpos, ypos, zpos;
617 const Int_t nameLen = 30;
618 char volumeName[nameLen];
619
620 // Create the Glue, the Kapton and the two Aluminum cables
621 xtot = xchip + (sIBFPCWiderXPlus + sIBFPCWiderXNeg) / 2;
622 ztot = mIBModuleZLength / 2;
623
624 TGeoBBox* glue = new TGeoBBox(xchip, sIBGlueThick / 2, ztot);
625 TGeoBBox* kapCable = new TGeoBBox(xtot, sIBFlexCableKapThick / 2, ztot);
626
627 TGeoVolume* aluGndCableVol = createIBFPCAlGnd(xtot, ztot);
628 TGeoVolume* aluAnodeCableVol = createIBFPCAlAnode(xtot, ztot);
629
630 // Then create the module volume
631 Double_t ygnd = (static_cast<TGeoBBox*>(aluGndCableVol->GetShape()))->GetDY();
632 Double_t yano = (static_cast<TGeoBBox*>(aluAnodeCableVol->GetShape()))->GetDY();
633
634 ytot = sIBGlueThick / 2 + ygnd + sIBFlexCableKapThick / 2 + yano + sIBFlexCapacitor22YHi / 2;
635 ymid = sIBGlueThick / 2 + ygnd + sIBFlexCableKapThick / 2 + yano;
636
637 xv[0] = xtot;
638 yv[0] = -ytot;
639 xv[1] = xv[0];
640 yv[1] = yv[0] + 6 * ymid;
641 xv[2] = xtot * shrinkFactor;
642 yv[2] = ytot;
643 xv[3] = -xtot;
644 yv[3] = yv[2];
645 xv[4] = xv[3];
646 yv[4] = yv[0];
647
648 TGeoXtru* module = new TGeoXtru(2);
649 module->DefinePolygon(6, xv, yv);
650 module->DefinePolygon(5, xv, yv);
651 module->DefineSection(0, -ztot);
652 module->DefineSection(1, ztot);
653
654 // Now the volumes
655 TGeoMedium* medAir = mgr->GetMedium(Form("%s_AIR$", GetDetName()));
656 TGeoMedium* medKapton = mgr->GetMedium(Form("%s_KAPTON(POLYCH2)$", GetDetName()));
657 TGeoMedium* medGlue = mgr->GetMedium(Form("%s_GLUE_IBFPC$", GetDetName()));
658
659 snprintf(volumeName, nameLen, "ServicesContainer%d", mLayerNumber);
660 TGeoVolume* modVol = new TGeoVolume(volumeName, module, medAir);
661
662 TGeoVolume* glueVol = new TGeoVolume("FPCGlue", glue, medGlue);
663 glueVol->SetLineColor(kBlack);
664 glueVol->SetFillColor(kBlack);
665
666 TGeoVolume* kapCableVol = new TGeoVolume("FPCKapton", kapCable, medKapton);
667 kapCableVol->SetLineColor(kBlue);
668 kapCableVol->SetFillColor(kBlue);
669
670 // Build up the module
671 xpos = -xtot + xchip + sIBFPCWiderXNeg;
672 ypos = -ytot + glue->GetDY();
673 if (mBuildLevel < 2) { // Glue
674 modVol->AddNode(glueVol, 1, new TGeoTranslation(xpos, ypos, 0));
675 }
676 ypos += glue->GetDY();
677
678 if (mBuildLevel < 4) { // Kapton
679 ypos += ygnd;
680 modVol->AddNode(aluGndCableVol, 1, new TGeoTranslation(0, ypos, 0));
681
682 ypos += (ygnd + kapCable->GetDY());
683 modVol->AddNode(kapCableVol, 1, new TGeoTranslation(0, ypos, 0));
684
685 ypos += (kapCable->GetDY() + yano);
686 modVol->AddNode(aluAnodeCableVol, 1, new TGeoTranslation(0, ypos, 0));
687
688 ypos += yano;
689 }
690
691 // Add the capacitors
692 createIBCapacitors(modVol, zchip, ypos);
693
694 // Done, return the module
695 return modVol;
696}
697
698void V3Layer::createIBCapacitors(TGeoVolume* modvol, Double_t zchip, Double_t yzero, const TGeoManager* mgr)
699{
700 //
701 // Adds the capacitors to the IB FPC
702 //
703 // Created: 13 Feb 2018 Mario Sitta
704 // Updated: 03 Apr 2019 Mario Sitta Fix positions (180' rotation)
705 // Updated: 31 Oct 2025 Mario Sitta Fix dimensions and weight
706 //
707
708 // Position of the various capacitors (A.Junique private communication
709 // where: X_capacitor = Z_module , Y_capacitor = X_module)
710 // Capacitors (different groups)
711 const Double_t xGroup1A = 4265.9 * sMicron;
712 const Double_t zGroup1A[2] = {-7142.9 * sMicron, 7594.1 * sMicron};
713 const Double_t xGroup1B = 690.9 * sMicron;
714 const Double_t zGroup1B = -7142.9 * sMicron;
715 const Double_t xGroup2 = 6300.0 * sMicron;
716 const Double_t zGroup2 = 15075.0 * sMicron;
717 const Double_t xGroup3 = 5575.0 * sMicron;
718 const Double_t zGroup3 = 131900.0 * sMicron;
719 const Double_t xGroup4[2] = {5600.0 * sMicron, 5575.0 * sMicron};
720 const Double_t zGroup4[sIBChipsPerRow] = {275.0 * sMicron, 250.0 * sMicron, 275.0 * sMicron,
721 250.0 * sMicron, 250.0 * sMicron, 300.0 * sMicron,
722 250.0 * sMicron, 300.0 * sMicron, 250.0 * sMicron};
723 const Int_t nGroup5A = 5, nGroup5B = 4;
724 const Double_t xGroup5A[2] = {1400.0 * sMicron, 1350.0 * sMicron};
725 const Double_t zGroup5A[nGroup5A] = {-112957.5 * sMicron, -82854.5 * sMicron, 7595.5 * sMicron, 37745.5 * sMicron,
726 128194.1 * sMicron};
727 const Double_t xGroup5B = 1100.0 * sMicron;
728 const Double_t zGroup5B[nGroup5B] = {-51525.0 * sMicron, -21375.0 * sMicron, 69075.0 * sMicron, 99225.0 * sMicron};
729 // Resistors
730 const Int_t nResist = 2;
731 const Double_t xResist = -7975.0 * sMicron;
732 const Double_t zResist[nResist] = {114403.0 * sMicron, 119222.0 * sMicron};
733
734 Double_t xpos, ypos, zpos;
735 Int_t nCapacitors;
736
737 TGeoVolume *capacitorSmall, *capacitorLarge, *resistor;
738
739 // Check whether we already have the volumes, otherwise create them
740 // (so as to avoid creating multiple copies of the very same volumes
741 // for each layer)
742 // The "small" capacitor is the 1 uF substrate capacitor
743 // The "large" capacitor is the 22 uF analog/digital PS capacitor
744 capacitorSmall = mgr->GetVolume("IBFPCCapacitorSmall");
745
746 if (!capacitorSmall) {
747 TGeoBBox* capSmsh = new TGeoBBox(sIBFlexCapacitor1XWid / 2, sIBFlexCapacitor1YHi / 2, sIBFlexCapacitor1ZLen / 2);
748 TGeoBBox* capLgsh = new TGeoBBox(sIBFlexCapacitor22XWid / 2, sIBFlexCapacitor22YHi / 2, sIBFlexCapacitor22ZLen / 2);
749
750 TGeoMedium* medCeramic = mgr->GetMedium(Form("%s_CERAMIC$", GetDetName()));
751
752 capacitorSmall = new TGeoVolume("IBFPCCapacitorSmall", capSmsh, medCeramic);
753 capacitorSmall->SetLineColor(kBlack);
754 capacitorSmall->SetFillColor(kBlack);
755
756 capacitorLarge = new TGeoVolume("IBFPCCapacitorLarge", capLgsh, medCeramic);
757 capacitorLarge->SetLineColor(kBlack);
758 capacitorLarge->SetFillColor(kBlack);
759
760 TGeoBBox* ressh = new TGeoBBox(sIBFlexResistorXWid / 2,
761 sIBFlexResistorYHi / 2,
762 sIBFlexResistorZLen / 2);
763
764 resistor = new TGeoVolume("IBFPCResistor", ressh, medCeramic);
765 resistor->SetLineColor(kBlack);
766 resistor->SetFillColor(kBlack);
767 } else { // Volumes already defined, get them
768 capacitorLarge = mgr->GetVolume("IBFPCCapacitorLarge");
769 resistor = mgr->GetVolume("IBFPCResistor");
770 }
771
772 // Place all the capacitors (they are really a lot...)
773 ypos = yzero + sIBFlexCapacitor22YHi / 2;
774
775 xpos = xGroup1A;
776 for (Int_t j = 0; j < sIBChipsPerRow; j++) {
777 zpos = -mIBModuleZLength / 2 + j * (2 * zchip + sIBChipZGap) + zchip + zGroup1A[0];
778 modvol->AddNode(capacitorLarge, 2 * j + 1, new TGeoTranslation(-xpos, ypos, -zpos));
779 zpos = -mIBModuleZLength / 2 + j * (2 * zchip + sIBChipZGap) + zchip + zGroup1A[1];
780 modvol->AddNode(capacitorLarge, 2 * j + 2, new TGeoTranslation(-xpos, ypos, -zpos));
781 }
782
783 nCapacitors = 2 * sIBChipsPerRow;
784 xpos = xGroup1B;
785 for (Int_t j = 0; j < sIBChipsPerRow; j++) {
786 zpos = -mIBModuleZLength / 2 + j * (2 * zchip + sIBChipZGap) + zchip + zGroup1B;
787 modvol->AddNode(capacitorLarge, j + 1 + nCapacitors, new TGeoTranslation(-xpos, ypos, -zpos));
788 }
789
790 nCapacitors += sIBChipsPerRow;
791 ypos = yzero + sIBFlexCapacitor1YHi / 2;
792 xpos = xGroup2;
793 // We have only 8 in these group, missing the central one
794 for (Int_t j = 0; j < sIBChipsPerRow - 1; j++) {
795 zpos = -mIBModuleZLength / 2 + j * (2 * zchip + sIBChipZGap) + zchip + zGroup2;
796 modvol->AddNode(capacitorSmall, j + 1 + nCapacitors, new TGeoTranslation(-xpos, ypos, -zpos));
797 }
798
799 nCapacitors += (sIBChipsPerRow - 1);
800 xpos = xGroup3;
801 zpos = zGroup3;
802 modvol->AddNode(capacitorSmall, 1 + nCapacitors, new TGeoTranslation(-xpos, ypos, -zpos));
803
804 nCapacitors++;
805 for (Int_t j = 0; j < sIBChipsPerRow; j++) {
806 if (j == (sIBChipsPerRow - 1)) {
807 xpos = xGroup4[1];
808 } else {
809 xpos = xGroup4[0];
810 }
811 zpos = -mIBModuleZLength / 2 + j * (2 * zchip + sIBChipZGap) + zchip + zGroup4[j];
812 modvol->AddNode(capacitorSmall, j + 1 + nCapacitors, new TGeoTranslation(-xpos, ypos, -zpos));
813 }
814
815 nCapacitors += sIBChipsPerRow;
816 ypos = yzero + sIBFlexCapacitor22YHi / 2;
817 for (Int_t j = 0; j < nGroup5A; j++) {
818 if (j == 0) {
819 xpos = xGroup5A[0];
820 } else {
821 xpos = xGroup5A[1];
822 }
823 zpos = zGroup5A[j];
824 modvol->AddNode(capacitorLarge, j + 1 + nCapacitors, new TGeoTranslation(-xpos, ypos, -zpos));
825 }
826
827 nCapacitors += nGroup5A;
828 xpos = xGroup5B;
829 for (Int_t j = 0; j < nGroup5B; j++) {
830 zpos = zGroup5B[j];
831 modvol->AddNode(capacitorLarge, j + 1 + nCapacitors, new TGeoTranslation(-xpos, ypos, -zpos));
832 }
833
834 // Place the resistors
835 xpos = xResist;
836 for (Int_t j = 0; j < nResist; j++) {
837 zpos = zResist[j];
838 modvol->AddNode(resistor, j + 1, new TGeoTranslation(-xpos, ypos, -zpos));
839 }
840}
841
842TGeoVolume* V3Layer::createIBFPCAlGnd(const Double_t xcable, const Double_t zcable, const TGeoManager* mgr)
843{
844 //
845 // Create the IB FPC Aluminum Ground cable
846 //
847 // Created: 20 Oct 2017 Mario Sitta
848 //
849
850 Double_t ytot, ypos;
851
852 // First create all needed shapes
853 ytot = sIBFlexCablePolyThick + sIBFlexCableAlThick;
854 TGeoBBox* coverlay = new TGeoBBox(xcable, ytot / 2, zcable);
855 TGeoBBox* aluminum = new TGeoBBox(xcable, sIBFlexCableAlThick / 2, zcable);
856
857 // Then the volumes
858 TGeoMedium* medKapton = mgr->GetMedium(Form("%s_KAPTON(POLYCH2)$", GetDetName()));
859 TGeoMedium* medAluminum = mgr->GetMedium(Form("%s_ALUMINUM$", GetDetName()));
860
861 TGeoVolume* coverlayVol = new TGeoVolume("FPCCoverlayGround", coverlay, medKapton);
862 coverlayVol->SetLineColor(kBlue);
863 coverlayVol->SetFillColor(kBlue);
864
865 TGeoVolume* aluminumVol = new TGeoVolume("FPCAluminumGround", aluminum, medAluminum);
866 aluminumVol->SetLineColor(kCyan);
867 aluminumVol->SetFillColor(kCyan);
868
869 ypos = coverlay->GetDY() - aluminum->GetDY();
870 if (mBuildLevel < 1) { // Aluminum
871 coverlayVol->AddNode(aluminumVol, 1, new TGeoTranslation(0, ypos, 0));
872 }
873
874 return coverlayVol;
875}
876
877TGeoVolume* V3Layer::createIBFPCAlAnode(const Double_t xcable, const Double_t zcable, const TGeoManager* mgr)
878{
879 //
880 // Create the IB FPC Aluminum Anode cable
881 //
882 //
883 // Created: 20 Oct 2017 Mario Sitta
884 // Updated: 03 Apr 2019 Mario Sitta Fix Al position (180' rotation)
885 //
886
887 Double_t ytot, ypos;
888 Double_t xtru[4], ytru[4];
889
890 // First create all needed shapes
891 ytot = sIBFlexCablePolyThick + sIBFlexCableAlThick;
892 TGeoBBox* coverlay = new TGeoBBox(xcable, ytot / 2, zcable);
893
894 // A trapezoid
895 xtru[0] = -sIBFPCAlAnodeWidth2 / 2;
896 ytru[0] = -zcable;
897 xtru[1] = sIBFPCAlAnodeWidth2 / 2;
898 ytru[1] = ytru[0];
899 xtru[2] = xtru[0] + sIBFPCAlAnodeWidth1;
900 ytru[2] = zcable;
901 xtru[3] = xtru[0];
902 ytru[3] = ytru[2];
903
904 TGeoXtru* aluminum = new TGeoXtru(2);
905 aluminum->DefinePolygon(4, xtru, ytru);
906 aluminum->DefineSection(0, -sIBFlexCableAlThick / 2);
907 aluminum->DefineSection(1, sIBFlexCableAlThick / 2);
908
909 // Then the volumes
910 TGeoMedium* medKapton = mgr->GetMedium(Form("%s_KAPTON(POLYCH2)$", GetDetName()));
911 TGeoMedium* medAluminum = mgr->GetMedium(Form("%s_ALUMINUM$", GetDetName()));
912
913 TGeoVolume* coverlayVol = new TGeoVolume("FPCCoverlayAnode", coverlay, medKapton);
914 coverlayVol->SetLineColor(kBlue);
915 coverlayVol->SetFillColor(kBlue);
916
917 TGeoVolume* aluminumVol = new TGeoVolume("FPCAluminumAnode", aluminum, medAluminum);
918 aluminumVol->SetLineColor(kCyan);
919 aluminumVol->SetFillColor(kCyan);
920
921 ypos = -coverlay->GetDY() + aluminum->GetZ(1);
922 if (mBuildLevel < 1) { // Aluminum
923 coverlayVol->AddNode(aluminumVol, 1, new TGeoCombiTrans(0, ypos, 0, new TGeoRotation("", 0, -90, 0)));
924 }
925
926 return coverlayVol;
927}
928
929TGeoVolume* V3Layer::createStaveStructInnerB(const TGeoManager* mgr)
930{
931 //
932 // Create the mechanical stave structure
933 //
934 // Created: 22 Mar 2013 Chinorat Kobdaj
935 // Updated: 26 Apr 2013 Mario Sitta
936 // Updated: 04 Apr 2017 Mario Sitta O2 version - All models obsolete except last one
937 // Updated: 25 Jan 2018 Mario Sitta Stave width is now a constant
938 //
939
940 TGeoVolume* mechStavVol = nullptr;
941
942 switch (mStaveModel) {
943 case kIBModelDummy:
944 mechStavVol = createStaveModelInnerBDummy(mgr);
945 break;
946 case kIBModel0:
947 case kIBModel1:
948 case kIBModel21:
949 case kIBModel22:
950 case kIBModel3:
951 LOG(fatal) << "Stave model " << mStaveModel << " obsolete and no longer supported";
952 break;
953 case kIBModel4:
954 mechStavVol = createStaveModelInnerB4(mgr);
955 break;
956 default:
957 LOG(fatal) << "Unknown stave model " << mStaveModel;
958 break;
959 }
960 return mechStavVol;
961}
962
963TGeoVolume* V3Layer::createStaveModelInnerBDummy(const TGeoManager*) const
964{
965 //
966 // Create dummy stave
967 //
968 // Created: 22 Mar 2013 Chinorat Kobdaj
969 // Updated: 26 Apr 2013 Mario Sitta
970 // Updated: 04 Apr 2017 Mario Sitta O2 version
971 //
972
973 // Done, return the stave structur
974 return nullptr;
975}
976
977// model4
978//________________________________________________________________________
979TGeoVolume* V3Layer::createStaveModelInnerB4(const TGeoManager* mgr)
980{
981 //
982 // Create the mechanical stave structure for Model 4 of TDR
983 //
984 // Input:
985 // mgr : the GeoManager (used only to get the proper material)
986 //
987 // Output:
988 //
989 // Return:
990 //
991 // Created: 04 Dec 2014 Mario Sitta
992 // Updated: 03 Mar 2015 Mario Sitta FPC in right position (beyond chip)
993 // Updated: 06 Mar 2015 Mario Sitta Space Frame corrected (C.G. data)
994 // Updated: 30 Apr 2015 Mario Sitta End-stave connectors added
995 // Updated: 04 Apr 2017 Mario Sitta O2 version
996 // Updated: 25 Jan 2018 Mario Sitta Stave width is now a constant
997 // Updated: 03 Feb 2018 Mario Sitta To last drawings (ALIITSUP0051)
998 //
999
1000 // Local parameters
1001 const Double_t xstave = sIBColdPlateWidth / 2;
1002
1003 Double_t layerHeight = 0.;
1004
1005 Double_t rPipeMin = sIBCoolPipeInnerD / 2;
1006 Double_t rPipeMax = rPipeMin + sIBCoolPipeThick;
1007
1008 const Int_t nv = 16;
1009 Double_t xv[nv], yv[nv]; // The stave container Xtru
1010 Double_t xlen, ylen, zlen, ztot;
1011 Double_t xpos, ypos, zpos, ylay, yposPipe;
1012 Double_t beta, gamma, theta;
1013
1014 // First create all needed shapes
1015 ztot = sIBColdPlateZLen / 2;
1016
1017 TGeoBBox* glue = new TGeoBBox(xstave, sIBGlueThick / 2, ztot);
1018
1019 TGeoBBox* fleecbot = new TGeoBBox(xstave, sIBCarbonFleeceThick / 2, ztot);
1020
1021 TGeoBBox* cfplate = new TGeoBBox(xstave, sIBK13D2UThick / 2, ztot);
1022
1023 TGeoTube* pipe = new TGeoTube(rPipeMin, rPipeMax, sIBCoolPipeZLen / 2);
1024
1025 TGeoTube* water = new TGeoTube(0., rPipeMin, sIBCoolPipeZLen / 2);
1026
1027 TGeoTubeSeg* cpaptub = new TGeoTubeSeg(rPipeMax, rPipeMax + sIBCarbonPaperThick, sIBCarbonPaperZLen / 2, 0, 180);
1028
1029 TGeoBBox* cpapvert = new TGeoBBox(sIBCarbonPaperThick / 2, pipe->GetRmax() / 2, sIBCarbonPaperZLen / 2);
1030
1031 xlen = sIBCoolPipeXDist / 2 - pipe->GetRmax() - sIBCarbonPaperThick;
1032 TGeoBBox* cpapmid = new TGeoBBox(xlen, sIBCarbonPaperThick / 2, sIBCarbonPaperZLen / 2);
1033
1034 xlen = sIBCarbonPaperWidth / 2 - sIBCoolPipeXDist / 2 - pipe->GetRmax() - sIBCarbonPaperThick;
1035 TGeoBBox* cpaplr = new TGeoBBox(xlen / 2, sIBCarbonPaperThick / 2, sIBCarbonPaperZLen / 2);
1036
1037 TGeoTubeSeg* fleecpipe = new TGeoTubeSeg(cpaptub->GetRmax(), cpaptub->GetRmax() + sIBCarbonFleeceThick, ztot, 0, 180);
1038
1039 TGeoBBox* fleecvert = new TGeoBBox(sIBCarbonFleeceThick / 2, (pipe->GetRmax() - sIBCarbonPaperThick) / 2, ztot);
1040
1041 xlen = sIBCoolPipeXDist / 2 - pipe->GetRmax() - sIBCarbonPaperThick - sIBCarbonFleeceThick;
1042 TGeoBBox* fleecmid = new TGeoBBox(xlen, sIBCarbonFleeceThick / 2, ztot);
1043
1044 xlen = xstave - sIBCoolPipeXDist / 2 - pipe->GetRmax() - sIBCarbonPaperThick - sIBCarbonFleeceThick;
1045 TGeoBBox* fleeclr = new TGeoBBox(xlen / 2, sIBCarbonFleeceThick / 2, ztot);
1046
1047 // The total height of the layer can now be computed
1048 layerHeight = 2 * (glue->GetDY() + fleecbot->GetDY() + cfplate->GetDY() + cpaplr->GetDY() + fleeclr->GetDY());
1049
1050 // The spaceframe structure
1051 TGeoTrd1* topv = new TGeoTrd1(sIBTopVertexWidth1 / 2, sIBTopVertexWidth2 / 2, ztot, sIBTopVertexHeight / 2);
1052
1053 xv[0] = 0;
1054 yv[0] = 0;
1055 xv[1] = sIBSideVertexWidth;
1056 yv[1] = yv[0];
1057 xv[2] = xv[0];
1058 yv[2] = sIBSideVertexHeight;
1059
1060 TGeoXtru* sidev = new TGeoXtru(2);
1061 sidev->DefinePolygon(3, xv, yv);
1062 sidev->DefineSection(0, -ztot);
1063 sidev->DefineSection(1, ztot);
1064
1065 xv[0] = sIBEndSupportXUp / 2;
1066 yv[0] = sIBStaveHeight - sIBEndSupportThick;
1067 xv[1] = xstave - sIBSideVertexWidth;
1068 yv[1] = layerHeight + sIBSideVertexHeight;
1069 xv[2] = xstave;
1070 yv[2] = layerHeight;
1071 xv[3] = xv[2];
1072 yv[3] = 0;
1073 xv[4] = xstave + sIBEndSupportThick;
1074 yv[4] = yv[3];
1075 xv[5] = xv[4];
1076 yv[5] = yv[2];
1077 xv[6] = xv[1] + sIBEndSupportThick * sinD(sIBEndSupportOpenPhi / 2);
1078 yv[6] = yv[1] + sIBEndSupportThick * cosD(sIBEndSupportOpenPhi / 2);
1079 xv[7] = xv[0];
1080 yv[7] = sIBStaveHeight;
1081 for (Int_t i = 0; i < nv / 2; i++) {
1082 xv[8 + i] = -xv[7 - i];
1083 yv[8 + i] = yv[7 - i];
1084 }
1085
1086 TGeoXtru* endsupp = new TGeoXtru(2);
1087 endsupp->DefinePolygon(16, xv, yv);
1088 endsupp->DefineSection(0, -sIBEndSupportZLen / 2);
1089 endsupp->DefineSection(1, sIBEndSupportZLen / 2);
1090
1091 xlen = TMath::Sqrt((yv[7] - yv[6]) * (yv[7] - yv[6]) + (xv[7] - xv[6]) * (xv[7] - xv[6]) +
1092 sIBTopFilamentInterZ * sIBTopFilamentInterZ / 4);
1093 theta = TMath::ATan((yv[7] - yv[6]) / (xv[7] - xv[6])) * TMath::RadToDeg();
1094 TGeoBBox* topfil = new TGeoBBox(xlen / 2, sIBTopFilamentSide / 2, sIBTopFilamentSide / 2);
1095
1096 // The half stave container (an XTru to avoid overlaps between neighbours)
1097 xv[0] = xstave + sIBTopFilamentSide;
1098 yv[0] = 0;
1099 xv[1] = xv[0];
1100 yv[1] = layerHeight + sIBSideVertexHeight + topfil->GetDZ();
1101 ;
1102 xv[2] = sIBEndSupportXUp / 2;
1103 yv[2] = sIBStaveHeight + sIBTopFilamentSide / sinD(-theta) - 0.01; // theta is neg
1104 for (Int_t i = 0; i < 3; i++) {
1105 xv[3 + i] = -xv[2 - i];
1106 yv[3 + i] = yv[2 - i];
1107 }
1108
1109 TGeoXtru* mechStruct = new TGeoXtru(2);
1110 mechStruct->DefinePolygon(6, xv, yv);
1111 mechStruct->SetName("mechStruct");
1112 mechStruct->DefineSection(0, -ztot);
1113 mechStruct->DefineSection(1, ztot);
1114
1115 // The connectors' containers
1116 zlen = sIBConnectBlockZLen - sIBConnTailZLen + sIBConnectAFitZOut;
1117 TGeoBBox* connAside = new TGeoBBox("connAsideIB", sIBConnectorXWidth / 2, sIBConnBodyYHeight / 2, zlen / 2);
1118
1119 zlen = sIBConnectBlockZLen - sIBConnTailZLen;
1120 TGeoBBox* connCside = new TGeoBBox("connCsideIB", sIBConnectorXWidth / 2, sIBConnBodyYHeight / 2, zlen / 2);
1121
1122 // The StaveStruct container, a Composite Shape
1123 yposPipe = 2 * glue->GetDY() + 2 * fleecbot->GetDY() + 2 * cfplate->GetDY() + pipe->GetRmax();
1124 ypos = connAside->GetDY() - sIBConnTubesYPos + yposPipe;
1125 zpos = ztot + connAside->GetDZ();
1126 TGeoTranslation* transAside = new TGeoTranslation("transAsideIB", 0, ypos, zpos);
1127 transAside->RegisterYourself();
1128
1129 ypos = connCside->GetDY() - sIBConnTubesYPos + yposPipe;
1130 zpos = ztot + connCside->GetDZ();
1131 TGeoTranslation* transCside = new TGeoTranslation("transCsideIB", 0, ypos, -zpos);
1132 transCside->RegisterYourself();
1133
1134 TGeoCompositeShape* mechStavSh =
1135 new TGeoCompositeShape("mechStruct+connAsideIB:transAsideIB+connCsideIB:transCsideIB");
1136
1137 // We have all shapes: now create the real volumes
1138
1139 TGeoMedium* medAir = mgr->GetMedium(Form("%s_AIR$", GetDetName()));
1140 TGeoMedium* medWater = mgr->GetMedium(Form("%s_WATER$", GetDetName()));
1141 TGeoMedium* medM55J6K = mgr->GetMedium(Form("%s_M55J6K$", GetDetName()));
1142 TGeoMedium* medM60J3K = mgr->GetMedium(Form("%s_M60J3K$", GetDetName()));
1143 TGeoMedium* medKapton = mgr->GetMedium(Form("%s_KAPTON(POLYCH2)$", GetDetName()));
1144 TGeoMedium* medGlue = mgr->GetMedium(Form("%s_GLUE$", GetDetName()));
1145 TGeoMedium* medK13D2U2k = mgr->GetMedium(Form("%s_K13D2U2k$", GetDetName()));
1146 TGeoMedium* medFGS003 = mgr->GetMedium(Form("%s_FGS003$", GetDetName()));
1147 TGeoMedium* medCarbonFleece = mgr->GetMedium(Form("%s_CarbonFleece$", GetDetName()));
1148
1149 const Int_t nameLen = 30;
1150 char volname[nameLen];
1151 snprintf(volname, nameLen, "%s%d_StaveStruct", GeometryTGeo::getITSStavePattern(), mLayerNumber);
1152 TGeoVolume* mechStavVol = new TGeoVolume(volname, mechStavSh, medAir);
1153 mechStavVol->SetLineColor(12);
1154 mechStavVol->SetFillColor(12);
1155 mechStavVol->SetVisibility(kFALSE);
1156
1157 TGeoVolume* glueVol = new TGeoVolume("Glue", glue, medGlue);
1158 glueVol->SetLineColor(kBlack);
1159 glueVol->SetFillColor(kBlack);
1160
1161 TGeoVolume* fleecbotVol = new TGeoVolume("CarbonFleeceBottom", fleecbot, medCarbonFleece);
1162 fleecbotVol->SetFillColor(kViolet);
1163 fleecbotVol->SetLineColor(kViolet);
1164
1165 TGeoVolume* cfplateVol = new TGeoVolume("CFPlate", cfplate, medK13D2U2k);
1166 cfplateVol->SetFillColor(5); // Yellow
1167 cfplateVol->SetLineColor(5);
1168
1169 TGeoVolume* pipeVol = new TGeoVolume("PolyimidePipe", pipe, medKapton);
1170 pipeVol->SetFillColor(35); // Blue shade
1171 pipeVol->SetLineColor(35);
1172
1173 TGeoVolume* waterVol = new TGeoVolume("Water", water, medWater);
1174 waterVol->SetFillColor(4); // Bright blue
1175 waterVol->SetLineColor(4);
1176
1177 TGeoVolume* cpaptubVol = new TGeoVolume("ThermasolPipeCover", cpaptub, medFGS003);
1178 cpaptubVol->SetFillColor(2); // Red
1179 cpaptubVol->SetLineColor(2);
1180
1181 TGeoVolume* cpapvertVol = new TGeoVolume("ThermasolVertical", cpapvert, medFGS003);
1182 cpapvertVol->SetFillColor(2); // Red
1183 cpapvertVol->SetLineColor(2);
1184
1185 TGeoVolume* cpapmidVol = new TGeoVolume("ThermasolMiddle", cpapmid, medFGS003);
1186 cpapmidVol->SetFillColor(2); // Red
1187 cpapmidVol->SetLineColor(2);
1188
1189 TGeoVolume* cpaplrVol = new TGeoVolume("ThermasolLeftRight", cpaplr, medFGS003);
1190 cpaplrVol->SetFillColor(2); // Red
1191 cpaplrVol->SetLineColor(2);
1192
1193 TGeoVolume* fleecpipeVol = new TGeoVolume("CarbonFleecePipeCover", fleecpipe, medCarbonFleece);
1194 fleecpipeVol->SetFillColor(28); // Brown shade
1195 fleecpipeVol->SetLineColor(28);
1196
1197 TGeoVolume* fleecvertVol = new TGeoVolume("CarbonFleeceVertical", fleecvert, medCarbonFleece);
1198 fleecvertVol->SetFillColor(28); // Brown shade
1199 fleecvertVol->SetLineColor(28);
1200
1201 TGeoVolume* fleecmidVol = new TGeoVolume("CarbonFleeceMiddle", fleecmid, medCarbonFleece);
1202 fleecmidVol->SetFillColor(28); // Brown shade
1203 fleecmidVol->SetLineColor(28);
1204
1205 TGeoVolume* fleeclrVol = new TGeoVolume("CarbonFleeceLeftRight", fleeclr, medCarbonFleece);
1206 fleeclrVol->SetFillColor(28); // Brown shade
1207 fleeclrVol->SetLineColor(28);
1208
1209 TGeoVolume* topvVol = new TGeoVolume("TopVertex", topv, medM55J6K);
1210 topvVol->SetFillColor(12); // Gray shade
1211 topvVol->SetLineColor(12);
1212
1213 TGeoVolume* sidevVol = new TGeoVolume("SideVertex", sidev, medM55J6K);
1214 sidevVol->SetFillColor(12); // Gray shade
1215 sidevVol->SetLineColor(12);
1216
1217 TGeoVolume* topfilVol = new TGeoVolume("TopFilament", topfil, medM60J3K);
1218 topfilVol->SetFillColor(12); // Gray shade
1219 topfilVol->SetLineColor(12);
1220
1221 TGeoVolume* endsuppVol = new TGeoVolume("EndSupport", endsupp, medM55J6K);
1222 endsuppVol->SetFillColor(12); // Gray shade
1223 endsuppVol->SetLineColor(12);
1224
1225 // Now build up the half stave
1226 ypos = glue->GetDY();
1227 if (mBuildLevel < 2) { // Glue
1228 mechStavVol->AddNode(glueVol, 1, new TGeoTranslation(0, ypos, 0));
1229 }
1230
1231 ypos += (glue->GetDY() + fleecbot->GetDY());
1232 if (mBuildLevel < 5) { // Carbon
1233 mechStavVol->AddNode(fleecbotVol, 1, new TGeoTranslation(0, ypos, 0));
1234 }
1235
1236 ypos += (fleecbot->GetDY() + cfplate->GetDY());
1237 if (mBuildLevel < 5) { // Carbon
1238 mechStavVol->AddNode(cfplateVol, 1, new TGeoTranslation(0, ypos, 0));
1239 }
1240
1241 ylay = ypos + cfplate->GetDY(); // The level where tubes etc. lay
1242
1243 xpos = sIBCoolPipeXDist / 2;
1244 ypos = ylay + pipe->GetRmax();
1245 yposPipe = ypos; // Save for later use
1246 if (mBuildLevel < 4) { // Kapton
1247 mechStavVol->AddNode(pipeVol, 1, new TGeoTranslation(-xpos, ypos, 0));
1248 mechStavVol->AddNode(pipeVol, 2, new TGeoTranslation(xpos, ypos, 0));
1249 }
1250
1251 if (mBuildLevel < 3) { // Water
1252 mechStavVol->AddNode(waterVol, 1, new TGeoTranslation(-xpos, ypos, 0));
1253 mechStavVol->AddNode(waterVol, 2, new TGeoTranslation(xpos, ypos, 0));
1254 }
1255
1256 if (mBuildLevel < 5) { // Carbon (stave components)
1257 mechStavVol->AddNode(cpaptubVol, 1, new TGeoTranslation(-xpos, ypos, 0));
1258 mechStavVol->AddNode(cpaptubVol, 2, new TGeoTranslation(xpos, ypos, 0));
1259
1260 mechStavVol->AddNode(fleecpipeVol, 1, new TGeoTranslation(-xpos, ypos, 0));
1261 mechStavVol->AddNode(fleecpipeVol, 2, new TGeoTranslation(xpos, ypos, 0));
1262
1263 xpos = sIBCoolPipeXDist / 2 - pipe->GetRmax() - cpapvert->GetDX();
1264 ypos = ylay + cpapvert->GetDY();
1265 mechStavVol->AddNode(cpapvertVol, 1, new TGeoTranslation(-xpos, ypos, 0));
1266 mechStavVol->AddNode(cpapvertVol, 2, new TGeoTranslation(xpos, ypos, 0));
1267
1268 xpos = sIBCoolPipeXDist / 2 + pipe->GetRmax() + cpapvert->GetDX();
1269 mechStavVol->AddNode(cpapvertVol, 3, new TGeoTranslation(-xpos, ypos, 0));
1270 mechStavVol->AddNode(cpapvertVol, 4, new TGeoTranslation(xpos, ypos, 0));
1271
1272 ypos = ylay + sIBCarbonPaperThick / 2;
1273 mechStavVol->AddNode(cpapmidVol, 1, new TGeoTranslation(0, ypos, 0));
1274
1275 xpos = xstave - cpaplr->GetDX();
1276 mechStavVol->AddNode(cpaplrVol, 1, new TGeoTranslation(-xpos, ypos, 0));
1277 mechStavVol->AddNode(cpaplrVol, 2, new TGeoTranslation(xpos, ypos, 0));
1278
1279 xpos = sIBCoolPipeXDist / 2 - pipe->GetRmax() - 2 * cpapvert->GetDX() - fleecvert->GetDX();
1280 ypos = ylay + sIBCarbonPaperThick + fleecvert->GetDY();
1281 mechStavVol->AddNode(fleecvertVol, 1, new TGeoTranslation(-xpos, ypos, 0));
1282 mechStavVol->AddNode(fleecvertVol, 2, new TGeoTranslation(xpos, ypos, 0));
1283
1284 xpos = sIBCoolPipeXDist / 2 + pipe->GetRmax() + 2 * cpapvert->GetDX() + fleecvert->GetDX();
1285 mechStavVol->AddNode(fleecvertVol, 3, new TGeoTranslation(-xpos, ypos, 0));
1286 mechStavVol->AddNode(fleecvertVol, 4, new TGeoTranslation(xpos, ypos, 0));
1287
1288 ypos = ylay + sIBCarbonPaperThick + sIBCarbonFleeceThick / 2;
1289 mechStavVol->AddNode(fleecmidVol, 1, new TGeoTranslation(0, ypos, 0));
1290
1291 xpos = xstave - fleeclr->GetDX();
1292 mechStavVol->AddNode(fleeclrVol, 1, new TGeoTranslation(-xpos, ypos, 0));
1293 mechStavVol->AddNode(fleeclrVol, 2, new TGeoTranslation(xpos, ypos, 0));
1294 }
1295
1296 ylay += (sIBCarbonPaperThick + sIBCarbonFleeceThick);
1297
1298 if (mBuildLevel < 5) { // Carbon (spaceframe)
1299 ypos = sIBStaveHeight - sIBEndSupportThick - topv->GetDz(); // Due to rotation, z is on Y
1300 mechStavVol->AddNode(topvVol, 1, new TGeoCombiTrans(0, ypos, 0, new TGeoRotation("", 0, -90, 0)));
1301
1302 xpos = xstave - sidev->GetX(1);
1303 ypos = ylay;
1304 mechStavVol->AddNode(sidevVol, 1, new TGeoTranslation(xpos, ypos, 0));
1305 mechStavVol->AddNode(sidevVol, 2, new TGeoCombiTrans(-xpos, ypos, 0, new TGeoRotation("", 90, 180, -90)));
1306
1307 zpos = ztot - endsupp->GetZ(1);
1308 mechStavVol->AddNode(endsuppVol, 1, new TGeoTranslation(0, 0, zpos));
1309 mechStavVol->AddNode(endsuppVol, 2, new TGeoTranslation(0, 0, -zpos));
1310
1311 gamma = 180. - sIBTopFilamentAlpha;
1312 xpos = xstave / 2 + topfil->GetDZ();
1313 ypos = (endsupp->GetY(7) + endsupp->GetY(6)) / 2;
1314 Int_t nFilamentGroups = (Int_t)(2 * (ztot - sIBEndSupportZLen) / sIBTopFilamentInterZ);
1315 // theta was computed when filament volume was created
1316 for (int i = 0; i < nFilamentGroups; i++) { // i<19
1317 // 1) Front Left Top Filament
1318 zpos = -(ztot - sIBEndSupportZLen) + i * sIBTopFilamentInterZ + sIBTopFilamentInterZ / 4;
1319 mechStavVol->AddNode(topfilVol, i * 4 + 1,
1320 new TGeoCombiTrans(xpos, ypos, zpos, new TGeoRotation("", 90 + theta, gamma / 2, -90)));
1321 // 2) Front Right Top Filament
1322 mechStavVol->AddNode(topfilVol, i * 4 + 2,
1323 new TGeoCombiTrans(-xpos, ypos, zpos, new TGeoRotation("", 90 - theta, -gamma / 2, -90)));
1324 // 3) Back Left Top Filament
1325 zpos += sIBTopFilamentInterZ / 2;
1326 mechStavVol->AddNode(topfilVol, i * 4 + 3,
1327 new TGeoCombiTrans(xpos, ypos, zpos, new TGeoRotation("", 90 + theta, -gamma / 2, -90)));
1328 // 4) Back Right Top Filament
1329 mechStavVol->AddNode(topfilVol, i * 4 + 4,
1330 new TGeoCombiTrans(-xpos, ypos, zpos, new TGeoRotation("", 90 - theta, gamma / 2, -90)));
1331 }
1332 }
1333
1334 // Add the end-stave connectors
1335 TGeoVolume *connectorASide, *connectorCSide;
1336
1337 // Check whether we have already all pieces
1338 // Otherwise create them
1339 connectorASide = mgr->GetVolume("IBConnectorASide");
1340
1341 if (!connectorASide) {
1342 createIBConnectors(mgr);
1343 connectorASide = mgr->GetVolume("IBConnectorASide");
1344 }
1345 connectorCSide = mgr->GetVolume("IBConnectorCSide");
1346
1347 ypos = (static_cast<TGeoBBox*>(connectorASide->GetShape()))->GetDY() - sIBConnTubesYPos +
1348 yposPipe; // We center the pipe and hole axes
1349 zpos = ztot + (sIBConnectBlockZLen - sIBConnTailZLen + sIBConnectAFitZOut) / 2;
1350 mechStavVol->AddNode(connectorASide, 1, new TGeoTranslation(0, ypos, zpos));
1351
1352 zpos = ztot + (sIBConnectBlockZLen - sIBConnTailZLen) / 2;
1353 mechStavVol->AddNode(connectorCSide, 1, new TGeoCombiTrans(0, ypos, -zpos, new TGeoRotation("", 90, 180, -90)));
1354
1355 // Done, return the stave structure
1356 return mechStavVol;
1357}
1358
1359void V3Layer::createIBConnectors(const TGeoManager* mgr)
1360{
1361 //
1362 // Create the end-stave connectors for IB staves
1363 // (simply call the actual creator methods)
1364 //
1365 // Created: 20 Apr 2015 Mario Sitta
1366 //
1367
1368 createIBConnectorsASide(mgr);
1369 createIBConnectorsCSide(mgr);
1370}
1371
1372void V3Layer::createIBConnectorsASide(const TGeoManager* mgr)
1373{
1374 //
1375 // Create the A-Side end-stave connectors for IB staves
1376 //
1377 // Created: 22 Apr 2015 Mario Sitta
1378 // Updated: 04 Apr 2017 Mario Sitta O2 version
1379 // Updated: 28 Jan 2018 Mario Sitta To last drawings (ALIITSUP0051)
1380 // Updated: 19 Jun 2019 Mario Sitta Avoid fake overlaps with EndWheels
1381 //
1382
1383 // Local variables
1384 const Int_t nv = 8;
1385 Double_t xv[nv], yv[nv];
1386 Double_t xlen, ylen, zlen;
1387 Double_t xpos, ypos, zpos;
1388
1389 // Gather all material pointers
1390 TGeoMedium* medAir = mgr->GetMedium(Form("%s_AIR$", GetDetName()));
1391 TGeoMedium* medPEEK = mgr->GetMedium(Form("%s_PEEKCF30$", GetDetName()));
1392 TGeoMedium* medInox304 = mgr->GetMedium(Form("%s_INOX304$", GetDetName()));
1393
1394 // First create all elements
1395 // (All measures refer to the blueprint ALIITSUP0051)
1396
1397 // The connector block, two Composite Shapes:
1398 // the body...
1399 xlen = sIBConnectorXWidth;
1400 ylen = sIBConnBodyYHeight;
1401 zlen = sIBConnectBlockZLen - sIBConnTailZLen;
1402 TGeoBBox* connBody = new TGeoBBox("connBodyA", xlen / 2, ylen / 2, zlen / 2);
1403
1404 TGeoTube* connRoundHole = new TGeoTube("connRoundHoleA", 0., sIBConnRoundHoleD / 2, sIBConnBodyYHeight / 1.5);
1405
1406 zpos = -connBody->GetDZ() + sIBConnRoundHoleZ;
1407 TGeoCombiTrans* connRoundHoleTrans =
1408 new TGeoCombiTrans("roundHoleTransA", 0, 0, zpos, new TGeoRotation("", 0, 90, 0));
1409 connRoundHoleTrans->RegisterYourself();
1410
1411 xlen = sIBConnSquareHoleX / 2;
1412 ylen = sIBConnBodyYHeight / 1.5;
1413 zlen = sIBConnSquareHoleZ / 2;
1414 TGeoBBox* connSquareHole = new TGeoBBox("connSquareHoleA", xlen, ylen, zlen);
1415
1416 zpos = -connBody->GetDZ() + sIBConnSquareHoleZPos;
1417 TGeoTranslation* connSquareHoleTrans = new TGeoTranslation("squareHoleTransA", 0, 0, zpos);
1418 connSquareHoleTrans->RegisterYourself();
1419
1420 TGeoTube* connTubeHole2 = new TGeoTube("tube2HoleA", 0, sIBConnTubeHole2D / 2, connBody->GetDZ());
1421
1422 xpos = sIBConnTubesXDist / 2;
1423 ypos = -connBody->GetDY() + sIBConnTubesYPos;
1424
1425 TGeoTranslation* connTubes2Trans1 = new TGeoTranslation("tubes2Trans1A", -xpos, ypos, 0);
1426 connTubes2Trans1->RegisterYourself();
1427
1428 TGeoTranslation* connTubes2Trans2 = new TGeoTranslation("tubes2Trans2A", xpos, ypos, 0);
1429 connTubes2Trans2->RegisterYourself();
1430
1431 zlen = sIBConnTubeHole1ZLen - sIBConnTailZLen;
1432 TGeoTube* connTubeHole3 = new TGeoTube("tube3HoleA", 0, sIBConnTubeHole1D / 2, zlen);
1433
1434 zpos = connBody->GetDZ();
1435 TGeoTranslation* connTubes3Trans1 = new TGeoTranslation("tubes3Trans1A", -xpos, ypos, -zpos);
1436 connTubes3Trans1->RegisterYourself();
1437 TGeoTranslation* connTubes3Trans2 = new TGeoTranslation("tubes3Trans2A", xpos, ypos, -zpos);
1438 connTubes3Trans2->RegisterYourself();
1439
1440 zlen = sIBConnTubeHole1ZLen2;
1441 TGeoTube* connFitHole = new TGeoTube("fitHoleA", 0, sIBConnectAFitExtD / 2, zlen);
1442
1443 TGeoTranslation* connFitHoleTrans1 = new TGeoTranslation("fitTrans1A", -xpos, ypos, zpos);
1444 connFitHoleTrans1->RegisterYourself();
1445 TGeoTranslation* connFitHoleTrans2 = new TGeoTranslation("fitTrans2A", xpos, ypos, zpos);
1446 connFitHoleTrans2->RegisterYourself();
1447
1448 zlen = sIBConnSideHole1XWid / 1.5;
1449 TGeoTube* sideHole1 = new TGeoTube("sideHole1A", 0, sIBConnSideHole1D / 2, zlen);
1450
1451 xpos = connBody->GetDX() - sIBConnSideHole1XWid + sideHole1->GetDz();
1452 ypos = connBody->GetDY() - sIBConnSideHole1YPos;
1453 zpos = -connBody->GetDZ() + (sIBConnSideHole1ZPos - sIBConnTailZLen);
1454 TGeoCombiTrans* connSideHole1Trans =
1455 new TGeoCombiTrans("sideHole1TransA", xpos, ypos, zpos, new TGeoRotation("", 90, 90, 0));
1456 connSideHole1Trans->RegisterYourself();
1457
1458 TGeoBBox* sideHole2Box =
1459 new TGeoBBox("sideHole2AB", sIBConnSideHole2XWid, sIBConnSideHole2YWid / 2, sIBConnSideHole2ZWid / 2);
1460
1461 xpos = -connBody->GetDX();
1462 ypos = connBody->GetDY() - sIBConnSideHole2YPos;
1463 zpos = -connBody->GetDZ() + (sIBConnSideHole2ZPos - sIBConnTailZLen) + sideHole2Box->GetDZ();
1464 TGeoTranslation* sideHole2BTrans = new TGeoTranslation("sideHole2TransBA", xpos, ypos, zpos);
1465 sideHole2BTrans->RegisterYourself();
1466
1467 TGeoTubeSeg* sideHole2TubeSeg =
1468 new TGeoTubeSeg("sideHole2ATS", 0, sIBConnSideHole2YWid / 2, sIBConnSideHole2XWid, 0, 180);
1469
1470 zpos = -connBody->GetDZ() + (sIBConnSideHole2ZPos - sIBConnTailZLen);
1471 TGeoCombiTrans* sideHole2TSTrans1 =
1472 new TGeoCombiTrans("sideHole2TSTrans1A", xpos, ypos, zpos, new TGeoRotation("", 90, -90, 0));
1473 sideHole2TSTrans1->RegisterYourself();
1474
1475 zpos = -connBody->GetDZ() + (sIBConnSideHole2ZPos - sIBConnTailZLen) + 2 * sideHole2Box->GetDZ();
1476 TGeoCombiTrans* sideHole2TSTrans2 =
1477 new TGeoCombiTrans("sideHole2TSTrans2A", xpos, ypos, zpos, new TGeoRotation("", 90, 90, 0));
1478 sideHole2TSTrans2->RegisterYourself();
1479
1480 TGeoCompositeShape* connBodySh = new TGeoCompositeShape(
1481 "connBodyA-connRoundHoleA:roundHoleTransA-connSquareHoleA:squareHoleTransA-tube2HoleA:tubes2Trans1A-tube2HoleA:"
1482 "tubes2Trans2A-fitHoleA:fitTrans1A-fitHoleA:fitTrans2A-tube3HoleA:tubes3Trans1A-tube3HoleA:tubes3Trans2A-"
1483 "sideHole1A:sideHole1TransA-sideHole2AB:sideHole2TransBA-sideHole2ATS:sideHole2TSTrans1A-sideHole2ATS:"
1484 "sideHole2TSTrans2A");
1485
1486 TGeoVolume* connBlockBody = new TGeoVolume("IBConnectorBlockBodyASide", connBodySh, medPEEK);
1487 connBlockBody->SetFillColor(42); // Brownish shade
1488 connBlockBody->SetLineColor(42);
1489
1490 // ...and the tail
1491 xv[0] = sIBConnectorXWidth / 2;
1492 yv[0] = sIBConnTailYShift;
1493 xv[1] = xv[0];
1494 yv[1] = sIBConnTailYMid;
1495 xv[2] = xv[1] - (sIBConnectorYTot - sIBConnTailYMid) / tanD(90 - sIBConnTailOpenPhi / 2);
1496 yv[2] = sIBConnectorYTot;
1497
1498 for (Int_t i = 0; i < 3; i++) {
1499 xv[3 + i] = -xv[2 - i];
1500 yv[3 + i] = yv[2 - i];
1501 }
1502
1503 TGeoXtru* connTail = new TGeoXtru(2);
1504 connTail->SetName("connTailA");
1505 connTail->DefinePolygon(6, xv, yv);
1506 connTail->DefineSection(0, 0);
1507 connTail->DefineSection(1, sIBConnTailZLen);
1508
1509 TGeoTube* connTubeHole1 = new TGeoTube("tube1HoleA", 0, sIBConnTubeHole1D / 2, sIBConnTubeHole1ZLen / 1.5);
1510
1511 xpos = sIBConnTubesXDist / 2;
1512 ypos = sIBConnTubesYPos;
1513 zpos = connTail->GetZ(1) / 2;
1514 TGeoTranslation* connTubes1Trans1 = new TGeoTranslation("tubes1Trans1A", -xpos, ypos, zpos);
1515 connTubes1Trans1->RegisterYourself();
1516 TGeoTranslation* connTubes1Trans2 = new TGeoTranslation("tubes1Trans2A", xpos, ypos, zpos);
1517 connTubes1Trans2->RegisterYourself();
1518
1519 TGeoCompositeShape* connTailSh =
1520 new TGeoCompositeShape("connTailA-tube1HoleA:tubes1Trans1A-tube1HoleA:tubes1Trans2A");
1521
1522 TGeoVolume* connBlockTail = new TGeoVolume("IBConnectorBlockTailASide", connTailSh, medPEEK);
1523 connBlockTail->SetFillColor(42); // Brownish shade
1524 connBlockTail->SetLineColor(42);
1525
1526 // The fitting tubes, a Tube
1527 TGeoTube* connFitSh = new TGeoTube(sIBConnectAFitIntD / 2, sIBConnectAFitExtD / 2, sIBConnectAFitZLen / 2);
1528
1529 TGeoVolume* connFit = new TGeoVolume("IBConnectorFitting", connFitSh, medInox304);
1530 connFit->SetFillColor(kGray);
1531 connFit->SetLineColor(kGray);
1532
1533 // Now create the container: cannot be a simple box
1534 // to avoid fake overlaps with stave elements
1535 xlen = sIBConnectorXWidth;
1536 ylen = sIBConnBodyYHeight;
1537 zlen = sIBConnectBlockZLen - sIBConnTailZLen + sIBConnectAFitZOut;
1538
1539 TGeoBBox* connBox = new TGeoBBox("connBoxA", xlen / 2, ylen / 2, zlen / 2);
1540
1541 ypos = -sIBConnectorYTot / 2 + connBox->GetDY();
1542 TGeoTranslation* transBodyA = new TGeoTranslation("transBodyA", 0, ypos, 0);
1543 transBodyA->RegisterYourself();
1544
1545 ypos = -sIBConnectorYTot / 2;
1546 zpos = -connBox->GetDZ() - connTail->GetZ(1);
1547 TGeoTranslation* transTailA = new TGeoTranslation("transTailA", 0, ypos, zpos);
1548 transTailA->RegisterYourself();
1549
1550 TGeoTube* connTubeHollow = new TGeoTube("tubeHollowA", 0, sIBConnTubeHole1D / 2, sIBConnTubeHole1ZLen / 2);
1551
1552 xpos = sIBConnTubesXDist / 2;
1553 ypos = -sIBConnectorYTot / 2 + sIBConnTubesYPos;
1554 zpos = -connBox->GetDZ() - connTail->GetZ(1) + sIBConnTubeHole1ZLen / 2;
1555 TGeoTranslation* connTubeHollTrans1 = new TGeoTranslation("tubeHollTrans1A", -xpos, ypos, zpos);
1556 connTubeHollTrans1->RegisterYourself();
1557 TGeoTranslation* connTubeHollTrans2 = new TGeoTranslation("tubeHollTrans2A", xpos, ypos, zpos);
1558 connTubeHollTrans2->RegisterYourself();
1559
1560 zpos = -connBox->GetDZ() + connTubeHole2->GetDz() - 2 * connFitHole->GetDz();
1561 TGeoTranslation* connTubes2Trans1Body = new TGeoTranslation("tubes2Trans1BA", -xpos, ypos, zpos);
1562 connTubes2Trans1Body->RegisterYourself();
1563 TGeoTranslation* connTubes2Trans2Body = new TGeoTranslation("tubes2Trans2BA", xpos, ypos, zpos);
1564 connTubes2Trans2Body->RegisterYourself();
1565
1566 TGeoCompositeShape* connBoxSh = new TGeoCompositeShape(
1567 "connBoxA:transBodyA-tube2HoleA:tubes2Trans1BA-tube2HoleA:tubes2Trans2BA+connTailA:transTailA-tubeHollowA:tubeHollTrans1A-"
1568 "tubeHollowA:tubeHollTrans2A");
1569
1570 TGeoVolume* connBoxASide = new TGeoVolume("IBConnectorASide", connBoxSh, medAir);
1571
1572 // Finally build up the connector
1573 // (NB: the origin is in the connBox, i.e. w/o the tail in Z)
1574 ypos = -sIBConnectorYTot / 2;
1575 zpos = -connBox->GetDZ() - connTail->GetZ(1);
1576 connBoxASide->AddNode(connBlockTail, 1, new TGeoTranslation(0, ypos, zpos));
1577
1578 ypos = -sIBConnectorYTot / 2 + connBody->GetDY();
1579 zpos = -connBox->GetDZ() + connBody->GetDZ();
1580 connBoxASide->AddNode(connBlockBody, 1, new TGeoTranslation(0, ypos, zpos));
1581
1582 xpos = sIBConnTubesXDist / 2;
1583 ypos = -sIBConnectorYTot / 2 + sIBConnTubesYPos;
1584 zpos = connBox->GetDZ() - connFitSh->GetDz();
1585 connBoxASide->AddNode(connFit, 1, new TGeoTranslation(xpos, ypos, zpos));
1586 connBoxASide->AddNode(connFit, 2, new TGeoTranslation(-xpos, ypos, zpos));
1587}
1588
1589void V3Layer::createIBConnectorsCSide(const TGeoManager* mgr)
1590{
1591 //
1592 // Create the C-Side end-stave connectors for IB staves
1593 //
1594 // Created: 05 May 2015 Mario Sitta
1595 // Updated: 04 Apr 2017 Mario Sitta O2 version
1596 // Updated: 28 Jan 2018 Mario Sitta To last drawings (ALIITSUP0051)
1597 // Updated: 15 May 2019 Mario Sitta Avoid fake overlaps with EndWheels
1598 //
1599
1600 // Local variables
1601 const Int_t nv = 8;
1602 Double_t xv[nv], yv[nv];
1603 Double_t xlen, ylen, zlen;
1604 Double_t xpos, ypos, zpos;
1605
1606 // Gather all material pointers
1607 TGeoMedium* medAir = mgr->GetMedium(Form("%s_AIR$", GetDetName()));
1608 TGeoMedium* medPEEK = mgr->GetMedium(Form("%s_PEEKCF30$", GetDetName()));
1609
1610 // First create all elements
1611 // (All measures refer to the blueprint ALIITSUP0051)
1612
1613 // The connector block, two Composite Shapes:
1614 // the body...
1615 xlen = sIBConnectorXWidth;
1616 ylen = sIBConnBodyYHeight;
1617 zlen = sIBConnectBlockZLen - sIBConnTailZLen;
1618 TGeoBBox* connBody = new TGeoBBox("connBodyC", xlen / 2, ylen / 2, zlen / 2);
1619
1620 TGeoTube* connRoundHole = new TGeoTube("connRoundHoleC", 0., sIBConnRoundHoleD / 2, sIBConnBodyYHeight / 1.5);
1621
1622 zpos = -connBody->GetDZ() + sIBConnRoundHoleZ;
1623 TGeoCombiTrans* connRoundHoleTrans =
1624 new TGeoCombiTrans("roundHoleTransC", 0, 0, zpos, new TGeoRotation("", 0, 90, 0));
1625 connRoundHoleTrans->RegisterYourself();
1626
1627 TGeoTube* connInsertHole = new TGeoTube("connInsertHoleC", 0, sIBConnInsertHoleD / 2, sIBConnBodyYHeight / 1.5);
1628
1629 zpos = -connBody->GetDZ() + sIBConnInsertHoleZPos;
1630 TGeoCombiTrans* connInsertHoleTrans =
1631 new TGeoCombiTrans("insertHoleTransC", 0, 0, zpos, new TGeoRotation("", 0, 90, 0));
1632 connInsertHoleTrans->RegisterYourself();
1633
1634 TGeoTube* connTubeHole2 = new TGeoTube("tube2HoleC", 0, sIBConnTubeHole2D / 2, connBody->GetDZ());
1635
1636 xpos = sIBConnTubesXDist / 2;
1637 ypos = -connBody->GetDY() + sIBConnTubesYPos;
1638 zpos = sIBConnectBlockZLen - sIBConnTubeHole3ZPos;
1639 TGeoTranslation* connTubes2Trans1 = new TGeoTranslation("tubes2Trans1C", -xpos, ypos, -zpos);
1640 connTubes2Trans1->RegisterYourself();
1641 TGeoTranslation* connTubes2Trans2 = new TGeoTranslation("tubes2Trans2C", xpos, ypos, -zpos);
1642 connTubes2Trans2->RegisterYourself();
1643
1644 zlen = sIBConnectorXWidth;
1645 TGeoTube* connTubeHole3 = new TGeoTube("tube3HoleC", 0, sIBConnTubeHole2D / 2, zlen / 2);
1646
1647 xpos = sIBConnTubeHole3XPos;
1648 zpos = connBody->GetDZ() - (sIBConnectBlockZLen - sIBConnTubeHole3ZPos);
1649 TGeoCombiTrans* connTubes3Trans =
1650 new TGeoCombiTrans("tubes3TransC", xpos, ypos, zpos, new TGeoRotation("", 90, -90, 90));
1651 connTubes3Trans->RegisterYourself();
1652
1653 zlen = sIBConnTubeHole1ZLen - sIBConnTailZLen;
1654 TGeoTube* connTubeHole4 = new TGeoTube("tube4HoleC", 0, sIBConnTubeHole1D / 2, zlen);
1655
1656 xpos = sIBConnTubesXDist / 2;
1657 zpos = connBody->GetDZ();
1658 TGeoTranslation* connTubes4Trans1 = new TGeoTranslation("tubes4Trans1C", -xpos, ypos, -zpos);
1659 connTubes4Trans1->RegisterYourself();
1660 TGeoTranslation* connTubes4Trans2 = new TGeoTranslation("tubes4Trans2C", xpos, ypos, -zpos);
1661 connTubes4Trans2->RegisterYourself();
1662
1663 zlen = sIBConnSideHole1XWid / 1.5;
1664 TGeoTube* sideHole1 = new TGeoTube("sideHole1C", 0, sIBConnSideHole1D / 2, zlen);
1665
1666 xpos = -connBody->GetDX() + sIBConnSideHole1XWid - sideHole1->GetDz();
1667 ypos = connBody->GetDY() - sIBConnSideHole1YPos;
1668 zpos = -connBody->GetDZ() + (sIBConnSideHole1ZPos - sIBConnTailZLen);
1669 TGeoCombiTrans* connSideHole1Trans =
1670 new TGeoCombiTrans("sideHole1TransC", xpos, ypos, zpos, new TGeoRotation("", 90, 90, 0));
1671 connSideHole1Trans->RegisterYourself();
1672
1673 TGeoBBox* sideHole2Box =
1674 new TGeoBBox("sideHole2CB", sIBConnSideHole2XWid, sIBConnSideHole2YWid / 2, sIBConnSideHole2ZWid / 2);
1675
1676 xpos = connBody->GetDX();
1677 ypos = connBody->GetDY() - sIBConnSideHole2YPos;
1678 zpos = -connBody->GetDZ() + (sIBConnSideHole2ZPos - sIBConnTailZLen) + sideHole2Box->GetDZ();
1679 TGeoTranslation* sideHole2BTrans = new TGeoTranslation("sideHole2TransBC", xpos, ypos, zpos);
1680 sideHole2BTrans->RegisterYourself();
1681
1682 TGeoTubeSeg* sideHole2TubeSeg =
1683 new TGeoTubeSeg("sideHole2CTS", 0, sIBConnSideHole2YWid / 2, sIBConnSideHole2XWid, 180, 360);
1684
1685 zpos = -connBody->GetDZ() + (sIBConnSideHole2ZPos - sIBConnTailZLen);
1686 TGeoCombiTrans* sideHole2TSTrans1 =
1687 new TGeoCombiTrans("sideHole2TSTrans1C", xpos, ypos, zpos, new TGeoRotation("", -90, 90, 0));
1688 sideHole2TSTrans1->RegisterYourself();
1689
1690 zpos = -connBody->GetDZ() + (sIBConnSideHole2ZPos - sIBConnTailZLen) + 2 * sideHole2Box->GetDZ();
1691 TGeoCombiTrans* sideHole2TSTrans2 =
1692 new TGeoCombiTrans("sideHole2TSTrans2C", xpos, ypos, zpos, new TGeoRotation("", -90, -90, 0));
1693 sideHole2TSTrans2->RegisterYourself();
1694
1695 TGeoCompositeShape* connBodySh = new TGeoCompositeShape(
1696 "connBodyC-tube2HoleC:tubes2Trans1C-tube2HoleC:tubes2Trans2C-tube3HoleC:tubes3TransC-tube4HoleC:tubes4Trans1C-"
1697 "tube4HoleC:tubes4Trans2C-sideHole1C:sideHole1TransC-sideHole2CTS:sideHole2TSTrans1C-sideHole2CTS:"
1698 "sideHole2TSTrans2C-sideHole2CB:sideHole2TransBC-connRoundHoleC:roundHoleTransC-connInsertHoleC:insertHoleTransC");
1699
1700 TGeoVolume* connBlockBody = new TGeoVolume("IBConnectorBlockBodyCSide", connBodySh, medPEEK);
1701 connBlockBody->SetFillColor(42); // Brownish shade
1702 connBlockBody->SetLineColor(42);
1703
1704 // ...and the tail
1705 xv[0] = sIBConnectorXWidth / 2;
1706 yv[0] = sIBConnTailYShift;
1707 xv[1] = xv[0];
1708 yv[1] = sIBConnTailYMid;
1709 xv[2] = xv[1] - (sIBConnectorYTot - sIBConnTailYMid) / tanD(90 - sIBConnTailOpenPhi / 2);
1710 yv[2] = sIBConnectorYTot;
1711
1712 for (Int_t i = 0; i < 3; i++) {
1713 xv[3 + i] = -xv[2 - i];
1714 yv[3 + i] = yv[2 - i];
1715 }
1716
1717 TGeoXtru* connTail = new TGeoXtru(2);
1718 connTail->SetName("connTailC");
1719 connTail->DefinePolygon(6, xv, yv);
1720 connTail->DefineSection(0, 0);
1721 connTail->DefineSection(1, sIBConnTailZLen);
1722
1723 TGeoTube* connTubeHole1 = new TGeoTube("tube1HoleC", 0, sIBConnTubeHole1D / 2, sIBConnTubeHole1ZLen / 1.5);
1724
1725 xpos = sIBConnTubesXDist / 2;
1726 ypos = sIBConnTubesYPos;
1727 zpos = connTail->GetZ(1) / 2;
1728 TGeoTranslation* connTubes1Trans1 = new TGeoTranslation("tubes1Trans1C", -xpos, ypos, zpos);
1729 connTubes1Trans1->RegisterYourself();
1730 TGeoTranslation* connTubes1Trans2 = new TGeoTranslation("tubes1Trans2C", xpos, ypos, zpos);
1731 connTubes1Trans2->RegisterYourself();
1732
1733 TGeoCompositeShape* connTailSh =
1734 new TGeoCompositeShape("connTailC-tube1HoleC:tubes1Trans1C-tube1HoleC:tubes1Trans2C");
1735
1736 TGeoVolume* connBlockTail = new TGeoVolume("IBConnectorBlockTailCSide", connTailSh, medPEEK);
1737 connBlockTail->SetFillColor(42); // Brownish shade
1738 connBlockTail->SetLineColor(42);
1739
1740 // The plug, a Pcon
1741 zlen = sIBConnPlugTotLen - sIBConnPlugInnerLen;
1742 TGeoPcon* connPlugSh = new TGeoPcon(0, 360, 4);
1743 connPlugSh->DefineSection(0, 0., 0., sIBConnTubeHole2D / 2);
1744 connPlugSh->DefineSection(1, zlen, 0., sIBConnTubeHole2D / 2);
1745 connPlugSh->DefineSection(2, zlen, sIBConnPlugInnerD / 2, sIBConnTubeHole2D / 2);
1746 connPlugSh->DefineSection(3, sIBConnPlugTotLen, sIBConnPlugInnerD / 2, sIBConnTubeHole2D / 2);
1747
1748 TGeoVolume* connPlug = new TGeoVolume("IBConnectorPlugC", connPlugSh, medPEEK);
1749 connPlug->SetFillColor(44); // Brownish shade (a bit darker to spot it)
1750 connPlug->SetLineColor(44);
1751
1752 // Now create the container: cannot be a simple box
1753 // to avoid fake overlaps with stave elements
1754 xlen = sIBConnectorXWidth;
1755 ylen = sIBConnBodyYHeight;
1756 zlen = sIBConnectBlockZLen - sIBConnTailZLen;
1757
1758 TGeoBBox* connBox = new TGeoBBox("connBoxC", xlen / 2, ylen / 2, zlen / 2);
1759
1760 ypos = -sIBConnectorYTot / 2 + connBox->GetDY();
1761 TGeoTranslation* transBodyC = new TGeoTranslation("transBodyC", 0, ypos, 0);
1762 transBodyC->RegisterYourself();
1763
1764 ypos = -sIBConnectorYTot / 2;
1765 zpos = -connBox->GetDZ() - connTail->GetZ(1);
1766 TGeoTranslation* transTailC = new TGeoTranslation("transTailC", 0, ypos, zpos);
1767 transTailC->RegisterYourself();
1768
1769 TGeoTube* connTubeHollow = new TGeoTube("tubeHollowC", 0, sIBConnTubeHole1D / 2, sIBConnTubeHole1ZLen / 2);
1770
1771 xpos = sIBConnTubesXDist / 2;
1772 ypos = -sIBConnectorYTot / 2 + sIBConnTubesYPos;
1773 zpos = -connBox->GetDZ() - connTail->GetZ(1) + sIBConnTubeHole1ZLen / 2;
1774 TGeoTranslation* connTubeHollTrans1 = new TGeoTranslation("tubeHollTrans1C", -xpos, ypos, zpos);
1775 connTubeHollTrans1->RegisterYourself();
1776 TGeoTranslation* connTubeHollTrans2 = new TGeoTranslation("tubeHollTrans2C", xpos, ypos, zpos);
1777 connTubeHollTrans2->RegisterYourself();
1778
1779 zpos = connBody->GetDZ() - (sIBConnectBlockZLen - sIBConnTubeHole3ZPos);
1780 TGeoTranslation* connTubes2Trans1Body = new TGeoTranslation("tubes2Trans1BC", -xpos, ypos, -zpos);
1781 connTubes2Trans1Body->RegisterYourself();
1782 TGeoTranslation* connTubes2Trans2Body = new TGeoTranslation("tubes2Trans2BC", xpos, ypos, -zpos);
1783 connTubes2Trans2Body->RegisterYourself();
1784
1785 TGeoCompositeShape* connBoxSh = new TGeoCompositeShape(
1786 "connBoxC:transBodyC-tube2HoleC:tubes2Trans1BC-tube2HoleC:tubes2Trans2BC+connTailC:transTailC-tubeHollowC:tubeHollTrans1C-"
1787 "tubeHollowC:tubeHollTrans2C");
1788
1789 TGeoVolume* connBoxCSide = new TGeoVolume("IBConnectorCSide", connBoxSh, medAir);
1790
1791 // Finally build up the connector
1792 // (NB: the origin is in the connBox, i.e. w/o the tail in Z)
1793 ypos = -connBoxSh->GetDY();
1794 zpos = -connBodySh->GetDZ() - connTail->GetZ(1);
1795 connBoxCSide->AddNode(connBlockTail, 1, new TGeoTranslation(0, ypos, zpos));
1796
1797 ypos = -connBoxSh->GetDY() + connBody->GetDY();
1798 connBoxCSide->AddNode(connBlockBody, 1, new TGeoTranslation(0, ypos, 0));
1799
1800 xpos = connBox->GetDX();
1801 ypos = -sIBConnectorYTot / 2 + sIBConnTubesYPos;
1802 zpos = connBody->GetDZ() - (sIBConnectBlockZLen - sIBConnTubeHole3ZPos);
1803 connBoxCSide->AddNode(connPlug, 1, new TGeoCombiTrans(xpos, ypos, zpos, new TGeoRotation("", 90, -90, 90)));
1804}
1805
1806TGeoVolume* V3Layer::createStaveOuterB(const TGeoManager* mgr)
1807{
1808 // Create the chip stave for the Outer Barrel
1809 //
1810 // Input:
1811 // mgr : the GeoManager (used only to get the proper material)
1812 //
1813 // Output:
1814 //
1815 // Return:
1816 //
1817 // Created: 20 Dec 2013 Mario Sitta
1818 // Updated: 12 Mar 2014 Mario Sitta
1819 // Updated: 19 Jul 2017 Mario Sitta O2 version
1820 //
1821 TGeoVolume* mechStavVol = nullptr;
1822
1823 switch (mStaveModel) {
1824 case kOBModelDummy:
1825 mechStavVol = createStaveModelOuterBDummy(mgr);
1826 break;
1827 case kOBModel0:
1828 case kOBModel1:
1829 LOG(fatal) << "Stave model " << mStaveModel << " obsolete and no longer supported";
1830 break;
1831 case kOBModel2:
1832 mechStavVol = createStaveModelOuterB2(mgr);
1833 break;
1834 default:
1835 LOG(fatal) << "Unknown stave model " << mStaveModel;
1836 break;
1837 }
1838 return mechStavVol;
1839}
1840
1841TGeoVolume* V3Layer::createStaveModelOuterBDummy(const TGeoManager*) const
1842{
1843 //
1844 // Create dummy stave
1845 //
1846 // Input:
1847 // mgr : the GeoManager (used only to get the proper material)
1848 //
1849 // Output:
1850 //
1851 // Return:
1852 //
1853 // Created: 20 Dec 2013 Mario Sitta
1854 //
1855
1856 // Done, return the stave structure
1857 return nullptr;
1858}
1859
1860TGeoVolume* V3Layer::createStaveModelOuterB2(const TGeoManager* mgr)
1861{
1862 //
1863 // Create the mechanical half stave structure
1864 // for the Outer Barrel as in TDR
1865 //
1866 // Input:
1867 // mgr : the GeoManager (used only to get the proper material)
1868 //
1869 // Output:
1870 //
1871 // Return:
1872 //
1873 // Created: 20 Nov 2013 Anastasia Barbano
1874 // Updated: 16 Jan 2014 Mario Sitta
1875 // Updated: 24 Feb 2014 Mario Sitta
1876 // Updated: 11 Nov 2014 Mario Sitta Model2
1877 // Updated: 03 Dec 2014 Mario Sitta Revised with C.Gargiulo latest infos
1878 // Updated: 19 Jul 2017 Mario Sitta O2 version
1879 // Updated: 04 Aug 2018 Mario Sitta Updated geometry
1880 // Updated: 25 Aug 2018 Mario Sitta To latest blueprints
1881 //
1882
1883 // Local parameters
1884 Double_t yFlex1 = sOBFlexCableAlThick;
1885 Double_t yFlex2 = sOBFlexCableKapThick;
1886 Double_t flexOverlap = 5; // to be checked - unused for the time being
1887 Double_t yCFleece = sOBCarbonFleeceThick;
1888 Double_t yGraph = sOBGraphiteFoilThick;
1889 Double_t xHalfSt, yHalfSt;
1890
1891 Double_t xmod, ymod, zmod, ypowbus, zbias;
1892 Double_t xtru[12], ytru[12];
1893 Double_t xpos, ypos, ypos1, zpos /*, zpos5cm*/;
1894 Double_t xlen, ylen, zlen;
1895 const Int_t nameLen = 30;
1896 char volname[nameLen];
1897
1898 Double_t rCoolMin, rCoolMax;
1899 rCoolMin = sOBCoolTubeInnerD / 2;
1900
1901 rCoolMax = rCoolMin + sOBCoolTubeThick;
1902
1903 // First create all needed shapes
1904
1905 TGeoVolume* moduleVol = createModuleOuterB();
1906 moduleVol->SetVisibility(kTRUE);
1907 xmod = (static_cast<TGeoBBox*>(moduleVol->GetShape()))->GetDX();
1908 ymod = (static_cast<TGeoBBox*>(moduleVol->GetShape()))->GetDY();
1909 zmod = (static_cast<TGeoBBox*>(moduleVol->GetShape()))->GetDZ();
1910
1911 if (mLayerNumber <= 4) {
1912 zlen = sOBColdPlateZLenML / 2; // Middle Layer
1913 } else {
1914 zlen = sOBColdPlateZLenOL / 2; // Outer Layer
1915 }
1916
1917 xlen = sOBColdPlateXWidth / 2;
1918
1919 TGeoBBox* coldPlate = new TGeoBBox("ColdPlate", xlen, sOBColdPlateThick / 2, zlen);
1920
1921 TGeoBBox* fleeccent = new TGeoBBox("FleeceCent", xlen, yCFleece / 2, zlen);
1922
1923 TGeoTube* coolTube = new TGeoTube("CoolingTube", rCoolMin, rCoolMax, zlen);
1924 TGeoTube* coolWater = new TGeoTube("CoolingWater", 0., rCoolMin, zlen);
1925
1926 xlen = sOBColdPlateXWidth / 2 - sOBCoolTubeXDist / 2 - coolTube->GetRmax();
1927 TGeoBBox* graphlat = new TGeoBBox("GraphLateral", xlen / 2, yGraph / 2, zlen);
1928
1929 xlen = sOBCoolTubeXDist / 2 - coolTube->GetRmax();
1930 TGeoBBox* graphmid = new TGeoBBox("GraphMiddle", xlen, yGraph / 2, zlen);
1931
1932 ylen = coolTube->GetRmax() - yGraph;
1933 TGeoBBox* graphvert = new TGeoBBox("GraphVertical", yGraph / 2, ylen / 2, zlen);
1934
1935 TGeoTubeSeg* graphtub = new TGeoTubeSeg("GraphTube", rCoolMax, rCoolMax + yGraph, zlen, 180., 360.);
1936
1937 xlen = sOBColdPlateXWidth / 2 - sOBCoolTubeXDist / 2 - coolTube->GetRmax() - yGraph;
1938 TGeoBBox* fleeclat = new TGeoBBox("FleecLateral", xlen / 2, yCFleece / 2, zlen);
1939
1940 xlen = sOBCoolTubeXDist / 2 - coolTube->GetRmax() - yGraph;
1941 TGeoBBox* fleecmid = new TGeoBBox("FleecMiddle", xlen, yCFleece / 2, zlen);
1942
1943 ylen = coolTube->GetRmax() - yGraph - yCFleece;
1944 TGeoBBox* fleecvert = new TGeoBBox("FleecVertical", yCFleece / 2, ylen / 2, zlen);
1945
1946 TGeoTubeSeg* fleectub =
1947 new TGeoTubeSeg("FleecTube", rCoolMax + yGraph, rCoolMax + yCFleece + yGraph, zlen, 180., 360.);
1948
1949 // TGeoBBox* flex1_5cm = new TGeoBBox("Flex1MV_5cm", xHalfSt, yFlex1 / 2, flexOverlap / 2);
1950 // TGeoBBox* flex2_5cm = new TGeoBBox("Flex2MV_5cm", xHalfSt, yFlex2 / 2, flexOverlap / 2);
1951
1952 // The power bus
1953 TGeoVolume* powerBusVol = createOBPowerBiasBuses(zlen);
1954 powerBusVol->SetVisibility(kTRUE);
1955 ypowbus = (static_cast<TGeoBBox*>(powerBusVol->GetShape()))->GetDY();
1956
1957 // The half stave container (an XTru to avoid overlaps between neightbours)
1958 xHalfSt = xmod; // add the cross cables when done!
1959 yHalfSt = ypowbus + ymod + coldPlate->GetDY() + 2 * fleeccent->GetDY() + graphlat->GetDY() + fleeclat->GetDY();
1960
1961 xtru[0] = xHalfSt;
1962 ytru[0] = 0;
1963 xtru[1] = xtru[0];
1964 ytru[1] = -2 * yHalfSt;
1965 xtru[2] = sOBCoolTubeXDist / 2 + fleectub->GetRmax();
1966 ytru[2] = ytru[1];
1967 xtru[3] = xtru[2];
1968 ytru[3] = ytru[2] - (coolTube->GetRmax() + fleectub->GetRmax());
1969 xtru[4] = sOBCoolTubeXDist / 2 - fleectub->GetRmax();
1970 ytru[4] = ytru[3];
1971 xtru[5] = xtru[4];
1972 ytru[5] = ytru[2];
1973 for (Int_t i = 0; i < 6; i++) {
1974 xtru[6 + i] = -xtru[5 - i];
1975 ytru[6 + i] = ytru[5 - i];
1976 }
1977 TGeoXtru* halfStaveCent = new TGeoXtru(2);
1978 halfStaveCent->DefinePolygon(12, xtru, ytru);
1979 halfStaveCent->DefineSection(0, -zlen);
1980 halfStaveCent->DefineSection(1, zlen);
1981 snprintf(volname, nameLen, "staveCentral%d", mLayerNumber);
1982 halfStaveCent->SetName(volname);
1983
1984 // The connectors' containers
1985 TGeoBBox* connAside = new TGeoBBox("connAsideOB", sOBCPConnectorXWidth / 2, sOBCPConnBlockYHei / 2,
1986 (sOBCPConnBlockZLen + sOBCPConnAFitZLen - sOBCPConnAFitZIn) / 2);
1987
1988 TGeoBBox* connCside =
1989 new TGeoBBox("connCsideOB", sOBCPConnectorXWidth / 2, sOBCPConnBlockYHei / 2, sOBCPConnBlockZLen / 2);
1990
1991 // The StaveStruct container, a Composite Shape
1992 ypos = 2 * yHalfSt + connAside->GetDY() - sOBCPConnHollowYHei;
1993 zpos = zlen + connAside->GetDZ() - sOBCPConnHollowZLen;
1994 snprintf(volname, nameLen, "transAsideOB%d", mLayerNumber);
1995 TGeoTranslation* transAside = new TGeoTranslation(volname, 0, -ypos, zpos);
1996 transAside->RegisterYourself();
1997
1998 zpos = zlen + connCside->GetDZ() - sOBCPConnHollowZLen;
1999 snprintf(volname, nameLen, "transCsideOB%d", mLayerNumber);
2000 TGeoTranslation* transCside = new TGeoTranslation(volname, 0, -ypos, -zpos);
2001 transCside->RegisterYourself();
2002
2003 char componame[70];
2004 snprintf(componame, 70, "staveCentral%d+connAsideOB:transAsideOB%d+connCsideOB:transCsideOB%d", mLayerNumber,
2005 mLayerNumber, mLayerNumber);
2006
2007 TGeoCompositeShape* halfStave = new TGeoCompositeShape(componame);
2008
2009 // We have all shapes: now create the real volumes
2010
2011 TGeoMedium* medAluminum = mgr->GetMedium(Form("%s_ALUMINUM$", GetDetName()));
2012 TGeoMedium* medK13D2U120 = mgr->GetMedium(Form("%s_K13D2U120$", GetDetName()));
2013 TGeoMedium* medKapton = mgr->GetMedium(Form("%s_KAPTON(POLYCH2)$", GetDetName()));
2014 TGeoMedium* medWater = mgr->GetMedium(Form("%s_WATER$", GetDetName()));
2015 TGeoMedium* medCarbonFleece = mgr->GetMedium(Form("%s_CarbonFleece$", GetDetName()));
2016 TGeoMedium* medFGS003 = mgr->GetMedium(Form("%s_FGS003$", GetDetName())); // amec thermasol
2017 TGeoMedium* medAir = mgr->GetMedium(Form("%s_AIR$", GetDetName()));
2018 TGeoMedium* medTungsten = mgr->GetMedium(Form("%s_TUNGSTEN$", GetDetName()));
2019
2020 TGeoVolume* coldPlateVol = new TGeoVolume("ColdPlateVol", coldPlate, medK13D2U120);
2021 coldPlateVol->SetLineColor(kYellow - 3);
2022 coldPlateVol->SetFillColor(coldPlateVol->GetLineColor());
2023 coldPlateVol->SetFillStyle(4000); // 0% transparent
2024
2025 TGeoVolume* fleeccentVol = new TGeoVolume("CarbonFleeceCentral", fleeccent, medCarbonFleece);
2026 fleeccentVol->SetLineColor(kViolet);
2027 fleeccentVol->SetFillColor(fleeccentVol->GetLineColor());
2028 fleeccentVol->SetFillStyle(4000); // 0% transparent
2029
2030 TGeoVolume* coolTubeVol = new TGeoVolume("CoolingTubeVol", coolTube, medKapton);
2031 coolTubeVol->SetLineColor(kGray);
2032 coolTubeVol->SetFillColor(coolTubeVol->GetLineColor());
2033 coolTubeVol->SetFillStyle(4000); // 0% transparent
2034
2035 TGeoVolume* coolWaterVol;
2036 coolWaterVol = new TGeoVolume("CoolingWaterVol", coolWater, medWater);
2037 coolWaterVol->SetLineColor(kBlue);
2038 coolWaterVol->SetFillColor(coolWaterVol->GetLineColor());
2039 coolWaterVol->SetFillStyle(4000); // 0% transparent
2040
2041 TGeoVolume* graphlatVol = new TGeoVolume("GraphiteFoilLateral", graphlat, medFGS003);
2042 graphlatVol->SetLineColor(kGreen);
2043 graphlatVol->SetFillColor(graphlatVol->GetLineColor());
2044 graphlatVol->SetFillStyle(4000); // 0% transparent
2045
2046 TGeoVolume* graphmidVol = new TGeoVolume("GraphiteFoilMiddle", graphmid, medFGS003);
2047 graphmidVol->SetLineColor(kGreen);
2048 graphmidVol->SetFillColor(graphmidVol->GetLineColor());
2049 graphmidVol->SetFillStyle(4000); // 0% transparent
2050
2051 TGeoVolume* graphvertVol = new TGeoVolume("GraphiteFoilVertical", graphvert, medFGS003);
2052 graphvertVol->SetLineColor(kGreen);
2053 graphvertVol->SetFillColor(graphvertVol->GetLineColor());
2054 graphvertVol->SetFillStyle(4000); // 0% transparent
2055
2056 TGeoVolume* graphtubVol = new TGeoVolume("GraphiteFoilPipeCover", graphtub, medFGS003);
2057 graphtubVol->SetLineColor(kGreen);
2058 graphtubVol->SetFillColor(graphtubVol->GetLineColor());
2059 graphtubVol->SetFillStyle(4000); // 0% transparent
2060
2061 TGeoVolume* fleeclatVol = new TGeoVolume("CarbonFleeceLateral", fleeclat, medCarbonFleece);
2062 fleeclatVol->SetLineColor(kViolet);
2063 fleeclatVol->SetFillColor(fleeclatVol->GetLineColor());
2064 fleeclatVol->SetFillStyle(4000); // 0% transparent
2065
2066 TGeoVolume* fleecmidVol = new TGeoVolume("CarbonFleeceMiddle", fleecmid, medCarbonFleece);
2067 fleecmidVol->SetLineColor(kViolet);
2068 fleecmidVol->SetFillColor(fleecmidVol->GetLineColor());
2069 fleecmidVol->SetFillStyle(4000); // 0% transparent
2070
2071 TGeoVolume* fleecvertVol = new TGeoVolume("CarbonFleeceVertical", fleecvert, medCarbonFleece);
2072 fleecvertVol->SetLineColor(kViolet);
2073 fleecvertVol->SetFillColor(fleecvertVol->GetLineColor());
2074 fleecvertVol->SetFillStyle(4000); // 0% transparent
2075
2076 TGeoVolume* fleectubVol = new TGeoVolume("CarbonFleecePipeCover", fleectub, medCarbonFleece);
2077 fleectubVol->SetLineColor(kViolet);
2078 fleectubVol->SetFillColor(fleectubVol->GetLineColor());
2079 fleectubVol->SetFillStyle(4000); // 0% transparent
2080
2081 snprintf(volname, nameLen, "%s%d", GeometryTGeo::getITSHalfStavePattern(), mLayerNumber);
2082 TGeoVolume* halfStaveVol = new TGeoVolume(volname, halfStave, medAir);
2083 // halfStaveVol->SetLineColor(12);
2084 // halfStaveVol->SetFillColor(12);
2085 // halfStaveVol->SetVisibility(kTRUE);
2086
2087 // TGeoVolume* flex1_5cmVol = new TGeoVolume("Flex1Vol5cm", flex1_5cm, medAluminum);
2088 // TGeoVolume* flex2_5cmVol = new TGeoVolume("Flex2Vol5cm", flex2_5cm, medKapton);
2089
2090 // flex1_5cmVol->SetLineColor(kRed);
2091 // flex2_5cmVol->SetLineColor(kGreen);
2092
2093 // Compute starting Z pos to center modules in stave
2094 // (no need to divide by 2, these are already half-lengths)
2095 zbias = zlen - mNumberOfModules * zmod - (mNumberOfModules - 1) * 0.5 * sOBModuleGap;
2096
2097 // Now build up the half stave
2098 ypos = -ypowbus;
2099 halfStaveVol->AddNode(powerBusVol, 1, new TGeoTranslation(0, ypos, 0));
2100
2101 ypos -= (ypowbus + ymod);
2102 for (Int_t j = 0; j < mNumberOfModules; j++) {
2103 zpos = zlen - zbias - j * (2 * zmod + sOBModuleGap) - zmod;
2104 halfStaveVol->AddNode(moduleVol, j, new TGeoTranslation(0, ypos, zpos));
2105 mHierarchy[kModule]++;
2106 }
2107
2108 ypos -= ymod;
2109
2110 ypos -= fleeccent->GetDY();
2111 if (mBuildLevel < 6) { // Carbon
2112 halfStaveVol->AddNode(fleeccentVol, 1, new TGeoTranslation(0, ypos, 0));
2113 }
2114 ypos -= fleeccent->GetDY();
2115
2116 ypos -= coldPlate->GetDY();
2117 if (mBuildLevel < 6) { // Carbon
2118 halfStaveVol->AddNode(coldPlateVol, 1, new TGeoTranslation(0, ypos, 0));
2119 }
2120 ypos -= coldPlate->GetDY();
2121
2122 ypos -= fleeccent->GetDY();
2123 if (mBuildLevel < 6) { // Carbon
2124 halfStaveVol->AddNode(fleeccentVol, 2, new TGeoTranslation(0, ypos, 0));
2125 }
2126
2127 xpos = sOBCoolTubeXDist / 2;
2128 ypos1 = ypos - (fleeccent->GetDY() + coolTube->GetRmax());
2129 if (mBuildLevel < 4) { // Water
2130 halfStaveVol->AddNode(coolWaterVol, 1, new TGeoTranslation(-xpos, ypos1, 0));
2131 halfStaveVol->AddNode(coolWaterVol, 2, new TGeoTranslation(xpos, ypos1, 0));
2132 }
2133
2134 if (mBuildLevel < 5) { // Kapton
2135 halfStaveVol->AddNode(coolTubeVol, 1, new TGeoTranslation(-xpos, ypos1, 0));
2136 halfStaveVol->AddNode(coolTubeVol, 2, new TGeoTranslation(xpos, ypos1, 0));
2137 }
2138
2139 if (mBuildLevel < 6) { // Carbon
2140 halfStaveVol->AddNode(graphtubVol, 1, new TGeoTranslation(-xpos, ypos1, 0));
2141 halfStaveVol->AddNode(graphtubVol, 2, new TGeoTranslation(xpos, ypos1, 0));
2142
2143 halfStaveVol->AddNode(fleectubVol, 1, new TGeoTranslation(-xpos, ypos1, 0));
2144 halfStaveVol->AddNode(fleectubVol, 2, new TGeoTranslation(xpos, ypos1, 0));
2145 }
2146
2147 xpos = sOBColdPlateXWidth / 2 - graphlat->GetDX();
2148 ypos1 = ypos - (fleeccent->GetDY() + graphlat->GetDY());
2149 if (mBuildLevel < 6) { // Carbon
2150 halfStaveVol->AddNode(graphlatVol, 1, new TGeoTranslation(-xpos, ypos1, 0));
2151 halfStaveVol->AddNode(graphlatVol, 2, new TGeoTranslation(xpos, ypos1, 0));
2152
2153 halfStaveVol->AddNode(graphmidVol, 1, new TGeoTranslation(0, ypos1, 0));
2154
2155 xpos = sOBColdPlateXWidth / 2 - 2 * graphlat->GetDX() + graphvert->GetDX();
2156 ypos1 = ypos - (fleeccent->GetDY() + 2 * graphlat->GetDY() + graphvert->GetDY());
2157 halfStaveVol->AddNode(graphvertVol, 1, new TGeoTranslation(-xpos, ypos1, 0));
2158 halfStaveVol->AddNode(graphvertVol, 2, new TGeoTranslation(xpos, ypos1, 0));
2159 xpos = graphmid->GetDX() - graphvert->GetDX();
2160 halfStaveVol->AddNode(graphvertVol, 3, new TGeoTranslation(-xpos, ypos1, 0));
2161 halfStaveVol->AddNode(graphvertVol, 4, new TGeoTranslation(xpos, ypos1, 0));
2162 }
2163
2164 xpos = sOBColdPlateXWidth / 2 - fleeclat->GetDX();
2165 ypos1 = ypos - (fleeccent->GetDY() + 2 * graphlat->GetDY() + fleeclat->GetDY());
2166 if (mBuildLevel < 6) { // Carbon
2167 halfStaveVol->AddNode(fleeclatVol, 1, new TGeoTranslation(-xpos, ypos1, 0));
2168 halfStaveVol->AddNode(fleeclatVol, 2, new TGeoTranslation(xpos, ypos1, 0));
2169
2170 halfStaveVol->AddNode(fleecmidVol, 1, new TGeoTranslation(0, ypos1, 0));
2171
2172 xpos = sOBColdPlateXWidth / 2 - 2 * fleeclat->GetDX() + fleecvert->GetDX();
2173 ypos1 = ypos - (fleeccent->GetDY() + 2 * graphlat->GetDY() + 2 * fleeclat->GetDY() + fleecvert->GetDY());
2174 halfStaveVol->AddNode(fleecvertVol, 1, new TGeoTranslation(-xpos, ypos1, 0));
2175 halfStaveVol->AddNode(fleecvertVol, 2, new TGeoTranslation(xpos, ypos1, 0));
2176 xpos = fleecmid->GetDX() - fleecvert->GetDX();
2177 halfStaveVol->AddNode(fleecvertVol, 3, new TGeoTranslation(-xpos, ypos1, 0));
2178 halfStaveVol->AddNode(fleecvertVol, 4, new TGeoTranslation(xpos, ypos1, 0));
2179 }
2180
2181 // Add the end-stave connectors
2182 TGeoVolume *connectorASide, *connectorCSide;
2183
2184 // Check whether we have already all pieces
2185 // Otherwise create them
2186 connectorASide = mgr->GetVolume("OBColdPlateConnectorASide");
2187
2188 if (!connectorASide) {
2189 createOBColdPlateConnectors();
2190 connectorASide = mgr->GetVolume("OBColdPlateConnectorASide");
2191 }
2192 connectorCSide = mgr->GetVolume("OBColdPlateConnectorCSide");
2193
2194 ypos = 2 * yHalfSt + (static_cast<TGeoBBox*>(connectorASide->GetShape()))->GetDY() - sOBCPConnHollowYHei;
2195 zpos = zlen + (static_cast<TGeoBBox*>(connectorASide->GetShape()))->GetDZ() - sOBCPConnHollowZLen;
2196 halfStaveVol->AddNode(connectorASide, 1, new TGeoCombiTrans(0, -ypos, zpos, new TGeoRotation("", 180, 0, 0)));
2197
2198 zpos = zlen + (static_cast<TGeoBBox*>(connectorCSide->GetShape()))->GetDZ() - sOBCPConnHollowZLen;
2199 halfStaveVol->AddNode(connectorCSide, 1, new TGeoCombiTrans(0, -ypos, -zpos, new TGeoRotation("", 180, 0, 0)));
2200
2201 // Done, return the half stave structure
2202 return halfStaveVol;
2203}
2204
2205TGeoVolume* V3Layer::createOBPowerBiasBuses(const Double_t zcable, const TGeoManager* mgr)
2206{
2207 //
2208 // Create the OB Power Bus and Bias Bus cables
2209 //
2210 // Input:
2211 // zcable : the cable half Z length
2212 // mgr : the GeoManager (used only to get the proper material)
2213 //
2214 // Output:
2215 //
2216 // Return:
2217 // a TGeoVolume with both the Power and the Bias Buses
2218 //
2219 // Created: 05 Aug 2018 Mario Sitta
2220 // Updated: 06 Sep 2018 Mario Sitta
2221 //
2222
2223 Double_t xcable, ytot, ypos;
2224
2225 // First create all needed shapes
2226 xcable = sOBPowerBusXWidth / 2;
2227 TGeoBBox* gndPB = new TGeoBBox(xcable, sOBPowerBusAlThick / 2, zcable);
2228 TGeoBBox* dielPB = new TGeoBBox(xcable, sOBPowerBusDielThick / 2, zcable);
2229 TGeoBBox* kapPB = new TGeoBBox(xcable, sOBPowerBusKapThick / 2, zcable);
2230 xcable *= sOBPowerBusAlFrac;
2231 TGeoBBox* topPB = new TGeoBBox(xcable, sOBPowerBusAlThick / 2, zcable);
2232
2233 xcable = sOBBiasBusXWidth / 2;
2234 TGeoBBox* botBB = new TGeoBBox(xcable, sOBBiasBusAlThick / 2, zcable);
2235 TGeoBBox* dielBB = new TGeoBBox(xcable, sOBBiasBusDielThick / 2, zcable);
2236 TGeoBBox* kapBB = new TGeoBBox(xcable, sOBBiasBusKapThick / 2, zcable);
2237 xcable *= sOBBiasBusAlFrac;
2238 TGeoBBox* topBB = new TGeoBBox(xcable, sOBBiasBusAlThick / 2, zcable);
2239
2240 // Then the volumes
2241 TGeoMedium* medKapton = mgr->GetMedium(Form("%s_KAPTON(POLYCH2)$", GetDetName()));
2242 TGeoMedium* medAluminum = mgr->GetMedium(Form("%s_ALUMINUM$", GetDetName()));
2243 TGeoMedium* medAir = mgr->GetMedium(Form("%s_AIR$", GetDetName()));
2244
2245 TGeoVolume* gndPBVol = new TGeoVolume("PowerBusGround", gndPB, medAluminum);
2246 gndPBVol->SetLineColor(kCyan);
2247 gndPBVol->SetFillColor(gndPBVol->GetLineColor());
2248 gndPBVol->SetFillStyle(4000); // 0% transparent
2249
2250 TGeoVolume* dielPBVol = new TGeoVolume("PowerBusDielectric", dielPB, medKapton);
2251 dielPBVol->SetLineColor(kBlue);
2252 dielPBVol->SetFillColor(dielPBVol->GetLineColor());
2253 dielPBVol->SetFillStyle(4000); // 0% transparent
2254
2255 TGeoVolume* kapPBVol = new TGeoVolume("PowerBusKapton", kapPB, medKapton);
2256 kapPBVol->SetLineColor(kBlue);
2257 kapPBVol->SetFillColor(kapPBVol->GetLineColor());
2258 kapPBVol->SetFillStyle(4000); // 0% transparent
2259
2260 TGeoVolume* topPBVol = new TGeoVolume("PowerBusTop", topPB, medAluminum);
2261 topPBVol->SetLineColor(kCyan);
2262 topPBVol->SetFillColor(topPBVol->GetLineColor());
2263 topPBVol->SetFillStyle(4000); // 0% transparent
2264
2265 TGeoVolume* botBBVol = new TGeoVolume("BiasBusBottom", botBB, medAluminum);
2266 botBBVol->SetLineColor(kCyan);
2267 botBBVol->SetFillColor(botBBVol->GetLineColor());
2268 botBBVol->SetFillStyle(4000); // 0% transparent
2269
2270 TGeoVolume* dielBBVol = new TGeoVolume("BiasBusDielectric", dielBB, medKapton);
2271 dielBBVol->SetLineColor(kBlue);
2272 dielBBVol->SetFillColor(dielBBVol->GetLineColor());
2273 dielBBVol->SetFillStyle(4000); // 0% transparent
2274
2275 TGeoVolume* kapBBVol = new TGeoVolume("BiasBusKapton", kapBB, medKapton);
2276 kapBBVol->SetLineColor(kBlue);
2277 kapBBVol->SetFillColor(kapBBVol->GetLineColor());
2278 kapBBVol->SetFillStyle(4000); // 0% transparent
2279
2280 TGeoVolume* topBBVol = new TGeoVolume("BiasBusTop", topBB, medAluminum);
2281 topBBVol->SetLineColor(kCyan);
2282 topBBVol->SetFillColor(topBBVol->GetLineColor());
2283 topBBVol->SetFillStyle(4000); // 0% transparent
2284
2285 // Finally the volume containing both the Power Bus and the Bias Bus
2286 xcable = sOBPowerBusXWidth / 2;
2287 ytot = 2 * kapPB->GetDY() + topPB->GetDY() + dielPB->GetDY() + gndPB->GetDY() + 2 * kapBB->GetDY() + topBB->GetDY() + dielBB->GetDY() + botBB->GetDY();
2288
2289 TGeoBBox* pnbBus = new TGeoBBox(xcable, ytot, zcable);
2290
2291 TGeoVolume* pnbBusVol = new TGeoVolume("OBPowerBiasBus", pnbBus, medAir);
2292
2293 // Volumes are piled up from bottom to top
2294 ypos = -pnbBus->GetDY() + kapPB->GetDY();
2295 if (mBuildLevel < 5) { // Kapton
2296 pnbBusVol->AddNode(kapPBVol, 1, new TGeoTranslation(0, ypos, 0));
2297 }
2298
2299 ypos += (kapPB->GetDY() + gndPB->GetDY());
2300 if (mBuildLevel < 2) { // Aluminum
2301 pnbBusVol->AddNode(gndPBVol, 1, new TGeoTranslation(0, ypos, 0));
2302 }
2303
2304 ypos += (gndPB->GetDY() + dielPB->GetDY());
2305 if (mBuildLevel < 5) { // Kapton
2306 pnbBusVol->AddNode(dielPBVol, 1, new TGeoTranslation(0, ypos, 0));
2307 }
2308
2309 ypos += (dielPB->GetDY() + topPB->GetDY());
2310 if (mBuildLevel < 2) { // Aluminum
2311 pnbBusVol->AddNode(topPBVol, 1, new TGeoTranslation(0, ypos, 0));
2312 }
2313
2314 ypos += (topPB->GetDY() + kapPB->GetDY());
2315 if (mBuildLevel < 5) { // Kapton
2316 pnbBusVol->AddNode(kapPBVol, 2, new TGeoTranslation(0, ypos, 0));
2317 }
2318
2319 //
2320 ypos += (kapPB->GetDY() + kapBB->GetDY());
2321 if (mBuildLevel < 5) { // Kapton
2322 pnbBusVol->AddNode(kapBBVol, 1, new TGeoTranslation(0, ypos, 0));
2323 }
2324
2325 ypos += (kapBB->GetDY() + botBB->GetDY());
2326 if (mBuildLevel < 2) { // Aluminum
2327 pnbBusVol->AddNode(botBBVol, 1, new TGeoTranslation(0, ypos, 0));
2328 }
2329
2330 ypos += (botBB->GetDY() + dielBB->GetDY());
2331 if (mBuildLevel < 5) { // Kapton
2332 pnbBusVol->AddNode(dielBBVol, 1, new TGeoTranslation(0, ypos, 0));
2333 }
2334
2335 ypos += (dielBB->GetDY() + topBB->GetDY());
2336 if (mBuildLevel < 2) { // Aluminum
2337 pnbBusVol->AddNode(topBBVol, 1, new TGeoTranslation(0, ypos, 0));
2338 }
2339
2340 ypos += (topBB->GetDY() + kapBB->GetDY());
2341 if (mBuildLevel < 5) { // Kapton
2342 pnbBusVol->AddNode(kapBBVol, 2, new TGeoTranslation(0, ypos, 0));
2343 }
2344
2345 //
2346 return pnbBusVol;
2347}
2348
2349void V3Layer::createOBColdPlateConnectors()
2350{
2351 //
2352 // Create the Cold Plate connectors for OB half staves
2353 // (simply call the actual creator methods)
2354 //
2355 // Input:
2356 //
2357 // Output:
2358 //
2359 // Return:
2360 //
2361 // Created: 26 May 2015 Mario Sitta
2362 //
2363
2364 createOBColdPlateConnectorsASide();
2365 createOBColdPlateConnectorsCSide();
2366}
2367
2368void V3Layer::createOBColdPlateConnectorsASide()
2369{
2370 //
2371 // Create the A-Side end-stave connectors for IB staves
2372 //
2373 // Input:
2374 //
2375 // Output:
2376 //
2377 // Return:
2378 //
2379 // Created: 26 May 2015 Mario Sitta
2380 // Updated: 20 Jul 2017 Mario Sitta O2 version
2381 // Updated: 15 Oct 2018 Mario Sitta To latest blueprints
2382 //
2383
2384 // The geoManager
2385 const TGeoManager* mgr = gGeoManager;
2386
2387 // Local variables
2388 const Int_t nv = 16;
2389 Double_t xv[nv], yv[nv];
2390 Double_t xlen, ylen, zlen;
2391 Double_t xpos, ypos, zpos;
2392
2393 // Gather all material pointers
2394 TGeoMedium* medAir = mgr->GetMedium(Form("%s_AIR$", GetDetName()));
2395 TGeoMedium* medPEEK = mgr->GetMedium(Form("%s_PEEKCF30$", GetDetName()));
2396 TGeoMedium* medInox304 = mgr->GetMedium(Form("%s_INOX304$", GetDetName()));
2397
2398 // First create all elements
2399
2400 // The connector block, a Composite Shape
2401 xlen = sOBCPConnectorXWidth;
2402 ylen = sOBCPConnBlockYHei;
2403 zlen = sOBCPConnBlockZLen;
2404 TGeoBBox* connBlock = new TGeoBBox("connBlockA", xlen / 2, ylen / 2, zlen / 2);
2405
2406 xv[0] = sOBCPConnectorXWidth * 0.6;
2407 yv[0] = -sOBCPConnHollowYHei;
2408 xv[1] = xv[0];
2409 yv[1] = sOBCPConnHollowYHei;
2410 xv[2] = sOBCPConnTubesXDist / 2 + sOBCPConnTubeHole1D / 2;
2411 yv[2] = yv[1];
2412 xv[3] = xv[2];
2413 yv[3] = sOBCPConnTubesYPos;
2414 xv[4] = sOBCPConnTubesXDist / 2 - sOBCPConnTubeHole1D / 2;
2415 yv[4] = yv[3];
2416 xv[5] = xv[4];
2417 yv[5] = yv[2];
2418
2419 for (Int_t i = 0; i < 6; i++) {
2420 xv[6 + i] = -xv[5 - i];
2421 yv[6 + i] = yv[5 - i];
2422 }
2423
2424 TGeoXtru* connBlockHoll = new TGeoXtru(2);
2425 connBlockHoll->SetName("connBlockHollA");
2426 connBlockHoll->DefinePolygon(12, xv, yv);
2427 connBlockHoll->DefineSection(0, -sOBCPConnHollowZLen);
2428 connBlockHoll->DefineSection(1, sOBCPConnHollowZLen);
2429
2430 ypos = -connBlock->GetDY();
2431 zpos = -connBlock->GetDZ();
2432 TGeoTranslation* transBlockHoll = new TGeoTranslation("transBlockHollA", 0, ypos, zpos);
2433 transBlockHoll->RegisterYourself();
2434
2435 xlen = sOBCPConnSquareHoleX / 2;
2436 ylen = sOBCPConnBlockYHei / 1.5;
2437 zlen = sOBCPConnSquareHoleZ / 2;
2438 TGeoBBox* connSquareHole = new TGeoBBox("connASquareHole", xlen, ylen, zlen);
2439
2440 zpos =
2441 -connBlock->GetDZ() + (sOBCPConnSqrHoleZPos + connSquareHole->GetDZ());
2442 TGeoTranslation* transSquareHole = new TGeoTranslation("transASquareHole", 0, 0, zpos);
2443 transSquareHole->RegisterYourself();
2444
2445 zlen = sOBCPConnTubeHole1Z;
2446 TGeoTube* connTubeHole1 = new TGeoTube("tube1AHole", 0, sOBCPConnTubeHole1D / 2, zlen);
2447
2448 xpos = sOBCPConnTubesXDist / 2;
2449 ypos = -connBlock->GetDY() + sOBCPConnTubesYPos;
2450 zpos = connBlock->GetDZ();
2451 TGeoTranslation* trans1Tube1AHole = new TGeoTranslation("trans1Tube1AHole", -xpos, ypos, -zpos);
2452 trans1Tube1AHole->RegisterYourself();
2453 TGeoTranslation* trans2Tube1AHole = new TGeoTranslation("trans2Tube1AHole", xpos, ypos, -zpos);
2454 trans2Tube1AHole->RegisterYourself();
2455
2456 zlen = sOBCPConnBlockZLen;
2457 TGeoTube* connTubeHole2 = new TGeoTube("tube2AHole", 0, sOBCPConnTubeHole2D / 2, zlen);
2458
2459 TGeoTranslation* trans1Tube2AHole = new TGeoTranslation("trans1Tube2AHole", -xpos, ypos, 0);
2460 trans1Tube2AHole->RegisterYourself();
2461 TGeoTranslation* trans2Tube2AHole = new TGeoTranslation("trans2Tube2AHole", xpos, ypos, 0);
2462 trans2Tube2AHole->RegisterYourself();
2463
2464 zlen = sOBCPConnAFitZIn;
2465 TGeoTube* connFitHole = new TGeoTube("fitAHole", 0, sOBCPConnFitHoleD / 2, zlen);
2466
2467 TGeoTranslation* trans1FitAHole = new TGeoTranslation("trans1FitAHole", -xpos, ypos, zpos);
2468 trans1FitAHole->RegisterYourself();
2469 TGeoTranslation* trans2FitAHole = new TGeoTranslation("trans2FitAHole", xpos, ypos, zpos);
2470 trans2FitAHole->RegisterYourself();
2471
2472 TGeoCompositeShape* connBlockSh = new TGeoCompositeShape(
2473 "connBlockA-connBlockHollA:transBlockHollA-connASquareHole:transASquareHole-tube1AHole:trans1Tube1AHole-tube1AHole:"
2474 "trans2Tube1AHole-tube2AHole:trans1Tube2AHole-tube2AHole:trans2Tube2AHole-fitAHole:trans1FitAHole-fitAHole:"
2475 "trans2FitAHole");
2476
2477 TGeoVolume* connBlockA = new TGeoVolume("OBColdPlateConnectorBlockASide", connBlockSh, medPEEK);
2478 connBlockA->SetFillColor(42); // Brownish shade
2479 connBlockA->SetLineColor(42);
2480
2481 // The fitting tubes, a Tube
2482 Double_t rmin = sOBCPConnAFitExtD / 2 - sOBCPConnAFitThick;
2483 TGeoTube* connFitSh = new TGeoTube(rmin, sOBCPConnAFitExtD / 2, sOBCPConnAFitZLen / 2);
2484
2485 TGeoVolume* connFit = new TGeoVolume("OBColdPlateConnectorFitting", connFitSh, medInox304);
2486 connFit->SetFillColor(kGray);
2487 connFit->SetLineColor(kGray);
2488
2489 // Now create the container: cannot be a simple box
2490 // to avoid fake overlaps with stave elements
2491 xlen = sOBCPConnectorXWidth;
2492 ylen = sOBCPConnBlockYHei;
2493 zlen = sOBCPConnBlockZLen + (sOBCPConnAFitZLen - sOBCPConnAFitZIn);
2494 TGeoBBox* connBox = new TGeoBBox("connectorOBCPA", xlen / 2, ylen / 2, zlen / 2);
2495
2496 ypos = -connBox->GetDY();
2497 zpos = -connBox->GetDZ();
2498 TGeoTranslation* transBoxHoll = new TGeoTranslation("transBoxHollA", 0, ypos, zpos);
2499 transBoxHoll->RegisterYourself();
2500
2501 xpos = sOBCPConnTubesXDist / 2;
2502 ypos = -connBox->GetDY() + sOBCPConnTubesYPos;
2503 zpos = connBox->GetDZ();
2504 TGeoTranslation* trans1BoxHole = new TGeoTranslation("trans1BoxAHole", -xpos, ypos, -zpos);
2505 trans1BoxHole->RegisterYourself();
2506 TGeoTranslation* trans2BoxHole = new TGeoTranslation("trans2BoxAHole", xpos, ypos, -zpos);
2507 trans2BoxHole->RegisterYourself();
2508
2509 TGeoCompositeShape* connectSh = new TGeoCompositeShape(
2510 "connectorOBCPA-connBlockHollA:transBoxHollA-tube1AHole:trans1BoxAHole-tube1AHole:trans2BoxAHole");
2511
2512 TGeoVolume* connectorASide = new TGeoVolume("OBColdPlateConnectorASide", connectSh, medAir);
2513
2514 // Finally build up the connector
2515 zpos = -connectSh->GetDZ() + connBlock->GetDZ();
2516 connectorASide->AddNode(connBlockA, 1, new TGeoTranslation(0, 0, zpos));
2517
2518 xpos = sOBCPConnTubesXDist / 2;
2519 ypos = -connBlock->GetDY() + sOBCPConnTubesYPos;
2520 zpos = connectSh->GetDZ() - connFitSh->GetDz();
2521 connectorASide->AddNode(connFit, 1, new TGeoTranslation(-xpos, ypos, zpos));
2522 connectorASide->AddNode(connFit, 2, new TGeoTranslation(xpos, ypos, zpos));
2523}
2524
2525void V3Layer::createOBColdPlateConnectorsCSide()
2526{
2527 //
2528 // Create the C-Side end-stave connectors for IB staves
2529 //
2530 // Input:
2531 //
2532 // Output:
2533 //
2534 // Return:
2535 //
2536 // Created: 29 May 2015 Mario Sitta
2537 // Updated: 20 Jul 2017 Mario Sitta O2 version
2538 // Updated: 15 Oct 2018 Mario Sitta To latest blueprints
2539 //
2540
2541 // The geoManager
2542 const TGeoManager* mgr = gGeoManager;
2543
2544 // Local variables
2545 const Int_t nv = 16;
2546 Double_t xv[nv], yv[nv];
2547 Double_t xlen, ylen, zlen;
2548 Double_t xpos, ypos, zpos;
2549
2550 // Gather all material pointers
2551 TGeoMedium* medAir = mgr->GetMedium(Form("%s_AIR$", GetDetName()));
2552 TGeoMedium* medPEEK = mgr->GetMedium(Form("%s_PEEKCF30$", GetDetName()));
2553
2554 // First create all elements
2555
2556 // The connector block, a Composite Shape
2557 xlen = sOBCPConnectorXWidth;
2558 ylen = sOBCPConnBlockYHei;
2559 zlen = sOBCPConnBlockZLen;
2560 TGeoBBox* connBlock = new TGeoBBox("connBlockC", xlen / 2, ylen / 2, zlen / 2);
2561
2562 xv[0] = sOBCPConnectorXWidth * 0.6;
2563 yv[0] = -sOBCPConnHollowYHei;
2564 xv[1] = xv[0];
2565 yv[1] = sOBCPConnHollowYHei;
2566 xv[2] = sOBCPConnTubesXDist / 2 + sOBCPConnTubeHole1D / 2;
2567 yv[2] = yv[1];
2568 xv[3] = xv[2];
2569 yv[3] = sOBCPConnTubesYPos;
2570 xv[4] = sOBCPConnTubesXDist / 2 - sOBCPConnTubeHole1D / 2;
2571 yv[4] = yv[3];
2572 xv[5] = xv[4];
2573 yv[5] = yv[2];
2574
2575 for (Int_t i = 0; i < 6; i++) {
2576 xv[6 + i] = -xv[5 - i];
2577 yv[6 + i] = yv[5 - i];
2578 }
2579
2580 TGeoXtru* connBlockHoll = new TGeoXtru(2);
2581 connBlockHoll->SetName("connBlockHollC");
2582 connBlockHoll->DefinePolygon(12, xv, yv);
2583 connBlockHoll->DefineSection(0, -sOBCPConnHollowZLen);
2584 connBlockHoll->DefineSection(1, sOBCPConnHollowZLen);
2585
2586 ypos = -connBlock->GetDY();
2587 zpos = connBlock->GetDZ();
2588 TGeoTranslation* transBlockHoll = new TGeoTranslation("transBlockHollC", 0, ypos, zpos);
2589 transBlockHoll->RegisterYourself();
2590
2591 TGeoTube* connRoundHole = new TGeoTube("connCRoundHole", 0, sOBCPConnRoundHoleD / 2, sOBCPConnBlockYHei / 1.5);
2592
2593 zpos = connBlock->GetDZ() - sOBCPConnRndHoleZPos;
2594 TGeoCombiTrans* transRoundHole = new TGeoCombiTrans("transCRoundHole", 0, 0, zpos, new TGeoRotation("", 0, 90, 0));
2595 transRoundHole->RegisterYourself();
2596
2597 zlen = sOBCPConnTubeHole1Z;
2598 TGeoTube* connTubeHole1 = new TGeoTube("tube1CHole", 0, sOBCPConnTubeHole1D / 2, zlen);
2599
2600 xpos = sOBCPConnTubesXDist / 2;
2601 ypos = -connBlock->GetDY() + sOBCPConnTubesYPos;
2602 zpos = connBlock->GetDZ();
2603 TGeoTranslation* trans1Tube1AHole = new TGeoTranslation("trans1Tube1CHole", -xpos, ypos, zpos);
2604 trans1Tube1AHole->RegisterYourself();
2605 TGeoTranslation* trans2Tube1AHole = new TGeoTranslation("trans2Tube1CHole", xpos, ypos, zpos);
2606 trans2Tube1AHole->RegisterYourself();
2607
2608 TGeoTube* connTubeHole2 = new TGeoTube("tube2CHole", 0, sOBCPConnTubeHole2D / 2, connBlock->GetDZ());
2609
2610 zpos = sOBCPConnTubeHole3ZP;
2611 TGeoTranslation* connTubes2Trans1 = new TGeoTranslation("trans1Tube2CHole", -xpos, ypos, zpos);
2612 connTubes2Trans1->RegisterYourself();
2613 TGeoTranslation* connTubes2Trans2 = new TGeoTranslation("trans2Tube2CHole", xpos, ypos, zpos);
2614 connTubes2Trans2->RegisterYourself();
2615
2616 TGeoTube* connTubeHole3 = new TGeoTube("tube3CHole", 0, sOBCPConnTubeHole2D / 2, connBlock->GetDX());
2617
2618 xpos = -sOBCPConnTubeHole3XP;
2619 zpos = -connBlock->GetDZ() + sOBCPConnTubeHole3ZP;
2620 TGeoCombiTrans* connTubes3Trans =
2621 new TGeoCombiTrans("transTube3CHole", xpos, ypos, zpos, new TGeoRotation("", 90, -90, 90));
2622 connTubes3Trans->RegisterYourself();
2623
2624 TGeoCompositeShape* connBlockSh = new TGeoCompositeShape(
2625 "connBlockC-connBlockHollC:transBlockHollC-connCRoundHole:transCRoundHole-tube1CHole:trans1Tube1CHole-tube1CHole:"
2626 "trans2Tube1CHole-tube2CHole:trans1Tube2CHole-tube2CHole:trans2Tube2CHole-tube3CHole:transTube3CHole");
2627
2628 TGeoVolume* connBlockC = new TGeoVolume("OBColdPlateConnectorBlockCSide", connBlockSh, medPEEK);
2629 connBlockC->SetFillColor(42); // Brownish shade
2630 connBlockC->SetLineColor(42);
2631
2632 // The plug, a Pcon
2633 TGeoPcon* connPlugSh = new TGeoPcon(0, 360, 4);
2634 connPlugSh->DefineSection(0, 0., 0., sOBCPConnTubeHole2D / 2);
2635 connPlugSh->DefineSection(1, sOBCPConnPlugThick, 0., sOBCPConnTubeHole2D / 2);
2636 connPlugSh->DefineSection(2, sOBCPConnPlugThick, sOBCPConnPlugInnerD / 2, sOBCPConnTubeHole2D / 2);
2637 connPlugSh->DefineSection(3, sOBCPConnPlugTotLen, sOBCPConnPlugInnerD / 2, sOBCPConnTubeHole2D / 2);
2638
2639 TGeoVolume* connPlug = new TGeoVolume("OBCPConnectorPlugC", connPlugSh, medPEEK);
2640 connPlug->SetFillColor(44); // Brownish shade (a bit darker to spot it)
2641 connPlug->SetLineColor(44);
2642
2643 // Now create the container: cannot be a simple box
2644 // to avoid fake overlaps with stave elements
2645 xlen = sOBCPConnectorXWidth;
2646 ylen = sOBCPConnBlockYHei;
2647 zlen = sOBCPConnBlockZLen;
2648 TGeoBBox* connBox = new TGeoBBox("connectorOBCPC", xlen / 2, ylen / 2, zlen / 2);
2649
2650 ypos = -connBox->GetDY();
2651 zpos = connBox->GetDZ();
2652 TGeoTranslation* transBoxHoll = new TGeoTranslation("transBoxHollC", 0, ypos, zpos);
2653 transBoxHoll->RegisterYourself();
2654
2655 xpos = sOBCPConnTubesXDist / 2;
2656 ypos = -connBox->GetDY() + sOBCPConnTubesYPos;
2657 zpos = connBox->GetDZ();
2658 TGeoTranslation* trans1BoxHole = new TGeoTranslation("trans1BoxCHole", -xpos, ypos, zpos);
2659 trans1BoxHole->RegisterYourself();
2660 TGeoTranslation* trans2BoxHole = new TGeoTranslation("trans2BoxCHole", xpos, ypos, zpos);
2661 trans2BoxHole->RegisterYourself();
2662
2663 TGeoCompositeShape* connectSh = new TGeoCompositeShape(
2664 "connectorOBCPC-connBlockHollC:transBoxHollC-tube1CHole:trans1BoxCHole-tube1CHole:trans2BoxCHole");
2665
2666 TGeoVolume* connectorCSide = new TGeoVolume("OBColdPlateConnectorCSide", connectSh, medAir);
2667
2668 // Finally build up the connector
2669 connectorCSide->AddNode(connBlockC, 1);
2670
2671 xpos = -connBlock->GetDX();
2672 ypos = -connBlock->GetDY() + sOBCPConnTubesYPos;
2673 zpos = -connBlock->GetDZ() + sOBCPConnTubeHole3ZP;
2674 connectorCSide->AddNode(connPlug, 1, new TGeoCombiTrans(xpos, ypos, zpos, new TGeoRotation("", 90, 90, 90)));
2675}
2676
2677TGeoVolume* V3Layer::createSpaceFrameOuterB(const TGeoManager* mgr)
2678{
2679 TGeoVolume* mechStavVol = nullptr;
2680
2681 switch (mStaveModel) {
2682 case kOBModelDummy:
2683 case kOBModel0:
2684 mechStavVol = createSpaceFrameOuterBDummy(mgr);
2685 break;
2686 case kOBModel1:
2687 case kOBModel2:
2688 mechStavVol = createSpaceFrameOuterB2(mgr);
2689 break;
2690 default:
2691 LOG(fatal) << "Unknown stave model " << mStaveModel;
2692 break;
2693 }
2694
2695 return mechStavVol;
2696}
2697
2698TGeoVolume* V3Layer::createSpaceFrameOuterBDummy(const TGeoManager*) const
2699{
2700 //
2701 // Create dummy stave
2702 //
2703 // Input:
2704 // mgr : the GeoManager (used only to get the proper material)
2705 //
2706 // Output:
2707 //
2708 // Return:
2709 //
2710
2711 // Done, return the stave structur
2712 return nullptr;
2713}
2714
2715TGeoVolume* V3Layer::createSpaceFrameOuterB2(const TGeoManager* mgr)
2716{
2717 //
2718 // Create the space frame for the Outer Barrel (Model 2)
2719 // The building blocks are created in another method to avoid
2720 // replicating the same volumes for all OB staves
2721 //
2722 // Input:
2723 // mgr : the GeoManager (used only to get the proper material)
2724 //
2725 // Output:
2726 //
2727 // Return:
2728 // a TGeoVolume with the Space Frame of a stave
2729 //
2730 // Created: 03 Feb 2015 Mario Sitta
2731 // Updated: 04 Jun 2015 Mario Sitta Change container to avoid overlaps
2732 // Updated: 20 Jul 2017 Mario Sitta O2 version
2733 //
2734
2735 TGeoMedium* medAir = mgr->GetMedium(Form("%s_AIR$", GetDetName()));
2736
2737 TGeoVolume *unitVol[2], *next2EndVol[2], *endVol[2];
2738 Double_t *xtru, *ytru;
2739 Double_t zlen, zpos;
2740 Int_t nPoints;
2741 const Int_t nameLen = 30;
2742 char volname[nameLen];
2743
2744 // Check whether we have already all pieces
2745 // Otherwise create them
2746 unitVol[0] = mgr->GetVolume("SpaceFrameUnit0");
2747
2748 if (!unitVol[0]) {
2749 createOBSpaceFrameObjects(mgr);
2750 unitVol[0] = mgr->GetVolume("SpaceFrameUnit0");
2751 }
2752
2753 unitVol[1] = mgr->GetVolume("SpaceFrameUnit1");
2754
2755 next2EndVol[0] = mgr->GetVolume("SpaceFrameNext2EndUnit0");
2756 next2EndVol[1] = mgr->GetVolume("SpaceFrameNext2EndUnit1");
2757
2758 endVol[0] = mgr->GetVolume("SpaceFrameEndUnit0");
2759 endVol[1] = mgr->GetVolume("SpaceFrameEndUnit1");
2760
2761 // Get the shape of the units
2762 // and create a similar shape for the Space Frame container
2763 TGeoXtru* volShape = static_cast<TGeoXtru*>(unitVol[0]->GetShape());
2764
2765 nPoints = volShape->GetNvert();
2766 xtru = new Double_t[nPoints];
2767 ytru = new Double_t[nPoints];
2768
2769 for (Int_t i = 0; i < nPoints; i++) {
2770 xtru[i] = volShape->GetX(i);
2771 ytru[i] = volShape->GetY(i);
2772 }
2773
2774 Int_t nUnits = sOBSpaceFrameNUnits[mLayerNumber / 5]; // 3,4 -> 0 - 5,6 -> 1
2775 zlen = (nUnits - 2) * sOBSpaceFrameUnitLen; // Take end units out
2776
2777 TGeoXtru* spaceFrameCentral = new TGeoXtru(2);
2778 spaceFrameCentral->DefinePolygon(nPoints, xtru, ytru);
2779 spaceFrameCentral->DefineSection(0, -zlen / 2);
2780 spaceFrameCentral->DefineSection(1, zlen / 2);
2781 snprintf(volname, nameLen, "sframecentral%d", mLayerNumber);
2782 spaceFrameCentral->SetName(volname);
2783
2784 zpos = zlen / 2 + sOBSpaceFrameUnitLen / 2;
2785 snprintf(volname, nameLen, "endUnit0Trans%d", mLayerNumber);
2786 TGeoCombiTrans* endUnit0Trans = new TGeoCombiTrans(volname, 0, 0, -zpos, new TGeoRotation("", 90, 180, -90));
2787 endUnit0Trans->RegisterYourself();
2788 snprintf(volname, nameLen, "endUnit1Trans%d", mLayerNumber);
2789 TGeoTranslation* endUnit1Trans = new TGeoTranslation(volname, 0, 0, zpos);
2790 endUnit1Trans->RegisterYourself();
2791
2792 // The Space Frame container: a Composite Shape to avoid overlaps
2793 // between the U-legs space and the end-stave connectors
2794 // ("endunitcontainer" is defined in CreateOBSpaceFrameObjects)
2795 char componame[100];
2796 snprintf(componame, 100, "sframecentral%d+endunitcontainer:endUnit0Trans%d+endunitcontainer:endUnit1Trans%d",
2797 mLayerNumber, mLayerNumber, mLayerNumber);
2798
2799 TGeoCompositeShape* spaceFrame = new TGeoCompositeShape(componame);
2800
2801 snprintf(volname, nameLen, "SpaceFrameVolumeLay%d", mLayerNumber);
2802 TGeoVolume* spaceFrameVol = new TGeoVolume(volname, spaceFrame, medAir);
2803 spaceFrameVol->SetVisibility(kFALSE);
2804
2805 // Finally build up the space frame
2806 TGeoXtru* frameUnit = static_cast<TGeoXtru*>(unitVol[0]->GetShape());
2807
2808 zpos = -spaceFrame->GetDZ() + frameUnit->GetDZ() + sOBSFrameConnTopLen;
2809 spaceFrameVol->AddNode(endVol[0], 1, new TGeoCombiTrans(0, 0, zpos, new TGeoRotation("", 90, 180, -90)));
2810
2811 zpos += (2 * frameUnit->GetDZ());
2812 spaceFrameVol->AddNode(next2EndVol[0], 1, new TGeoTranslation(0, 0, zpos));
2813
2814 for (Int_t i = 2; i < nUnits - 2; i++) {
2815 zpos += (2 * frameUnit->GetDZ());
2816 Int_t j = i / 2;
2817 Int_t k = i - j * 2; // alternatively 0 or 1
2818 spaceFrameVol->AddNode(unitVol[k], j, new TGeoTranslation(0, 0, zpos));
2819 }
2820
2821 zpos += (2 * frameUnit->GetDZ());
2822 spaceFrameVol->AddNode(next2EndVol[1], 1, new TGeoTranslation(0, 0, zpos));
2823
2824 zpos += (2 * frameUnit->GetDZ());
2825 spaceFrameVol->AddNode(endVol[1], 1, new TGeoTranslation(0, 0, zpos));
2826
2827 // Done, clean up and return the space frame structure
2828 delete[] xtru;
2829 delete[] ytru;
2830
2831 return spaceFrameVol;
2832}
2833
2834void V3Layer::createOBSpaceFrameObjects(const TGeoManager* mgr)
2835{
2836 //
2837 // Create the space frame building blocks for the Outer Barrel
2838 // This method is practically identical to previous versions of
2839 // CreateSpaceFrameOuterB1
2840 // NB: it is pretty cumbersome, because we don't want to use assemblies
2841 // so we are forced to have well-crafted containers to avoid fake overlaps
2842 //
2843 // Input:
2844 // mgr : the GeoManager (used only to get the proper material)
2845 //
2846 // Output:
2847 //
2848 // Return:
2849 // a TGeoVolume with the Space Frame of a stave
2850 //
2851 // Created: 03 Feb 2015 Mario Sitta
2852 // Updated: 03 Jun 2015 Mario Sitta End units w/o U-legs
2853 // Updated: 20 Jul 2017 Mario Sitta O2 version
2854 // Updated: 09 Sep 2019 Mario Sitta Connectors added
2855 // Updated: 27 Sep 2019 Mario Sitta New TopV for End Units
2856 //
2857
2858 // Materials defined in AliITSUv2
2859 TGeoMedium* medCarbon = mgr->GetMedium(Form("%s_M55J6K$", GetDetName()));
2860 TGeoMedium* medF6151B05M = mgr->GetMedium(Form("%s_F6151B05M$", GetDetName()));
2861 TGeoMedium* medAir = mgr->GetMedium(Form("%s_AIR$", GetDetName()));
2862
2863 // Local parameters
2864 Double_t halfFrameWidth = sOBSpaceFrameWidth / 2;
2865 Double_t triangleHeight = sOBSpaceFrameHeight;
2866 Double_t sframeHeight = triangleHeight + sOBSFrameBaseRibDiam + sOBSFrameULegHeight2 * 2;
2867 Double_t staveLa = sOBSpaceFrameTopVL;
2868 Double_t staveHa = sOBSpaceFrameTopVH;
2869 Double_t staveLb = sOBSpaceFrameSideVL;
2870 Double_t staveHb = sOBSpaceFrameSideVH;
2871 Double_t alphaDeg = sOBSpaceFrameVAlpha;
2872 Double_t alphaRad = alphaDeg * TMath::DegToRad() / 2;
2873 Double_t beta = sOBSpaceFrameVBeta * TMath::DegToRad() / 2;
2874 Double_t sideRibRadius = sOBSFrameSideRibDiam / 2;
2875 Double_t sidePhiDeg = sOBSFrameSideRibPhi;
2876 Double_t sidePhiRad = sidePhiDeg * TMath::DegToRad();
2877 Double_t baseRibRadius = sOBSFrameBaseRibDiam / 2;
2878 Double_t basePhiDeg = sOBSFrameBaseRibPhi;
2879 Double_t basePhiRad = basePhiDeg * TMath::DegToRad();
2880 Double_t ulegHalfLen = sOBSFrameULegLen / 2;
2881 Double_t ulegHalfWidth = sOBSFrameULegWidth / 2;
2882 Double_t ulegHigh1 = sOBSFrameULegHeight1;
2883 Double_t ulegHigh2 = sOBSFrameULegHeight2;
2884 Double_t ulegThick = sOBSFrameULegThick;
2885 Double_t topVFactorEU = 0.60; // Fraction of TopV total length for End Units
2886
2887 Double_t xlen, zlen;
2888 Double_t xpos, ypos, zpos;
2889 Double_t unitlen;
2890 Double_t xtru[22], ytru[22];
2891
2892 unitlen = sOBSpaceFrameUnitLen;
2893
2894 xlen = halfFrameWidth + sideRibRadius;
2895
2896 // We need a properly shaped Xtru to accomodate the ribs avoiding
2897 // overlaps with the HalfStave cooling tubes
2898 xtru[0] = sOBSFrameULegXPos - ulegHalfLen;
2899 ytru[0] = -(triangleHeight / 2 + baseRibRadius);
2900 xtru[1] = xtru[0];
2901 ytru[1] = ytru[0] - ulegHigh1;
2902 xtru[2] = xtru[1] + ulegThick;
2903 ytru[2] = ytru[1];
2904 xtru[3] = xtru[2];
2905 ytru[3] = ytru[0] - ulegThick;
2906 xtru[7] = sOBSFrameULegXPos + ulegHalfLen;
2907 ytru[7] = ytru[0];
2908 xtru[6] = xtru[7];
2909 ytru[6] = ytru[1];
2910 xtru[5] = xtru[6] - ulegThick;
2911 ytru[5] = ytru[6];
2912 xtru[4] = xtru[5];
2913 ytru[4] = ytru[3];
2914 xtru[8] = xlen;
2915 ytru[8] = ytru[7];
2916 xtru[9] = xtru[8];
2917 ytru[9] = 0.9 * ytru[8];
2918 xtru[10] = 0.3 * xtru[8];
2919 ytru[10] = triangleHeight / 2;
2920 for (Int_t i = 0; i < 11; i++) { // Reflect on the X negative side
2921 xtru[i + 11] = -xtru[10 - i];
2922 ytru[i + 11] = ytru[10 - i];
2923 }
2924 ytru[15] = ytru[0] - ulegHigh2; // U-legs on negative X are longer
2925 ytru[16] = ytru[15];
2926 ytru[19] = ytru[15];
2927 ytru[20] = ytru[15];
2928
2929 // The space frame single units
2930 // We need two units because the base ribs are alternately oriented
2931 // The next-to-end units are slightly different
2932 TGeoXtru* frameUnit = new TGeoXtru(2);
2933 frameUnit->DefinePolygon(22, xtru, ytru);
2934 frameUnit->DefineSection(0, -unitlen / 2);
2935 frameUnit->DefineSection(1, unitlen / 2);
2936
2937 TGeoXtru* next2EndUnit = new TGeoXtru(2);
2938 next2EndUnit->DefinePolygon(22, xtru, ytru);
2939 next2EndUnit->DefineSection(0, -unitlen / 2);
2940 next2EndUnit->DefineSection(1, unitlen / 2);
2941
2942 // The end units have no U-legs, but they contain the end-stave connectors
2943 // so we build a CompositeShape using two Xtru's
2944 xtru[0] = xlen;
2945 ytru[0] = -(triangleHeight / 2 + baseRibRadius);
2946 xtru[1] = xtru[0];
2947 ytru[1] = 0.9 * ytru[0];
2948 xtru[2] = 0.3 * xtru[0];
2949 ytru[2] = triangleHeight / 2;
2950 for (Int_t i = 0; i < 3; i++) { // Reflect on the X negative side
2951 xtru[i + 3] = -xtru[2 - i];
2952 ytru[i + 3] = ytru[2 - i];
2953 }
2954
2955 TGeoXtru* endUnitBody = new TGeoXtru(2);
2956 endUnitBody->SetName("endunitbody");
2957 endUnitBody->DefinePolygon(6, xtru, ytru);
2958 endUnitBody->DefineSection(0, -unitlen / 2);
2959 endUnitBody->DefineSection(1, 0.8 * unitlen / 2);
2960
2961 xtru[2] = 0.25 * (3 * xtru[1] + xtru[2]);
2962 ytru[2] = 0.25 * (3 * ytru[1] + ytru[2]);
2963 for (Int_t i = 0; i < 3; i++) { // Reflect on the X negative side
2964 xtru[i + 3] = -xtru[2 - i];
2965 ytru[i + 3] = ytru[2 - i];
2966 }
2967
2968 TGeoXtru* endUnitBodyLow = new TGeoXtru(2);
2969 endUnitBodyLow->SetName("endunitbodylow");
2970 endUnitBodyLow->DefinePolygon(6, xtru, ytru);
2971 endUnitBodyLow->DefineSection(0, 0.8 * unitlen / 2);
2972 endUnitBodyLow->DefineSection(1, unitlen / 2);
2973
2974 // (See createOBSpaceFrameConnector lower down for details)
2975 xtru[0] = sOBSFrameConnWidth / 2.;
2976 ytru[0] = 0.;
2977 xtru[1] = xtru[0];
2978 ytru[1] = sOBSFrameConnInsHei;
2979 xtru[2] = xtru[1] - sOBSFrameConnTotHei + sOBSFrameConnInsHei;
2980 ytru[2] = sOBSFrameConnTotHei;
2981 for (Int_t i = 0; i < 3; i++) { // Reflect on the X negative side
2982 xtru[i + 3] = -xtru[2 - i];
2983 ytru[i + 3] = ytru[2 - i];
2984 }
2985
2986 TGeoXtru* endUnitConn = new TGeoXtru(2);
2987 endUnitConn->SetName("endunitconn");
2988 endUnitConn->DefinePolygon(6, xtru, ytru);
2989 endUnitConn->DefineSection(0, 0.);
2990 endUnitConn->DefineSection(1, sOBSFrameConnTopLen);
2991
2992 // We create a fake side V to have its dimensions, needed for
2993 // the creation of the end unit container
2994 TGeoXtru* vside =
2995 createStaveSide("fakeCornerSide", unitlen / 2., alphaRad, beta, staveLb, staveHb, kFALSE);
2996
2997 ypos = -triangleHeight / 2 + vside->GetY(3);
2998 TGeoTranslation* endUnitConnTrans = new TGeoTranslation("endunitconntrans", 0, ypos, unitlen / 2);
2999 endUnitConnTrans->RegisterYourself();
3000
3001 TGeoCompositeShape* endUnit = new TGeoCompositeShape("endunitbody+endunitbodylow+endunitconn:endunitconntrans");
3002 endUnit->SetName("endunitcontainer"); // Will be used when create spaceframe
3003
3004 // The air containers
3005 TGeoVolume* unitVol[2];
3006 unitVol[0] = new TGeoVolume("SpaceFrameUnit0", frameUnit, medAir);
3007 unitVol[1] = new TGeoVolume("SpaceFrameUnit1", frameUnit, medAir);
3008 unitVol[0]->SetVisibility(kFALSE);
3009 unitVol[1]->SetVisibility(kFALSE);
3010
3011 TGeoVolume* next2EndVol[2];
3012 next2EndVol[0] = new TGeoVolume("SpaceFrameNext2EndUnit0", next2EndUnit, medAir);
3013 next2EndVol[1] = new TGeoVolume("SpaceFrameNext2EndUnit1", next2EndUnit, medAir);
3014 next2EndVol[0]->SetVisibility(kFALSE);
3015 next2EndVol[1]->SetVisibility(kFALSE);
3016
3017 TGeoVolume* endVol[2];
3018 endVol[0] = new TGeoVolume("SpaceFrameEndUnit0", endUnit, medAir);
3019 endVol[1] = new TGeoVolume("SpaceFrameEndUnit1", endUnit, medAir);
3020 endVol[0]->SetVisibility(kFALSE);
3021 endVol[1]->SetVisibility(kFALSE);
3022
3023 // The actual volumes
3024
3025 //--- The top V of the Carbon Fiber Stave (segment)
3026 TGeoXtru* cfStavTop =
3027 createStaveSide("CFstavTopCornerVolshape", unitlen / 2., alphaRad, beta, staveLa, staveHa, kTRUE);
3028
3029 TGeoVolume* cfStavTopVol = new TGeoVolume("CFstavTopCornerVol", cfStavTop, medCarbon);
3030 cfStavTopVol->SetLineColor(35);
3031
3032 unitVol[0]->AddNode(cfStavTopVol, 1, new TGeoTranslation(0, triangleHeight / 2, 0));
3033
3034 unitVol[1]->AddNode(cfStavTopVol, 1, new TGeoTranslation(0, triangleHeight / 2, 0));
3035
3036 next2EndVol[0]->AddNode(cfStavTopVol, 1, new TGeoTranslation(0, triangleHeight / 2, 0));
3037
3038 next2EndVol[1]->AddNode(cfStavTopVol, 1, new TGeoTranslation(0, triangleHeight / 2, 0));
3039
3040 zlen = topVFactorEU * unitlen;
3041 TGeoXtru* cfStavTopEU =
3042 createStaveSide("CFstavTopCornerEUVolshape", zlen / 2., alphaRad, beta, staveLa, staveHa, kTRUE);
3043
3044 TGeoVolume* cfStavTopVolEU = new TGeoVolume("CFstavTopCornerEUVol", cfStavTopEU, medCarbon);
3045 cfStavTopVol->SetLineColor(35);
3046
3047 zpos = endUnitBody->GetDZ() - zlen / 2.;
3048
3049 endVol[0]->AddNode(cfStavTopVolEU, 1, new TGeoTranslation(0, triangleHeight / 2, -zpos));
3050
3051 endVol[1]->AddNode(cfStavTopVolEU, 1, new TGeoTranslation(0, triangleHeight / 2, -zpos));
3052
3053 //--- The two side V's
3054 TGeoXtru* cfStavSide =
3055 createStaveSide("CFstavSideCornerVolshape", unitlen / 2., alphaRad, beta, staveLb, staveHb, kFALSE);
3056
3057 TGeoVolume* cfStavSideVol = new TGeoVolume("CFstavSideCornerVol", cfStavSide, medCarbon);
3058 cfStavSideVol->SetLineColor(35);
3059
3060 unitVol[0]->AddNode(cfStavSideVol, 1, new TGeoTranslation(halfFrameWidth, -triangleHeight / 2, 0));
3061 unitVol[0]->AddNode(cfStavSideVol, 2,
3062 new TGeoCombiTrans(-halfFrameWidth, -triangleHeight / 2, 0, new TGeoRotation("", 90, 180, -90)));
3063
3064 unitVol[1]->AddNode(cfStavSideVol, 1, new TGeoTranslation(halfFrameWidth, -triangleHeight / 2, 0));
3065 unitVol[1]->AddNode(cfStavSideVol, 2,
3066 new TGeoCombiTrans(-halfFrameWidth, -triangleHeight / 2, 0, new TGeoRotation("", 90, 180, -90)));
3067
3068 next2EndVol[0]->AddNode(cfStavSideVol, 1, new TGeoTranslation(halfFrameWidth, -triangleHeight / 2, 0));
3069 next2EndVol[0]->AddNode(
3070 cfStavSideVol, 2, new TGeoCombiTrans(-halfFrameWidth, -triangleHeight / 2, 0, new TGeoRotation("", 90, 180, -90)));
3071
3072 next2EndVol[1]->AddNode(cfStavSideVol, 1, new TGeoTranslation(halfFrameWidth, -triangleHeight / 2, 0));
3073 next2EndVol[1]->AddNode(
3074 cfStavSideVol, 2, new TGeoCombiTrans(-halfFrameWidth, -triangleHeight / 2, 0, new TGeoRotation("", 90, 180, -90)));
3075
3076 endVol[0]->AddNode(cfStavSideVol, 1, new TGeoTranslation(halfFrameWidth, -triangleHeight / 2, 0));
3077 endVol[0]->AddNode(cfStavSideVol, 2,
3078 new TGeoCombiTrans(-halfFrameWidth, -triangleHeight / 2, 0, new TGeoRotation("", 90, 180, -90)));
3079
3080 endVol[1]->AddNode(cfStavSideVol, 1, new TGeoTranslation(halfFrameWidth, -triangleHeight / 2, 0));
3081 endVol[1]->AddNode(cfStavSideVol, 2,
3082 new TGeoCombiTrans(-halfFrameWidth, -triangleHeight / 2, 0, new TGeoRotation("", 90, 180, -90)));
3083
3084 //--- The beams
3085 // Ribs on the sides
3086 Double_t ribZProj = triangleHeight / TMath::Tan(sidePhiRad);
3087 Double_t sideRibLen =
3088 TMath::Sqrt(ribZProj * ribZProj + triangleHeight * triangleHeight + halfFrameWidth * halfFrameWidth);
3089
3090 TGeoTubeSeg* sideRib = new TGeoTubeSeg(0, sideRibRadius, sideRibLen / 2, 0, 180);
3091 TGeoVolume* sideRibVol = new TGeoVolume("CFstavSideBeamVol", sideRib, medCarbon);
3092 sideRibVol->SetLineColor(35);
3093
3094 TGeoCombiTrans* sideTransf[4];
3095 xpos = halfFrameWidth / 2 + 0.8 * staveHa * TMath::Cos(alphaRad / 2);
3096 ypos = -sideRibRadius / 2;
3097 zpos = unitlen / 4;
3098
3099 sideTransf[0] = new TGeoCombiTrans(xpos, ypos, -zpos, new TGeoRotation("", 90 - alphaDeg, -sidePhiDeg, -90));
3100 sideTransf[1] = new TGeoCombiTrans(xpos, ypos, zpos, new TGeoRotation("", 90 - alphaDeg, sidePhiDeg, -90));
3101 sideTransf[2] = new TGeoCombiTrans(-xpos, ypos, -zpos, new TGeoRotation("", 90 + alphaDeg, sidePhiDeg, -90));
3102 sideTransf[3] = new TGeoCombiTrans(-xpos, ypos, zpos, new TGeoRotation("", 90 + alphaDeg, -sidePhiDeg, -90));
3103
3104 unitVol[0]->AddNode(sideRibVol, 1, sideTransf[0]);
3105 unitVol[0]->AddNode(sideRibVol, 2, sideTransf[1]);
3106 unitVol[0]->AddNode(sideRibVol, 3, sideTransf[2]);
3107 unitVol[0]->AddNode(sideRibVol, 4, sideTransf[3]);
3108
3109 unitVol[1]->AddNode(sideRibVol, 1, sideTransf[0]);
3110 unitVol[1]->AddNode(sideRibVol, 2, sideTransf[1]);
3111 unitVol[1]->AddNode(sideRibVol, 3, sideTransf[2]);
3112 unitVol[1]->AddNode(sideRibVol, 4, sideTransf[3]);
3113
3114 next2EndVol[0]->AddNode(sideRibVol, 1, sideTransf[0]);
3115 next2EndVol[0]->AddNode(sideRibVol, 2, sideTransf[1]);
3116 next2EndVol[0]->AddNode(sideRibVol, 3, sideTransf[2]);
3117 next2EndVol[0]->AddNode(sideRibVol, 4, sideTransf[3]);
3118
3119 next2EndVol[1]->AddNode(sideRibVol, 1, sideTransf[0]);
3120 next2EndVol[1]->AddNode(sideRibVol, 2, sideTransf[1]);
3121 next2EndVol[1]->AddNode(sideRibVol, 3, sideTransf[2]);
3122 next2EndVol[1]->AddNode(sideRibVol, 4, sideTransf[3]);
3123
3124 endVol[0]->AddNode(sideRibVol, 1, sideTransf[0]);
3125 endVol[0]->AddNode(sideRibVol, 2, sideTransf[1]);
3126 endVol[0]->AddNode(sideRibVol, 3, sideTransf[2]);
3127 endVol[0]->AddNode(sideRibVol, 4, sideTransf[3]);
3128
3129 endVol[1]->AddNode(sideRibVol, 1, sideTransf[0]);
3130 endVol[1]->AddNode(sideRibVol, 2, sideTransf[1]);
3131 endVol[1]->AddNode(sideRibVol, 3, sideTransf[2]);
3132 endVol[1]->AddNode(sideRibVol, 4, sideTransf[3]);
3133
3134 // Ribs on the bottom
3135 // Rib1 are the inclined ones, Rib2 the straight ones
3136 Double_t baseRibLen = 0.98 * 2 * halfFrameWidth / TMath::Sin(basePhiRad);
3137
3138 TGeoTubeSeg* baseRib1 = new TGeoTubeSeg(0, baseRibRadius, baseRibLen / 2, 0, 180);
3139 TGeoVolume* baseRib1Vol = new TGeoVolume("CFstavBaseBeam1Vol", baseRib1, medCarbon);
3140 baseRib1Vol->SetLineColor(35);
3141
3142 TGeoTubeSeg* baseRib2 = new TGeoTubeSeg(0, baseRibRadius, halfFrameWidth, 0, 90);
3143 TGeoVolume* baseRib2Vol = new TGeoVolume("CFstavBaseBeam2Vol", baseRib2, medCarbon);
3144 baseRib2Vol->SetLineColor(35);
3145
3146 TGeoTubeSeg* baseEndRib = new TGeoTubeSeg(0, baseRibRadius, halfFrameWidth, 0, 180);
3147 TGeoVolume* baseEndRibVol = new TGeoVolume("CFstavBaseEndBeamVol", baseEndRib, medCarbon);
3148 baseEndRibVol->SetLineColor(35);
3149
3150 TGeoCombiTrans* baseTransf[6];
3151 ypos = triangleHeight / 2;
3152 zpos = unitlen / 2;
3153
3154 baseTransf[0] = new TGeoCombiTrans("", 0, -ypos, -zpos, new TGeoRotation("", 90, 90, 90));
3155 baseTransf[1] = new TGeoCombiTrans("", 0, -ypos, zpos, new TGeoRotation("", -90, 90, -90));
3156 baseTransf[2] = new TGeoCombiTrans(0, -ypos, 0, new TGeoRotation("", -90, basePhiDeg, -90));
3157 baseTransf[3] = new TGeoCombiTrans(0, -ypos, 0, new TGeoRotation("", -90, -basePhiDeg, -90));
3158 zpos -= baseEndRib->GetRmax();
3159 baseTransf[4] = new TGeoCombiTrans("", 0, -ypos, -zpos, new TGeoRotation("", 90, 90, 90));
3160 baseTransf[5] = new TGeoCombiTrans("", 0, -ypos, zpos, new TGeoRotation("", 90, 90, 90));
3161
3162 unitVol[0]->AddNode(baseRib2Vol, 1, baseTransf[0]);
3163 unitVol[0]->AddNode(baseRib2Vol, 2, baseTransf[1]);
3164 unitVol[0]->AddNode(baseRib1Vol, 1, baseTransf[2]);
3165
3166 unitVol[1]->AddNode(baseRib2Vol, 1, baseTransf[0]);
3167 unitVol[1]->AddNode(baseRib2Vol, 2, baseTransf[1]);
3168 unitVol[1]->AddNode(baseRib1Vol, 1, baseTransf[3]);
3169
3170 next2EndVol[0]->AddNode(baseRib2Vol, 1, baseTransf[0]);
3171 next2EndVol[0]->AddNode(baseRib2Vol, 2, baseTransf[1]);
3172 next2EndVol[0]->AddNode(baseRib1Vol, 1, baseTransf[3]);
3173
3174 next2EndVol[1]->AddNode(baseRib2Vol, 1, baseTransf[0]);
3175 next2EndVol[1]->AddNode(baseRib2Vol, 2, baseTransf[1]);
3176 next2EndVol[1]->AddNode(baseRib1Vol, 1, baseTransf[3]);
3177
3178 endVol[0]->AddNode(baseEndRibVol, 1, baseTransf[4]);
3179 endVol[0]->AddNode(baseRib2Vol, 1, baseTransf[1]);
3180 endVol[0]->AddNode(baseRib1Vol, 1, baseTransf[2]);
3181
3182 endVol[1]->AddNode(baseEndRibVol, 1, baseTransf[5]);
3183 endVol[1]->AddNode(baseRib2Vol, 1, baseTransf[0]);
3184 endVol[1]->AddNode(baseRib1Vol, 1, baseTransf[2]);
3185
3186 // The Space Frame connectors
3187 ypos = -triangleHeight / 2 + cfStavSide->GetY(3);
3188 zpos = unitlen / 2;
3189 createOBSpaceFrameConnector(endVol[0], ypos, zpos, kFALSE); // Side C
3190 createOBSpaceFrameConnector(endVol[1], ypos, zpos, kTRUE); // Side A
3191
3192 // U-Legs
3193 // The shorter
3194 xtru[0] = ulegHalfLen;
3195 ytru[0] = 0;
3196 xtru[1] = xtru[0];
3197 ytru[1] = -ulegHigh1;
3198 xtru[2] = xtru[1] - ulegThick;
3199 ytru[2] = ytru[1];
3200 xtru[3] = xtru[2];
3201 ytru[3] = ytru[0] - ulegThick;
3202 for (Int_t i = 0; i < 4; i++) { // Reflect on the X negative side
3203 xtru[i + 4] = -xtru[3 - i];
3204 ytru[i + 4] = ytru[3 - i];
3205 }
3206
3207 TGeoXtru* uleg1full = new TGeoXtru(2); // This will go in the next end units
3208 uleg1full->DefinePolygon(8, xtru, ytru);
3209 uleg1full->DefineSection(0, -ulegHalfWidth);
3210 uleg1full->DefineSection(1, ulegHalfWidth);
3211
3212 TGeoXtru* uleg1half = new TGeoXtru(2); // This will go in the middle unitys
3213 uleg1half->DefinePolygon(8, xtru, ytru);
3214 uleg1half->DefineSection(0, -ulegHalfWidth / 2);
3215 uleg1half->DefineSection(1, ulegHalfWidth / 2);
3216
3217 TGeoVolume* uleg1fullVol = new TGeoVolume("CFstavULeg1FullVol", uleg1full, medF6151B05M);
3218 uleg1fullVol->SetLineColor(35);
3219
3220 TGeoVolume* uleg1halfVol = new TGeoVolume("CFstavULeg1HalfVol", uleg1half, medF6151B05M);
3221 uleg1halfVol->SetLineColor(35);
3222
3223 // The longer
3224 ytru[1] = -ulegHigh2;
3225 ytru[2] = -ulegHigh2;
3226 ytru[5] = -ulegHigh2;
3227 ytru[6] = -ulegHigh2;
3228
3229 TGeoXtru* uleg2full = new TGeoXtru(2); // This will go in the next end units
3230 uleg2full->DefinePolygon(8, xtru, ytru);
3231 uleg2full->DefineSection(0, -ulegHalfWidth);
3232 uleg2full->DefineSection(1, ulegHalfWidth);
3233
3234 TGeoXtru* uleg2half = new TGeoXtru(2); // This will go in the middle unitys
3235 uleg2half->DefinePolygon(8, xtru, ytru);
3236 uleg2half->DefineSection(0, -ulegHalfWidth / 2);
3237 uleg2half->DefineSection(1, ulegHalfWidth / 2);
3238
3239 TGeoVolume* uleg2fullVol = new TGeoVolume("CFstavULeg2FullVol", uleg2full, medF6151B05M);
3240 uleg2fullVol->SetLineColor(35);
3241
3242 TGeoVolume* uleg2halfVol = new TGeoVolume("CFstavULeg2HalfVol", uleg2half, medF6151B05M);
3243 uleg2halfVol->SetLineColor(35);
3244
3245 xpos = sOBSFrameULegXPos;
3246 ypos = triangleHeight / 2 + baseRibRadius;
3247 zpos = unitlen / 2 - uleg1half->GetZ(1);
3248
3249 unitVol[0]->AddNode(uleg1halfVol, 1, // Shorter on +X
3250 new TGeoTranslation(xpos, -ypos, -zpos));
3251 unitVol[0]->AddNode(uleg1halfVol, 2, new TGeoTranslation(xpos, -ypos, zpos));
3252
3253 unitVol[1]->AddNode(uleg1halfVol, 1, new TGeoTranslation(xpos, -ypos, -zpos));
3254 unitVol[1]->AddNode(uleg1halfVol, 2, new TGeoTranslation(xpos, -ypos, zpos));
3255
3256 unitVol[0]->AddNode(uleg2halfVol, 1, // Longer on -X
3257 new TGeoTranslation(-xpos, -ypos, -zpos));
3258 unitVol[0]->AddNode(uleg2halfVol, 2, new TGeoTranslation(-xpos, -ypos, zpos));
3259
3260 unitVol[1]->AddNode(uleg2halfVol, 1, new TGeoTranslation(-xpos, -ypos, -zpos));
3261 unitVol[1]->AddNode(uleg2halfVol, 2, new TGeoTranslation(-xpos, -ypos, zpos));
3262
3263 next2EndVol[0]->AddNode(uleg1halfVol, 1, new TGeoTranslation(xpos, -ypos, zpos));
3264 next2EndVol[0]->AddNode(uleg2halfVol, 1, new TGeoTranslation(-xpos, -ypos, zpos));
3265
3266 next2EndVol[1]->AddNode(uleg1halfVol, 1, new TGeoTranslation(xpos, -ypos, -zpos));
3267 next2EndVol[1]->AddNode(uleg2halfVol, 1, new TGeoTranslation(-xpos, -ypos, -zpos));
3268
3269 zpos = unitlen / 2 - uleg1full->GetZ(1);
3270 next2EndVol[0]->AddNode(uleg1fullVol, 1, new TGeoTranslation(xpos, -ypos, -zpos));
3271 next2EndVol[0]->AddNode(uleg2fullVol, 1, new TGeoTranslation(-xpos, -ypos, -zpos));
3272
3273 next2EndVol[1]->AddNode(uleg1fullVol, 1, new TGeoTranslation(xpos, -ypos, zpos));
3274 next2EndVol[1]->AddNode(uleg2fullVol, 1, new TGeoTranslation(-xpos, -ypos, zpos));
3275
3276 // Done
3277 return;
3278}
3279
3280void V3Layer::createOBSpaceFrameConnector(TGeoVolume* mother, const Double_t ymot, const Double_t zmot, const Bool_t sideA, const TGeoManager* mgr)
3281{
3282 //
3283 // Creates the OB Space Frame Connectors
3284 // (ALIITSUP0070+ALIITSUP0069)
3285 //
3286 // Input:
3287 // mother : the SF unit volume to contain the connector
3288 // ymot : the Y position of the connector in the mother volume
3289 // zmot : the Z position of the connector in the mother volume
3290 // sideA : true for Side A, false for Side C
3291 // mgr : the GeoManager (used only to get the proper material)
3292 //
3293 // Output:
3294 //
3295 // Return:
3296 //
3297 // Created: 09 Sep 2019 M. Sitta
3298
3299 // Materials defined in AliITSUv2
3300 TGeoMedium* medPEEK = mgr->GetMedium(Form("%s_PEEKCF30$", GetDetName()));
3301
3302 // Local parameters
3303 TString connName, compoShape;
3304
3305 Double_t xlen, ylen, zlen;
3306 Double_t xpos, ypos, zpos;
3307 Double_t xtru[6], ytru[6];
3308
3309 // The external (higher) part: a Xtru
3310 ylen = sOBSFrameConnTotHei - sOBSFrameConnInsHei;
3311
3312 xtru[0] = sOBSFrameConnWidth / 2.;
3313 ytru[0] = 0.;
3314 xtru[1] = xtru[0];
3315 ytru[1] = sOBSFrameConnInsHei;
3316 xtru[2] = xtru[1] - ylen; // Because side is at 45' so dx = dy
3317 ytru[2] = sOBSFrameConnTotHei;
3318 for (Int_t i = 0; i < 3; i++) { // Reflect on the X negative side
3319 xtru[i + 3] = -xtru[2 - i];
3320 ytru[i + 3] = ytru[2 - i];
3321 }
3322
3323 TGeoXtru* topConn = new TGeoXtru(2);
3324 topConn->SetName("connectorTop");
3325 topConn->DefinePolygon(6, xtru, ytru);
3326 topConn->DefineSection(0, 0.);
3327 topConn->DefineSection(1, sOBSFrameConnTopLen);
3328
3329 // The insert: a Xtru
3330 zlen = sOBSFrameConnTotLen - sOBSFrameConnTopLen;
3331
3332 xtru[0] = sOBSFrameConnInsBase / 2.;
3333 ytru[0] = 0.;
3334 xtru[1] = sOBSFrameConnInsWide / 2.;
3335 ytru[1] = sOBSFrameConnInsHei;
3336 xtru[2] = -xtru[1];
3337 ytru[2] = ytru[1];
3338 xtru[3] = -xtru[0];
3339 ytru[3] = ytru[0];
3340
3341 TGeoXtru* insConn = new TGeoXtru(2);
3342 insConn->SetName("connectorIns");
3343 insConn->DefinePolygon(4, xtru, ytru);
3344 insConn->DefineSection(0, -zlen);
3345 insConn->DefineSection(1, 0.);
3346
3347 // The holes in the external (higher) part: Tube's and a BBox
3348 TGeoTube* topHoleR = new TGeoTube("topholer", 0., sOBSFrameConnTopHoleD / 2., 1.1 * sOBSFrameConnTotHei);
3349
3350 xpos = sOBSFrConnTopHoleXDist / 2.;
3351 ypos = sOBSFrameConnTotHei / 2.;
3352 zpos = sOBSFrameConnTopLen - sOBSFrameConnHoleZPos;
3353 TGeoCombiTrans* topHoleR1Trans = new TGeoCombiTrans("topholer1tr", xpos, ypos, zpos, new TGeoRotation("", 0, 90, 0));
3354 topHoleR1Trans->RegisterYourself();
3355
3356 TGeoCombiTrans* topHoleR2Trans = new TGeoCombiTrans("topholer2tr", -xpos, ypos, zpos, new TGeoRotation("", 0, 90, 0));
3357 topHoleR2Trans->RegisterYourself();
3358
3359 xpos = sOBSFrConnCHoleXDist / 2.;
3360 zpos = sOBSFrameConnTopLen - sOBSFrameConnCHoleZPos;
3361 TGeoCombiTrans* topCHoleR1Trans = new TGeoCombiTrans("topcholer1tr", xpos, ypos, zpos, new TGeoRotation("", 0, 90, 0));
3362 topCHoleR1Trans->RegisterYourself();
3363
3364 TGeoCombiTrans* topCHoleR2Trans = new TGeoCombiTrans("topcholer2tr", -xpos, ypos, zpos, new TGeoRotation("", 0, 90, 0));
3365 topCHoleR2Trans->RegisterYourself();
3366
3367 TGeoBBox* topAHole = new TGeoBBox("topahole", sOBSFrameConnAHoleWid / 2., sOBSFrameConnTotHei, sOBSFrameConnAHoleLen / 2.);
3368
3369 zpos = sOBSFrameConnTopLen - sOBSFrameConnHoleZPos;
3370 TGeoTranslation* topAHoleTrans = new TGeoTranslation("topaholetr", 0, ypos, zpos);
3371 topAHoleTrans->RegisterYourself();
3372
3373 TGeoTube* topCHole = new TGeoTube("topchole", 0., sOBSFrConnCTopHoleD / 2., sOBSFrameConnTotHei);
3374
3375 TGeoCombiTrans* topCHoleTrans = new TGeoCombiTrans("topcholetr", 0, ypos, zpos, new TGeoRotation("", 0, 90, 0));
3376 topCHoleTrans->RegisterYourself();
3377
3378 TGeoTube* topASide = new TGeoTube("topaside", 0., sOBSFrConnASideHoleD / 2., 1.1 * sOBSFrConnASideHoleL);
3379
3380 zpos = sOBSFrameConnTopLen + topASide->GetDz() - sOBSFrConnASideHoleL;
3381 TGeoTranslation* topASideTrans = new TGeoTranslation("topasidetr", 0, sOBSFrConnASideHoleY, zpos);
3382 topASideTrans->RegisterYourself();
3383
3384 // The holes in the insert: a Tube
3385 TGeoTube* insHole = new TGeoTube("inshole", 0., sOBSFrameConnInsHoleD / 2., sOBSFrameConnInsHei);
3386
3387 xpos = sOBSFrameConnInsHoleX / 2.;
3388 ypos = sOBSFrameConnInsHei / 2.;
3389 zpos = sOBSFrameConnTopLen - sOBSFrameConnHoleZPos - sOBSFrameConnHoleZDist;
3390 TGeoCombiTrans* insHole1Trans = new TGeoCombiTrans("inshole1tr", xpos, ypos, zpos, new TGeoRotation("", 0, 90, 0));
3391 insHole1Trans->RegisterYourself();
3392
3393 TGeoCombiTrans* insHole2Trans = new TGeoCombiTrans("inshole2tr", -xpos, ypos, zpos, new TGeoRotation("", 0, 90, 0));
3394 insHole2Trans->RegisterYourself();
3395
3396 // The connector: a CompositeShape
3397 if (sideA) {
3398 connName = "OBSFConnectorA";
3399 compoShape = "(connectorTop-topholer:topholer2tr-topholer:topholer1tr-topahole:topaholetr-topaside:topasidetr)+(connectorIns-inshole:inshole1tr-inshole:inshole2tr)";
3400 } else {
3401 connName = "OBSFConnectorC";
3402 compoShape = "(connectorTop-topholer:topholer2tr-topholer:topholer1tr-topholer:topcholer1tr-topholer:topcholer2tr-topchole:topcholetr)+(connectorIns-inshole:inshole1tr-inshole:inshole2tr)";
3403 }
3404
3405 TGeoCompositeShape* obsfConnSh = new TGeoCompositeShape(compoShape.Data());
3406
3407 TGeoVolume* obsfConnVol = new TGeoVolume(connName, obsfConnSh, medPEEK);
3408
3409 // Finally put the connector into its mother volume
3410 mother->AddNode(obsfConnVol, 1, new TGeoTranslation(0, ymot, zmot));
3411}
3412
3413TGeoVolume* V3Layer::createModuleOuterB(const TGeoManager* mgr)
3414{
3415 //
3416 // Creates the OB Module: HIC + FPC
3417 //
3418 // Input:
3419 // mgr : the GeoManager (used only to get the proper material)
3420 //
3421 // Output:
3422 //
3423 // Return:
3424 // the module as a TGeoVolume
3425 //
3426 // Created: 18 Dec 2013 M. Sitta, A. Barbano
3427 // Updated: 26 Feb 2014 M. Sitta
3428 // Updated: 12 Nov 2014 M. Sitta Model2 is w/o Carbon Plate and Glue
3429 // and Cu instead of Al
3430 // Updated: 20 Jul 2017 M. Sitta O2 version
3431 // Updated: 30 Jul 2018 M. Sitta Updated geometry
3432 // Updated: 13 Jun 2026 M. Sitta Add FPC capacitors
3433 //
3434
3435 const Int_t nameLen = 30;
3436 char chipName[nameLen], sensName[nameLen], volName[nameLen];
3437
3438 Double_t xGap = sOBChipXGap;
3439 Double_t zGap = sOBChipZGap;
3440
3441 Double_t xchip, ychip, zchip;
3442 Double_t xlen, ylen, zlen;
3443 Double_t xpos, ypos, zpos;
3444
3445 Bool_t dummyChip;
3446
3447 // First create all needed shapes
3448
3449 // For material budget studies
3450 if (mBuildLevel < 7) {
3451 dummyChip = kFALSE; // will be made of Si
3452 } else {
3453 dummyChip = kTRUE; // will be made of Air
3454 }
3455
3456 // The chip (the same as for IB)
3457 snprintf(chipName, nameLen, "%s%d", GeometryTGeo::getITSChipPattern(), mLayerNumber);
3458 snprintf(sensName, nameLen, "%s%d", GeometryTGeo::getITSSensorPattern(), mLayerNumber);
3459
3460 ylen = 0.5 * sOBChipThickness;
3461
3462 TGeoVolume* chipVol = AlpideChip::createChip(ylen, mSensorThickness / 2, chipName, sensName, dummyChip);
3463
3464 xchip = (static_cast<TGeoBBox*>(chipVol->GetShape()))->GetDX();
3465 ychip = (static_cast<TGeoBBox*>(chipVol->GetShape()))->GetDY();
3466 zchip = (static_cast<TGeoBBox*>(chipVol->GetShape()))->GetDZ();
3467
3468 mOBModuleZLength = 2 * zchip * sOBChipsPerRow + (sOBChipsPerRow - 1) * sOBChipZGap;
3469
3470 zlen = mOBModuleZLength / 2;
3471
3472 // The glue
3473 xlen = (4 * xchip + xGap) / 2;
3474 ylen = sOBGlueFPCThick / 2;
3475 TGeoBBox* glueFPC = new TGeoBBox("GlueFPC", xlen, ylen, zlen);
3476
3477 ylen = sOBGlueColdPlThick / 2;
3478 TGeoBBox* glueCP = new TGeoBBox("GlueCP", xlen, ylen, zlen);
3479
3480 // The FPC cables
3481 xlen = sOBFlexCableXWidth / 2;
3482 ylen = sOBFlexCableKapThick / 2;
3483 TGeoBBox* flexKap = new TGeoBBox("MidFlexKap", xlen, ylen, zlen);
3484
3485 TGeoVolume* cuGndCableVol = createOBFPCCuGnd(zlen);
3486 TGeoVolume* cuSignalCableVol = createOBFPCCuSig(zlen);
3487
3488 // The module
3489 Double_t ygnd = (static_cast<TGeoBBox*>(cuGndCableVol->GetShape()))->GetDY();
3490 Double_t ysig = (static_cast<TGeoBBox*>(cuSignalCableVol->GetShape()))->GetDY();
3491
3492 xlen = (static_cast<TGeoBBox*>(cuGndCableVol->GetShape()))->GetDX();
3493 // ylen = glueCP->GetDY() + ychip + glueFPC->GetDY() + ysig + flexKap->GetDY() + ygnd;
3494 ylen = glueCP->GetDY() + ychip + glueFPC->GetDY() + ysig + flexKap->GetDY() + ygnd + sOBFPCCapacitorYHi / 2;
3495 TGeoBBox* module = new TGeoBBox("OBModule", xlen, ylen, zlen);
3496
3497 // We have all shapes: now create the real volumes
3498
3499 TGeoMedium* medAir = mgr->GetMedium(Form("%s_AIR$", GetDetName()));
3500 TGeoMedium* medGlue = mgr->GetMedium(Form("%s_GLUE$", GetDetName()));
3501 TGeoMedium* medKapton = mgr->GetMedium(Form("%s_KAPTON(POLYCH2)$", GetDetName()));
3502
3503 TGeoVolume* glueFPCVol = new TGeoVolume("GlueFPCVol", glueFPC, medGlue);
3504 glueFPCVol->SetLineColor(kBlack);
3505 glueFPCVol->SetFillColor(glueFPCVol->GetLineColor());
3506 glueFPCVol->SetFillStyle(4000); // 0% transparent
3507
3508 TGeoVolume* glueCPVol = new TGeoVolume("GlueColdPlVol", glueCP, medGlue);
3509 glueCPVol->SetLineColor(kBlack);
3510 glueCPVol->SetFillColor(glueCPVol->GetLineColor());
3511 glueCPVol->SetFillStyle(4000); // 0% transparent
3512
3513 TGeoVolume* flexKapVol = new TGeoVolume("FPCMidKapVol", flexKap, medKapton);
3514 flexKapVol->SetLineColor(kGreen);
3515 flexKapVol->SetFillColor(flexKapVol->GetLineColor());
3516 flexKapVol->SetFillStyle(4000); // 0% transparent
3517
3518 snprintf(volName, nameLen, "%s%d", GeometryTGeo::getITSModulePattern(), mLayerNumber);
3519 TGeoVolume* modVol = new TGeoVolume(volName, module, medAir);
3520 modVol->SetVisibility(kTRUE);
3521
3522 // Now build up the module
3523 ypos = -module->GetDY() + glueCP->GetDY();
3524
3525 if (mBuildLevel < 3) { // Glue
3526 modVol->AddNode(glueCPVol, 1, new TGeoTranslation(0, ypos, 0));
3527 }
3528
3529 xpos = xchip + xGap / 2;
3530 ypos += (ychip + glueCP->GetDY());
3531 // We use two loops here to have the same chip numbering as in HW
3532 // X ^ | 6| 5| 4| 3| 2| 1| 0|
3533 // ----|--------------------------> Z
3534 // | | 7| 8| 9|10|11|12|13|
3535 //
3536 for (Int_t k = 0; k < sOBChipsPerRow; k++) // put first 7 chip row
3537 {
3538 zpos = module->GetDZ() - zchip - k * (2 * zchip + zGap);
3539 modVol->AddNode(chipVol, k, new TGeoCombiTrans(xpos, ypos, zpos, new TGeoRotation("", 0, 180, 180)));
3540 mHierarchy[kChip] += 1;
3541 }
3542
3543 for (Int_t k = 0; k < sOBChipsPerRow; k++) // put second 7 chip row
3544 {
3545 zpos = -module->GetDZ() + zchip + k * (2 * zchip + zGap);
3546 modVol->AddNode(chipVol, k + sOBChipsPerRow, new TGeoTranslation(-xpos, ypos, zpos));
3547 mHierarchy[kChip] += 1;
3548 }
3549
3550 ypos += (ychip + glueFPC->GetDY());
3551 if (mBuildLevel < 3) { // Glue
3552 modVol->AddNode(glueFPCVol, 1, new TGeoTranslation(0, ypos, 0));
3553 }
3554 ypos += glueFPC->GetDY();
3555
3556 if (mBuildLevel < 5) { // Kapton
3557 ypos += ysig;
3558 modVol->AddNode(cuSignalCableVol, 1, new TGeoTranslation(0, ypos, 0));
3559
3560 ypos += (ysig + flexKap->GetDY());
3561 modVol->AddNode(flexKapVol, 1, new TGeoTranslation(0, ypos, 0));
3562
3563 ypos += (flexKap->GetDY() + ygnd);
3564 modVol->AddNode(cuGndCableVol, 1, new TGeoTranslation(0, ypos, 0));
3565 }
3566
3567 // Add the FPC capacitors
3568 ypos += ygnd;
3569 createOBFPCCapacitors(modVol, xlen, zlen, ypos);
3570
3571 // Done, return the module
3572 return modVol;
3573}
3574
3575TGeoVolume* V3Layer::createOBFPCCuGnd(const Double_t zcable, const TGeoManager* mgr)
3576{
3577 //
3578 // Create the OB FPC Copper Ground cable
3579 //
3580 // Input:
3581 // zcable : the cable half Z length
3582 // mgr : the GeoManager (used only to get the proper material)
3583 //
3584 // Output:
3585 //
3586 // Return:
3587 // the FPC cable as a TGeoVolume
3588 //
3589 // Created: 30 Jul 2018 Mario Sitta
3590 //
3591
3592 Double_t xcable, ytot, ypos;
3593
3594 // First create all needed shapes
3595 xcable = sOBFlexCableXWidth / 2;
3596 ytot = sOBFPCSoldMaskThick + sOBFPCCopperThick;
3597 TGeoBBox* soldmask = new TGeoBBox(xcable, ytot / 2, zcable);
3598 xcable *= sOBFPCCuAreaFracGnd;
3599 TGeoBBox* copper = new TGeoBBox(xcable, sOBFPCCopperThick / 2, zcable);
3600
3601 // Then the volumes
3602 TGeoMedium* medKapton = mgr->GetMedium(Form("%s_KAPTON(POLYCH2)$", GetDetName()));
3603 TGeoMedium* medCopper = mgr->GetMedium(Form("%s_COPPER$", GetDetName()));
3604
3605 TGeoVolume* soldmaskVol = new TGeoVolume("FPCGndSolderMask", soldmask, medKapton);
3606 soldmaskVol->SetLineColor(kBlue);
3607 soldmaskVol->SetFillColor(kBlue);
3608
3609 TGeoVolume* copperVol = new TGeoVolume("FPCCopperGround", copper, medCopper);
3610 copperVol->SetLineColor(kCyan);
3611 copperVol->SetFillColor(kCyan);
3612
3613 ypos = -soldmask->GetDY() + copper->GetDY();
3614 if (mBuildLevel < 1) { // Copper
3615 soldmaskVol->AddNode(copperVol, 1, new TGeoTranslation(0, ypos, 0));
3616 }
3617
3618 return soldmaskVol;
3619}
3620
3621TGeoVolume* V3Layer::createOBFPCCuSig(const Double_t zcable, const TGeoManager* mgr)
3622{
3623 //
3624 // Create the OB FPC Copper Signal cable
3625 //
3626 // Input:
3627 // zcable : the cable half Z length
3628 // mgr : the GeoManager (used only to get the proper material)
3629 //
3630 // Output:
3631 //
3632 // Return:
3633 // the FPC cable as a TGeoVolume
3634 //
3635 // Created: 30 Jul 2018 Mario Sitta
3636 //
3637
3638 Double_t xcable, ytot, ypos;
3639
3640 // First create all needed shapes
3641 xcable = sOBFlexCableXWidth / 2;
3642 ytot = sOBFPCSoldMaskThick + sOBFPCCopperThick;
3643 TGeoBBox* soldmask = new TGeoBBox(xcable, ytot / 2, zcable);
3644 xcable *= sOBFPCCuAreaFracSig;
3645 TGeoBBox* copper = new TGeoBBox(xcable, sOBFPCCopperThick / 2, zcable);
3646
3647 // Then the volumes
3648 TGeoMedium* medKapton = mgr->GetMedium(Form("%s_KAPTON(POLYCH2)$", GetDetName()));
3649 TGeoMedium* medCopper = mgr->GetMedium(Form("%s_COPPER$", GetDetName()));
3650
3651 TGeoVolume* soldmaskVol = new TGeoVolume("FPCSigSolderMask", soldmask, medKapton);
3652 soldmaskVol->SetLineColor(kBlue);
3653 soldmaskVol->SetFillColor(kBlue);
3654
3655 TGeoVolume* copperVol = new TGeoVolume("FPCCopperSignal", copper, medCopper);
3656 copperVol->SetLineColor(kCyan);
3657 copperVol->SetFillColor(kCyan);
3658
3659 ypos = soldmask->GetDY() - copper->GetDY();
3660 if (mBuildLevel < 1) { // Copper
3661 soldmaskVol->AddNode(copperVol, 1, new TGeoTranslation(0, ypos, 0));
3662 }
3663
3664 return soldmaskVol;
3665}
3666
3667void V3Layer::createOBFPCCapacitors(TGeoVolume* modvol, Double_t xmodlen, Double_t zmodlen, Double_t yzero, const TGeoManager* mgr)
3668{
3669 //
3670 // Adds the capacitors to the OB FPC
3671 //
3672 // Input:
3673 // modvol : the OB module mother volume
3674 // xmodlen : the module half X length
3675 // zmodlen : the module half Z length
3676 // yzero : the Y base position of capacitors
3677 // mgr : the GeoManager (used only to get the proper material)
3678 //
3679 // Output:
3680 //
3681 // Return:
3682 //
3683 // Created: 13 Jun 2026 Mario Sitta
3684 //
3685
3686 // Number of capacitors and their positions from Gerber files
3687 // and F.Benotto communications
3688
3689 // Capacitors position (Gerber X,Y with respect to bottom left corner
3690 // will be translated to TGeo Z,X with respect center of module)
3691 const Int_t nGroups = 10;
3692 const Double_t xyCapacitors[nGroups][2] = {
3693 {26.34 * sMm, 14.02 * sMm}, {7.16 * sMm, 18.96 * sMm}, {26.04 * sMm, 10.34 * sMm}, {7.91 * sMm, 22.67 * sMm}, {41.36 * sMm, 18.78 * sMm}, {41.56 * sMm, 14.23 * sMm}, {64.35 * sMm, 13.54 * sMm}, {25.95 * sMm, 19.38 * sMm}, {64.39 * sMm, 10.45 * sMm}, {22.21 * sMm, 22.63 * sMm}};
3694
3695 const Double_t deltaYCapacitors = 30 * sMm;
3696
3697 const Int_t nCapacitors[nGroups] = {7, 7, 7, 7, 5, 5, 5, 7, 5, 7};
3698
3699 const Double_t xyCapacitorSingle[8][2] = {
3700 {14.91 * sMm, 18.78 * sMm},
3701 {195.81 * sMm, 18.78 * sMm},
3702 {15.11 * sMm, 14.23 * sMm},
3703 {196.01 * sMm, 14.23 * sMm},
3704 {34.20 * sMm, 13.54 * sMm},
3705 {36.59 * sMm, 10.33 * sMm},
3706 {7.73 * sMm, 13.54 * sMm},
3707 {11.44 * sMm, 12.13 * sMm},
3708 };
3709
3710 // Local variables
3711 Double_t xpos, ypos, zpos;
3712 Int_t idCapacitor;
3713
3714 TGeoVolume* capacitorOB;
3715
3716 // Check whether we already have the volumes, otherwise create them
3717 // (so as to avoid creating multiple copies of the very same volumes
3718 // for each layer)
3719 capacitorOB = mgr->GetVolume("OBFPCCapacitor");
3720
3721 if (!capacitorOB) {
3722 TGeoBBox* capacit = new TGeoBBox(sOBFPCCapacitorXWid / 2, sOBFPCCapacitorYHi / 2, sOBFPCCapacitorZLen / 2);
3723
3724 TGeoMedium* medCeramic = mgr->GetMedium(Form("%s_CERAMIC$", GetDetName()));
3725
3726 capacitorOB = new TGeoVolume("OBFPCCapacitor", capacit, medCeramic);
3727 capacitorOB->SetLineColor(kBlack);
3728 capacitorOB->SetFillColor(kBlack);
3729 }
3730
3731 // Place all the capacitors (they are really a lot...)
3732 ypos = yzero + sOBFPCCapacitorYHi / 2;
3733 idCapacitor = 0;
3734
3735 for (Int_t jgrp = 0; jgrp < nGroups; jgrp++) { // Loop on the groups of cap's
3736 xpos = xyCapacitors[jgrp][1] - xmodlen;
3737 for (Int_t jcap = 0; jcap < nCapacitors[jgrp]; jcap++) { // Loop on cap's
3738 zpos = xyCapacitors[jgrp][0] - zmodlen + jcap * deltaYCapacitors;
3739 idCapacitor++;
3740 modvol->AddNode(capacitorOB, idCapacitor, new TGeoTranslation(xpos, ypos, zpos));
3741 }
3742 }
3743
3744 // Add single capacitors
3745 for (Int_t jcap = 0; jcap < 8; jcap++) {
3746 xpos = xyCapacitorSingle[jcap][1] - xmodlen;
3747 zpos = xyCapacitorSingle[jcap][0] - zmodlen;
3748 idCapacitor++;
3749 modvol->AddNode(capacitorOB, idCapacitor, new TGeoTranslation(xpos, ypos, zpos));
3750 }
3751
3752 // We've done
3753}
3754
3755Double_t V3Layer::radiusOmTurboContainer()
3756{
3757 Double_t rr, delta, z, lstav, rstav;
3758
3759 if (mChipThickness > 89.) { // Very big angle: avoid overflows since surely
3760 return -1; // the radius from lower vertex is the right value
3761 }
3762
3763 rstav = mLayerRadius + 0.5 * mChipThickness;
3764 delta = (0.5 * mChipThickness) / cosD(mStaveTilt);
3765 z = (0.5 * mChipThickness) * tanD(mStaveTilt);
3766
3767 rr = rstav - delta;
3768 lstav = (0.5 * mStaveWidth) - z;
3769
3770 if ((rr * sinD(mStaveTilt) < lstav)) {
3771 return (rr * cosD(mStaveTilt));
3772 } else {
3773 return -1;
3774 }
3775}
3776
3778{
3779 if (mLayerNumber < sNumberOfInnerLayers) {
3780 mNumberOfChips = u;
3781 } else {
3782 mNumberOfModules = u;
3783 mNumberOfChips = sOBChipsPerRow;
3784 }
3785}
3786
3787void V3Layer::setStaveTilt(const Double_t t)
3788{
3789 if (mIsTurbo) {
3790 mStaveTilt = t;
3791 } else {
3792 LOG(error) << "Not a Turbo layer";
3793 }
3794}
3795
3796void V3Layer::setStaveWidth(const Double_t w)
3797{
3798 if (mIsTurbo) {
3799 mStaveWidth = w;
3800 } else {
3801 LOG(error) << "Not a Turbo layer";
3802 }
3803}
3804
3805TGeoXtru* V3Layer::createStaveSide(const char* name, Double_t dz, Double_t alpha, Double_t beta, Double_t L, Double_t H,
3806 Bool_t top)
3807{
3808 //
3809 // Creates the V-shaped sides of the OB space frame
3810 // (from a similar method with same name and function
3811 // in AliITSv11GeometrySDD class by L.Gaudichet)
3812 //
3813 // Updated: 15 Dec 2014 Mario Sitta Rewritten using Xtru
3814 // Updated: 09 Jan 2015 Mario Sitta Rewritten again using different
3815 // aperture angles (info by C.Gargiulo)
3816 // Updated: 21 Jul 2017 Mario Sitta O2 version
3817 //
3818
3819 // Create the V shape corner of CF stave
3820
3821 const Int_t nv = 6;
3822 Double_t xv[nv], yv[nv];
3823
3824 TGeoXtru* cfStavSide = new TGeoXtru(2);
3825 cfStavSide->SetName(name);
3826
3827 Double_t theta = TMath::PiOver2() - beta;
3828 Double_t gamma = beta - alpha;
3829 // Points must be in clockwise order
3830 if (top) { // TOP - vertices not in order
3831 xv[3] = 0;
3832 yv[3] = 0;
3833 xv[2] = L * TMath::Sin(alpha);
3834 yv[2] = -L * TMath::Cos(alpha);
3835 xv[1] = xv[2] - H * TMath::Cos(alpha);
3836 yv[1] = yv[2] - H * TMath::Sin(alpha);
3837 xv[0] = 0;
3838 yv[0] = yv[1] + TMath::Tan(theta) * xv[1];
3839 xv[4] = -xv[2]; // Reflect
3840 yv[4] = yv[2];
3841 xv[5] = -xv[1];
3842 yv[5] = yv[1];
3843 } else { // SIDE
3844 Double_t m = -TMath::Tan(alpha), n = TMath::Tan(gamma);
3845 xv[0] = 0;
3846 yv[0] = 0;
3847 xv[1] = -L * TMath::Cos(2 * alpha);
3848 yv[1] = L * TMath::Sin(2 * alpha);
3849 xv[2] = xv[1] - H * TMath::Sin(2 * alpha);
3850 yv[2] = yv[1] - H * TMath::Cos(2 * alpha);
3851 xv[4] = -L;
3852 yv[4] = H;
3853 xv[5] = xv[4];
3854 yv[5] = 0;
3855 xv[3] = (yv[4] - n * xv[4]) / (m - n);
3856 yv[3] = m * xv[3];
3857 }
3858
3859 cfStavSide->DefinePolygon(nv, xv, yv);
3860 cfStavSide->DefineSection(0, -dz);
3861 cfStavSide->DefineSection(1, dz);
3862
3863 return cfStavSide;
3864}
3865
3866TGeoCombiTrans* V3Layer::createCombiTrans(const char* name, Double_t dy, Double_t dz, Double_t dphi, Bool_t planeSym)
3867{
3868 TGeoTranslation t1(dy * cosD(90. + dphi), dy * sinD(90. + dphi), dz);
3869 TGeoRotation r1("", 0., 0., dphi);
3870 TGeoRotation r2("", 90, 180, -90 - dphi);
3871
3872 TGeoCombiTrans* combiTrans1 = new TGeoCombiTrans(name);
3873 combiTrans1->SetTranslation(t1);
3874 if (planeSym) {
3875 combiTrans1->SetRotation(r1);
3876 } else {
3877 combiTrans1->SetRotation(r2);
3878 }
3879 return combiTrans1;
3880}
3881
3882void V3Layer::addTranslationToCombiTrans(TGeoCombiTrans* ct, Double_t dx, Double_t dy, Double_t dz) const
3883{
3884 // Add a dx,dy,dz translation to the initial TGeoCombiTrans
3885 const Double_t* vect = ct->GetTranslation();
3886 Double_t newVect[3] = {vect[0] + dx, vect[1] + dy, vect[2] + dz};
3887 ct->SetTranslation(newVect);
3888}
Creates an ALPIDE chip in simulation.
std::ostringstream debug
int32_t i
Definition of the GeometryTGeo class.
uint32_t j
Definition RawData.h:0
Definition of the SegmentationAlpide class.
ClassImp(V3Layer)
Definition of the V3Layer class.
static const char * getITSLayerPattern()
static const char * getITSSensorPattern()
static const char * getITSHalfBarrelPattern()
static const char * getITSChipPattern()
static const char * getITSModulePattern()
static const char * getITSHalfStavePattern()
static const char * getITSStavePattern()
Double_t cosD(Double_t deg) const
Cosine function.
Definition V11Geometry.h:91
const char * GetDetName() const
Get detector name.
Definition V11Geometry.h:58
Double_t sinD(Double_t deg) const
Definition V11Geometry.h:85
static const Double_t sMm
Convert mm to TGeom's cm.
Double_t tanD(Double_t deg) const
Tangent function.
Definition V11Geometry.h:97
static const Double_t sMicron
Convert micron to TGeom's cm.
void setStaveWidth(Double_t w)
Definition V3Layer.cxx:3796
void setStaveTilt(Double_t t)
Definition V3Layer.cxx:3787
void setNumberOfUnits(Int_t u)
Definition V3Layer.cxx:3777
virtual void createLayer(TGeoVolume *motherVolume)
Definition V3Layer.cxx:314
~V3Layer() override
Default destructor.
static TGeoVolume * createChip(Double_t yc, Double_t ys, char const *chipName="AlpideChip", char const *sensName="AlpideSensor", Bool_t dummy=kFALSE, const TGeoManager *mgr=gGeoManager)
GLdouble n
Definition glcorearb.h:1982
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
const GLfloat * m
Definition glcorearb.h:4066
GLdouble GLdouble GLdouble GLdouble top
Definition glcorearb.h:4077
GLuint const GLchar * name
Definition glcorearb.h:781
GLboolean r
Definition glcorearb.h:1233
GLubyte GLubyte GLubyte GLubyte w
Definition glcorearb.h:852
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
Definition glcorearb.h:5034
value_T std::array< value_T, 7 > & vect
Definition TrackUtils.h:42
constexpr double zGap
Definition Specs.h:176
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"