A more efficient way of volume creations and other minor improvements (Mario)
[u/mrichter/AliRoot.git] / ITS / UPGRADE / ITSUpgradeSim / AliITSUv1Layer.cxx
CommitLineData
b705c75b 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16//*************************************************************************
17// This class Defines the Geometry for the ITS Upgrade using TGeo
18// This is a work class used to study different configurations
19// during the development of the new ITS structure.
20//
21// Mario Sitta <sitta@to.infn.it>
22// Chinorat Kobdaj (kobdaj@g.sut.ac.th)
23//*************************************************************************
24
25
26/* $Id: AliITSUv1Layer.cxx */
27// General Root includes
28#include <TMath.h>
29// Root Geometry includes
30//#include <AliLog.h>
31#include <TGeoManager.h>
32#include <TGeoVolume.h>
33#include <TGeoPcon.h>
34#include <TGeoCone.h>
35#include <TGeoTube.h> // contaings TGeoTubeSeg
36#include <TGeoArb8.h>
37#include <TGeoXtru.h>
38#include <TGeoCompositeShape.h>
39#include <TGeoMatrix.h>
40#include "AliITSUv1Layer.h"
41#include "AliITSUGeomTGeo.h"
42#include <TGeoBBox.h>
43#include <TGeoShape.h>
44#include <TGeoTrd1.h>
45using namespace TMath;
46
c55b10c2 47// General Parameters
48const Int_t AliITSUv1Layer::fgkNumberOfInnerLayers = 3;
49
1fc6eff6 50const Double_t AliITSUv1Layer::fgkDefaultSensorThick = 18*fgkmicron;
51const Double_t AliITSUv1Layer::fgkDefaultChipThick = 50*fgkmicron;
c55b10c2 52
53// Inner Barrel Parameters
54const Int_t AliITSUv1Layer::fgkIBChipsPerRow = 9;
55const Int_t AliITSUv1Layer::fgkIBNChipRows = 1;
56
019dc90c 57const Double_t AliITSUv1Layer::fgkIBFlexCableAlThick = 50.0 *fgkmicron;
58const Double_t AliITSUv1Layer::fgkIBFlexCableKapThick = 125.0 *fgkmicron;
59const Double_t AliITSUv1Layer::fgkIBGlueThick = 100.0 *fgkmicron;
60const Double_t AliITSUv1Layer::fgkIBCarbonFleeceThick = 20.0 *fgkmicron;
61const Double_t AliITSUv1Layer::fgkIBCarbonPaperThick = 30.0 *fgkmicron;
62const Double_t AliITSUv1Layer::fgkIBK13D2UThick = 70.0 *fgkmicron;
63const Double_t AliITSUv1Layer::fgkIBCoolPipeInnerD = 1.024*fgkmm;
64const Double_t AliITSUv1Layer::fgkIBCoolPipeThick = 25.4 *fgkmicron;
65const Double_t AliITSUv1Layer::fgkIBCoolPipeXDist = 5.0 *fgkmm;
66const Double_t AliITSUv1Layer::fgkIBTopVertexWidth = 0.072*fgkcm;
67const Double_t AliITSUv1Layer::fgkIBTopVertexHeight = 0.04 *fgkcm;
68const Double_t AliITSUv1Layer::fgkIBSideVertexWidth = 0.052*fgkcm;
69const Double_t AliITSUv1Layer::fgkIBSideVertexHeight = 0.11 *fgkcm;
70const Double_t AliITSUv1Layer::fgkIBTopFilamentLength = 0.844*fgkcm;
71const Double_t AliITSUv1Layer::fgkIBTopFilamentSide = 0.02 *fgkcm;
72const Double_t AliITSUv1Layer::fgkIBTopFilamentAlpha = 57.0; // Deg
73
74const Double_t AliITSUv1Layer::fgkIBStaveHeight = 0.283*fgkcm;
75
c55b10c2 76// Outer Barrel Parameters
77const Int_t AliITSUv1Layer::fgkOBChipsPerRow = 7;
78const Int_t AliITSUv1Layer::fgkOBNChipRows = 2;
79
80const Double_t AliITSUv1Layer::fgkOBHalfStaveWidth = 3.01 *fgkcm;
81const Double_t AliITSUv1Layer::fgkOBModuleWidth = fgkOBHalfStaveWidth;
82const Double_t AliITSUv1Layer::fgkOBModuleGap = 0.01 *fgkcm;
83const Double_t AliITSUv1Layer::fgkOBChipXGap = 0.01 *fgkcm;
84const Double_t AliITSUv1Layer::fgkOBChipZGap = 0.01 *fgkcm;
85const Double_t AliITSUv1Layer::fgkOBFlexCableAlThick = 0.005*fgkcm;
1fc6eff6 86const Double_t AliITSUv1Layer::fgkOBFlexCableCuThick = 0.004*fgkcm;
f1496ca7 87const Double_t AliITSUv1Layer::fgkOBFlexCableKapThick1= 0.01 *fgkcm;
88const Double_t AliITSUv1Layer::fgkOBFlexCableKapThick = 125.0 *fgkmicron;
c55b10c2 89const Double_t AliITSUv1Layer::fgkOBBusCableAlThick = 0.02 *fgkcm;
90const Double_t AliITSUv1Layer::fgkOBBusCableKapThick = 0.02 *fgkcm;
91const Double_t AliITSUv1Layer::fgkOBColdPlateThick = 0.012*fgkcm;
92const Double_t AliITSUv1Layer::fgkOBCarbonPlateThick = 0.012*fgkcm;
1fc6eff6 93const Double_t AliITSUv1Layer::fgkOBGlueThickM1 = 0.03 *fgkcm;
94const Double_t AliITSUv1Layer::fgkOBGlueThick = 0.01 *fgkcm;
c55b10c2 95const Double_t AliITSUv1Layer::fgkOBModuleZLength = 21.06 *fgkcm;
94fc91be 96const Double_t AliITSUv1Layer::fgkOBHalfStaveYPos = 2.067*fgkcm;
c55b10c2 97const Double_t AliITSUv1Layer::fgkOBHalfStaveYTrans = 1.76 *fgkmm;
65740b7a 98const Double_t AliITSUv1Layer::fgkOBHalfStaveXOverlap = 4.3 *fgkmm;
c55b10c2 99const Double_t AliITSUv1Layer::fgkOBGraphiteFoilThick = 30.0 *fgkmicron;
1fc6eff6 100const Double_t AliITSUv1Layer::fgkOBCarbonFleeceThick = 20.0 *fgkmicron;
101const Double_t AliITSUv1Layer::fgkOBCoolTubeInnerDM1 = 2.052*fgkmm;
102const Double_t AliITSUv1Layer::fgkOBCoolTubeInnerD = 2.05 *fgkmm;
d7ef241e 103const Double_t AliITSUv1Layer::fgkOBCoolTubeThick = 32.0 *fgkmicron;
c55b10c2 104const Double_t AliITSUv1Layer::fgkOBCoolTubeXDist = 11.1 *fgkmm;
105
94fc91be 106const Double_t AliITSUv1Layer::fgkOBSpaceFrameZLen[2] = { 900.0*fgkmm,
107 1526.0*fgkmm};
108const Int_t AliITSUv1Layer::fgkOBSpaceFrameNUnits[2]= { 23, 39};
109const Double_t AliITSUv1Layer::fgkOBSpaceFrameUnitLen = 39.1 *fgkmm;
110const Double_t AliITSUv1Layer::fgkOBSpaceFrameWidth = 42.44 *fgkmm;
5402be00 111const Double_t AliITSUv1Layer::fgkOBSpaceFrameHeight = 36.45 *fgkmm;
94fc91be 112const Double_t AliITSUv1Layer::fgkOBSpaceFrameTopVL = 4.0 *fgkmm;
113const Double_t AliITSUv1Layer::fgkOBSpaceFrameTopVH = 0.35 *fgkmm;
114const Double_t AliITSUv1Layer::fgkOBSpaceFrameSideVL = 4.5 *fgkmm;
115const Double_t AliITSUv1Layer::fgkOBSpaceFrameSideVH = 0.35 *fgkmm;
116const Double_t AliITSUv1Layer::fgkOBSpaceFrameVAlpha = 60.0; // deg
117const Double_t AliITSUv1Layer::fgkOBSpaceFrameVBeta = 68.0; // deg
118const Double_t AliITSUv1Layer::fgkOBSFrameBaseRibDiam = 1.33 *fgkmm;
119const Double_t AliITSUv1Layer::fgkOBSFrameBaseRibPhi = 54.0; // deg
120const Double_t AliITSUv1Layer::fgkOBSFrameSideRibDiam = 1.25 *fgkmm;
121const Double_t AliITSUv1Layer::fgkOBSFrameSideRibPhi = 70.0; // deg
5402be00 122const Double_t AliITSUv1Layer::fgkOBSFrameULegLen = 14.2 *fgkmm;
123const Double_t AliITSUv1Layer::fgkOBSFrameULegWidth = 1.5 *fgkmm;
124const Double_t AliITSUv1Layer::fgkOBSFrameULegHeight1 = 2.7 *fgkmm;
125const Double_t AliITSUv1Layer::fgkOBSFrameULegHeight2 = 5.0 *fgkmm;
126const Double_t AliITSUv1Layer::fgkOBSFrameULegThick = 0.3 *fgkmm;
127const Double_t AliITSUv1Layer::fgkOBSFrameULegXPos = 12.9 *fgkmm;
b705c75b 128
129
130ClassImp(AliITSUv1Layer)
131
132#define SQ(A) (A)*(A)
133
134//________________________________________________________________________
135AliITSUv1Layer::AliITSUv1Layer():
136 AliITSv11Geometry(),
137 fLayerNumber(0),
138 fPhi0(0),
139 fLayRadius(0),
140 fZLength(0),
141 fSensorThick(0),
1fc6eff6 142 fChipThick(0),
852af72e 143 fStaveWidth(0),
144 fStaveTilt(0),
145 fNStaves(0),
c55b10c2 146 fNModules(0),
852af72e 147 fNChips(0),
148 fChipTypeID(0),
b705c75b 149 fIsTurbo(0),
150 fBuildLevel(0),
151 fStaveModel(AliITSUv1::kIBModelDummy)
152{
153 //
154 // Standard constructor
c55b10c2 155 for (int i=kNHLevels;i--;) fHierarchy[i] = 0;
b705c75b 156 //
157}
158
159//________________________________________________________________________
160AliITSUv1Layer::AliITSUv1Layer(Int_t debug):
161 AliITSv11Geometry(debug),
162 fLayerNumber(0),
163 fPhi0(0),
164 fLayRadius(0),
165 fZLength(0),
166 fSensorThick(0),
1fc6eff6 167 fChipThick(0),
852af72e 168 fStaveWidth(0),
169 fStaveTilt(0),
170 fNStaves(0),
c55b10c2 171 fNModules(0),
852af72e 172 fNChips(0),
173 fChipTypeID(0),
b705c75b 174 fIsTurbo(0),
175 fBuildLevel(0),
176 fStaveModel(AliITSUv1::kIBModelDummy)
177{
178 //
179 // Constructor setting debugging level
c55b10c2 180 for (int i=kNHLevels;i--;) fHierarchy[i] = 0;
b705c75b 181 //
182}
183
184//________________________________________________________________________
185AliITSUv1Layer::AliITSUv1Layer(Int_t lay, Int_t debug):
186 AliITSv11Geometry(debug),
187 fLayerNumber(lay),
188 fPhi0(0),
189 fLayRadius(0),
190 fZLength(0),
191 fSensorThick(0),
1fc6eff6 192 fChipThick(0),
852af72e 193 fStaveWidth(0),
194 fStaveTilt(0),
195 fNStaves(0),
c55b10c2 196 fNModules(0),
852af72e 197 fNChips(0),
198 fChipTypeID(0),
b705c75b 199 fIsTurbo(0),
200 fBuildLevel(0),
201 fStaveModel(AliITSUv1::kIBModelDummy)
202{
203 //
204 // Constructor setting layer number and debugging level
c55b10c2 205 for (int i=kNHLevels;i--;) fHierarchy[i] = 0;
b705c75b 206 //
207}
208
209//________________________________________________________________________
210AliITSUv1Layer::AliITSUv1Layer(Int_t lay, Bool_t turbo, Int_t debug):
211 AliITSv11Geometry(debug),
212 fLayerNumber(lay),
213 fPhi0(0),
214 fLayRadius(0),
215 fZLength(0),
216 fSensorThick(0),
1fc6eff6 217 fChipThick(0),
852af72e 218 fStaveWidth(0),
219 fStaveTilt(0),
220 fNStaves(0),
c55b10c2 221 fNModules(0),
852af72e 222 fNChips(0),
223 fChipTypeID(0),
b705c75b 224 fIsTurbo(turbo),
225 fBuildLevel(0),
226 fStaveModel(AliITSUv1::kIBModelDummy)
227{
228 //
229 // Constructor setting layer number and debugging level
852af72e 230 // for a "turbo" layer (i.e. where staves overlap in phi)
c55b10c2 231 for (int i=kNHLevels;i--;) fHierarchy[i] = 0;
b705c75b 232 //
233}
234
235//________________________________________________________________________
236AliITSUv1Layer::AliITSUv1Layer(const AliITSUv1Layer &s):
237 AliITSv11Geometry(s.GetDebug()),
238 fLayerNumber(s.fLayerNumber),
239 fPhi0(s.fPhi0),
240 fLayRadius(s.fLayRadius),
241 fZLength(s.fZLength),
242 fSensorThick(s.fSensorThick),
1fc6eff6 243 fChipThick(s.fChipThick),
852af72e 244 fStaveWidth(s.fStaveWidth),
245 fStaveTilt(s.fStaveTilt),
246 fNStaves(s.fNStaves),
c55b10c2 247 fNModules(s.fNModules),
852af72e 248 fNChips(s.fNChips),
249 fChipTypeID(s.fChipTypeID),
b705c75b 250 fIsTurbo(s.fIsTurbo),
251 fBuildLevel(s.fBuildLevel),
252 fStaveModel(s.fStaveModel)
253{
254 //
255 // Copy constructor
c55b10c2 256 for (int i=kNHLevels;i--;) fHierarchy[i] = s.fHierarchy[i];
b705c75b 257 //
258}
259
260//________________________________________________________________________
261AliITSUv1Layer& AliITSUv1Layer::operator=(const AliITSUv1Layer &s)
262{
263 //
264 // Assignment operator
265 //
266 if(&s == this) return *this;
267
268 fLayerNumber = s.fLayerNumber;
269 fPhi0 = s.fPhi0;
270 fLayRadius = s.fLayRadius;
271 fZLength = s.fZLength;
272 fSensorThick = s.fSensorThick;
1fc6eff6 273 fChipThick = s.fChipThick;
c55b10c2 274 fStaveWidth = s.fStaveWidth;
275 fStaveTilt = s.fStaveTilt;
276 fNStaves = s.fNStaves;
277 fNModules = s.fNModules;
278 fNChips = s.fNChips;
b705c75b 279 fIsTurbo = s.fIsTurbo;
c55b10c2 280 fChipTypeID = s.fChipTypeID;
b705c75b 281 fBuildLevel = s.fBuildLevel;
282 fStaveModel = s.fStaveModel;
c55b10c2 283 for (int i=kNHLevels;i--;) fHierarchy[i] = s.fHierarchy[i];
284 //
b705c75b 285 return *this;
286}
287
288//________________________________________________________________________
289AliITSUv1Layer::~AliITSUv1Layer() {
290 //
291 // Destructor
292 //
293}
294
295//________________________________________________________________________
296void AliITSUv1Layer::CreateLayer(TGeoVolume *moth){
297//
298// Creates the actual Layer and places inside its mother volume
299//
300// Input:
301// moth : the TGeoVolume owing the volume structure
302//
303// Output:
304//
305// Return:
306//
307// Created: 17 Jun 2011 Mario Sitta
308// Updated: 08 Jul 2011 Mario Sitta
309// Updated: 20 May 2013 Mario Sitta Layer is Assembly instead of Tube
310//
311 // Local variables
312 char volname[30];
313 Double_t xpos, ypos, zpos;
314 Double_t alpha;
315
316
317 // Check if the user set the proper parameters
c55b10c2 318 if (fLayRadius<= 0) AliFatal(Form("Wrong layer radius (%f)",fLayRadius));
319 if (fZLength <= 0) AliFatal(Form("Wrong layer length (%f)",fZLength));
852af72e 320 if (fNStaves <= 0) AliFatal(Form("Wrong number of staves (%d)",fNStaves));
c55b10c2 321 if (fNChips <= 0) AliFatal(Form("Wrong number of chips (%d)",fNChips));
322
323 if (fLayerNumber >= fgkNumberOfInnerLayers && fNModules <= 0)
324 AliFatal(Form("Wrong number of modules (%d)",fNModules));
b705c75b 325
1fc6eff6 326 if (fChipThick <= 0) {
327 AliInfo(Form("Chip thickness wrong or not set (%f), using default (%f)",
328 fChipThick,fgkDefaultChipThick));
329 fChipThick = fgkDefaultChipThick;
b705c75b 330 }
331
332 if (fSensorThick <= 0) {
333 AliInfo(Form("Sensor thickness wrong or not set (%f), using default (%f)",
334 fSensorThick,fgkDefaultSensorThick));
335 fSensorThick = fgkDefaultSensorThick;
336 }
337
1fc6eff6 338 if (fSensorThick > fChipThick) {
339 AliWarning(Form("Sensor thickness (%f) is greater than chip thickness (%f), fixing",
340 fSensorThick,fChipThick));
341 fSensorThick = fChipThick;
b705c75b 342 }
343
344
345 // If a Turbo layer is requested, do it and exit
346 if (fIsTurbo) {
347 CreateLayerTurbo(moth);
348 return;
349 }
350
351
852af72e 352 // First create the stave container
353 alpha = (360./(2*fNStaves))*DegToRad();
b705c75b 354
852af72e 355 // fStaveWidth = fLayRadius*Tan(alpha);
b705c75b 356
357 snprintf(volname, 30, "%s%d", AliITSUGeomTGeo::GetITSLayerPattern(),fLayerNumber);
358 TGeoVolume *layVol = new TGeoVolumeAssembly(volname);
1fc6eff6 359 layVol->SetTitle(
360 Form("Model %d Build level %d",(Int_t)fStaveModel,fBuildLevel));
852af72e 361 layVol->SetUniqueID(fChipTypeID);
b705c75b 362
363// layVol->SetVisibility(kFALSE);
364 layVol->SetVisibility(kTRUE);
365 layVol->SetLineColor(1);
366
852af72e 367 TGeoVolume *stavVol = CreateStave();
b705c75b 368
369
370 // Now build up the layer
852af72e 371 alpha = 360./fNStaves;
65740b7a 372 Double_t r = fLayRadius + ((TGeoBBox*)stavVol->GetShape())->GetDY();
852af72e 373 for (Int_t j=0; j<fNStaves; j++) {
b705c75b 374 Double_t phi = j*alpha + fPhi0;
375 xpos = r*CosD(phi);// r*SinD(-phi);
376 ypos = r*SinD(phi);// r*CosD(-phi);
377 zpos = 0.;
378 phi += 90;
852af72e 379 layVol->AddNode(stavVol, j, new TGeoCombiTrans( xpos, ypos, zpos,
b705c75b 380 new TGeoRotation("",phi,0,0)));
381 }
382
383
384 // Finally put everything in the mother volume
385 moth->AddNode(layVol, 1, 0);
386
387
388 // Upgrade geometry is served
389 return;
390}
391
392//________________________________________________________________________
393void AliITSUv1Layer::CreateLayerTurbo(TGeoVolume *moth){
394//
395// Creates the actual Layer and places inside its mother volume
852af72e 396// A so-called "turbo" layer is a layer where staves overlap in phi
b705c75b 397// User can set width and tilt angle, no check is performed here
398// to avoid volume overlaps
399//
400// Input:
401// moth : the TGeoVolume owing the volume structure
402//
403// Output:
404//
405// Return:
406//
407// Created: 08 Jul 2011 Mario Sitta
408// Updated: 08 Mar 2012 Mario Sitta Correct way to compute container R
409// Updated: 20 May 2013 Mario Sitta Layer is Assemgbly instead of Tube
410//
411
412
413 // Local variables
414 char volname[30];
415 Double_t xpos, ypos, zpos;
416 Double_t alpha;
417
418
419 // Check if the user set the proper (remaining) parameters
852af72e 420 if (fStaveWidth <= 0)
421 AliFatal(Form("Wrong stave width (%f)",fStaveWidth));
422 if (Abs(fStaveTilt) > 45)
423 AliWarning(Form("Stave tilt angle (%f) greater than 45deg",fStaveTilt));
b705c75b 424
425
426 snprintf(volname, 30, "%s%d", AliITSUGeomTGeo::GetITSLayerPattern(), fLayerNumber);
427 TGeoVolume *layVol = new TGeoVolumeAssembly(volname);
1fc6eff6 428 layVol->SetTitle(
429 Form("Model %d Build level %d",(Int_t)fStaveModel,fBuildLevel));
852af72e 430 layVol->SetUniqueID(fChipTypeID);
b705c75b 431 layVol->SetVisibility(kTRUE);
432 layVol->SetLineColor(1);
852af72e 433 TGeoVolume *stavVol = CreateStave();
b705c75b 434
435
436 // Now build up the layer
852af72e 437 alpha = 360./fNStaves;
438 Double_t r = fLayRadius /* +chip thick ?! */;
439 for (Int_t j=0; j<fNStaves; j++) {
b705c75b 440 Double_t phi = j*alpha + fPhi0;
441 xpos = r*CosD(phi);// r*SinD(-phi);
442 ypos = r*SinD(phi);// r*CosD(-phi);
443 zpos = 0.;
444 phi += 90;
852af72e 445 layVol->AddNode(stavVol, j, new TGeoCombiTrans( xpos, ypos, zpos,
446 new TGeoRotation("", phi-fStaveTilt,0,0)));
b705c75b 447 }
448
449
450 // Finally put everything in the mother volume
451 moth->AddNode(layVol, 1, 0);
452
453 return;
454}
455
456//________________________________________________________________________
852af72e 457TGeoVolume* AliITSUv1Layer::CreateStave(const TGeoManager * /*mgr*/){
b705c75b 458//
852af72e 459// Creates the actual Stave
b705c75b 460//
461// Input:
462// mgr : the GeoManager (used only to get the proper material)
463//
464// Output:
465//
466// Return:
467//
468// Created: 22 Jun 2011 Mario Sitta
469// Updated: 18 Dec 2013 Mario Sitta Handle IB and OB
94fc91be 470// Updated: 12 Jan 2015 Mario Sitta Fix overlap with new OB space frame
471// (by moving the latter, not the sensors to avoid
472// spoiling their position in space)
b705c75b 473//
474
475 char volname[30];
b705c75b 476
2b9468b2 477 Double_t xlen, ylen, zlen;
478 Double_t xpos, ypos;
b705c75b 479 Double_t alpha;
480
481
482 // First create all needed shapes
852af72e 483 alpha = (360./(2*fNStaves))*DegToRad();
b705c75b 484
852af72e 485 // The stave
2b9468b2 486 xlen = fLayRadius*Tan(alpha);
487 if (fIsTurbo) xlen = 0.5*fStaveWidth;
1fc6eff6 488 ylen = 0.5*fChipThick;
b705c75b 489 zlen = 0.5*fZLength;
490
491 Double_t yplus = 0.46;
852af72e 492 TGeoXtru *stave = new TGeoXtru(2); //z sections
2b9468b2 493 Double_t xv[5] = {xlen,xlen,0,-xlen,-xlen};
b705c75b 494 Double_t yv[5] = {ylen+0.09,-0.15,-yplus-fSensorThick,-0.15,ylen+0.09};
852af72e 495 stave->DefinePolygon(5,xv,yv);
496 stave->DefineSection(0,-zlen,0,0,1.);
497 stave->DefineSection(1,+zlen,0,0,1.);
b705c75b 498
499 // We have all shapes: now create the real volumes
500
852af72e 501 snprintf(volname, 30, "%s%d", AliITSUGeomTGeo::GetITSStavePattern(), fLayerNumber);
c55b10c2 502// TGeoVolume *staveVol = new TGeoVolume(volname, stave, medAir);
503 TGeoVolume *staveVol = new TGeoVolumeAssembly(volname);
b705c75b 504
c55b10c2 505 // staveVol->SetVisibility(kFALSE);
506 staveVol->SetVisibility(kTRUE);
507 staveVol->SetLineColor(2);
c55b10c2 508 TGeoVolume *mechStaveVol = 0;
b705c75b 509
852af72e 510 // Now build up the stave
c55b10c2 511 if (fLayerNumber < fgkNumberOfInnerLayers) {
2b9468b2 512 TGeoVolume *modVol = CreateStaveInnerB(xlen,ylen,zlen);
513 staveVol->AddNode(modVol, 0);
c55b10c2 514 fHierarchy[kHalfStave] = 1;
b705c75b 515
2b9468b2 516 // Mechanical stave structure
517 mechStaveVol = CreateStaveStructInnerB(xlen,zlen);
06a9bd15 518 if (mechStaveVol) {
019dc90c 519 ypos = ((TGeoBBox*)(modVol->GetShape()))->GetDY();
520 if (fStaveModel != AliITSUv1::kIBModel4)
521 ypos += ((TGeoBBox*)(mechStaveVol->GetShape()))->GetDY();
06a9bd15 522 staveVol->AddNode(mechStaveVol, 1, new TGeoCombiTrans(0, -ypos, 0, new TGeoRotation("",0, 0, 180)));
523 }
b705c75b 524 }
525
526 else{
2b9468b2 527 TGeoVolume *hstaveVol = CreateStaveOuterB();
b705c75b 528 if (fStaveModel == AliITSUv1::kOBModel0) { // Create simplified stave struct as in v0
2b9468b2 529 staveVol->AddNode(hstaveVol, 0);
530 fHierarchy[kHalfStave] = 1;
b705c75b 531 } else { // (if fStaveModel) Create new stave struct as in TDR
2b9468b2 532 xpos = ((TGeoBBox*)(hstaveVol->GetShape()))->GetDX()
c55b10c2 533 - fgkOBHalfStaveXOverlap/2;
94fc91be 534 // ypos is now a parameter to avoid HS displacement wrt nominal radii
535 ypos = fgkOBHalfStaveYPos;
2b9468b2 536 staveVol->AddNode(hstaveVol, 0, new TGeoTranslation(-xpos, ypos, 0));
537 staveVol->AddNode(hstaveVol, 1, new TGeoTranslation( xpos, ypos+fgkOBHalfStaveYTrans, 0));
c55b10c2 538 fHierarchy[kHalfStave] = 2; // RS
2b9468b2 539 mechStaveVol = CreateSpaceFrameOuterB();
94fc91be 540 if (mechStaveVol) {
e14c51b6 541 if (fBuildLevel < 6) // Carbon
542 staveVol->AddNode(mechStaveVol, 1,
543 new TGeoCombiTrans(0, -fgkOBSFrameULegHeight1, 0,
c55b10c2 544 new TGeoRotation("", 180, 0, 0)));
94fc91be 545 }
b705c75b 546 } // if (fStaveModel)
547 }
548
549
852af72e 550 // Done, return the stave
c55b10c2 551 return staveVol;
552}
553
554//________________________________________________________________________
555TGeoVolume* AliITSUv1Layer::CreateStaveInnerB(const Double_t xsta,
556 const Double_t ysta,
557 const Double_t zsta,
558 const TGeoManager *mgr){
559//
560// Create the chip stave for the Inner Barrel
561// (Here we fake the halfstave volume to have the same
562// formal geometry hierarchy as for the Outer Barrel)
563//
564// Input:
2b9468b2 565// xsta, ysta, zsta : X, Y, Z stave half lengths
c55b10c2 566// mgr : the GeoManager (used only to get the proper material)
567//
568// Output:
569//
570// Return:
571//
572// Created: 06 Mar 2014 Mario Sitta
573//
574
575 // Local variables
576 Double_t xmod, ymod, zmod;
577 char volname[30];
578
579 // First we create the module (i.e. the HIC with 9 chips)
580 TGeoVolume *moduleVol = CreateModuleInnerB(xsta, ysta, zsta);
581
582 // Then we create the fake halfstave and the actual stave
583 xmod = ((TGeoBBox*)(moduleVol->GetShape()))->GetDX();
584 ymod = ((TGeoBBox*)(moduleVol->GetShape()))->GetDY();
585 zmod = ((TGeoBBox*)(moduleVol->GetShape()))->GetDZ();
586
587 TGeoBBox *hstave = new TGeoBBox(xmod, ymod, zmod);
588
589 TGeoMedium *medAir = mgr->GetMedium("ITS_AIR$");
590
591 snprintf(volname, 30, "%s%d", AliITSUGeomTGeo::GetITSHalfStavePattern(), fLayerNumber);
592 TGeoVolume *hstaveVol = new TGeoVolume(volname, hstave, medAir);
593
594
595 // Finally build it up
596 hstaveVol->AddNode(moduleVol, 0);
597 fHierarchy[kModule] = 1;
598
599 // Done, return the stave structure
600 return hstaveVol;
601}
602
603//________________________________________________________________________
604TGeoVolume* AliITSUv1Layer::CreateModuleInnerB(Double_t xmod,
605 Double_t ymod,
606 Double_t zmod,
607 const TGeoManager *mgr){
608//
609// Creates the IB Module: (only the chips for the time being)
610//
611// Input:
2b9468b2 612// xmod, ymod, zmod : X, Y, Z module half lengths
c55b10c2 613// mgr : the GeoManager (used only to get the proper material)
614//
615// Output:
616//
617// Return:
618// the module as a TGeoVolume
619//
620// Created: 06 Mar 2014 M. Sitta
621//
622
2b9468b2 623 Double_t zchip;
d2a3dfa2 624 Double_t zpos;
c55b10c2 625 char volname[30];
626
627 // First create the single chip
2b9468b2 628 zchip = zmod/fgkIBChipsPerRow;
629 TGeoVolume *chipVol = CreateChipInnerB(xmod, ymod, zchip);
c55b10c2 630
631 // Then create the module and populate it with the chips
632 TGeoBBox *module = new TGeoBBox(xmod, ymod, zmod);
633
634 TGeoMedium *medAir = mgr->GetMedium("ITS_AIR$");
635
636 snprintf(volname, 30, "%s%d", AliITSUGeomTGeo::GetITSModulePattern(), fLayerNumber);
637 TGeoVolume *modVol = new TGeoVolume(volname, module, medAir);
638
d2a3dfa2 639 // mm (not used) zlen = ((TGeoBBox*)chipVol->GetShape())->GetDZ();
c55b10c2 640 for (Int_t j=0; j<fgkIBChipsPerRow; j++) {
2b9468b2 641 zpos = -zmod + j*2*zchip + zchip;
642 modVol->AddNode(chipVol, j, new TGeoTranslation(0, 0, zpos));
c55b10c2 643 fHierarchy[kChip]++;
644 }
645
646 // Done, return the module
647 return modVol;
b705c75b 648}
649
650//________________________________________________________________________
852af72e 651TGeoVolume* AliITSUv1Layer::CreateStaveStructInnerB(const Double_t xsta,
652 const Double_t zsta,
b705c75b 653 const TGeoManager *mgr){
654//
655// Create the mechanical stave structure
656//
657// Input:
852af72e 658// xsta : X length
659// zsta : Z length
b705c75b 660// mgr : the GeoManager (used only to get the proper material)
661//
662// Output:
663//
664// Return:
665//
666// Created: 22 Mar 2013 Chinorat Kobdaj
667// Updated: 26 Apr 2013 Mario Sitta
668//
669
852af72e 670 TGeoVolume *mechStavVol = 0;
b705c75b 671
672 switch (fStaveModel) {
673 case AliITSUv1::kIBModelDummy:
852af72e 674 mechStavVol = CreateStaveModelInnerBDummy(xsta,zsta,mgr);
b705c75b 675 break;
676 case AliITSUv1::kIBModel0:
852af72e 677 mechStavVol = CreateStaveModelInnerB0(xsta,zsta,mgr);
b705c75b 678 break;
679 case AliITSUv1::kIBModel1:
852af72e 680 mechStavVol = CreateStaveModelInnerB1(xsta,zsta,mgr);
b705c75b 681 break;
682 case AliITSUv1::kIBModel21:
852af72e 683 mechStavVol = CreateStaveModelInnerB21(xsta,zsta,mgr);
b705c75b 684 break;
685 case AliITSUv1::kIBModel22:
852af72e 686 mechStavVol = CreateStaveModelInnerB22(xsta,zsta,mgr);
b705c75b 687 break;
688 case AliITSUv1::kIBModel3:
852af72e 689 mechStavVol = CreateStaveModelInnerB3(xsta,zsta,mgr);
b705c75b 690 break;
019dc90c 691 case AliITSUv1::kIBModel4:
692 mechStavVol = CreateStaveModelInnerB4(xsta,zsta,mgr);
693 break;
b705c75b 694 default:
695 AliFatal(Form("Unknown stave model %d",fStaveModel));
696 break;
697 }
698
852af72e 699 return mechStavVol;
b705c75b 700}
701
702
703//________________________________________________________________________
704TGeoVolume* AliITSUv1Layer::CreateStaveModelInnerBDummy(const Double_t ,
705 const Double_t ,
706 const TGeoManager *) const {
707//
708// Create dummy stave
709//
710// Input:
852af72e 711// xsta : X length
712// zsta : Z length
b705c75b 713// mgr : the GeoManager (used only to get the proper material)
714//
715// Output:
716//
717// Return:
718//
719// Created: 22 Mar 2013 Chinorat Kobdaj
720// Updated: 26 Apr 2013 Mario Sitta
721//
722
723 // Done, return the stave structur
724 return 0;
725}
726
727//________________________________________________________________________
852af72e 728TGeoVolume* AliITSUv1Layer::CreateStaveModelInnerB0(const Double_t xsta,
729 const Double_t zsta,
b705c75b 730 const TGeoManager *mgr){
731//
732// Create the mechanical stave structure for Model 0 of TDR
733//
734// Input:
852af72e 735// xsta : X length
736// zsta : Z length
b705c75b 737// mgr : the GeoManager (used only to get the proper material)
738//
739// Output:
740//
741// Return:
742//
743// Created: 22 Mar 2013 Chinorat Kobdaj
744// Updated: 26 Apr 2013 Mario Sitta
745//
746
747 // Materials defined in AliITSUv1
748 TGeoMedium *medAir = mgr->GetMedium("ITS_AIR$");
749 TGeoMedium *medWater = mgr->GetMedium("ITS_WATER$");
750
751 TGeoMedium *medM60J3K = mgr->GetMedium("ITS_M60J3K$");
752 TGeoMedium *medKapton = mgr->GetMedium("ITS_KAPTON(POLYCH2)$");
753 TGeoMedium *medGlue = mgr->GetMedium("ITS_GLUE$");
754 TGeoMedium *medFlexCable = mgr->GetMedium("ITS_FLEXCABLE$");
755
756 // Local parameters
757 Double_t kConeOutRadius = 0.15/2;
758 Double_t kConeInRadius = 0.1430/2;
852af72e 759 Double_t kStaveLength = zsta*2;
760 Double_t kStaveWidth = xsta*2-kConeOutRadius*2;
b705c75b 761 Double_t kWidth = kStaveWidth/4;//1/2 of kWidth
762 Double_t kStaveHeight = 0.3;
763 Double_t kHeight = kStaveHeight/2;
764 Double_t kAlpha = 90-67;//90-33.69;
765 Double_t kTheta = kAlpha*TMath::DegToRad();
766 Double_t kS1 = kWidth/TMath::Sin(kTheta);
767 Double_t kL1 = kWidth/TMath::Tan(kTheta);
768 Double_t kS2 = TMath::Sqrt(kHeight*kHeight + kS1*kS1);//TMath::Sin(the2);
769 Double_t kThe2 = TMath::ATan(kHeight/kS1);
770 Double_t kBeta = kThe2*TMath::RadToDeg();
771 // Int_t loop = kStaveLength/(kL1);
772 // Double_t s3 = kWidth/(2*TMath::Sin(kTheta));
773 // Double_t s4 = 3*kWidth/(2*TMath::Sin(kTheta));
774
775 AliDebug(1, Form("BuildLevel %d\n",fBuildLevel));
776
777 char volname[30];
852af72e 778 snprintf(volname, 30, "%s%d_StaveStruct", AliITSUGeomTGeo::GetITSStavePattern(), fLayerNumber);
b705c75b 779
780 Double_t z=0, y=-0.011+0.0150, x=0;
781
852af72e 782 TGeoVolume *mechStavVol = 0;
b705c75b 783
784 if (fBuildLevel < 5) {
785
786 // world (trapezoid)
787 TGeoXtru *mechStruct = new TGeoXtru(2); //z sections
788 Double_t xv[5] = {kStaveWidth/2+0.1,kStaveWidth/2+0.1,0,-kStaveWidth/2-0.1,-kStaveWidth/2-0.1};
789 Double_t yv[5] = {-kConeOutRadius*2-0.07,0,kStaveHeight,0,-kConeOutRadius*2-0.07};
790 mechStruct->DefinePolygon(5,xv,yv);
791 mechStruct->DefineSection(0,-kStaveLength-0.1,0,0,1.);
792 mechStruct->DefineSection(1,kStaveLength+0.1,0,0,1.);
793
852af72e 794 mechStavVol = new TGeoVolume(volname, mechStruct, medAir);
795 mechStavVol->SetLineColor(12);
796 mechStavVol->SetFillColor(12);
797 mechStavVol->SetVisibility(kTRUE);
b705c75b 798
799 // detailed structure ++++++++++++++
800 //Pipe Kapton grey-35
801 TGeoTube *coolTube = new TGeoTube(kConeInRadius,kConeOutRadius,kStaveLength/2);
802 TGeoVolume *volCoolTube= new TGeoVolume("pipe", coolTube, medKapton);
803 volCoolTube->SetFillColor(35);
804 volCoolTube->SetLineColor(35);
852af72e 805 mechStavVol->AddNode(volCoolTube,0,new TGeoTranslation(x+(kStaveWidth/2),y-(kHeight-kConeOutRadius),0));
806 mechStavVol->AddNode(volCoolTube,1,new TGeoTranslation(x-(kStaveWidth/2),y-(kHeight-kConeOutRadius),0));
b705c75b 807 }
808
809 if (fBuildLevel < 4) {
810 TGeoTube *coolTubeW = new TGeoTube(0.,kConeInRadius,kStaveLength/2);
811 TGeoVolume *volCoolTubeW= new TGeoVolume("pipeWater", coolTubeW, medWater);
812 volCoolTubeW->SetFillColor(4);
813 volCoolTubeW->SetLineColor(4);
852af72e 814 mechStavVol->AddNode(volCoolTubeW,0,new TGeoTranslation(x+(kStaveWidth/2),y-(kHeight-kConeOutRadius),0));
815 mechStavVol->AddNode(volCoolTubeW,1,new TGeoTranslation(x-(kStaveWidth/2),y-(kHeight-kConeOutRadius),0));
b705c75b 816 }
817
818 //frequency of filament
819 //n = 4 means very dense(4 filaments per interval)
820 //n = 2 means dense(2 filaments per interval)
821 Int_t n =4;
822 Int_t loop = (Int_t)(kStaveLength/(4*kL1/n) + 2/n)-1;
823 if (fBuildLevel < 3) {
824 //Top CFRP Filament black-12 Carbon structure TGeoBBox (length,thickness,width)
825 TGeoBBox *t2=new TGeoBBox(kS2,0.007/2,0.15/2);//(kS2,0.002,0.02);
826 TGeoVolume *volT2=new TGeoVolume("TopFilament", t2, medM60J3K);
827 volT2->SetLineColor(12);
828 volT2->SetFillColor(12);
829
830 for(int i=1;i<loop;i++){ //i<60;i++){
852af72e 831 mechStavVol->AddNode(volT2,4*i+0,
b705c75b 832 new TGeoCombiTrans(x+kWidth,y+(2*kConeOutRadius),z-kStaveLength/2+(i*(4/n)*kL1)+kS1/2,//z-14.25+(i*2*kL1),
833 new TGeoRotation("volT2",90,90-kAlpha,90-kBeta)));
852af72e 834 mechStavVol->AddNode(volT2,4*i+1,
b705c75b 835 new TGeoCombiTrans(x-kWidth,y+(2*kConeOutRadius),z-kStaveLength/2+(i*(4/n)*kL1)+kS1/2,//z-14.25+(i*2*kL1),
836 new TGeoRotation("volT2",90,-90+kAlpha,-90+kBeta)));
852af72e 837 mechStavVol->AddNode(volT2,4*i+2,
b705c75b 838 new TGeoCombiTrans(x+kWidth,y+(2*kConeOutRadius),z-kStaveLength/2+(i*(4/n)*kL1)+kS1/2,//z-14.25+(i*2*kL1),
839 new TGeoRotation("volT2",90,-90+kAlpha,90-kBeta)));
852af72e 840 mechStavVol->AddNode(volT2,4*i+3,
b705c75b 841 new TGeoCombiTrans(x-kWidth,y+(2*kConeOutRadius),z-kStaveLength/2+(i*(4/n)*kL1)+kS1/2,//z-14.25+(i*2*kL1),
842 new TGeoRotation("volT2",90,90-kAlpha,-90+kBeta)));
843 }
844
845
846 //Bottom CFRP Filament black-12 Carbon structure TGeoBBox (thickness,width,length)
847 TGeoBBox *t1=new TGeoBBox(0.007/2,0.15/2,kS1);//(0.002,0.02,kS1);
848 TGeoVolume *volT1=new TGeoVolume("CFRPBottom", t1, medM60J3K);
849 volT1->SetLineColor(12);
850 volT1->SetFillColor(12);
851
852 for(int i=1;i<loop;i++){
852af72e 853 mechStavVol->AddNode(volT1,4*i+0,
b705c75b 854 new TGeoCombiTrans(x+kWidth,y-kHeight,z-kStaveLength/2+((4/n)*kL1*i)+kS1/2, //z-14.25+(i*2*kL1),
855 new TGeoRotation("volT1",-90,kAlpha,0)));
852af72e 856 mechStavVol->AddNode(volT1,4*i+1,
b705c75b 857 new TGeoCombiTrans(x-kWidth,y-kHeight,z-kStaveLength/2+((4/n)*kL1*i)+kS1/2, //z-14.25+(i*2*kL1),
858 new TGeoRotation("volT1",90,kAlpha,0)));
852af72e 859 mechStavVol->AddNode(volT1,4*i+2,
b705c75b 860 new TGeoCombiTrans(x+kWidth,y-kHeight,z-kStaveLength/2+(i*(4/n)*kL1)+kS1/2, //z-14.25+(i*2*kL1),
861 new TGeoRotation("volT1",-90,-kAlpha,0)));
852af72e 862 mechStavVol->AddNode(volT1,4*i+3,
b705c75b 863 new TGeoCombiTrans(x-kWidth,y-kHeight,z-kStaveLength/2+(i*(4/n)*kL1)+kS1/2, //z-14.25+(i*2*kL1),
864 new TGeoRotation("volT1",-90,+kAlpha,0)));
865 }
866 }
867
868 if (fBuildLevel < 2) {
869 // Glue CFRP-Silicon layers TGeoBBox(thickness,width,kS1);
870 TGeoBBox *tG=new TGeoBBox(0.0075/2,0.18/2,kS1);
871 TGeoVolume *volTG=new TGeoVolume("Glue1", tG, medGlue);
872 volTG->SetLineColor(5);
873 volTG->SetFillColor(5);
874
875 for(int i=1;i<loop;i++){ //i<60;i++){
852af72e 876 mechStavVol->AddNode(volTG,4*i+0,
b705c75b 877 new TGeoCombiTrans(x+kWidth,y-0.16,z-kStaveLength/2+((4/n)*kL1*i)+kS1/2, //z-14.25+(2*kL1*i),
878 new TGeoRotation("volTG",-90,kAlpha,0)));
852af72e 879 mechStavVol->AddNode(volTG,4*i+1,
b705c75b 880 new TGeoCombiTrans(x-kWidth,y-0.16,z-kStaveLength/2+((4/n)*kL1*i)+kS1/2, //z-14.25+(2*kL1*i),
881 new TGeoRotation("volTG",90,kAlpha,0)));
852af72e 882 mechStavVol->AddNode(volTG,4*i+2,
b705c75b 883 new TGeoCombiTrans(x+kWidth,y-0.16,z-kStaveLength/2+((4/n)*i*kL1)+kS1/2, //z-14.25+(i*2*kL1),
884 new TGeoRotation("volTG",-90,-kAlpha,0)));
852af72e 885 mechStavVol->AddNode(volTG,4*i+3,
b705c75b 886 new TGeoCombiTrans(x-kWidth,y-0.16,z-kStaveLength/2+(i*(4/n)*kL1)+kS1/2, //z-14.25+(i*2*kL1),
887 new TGeoRotation("volTG",-90,+kAlpha,0)));
888 }
889
852af72e 890 TGeoBBox *glue = new TGeoBBox(xsta, 0.005/2, zsta);
b705c75b 891 TGeoVolume *volGlue=new TGeoVolume("Glue2", glue, medGlue);
892 volGlue->SetLineColor(5);
893 volGlue->SetFillColor(5);
852af72e 894 //mechStavVol->AddNode(volGlue, 0, new TGeoCombiTrans(x, y-0.16, z, new TGeoRotation("",0, 0, 0)));
895 mechStavVol->AddNode(volGlue, 1, new TGeoCombiTrans(x, y-0.165-fSensorThick-0.005, z, new TGeoRotation("",0, 0, 0)));
b705c75b 896 }
897
898 if (fBuildLevel < 1) {
899 //Flex cable brown-28 TGeoBBox(width,thickness,length);
852af72e 900 TGeoBBox *kapCable = new TGeoBBox(xsta, 0.01/2, zsta);
b705c75b 901 TGeoVolume *volCable=new TGeoVolume("FlexCable", kapCable, medFlexCable);
902 volCable->SetLineColor(28);
903 volCable->SetFillColor(28);
852af72e 904 mechStavVol->AddNode(volCable, 0, new TGeoCombiTrans(x, y-0.165-fSensorThick-0.005-0.01, z, new TGeoRotation("",0, 0, 0)));
b705c75b 905 }
906
907 // Done, return the stave structur
852af72e 908 return mechStavVol;
b705c75b 909}
910
911
912//________________________________________________________________________
852af72e 913TGeoVolume* AliITSUv1Layer::CreateStaveModelInnerB1(const Double_t xsta,
914 const Double_t zsta,
b705c75b 915 const TGeoManager *mgr){
916//
917// Create the mechanical stave structure for Model 1 of TDR
918//
919// Input:
852af72e 920// xsta : X length
921// zsta : Z length
b705c75b 922// mgr : the GeoManager (used only to get the proper material)
923//
924// Output:
925//
926// Return:
927//
928// Created: 22 Mar 2013 Chinorat Kobdaj
929// Updated: 26 Apr 2013 Mario Sitta
930//
931
932 // Materials defined in AliITSUv1
933 TGeoMedium *medAir = mgr->GetMedium("ITS_AIR$");
934 TGeoMedium *medWater = mgr->GetMedium("ITS_WATER$");
935
936 TGeoMedium *medM60J3K = mgr->GetMedium("ITS_M60J3K$");
937 TGeoMedium *medKapton = mgr->GetMedium("ITS_KAPTON(POLYCH2)$");
938 TGeoMedium *medGlue = mgr->GetMedium("ITS_GLUE$");
939 TGeoMedium *medFlexCable = mgr->GetMedium("ITS_FLEXCABLE$");
940
941 // Local parameters
942 Double_t kConeOutRadius = 0.15/2;
943 // Double_t kConeInRadius = 0.1430/2;
852af72e 944 Double_t kStaveLength = zsta*2;
945 // Double_t kStaveWidth = xsta*2-kConeOutRadius*2;
946 Double_t kStaveWidth = xsta*2;
b705c75b 947 Double_t kWidth = kStaveWidth/4;//1/2 of kWidth
948 Double_t kStaveHeight = 0.3;
949 Double_t kHeight = kStaveHeight/2;
950 Double_t kAlpha = 90-33.;//90-30;
951 Double_t kTheta = kAlpha*TMath::DegToRad();
952 Double_t kS1 = kWidth/TMath::Sin(kTheta);
953 Double_t kL1 = kWidth/TMath::Tan(kTheta);
954 Double_t kS2 = TMath::Sqrt(kHeight*kHeight + kS1*kS1);//TMath::Sin(the2);
955 Double_t kThe2 = TMath::ATan(kHeight/kS1);
956 Double_t kBeta = kThe2*TMath::RadToDeg();
957 Int_t loop = (Int_t)((kStaveLength/(2*kL1))/2);
958
959
852af72e 960 TGeoVolume *mechStavVol = 0;
b705c75b 961
962 char volname[30];
852af72e 963 snprintf(volname, 30, "%s%d_StaveStruct", AliITSUGeomTGeo::GetITSStavePattern(), fLayerNumber);
b705c75b 964
965
966 // detailed structure ++++++++++++++
967 Double_t z=0, y=-0.011+0.0150, x=0;
968
969 // Polimide micro channels numbers
970 Double_t yMC = y-kHeight+0.01;
971 Int_t nb = (Int_t)(kStaveWidth/0.1)+1;
852af72e 972 Double_t xstaMC = (nb*0.1-0.08)/2;
b705c75b 973
974
975 if (fBuildLevel < 5) {
976 // world (trapezoid)
977 TGeoXtru *mechStruct = new TGeoXtru(2); //z sections
978 Double_t xv[5] = {kStaveWidth/2+0.1,kStaveWidth/2+0.1,0,-kStaveWidth/2-0.1,-kStaveWidth/2-0.1};
979 Double_t yv[5] = {-kConeOutRadius*2-0.07,0,kStaveHeight,0,-kConeOutRadius*2-0.07};
980 mechStruct->DefinePolygon(5,xv,yv);
981 mechStruct->DefineSection(0,-kStaveLength-0.1,0,0,1.);
982 mechStruct->DefineSection(1,kStaveLength+0.1,0,0,1.);
983
852af72e 984 mechStavVol = new TGeoVolume(volname, mechStruct, medAir);
985 mechStavVol->SetLineColor(12);
986 mechStavVol->SetFillColor(12);
987 mechStavVol->SetVisibility(kTRUE);
b705c75b 988
989 // Polimide micro channels numbers
852af72e 990 TGeoBBox *tM0=new TGeoBBox(xstaMC, 0.005/2, zsta);
b705c75b 991 TGeoVolume *volTM0=new TGeoVolume("MicroChanCover", tM0, medKapton);
992 volTM0->SetLineColor(35);
993 volTM0->SetFillColor(35);
852af72e 994 mechStavVol->AddNode(volTM0, 0, new TGeoCombiTrans(x,-0.0125+yMC, z, new TGeoRotation("",0, 0, 0)));
995 mechStavVol->AddNode(volTM0, 1, new TGeoCombiTrans(x,+0.0125+yMC, z, new TGeoRotation("",0, 0, 0)));
b705c75b 996
852af72e 997 TGeoBBox *tM0b=new TGeoBBox(0.02/2, 0.02/2, zsta);
b705c75b 998 TGeoVolume *volTM0b=new TGeoVolume("MicroChanWalls", tM0b, medKapton);
999 volTM0b->SetLineColor(35);
1000 volTM0b->SetFillColor(35);
1001 for (Int_t ib=0;ib<nb;ib++) {
852af72e 1002 mechStavVol->AddNode(volTM0b, ib, new TGeoCombiTrans(x+ib*0.1-xstaMC+0.01,yMC, z, new TGeoRotation("",0, 0, 0)));
b705c75b 1003 }
1004
1005 }
1006
1007 if (fBuildLevel < 4) {
1008 // Water in Polimide micro channels
852af72e 1009 TGeoBBox *water=new TGeoBBox(0.08/2, 0.02/2, zsta+0.1);
b705c75b 1010 TGeoVolume *volWater=new TGeoVolume("Water", water, medWater);
1011 volWater->SetLineColor(4);
1012 volWater->SetFillColor(4);
1013 for (Int_t ib=0;ib<(nb-1);ib++) {
852af72e 1014 mechStavVol->AddNode(volWater, ib, new TGeoCombiTrans(x+ib*0.1-xstaMC+0.06,yMC, z, new TGeoRotation("",0, 0, 0)));
b705c75b 1015 }
1016 }
1017
1018 if (fBuildLevel < 3) {
1019 //Bottom filament CFRP black-12 Carbon structure TGeoBBox (thickness,width,length)
1020 Double_t filWidth = 0.04;
1021 Double_t filHeight= 0.02;
1022 TGeoBBox *t1=new TGeoBBox(filHeight/2,filWidth/2,kS1);
1023 TGeoVolume *volT1=new TGeoVolume("CFRPBottom", t1, medM60J3K);
1024 volT1->SetLineColor(12);
1025 volT1->SetFillColor(12);
1026 for(int i=0;i<loop;i++){//i<30;i++){
852af72e 1027 mechStavVol->AddNode(volT1,4*i+0,
b705c75b 1028 new TGeoCombiTrans(x+kWidth,y-kHeight+0.04+filHeight/2,z-kStaveLength/2+(4*kL1)+kS1/2,
1029 new TGeoRotation("volT1",-90,kAlpha,0)));
852af72e 1030 mechStavVol->AddNode(volT1,4*i+1,
b705c75b 1031 new TGeoCombiTrans(x-kWidth,y-kHeight+0.04+filHeight/2,z-kStaveLength/2+(4*kL1*i)+kS1/2,
1032 new TGeoRotation("volT1",90,kAlpha,0)));
852af72e 1033 mechStavVol->AddNode(volT1,4*i+2,
b705c75b 1034 new TGeoCombiTrans(x+kWidth,y-kHeight+0.04+filHeight/2,z-kStaveLength/2+2*kL1+(i*4*kL1)+kS1/2,
1035 new TGeoRotation("volT1",-90,-kAlpha,0)));
852af72e 1036 mechStavVol->AddNode(volT1,4*i+3,
b705c75b 1037 new TGeoCombiTrans(x-kWidth,y-kHeight+0.04+filHeight/2,z-kStaveLength/2+2*kL1+(i*4*kL1)+kS1/2,
1038 new TGeoRotation("volT1",-90,+kAlpha,0)));
1039 }
1040
1041 // Top filament CFRP black-12 Carbon structure TGeoBBox (length,thickness,width)
1042 TGeoBBox *t2=new TGeoBBox(kS2,filHeight/2,filWidth/2);
1043 TGeoVolume *volT2=new TGeoVolume("CFRPTop", t2, medM60J3K);
1044 volT2->SetLineColor(12);
1045 volT2->SetFillColor(12);
1046 for(int i=0;i<loop;i++){ //i<30;i++){
852af72e 1047 mechStavVol->AddNode(volT2,4*i+0,
b705c75b 1048 new TGeoCombiTrans(x+kWidth,y+0.04+filHeight/2,z-kStaveLength/2+(i*4*kL1)+kS1/2,
1049 new TGeoRotation("volT2",90,90-kAlpha,90-kBeta)));
852af72e 1050 mechStavVol->AddNode(volT2,4*i+1,
b705c75b 1051 new TGeoCombiTrans(x-kWidth,y+0.04+filHeight/2,z-kStaveLength/2+(i*4*kL1)+kS1/2,
1052 new TGeoRotation("volT2",90,-90+kAlpha,-90+kBeta)));
852af72e 1053 mechStavVol->AddNode(volT2,4*i+2,
b705c75b 1054 new TGeoCombiTrans(x+kWidth,y+0.04+filHeight/2,z-kStaveLength/2+2*kL1+(i*4*kL1)+kS1/2,
1055 new TGeoRotation("volT2",90,-90+kAlpha,90-kBeta)));
852af72e 1056 mechStavVol->AddNode(volT2,4*i+3,
b705c75b 1057 new TGeoCombiTrans(x-kWidth,y+0.04+filHeight/2,z-kStaveLength/2+2*kL1+(i*4*kL1)+kS1/2,
1058 new TGeoRotation("volT2",90,90-kAlpha,-90+kBeta)));
1059 }
1060 }
1061
1062 if (fBuildLevel < 2) {
1063 // Glue between filament and polimide micro channel
1064 TGeoBBox *t3=new TGeoBBox(0.01/2,0.04,kS1);
1065 TGeoVolume *volT3=new TGeoVolume("FilamentGlue", t3, medGlue);
1066 volT3->SetLineColor(5);
1067 volT3->SetFillColor(5);
1068 for(int i=0;i<loop;i++){//i<30;i++){
852af72e 1069 mechStavVol->AddNode(volT3,4*i+0,
b705c75b 1070 new TGeoCombiTrans(x+kWidth,y-kHeight+0.0325,z-kStaveLength/2+(4*kL1*i)+kS1/2,
1071 new TGeoRotation("volT1",-90,kAlpha,0)));
852af72e 1072 mechStavVol->AddNode(volT3,4*i+1,
b705c75b 1073 new TGeoCombiTrans(x-kWidth,y-kHeight+0.0325,z-kStaveLength/2+(4*kL1*i)+kS1/2,
1074 new TGeoRotation("volT1",90,kAlpha,0)));
852af72e 1075 mechStavVol->AddNode(volT3,4*i+2,
b705c75b 1076 new TGeoCombiTrans(x+kWidth,y-kHeight+0.0325,z-kStaveLength/2+2*kL1+(i*4*kL1)+kS1/2,
1077 new TGeoRotation("volT1",-90,-kAlpha,0)));
852af72e 1078 mechStavVol->AddNode(volT3,4*i+3,
b705c75b 1079 new TGeoCombiTrans(x-kWidth,y-kHeight+0.0325,z-kStaveLength/2+2*kL1+(i*4*kL1)+kS1/2,
1080 new TGeoRotation("volT1",-90,+kAlpha,0)));
1081 }
1082
1083 // Glue microchannel and sensor
852af72e 1084 TGeoBBox *glueM = new TGeoBBox(xsta, 0.01/2, zsta);
b705c75b 1085 TGeoVolume *volGlueM=new TGeoVolume("MicroChanGlue", glueM, medGlue);
1086 volGlueM->SetLineColor(5);
1087 volGlueM->SetFillColor(5);
852af72e 1088 mechStavVol->AddNode(volGlueM, 0, new TGeoCombiTrans(x, y-0.16, z, new TGeoRotation("",0, 0, 0)));
b705c75b 1089
1090 // Glue sensor and kapton
852af72e 1091 TGeoBBox *glue = new TGeoBBox(xsta, 0.005/2, zsta);
b705c75b 1092 TGeoVolume *volGlue=new TGeoVolume("SensorGlue", glue, medGlue);
1093 volGlue->SetLineColor(5);
1094 volGlue->SetFillColor(5);
852af72e 1095 mechStavVol->AddNode(volGlue, 1, new TGeoCombiTrans(x, y-0.165-fSensorThick-0.005, z, new TGeoRotation("",0, 0, 0)));
b705c75b 1096 }
1097
1098 if (fBuildLevel < 1) {
852af72e 1099 TGeoBBox *kapCable = new TGeoBBox(xsta, 0.01/2, zsta);
b705c75b 1100 TGeoVolume *volCable=new TGeoVolume("FlexCable", kapCable, medFlexCable);
1101 volCable->SetLineColor(28);
1102 volCable->SetFillColor(28);
852af72e 1103 mechStavVol->AddNode(volCable, 0, new TGeoCombiTrans(x, y-0.165-fSensorThick-0.005-0.01, z, new TGeoRotation("",0, 0, 0)));
b705c75b 1104 }
1105
1106 // Done, return the stave structur
852af72e 1107 return mechStavVol;
b705c75b 1108
1109}
1110
1111//________________________________________________________________________
852af72e 1112TGeoVolume* AliITSUv1Layer::CreateStaveModelInnerB21(const Double_t xsta,
1113 const Double_t zsta,
b705c75b 1114 const TGeoManager *mgr){
1115//
1116// Create the mechanical stave structure for Model 2.1 of TDR
1117//
1118// Input:
852af72e 1119// xsta : X length
1120// zsta : Z length
b705c75b 1121// mgr : the GeoManager (used only to get the proper material)
1122//
1123// Output:
1124//
1125// Return:
1126//
1127// Created: 22 Mar 2013 Chinorat Kobdaj
1128// Updated: 26 Apr 2013 Mario Sitta
1129//
1130
1131 // Materials defined in AliITSUv1
1132 TGeoMedium *medAir = mgr->GetMedium("ITS_AIR$");
1133 TGeoMedium *medWater = mgr->GetMedium("ITS_WATER$");
1134
1135 TGeoMedium *medM60J3K = mgr->GetMedium("ITS_M60J3K$");
1136 TGeoMedium *medKapton = mgr->GetMedium("ITS_KAPTON(POLYCH2)$");
1137 TGeoMedium *medGlue = mgr->GetMedium("ITS_GLUE$");
1138 TGeoMedium *medFlexCable = mgr->GetMedium("ITS_FLEXCABLE$");
1139 TGeoMedium *medK13D2U2k = mgr->GetMedium("ITS_K13D2U2k$");
1140 TGeoMedium *medFGS003 = mgr->GetMedium("ITS_FGS003$");
1141 TGeoMedium *medCarbonFleece = mgr->GetMedium("ITS_CarbonFleece$");
1142
1143 // Local parameters
1144 Double_t kConeOutRadius =0.151384/2;
1145 Double_t kConeInRadius = 0.145034/2;
852af72e 1146 Double_t kStaveLength = zsta;
1147 Double_t kStaveWidth = xsta*2;
b705c75b 1148 Double_t kWidth = (kStaveWidth+0.005)/4;
1149 Double_t kStaveHeigth = 0.33;//0.33;
1150 Double_t kHeight = (kStaveHeigth+0.025)/2;
1151 Double_t kAlpha = 57; //56.31;
1152 Double_t kTheta = kAlpha*TMath::DegToRad();
1153 Double_t kS1 = (kStaveWidth/4)/TMath::Sin(kTheta);
1154 Double_t kL1 = (kStaveWidth/4)/TMath::Tan(kTheta);
1155 Double_t kS2 = sqrt(kHeight*kHeight + kS1*kS1);//TMath::Sin(the2);
1156 Double_t kThe2 = TMath::ATan(kHeight/kS1);
1157 Double_t kBeta = kThe2*TMath::RadToDeg();
1158 // Double_t lay1 = 0.003157;
1159 Double_t kLay1 = 0.003;//Amec carbon
1160 // Double_t lay2 = 0.0043215;//C Fleece carbon
1161 Double_t kLay2 = 0.002;//C Fleece carbon
1162 Double_t kLay3 = 0.007;//K13D2U carbon
1163 Int_t loop = (Int_t)(kStaveLength/(2*kL1));
1164
1165
1166 char volname[30];
852af72e 1167 snprintf(volname, 30, "%s%d_StaveStruct", AliITSUGeomTGeo::GetITSStavePattern(), fLayerNumber);
b705c75b 1168
1169 Double_t z=0, y=-(kConeOutRadius+0.03)+0.0385, x=0;
1170
852af72e 1171 TGeoVolume *mechStavVol = 0;
b705c75b 1172
1173 if (fBuildLevel < 5) {
1174 // world (trapezoid)
1175 TGeoXtru *mechStruct = new TGeoXtru(2); //z sections
1176 Double_t xv[5] = {kStaveWidth/2+0.1,kStaveWidth/2+0.1,0,-kStaveWidth/2-0.1,-kStaveWidth/2-0.1};
1177 Double_t yv[5] = {-kConeOutRadius*2-0.07,0,kStaveHeigth,0,-kConeOutRadius*2-0.07};
1178 mechStruct->DefinePolygon(5,xv,yv);
1179 mechStruct->DefineSection(0,-kStaveLength-0.1,0,0,1.);
1180 mechStruct->DefineSection(1,kStaveLength+0.1,0,0,1.);
1181
852af72e 1182 mechStavVol = new TGeoVolume(volname, mechStruct, medAir);
1183 mechStavVol->SetLineColor(12);
1184 mechStavVol->SetFillColor(12);
1185 mechStavVol->SetVisibility(kTRUE);
b705c75b 1186
1187 //Pipe Kapton grey-35
1188 TGeoCone *cone1 = new TGeoCone(kStaveLength,kConeInRadius,kConeOutRadius,kConeInRadius,kConeOutRadius);
1189 TGeoVolume *volCone1= new TGeoVolume("PolyimidePipe", cone1, medKapton);
1190 volCone1->SetFillColor(35);
1191 volCone1->SetLineColor(35);
852af72e 1192 mechStavVol->AddNode(volCone1,1,new TGeoTranslation(x+0.25,y,z));
1193 mechStavVol->AddNode(volCone1,2,new TGeoTranslation(x-0.25,y,z));
b705c75b 1194 }
1195
1196 if (fBuildLevel < 4) {
1197
1198 TGeoTube *coolTubeW = new TGeoTube(0.,kConeInRadius,kStaveLength);
1199 TGeoVolume *volCoolTubeW= new TGeoVolume("Water", coolTubeW, medWater);
1200 volCoolTubeW->SetFillColor(4);
1201 volCoolTubeW->SetLineColor(4);
852af72e 1202 mechStavVol->AddNode(volCoolTubeW,0,new TGeoTranslation(x-0.25,y,z));
1203 mechStavVol->AddNode(volCoolTubeW,1,new TGeoTranslation(x+0.25,y,z));
b705c75b 1204 }
1205
1206 if (fBuildLevel < 3) {
1207 //top fillament
1208 // Top filament M60J black-12 Carbon structure TGeoBBox (length,thickness,width)
1209 TGeoBBox *t2=new TGeoBBox(kS2,0.02/2,0.04/2); //TGeoBBox *t2=new TGeoBBox(kS2,0.01,0.02);
1210 TGeoVolume *volT2=new TGeoVolume("TopFilament", t2, medM60J3K);
1211 volT2->SetLineColor(12);
1212 volT2->SetFillColor(12);
1213 for(int i=0;i<loop;i++){// i<28;i++){
852af72e 1214 mechStavVol->AddNode(volT2,i*4+1,new TGeoCombiTrans(x+kWidth,y+kHeight+(0.12/2)-0.014+0.007,z-kStaveLength+(i*4*kL1)+kS1/2, new TGeoRotation("volT2",90,90-kAlpha,90-kBeta)));
1215 mechStavVol->AddNode(volT2,i*4+2,new TGeoCombiTrans(x-kWidth,y+kHeight+(0.12/2)-0.014+0.007,z-kStaveLength+(i*4*kL1)+kS1/2, new TGeoRotation("volT2",90,-90+kAlpha,-90+kBeta)));
1216 mechStavVol->AddNode(volT2,i*4+3,new TGeoCombiTrans(x+kWidth,y+kHeight+(0.12/2)-0.014+0.007,z-kStaveLength+2*kL1+(i*4*kL1)+kS1/2, new TGeoRotation("volT2",90,-90+kAlpha,90-kBeta)));
1217 mechStavVol->AddNode(volT2,i*4+4,new TGeoCombiTrans(x-kWidth,y+kHeight+(0.12/2)-0.014+0.007,z-kStaveLength+2*kL1+(i*4*kL1)+kS1/2, new TGeoRotation("volT2",90,90-kAlpha,-90+kBeta)));
1218// mechStavVol->AddNode(volT2,i*4+1,new TGeoCombiTrans(x+kWidth+0.0036,y+kHeight-(0.12/2)+0.072,z+kStaveLength+(i*4*kL1)+kS1/2, new TGeoRotation("volT2",90,90-kAlpha,90-kBeta)));
b705c75b 1219
1220 }
1221
1222 //wall side structure out
1223 TGeoBBox *box4 = new TGeoBBox(0.03/2,0.12/2,kStaveLength-0.50);
1224 TGeoVolume *plate4 = new TGeoVolume("WallOut",box4,medM60J3K);
1225 plate4->SetFillColor(35);
1226 plate4->SetLineColor(35);
852af72e 1227 mechStavVol->AddNode(plate4,1,new TGeoCombiTrans(x+(2*kStaveWidth/4)-(0.03/2),y-0.0022-kConeOutRadius+0.12/2+0.007,z,new TGeoRotation("plate4",0,0,0)));
1228 mechStavVol->AddNode(plate4,2,new TGeoCombiTrans(x-(2*kStaveWidth/4)+(0.03/2),y-0.0022-kConeOutRadius+0.12/2+0.007,z,new TGeoRotation("plate4",0,0,0)));
b705c75b 1229 //wall side in
1230 TGeoBBox *box5 = new TGeoBBox(0.015/2,0.12/2,kStaveLength-0.50);
1231 TGeoVolume *plate5 = new TGeoVolume("WallIn",box5,medM60J3K);
1232 plate5->SetFillColor(12);
1233 plate5->SetLineColor(12);
852af72e 1234 mechStavVol->AddNode(plate5,1,new TGeoCombiTrans(x+(2*kStaveWidth/4)-0.03-0.015/2,y-0.0022-kConeOutRadius+0.12/2+0.007,z,new TGeoRotation("plate5",0,0,0)));
1235 mechStavVol->AddNode(plate5,2,new TGeoCombiTrans(x-(2*kStaveWidth/4)+0.03+0.015/2,y-0.0022-kConeOutRadius+0.12/2+0.007,z,new TGeoRotation("plate5",0,0,0)));
b705c75b 1236
1237 //Amec Thermasol red-2 cover tube FGS300
1238 TGeoConeSeg *cons1 = new TGeoConeSeg(kStaveLength-0.50,kConeOutRadius,kConeOutRadius+kLay1,kConeOutRadius,kConeOutRadius+kLay1,0,180);
1239 TGeoVolume *cone11 = new TGeoVolume("ThermasolPipeCover",cons1,medFGS003);
1240 cone11->SetFillColor(2);
1241 cone11->SetLineColor(2);
852af72e 1242 mechStavVol->AddNode(cone11,1,new TGeoCombiTrans(x+0.25,y,z,new TGeoRotation("Cone11",0,0,0)));
1243 mechStavVol->AddNode(cone11,2,new TGeoCombiTrans(x-0.25,y,z,new TGeoRotation("Cone11",0,0,0)));
b705c75b 1244
1245 TGeoBBox *box2 = new TGeoBBox((0.50-(2*kConeOutRadius))/2,kLay1/2,kStaveLength-0.50);
1246 TGeoVolume *plate2 = new TGeoVolume("ThermasolMiddle",box2,medFGS003);
1247 plate2->SetFillColor(2);
1248 plate2->SetLineColor(2);
852af72e 1249 mechStavVol->AddNode(plate2,1,new TGeoCombiTrans(x,y-kConeOutRadius+(kLay1/2),z,new TGeoRotation("plate2",0,0,0)));
b705c75b 1250
1251 TGeoBBox *box21 = new TGeoBBox((0.75-0.25-kConeOutRadius-kLay1)/2,kLay1/2,kStaveLength-0.50);
1252 TGeoVolume *plate21 = new TGeoVolume("ThermasolLeftRight",box21,medFGS003);
1253 plate21->SetFillColor(2);
1254 plate21->SetLineColor(2);
852af72e 1255 mechStavVol->AddNode(plate21,1,new TGeoCombiTrans(x+0.25+kConeOutRadius+(0.75-0.25-kConeOutRadius)/2-(kLay1/2),y-kConeOutRadius+(kLay1/2),z,new TGeoRotation("plate21",0,0,0)));
1256 mechStavVol->AddNode(plate21,2,new TGeoCombiTrans(x-0.25-kConeOutRadius-(0.75-0.25-kConeOutRadius)/2+(kLay1/2),y-kConeOutRadius+(kLay1/2),z,new TGeoRotation("plate21",0,0,0)));
b705c75b 1257
1258 TGeoBBox *box22 = new TGeoBBox((kLay1/2),kConeOutRadius/2,kStaveLength-0.50);
1259 TGeoVolume *plate22 = new TGeoVolume("ThermasolVertical",box22,medFGS003);
1260 plate22->SetFillColor(2);
1261 plate22->SetLineColor(2);
852af72e 1262 mechStavVol->AddNode(plate22,1,new TGeoCombiTrans(x+0.25+kConeOutRadius+(kLay1/2),y-kConeOutRadius/2,z,new TGeoRotation("plate22",0,0,0)));
1263 mechStavVol->AddNode(plate22,2,new TGeoCombiTrans(x+0.25-kConeOutRadius-(kLay1/2),y-kConeOutRadius/2,z,new TGeoRotation("plate22",0,0,0)));
1264 mechStavVol->AddNode(plate22,3,new TGeoCombiTrans(x-0.25+kConeOutRadius+(kLay1/2),y-kConeOutRadius/2,z,new TGeoRotation("plate22",0,0,0)));
1265 mechStavVol->AddNode(plate22,4,new TGeoCombiTrans(x-0.25-kConeOutRadius-(kLay1/2),y-kConeOutRadius/2,z,new TGeoRotation("plate22",0,0,0)));
b705c75b 1266
1267 //C Fleece
1268 TGeoConeSeg *cons2 = new TGeoConeSeg(kStaveLength-0.50,kConeOutRadius+kLay1,kConeOutRadius+kLay1+kLay2,kConeOutRadius+kLay1,kConeOutRadius+kLay1+kLay2,0,180);
1269 TGeoVolume *cone12 = new TGeoVolume("CFleecePipeCover",cons2,medCarbonFleece);
1270 cone12->SetFillColor(28);
1271 cone12->SetLineColor(28);
852af72e 1272 mechStavVol->AddNode(cone12,1,new TGeoCombiTrans(x+0.25,y,z,new TGeoRotation("Cone12",0,0,0)));
1273 mechStavVol->AddNode(cone12,2,new TGeoCombiTrans(x-0.25,y,z,new TGeoRotation("Cone12",0,0,0)));
b705c75b 1274
1275 TGeoBBox *box3 = new TGeoBBox((0.50-(2*(kConeOutRadius+kLay1)))/2,kLay2/2,kStaveLength-0.50);
1276 TGeoVolume *plate3 = new TGeoVolume("CFleeceMiddle",box3,medCarbonFleece);
1277 plate3->SetFillColor(28);
1278 plate3->SetLineColor(28);
852af72e 1279 mechStavVol->AddNode(plate3,1,new TGeoCombiTrans(x,y-kConeOutRadius+kLay1+(kLay2/2),z,new TGeoRotation("plate3",0,0,0)));
b705c75b 1280
1281 TGeoBBox *box31 = new TGeoBBox((0.75-0.25-kConeOutRadius-kLay1)/2,kLay2/2,kStaveLength-0.50);
1282 TGeoVolume *plate31 = new TGeoVolume("CFleeceLeftRight",box31,medCarbonFleece);
1283 plate31->SetFillColor(28);
1284 plate31->SetLineColor(28);
852af72e 1285 mechStavVol->AddNode(plate31,1,new TGeoCombiTrans(x+0.25+kConeOutRadius+kLay1+(0.75-0.25-kConeOutRadius-kLay1)/2,y-kConeOutRadius+kLay1+(kLay2/2),z,new TGeoRotation("plate31",0,0,0)));
1286 mechStavVol->AddNode(plate31,2,new TGeoCombiTrans(x-0.25-kConeOutRadius-kLay1-(0.75-0.25-kConeOutRadius-kLay1)/2,y-kConeOutRadius+kLay1+(kLay2/2),z,new TGeoRotation("plate31",0,0,0)));
b705c75b 1287
1288 TGeoBBox *box32 = new TGeoBBox((kLay2/2),(kConeOutRadius-kLay1)/2,kStaveLength-0.50);
1289 TGeoVolume *plate32 = new TGeoVolume("CFleeceVertical",box32,medCarbonFleece);
1290 plate32->SetFillColor(28);
1291 plate32->SetLineColor(28);
852af72e 1292 mechStavVol->AddNode(plate32,1,new TGeoCombiTrans(x+0.25+kConeOutRadius+kLay1+(kLay2/2),y+(kLay1-kConeOutRadius)/2,z,new TGeoRotation("plate32",0,0,0)));
1293 mechStavVol->AddNode(plate32,2,new TGeoCombiTrans(x+0.25-kConeOutRadius-kLay1-(kLay2/2),y+(kLay1-kConeOutRadius)/2,z,new TGeoRotation("plate32",0,0,0)));
1294 mechStavVol->AddNode(plate32,3,new TGeoCombiTrans(x-0.25+kConeOutRadius+kLay1+(kLay2/2),y+(kLay1-kConeOutRadius)/2,z,new TGeoRotation("plate32",0,0,0)));
1295 mechStavVol->AddNode(plate32,4,new TGeoCombiTrans(x-0.25-kConeOutRadius-kLay1-(kLay2/2),y+(kLay1-kConeOutRadius)/2,z,new TGeoRotation("plate32",0,0,0)));
b705c75b 1296
1297
1298 //K13D2U carbon plate
1299 TGeoBBox *box1 = new TGeoBBox(2*kWidth,kLay3/2,kStaveLength-0.50);
1300 TGeoVolume *plate1 = new TGeoVolume("CarbonPlate",box1,medK13D2U2k);
1301 plate1->SetFillColor(5);
1302 plate1->SetLineColor(5);
852af72e 1303 mechStavVol->AddNode(plate1,1,new TGeoCombiTrans(x,y-(kConeOutRadius+(kLay3/2)),z,new TGeoRotation("plate1",0,0,0)));
b705c75b 1304
1305 //C Fleece bottom plate
1306 TGeoBBox *box6 = new TGeoBBox(2*kWidth,kLay2/2,kStaveLength-0.50);
1307 TGeoVolume *plate6 = new TGeoVolume("CFleeceBottom",box6,medCarbonFleece);
1308 plate6->SetFillColor(2);
1309 plate6->SetLineColor(2);
852af72e 1310 mechStavVol->AddNode(plate6,1,new TGeoCombiTrans(x,y-(kConeOutRadius+kLay3+(kLay2/2)),z,new TGeoRotation("plate1",0,0,0)));
b705c75b 1311
1312
1313 }
1314
1315 if (fBuildLevel < 2) {
1316 //Glue layers and kapton
852af72e 1317 TGeoBBox *glue = new TGeoBBox(kStaveWidth/2, 0.005/2, zsta);
b705c75b 1318 TGeoVolume *volGlue=new TGeoVolume("Glue", glue, medGlue);
1319 volGlue->SetLineColor(5);
1320 volGlue->SetFillColor(5);
852af72e 1321 mechStavVol->AddNode(volGlue, 0, new TGeoCombiTrans(x,y-(kConeOutRadius+kLay3+(kLay2/2)+(0.01/2)), z, new TGeoRotation("",0, 0, 0)));
1322 mechStavVol->AddNode(volGlue, 1, new TGeoCombiTrans(x,y-(kConeOutRadius+kLay3+(kLay2/2)+0.01+fSensorThick+(0.01/2)), z, new TGeoRotation("",0, 0, 0)));
b705c75b 1323 }
1324
1325 if (fBuildLevel < 1) {
852af72e 1326 TGeoBBox *kapCable = new TGeoBBox(kStaveWidth/2, 0.01/2, zsta);
b705c75b 1327 TGeoVolume *volCable=new TGeoVolume("FlexCable", kapCable, medFlexCable);
1328 volCable->SetLineColor(28);
1329 volCable->SetFillColor(28);
852af72e 1330 mechStavVol->AddNode(volCable, 0, new TGeoCombiTrans(x, y-(kConeOutRadius+kLay3+(kLay2/2)+0.01+fSensorThick+0.01+(0.01/2)), z, new TGeoRotation("",0, 0, 0)));
b705c75b 1331 }
1332
1333
1334 // Done, return the stave structure
852af72e 1335 return mechStavVol;
b705c75b 1336
1337}
019dc90c 1338
b705c75b 1339// new model22
1340//________________________________________________________________________
852af72e 1341TGeoVolume* AliITSUv1Layer::CreateStaveModelInnerB22(const Double_t xsta,
1342 const Double_t zsta,
b705c75b 1343 const TGeoManager *mgr){
1344//
1345// Create the mechanical stave structure for Model 2.2 of TDR
1346//
1347// Input:
852af72e 1348// xsta : X length
1349// zsta : Z length
b705c75b 1350// mgr : the GeoManager (used only to get the proper material)
1351//
1352// Output:
1353//
1354// Return:
1355//
1356// Created: 22 Mar 2013 Chinorat Kobdaj
1357// Updated: 26 Apr 2013 Mario Sitta
1358// Updated: 30 Apr 2013 Wanchaloem Poonsawat
1359//
1360
1361 // Materials defined in AliITSUv1
1362 TGeoMedium *medAir = mgr->GetMedium("ITS_AIR$");
1363 TGeoMedium *medWater = mgr->GetMedium("ITS_WATER$");
1364
1365 TGeoMedium *medM60J3K = mgr->GetMedium("ITS_M60J3K$");
1366 TGeoMedium *medKapton = mgr->GetMedium("ITS_KAPTON(POLYCH2)$");
1367 TGeoMedium *medGlue = mgr->GetMedium("ITS_GLUE$");
1368 TGeoMedium *medFlexCable = mgr->GetMedium("ITS_FLEXCABLE$");
1369 TGeoMedium *medK13D2U2k = mgr->GetMedium("ITS_K13D2U2k$");
1370 TGeoMedium *medFGS003 = mgr->GetMedium("ITS_FGS003$");
1371 TGeoMedium *medCarbonFleece = mgr->GetMedium("ITS_CarbonFleece$");
1372
1373 // Local parameters
d7ef241e 1374 Double_t kConeOutRadius =(0.1024+0.0025)/2;//0.107/2;
1375 Double_t kConeInRadius = 0.1024/2;//0.10105/2
852af72e 1376 Double_t kStaveLength = zsta;
1377 Double_t kStaveWidth = xsta*2;
b705c75b 1378 Double_t kWidth = (kStaveWidth)/4;
1379 Double_t kStaveHeight = 0.283;//0.33;
1380 Double_t kHeight = (kStaveHeight)/2;
1381 Double_t kAlpha = 57;//56.31;
1382 Double_t kTheta = kAlpha*TMath::DegToRad();
1383 Double_t kS1 = ((kStaveWidth)/4)/TMath::Sin(kTheta);
1384 Double_t kL1 = (kStaveWidth/4)/TMath::Tan(kTheta);
1385 Double_t kS2 = sqrt(kHeight*kHeight + kS1*kS1);//TMath::Sin(kThe2);
1386 Double_t kThe2 = TMath::ATan(kHeight/(0.375-0.036));
1387 Double_t kBeta = kThe2*TMath::RadToDeg();
1388 Double_t klay1 = 0.003;//Amec carbon
1389 Double_t klay2 = 0.002;//C Fleece carbon
1390 Double_t klay3 = 0.007;//CFplate K13D2U carbon
1391 Double_t klay4 = 0.007;//GluekStaveLength/2
1392 Double_t klay5 = 0.01;//Flex cable
1393 Double_t kTopVertexMaxWidth = 0.072;
1394 Double_t kTopVertexHeight = 0.04;
1395 Double_t kSideVertexMWidth = 0.052;
1396 Double_t kSideVertexHeight = 0.11;
1397
1398
1399 Int_t loop = (Int_t)(kStaveLength/(2*kL1));
1400
1401 char volname[30];
852af72e 1402 snprintf(volname, 30, "%s%d_StaveStruct", AliITSUGeomTGeo::GetITSStavePattern(), fLayerNumber);
b705c75b 1403
1404 Double_t z=0, y=-(2*kConeOutRadius)+klay1+klay2+fSensorThick/2-0.0004, x=0;
1405
852af72e 1406 TGeoVolume *mechStavVol = 0;
b705c75b 1407
1408 if (fBuildLevel < 5) {
1409 // world (trapezoid)
1410 TGeoXtru *mechStruct = new TGeoXtru(2); //z sections
1411 Double_t xv[6] = {kStaveWidth/2,kStaveWidth/2,0.012,-0.012,-kStaveWidth/2,-kStaveWidth/2};
1412 /* Double_t yv[6] = {-2*(kConeOutRadius+klay1+1.5*klay2+klay3+klay4+fSensorThick+klay5),
1413 0-0.02,kStaveHeight+0.01,kStaveHeight+0.01,0-0.02,
1414 -2*(kConeOutRadius+klay1+1.5*klay2+klay3+klay4+fSensorThick+klay5)}; // (kConeOutRadius*2)-0.0635 */
dd49bd10 1415 Double_t yv[6] = {-(kConeOutRadius*2)-0.07295,0-0.02,kStaveHeight+0.01,kStaveHeight+0.01,0-0.02,-(kConeOutRadius*2)-0.07295}; // (kConeOutRadius*2)-0.064
b705c75b 1416 mechStruct->DefinePolygon(6,xv,yv);
1417 mechStruct->DefineSection(0,-kStaveLength,0,0,1.);
1418 mechStruct->DefineSection(1,kStaveLength,0,0,1.);
1419
852af72e 1420 mechStavVol = new TGeoVolume(volname, mechStruct, medAir);
1421 mechStavVol->SetLineColor(12);
1422 mechStavVol->SetFillColor(12);
1423 mechStavVol->SetVisibility(kTRUE);
b705c75b 1424
1425 //Polyimide Pipe Kapton grey-35
1426 TGeoCone *cone1 = new TGeoCone(kStaveLength,kConeInRadius,kConeOutRadius-0.0001,kConeInRadius,kConeOutRadius-0.0001);
1427 TGeoVolume *volCone1= new TGeoVolume("PolyimidePipe", cone1, medKapton);
1428 volCone1->SetFillColor(35);
1429 volCone1->SetLineColor(35);
852af72e 1430 mechStavVol->AddNode(volCone1,1,new TGeoTranslation(x+0.25,y,z));
1431 mechStavVol->AddNode(volCone1,2,new TGeoTranslation(x-0.25,y,z));
b705c75b 1432 }
1433
1434 if (fBuildLevel < 4) {
1435 TGeoTube *coolTubeW = new TGeoTube(0.,kConeInRadius-0.0001,kStaveLength);
1436 TGeoVolume *volCoolTubeW= new TGeoVolume("Water", coolTubeW, medWater);
1437 volCoolTubeW->SetFillColor(4);
1438 volCoolTubeW->SetLineColor(4);
852af72e 1439 mechStavVol->AddNode(volCoolTubeW,0,new TGeoTranslation(x-0.25,y,z));
1440 mechStavVol->AddNode(volCoolTubeW,1,new TGeoTranslation(x+0.25,y,z));
b705c75b 1441 }
1442
1443 if (fBuildLevel < 3) {
1444 //top fillament
1445 // Top filament M60J black-12 Carbon structure TGeoBBox (length,thickness,width)
1446 TGeoBBox *t2=new TGeoBBox(kS2-0.028,0.02/2,0.02/2); //0.04/2//TGeoBBox *t2=new TGeoBBox(kS2,0.01,0.02);//kS2-0.03 old Config.C
1447 TGeoVolume *volT2=new TGeoVolume("TopFilament", t2, medM60J3K);
1448 volT2->SetLineColor(12);
1449 volT2->SetFillColor(12);
1450 for(int i=0;i<loop;i++){// i<28;i++){
1451 // 1) Front Left Top Filament
852af72e 1452 mechStavVol->AddNode(volT2,i*4+1,new TGeoCombiTrans(x+kWidth+0.0036,y+kHeight+0.01,z-kStaveLength+0.1+(i*4*kL1)+kS1/2, new TGeoRotation("volT2",90,90-kAlpha,90-kBeta)));
b705c75b 1453 // 2) Front Right Top Filament
852af72e 1454 mechStavVol->AddNode(volT2,i*4+2,new TGeoCombiTrans(x-kWidth-0.0036,y+kHeight+0.01,z-kStaveLength+0.1+(i*4*kL1)+kS1/2, new TGeoRotation("volT2",90,-90+kAlpha,-90+kBeta)));
b705c75b 1455 // 3) Back Left Top Filament
852af72e 1456 mechStavVol->AddNode(volT2,i*4+3,new TGeoCombiTrans(x+kWidth+0.0036,y+kHeight+0.01,z-kStaveLength+0.1+2*kL1+(i*4*kL1)+kS1/2, new TGeoRotation("volT2",90,-90+kAlpha,90-kBeta)));
b705c75b 1457 // 4) Back Right Top Filament
852af72e 1458 mechStavVol->AddNode(volT2,i*4+4,new TGeoCombiTrans(x-kWidth-0.0036,y+kHeight+0.01,z-kStaveLength+0.1+2*kL1+(i*4*kL1)+kS1/2, new TGeoRotation("volT2",90,90-kAlpha,-90+kBeta)));
b705c75b 1459 }
1460
1461 //Vertex structure
1462
1463 //top ver trd1
1464 TGeoTrd1 *trd1 = new TGeoTrd1(0,kTopVertexMaxWidth/2,kStaveLength,kTopVertexHeight/2);
1465 TGeoVolume *ibdv = new TGeoVolume("TopVertex",trd1,medM60J3K);
1466 ibdv->SetFillColor(12);
1467 ibdv->SetLineColor(12);
852af72e 1468 mechStavVol->AddNode(ibdv,1,new TGeoCombiTrans(x,y+kStaveHeight+0.03,z,new TGeoRotation("ibdv",0.,-90,0)));//y+kStaveHeight+0.056
b705c75b 1469
1470 //left trd2
1471 TGeoTrd1 *trd2 = new TGeoTrd1(0,kSideVertexMWidth/2,kStaveLength, kSideVertexHeight/2);
1472 TGeoVolume *ibdv2 = new TGeoVolume("LeftVertex",trd2,medM60J3K);
1473 ibdv2->SetFillColor(12);
1474 ibdv2->SetLineColor(12);
8397c175 1475 mechStavVol->AddNode(ibdv2,1,new TGeoCombiTrans(x+kStaveWidth/2-0.06,y-0.0348,z,new TGeoRotation("ibdv2",-103.3,90,0))); //x-kStaveWidth/2-0.09 old Config.C y-0.0355,
b705c75b 1476
1477 //right trd3
1478 TGeoTrd1 *trd3 = new TGeoTrd1(0,kSideVertexMWidth/2,kStaveLength, kSideVertexHeight/2);
1479 TGeoVolume *ibdv3 = new TGeoVolume("RightVertex",trd3,medM60J3K);
1480 ibdv3->SetFillColor(12);
1481 ibdv3->SetLineColor(12);
8397c175 1482 mechStavVol->AddNode(ibdv3,1,new TGeoCombiTrans(x-kStaveWidth/2+0.06,y-0.0348,z,new TGeoRotation("ibdv3",103.3,90,0))); //x-kStaveWidth/2+0.09 old Config.C
b705c75b 1483
1484 //Carbon Fleece
852af72e 1485 TGeoConeSeg *cons2 = new TGeoConeSeg(zsta,kConeOutRadius+klay1,kConeOutRadius+klay1+klay2,kConeOutRadius+klay1,kConeOutRadius+klay1+klay2,0,180);
b705c75b 1486 TGeoVolume *cone12 = new TGeoVolume("CarbonFleecePipeCover",cons2,medCarbonFleece);
1487 cone12->SetFillColor(28);
1488 cone12->SetLineColor(28);
852af72e 1489 mechStavVol->AddNode(cone12,1,new TGeoCombiTrans(x+0.25,y,z,new TGeoRotation("cone12",0,0,0)));
1490 mechStavVol->AddNode(cone12,2,new TGeoCombiTrans(x-0.25,y,z,new TGeoRotation("cone12",0,0,0)));
b705c75b 1491
852af72e 1492 TGeoBBox *box3 = new TGeoBBox((0.50-(2*(kConeOutRadius+klay1)))/2,klay2/2,zsta);//kStaveLength-0.50);
b705c75b 1493 TGeoVolume *plate3 = new TGeoVolume("CarbonFleeceMiddle",box3,medCarbonFleece);
1494 plate3->SetFillColor(28);
1495 plate3->SetLineColor(28);
852af72e 1496 mechStavVol->AddNode(plate3,1,new TGeoCombiTrans(x,y-kConeOutRadius+klay1+(klay2/2),z,new TGeoRotation("plate3",0,0,0)));
b705c75b 1497
852af72e 1498 TGeoBBox *box31 = new TGeoBBox((0.75-0.25-kConeOutRadius-klay1)/2+0.0025,klay2/2,zsta);
b705c75b 1499 TGeoVolume *plate31 = new TGeoVolume("CarbonFleeceLeftRight",box31,medCarbonFleece);
1500 plate31->SetFillColor(28);
1501 plate31->SetLineColor(28);
852af72e 1502 mechStavVol->AddNode(plate31,1,new TGeoCombiTrans(x+0.25+kConeOutRadius+klay1+(0.75-0.25-kConeOutRadius-klay1)/2,y-kConeOutRadius+klay1+(klay2/2),z,new TGeoRotation("plate31",0,0,0)));
1503 mechStavVol->AddNode(plate31,2,new TGeoCombiTrans(x-0.25-kConeOutRadius-klay1-(0.75-0.25-kConeOutRadius-klay1)/2,y-kConeOutRadius+klay1+(klay2/2),z,new TGeoRotation("plate31",0,0,0)));
b705c75b 1504
852af72e 1505 TGeoBBox *box32 = new TGeoBBox((klay2/2),(kConeOutRadius-klay1)/2,zsta);
b705c75b 1506 TGeoVolume *plate32 = new TGeoVolume("CarbonFleeceVertical",box32,medCarbonFleece);
1507 plate32->SetFillColor(28);
1508 plate32->SetLineColor(28);
852af72e 1509 mechStavVol->AddNode(plate32,1,new TGeoCombiTrans(x+0.25+kConeOutRadius+klay1+(klay2/2),y+(klay1-kConeOutRadius)/2,z,new TGeoRotation("plate32",0,0,0)));
1510 mechStavVol->AddNode(plate32,2,new TGeoCombiTrans(x+0.25-kConeOutRadius-klay1-(klay2/2),y+(klay1-kConeOutRadius)/2,z,new TGeoRotation("plate32",0,0,0)));
1511 mechStavVol->AddNode(plate32,3,new TGeoCombiTrans(x-0.25+kConeOutRadius+klay1+(klay2/2),y+(klay1-kConeOutRadius)/2,z,new TGeoRotation("plate32",0,0,0)));
1512 mechStavVol->AddNode(plate32,4,new TGeoCombiTrans(x-0.25-kConeOutRadius-klay1-(klay2/2),y+(klay1-kConeOutRadius)/2,z,new TGeoRotation("plate32",0,0,0)));
b705c75b 1513
1514 //Amec Thermasol red-2 cover tube FGS300 or Carbon Paper
852af72e 1515 TGeoConeSeg *cons1 = new TGeoConeSeg(zsta,kConeOutRadius,kConeOutRadius+klay1-0.0001,kConeOutRadius,kConeOutRadius+klay1-0.0001,0,180);//kConeOutRadius+klay1-0.0001
b705c75b 1516 TGeoVolume *cone11 = new TGeoVolume("ThermasolPipeCover",cons1,medFGS003);
1517 cone11->SetFillColor(2);
1518 cone11->SetLineColor(2);
852af72e 1519 mechStavVol->AddNode(cone11,1,new TGeoCombiTrans(x+0.25,y,z,new TGeoRotation("cone11",0,0,0)));
1520 mechStavVol->AddNode(cone11,2,new TGeoCombiTrans(x-0.25,y,z,new TGeoRotation("cone11",0,0,0)));
b705c75b 1521
852af72e 1522 TGeoBBox *box2 = new TGeoBBox((0.50-(2*kConeOutRadius))/2,(klay1/2),zsta);//kStaveLength-0.50);
b705c75b 1523 TGeoVolume *plate2 = new TGeoVolume("ThermasolMiddle",box2,medFGS003);
1524 plate2->SetFillColor(2);
1525 plate2->SetLineColor(2);
852af72e 1526 mechStavVol->AddNode(plate2,1,new TGeoCombiTrans(x,y-kConeOutRadius+(klay1/2),z,new TGeoRotation("plate2",0,0,0)));
b705c75b 1527
852af72e 1528 TGeoBBox *box21 = new TGeoBBox((0.75-0.25-kConeOutRadius-klay1)/2+0.0025,(klay1/2),zsta);
b705c75b 1529 TGeoVolume *plate21 = new TGeoVolume("ThermasolLeftRight",box21,medFGS003);
1530 plate21->SetFillColor(2);
1531 plate21->SetLineColor(2);
852af72e 1532 mechStavVol->AddNode(plate21,1,new TGeoCombiTrans(x+0.25+kConeOutRadius+(0.75-0.25-kConeOutRadius)/2-(klay1/2)+0.0025,y-kConeOutRadius+(klay1/2),z,new TGeoRotation("plate21",0,0,0)));
1533 mechStavVol->AddNode(plate21,2,new TGeoCombiTrans(x-0.25-kConeOutRadius-(0.75-0.25-kConeOutRadius)/2+(klay1/2)-0.0025,y-kConeOutRadius+(klay1/2),z,new TGeoRotation("plate21",0,0,0)));
b705c75b 1534
852af72e 1535 TGeoBBox *box22 = new TGeoBBox((klay1/2),kConeOutRadius/2,zsta);
b705c75b 1536 TGeoVolume *plate22 = new TGeoVolume("ThermasolVertical",box22,medFGS003);
1537 plate22->SetFillColor(2);
1538 plate22->SetLineColor(2);
852af72e 1539 mechStavVol->AddNode(plate22,1,new TGeoCombiTrans(x+0.25+kConeOutRadius+(klay1/2),y-kConeOutRadius/2,z,new TGeoRotation("plate22",0,0,0)));
1540 mechStavVol->AddNode(plate22,2,new TGeoCombiTrans(x+0.25-kConeOutRadius-(klay1/2),y-kConeOutRadius/2,z,new TGeoRotation("plate22",0,0,0)));
1541 mechStavVol->AddNode(plate22,3,new TGeoCombiTrans(x-0.25+kConeOutRadius+(klay1/2),y-kConeOutRadius/2,z,new TGeoRotation("plate22",0,0,0)));
1542 mechStavVol->AddNode(plate22,4,new TGeoCombiTrans(x-0.25-kConeOutRadius-(klay1/2),y-kConeOutRadius/2,z,new TGeoRotation("plate22",0,0,0)));
b705c75b 1543
1544 //K13D2U CF plate
852af72e 1545 TGeoBBox *box1 = new TGeoBBox(2*kWidth,(klay3)/2,zsta);
b705c75b 1546 TGeoVolume *plate1 = new TGeoVolume("CFPlate",box1,medK13D2U2k);
1547 plate1->SetFillColor(5);
1548 plate1->SetLineColor(5);
852af72e 1549 mechStavVol->AddNode(plate1,1,new TGeoCombiTrans(x,y-(kConeOutRadius+(klay3/2)),z,new TGeoRotation("plate1",0,0,0)));
b705c75b 1550
1551 //C Fleece bottom plate
852af72e 1552 TGeoBBox *box6 = new TGeoBBox(2*kWidth,(klay2)/2,zsta);
b705c75b 1553 TGeoVolume *plate6 = new TGeoVolume("CarbonFleeceBottom",box6,medCarbonFleece);
1554 plate6->SetFillColor(2);
1555 plate6->SetLineColor(2);
852af72e 1556 mechStavVol->AddNode(plate6,1,new TGeoCombiTrans(x,y-(kConeOutRadius+klay3+(klay2/2)),z,new TGeoRotation("plate6",0,0,0)));
b705c75b 1557
1558 }
1559 if (fBuildLevel < 2) {
1560 //Glue klayers and kapton
852af72e 1561 TGeoBBox *glue = new TGeoBBox(kStaveWidth/2, (klay4)/2, zsta);
b705c75b 1562 TGeoVolume *volGlue=new TGeoVolume("Glue", glue, medGlue);
1563 volGlue->SetLineColor(5);
1564 volGlue->SetFillColor(5);
852af72e 1565 // mechStavVol->AddNode(volGlue, 0, new TGeoCombiTrans(x,y-(kConeOutRadius+klay3+klay2+(klay4/2)), z, new TGeoRotation("",0, 0, 0)));
1566 mechStavVol->AddNode(volGlue, 0, new TGeoCombiTrans(x,y-(kConeOutRadius+klay3+klay2+(klay4)/2)+0.00005, z, new TGeoRotation("",0, 0, 0)));
b705c75b 1567 }
1568
1569 if (fBuildLevel < 1) {
1570 //Flex Cable or Bus
852af72e 1571 TGeoBBox *kapCable = new TGeoBBox(kStaveWidth/2, klay5/2, zsta);//klay5/2
b705c75b 1572 TGeoVolume *volCable=new TGeoVolume("FlexCable", kapCable, medFlexCable);
1573 volCable->SetLineColor(28);
1574 volCable->SetFillColor(28);
852af72e 1575 // mechStavVol->AddNode(volCable, 0, new TGeoCombiTrans(x, y-(kConeOutRadius+klay3+klay2+klay4+fSensorThick+(klay5)/2)+0.0002, z, new TGeoRotation("",0, 0, 0)));
dd49bd10 1576 mechStavVol->AddNode(volCable, 0, new TGeoCombiTrans(x, y-(kConeOutRadius+klay3+klay2+klay4+(klay5)/2), z, new TGeoRotation("",0, 0, 0)));
b705c75b 1577 }
1578 // Done, return the stave structe
852af72e 1579 return mechStavVol;
b705c75b 1580}
1581
1582// model3
1583//________________________________________________________________________
852af72e 1584TGeoVolume* AliITSUv1Layer::CreateStaveModelInnerB3(const Double_t xsta,
1585 const Double_t zsta,
b705c75b 1586 const TGeoManager *mgr){
1587//
1588// Create the mechanical stave structure for Model 3 of TDR
1589//
1590// Input:
852af72e 1591// xsta : X length
1592// zsta : Z length
b705c75b 1593// mgr : the GeoManager (used only to get the proper material)
1594//
1595// Output:
1596//
1597// Return:
1598//
1599// Created: 28 May 2013 Chinorat Kobdaj
1600// Updated: Mario Sitta
1601// Updated: Wanchaloem Poonsawat
1602//
1603
1604 // Materials defined in AliITSUv1
1605 TGeoMedium *medAir = mgr->GetMedium("ITS_AIR$");
1606 TGeoMedium *medWater = mgr->GetMedium("ITS_WATER$");
1607
1608 TGeoMedium *medM60J3K = mgr->GetMedium("ITS_M60J3K$");
1609 TGeoMedium *medKapton = mgr->GetMedium("ITS_KAPTON(POLYCH2)$");
1610 TGeoMedium *medGlue = mgr->GetMedium("ITS_GLUE$");
1611 TGeoMedium *medFlexCable = mgr->GetMedium("ITS_FLEXCABLE$");
1612 //TGeoMedium *medK13D2U2k = mgr->GetMedium("ITS_K13D2U2k$");
1613 //TGeoMedium *medFGS003 = mgr->GetMedium("ITS_FGS003$");
1614 //TGeoMedium *medCarbonFleece = mgr->GetMedium("ITS_CarbonFleece$");
1615
1616 // Local parameters
1617 Double_t kConeOutRadius = 0.15/2;
852af72e 1618 Double_t kStaveLength = zsta*2;
1619 Double_t kStaveWidth = xsta*2;
b705c75b 1620 Double_t w = kStaveWidth/4;//1/2 of W
1621 Double_t staveHeight = 0.3;
1622 Double_t h = staveHeight/2;
1623 Double_t alpha = 90-33.;//90-30;
1624 Double_t the1 = alpha*TMath::DegToRad();
1625 Double_t s1 = w/TMath::Sin(the1);
1626 Double_t l = w/TMath::Tan(the1);
1627 Double_t s2 = TMath::Sqrt(h*h + s1*s1);//TMath::Sin(the2);
1628 Double_t the2 = TMath::ATan(h/s1);
1629 Double_t beta = the2*TMath::RadToDeg();
1630 Double_t klay4 = 0.007; //Glue
1631 Double_t klay5 = 0.01; //Flexcable
1632 Int_t loop = (Int_t)((kStaveLength/(2*l))/2);
1633 Double_t hh = 0.01;
1634 Double_t ang1 = 0*TMath::DegToRad();
1635 Double_t ang2 = 0*TMath::DegToRad();
1636 Double_t ang3 = 0*TMath::DegToRad();
852af72e 1637 Int_t chips = 4;
b705c75b 1638 Double_t headWidth=0.25;
852af72e 1639 Double_t smcLength=kStaveLength/chips-2*headWidth;//6.25;
b705c75b 1640 Double_t smcWidth=kStaveWidth;
1641 Double_t smcSide1Thick=0.03;
1642 Double_t vaporThick=0.032;
1643 Double_t liquidThick=0.028;
1644 Double_t smcSide2Thick=0.01;
1645 Double_t smcSide3Thick=0.0055;
1646 Double_t smcSide4Thick=0.0095;
1647 Double_t smcSide5Thick=0.0075;
1648 Double_t smcSpace=0.01;
1649
1650
1651 char volname[30];
852af72e 1652 snprintf(volname, 30, "%s%d_StaveStruct", AliITSUGeomTGeo::GetITSStavePattern(), fLayerNumber);
b705c75b 1653
1654 // detailed structure ++++++++++++++
1655 Double_t z=0, y=0-0.007, x=0;
1656
1657 // Polimide micro channels numbers
1658 Double_t yMC = y-h+0.01;
1659 Int_t nb = (Int_t)(kStaveWidth/0.1)+1;
852af72e 1660 Double_t xstaMC = (nb*0.1-0.08)/2;
b705c75b 1661
1662
852af72e 1663 TGeoVolume *mechStavVol = 0;
b705c75b 1664 if (fBuildLevel < 5) {
1665 // world (trapezoid)
1666 TGeoXtru *mechStruct = new TGeoXtru(2); //z sections
1667 Double_t xv[5] = {kStaveWidth/2+0.1,kStaveWidth/2+0.1,0,-kStaveWidth/2-0.1,-kStaveWidth/2-0.1};
1668 Double_t yv[5] = {-kConeOutRadius*2-0.07,0,staveHeight,0,-kConeOutRadius*2-0.07};
1669 mechStruct->DefinePolygon(5,xv,yv);
1670 mechStruct->DefineSection(0,-kStaveLength-0.1,0,0,1.);
1671 mechStruct->DefineSection(1,kStaveLength+0.1,0,0,1.);
852af72e 1672 mechStavVol = new TGeoVolume(volname, mechStruct, medAir);
1673 mechStavVol->SetLineColor(12);
1674 mechStavVol->SetFillColor(12);
1675 mechStavVol->SetVisibility(kTRUE);
b705c75b 1676
1677 // Silicon micro channels numbers
1678
1679 TGeoBBox *tM0a=new TGeoBBox(smcWidth/2, 0.003/2, headWidth/2);
1680 TGeoVolume *volTM0a=new TGeoVolume("microChanTop1", tM0a, medKapton);
1681 volTM0a->SetLineColor(35);
1682 volTM0a->SetFillColor(35);
1683
852af72e 1684 for(Int_t mo=1; mo<=chips; mo++) {
1685 mechStavVol->AddNode(volTM0a, 0, new TGeoCombiTrans(x,yMC+0.03, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth+smcLength/2+(headWidth/2), new TGeoRotation("",ang1, ang2, ang3)));
1686 mechStavVol->AddNode(volTM0a, 1, new TGeoCombiTrans(x,yMC+0.03, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth-smcLength/2-(headWidth/2), new TGeoRotation("",ang1, ang2, ang3)));
b705c75b 1687 }
1688 TGeoBBox *tM0c=new TGeoBBox(0.3/2, 0.003/2,smcLength/2);
1689 TGeoVolume *volTM0c=new TGeoVolume("microChanTop2", tM0c, medKapton);
1690 volTM0c->SetLineColor(35);
1691 volTM0c->SetFillColor(35);
852af72e 1692 for(Int_t mo=1; mo<=chips; mo++) {
1693 mechStavVol->AddNode(volTM0c, 0, new TGeoCombiTrans(x+(smcWidth/2)-(0.3/2),yMC+0.03, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));
1694 mechStavVol->AddNode(volTM0c, 1, new TGeoCombiTrans(x-(smcWidth/2)+(0.3/2),yMC+0.03, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1695 }
1696 TGeoBBox *tM0c1=new TGeoBBox(0.2225/2, 0.003/2,smcLength/2);
1697 TGeoVolume *volTM0c1=new TGeoVolume("microChanBot1", tM0c1, medKapton);
1698 volTM0c1->SetLineColor(6);
1699 volTM0c1->SetFillColor(6);
852af72e 1700 for(Int_t mo=1; mo<=chips; mo++) {
1701 mechStavVol->AddNode(volTM0c1, 0, new TGeoCombiTrans(x+smcWidth/2-(smcSide1Thick)-(vaporThick)-(smcSide2Thick)-(smcSide3Thick)-(0.2225/2),yMC+0.03-hh-(0.003), z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
1702 mechStavVol->AddNode(volTM0c1, 1, new TGeoCombiTrans(x-smcWidth/2+(smcSide1Thick)+(liquidThick)+(smcSide2Thick)+(smcSide4Thick)+(0.2225/2),yMC+0.03-hh-(0.003), z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1703 }
1704 TGeoBBox *tM0c2=new TGeoBBox(0.072/2, 0.003/2,smcLength/2);
1705 TGeoVolume *volTM0c2=new TGeoVolume("microChanBot2", tM0c2, medKapton);
1706 volTM0c2->SetLineColor(35);
1707 volTM0c2->SetFillColor(35);
852af72e 1708 for(Int_t mo=1; mo<=chips; mo++) {
1709 mechStavVol->AddNode(volTM0c2, 0, new TGeoCombiTrans(x+smcWidth/2-(0.072/2),yMC+0.03-(0.035+0.0015)-(0.003)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1710 }
1711 TGeoBBox *tM0c2r=new TGeoBBox(0.068/2, 0.003/2,smcLength/2);
1712 TGeoVolume *volTM0c2r=new TGeoVolume("microChanBot3", tM0c2r, medKapton);
1713 volTM0c2r->SetLineColor(35);
1714 volTM0c2r->SetFillColor(35);
852af72e 1715 for(Int_t mo=1; mo<=chips; mo++) {
1716 mechStavVol->AddNode(volTM0c2r, 0, new TGeoCombiTrans(x-smcWidth/2+(0.068/2),yMC+0.03-(0.035+0.0015)-(0.003)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1717 }
1718 TGeoBBox *tM0d=new TGeoBBox(smcSide1Thick/2, 0.035/2,smcLength/2);
1719 TGeoVolume *volTM0d=new TGeoVolume("microChanSide1", tM0d, medKapton);
1720 volTM0d->SetLineColor(12);
1721 volTM0d->SetFillColor(12);
852af72e 1722 for(Int_t mo=1; mo<=chips; mo++) {
1723 mechStavVol->AddNode(volTM0d, 0, new TGeoCombiTrans(x+smcWidth/2-(smcSide1Thick/2),yMC+0.03-0.0015-(0.035)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
1724 mechStavVol->AddNode(volTM0d, 1, new TGeoCombiTrans(x-smcWidth/2+(smcSide1Thick/2),yMC+0.03-0.0015-(0.035)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1725 }
1726
1727 TGeoBBox *tM0d1=new TGeoBBox(smcSide2Thick/2, 0.035/2,smcLength/2);
1728 TGeoVolume *volTM0d1=new TGeoVolume("microChanSide2", tM0d1, medKapton);
1729 volTM0d1->SetLineColor(12);
1730 volTM0d1->SetFillColor(12);
852af72e 1731 for(Int_t mo=1; mo<=chips; mo++) {
1732 mechStavVol->AddNode(volTM0d1, 0, new TGeoCombiTrans(x+smcWidth/2-(smcSide1Thick)-(vaporThick)-(smcSide2Thick/2),yMC+0.03-(0.003+0.035)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
1733 mechStavVol->AddNode(volTM0d1, 1, new TGeoCombiTrans(x-smcWidth/2+(smcSide1Thick)+(liquidThick)+(smcSide2Thick/2),yMC+0.03-(0.003+0.035)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1734 }
1735 TGeoBBox *tM0d2=new TGeoBBox(smcSide3Thick/2, (hh+0.003)/2, smcLength/2);
1736 TGeoVolume *volTM0d2=new TGeoVolume("microChanSide3", tM0d2, medKapton);
1737 volTM0d2->SetLineColor(12);
1738 volTM0d2->SetFillColor(12);
852af72e 1739 for(Int_t mo=1; mo<=chips; mo++) {
1740 mechStavVol->AddNode(volTM0d2, 0, new TGeoCombiTrans(x+smcWidth/2-(smcSide1Thick)-(vaporThick)-(smcSide2Thick)-(smcSide3Thick/2),yMC+0.03-(0.003+hh+0.003)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1741 }
1742 TGeoBBox *tM0d2r=new TGeoBBox(smcSide4Thick/2, (hh+0.003)/2, smcLength/2);
1743 TGeoVolume *volTM0d2r=new TGeoVolume("microChanSide4", tM0d2r, medKapton);
1744 volTM0d2r->SetLineColor(12);
1745 volTM0d2r->SetFillColor(12);
852af72e 1746 for(Int_t mo=1; mo<=chips; mo++) {
1747 mechStavVol->AddNode(volTM0d2r, 0, new TGeoCombiTrans(x-smcWidth/2+(smcSide1Thick)+(liquidThick)+(smcSide2Thick)+(smcSide4Thick/2),yMC+0.03-(0.003+hh+0.003)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1748 }
1749 TGeoBBox *tM0e=new TGeoBBox(smcSide5Thick/2, hh/2,smcLength/2);
1750 TGeoVolume *volTM0e=new TGeoVolume("microChanSide5", tM0e, medKapton);
1751 volTM0e->SetLineColor(12);
1752 volTM0e->SetFillColor(12);
852af72e 1753 for(Int_t mo=1; mo<=chips; mo++) {
b705c75b 1754 for (Int_t ie=0;ie<11;ie++) {
852af72e 1755 mechStavVol->AddNode(volTM0e, 0, new TGeoCombiTrans(x-(ie*(smcSpace+smcSide5Thick))+smcWidth/2-(smcSide1Thick)-(vaporThick)-(smcSide2Thick)-(smcSide3Thick)-smcSpace-(smcSide5Thick/2),yMC+0.03-(0.003+hh)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
1756 mechStavVol->AddNode(volTM0e, 1, new TGeoCombiTrans(x+(ie*(smcSpace+smcSide5Thick))-smcWidth/2+(smcSide1Thick)+(liquidThick)+(smcSide2Thick)+(smcSide4Thick)+smcSpace+(smcSide5Thick/2),yMC+0.03-(0.003+hh)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1757 }
1758 }
1759
1760 TGeoBBox *tM0f=new TGeoBBox(0.02/2, hh/2, smcLength/2);
1761 TGeoVolume *volTM0f=new TGeoVolume("microChanTop3", tM0f, medKapton);
1762 //Double_t smcChannels=12;
1763 Double_t smcCloseWallvapor=smcWidth/2-smcSide1Thick-vaporThick-smcSide2Thick-smcSide3Thick-12*smcSpace-11*smcSide5Thick;
1764 Double_t smcCloseWallliquid=smcWidth/2-smcSide1Thick-liquidThick-smcSide2Thick-smcSide4Thick-12*smcSpace-11*smcSide5Thick;
1765 volTM0f->SetLineColor(12);
1766 volTM0f->SetFillColor(12);
852af72e 1767 for(Int_t mo=1; mo<=chips; mo++) {
1768 mechStavVol->AddNode(volTM0f, 0, new TGeoCombiTrans(x+smcCloseWallvapor-(0.02)/2,yMC+0.03-(0.003+hh)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
1769 mechStavVol->AddNode(volTM0f, 1, new TGeoCombiTrans(x-smcCloseWallliquid+(0.02)/2,yMC+0.03-(0.003+hh)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1770 }
1771 //Head(back) microchannel
1772
1773 TGeoBBox *tM0hb=new TGeoBBox(smcWidth/2, 0.025/2, headWidth/2);
1774 TGeoVolume *volTM0hb=new TGeoVolume("microChanHeadBackBottom1", tM0hb, medKapton);
1775 volTM0hb->SetLineColor(4);
1776 volTM0hb->SetFillColor(4);
852af72e 1777 for(Int_t mo=1; mo<=chips; mo++) {
1778 mechStavVol->AddNode(volTM0hb, 0, new TGeoCombiTrans(x,yMC+0.03-0.0145-(0.025/2), z+(mo-3)*kStaveLength/4+smcLength/2+headWidth+smcLength/2+(headWidth/2), new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
1779 mechStavVol->AddNode(volTM0hb, 1, new TGeoCombiTrans(x,yMC+0.03-0.0145-(0.025)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth-smcLength/2-(headWidth/2), new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1780 }
1781 TGeoBBox *tM0h1=new TGeoBBox(smcWidth/2, 0.013/2, 0.05/2);
1782 TGeoVolume *volTM0h1=new TGeoVolume("microChanHeadBackBottom2", tM0h1, medKapton);
1783 volTM0h1->SetLineColor(5);
1784 volTM0h1->SetFillColor(5);
852af72e 1785 for(Int_t mo=1; mo<=chips; mo++) {
1786 mechStavVol->AddNode(volTM0h1, 0, new TGeoCombiTrans(x,yMC+0.03-0.0015-(0.013/2), z+(mo-3)*kStaveLength/4+smcLength/2+headWidth-smcLength/2-headWidth+(0.05/2), new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1787 }
1788 TGeoBBox *tM0h2=new TGeoBBox(smcWidth/2, 0.003/2, 0.18/2);
1789 TGeoVolume *volTM0h2=new TGeoVolume("microChanHeadBackBottom7", tM0h2, medKapton);
1790 volTM0h2->SetLineColor(6);
1791 volTM0h2->SetFillColor(6);
852af72e 1792 for(Int_t mo=1; mo<=chips; mo++) {
1793 mechStavVol->AddNode(volTM0h2, 0, new TGeoCombiTrans(x,yMC+0.03-0.0015-0.01-(0.003/2), z+(mo-3)*kStaveLength/4+smcLength/2+headWidth-smcLength/2-0.02-(0.18/2), new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1794 }
1795 TGeoBBox *tM0h3=new TGeoBBox(smcWidth/2, 0.013/2, 0.02/2);
1796 TGeoVolume *volTM0h3=new TGeoVolume("microChanHeadBackBottom3", tM0h3, medKapton);
1797 volTM0h3->SetLineColor(5);
1798 volTM0h3->SetFillColor(5);
852af72e 1799 for(Int_t mo=1; mo<=chips; mo++) {
1800 mechStavVol->AddNode(volTM0h3, 0, new TGeoCombiTrans(x,yMC+0.03-0.0015-(0.013/2), z+(mo-3)*kStaveLength/4+smcLength/2+headWidth-smcLength/2-(0.02/2), new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1801 }
1802 TGeoBBox *tM0b1=new TGeoBBox(smcWidth/2, 0.013/2, 0.03/2);
1803 TGeoVolume *volTM0b1=new TGeoVolume("microChanHeadBackBottom4", tM0b1, medKapton);
1804 volTM0b1->SetLineColor(5);
1805 volTM0b1->SetFillColor(5);
852af72e 1806 for(Int_t mo=1; mo<=chips; mo++) {
1807 mechStavVol->AddNode(volTM0b1, 0, new TGeoCombiTrans(x,yMC+0.03-0.0015-(0.013/2), z+(mo-3)*kStaveLength/4+smcLength/2+headWidth+smcLength/2+headWidth-(0.03/2), new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1808 }
1809 TGeoBBox *tM0b2=new TGeoBBox(smcWidth/2, 0.003/2, 0.2/2);
1810 TGeoVolume *volTM0b2=new TGeoVolume("microChanHeadBackBottom5", tM0b2, medKapton);
1811 volTM0b2->SetLineColor(6);
1812 volTM0b2->SetFillColor(6);
852af72e 1813 for(Int_t mo=1; mo<=chips; mo++) {
1814 mechStavVol->AddNode(volTM0b2, 0, new TGeoCombiTrans(x,yMC+0.03-0.0015-0.01-(0.003/2), z+(mo-3)*kStaveLength/4+smcLength/2+headWidth+smcLength/2+0.02+(0.2/2), new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1815 }
1816 TGeoBBox *tM0b3=new TGeoBBox(smcWidth/2, 0.013/2, 0.02/2);
1817 TGeoVolume *volTM0b3=new TGeoVolume("microChanHeadBackBottom6", tM0b3, medKapton);
1818 volTM0b3->SetLineColor(5);
1819 volTM0b3->SetFillColor(5);
852af72e 1820 for(Int_t mo=1; mo<=chips; mo++) {
1821 mechStavVol->AddNode(volTM0b3, 0, new TGeoCombiTrans(x,yMC+0.03-0.0015-(0.013/2), z+(mo-3)*kStaveLength/4+smcLength/2+headWidth+smcLength/2+(0.02/2), new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1822 }
1823
852af72e 1824 TGeoBBox *tM0b=new TGeoBBox(0.02/2, 0.02/2, zsta);
b705c75b 1825 TGeoVolume *volTM0b=new TGeoVolume("microChanWalls", tM0b, medKapton);
1826 volTM0b->SetLineColor(35);
1827 volTM0b->SetFillColor(35);
1828 for (Int_t ib=0;ib<nb;ib++) {
852af72e 1829 //mechStavVol->AddNode(volTM0b, ib, new TGeoCombiTrans(x+ib*0.1-xstaMC+0.01,yMC, z, new TGeoRotation("",0, 0, 0)));
b705c75b 1830 }
1831
1832 }
1833
1834 if (fBuildLevel < 4) {
1835
1836 //**********cooling inlet outlet
1837
1838 TGeoBBox *tM0dv=new TGeoBBox(vaporThick/2, 0.035/2,smcLength/2);
1839 TGeoVolume *volTM0dv=new TGeoVolume("microChanVapor", tM0dv, medWater);
1840 volTM0dv->SetLineColor(2);
1841 volTM0dv->SetFillColor(2);
852af72e 1842 for(Int_t mo=1; mo<=chips; mo++) {
1843 mechStavVol->AddNode(volTM0dv, 0, new TGeoCombiTrans(x+smcWidth/2-(smcSide1Thick)-(vaporThick/2),yMC+0.03-0.0015-(0.035)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1844 }
1845 TGeoBBox *tM0dl=new TGeoBBox(liquidThick/2, 0.035/2,smcLength/2);
1846 TGeoVolume *volTM0dl=new TGeoVolume("microChanLiquid", tM0dl, medWater);
1847 volTM0dl->SetLineColor(3);
1848 volTM0dl->SetFillColor(3);
852af72e 1849 for(Int_t mo=1; mo<=chips; mo++) {
1850 mechStavVol->AddNode(volTM0dl, 0, new TGeoCombiTrans(x-smcWidth/2+(smcSide1Thick)+(liquidThick/2),yMC+0.03-0.0015-(0.035)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1851 }
1852 // small cooling fluid now using water wait for freeon value
1853 TGeoBBox *tM0dlq=new TGeoBBox(smcSpace/2, hh/2,smcLength/2);
1854 TGeoVolume *volTM0dlq=new TGeoVolume("smallLiquid", tM0dlq, medWater);
1855 volTM0dlq->SetLineColor(3);
1856 volTM0dlq->SetFillColor(3);
1857 TGeoBBox *tM0dvp=new TGeoBBox(smcSpace/2, hh/2,smcLength/2);
1858 TGeoVolume *volTM0dvp=new TGeoVolume("microChanVapor", tM0dvp, medWater);
1859 volTM0dvp->SetLineColor(2);
1860 volTM0dvp->SetFillColor(2);
852af72e 1861 for(Int_t mo=1; mo<=chips; mo++) {
b705c75b 1862 for (Int_t is=0;is<12;is++) {
852af72e 1863 mechStavVol->AddNode(volTM0dlq, 0, new TGeoCombiTrans(x+(is*(smcSpace+smcSide5Thick))-smcWidth/2+(smcSide1Thick)+(vaporThick)+(smcSide2Thick)+(smcSide3Thick)+smcSpace/2,yMC+0.03-(0.003+hh)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
1864 mechStavVol->AddNode(volTM0dvp, 1, new TGeoCombiTrans(x-(is*(smcSpace+smcSide5Thick))+smcWidth/2-(smcSide1Thick)-(vaporThick)-(smcSide2Thick)-(smcSide3Thick)-smcSpace/2,yMC+0.03-(0.003+hh)/2, z+(mo-3)*kStaveLength/4+smcLength/2+headWidth, new TGeoRotation("",ang1, ang2, ang3)));//("",0, 0, 0)));
b705c75b 1865 }
1866 }
1867
1868 //*************
1869
1870 }
1871
1872 if (fBuildLevel < 3) {
1873
1874 //Bottom filament CFRP black-12 Carbon structure TGeoBBox (thickness,width,length)
1875
1876 Double_t filWidth = 0.04;
1877 Double_t filHeight= 0.02;
1878 TGeoBBox *t1=new TGeoBBox(filHeight/2,filWidth/2,s1);
1879 TGeoVolume *volT1=new TGeoVolume("bottomFilament", t1, medM60J3K);
1880 volT1->SetLineColor(12);
1881 volT1->SetFillColor(12);
1882 for(int i=0;i<loop;i++){//i<30;i++){
852af72e 1883 mechStavVol->AddNode(volT1,4*i+0,
b705c75b 1884 new TGeoCombiTrans(x+w,y-h+0.04+filHeight/2,z-kStaveLength/2+(4*l*i)+s1/2,
1885 new TGeoRotation("volT1",-90,alpha,0)));
852af72e 1886 mechStavVol->AddNode(volT1,4*i+1,
b705c75b 1887 new TGeoCombiTrans(x-w,y-h+0.04+filHeight/2,z-kStaveLength/2+(4*l*i)+s1/2,
1888 new TGeoRotation("volT1",90,alpha,0)));
852af72e 1889 mechStavVol->AddNode(volT1,4*i+2,
b705c75b 1890 new TGeoCombiTrans(x+w,y-h+0.04+filHeight/2,z-kStaveLength/2+2*l+(i*4*l)+s1/2,
1891 new TGeoRotation("volT1",-90,-alpha,0)));
852af72e 1892 mechStavVol->AddNode(volT1,4*i+3,
b705c75b 1893 new TGeoCombiTrans(x-w,y-h+0.04+filHeight/2,z-kStaveLength/2+2*l+(i*4*l)+s1/2,
1894 new TGeoRotation("volT1",-90,+alpha,0)));
1895 }
1896
1897 // Top filament CERP black-12 Carbon structure TGeoBBox (length,thickness,width)
1898
1899 TGeoBBox *t2=new TGeoBBox(s2,filHeight/2,filWidth/2);
1900 TGeoVolume *volT2=new TGeoVolume("topFilament", t2, medM60J3K);
1901 volT2->SetLineColor(12);
1902 volT2->SetFillColor(12);
1903 for(int i=0;i<loop;i++){ //i<30;i++){
852af72e 1904 mechStavVol->AddNode(volT2,4*i+0,
b705c75b 1905 new TGeoCombiTrans(x+w,y+0.04+filHeight/2,z-kStaveLength/2+(i*4*l)+s1/2,
1906 new TGeoRotation("volT2",90,90-alpha,90-beta)));
852af72e 1907 mechStavVol->AddNode(volT2,4*i+1,
b705c75b 1908 new TGeoCombiTrans(x-w,y+0.04+filHeight/2,z-kStaveLength/2+(i*4*l)+s1/2,
1909 new TGeoRotation("volT2",90,-90+alpha,-90+beta)));
852af72e 1910 mechStavVol->AddNode(volT2,4*i+2,
b705c75b 1911 new TGeoCombiTrans(x+w,y+0.04+filHeight/2,z-kStaveLength/2+2*l+(i*4*l)+s1/2,
1912 new TGeoRotation("volT2",90,-90+alpha,90-beta)));
852af72e 1913 mechStavVol->AddNode(volT2,4*i+3,
b705c75b 1914 new TGeoCombiTrans(x-w,y+0.04+filHeight/2,z-kStaveLength/2+2*l+(i*4*l)+s1/2,
1915 new TGeoRotation("volT2",90,90-alpha,-90+beta)));
1916 }
1917 }
1918
1919 if (fBuildLevel < 2) {
1920
1921 // Glue Filament and Silicon MicroChannel
852af72e 1922 TGeoBBox *tM0=new TGeoBBox(xstaMC/5, klay4/2, zsta);
b705c75b 1923 TGeoVolume *volTM0=new TGeoVolume("glueFM", tM0,medGlue );
1924 volTM0->SetLineColor(5);
1925 volTM0->SetFillColor(5);
852af72e 1926 mechStavVol->AddNode(volTM0, 0, new TGeoCombiTrans(x-xsta/2-0.25,0.03+yMC, z, new TGeoRotation("",0, 0, 0)));
1927 mechStavVol->AddNode(volTM0, 1, new TGeoCombiTrans(x+xsta/2+0.25,0.03+yMC, z, new TGeoRotation("",0, 0, 0)));
b705c75b 1928
1929
1930 // Glue microchannel and sensor
852af72e 1931 TGeoBBox *glueM = new TGeoBBox(xstaMC/5, klay4/2, zsta);
b705c75b 1932 TGeoVolume *volGlueM=new TGeoVolume("glueMS", glueM, medGlue);
1933 volGlueM->SetLineColor(5);
1934 volGlueM->SetFillColor(5);
852af72e 1935 mechStavVol->AddNode(volGlueM, 0, new TGeoCombiTrans(x-xsta/2-0.25,yMC-0.01, z, new TGeoRotation("",0, 0, 0)));
1936 mechStavVol->AddNode(volGlueM, 1, new TGeoCombiTrans(x+xsta/2+0.25,yMC-0.01, z, new TGeoRotation("",0, 0, 0)));
b705c75b 1937
1938 // Glue sensor and kapton
852af72e 1939 TGeoBBox *glue = new TGeoBBox(xsta, klay4/2, zsta);
b705c75b 1940 TGeoVolume *volGlue=new TGeoVolume("glueSensorBus", glue, medGlue);
1941 volGlue->SetLineColor(5);
1942 volGlue->SetFillColor(5);
852af72e 1943 mechStavVol->AddNode(volGlue, 1, new TGeoCombiTrans(x, y-0.154-fSensorThick-klay4/2, z, new TGeoRotation("",0, 0, 0)));
b705c75b 1944 }
1945
1946 if (fBuildLevel < 1) {
852af72e 1947 TGeoBBox *kapCable = new TGeoBBox(xsta, klay5/2, zsta);
b705c75b 1948 TGeoVolume *volCable=new TGeoVolume("Flexcable", kapCable, medFlexCable);
1949 volCable->SetLineColor(28);
1950 volCable->SetFillColor(28);
852af72e 1951 mechStavVol->AddNode(volCable, 0, new TGeoCombiTrans(x, y-0.154-fSensorThick-klay4-klay5/2, z, new TGeoRotation("",0, 0, 0)));
b705c75b 1952 }
1953
1954 // Done, return the stave structur
852af72e 1955 return mechStavVol;
b705c75b 1956 }
1957
019dc90c 1958// model4
1959//________________________________________________________________________
1960TGeoVolume* AliITSUv1Layer::CreateStaveModelInnerB4(const Double_t xstave,
1961 const Double_t zstave,
1962 const TGeoManager *mgr){
1963//
1964// Create the mechanical stave structure for Model 2.2 of TDR
1965// Logic is similar to method CreateStaveModelInnerB22
1966// but completely rewritten:
1967// - code completely revised, made systematic and more similar to OB
1968// - fix some inconsistencies (stave element sequence, empty space)
1969// - use static const as parameters
1970// - comply with latest (nov '14) C.Gargiulo data
1971//
1972// Input:
1973// xstave : stave X half length
1974// zstave : stave Z half length
1975// mgr : the GeoManager (used only to get the proper material)
1976//
1977// Output:
1978//
1979// Return:
1980//
1981// Created: 04 Dec 2014 Mario Sitta
1982//
1983
1984
1985 // Local parameters
1986 Double_t layerHeight = 0.;
1987
1988 Double_t rPipeMin = fgkIBCoolPipeInnerD/2;
1989 Double_t rPipeMax = rPipeMin + fgkIBCoolPipeThick;
1990
1991 Double_t topFilTheta = fgkIBTopFilamentAlpha*TMath::DegToRad();
1992 Double_t topFilLProj = xstave/TMath::Sin(topFilTheta); // Top filament length projected on stave XZ plane
1993 Double_t topFilYLen = xstave/TMath::Tan(topFilTheta); // Filament length on Y
1994 Int_t nFilaments = (Int_t)(zstave/topFilYLen);
1995 // Question: would it be better to fix the number of filaments and
1996 // compute the angle alpha from it, or leave as it is now, i.e. fix the
1997 // filament inclination angle alpha and compute their number ?
1998
1999 const Int_t nv = 6;
2000 Double_t xv[nv], yv[nv]; // The stave container Xtru
2001 Double_t xlen;
2002 Double_t xpos, ypos, zpos, ylay;
2003 Double_t beta, gamma, theta;
2004
2005
2006 // First create all needed shapes
2007 TGeoBBox *kapCable = new TGeoBBox(xstave, fgkIBFlexCableKapThick/2, zstave);
2008
2009 TGeoBBox *aluCable = new TGeoBBox(xstave, fgkIBFlexCableAlThick/2, zstave);
2010
2011 TGeoBBox *glue = new TGeoBBox(xstave, fgkIBGlueThick/2, zstave);
2012
2013 TGeoBBox *fleecbot = new TGeoBBox(xstave, fgkIBCarbonFleeceThick/2, zstave);
2014
2015 TGeoBBox *cfplate = new TGeoBBox(xstave, fgkIBK13D2UThick/2, zstave);
2016
2017 TGeoTube *pipe = new TGeoTube(rPipeMin, rPipeMax, zstave);
2018
2019 TGeoTube *water = new TGeoTube(0., rPipeMin, zstave);
2020
2021 TGeoTubeSeg *cpaptub = new TGeoTubeSeg(rPipeMax,
2022 rPipeMax + fgkIBCarbonPaperThick,
2023 zstave, 0, 180);
2024
2025 TGeoBBox *cpapvert = new TGeoBBox(fgkIBCarbonPaperThick/2,
2026 pipe->GetRmax()/2, zstave);
2027
2028 xlen = fgkIBCoolPipeXDist/2 - pipe->GetRmax() - fgkIBCarbonPaperThick;
2029 TGeoBBox *cpapmid = new TGeoBBox(xlen, fgkIBCarbonPaperThick/2, zstave);
2030
2031 xlen = xstave -fgkIBCoolPipeXDist/2 -pipe->GetRmax() -fgkIBCarbonPaperThick;
2032 TGeoBBox *cpaplr = new TGeoBBox(xlen/2, fgkIBCarbonPaperThick/2, zstave);
2033
2034 TGeoTubeSeg *fleecpipe = new TGeoTubeSeg(cpaptub->GetRmax(),
2035 cpaptub->GetRmax() + fgkIBCarbonFleeceThick,
2036 zstave, 0, 180);
2037
2038 TGeoBBox *fleecvert = new TGeoBBox(fgkIBCarbonFleeceThick/2,
2039 (pipe->GetRmax()-fgkIBCarbonPaperThick)/2,
2040 zstave);
2041
2042 xlen = fgkIBCoolPipeXDist/2 - pipe->GetRmax() - fgkIBCarbonPaperThick
2043 - fgkIBCarbonFleeceThick;
2044 TGeoBBox *fleecmid = new TGeoBBox(xlen, fgkIBCarbonFleeceThick/2, zstave);
2045
2046 xlen = xstave - fgkIBCoolPipeXDist/2 - pipe->GetRmax()
2047 - fgkIBCarbonPaperThick - fgkIBCarbonFleeceThick;
2048 TGeoBBox *fleeclr = new TGeoBBox(xlen/2, fgkIBCarbonFleeceThick/2, zstave);
2049
2050 // The spaceframe structure
2051 TGeoTrd1 *topv = new TGeoTrd1(0, fgkIBTopVertexWidth/2, zstave,
2052 fgkIBTopVertexHeight/2);
2053
2054 TGeoTrd1 *sidev = new TGeoTrd1(0, fgkIBSideVertexWidth/2, zstave,
2055 fgkIBSideVertexHeight/2);
2056
2057 TGeoBBox *topfil = new TGeoBBox(fgkIBTopFilamentLength/2,
2058 fgkIBTopFilamentSide/2,
2059 fgkIBTopFilamentSide/2);
2060
2061 // The half stave container (an XTru to avoid overlaps between neighbours)
2062 beta = TMath::ATan(2*sidev->GetDz()/sidev->GetDx2());
2063 gamma = TMath::PiOver2() - beta;
2064
2065 layerHeight = 2*( kapCable->GetDY() + aluCable->GetDY() + glue->GetDY()
2066 + fleecbot->GetDY() + cfplate->GetDY() + cpaplr->GetDY()
2067 + fleeclr->GetDY() );
2068
2069 xv[0] = xstave;
2070 yv[0] = 0;
2071 xv[1] = xv[0];
2072 yv[1] = layerHeight + fgkIBSideVertexHeight;
2073 xv[2] = fgkIBTopVertexWidth/2;
2074 yv[2] = fgkIBStaveHeight + 2*topfil->GetDZ();
2075 for (Int_t i = 0; i<nv/2; i++) {
2076 xv[3+i] = -xv[2-i];
2077 yv[3+i] = yv[2-i];
2078 }
2079
2080 TGeoXtru *mechStruct = new TGeoXtru(2);
2081 mechStruct->DefinePolygon(nv, xv, yv);
2082 mechStruct->DefineSection(0,-zstave-topfil->GetDY());
2083 mechStruct->DefineSection(1, zstave+topfil->GetDY());
2084
2085
2086 // We have all shapes: now create the real volumes
2087
2088 TGeoMedium *medAir = mgr->GetMedium("ITS_AIR$");
2089 TGeoMedium *medWater = mgr->GetMedium("ITS_WATER$");
2090 TGeoMedium *medM55J6K = mgr->GetMedium("ITS_M55J6K$");
2091 TGeoMedium *medM60J3K = mgr->GetMedium("ITS_M60J3K$");
2092 TGeoMedium *medKapton = mgr->GetMedium("ITS_KAPTON(POLYCH2)$");
2093 TGeoMedium *medGlue = mgr->GetMedium("ITS_GLUE$");
2094 TGeoMedium *medK13D2U2k = mgr->GetMedium("ITS_K13D2U2k$");
2095 TGeoMedium *medFGS003 = mgr->GetMedium("ITS_FGS003$");
2096 TGeoMedium *medCarbonFleece = mgr->GetMedium("ITS_CarbonFleece$");
2097 TGeoMedium *medAluminum = mgr->GetMedium("ITS_ALUMINUM$");
2098
2099
2100 char volname[30];
2101 snprintf(volname, 30, "%s%d_StaveStruct",
2102 AliITSUGeomTGeo::GetITSStavePattern(), fLayerNumber);
2103 TGeoVolume *mechStavVol = new TGeoVolume(volname, mechStruct, medAir);
2104 mechStavVol->SetLineColor(12);
2105 mechStavVol->SetFillColor(12);
e14c51b6 2106 mechStavVol->SetVisibility(kFALSE);
019dc90c 2107
2108 TGeoVolume *kapCableVol = new TGeoVolume("FPCKapton", kapCable, medKapton);
2109 kapCableVol->SetLineColor(kBlue);
2110 kapCableVol->SetFillColor(kBlue);
2111
2112 TGeoVolume *aluCableVol = new TGeoVolume("FPCAluminum",
2113 aluCable, medAluminum);
2114 aluCableVol->SetLineColor(kCyan);
2115 aluCableVol->SetFillColor(kCyan);
2116
2117 TGeoVolume *glueVol = new TGeoVolume("Glue", glue, medGlue);
2118 glueVol->SetLineColor(kBlack);
2119 glueVol->SetFillColor(kBlack);
2120
2121 TGeoVolume *fleecbotVol = new TGeoVolume("CarbonFleeceBottom",
2122 fleecbot, medCarbonFleece);
2123 fleecbotVol->SetFillColor(kViolet);
2124 fleecbotVol->SetLineColor(kViolet);
2125
2126 TGeoVolume *cfplateVol = new TGeoVolume("CFPlate", cfplate, medK13D2U2k);
2127 cfplateVol->SetFillColor(5); // Yellow
2128 cfplateVol->SetLineColor(5);
2129
2130 TGeoVolume *pipeVol = new TGeoVolume("PolyimidePipe", pipe, medKapton);
2131 pipeVol->SetFillColor(35); // Blue shade
2132 pipeVol->SetLineColor(35);
2133
2134 TGeoVolume *waterVol= new TGeoVolume("Water", water, medWater);
2135 waterVol->SetFillColor(4); // Bright blue
2136 waterVol->SetLineColor(4);
2137
2138 TGeoVolume *cpaptubVol = new TGeoVolume("ThermasolPipeCover",
2139 cpaptub, medFGS003);
2140 cpaptubVol->SetFillColor(2); // Red
2141 cpaptubVol->SetLineColor(2);
2142
2143 TGeoVolume *cpapvertVol = new TGeoVolume("ThermasolVertical",
2144 cpapvert, medFGS003);
2145 cpapvertVol->SetFillColor(2); // Red
2146 cpapvertVol->SetLineColor(2);
2147
2148 TGeoVolume *cpapmidVol = new TGeoVolume("ThermasolMiddle",
2149 cpapmid, medFGS003);
2150 cpapmidVol->SetFillColor(2); // Red
2151 cpapmidVol->SetLineColor(2);
2152
2153 TGeoVolume *cpaplrVol = new TGeoVolume("ThermasolLeftRight",
2154 cpaplr, medFGS003);
2155 cpaplrVol->SetFillColor(2); // Red
2156 cpaplrVol->SetLineColor(2);
2157
2158 TGeoVolume *fleecpipeVol = new TGeoVolume("CarbonFleecePipeCover",
2159 fleecpipe, medCarbonFleece);
2160 fleecpipeVol->SetFillColor(28); // Brown shade
2161 fleecpipeVol->SetLineColor(28);
2162
2163 TGeoVolume *fleecvertVol = new TGeoVolume("CarbonFleeceVertical",
2164 fleecvert, medCarbonFleece);
2165 fleecvertVol->SetFillColor(28); // Brown shade
2166 fleecvertVol->SetLineColor(28);
2167
2168 TGeoVolume *fleecmidVol = new TGeoVolume("CarbonFleeceMiddle",
2169 fleecmid, medCarbonFleece);
2170 fleecmidVol->SetFillColor(28); // Brown shade
2171 fleecmidVol->SetLineColor(28);
2172
2173 TGeoVolume *fleeclrVol = new TGeoVolume("CarbonFleeceLeftRight",
2174 fleeclr, medCarbonFleece);
2175 fleeclrVol->SetFillColor(28); // Brown shade
2176 fleeclrVol->SetLineColor(28);
2177
2178 TGeoVolume *topvVol = new TGeoVolume("TopVertex", topv, medM55J6K);
2179 topvVol->SetFillColor(12); // Gray shade
2180 topvVol->SetLineColor(12);
2181
2182 TGeoVolume *sidevVol = new TGeoVolume("SideVertex", sidev, medM55J6K);
2183 sidevVol->SetFillColor(12); // Gray shade
2184 sidevVol->SetLineColor(12);
2185
2186 TGeoVolume *topfilVol = new TGeoVolume("TopFilament", topfil, medM60J3K);
2187 topfilVol->SetFillColor(12); // Gray shade
2188 topfilVol->SetLineColor(12);
2189
2190
2191 // Now build up the half stave
2192 ypos = kapCable->GetDY();
2193 if (fBuildLevel < 4) // Kapton
2194 mechStavVol->AddNode(kapCableVol, 1, new TGeoTranslation(0, ypos, 0));
2195
2196 ypos += (kapCable->GetDY() + aluCable->GetDY());
2197 if (fBuildLevel < 1) // Aluminum
2198 mechStavVol->AddNode(aluCableVol, 1, new TGeoTranslation(0, ypos, 0));
2199
2200 ypos += (aluCable->GetDY() + glue->GetDY());
2201 if (fBuildLevel < 2) // Glue
2202 mechStavVol->AddNode(glueVol, 1, new TGeoTranslation(0, ypos, 0));
2203
2204 ypos += (glue->GetDY() + fleecbot->GetDY());
2205 if (fBuildLevel < 5) // Carbon
2206 mechStavVol->AddNode(fleecbotVol, 1, new TGeoTranslation(0, ypos, 0));
2207
2208 ypos += (fleecbot->GetDY() + cfplate->GetDY());
2209 if (fBuildLevel < 5) // Carbon
2210 mechStavVol->AddNode(cfplateVol, 1, new TGeoTranslation(0, ypos, 0));
2211
2212 ylay = ypos + cfplate->GetDY(); // The level where tubes etc. lay
2213
2214 xpos = fgkIBCoolPipeXDist/2;
2215 ypos = ylay + pipe->GetRmax();
2216 if (fBuildLevel < 4) { // Kapton
2217 mechStavVol->AddNode(pipeVol, 1, new TGeoTranslation(-xpos, ypos, 0));
2218 mechStavVol->AddNode(pipeVol, 2, new TGeoTranslation( xpos, ypos, 0));
2219 }
2220
2221 if (fBuildLevel < 3) { // Water
2222 mechStavVol->AddNode(waterVol, 1, new TGeoTranslation(-xpos, ypos, 0));
2223 mechStavVol->AddNode(waterVol, 2, new TGeoTranslation( xpos, ypos, 0));
2224 }
2225
2226 if (fBuildLevel < 5) { // Carbon (stave components)
2227 mechStavVol->AddNode(cpaptubVol, 1, new TGeoTranslation(-xpos, ypos, 0));
2228 mechStavVol->AddNode(cpaptubVol, 2, new TGeoTranslation( xpos, ypos, 0));
2229
2230 mechStavVol->AddNode(fleecpipeVol,1, new TGeoTranslation(-xpos, ypos, 0));
2231 mechStavVol->AddNode(fleecpipeVol,2, new TGeoTranslation( xpos, ypos, 0));
2232
2233 xpos = fgkIBCoolPipeXDist/2 - pipe->GetRmax() - cpapvert->GetDX();
2234 ypos = ylay + cpapvert->GetDY();
2235 mechStavVol->AddNode(cpapvertVol, 1, new TGeoTranslation(-xpos, ypos, 0));
2236 mechStavVol->AddNode(cpapvertVol, 2, new TGeoTranslation( xpos, ypos, 0));
2237
2238 xpos = fgkIBCoolPipeXDist/2 + pipe->GetRmax() + cpapvert->GetDX();
2239 mechStavVol->AddNode(cpapvertVol, 3, new TGeoTranslation(-xpos, ypos, 0));
2240 mechStavVol->AddNode(cpapvertVol, 4, new TGeoTranslation( xpos, ypos, 0));
2241
2242 ypos = ylay + fgkIBCarbonPaperThick/2;
2243 mechStavVol->AddNode(cpapmidVol, 1, new TGeoTranslation(0, ypos, 0));
2244
2245 xpos = xstave - cpaplr->GetDX();
2246 mechStavVol->AddNode(cpaplrVol, 1, new TGeoTranslation(-xpos, ypos, 0));
2247 mechStavVol->AddNode(cpaplrVol, 2, new TGeoTranslation( xpos, ypos, 0));
2248
2249 xpos = fgkIBCoolPipeXDist/2 - pipe->GetRmax() - 2*cpapvert->GetDX()
2250 - fleecvert->GetDX();
2251 ypos = ylay + fgkIBCarbonPaperThick + fleecvert->GetDY();
2252 mechStavVol->AddNode(fleecvertVol, 1, new TGeoTranslation(-xpos, ypos, 0));
2253 mechStavVol->AddNode(fleecvertVol, 2, new TGeoTranslation( xpos, ypos, 0));
2254
2255 xpos = fgkIBCoolPipeXDist/2 + pipe->GetRmax() + 2*cpapvert->GetDX()
2256 + fleecvert->GetDX();
2257 mechStavVol->AddNode(fleecvertVol, 3, new TGeoTranslation(-xpos, ypos, 0));
2258 mechStavVol->AddNode(fleecvertVol, 4, new TGeoTranslation( xpos, ypos, 0));
2259
2260 ypos = ylay + fgkIBCarbonPaperThick + fgkIBCarbonFleeceThick/2;
2261 mechStavVol->AddNode(fleecmidVol, 1, new TGeoTranslation(0, ypos, 0));
2262
2263 xpos = xstave - fleeclr->GetDX();
2264 mechStavVol->AddNode(fleeclrVol, 1, new TGeoTranslation(-xpos, ypos, 0));
2265 mechStavVol->AddNode(fleeclrVol, 2, new TGeoTranslation( xpos, ypos, 0));
2266 }
2267
2268 ylay += (fgkIBCarbonPaperThick + fgkIBCarbonFleeceThick);
2269
2270 if (fBuildLevel < 5) { // Carbon (spaceframe)
2271 ypos = fgkIBStaveHeight - topv->GetDz(); // Due to rotation, z is on Y
2272 mechStavVol->AddNode(topvVol, 1,
2273 new TGeoCombiTrans(0, ypos, 0,
2274 new TGeoRotation("",0,-90,0)));
2275
2276 // beta and gamma were already computed when building mechStruct shape
2277 xpos = xstave - TMath::Cos(gamma)*sidev->GetDz();
2278 ypos = ylay + TMath::Sin(gamma)*sidev->GetDz();
2279 beta *= TMath::RadToDeg(); // beta was rad, we need deg
2280
2281 mechStavVol->AddNode(sidevVol, 1,
2282 new TGeoCombiTrans(-xpos, ypos, 0,
2283 new TGeoRotation("", 180-beta,90,0)));
2284 mechStavVol->AddNode(sidevVol, 2,
2285 new TGeoCombiTrans( xpos, ypos, 0,
2286 new TGeoRotation("",-180+beta,90,0)));
2287
2288 gamma *= TMath::RadToDeg(); // gamma was rad, we need deg
2289 theta = 90. - fgkIBTopFilamentAlpha;
2290 xpos = xstave/2 + topfil->GetDZ();
2291 ypos = ( layerHeight + fgkIBStaveHeight )/2 +
2292 fgkIBSideVertexWidth*TMath::Sin(beta*TMath::DegToRad())/2 ;
2293 for(int i=0; i<nFilaments; i++){ // i<28 (?)
2294 // 1) Front Left Top Filament
2295 zpos = -zstave + (i*2*topFilYLen) + topFilLProj/4; // ?????
2296 mechStavVol->AddNode(topfilVol, i*4+1,
2297 new TGeoCombiTrans( xpos, ypos, zpos,
2298 new TGeoRotation("", 90, theta, 90-gamma)));
2299 // 2) Front Right Top Filament
2300 mechStavVol->AddNode(topfilVol, i*4+2,
2301 new TGeoCombiTrans(-xpos, ypos, zpos,
2302 new TGeoRotation("", 90,-theta,-90+gamma)));
2303 // 3) Back Left Top Filament
2304 zpos += topFilYLen;
2305 mechStavVol->AddNode(topfilVol, i*4+3,
2306 new TGeoCombiTrans( xpos, ypos, zpos,
2307 new TGeoRotation("", 90,-theta, 90-gamma)));
2308 // 4) Back Right Top Filament
2309 mechStavVol->AddNode(topfilVol, i*4+4,
2310 new TGeoCombiTrans(-xpos, ypos, zpos,
2311 new TGeoRotation("", 90, theta,-90+gamma)));
2312 }
2313 }
2314
2315
2316 // Done, return the stave structure
2317 return mechStavVol;
2318}
2319
b705c75b 2320//________________________________________________________________________
2b9468b2 2321TGeoVolume* AliITSUv1Layer::CreateStaveOuterB(const TGeoManager *mgr){
b705c75b 2322//
852af72e 2323// Create the chip stave for the Outer Barrel
b705c75b 2324//
2325// Input:
b705c75b 2326// mgr : the GeoManager (used only to get the proper material)
2327//
2328// Output:
2329//
2330// Return:
2331//
2332// Created: 20 Dec 2013 Mario Sitta
2b9468b2 2333// Updated: 12 Mar 2014 Mario Sitta
b705c75b 2334//
2335
852af72e 2336 TGeoVolume *mechStavVol = 0;
b705c75b 2337
2338 switch (fStaveModel) {
2339 case AliITSUv1::kOBModelDummy:
2b9468b2 2340 mechStavVol = CreateStaveModelOuterBDummy(mgr);
b705c75b 2341 break;
2342 case AliITSUv1::kOBModel0:
2b9468b2 2343 mechStavVol = CreateStaveModelOuterB0(mgr);
b705c75b 2344 break;
2345 case AliITSUv1::kOBModel1:
1fc6eff6 2346 case AliITSUv1::kOBModel2:
2347 mechStavVol = CreateStaveModelOuterB12(mgr);
b705c75b 2348 break;
2349 default:
2350 AliFatal(Form("Unknown stave model %d",fStaveModel));
2351 break;
2352 }
2353
852af72e 2354 return mechStavVol;
b705c75b 2355}
2356
2357//________________________________________________________________________
2b9468b2 2358TGeoVolume* AliITSUv1Layer::CreateStaveModelOuterBDummy(const TGeoManager *) const {
b705c75b 2359//
2360// Create dummy stave
2361//
2362// Input:
b705c75b 2363// mgr : the GeoManager (used only to get the proper material)
2364//
2365// Output:
2366//
2367// Return:
2368//
2369// Created: 20 Dec 2013 Mario Sitta
2370//
2371
2372
2373 // Done, return the stave structure
2374 return 0;
2375}
2376
2377//________________________________________________________________________
2b9468b2 2378TGeoVolume* AliITSUv1Layer::CreateStaveModelOuterB0(const TGeoManager *mgr){
b705c75b 2379//
2380// Creation of the mechanical stave structure for the Outer Barrel as in v0
2b9468b2 2381// (we fake the module and halfstave volumes to have always
2382// the same formal geometry hierarchy)
b705c75b 2383//
2384// Input:
b705c75b 2385// mgr : the GeoManager (used only to get the proper material)
2386//
2387// Output:
2388//
2389// Return:
2390//
2391// Created: 20 Dec 2013 Mario Sitta
2b9468b2 2392// Updated: 12 Mar 2014 Mario Sitta
b705c75b 2393//
2394
2b9468b2 2395 // Local variables
2396 Double_t xmod, ymod, zmod;
2397 Double_t xlen, ylen, zlen;
2398 Double_t ypos, zpos;
2399 char volname[30];
2400
2401 // First create all needed shapes
2402
2403 // The chip
2404 xlen = fgkOBHalfStaveWidth;
1fc6eff6 2405 ylen = 0.5*fChipThick;
2b9468b2 2406 zlen = fgkOBModuleZLength/2;
2407
2408 TGeoVolume *chipVol = CreateChipInnerB(xlen, ylen, zlen);
2409
2410 xmod = ((TGeoBBox*)chipVol->GetShape())->GetDX();
2411 ymod = ((TGeoBBox*)chipVol->GetShape())->GetDY();
2412 zmod = ((TGeoBBox*)chipVol->GetShape())->GetDZ();
2413
2414 TGeoBBox *module = new TGeoBBox(xmod, ymod, zmod);
2415
2416 zlen = fgkOBModuleZLength*fNModules;
2417 TGeoBBox *hstave = new TGeoBBox(xlen, ylen, zlen/2);
2418
2419
2420 // We have all shapes: now create the real volumes
2421
2422 TGeoMedium *medAir = mgr->GetMedium("ITS_AIR$");
2423
2424 snprintf(volname, 30, "%s%d", AliITSUGeomTGeo::GetITSModulePattern(), fLayerNumber);
2425 TGeoVolume *modVol = new TGeoVolume(volname, module, medAir);
2426 modVol->SetVisibility(kTRUE);
2427
2428 snprintf(volname, 30, "%s%d", AliITSUGeomTGeo::GetITSHalfStavePattern(), fLayerNumber);
2429 TGeoVolume *hstaveVol = new TGeoVolume(volname, hstave, medAir);
2430
2431
2432 // Finally build it up
2433 modVol->AddNode(chipVol, 0);
2434 fHierarchy[kChip]=1;
2435
2436 for (Int_t j=0; j<fNModules; j++) {
2437 ypos = 0.021; // Remove small overlap - M.S: 21may13
2438 zpos = -hstave->GetDZ() + j*2*zmod + zmod;
2439 hstaveVol->AddNode(modVol, j, new TGeoTranslation(0, ypos, zpos));
2440 fHierarchy[kModule]++;
2441 }
2442
2443
b705c75b 2444 // Done, return the stave structure
2b9468b2 2445 return hstaveVol;
b705c75b 2446}
2447
2448//________________________________________________________________________
1fc6eff6 2449TGeoVolume* AliITSUv1Layer::CreateStaveModelOuterB12(const TGeoManager *mgr){
b705c75b 2450//
c55b10c2 2451// Create the mechanical half stave structure
2452// for the Outer Barrel as in TDR
b705c75b 2453//
2454// Input:
b705c75b 2455// mgr : the GeoManager (used only to get the proper material)
2456//
2457// Output:
2458//
2459// Return:
2460//
2461// Created: 20 Nov 2013 Anastasia Barbano
2462// Updated: 16 Jan 2014 Mario Sitta
c55b10c2 2463// Updated: 24 Feb 2014 Mario Sitta
1fc6eff6 2464// Updated: 11 Nov 2014 Mario Sitta Model2
f1496ca7 2465// Updated: 03 Dec 2014 Mario Sitta Revised with C.Gargiulo latest infos
b705c75b 2466//
2467
c55b10c2 2468
2469 // Local parameters
2470 Double_t yFlex1 = fgkOBFlexCableAlThick;
2471 Double_t yFlex2 = fgkOBFlexCableKapThick;
1fc6eff6 2472 Double_t flexOverlap = 5; // to be checked - unused for the time being
c55b10c2 2473 Double_t xHalfSt = fgkOBHalfStaveWidth/2;
f1496ca7 2474 Double_t yCFleece = fgkOBCarbonFleeceThick;
2475 Double_t yGraph = fgkOBGraphiteFoilThick;
c55b10c2 2476
c55b10c2 2477 Double_t ymod, zmod;
2b9468b2 2478 Double_t xtru[12], ytru[12];
c55b10c2 2479 Double_t xpos, ypos, ypos1, zpos/*, zpos5cm*/;
1fc6eff6 2480 Double_t xlen, ylen, zlen;
c55b10c2 2481 char volname[30];
2482
1fc6eff6 2483 Double_t rCoolMin, rCoolMax;
2484 if (fStaveModel == AliITSUv1::kOBModel1)
2485 rCoolMin = fgkOBCoolTubeInnerDM1/2;
2486 else
2487 rCoolMin = fgkOBCoolTubeInnerD/2;
2488
2489 rCoolMax = rCoolMin + fgkOBCoolTubeThick;
c55b10c2 2490
2b9468b2 2491 zlen = (fNModules*fgkOBModuleZLength + (fNModules-1)*fgkOBModuleGap)/2;
c55b10c2 2492
2493
2494 // First create all needed shapes
2495
2496 TGeoVolume *moduleVol = CreateModuleOuterB();
2497 moduleVol->SetVisibility(kTRUE);
2498 ymod = ((TGeoBBox*)(moduleVol->GetShape()))->GetDY();
2499 zmod = ((TGeoBBox*)(moduleVol->GetShape()))->GetDZ();
2500
2501 TGeoBBox *busAl = new TGeoBBox("BusAl", xHalfSt, fgkOBBusCableAlThick/2,
2502 zlen);
2503 TGeoBBox *busKap = new TGeoBBox("BusKap", xHalfSt, fgkOBBusCableKapThick/2,
2504 zlen);
2505
1fc6eff6 2506 TGeoBBox *glue = new TGeoBBox("Glue", xHalfSt, fgkOBGlueThick/2, zlen);
2507
c55b10c2 2508 TGeoBBox *coldPlate = new TGeoBBox("ColdPlate", fgkOBHalfStaveWidth/2,
2509 fgkOBColdPlateThick/2, zlen);
2510
f1496ca7 2511 TGeoBBox *fleeccent = new TGeoBBox("FleeceCent", xHalfSt,
2512 yCFleece/2, zlen);
2513
c55b10c2 2514 TGeoTube *coolTube = new TGeoTube("CoolingTube", rCoolMin, rCoolMax, zlen);
8397c175 2515 TGeoTube *coolWater = new TGeoTube("CoolingWater", 0., rCoolMin, zlen);
c55b10c2 2516
2517 xlen = xHalfSt - fgkOBCoolTubeXDist/2 - coolTube->GetRmax();
f1496ca7 2518 TGeoBBox *graphlat = new TGeoBBox("GraphLateral", xlen/2, yGraph/2, zlen);
c55b10c2 2519
2520 xlen = fgkOBCoolTubeXDist/2 - coolTube->GetRmax();
f1496ca7 2521 TGeoBBox *graphmid = new TGeoBBox("GraphMiddle", xlen, yGraph/2, zlen);
c55b10c2 2522
f1496ca7 2523 ylen = coolTube->GetRmax() - yGraph;
2524 TGeoBBox *graphvert = new TGeoBBox("GraphVertical", yGraph/2, ylen/2, zlen);
c55b10c2 2525
2526 TGeoTubeSeg *graphtub = new TGeoTubeSeg("GraphTube", rCoolMax,
f1496ca7 2527 rCoolMax+yGraph, zlen,
c55b10c2 2528 180., 360.);
2529
f1496ca7 2530 xlen = xHalfSt - fgkOBCoolTubeXDist/2 - coolTube->GetRmax() - yGraph;
2531 TGeoBBox *fleeclat = new TGeoBBox("FleecLateral", xlen/2, yCFleece/2, zlen);
c55b10c2 2532
f1496ca7 2533 xlen = fgkOBCoolTubeXDist/2 - coolTube->GetRmax() - yGraph;
2534 TGeoBBox *fleecmid = new TGeoBBox("FleecMiddle", xlen, yCFleece/2, zlen);
c55b10c2 2535
f1496ca7 2536 ylen = coolTube->GetRmax() - yGraph - yCFleece;
2537 TGeoBBox *fleecvert = new TGeoBBox("FleecVertical", yCFleece/2, ylen/2,
2538 zlen);
c55b10c2 2539
f1496ca7 2540 TGeoTubeSeg *fleectub = new TGeoTubeSeg("FleecTube", rCoolMax+yGraph,
2541 rCoolMax+yCFleece+yGraph,
c55b10c2 2542 zlen, 180., 360.);
2543
2544 TGeoBBox *flex1_5cm = new TGeoBBox("Flex1MV_5cm",xHalfSt,yFlex1/2,flexOverlap/2);
2545 TGeoBBox *flex2_5cm = new TGeoBBox("Flex2MV_5cm",xHalfSt,yFlex2/2,flexOverlap/2);
2546
2b9468b2 2547 // The half stave container (an XTru to avoid overlaps between neightbours)
1fc6eff6 2548 ylen = ymod + busAl->GetDY() + busKap->GetDY() + coldPlate->GetDY()
f1496ca7 2549 + fleeccent->GetDY() + graphlat->GetDY() + fleeclat->GetDY();
1fc6eff6 2550 if (fStaveModel == AliITSUv1::kOBModel2)
2551 ylen += 2*glue->GetDY();
2552
2b9468b2 2553 xtru[0] = xHalfSt;
2554 ytru[0] = 0;
2555 xtru[1] = xtru[0];
1fc6eff6 2556 ytru[1] = -2*ylen;
2b9468b2 2557 xtru[2] = fgkOBCoolTubeXDist/2 + fleectub->GetRmax();
2558 ytru[2] = ytru[1];
2559 xtru[3] = xtru[2];
2560 ytru[3] = ytru[2] - (coolTube->GetRmax() + fleectub->GetRmax());
2561 xtru[4] = fgkOBCoolTubeXDist/2 - fleectub->GetRmax();
2562 ytru[4] = ytru[3];
2563 xtru[5] = xtru[4];
2564 ytru[5] = ytru[2];
2565 for (Int_t i = 0; i<6; i++) {
2566 xtru[6+i] = -xtru[5-i];
2567 ytru[6+i] = ytru[5-i];
2568 }
2569 TGeoXtru *halfStave = new TGeoXtru(2);
2570 halfStave->DefinePolygon(12, xtru, ytru);
2571 halfStave->DefineSection(0,-fZLength/2);
2572 halfStave->DefineSection(1, fZLength/2);
c55b10c2 2573
2574
2575 // We have all shapes: now create the real volumes
2576
b705c75b 2577 TGeoMedium *medAluminum = mgr->GetMedium("ITS_ALUMINUM$");
f1496ca7 2578 TGeoMedium *medK13D2U120 = mgr->GetMedium("ITS_K13D2U120$");
b705c75b 2579 TGeoMedium *medKapton = mgr->GetMedium("ITS_KAPTON(POLYCH2)$");
b705c75b 2580 TGeoMedium *medWater = mgr->GetMedium("ITS_WATER$");
2581 TGeoMedium *medCarbonFleece = mgr->GetMedium("ITS_CarbonFleece$");
2582 TGeoMedium *medFGS003 = mgr->GetMedium("ITS_FGS003$"); //amec thermasol
2583 TGeoMedium *medAir = mgr->GetMedium("ITS_AIR$");
1fc6eff6 2584 TGeoMedium *medGlue = mgr->GetMedium("ITS_GLUE$");
b705c75b 2585
2586
1fc6eff6 2587 TGeoVolume *busAlVol = new TGeoVolume("PowerBusAlVol", busAl , medAluminum);
c55b10c2 2588 busAlVol->SetLineColor(kCyan);
2589 busAlVol->SetFillColor(busAlVol->GetLineColor());
2590 busAlVol->SetFillStyle(4000); // 0% transparent
b705c75b 2591
1fc6eff6 2592 TGeoVolume *busKapVol = new TGeoVolume("PowerBusKapVol", busKap, medKapton);
c55b10c2 2593 busKapVol->SetLineColor(kBlue);
2594 busKapVol->SetFillColor(busKapVol->GetLineColor());
2595 busKapVol->SetFillStyle(4000); // 0% transparent
b705c75b 2596
c55b10c2 2597 TGeoVolume *coldPlateVol = new TGeoVolume("ColdPlateVol",
f1496ca7 2598 coldPlate, medK13D2U120);
c55b10c2 2599 coldPlateVol->SetLineColor(kYellow-3);
2600 coldPlateVol->SetFillColor(coldPlateVol->GetLineColor());
2601 coldPlateVol->SetFillStyle(4000); // 0% transparent
b705c75b 2602
f1496ca7 2603 TGeoVolume *fleeccentVol = new TGeoVolume("CarbonFleeceCentral",
2604 fleeccent, medCarbonFleece);
2605 fleeccentVol->SetLineColor(kViolet);
2606 fleeccentVol->SetFillColor(fleeccentVol->GetLineColor());
2607 fleeccentVol->SetFillStyle(4000); // 0% transparent
2608
1fc6eff6 2609 TGeoVolume *glueVol = new TGeoVolume("GlueVol", glue, medGlue);
2610 glueVol->SetLineColor(kBlack);
2611 glueVol->SetFillColor(glueVol->GetLineColor());
2612 glueVol->SetFillStyle(4000); // 0% transparent
2613
c55b10c2 2614 TGeoVolume *coolTubeVol = new TGeoVolume("CoolingTubeVol",
2615 coolTube, medKapton);
2616 coolTubeVol->SetLineColor(kGray);
2617 coolTubeVol->SetFillColor(coolTubeVol->GetLineColor());
2618 coolTubeVol->SetFillStyle(4000); // 0% transparent
2619
8397c175 2620 TGeoVolume *coolWaterVol;
2621 coolWaterVol = new TGeoVolume("CoolingWaterVol", coolWater, medWater);
c55b10c2 2622 coolWaterVol->SetLineColor(kBlue);
2623 coolWaterVol->SetFillColor(coolWaterVol->GetLineColor());
2624 coolWaterVol->SetFillStyle(4000); // 0% transparent
2625
2626 TGeoVolume *graphlatVol = new TGeoVolume("GraphiteFoilLateral",
2627 graphlat, medFGS003);
2628 graphlatVol->SetLineColor(kGreen);
2629 graphlatVol->SetFillColor(graphlatVol->GetLineColor());
2630 graphlatVol->SetFillStyle(4000); // 0% transparent
2631
2632 TGeoVolume *graphmidVol = new TGeoVolume("GraphiteFoilMiddle",
2633 graphmid, medFGS003);
2634 graphmidVol->SetLineColor(kGreen);
2635 graphmidVol->SetFillColor(graphmidVol->GetLineColor());
2636 graphmidVol->SetFillStyle(4000); // 0% transparent
2637
2638 TGeoVolume *graphvertVol = new TGeoVolume("GraphiteFoilVertical",
2639 graphvert, medFGS003);
2640 graphvertVol->SetLineColor(kGreen);
2641 graphvertVol->SetFillColor(graphvertVol->GetLineColor());
2642 graphvertVol->SetFillStyle(4000); // 0% transparent
2643
2644 TGeoVolume *graphtubVol = new TGeoVolume("GraphiteFoilPipeCover",
2645 graphtub, medFGS003);
2646 graphtubVol->SetLineColor(kGreen);
2647 graphtubVol->SetFillColor(graphtubVol->GetLineColor());
2648 graphtubVol->SetFillStyle(4000); // 0% transparent
2649
2650 TGeoVolume *fleeclatVol = new TGeoVolume("CarbonFleeceLateral",
2651 fleeclat, medCarbonFleece);
2652 fleeclatVol->SetLineColor(kViolet);
2653 fleeclatVol->SetFillColor(fleeclatVol->GetLineColor());
2654 fleeclatVol->SetFillStyle(4000); // 0% transparent
2655
2656 TGeoVolume *fleecmidVol = new TGeoVolume("CarbonFleeceMiddle",
2657 fleecmid, medCarbonFleece);
2658 fleecmidVol->SetLineColor(kViolet);
2659 fleecmidVol->SetFillColor(fleecmidVol->GetLineColor());
2660 fleecmidVol->SetFillStyle(4000); // 0% transparent
2661
2662 TGeoVolume *fleecvertVol = new TGeoVolume("CarbonFleeceVertical",
2663 fleecvert, medCarbonFleece);
2664 fleecvertVol->SetLineColor(kViolet);
2665 fleecvertVol->SetFillColor(fleecvertVol->GetLineColor());
2666 fleecvertVol->SetFillStyle(4000); // 0% transparent
2667
2668 TGeoVolume *fleectubVol = new TGeoVolume("CarbonFleecePipeCover",
2669 fleectub, medCarbonFleece);
2670 fleectubVol->SetLineColor(kViolet);
2671 fleectubVol->SetFillColor(fleectubVol->GetLineColor());
2672 fleectubVol->SetFillStyle(4000); // 0% transparent
2673
2674 snprintf(volname, 30, "%s%d", AliITSUGeomTGeo::GetITSHalfStavePattern(), fLayerNumber);
2675 TGeoVolume *halfStaveVol = new TGeoVolume(volname, halfStave, medAir);
2676// halfStaveVol->SetLineColor(12);
2677// halfStaveVol->SetFillColor(12);
2678// halfStaveVol->SetVisibility(kTRUE);
b705c75b 2679
b705c75b 2680
b705c75b 2681 TGeoVolume *flex1_5cmVol = new TGeoVolume("Flex1Vol5cm",flex1_5cm,medAluminum);
2682 TGeoVolume *flex2_5cmVol = new TGeoVolume("Flex2Vol5cm",flex2_5cm,medKapton);
b705c75b 2683
c55b10c2 2684
b705c75b 2685 flex1_5cmVol->SetLineColor(kRed);
2686 flex2_5cmVol->SetLineColor(kGreen);
b705c75b 2687
b705c75b 2688
c55b10c2 2689 // Now build up the half stave
2b9468b2 2690 ypos = - busKap->GetDY();
1fc6eff6 2691 if ( (fStaveModel == AliITSUv1::kOBModel1 && fBuildLevel < 4) || // Kapton
2692 (fStaveModel == AliITSUv1::kOBModel2 && fBuildLevel < 5) )
8397c175 2693 halfStaveVol->AddNode(busKapVol, 1, new TGeoTranslation(0, ypos, 0));
b705c75b 2694
c55b10c2 2695 ypos -= (busKap->GetDY() + busAl->GetDY());
1fc6eff6 2696 if ( (fStaveModel == AliITSUv1::kOBModel1 && fBuildLevel < 1) || // Aluminum
2697 (fStaveModel == AliITSUv1::kOBModel2 && fBuildLevel < 2) )
8397c175 2698 halfStaveVol->AddNode(busAlVol, 1, new TGeoTranslation(0, ypos, 0));
b705c75b 2699
1fc6eff6 2700 ypos -= busAl->GetDY();
2701
2702 if (fStaveModel == AliITSUv1::kOBModel2) {
2703 ypos -= glue->GetDY();
2704 if (fBuildLevel < 3) // Glue
2705 halfStaveVol->AddNode(glueVol, 1, new TGeoTranslation(0, ypos, 0));
2706 ypos -= glue->GetDY();
2707 }
2708
2709 ypos -= ymod;
2b9468b2 2710 for (Int_t j=0; j<fNModules; j++) {
c55b10c2 2711 zpos = -zlen + j*(2*zmod + fgkOBModuleGap) + zmod;
2712 halfStaveVol->AddNode(moduleVol, j, new TGeoTranslation(0, ypos, zpos));
2713 fHierarchy[kModule]++;
b705c75b 2714 }
c55b10c2 2715
1fc6eff6 2716 ypos -= ymod;
2717
2718 if (fStaveModel == AliITSUv1::kOBModel2) {
2719 ypos -= glue->GetDY();
2720 if (fBuildLevel < 3) // Glue
2721 halfStaveVol->AddNode(glueVol, 2, new TGeoTranslation(0, ypos, 0));
2722 ypos -= glue->GetDY();
2723 }
2724
f1496ca7 2725 ypos -= fleeccent->GetDY();
2726 if ( (fStaveModel == AliITSUv1::kOBModel1 && fBuildLevel < 5) || // Carbon
2727 (fStaveModel == AliITSUv1::kOBModel2 && fBuildLevel < 6) )
2728 halfStaveVol->AddNode(fleeccentVol, 1, new TGeoTranslation(0, ypos, 0));
2729 ypos -= fleeccent->GetDY();
2730
1fc6eff6 2731 ypos -= coldPlate->GetDY();
2732 if ( (fStaveModel == AliITSUv1::kOBModel1 && fBuildLevel < 5) || // Carbon
2733 (fStaveModel == AliITSUv1::kOBModel2 && fBuildLevel < 6) )
8397c175 2734 halfStaveVol->AddNode(coldPlateVol, 1, new TGeoTranslation(0, ypos, 0));
c55b10c2 2735
2736 xpos = fgkOBCoolTubeXDist/2;
2737 ypos1 = ypos - (coldPlate->GetDY() + coolTube->GetRmax());
1fc6eff6 2738 if ( (fStaveModel == AliITSUv1::kOBModel1 && fBuildLevel < 3) || // Water
2739 (fStaveModel == AliITSUv1::kOBModel2 && fBuildLevel < 4) ) {
8397c175 2740 halfStaveVol->AddNode(coolWaterVol, 1, new TGeoTranslation(-xpos, ypos1, 0));
2741 halfStaveVol->AddNode(coolWaterVol, 2, new TGeoTranslation( xpos, ypos1, 0));
2742 }
1fc6eff6 2743
2744 if ( (fStaveModel == AliITSUv1::kOBModel1 && fBuildLevel < 4) || // Kapton
2745 (fStaveModel == AliITSUv1::kOBModel2 && fBuildLevel < 5) ) {
8397c175 2746 halfStaveVol->AddNode(coolTubeVol,1, new TGeoTranslation(-xpos, ypos1, 0));
2747 halfStaveVol->AddNode(coolTubeVol,2, new TGeoTranslation( xpos, ypos1, 0));
2748 }
c55b10c2 2749
1fc6eff6 2750 if ( (fStaveModel == AliITSUv1::kOBModel1 && fBuildLevel < 5) || // Carbon
2751 (fStaveModel == AliITSUv1::kOBModel2 && fBuildLevel < 6) ) {
8397c175 2752 halfStaveVol->AddNode(graphtubVol,1, new TGeoTranslation(-xpos, ypos1, 0));
2753 halfStaveVol->AddNode(graphtubVol,2, new TGeoTranslation( xpos, ypos1, 0));
c55b10c2 2754
8397c175 2755 halfStaveVol->AddNode(fleectubVol,1, new TGeoTranslation(-xpos, ypos1, 0));
2756 halfStaveVol->AddNode(fleectubVol,2, new TGeoTranslation( xpos, ypos1, 0));
2757 }
c55b10c2 2758
2759 xpos = xHalfSt - graphlat->GetDX();
2760 ypos1 = ypos - (coldPlate->GetDY() + graphlat->GetDY());
1fc6eff6 2761 if ( (fStaveModel == AliITSUv1::kOBModel1 && fBuildLevel < 5) || // Carbon
2762 (fStaveModel == AliITSUv1::kOBModel2 && fBuildLevel < 6) ) {
8397c175 2763 halfStaveVol->AddNode(graphlatVol,1, new TGeoTranslation(-xpos, ypos1, 0));
2764 halfStaveVol->AddNode(graphlatVol,2, new TGeoTranslation( xpos, ypos1, 0));
2765
2766 halfStaveVol->AddNode(graphmidVol,1, new TGeoTranslation(0, ypos1, 0));
2767
2768 xpos = xHalfSt - 2*graphlat->GetDX() + graphvert->GetDX();
2769 ypos1 = ypos - (coldPlate->GetDY()+2*graphlat->GetDY()+graphvert->GetDY());
2770 halfStaveVol->AddNode(graphvertVol,1,new TGeoTranslation(-xpos, ypos1, 0));
2771 halfStaveVol->AddNode(graphvertVol,2,new TGeoTranslation( xpos, ypos1, 0));
2772 xpos = graphmid->GetDX() - graphvert->GetDX();
2773 halfStaveVol->AddNode(graphvertVol,3,new TGeoTranslation(-xpos, ypos1, 0));
2774 halfStaveVol->AddNode(graphvertVol,4,new TGeoTranslation( xpos, ypos1, 0));
2775 }
c55b10c2 2776
2777 xpos = xHalfSt - fleeclat->GetDX();
2778 ypos1 = ypos - (coldPlate->GetDY() +2*graphlat->GetDY() +fleeclat->GetDY());
1fc6eff6 2779 if ( (fStaveModel == AliITSUv1::kOBModel1 && fBuildLevel < 5) || // Carbon
2780 (fStaveModel == AliITSUv1::kOBModel2 && fBuildLevel < 6) ) {
8397c175 2781 halfStaveVol->AddNode(fleeclatVol,1, new TGeoTranslation(-xpos, ypos1, 0));
2782 halfStaveVol->AddNode(fleeclatVol,2, new TGeoTranslation( xpos, ypos1, 0));
2783
2784 halfStaveVol->AddNode(fleecmidVol, 1, new TGeoTranslation(0, ypos1, 0));
2785
2786 xpos = xHalfSt - 2*fleeclat->GetDX() + fleecvert->GetDX();
2787 ypos1 = ypos - (coldPlate->GetDY() +2*graphlat->GetDY()
2788 + 2*fleeclat->GetDY() + fleecvert->GetDY());
2789 halfStaveVol->AddNode(fleecvertVol,1,new TGeoTranslation(-xpos, ypos1, 0));
2790 halfStaveVol->AddNode(fleecvertVol,2,new TGeoTranslation( xpos, ypos1, 0));
2791 xpos = fleecmid->GetDX() - fleecvert->GetDX();
2792 halfStaveVol->AddNode(fleecvertVol,3,new TGeoTranslation(-xpos, ypos1, 0));
2793 halfStaveVol->AddNode(fleecvertVol,4,new TGeoTranslation( xpos, ypos1, 0));
2794 }
c55b10c2 2795
2796
2797 //THE FOLLOWING IS ONLY A REMINDER FOR WHAT IS STILL MISSING
2798
2799// for (Int_t j=0; j<fNChips; j++) {
2800
2801// zpos = -(zact + (fNChips-1)*modGap)/2 + j*(zMod + modGap) + zMod/2;
2802// zpos5cm = -(zact + (fNChips-1)*modGap)/2 + (j+1)*(zMod + modGap) + flexOverlap/2 ;
2803
2804// halfStaveVol->AddNode(moduleVol, j, new TGeoTranslation(xPos, -ylen + yPos + 2*rCoolMax + yCPlate + yGlue + yModPlate + ymod, zpos));
2805// halfStaveVol->AddNode(moduleVol, fNChips+j, new TGeoTranslation(-xPos, -ylen + yPos + 2*rCoolMax + yCPlate + yGlue + yModPlate + ymod +deltaY, zpos));
2806
2807// if((j+1)!=fNChips){
2808// halfStaveVol->AddNode(flex1_5cmVol,j,new TGeoTranslation(xPos,-ylen + yPos + 2*rCoolMax + yCPlate + yGlue + yModPlate + 2*ymod + yFlex1 + yFlex2 + yFlex1/2,zpos5cm));
2809// halfStaveVol->AddNode(flex1_5cmVol,fNChips+j,new TGeoTranslation(-xPos,-ylen + yPos + 2*rCoolMax + yCPlate + yGlue + yModPlate + 2*ymod + yFlex1 + yFlex2 + yFlex1/2 +deltaY,zpos5cm));
2810// halfStaveVol->AddNode(flex2_5cmVol,j,new TGeoTranslation(xPos,-ylen + yPos + 2*rCoolMax + yCPlate + yGlue + yModPlate + 2*ymod + 2*yFlex1 + 3*yFlex2/2,zpos5cm));
2811// halfStaveVol->AddNode(flex2_5cmVol,fNChips+j,new TGeoTranslation(-xPos,-ylen + yPos + 2*rCoolMax + yCPlate + yGlue + yModPlate + 2*ymod + 2*yFlex1 + 3*yFlex2/2 +deltaY,zpos5cm));
2812// }
2813// else {
2814// halfStaveVol->AddNode(flex1_5cmVol,j,new TGeoTranslation(xPos,-ylen + yPos + 2*rCoolMax + yCPlate + yGlue + yModPlate + 2*ymod + yFlex1/2,zpos5cm-modGap));
2815// halfStaveVol->AddNode(flex1_5cmVol,fNChips+j,new TGeoTranslation(-xPos,-ylen + yPos + 2*rCoolMax + yCPlate + yGlue + yModPlate + 2*ymod + yFlex1/2 +deltaY,zpos5cm-modGap));
2816// halfStaveVol->AddNode(flex2_5cmVol,j,new TGeoTranslation(xPos,-ylen + yPos + 2*rCoolMax + yCPlate + yGlue + yModPlate +2*ymod + yFlex1 + yFlex2/2,zpos5cm-modGap));
2817// halfStaveVol->AddNode(flex2_5cmVol,fNChips+j,new TGeoTranslation(-xPos,-ylen + yPos + 2*rCoolMax + yCPlate + yGlue + yModPlate + 2*ymod + yFlex1 + yFlex2/2 +deltaY,zpos5cm-modGap));
2818
2819// }
2820// }
b705c75b 2821
2822
c55b10c2 2823 // Done, return the half stave structure
2824 return halfStaveVol;
b705c75b 2825}
2826
2827//________________________________________________________________________
2b9468b2 2828TGeoVolume* AliITSUv1Layer::CreateSpaceFrameOuterB(const TGeoManager *mgr){
b705c75b 2829//
2830// Create the space frame for the Outer Barrel
2831//
2832// Input:
b705c75b 2833// mgr : the GeoManager (used only to get the proper material)
2834//
2835// Output:
2836//
2837// Return:
2838//
2839//
2840
852af72e 2841 TGeoVolume *mechStavVol = 0;
b705c75b 2842
2843 switch (fStaveModel) {
2844 case AliITSUv1::kOBModelDummy:
c55b10c2 2845 case AliITSUv1::kOBModel0:
2b9468b2 2846 mechStavVol = CreateSpaceFrameOuterBDummy(mgr);
b705c75b 2847 break;
2848 case AliITSUv1::kOBModel1:
1fc6eff6 2849 case AliITSUv1::kOBModel2:
2b9468b2 2850 mechStavVol = CreateSpaceFrameOuterB1(mgr);
b705c75b 2851 break;
2852 default:
2853 AliFatal(Form("Unknown stave model %d",fStaveModel));
2854 break;
2855 }
2856
852af72e 2857 return mechStavVol;
b705c75b 2858}
2859
2860//________________________________________________________________________
2b9468b2 2861TGeoVolume* AliITSUv1Layer::CreateSpaceFrameOuterBDummy(const TGeoManager *) const {
b705c75b 2862//
2863// Create dummy stave
2864//
2865// Input:
b705c75b 2866// mgr : the GeoManager (used only to get the proper material)
2867//
2868// Output:
2869//
2870// Return:
2871//
2872
2873
2874 // Done, return the stave structur
2875 return 0;
2876}
2877
2878//________________________________________________________________________
2b9468b2 2879TGeoVolume* AliITSUv1Layer::CreateSpaceFrameOuterB1(const TGeoManager *mgr){
b705c75b 2880//
c55b10c2 2881// Create the space frame for the Outer Barrel (Model 1)
e14c51b6 2882// The building blocks are created in another method to avoid
2883// replicating the same volumes for all OB staves
b705c75b 2884//
2885// Input:
b705c75b 2886// mgr : the GeoManager (used only to get the proper material)
2887//
2888// Output:
2889//
2890// Return:
2891// a TGeoVolume with the Space Frame of a stave
2892//
e14c51b6 2893// Created: 03 Feb 2015 Mario Sitta
2894//
2895
2896 TGeoMedium *medAir = mgr->GetMedium("ITS_AIR$");
2897
2898 TGeoVolume *unitVol[2], *endVol[2];
2899 Double_t *xtru, *ytru;
2900 Double_t zlen, zpos;
2901 Int_t nPoints;
2902 char volname[30];
2903
2904
2905 // Check whether we have already all pieces
2906 // Otherwise create them
2907 unitVol[0] = mgr->GetVolume("SpaceFrameUnit0");
2908
2909 if (!unitVol[0]) {
2910 CreateOBSpaceFrameObjects(mgr);
2911 unitVol[0] = mgr->GetVolume("SpaceFrameUnit0");
2912 }
2913
2914 unitVol[1] = mgr->GetVolume("SpaceFrameUnit1");
2915
2916 endVol[0] = mgr->GetVolume("SpaceFrameEndUnit0");
2917 endVol[1] = mgr->GetVolume("SpaceFrameEndUnit1");
2918
2919 // Get the shape of the units
2920 // and create a similar shape for the Space Frame container
2921 TGeoXtru *volShape = (TGeoXtru*)(unitVol[0]->GetShape());
2922
2923 nPoints = volShape->GetNvert();
2924 xtru = new Double_t[nPoints];
2925 ytru = new Double_t[nPoints];
2926
2927 for (Int_t i=0; i<nPoints; i++) {
2928 xtru[i] = volShape->GetX(i);
2929 ytru[i] = volShape->GetY(i);
2930 }
2931
2932 zlen = fgkOBSpaceFrameZLen[fLayerNumber/5]; // 3,4 -> 0 - 5,6 -> 1
2933
2934 TGeoXtru *spaceFrame = new TGeoXtru(2);
2935 spaceFrame->DefinePolygon(nPoints, xtru, ytru);
2936 spaceFrame->DefineSection(0,-zlen/2);
2937 spaceFrame->DefineSection(1, zlen/2);
2938
2939 snprintf(volname, 30, "SpaceFrameVolumeLay%d", fLayerNumber);
2940 TGeoVolume *spaceFrameVol = new TGeoVolume(volname, spaceFrame, medAir);
2941 spaceFrameVol->SetVisibility(kFALSE);
2942
2943
2944 // Finally build up the space frame
2945 Int_t nUnits = fgkOBSpaceFrameNUnits[fLayerNumber/5]; // 3,4 -> 0 - 5,6 -> 1
2946
2947 TGeoXtru *frameUnit = (TGeoXtru*)(unitVol[0]->GetShape());
2948 TGeoXtru *endUnit = (TGeoXtru*)( endVol[0]->GetShape());
2949
2950 zpos = -spaceFrame->GetDZ() + endUnit->GetDZ();
2951 spaceFrameVol->AddNode(endVol[0], 1, new TGeoTranslation(0, 0, zpos));
2952
2953 for(Int_t i=1; i<nUnits-1; i++){
2954 zpos = -spaceFrame->GetDZ() + (1 + 2*i)*frameUnit->GetDZ();
2955 Int_t j = i/2;
2956 Int_t k = i - j*2; // alternatively 0 or 1
2957 spaceFrameVol->AddNode(unitVol[k], j+1, new TGeoTranslation(0, 0, zpos));
2958 }
2959
2960 zpos = -spaceFrame->GetDZ() + (2*nUnits - 1)*endUnit->GetDZ();
2961 spaceFrameVol->AddNode(endVol[1], 1, new TGeoTranslation(0, 0, zpos));
2962
2963
2964 // Done, clean up and return the space frame structure
2965 delete [] xtru;
2966 delete [] ytru;
2967
2968 return spaceFrameVol;
2969}
2970
2971//________________________________________________________________________
2972void AliITSUv1Layer::CreateOBSpaceFrameObjects(const TGeoManager *mgr){
2973//
2974// Create the space frame building blocks for the Outer Barrel
2975// This method is practically identical to previous versions of
2976// CreateSpaceFrameOuterB1
2977//
2978// Input:
2979// mgr : the GeoManager (used only to get the proper material)
2980//
2981// Output:
2982//
2983// Return:
2984// a TGeoVolume with the Space Frame of a stave
2985//
2986// Created: 03 Feb 2015 Mario Sitta
b705c75b 2987//
2988
2989
94fc91be 2990 // Materials defined in AliITSUv1
2991 TGeoMedium *medCarbon = mgr->GetMedium("ITS_M55J6K$");
5402be00 2992 TGeoMedium *medF6151B05M = mgr->GetMedium("ITS_F6151B05M$");
b705c75b 2993 TGeoMedium *medAir = mgr->GetMedium("ITS_AIR$");
2994
2995
2996 // Local parameters
94fc91be 2997 Double_t halfFrameWidth = fgkOBSpaceFrameWidth/2;
5402be00 2998 Double_t triangleHeight = fgkOBSpaceFrameHeight;
2999 Double_t sframeHeight = triangleHeight + fgkOBSFrameBaseRibDiam
3000 + fgkOBSFrameULegHeight2*2;
94fc91be 3001 Double_t staveLa = fgkOBSpaceFrameTopVL;
3002 Double_t staveHa = fgkOBSpaceFrameTopVH;
3003 Double_t staveLb = fgkOBSpaceFrameSideVL;
3004 Double_t staveHb = fgkOBSpaceFrameSideVH;
3005 Double_t alphaDeg = fgkOBSpaceFrameVAlpha;
3006 Double_t alphaRad = alphaDeg*TMath::DegToRad()/2;
3007 Double_t beta = fgkOBSpaceFrameVBeta*TMath::DegToRad()/2;
3008 Double_t sideRibRadius = fgkOBSFrameSideRibDiam/2;
3009 Double_t sidePhiDeg = fgkOBSFrameSideRibPhi;
3010 Double_t sidePhiRad = sidePhiDeg*TMath::DegToRad();
3011 Double_t baseRibRadius = fgkOBSFrameBaseRibDiam/2;
3012 Double_t basePhiDeg = fgkOBSFrameBaseRibPhi;
3013 Double_t basePhiRad = basePhiDeg*TMath::DegToRad();
5402be00 3014 Double_t ulegHalfLen = fgkOBSFrameULegLen/2;
e14c51b6 3015 Double_t ulegHalfWidth = fgkOBSFrameULegWidth/2;
5402be00 3016 Double_t ulegHigh1 = fgkOBSFrameULegHeight1;
3017 Double_t ulegHigh2 = fgkOBSFrameULegHeight2;
3018 Double_t ulegThick = fgkOBSFrameULegThick;
94fc91be 3019
3020 Double_t xlen, zlen;
2b9468b2 3021 Double_t xpos, ypos, zpos;
94fc91be 3022 Double_t unitlen;
5402be00 3023 Double_t xtru[22], ytru[22];
3024 char volname[30];
c55b10c2 3025
c55b10c2 3026
94fc91be 3027 zlen = fgkOBSpaceFrameZLen[fLayerNumber/5]; // 3,4 -> 0 - 5,6 -> 1
3028 unitlen = fgkOBSpaceFrameUnitLen;
c55b10c2 3029
94fc91be 3030 xlen = halfFrameWidth + sideRibRadius;
b705c75b 3031
5402be00 3032 // We need a properly shaped Xtru to accomodate the ribs avoiding
3033 // overlaps with the HalfStave cooling tubes
3034 xtru[ 0] = fgkOBSFrameULegXPos - ulegHalfLen;
3035 ytru[ 0] = -(triangleHeight/2 + baseRibRadius);
3036 xtru[ 1] = xtru[0];
3037 ytru[ 1] = ytru[0] - ulegHigh1;
3038 xtru[ 2] = xtru[1] + ulegThick;
3039 ytru[ 2] = ytru[1];
3040 xtru[ 3] = xtru[2];
3041 ytru[ 3] = ytru[0] - ulegThick;
3042 xtru[ 7] = fgkOBSFrameULegXPos + ulegHalfLen;
3043 ytru[ 7] = ytru[0];
3044 xtru[ 6] = xtru[7];
3045 ytru[ 6] = ytru[1];
3046 xtru[ 5] = xtru[6] - ulegThick;
3047 ytru[ 5] = ytru[6];
3048 xtru[ 4] = xtru[5];
3049 ytru[ 4] = ytru[3];
3050 xtru[ 8] = xlen;
3051 ytru[ 8] = ytru[7];
3052 xtru[ 9] = xtru[8];
3053 ytru[ 9] = 0.9*ytru[8];
3054 xtru[10] = 0.3*xtru[8];
3055 ytru[10] = triangleHeight/2;
3056 for (Int_t i=0; i<11; i++) { // Reflect on the X negative side
3057 xtru[i+11] = -xtru[10-i];
3058 ytru[i+11] = ytru[10-i];
3059 }
3060 ytru[15] = ytru[0] - ulegHigh2; // U-legs on negative X are longer
3061 ytru[16] = ytru[15];
3062 ytru[19] = ytru[15];
3063 ytru[20] = ytru[15];
3064
3065
e14c51b6