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