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