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