1 /**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 // This class Defines the Geometry for the ITS services and support cones
17 // outside of the central volume (except for the Central support
18 // cylinders). Other classes define the rest of the ITS, specifically the
19 // SSD support cone, the SSD Support central cylinder, the SDD support cone,
20 // the SDD support central cylinder, the SPD Thermal Shield, The supports
21 // and cable trays on both the RB26 (muon dump) and RB24 sides, and all of
22 // the cabling from the ladders/stave ends out past the TPC.
24 // Here is the calling sequence associated with this file
25 // SPDSector(TGeoVolume *moth,TGeoManager *mgr)
26 // -----CarbonFiberSector(TGeoVolume *moth,Double_t &xAAtubeCenter0,
27 // Double_t &yAAtubeCenter0,TGeoManager *mgr)
28 // -----2* SPDsectorShape(Int_t n,const Double_t *xc,const Double_t *yc,
29 // | const Double_t *r,const Double_t *ths,
30 // | const Double_t *the,Int_t npr,Int_t &m,
31 // | Double_t **xp,Double_t **yp)
32 // -----StavesInSector(TGeoVolume *moth,TGeoManager *mgr)
33 // -----3* CreaeStave(Int_t layer,TArrayD &sizes,Bool_t addClips,
34 // | TGeoManager *mgr)
35 // | -----2* CreateHalfStave(Boot_t isRight,Int_t layer,
36 // | Int_t idxCentral,Int_t idxSide,
37 // | TArrayD &sizes,Bool_t addClips,
38 // | TGeoManager *mgr)
39 // | -----CreateGrondingFoil(Bool_t isRight,TArrayD &sizes,
40 // | | TGeoManager *mgr)
41 // | | -----4* CreateGroundingFoilSingle(Int_t type,
42 // | | TArrayD &sizes,
43 // | | TGeoManger *mgr)
44 // | |----CreateLadder(Int_t layer, TArrayD &sizes,
45 // | | TGeoManager *mgr)
46 // | |----CreateMCM(Bool_t isRight,TArrayD &sizes,
47 // | | TGeoManger *mgr)
48 // | |----CreatePixelBus(Bool_t isRight,TArrayD &sizes,
49 // | | TGeoManager *mgr)
50 // | -----CreateClip(TArrayD &sizes,TGeoManager *mgr)
51 // |----GetSectorMountingPoints(Int_t index,Double_t &x0,
52 // | Double_t &y0,Double_t &x1,
54 // -----3* ParallelPosition(Double_t dist1,Double_t dist2,
55 // Double_t phi,Double_t &x,Double_t &y)
57 // Obsoleate or presently unused routines are: setAddStave(Bool_t *mask),
58 // CreatePixelBusAndExtensions(...) which calles CreateExtender(...).
63 // General Root includes
64 #include <Riostream.h>
68 #include <TPolyLine.h>
69 #include <TPolyMarker.h>
71 // Root Geometry includes
72 #include <TGeoCompositeShape.h>
74 #include <TGeoGlobalMagField.h>
75 #include <TGeoMaterial.h>
76 #include <TGeoMatrix.h>
77 #include <TGeoMedium.h>
78 #include <TGeoTube.h> // contains TGeoTubeSeg
79 #include <TGeoVolume.h>
89 #include "AliITSv11GeometrySPD.h"
91 // Constant definistions
92 const Double_t AliITSv11GeometrySPD::fgkGapLadder =
93 AliITSv11Geometry::fgkmicron*75.; // 75 microns
94 const Double_t AliITSv11GeometrySPD::fgkGapHalfStave =
95 AliITSv11Geometry::fgkmicron*120.; // 120 microns
97 ClassImp(AliITSv11GeometrySPD)
98 //______________________________________________________________________
99 AliITSv11GeometrySPD::AliITSv11GeometrySPD(/*Double_t gap*/):
100 AliITSv11Geometry(),// Default constructor of base class
101 fAddStave(), // [DEBUG] must be TRUE for all staves which will be
102 // mounted in the sector (used to check overlaps)
103 fSPDsectorX0(0), // X of first edge of sector plane for stave
104 fSPDsectorY0(0), // Y of first edge of sector plane for stave
105 fSPDsectorX1(0), // X of second edge of sector plane for stave
106 fSPDsectorY1(0), // Y of second edge of sector plane for stave
107 fTubeEndSector() // coordinate of cooling tube ends
110 // Default constructor.
111 // This does not initialize anything and is provided just for
112 // completeness. It is recommended to use the other one.
113 // The alignment gap is specified as argument (default = 0.0075 cm).
119 // A default constructed AliITSv11GeometrySPD class.
123 for (i = 0; i < 6; i++) fAddStave[i] = kTRUE;
124 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++){
125 this->fTubeEndSector[k][0][i][j] = 0.0;
126 this->fTubeEndSector[k][1][i][j] = 0.0;
129 //______________________________________________________________________
130 AliITSv11GeometrySPD::AliITSv11GeometrySPD(Int_t debug/*, Double_t gap*/):
131 AliITSv11Geometry(debug),// Default constructor of base class
132 fAddStave(), // [DEBUG] must be TRUE for all staves which will be
133 // mounted in the sector (used to check overlaps)
134 fSPDsectorX0(0), // X of first edge of sector plane for stave
135 fSPDsectorY0(0), // Y of first edge of sector plane for stave
136 fSPDsectorX1(0), // X of second edge of sector plane for stave
137 fSPDsectorY1(0), // Y of second edge of sector plane for stave
138 fTubeEndSector() // coordinate of cooling tube ends
141 // Constructor with debug setting argument
142 // This is the constructor which is recommended to be used.
143 // It sets a debug level, and initializes the name of the object.
144 // The alignment gap is specified as argument (default = 0.0075 cm).
146 // Int_t debug Debug level, 0= no debug output.
150 // A default constructed AliITSv11GeometrySPD class.
154 for (i = 0; i < 6; i++) fAddStave[i] = kTRUE;
155 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++){
156 this->fTubeEndSector[k][0][i][j] = 0.0;
157 this->fTubeEndSector[k][1][i][j] = 0.0;
160 //______________________________________________________________________
161 AliITSv11GeometrySPD::AliITSv11GeometrySPD(const AliITSv11GeometrySPD &s):
162 AliITSv11Geometry(s),// Base Class Copy constructor
163 fAddStave(), // [DEBUG] must be TRUE for all staves which will be
164 // mounted in the sector (used to check overlaps)
165 fSPDsectorX0(s.fSPDsectorX0), // X of first edge of sector plane for stave
166 fSPDsectorY0(s.fSPDsectorY0), // Y of first edge of sector plane for stave
167 fSPDsectorX1(s.fSPDsectorX1), // X of second edge of sector plane for stave
168 fSPDsectorY1(s.fSPDsectorY1) // Y of second edge of sector plane for stave
173 // AliITSv11GeometrySPD &s source class
177 // A copy of a AliITSv11GeometrySPD class.
181 for (i = 0; i < 6; i++) this->fAddStave[i] = s.fAddStave[i];
182 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++){
183 this->fTubeEndSector[k][0][i][j] = s.fTubeEndSector[k][0][i][j];
184 this->fTubeEndSector[k][1][i][j] = s.fTubeEndSector[k][1][i][j];
187 //______________________________________________________________________
188 AliITSv11GeometrySPD& AliITSv11GeometrySPD::operator=(const
189 AliITSv11GeometrySPD &s)
194 // AliITSv11GeometrySPD &s source class
198 // A copy of a AliITSv11GeometrySPD class.
202 if(this==&s) return *this;
203 for (i = 0; i < 6; i++) this->fAddStave[i] = s.fAddStave[i];
204 this->fSPDsectorX0=s.fSPDsectorX0;
205 this->fSPDsectorY0=s.fSPDsectorY0;
206 this->fSPDsectorX1=s.fSPDsectorX1;
207 this->fSPDsectorY1=s.fSPDsectorY1;
208 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++){
209 this->fTubeEndSector[k][0][i][j] = s.fTubeEndSector[k][0][i][j];
210 this->fTubeEndSector[k][1][i][j] = s.fTubeEndSector[k][1][i][j];
214 //______________________________________________________________________
215 TGeoMedium* AliITSv11GeometrySPD::GetMedium(const char* mediumName,
216 TGeoManager *mgr) const
219 // This function is used to recovery any medium
220 // used to build the geometry volumes.
221 // If the required medium does not exists,
222 // a NULL pointer is returned, and an error message is written.
224 Char_t itsMediumName[30];
226 sprintf(itsMediumName, "ITS_%s", mediumName);
227 TGeoMedium* medium = mgr->GetMedium(itsMediumName);
228 if (!medium) AliError(Form("Medium <%s> not found", mediumName));
233 //______________________________________________________________________
234 void AliITSv11GeometrySPD::SPDSector(TGeoVolume *moth, TGeoManager *mgr)
237 // Creates a single SPD carbon fiber sector and places it
238 // in a container volume passed as first argument ('moth').
239 // Second argument points to the TGeoManager which coordinates
240 // the overall volume creation.
241 // The position of the sector is based on distance of
242 // closest point of SPD stave to beam pipe
243 // (figures all-sections-modules.ps) of 7.22mm at section A-A.
248 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/assembly.ps"
249 title="SPD Sector drawing with all cross sections defined">
250 <p>The SPD Sector definition. In
251 <a href="http://alice.pd.infn.it/latestdr/Geometric-Revision/assembly.hpgl">HPGL</a> format.
252 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/assembly-10-modules.ps"
253 titile="SPD All Sectors end view with thermal sheald">
254 <p>The SPD all sector end view with thermal sheald.
255 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/assembly.ps"
256 title="SPD side view cross section">
257 <p>SPD side view cross section with condes and thermal shealds.
258 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-A_A.jpg"
259 title="Cross section A-A"><p>Cross section A-A.
260 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-B_B.jpg"
261 title="Cross updated section A-A"><p>Cross updated section A-A.
262 <img src="http://physics.mps.ohio-state.edu/~nilsen/ITSfigures/Sezione_layerAA.pdf"
263 title="Cross section B-B"><p>Cross section B-B.
264 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-C_C.jpg"
265 title-"Cross section C-C"><p>Cross section C-C.
266 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-D_D.jpg"
267 title="Cross section D-D"><p>Cross section D-D.
268 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-E_E.jpg"
269 title="Cross section E-E"><p>Cross section E-E.
270 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-F_F.jpg"
271 title="Cross section F-F"><p>Cross section F-F.
272 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-G_G.jpg"
273 title="Cross section G-G"><p>Cross section G-G.
278 // TGeoVolume *moth Pointer to mother volume where this object
279 // is to be placed in
280 // TGeoManager *mgr Pointer to the TGeoManager used, defaule is
286 // Updated values for kSPDclossesStaveAA, kBeamPipeRadius, and
287 // staveThicknessAA are taken from
288 // http://physics.mps.ohio-state.edu/~nilsen/ITSfigures/Sezione_layerAA.pdf
290 const Double_t kSPDclossesStaveAA = 7.25* fgkmm;
291 const Double_t kSectorStartingAngle = -72.0 * fgkDegree;
292 const Int_t kNSectorsTotal = 10;
293 const Double_t kSectorRelativeAngle = 36.0 * fgkDegree; // = 360.0 / 10
294 const Double_t kBeamPipeRadius = 0.5 * 59.6 * fgkmm; // diam. = 59.6 mm
295 //const Double_t staveThicknessAA = 0.9 *fgkmm; // nominal thickness
296 const Double_t staveThicknessAA = 1.02 * fgkmm; // get from stave geometry.
299 Double_t angle, radiusSector, xAAtubeCenter0, yAAtubeCenter0;
300 TGeoCombiTrans *secRot = new TGeoCombiTrans(), *comrot;
301 TGeoVolume *vCarbonFiberSector;
302 TGeoMedium *medSPDcf;
304 // Define an assembly and fill it with the support of
305 // a single carbon fiber sector and staves in it
306 medSPDcf = GetMedium("SPD C (M55J)$", mgr);
307 vCarbonFiberSector = new TGeoVolumeAssembly("ITSSPDCarbonFiberSectorV");
308 vCarbonFiberSector->SetMedium(medSPDcf);
309 CarbonFiberSector(vCarbonFiberSector, xAAtubeCenter0, yAAtubeCenter0, mgr);
311 // Compute the radial shift out of the sectors
312 radiusSector = kBeamPipeRadius + kSPDclossesStaveAA + staveThicknessAA;
313 radiusSector = GetSPDSectorTranslation(fSPDsectorX0.At(1), fSPDsectorY0.At(1),
314 fSPDsectorX1.At(1), fSPDsectorY1.At(1), radiusSector);
315 //radiusSector *= radiusSector; // squaring;
316 //radiusSector -= xAAtubeCenter0 * xAAtubeCenter0;
317 //radiusSector = -yAAtubeCenter0 + TMath::Sqrt(radiusSector);
319 AliDebug(1, Form("SPDSector : radiusSector=%f\n",radiusSector));
321 AliDebug(1, Form("i= %d x0=%f y0=%f x1=%f y1=%f\n", i,
322 fSPDsectorX0.At(i), fSPDsectorY0.At(i),
323 fSPDsectorX1.At(i),fSPDsectorY1.At(i)));
325 // add 10 single sectors, by replicating the virtual sector defined above
326 // and placing at different angles
327 Double_t shiftX, shiftY, tub[2][6][3];
328 for(i=0;i<2;i++)for(j=0;j<6;j++)for(k=0;k<3;k++) tub[i][j][k] = fTubeEndSector[0][i][j][k];
329 angle = kSectorStartingAngle;
330 secRot->RotateZ(angle);
331 TGeoVolumeAssembly *vcenteral = new TGeoVolumeAssembly("ITSSPD");
332 moth->AddNode(vcenteral, 1, 0);
333 for(i = 0; i < kNSectorsTotal; i++) {
334 shiftX = -radiusSector * TMath::Sin(angle/fgkRadian);
335 shiftY = radiusSector * TMath::Cos(angle/fgkRadian);
336 //cout << "ANGLE = " << angle << endl;
337 shiftX += 0.1094 * TMath::Cos((angle + 196.)/fgkRadian);
338 shiftY += 0.1094 * TMath::Sin((angle + 196.)/fgkRadian);
341 //shiftX -= 0.11 * TMath::Cos(angle/fgkRadian); // add by Alberto
342 //shiftY -= 0.11 * TMath::Sin(angle/fgkRadian); // don't ask me where that 0.11 comes from!
343 secRot->SetDx(shiftX);
344 secRot->SetDy(shiftY);
345 comrot = new TGeoCombiTrans(*secRot);
346 vcenteral->AddNode(vCarbonFiberSector,i+1,comrot);
347 for(j=0;j<2;j++)for(k=0;k<6;k++) // Transform Tube ends for each sector
348 comrot->LocalToMaster(tub[j][k],fTubeEndSector[i][j][k]);
350 AliInfo(Form("i=%d angle=%g angle[rad]=%g radiusSector=%g "
351 "x=%g y=%g \n",i, angle, angle/fgkRadian,
352 radiusSector, shiftX, shiftY));
353 } // end if GetDebug(5)
354 angle += kSectorRelativeAngle;
355 secRot->RotateZ(kSectorRelativeAngle);
357 if(GetDebug(3)) moth->PrintNodes();
362 //______________________________________________________________________
363 void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
364 Double_t &xAAtubeCenter0, Double_t &yAAtubeCenter0, TGeoManager *mgr)
367 // Define the detail SPD Carbon fiber support Sector geometry.
368 // Based on the drawings:
370 http:///QA-construzione-profilo-modulo.ps
372 // - ALICE-Pixel "Costruzione Profilo Modulo" (march 25 2004)
373 // - ALICE-SUPPORTO "Costruzione Profilo Modulo"
375 // Define outside radii as negative, where "outside" means that the
376 // center of the arc is outside of the object (feb 16 2004).
378 // Arguments [the one passed by ref contain output values]:
380 // TGeoVolume *moth the voulme which will contain this object
381 // TGeoManager *mgr TGeo builder defauls is gGeoManager
383 // Double_t &xAAtubeCenter0 (by ref) x location of the outer surface
384 // of the cooling tube center for tube 0.
385 // Double_t &yAAtubeCenter0 (by ref) y location of the outer surface
386 // of the cooling tube center for tube 0.
390 // Int the two variables passed by reference values will be stored
391 // which will then be used to correctly locate this sector.
392 // The information used for this is the distance between the
393 // center of the #0 detector and the beam pipe.
394 // Measurements are taken at cross section A-A.
397 //TGeoMedium *medSPDfs = 0;//SPD support cone inserto stesalite 4411w
398 //TGeoMedium *medSPDfo = 0;//SPD support cone foam, Rohacell 50A.
399 //TGeoMedium *medSPDal = 0;//SPD support cone SDD mounting bracket Al
400 TGeoMedium *medSPDcf = GetMedium("SPD C (M55J)$", mgr);
401 TGeoMedium *medSPDss = GetMedium("INOX$", mgr);
402 TGeoMedium *medSPDair = GetMedium("AIR$", mgr);
403 TGeoMedium *medSPDcoolfl = GetMedium("Freon$", mgr); //ITSspdCoolingFluid
405 const Double_t ksecDz = 0.5 * 500.0 * fgkmm;
406 //const Double_t ksecLen = 30.0 * fgkmm;
407 const Double_t ksecCthick = 0.2 * fgkmm;
408 const Double_t ksecDipLength = 3.2 * fgkmm;
409 const Double_t ksecDipRadii = 0.4 * fgkmm;
410 //const Double_t ksecCoolingTubeExtraDepth = 0.86 * fgkmm;
412 // The following positions ('ksecX#' and 'ksecY#') and radii ('ksecR#')
413 // are the centers and radii of curvature of all the rounded corners
414 // between the straight borders of the SPD sector shape.
415 // To draw this SPD sector, the following steps are followed:
416 // 1) the (ksecX, ksecY) points are plotted
417 // and circles of the specified radii are drawn around them.
418 // 2) each pair of consecutive circles is connected by a line
419 // tangent to them, in accordance with the radii being "internal"
420 // or "external" with respect to the closed shape which describes
421 // the sector itself.
422 // The resulting connected shape is the section
423 // of the SPD sector surface in the transverse plane (XY).
425 const Double_t ksecX0 = -10.725 * fgkmm;
426 const Double_t ksecY0 = -14.853 * fgkmm;
427 const Double_t ksecR0 = -0.8 * fgkmm; // external
428 const Double_t ksecX1 = -13.187 * fgkmm;
429 const Double_t ksecY1 = -19.964 * fgkmm;
430 const Double_t ksecR1 = +0.6 * fgkmm; // internal // (modif. by Alberto)
431 //const Double_t ksecR1 = +0.8 * fgkmm; // internal // (modif. by Alberto)
433 // const Double_t ksecDip0 = 5.9 * fgkmm;
435 //const Double_t ksecX2 = -3.883 * fgkmm;
436 const Double_t ksecX2 = -3.833 * fgkmm; // (corr. by Alberto)
437 const Double_t ksecY2 = -17.805 * fgkmm;
438 const Double_t ksecR2 = +0.6 * fgkmm; // internal (guess)
439 const Double_t ksecX3 = -3.123 * fgkmm;
440 const Double_t ksecY3 = -14.618 * fgkmm;
441 const Double_t ksecR3 = -0.6 * fgkmm; // external
442 //const Double_t ksecDip1 = 8.035 * fgkmm;
444 const Double_t ksecX4 = +11.280 * fgkmm;
445 const Double_t ksecY4 = -14.473 * fgkmm;
446 const Double_t ksecR4 = +0.8 * fgkmm; // internal
447 const Double_t ksecX5 = +19.544 * fgkmm;
448 const Double_t ksecY5 = +10.961 * fgkmm;
449 const Double_t ksecR5 = +0.8 * fgkmm; // internal
450 //const Double_t ksecDip2 = 4.553 * fgkmm;
452 const Double_t ksecX6 = +10.830 * fgkmm;
453 const Double_t ksecY6 = +16.858 * fgkmm;
454 const Double_t ksecR6 = +0.6 * fgkmm; // internal
455 const Double_t ksecX7 = +11.581 * fgkmm;
456 const Double_t ksecY7 = +13.317 * fgkmm;
457 const Double_t ksecR7 = -0.6 * fgkmm; // external
458 //const Double_t ksecDip3 = 6.978 * fgkmm;
460 const Double_t ksecX8 = -0.733 * fgkmm;
461 const Double_t ksecY8 = +17.486 * fgkmm;
462 const Double_t ksecR8 = +0.6 * fgkmm; // internal
463 const Double_t ksecX9 = +0.562 * fgkmm;
464 //const Double_t ksecY9 = +14.486 * fgkmm; // correction by
465 const Double_t ksecY9 = +14.107 * fgkmm; // Alberto
466 const Double_t ksecR9 = -0.6 * fgkmm; // external
467 //const Double_t ksecDip4 = 6.978 * fgkmm;
469 const Double_t ksecX10 = -12.252 * fgkmm;
470 const Double_t ksecY10 = +16.298 * fgkmm;
471 const Double_t ksecR10 = +0.6 * fgkmm; // internal
472 const Double_t ksecX11 = -10.445 * fgkmm;
473 const Double_t ksecY11 = +13.162 * fgkmm;
474 const Double_t ksecR11 = -0.6 * fgkmm; // external
475 //const Double_t ksecDip5 = 6.978 * fgkmm;
477 const Double_t ksecX12 = -22.276 * fgkmm;
478 const Double_t ksecY12 = +12.948 * fgkmm;
479 const Double_t ksecR12 = +0.85 * fgkmm; // internal
480 const Double_t ksecR13 = -0.8 * fgkmm; // external
481 const Double_t ksecAngleSide13 = 36.0 * fgkDegree;
483 const Int_t ksecNRadii = 20;
484 const Int_t ksecNPointsPerRadii = 4;
485 const Int_t ksecNCoolingTubeDips = 6;
487 // Since the rounded parts are approximated by a regular polygon
488 // and a cooling tube of the propper diameter must fit, a scaling factor
489 // increases the size of the polygon for the tube to fit.
490 //const Double_t ksecRCoolScale = 1./TMath::Cos(TMath::Pi()/
491 // (Double_t)ksecNPointsPerRadii);
492 const Double_t ksecZEndLen = 30.000 * fgkmm;
493 //const Double_t ksecZFlangLen = 45.000 * fgkmm;
494 const Double_t ksecTl = 0.860 * fgkmm;
495 const Double_t ksecCthick2 = 0.600 * fgkmm;
496 //const Double_t ksecCthick3 = 1.80 * fgkmm;
497 //const Double_t ksecSidelen = 22.0 * fgkmm;
498 //const Double_t ksecSideD5 = 3.679 * fgkmm;
499 //const Double_t ksecSideD12 = 7.066 * fgkmm;
500 const Double_t ksecRCoolOut = 2.400 * fgkmm;
501 const Double_t ksecRCoolIn = 2.000 * fgkmm;
502 const Double_t ksecDl1 = 5.900 * fgkmm;
503 const Double_t ksecDl2 = 8.035 * fgkmm;
504 const Double_t ksecDl3 = 4.553 * fgkmm;
505 const Double_t ksecDl4 = 6.978 * fgkmm;
506 const Double_t ksecDl5 = 6.978 * fgkmm;
507 const Double_t ksecDl6 = 6.978 * fgkmm;
508 const Double_t ksecCoolTubeThick = 0.04 * fgkmm;
509 const Double_t ksecCoolTubeROuter = 2.6 * fgkmm;
510 const Double_t ksecCoolTubeFlatX = 3.696 * fgkmm;
511 const Double_t ksecCoolTubeFlatY = 0.68 * fgkmm;
512 //const Double_t ksecBeamX0 = 0.0 * fgkmm; // guess
513 //const Double_t ksecBeamY0 = (15.223 + 40.) * fgkmm; // guess
515 // redefine some of the points already defined above
516 // in the format of arrays (???)
517 const Int_t ksecNPoints = (ksecNPointsPerRadii + 1) * ksecNRadii + 8;
518 Double_t secX[ksecNRadii] = {
519 ksecX0, ksecX1, -1000.0,
520 ksecX2, ksecX3, -1000.0,
521 ksecX4, ksecX5, -1000.0,
522 ksecX6, ksecX7, -1000.0,
523 ksecX8, ksecX9, -1000.0,
524 ksecX10, ksecX11, -1000.0,
527 Double_t secY[ksecNRadii] = {
528 ksecY0, ksecY1, -1000.0,
529 ksecY2, ksecY3, -1000.0,
530 ksecY4, ksecY5, -1000.0,
531 ksecY6, ksecY7, -1000.0,
532 ksecY8, ksecY9, -1000.0,
533 ksecY10, ksecY11, -1000.0,
536 Double_t secR[ksecNRadii] = {
537 ksecR0, ksecR1, -.5 * ksecDipLength - ksecDipRadii,
538 ksecR2, ksecR3, -.5 * ksecDipLength - ksecDipRadii,
539 ksecR4, ksecR5, -.5 * ksecDipLength - ksecDipRadii,
540 ksecR6, ksecR7, -.5 * ksecDipLength - ksecDipRadii,
541 ksecR8, ksecR9, -.5 * ksecDipLength - ksecDipRadii,
542 ksecR10, ksecR11, -.5 * ksecDipLength - ksecDipRadii,
546 Double_t secX2[ksecNRadii];
547 Double_t secY2[ksecNRadii];
548 Double_t secR2[ksecNRadii] = {
549 ksecR0, ksecR1, ksecRCoolOut,
550 ksecR2, ksecR3, ksecRCoolOut,
551 ksecR4, ksecR5, ksecRCoolOut,
552 ksecR6, ksecR7, ksecRCoolOut,
553 ksecR8, ksecR9, ksecRCoolOut,
554 ksecR10, ksecR11, ksecRCoolOut,
557 Double_t secDip2[ksecNCoolingTubeDips] = {
558 ksecDl1, ksecDl2, ksecDl3,
559 ksecDl4, ksecDl5, ksecDl6
561 Double_t secX3[ksecNRadii];
562 Double_t secY3[ksecNRadii];
563 const Int_t ksecDipIndex[ksecNCoolingTubeDips] = {2, 5, 8, 11, 14, 17};
564 Double_t secAngleStart[ksecNRadii];
565 Double_t secAngleEnd[ksecNRadii];
566 Double_t secAngleStart2[ksecNRadii];
567 Double_t secAngleEnd2[ksecNRadii];
568 Double_t secAngleTurbo[ksecNCoolingTubeDips] = {0., 0., 0., 0., 0., 0.0};
569 //Double_t secAngleStart3[ksecNRadii];
570 //Double_t secAngleEnd3[ksecNRadii];
571 Double_t xpp[ksecNPoints], ypp[ksecNPoints];
572 Double_t xpp2[ksecNPoints], ypp2[ksecNPoints];
573 Double_t *xp[ksecNRadii], *xp2[ksecNRadii];
574 Double_t *yp[ksecNRadii], *yp2[ksecNRadii];
575 TGeoXtru *sA0, *sA1, *sB0, *sB1,*sB2;
577 TGeoEltu *sTA0, *sTA1;
578 TGeoTube *sTB0, *sTB1; //,*sM0;
580 TGeoTranslation *trans;
581 TGeoCombiTrans *rotrans;
582 Double_t t, t0, t1, a, b, x0, y0,z0, x1, y1;
587 AliError("Container volume (argument) is NULL");
590 for(i = 0; i < ksecNRadii; i++) {
591 xp[i] = &(xpp[i*(ksecNPointsPerRadii+1)]);
592 yp[i] = &(ypp[i*(ksecNPointsPerRadii+1)]);
593 xp2[i] = &(xpp2[i*(ksecNPointsPerRadii+1)]);
594 yp2[i] = &(ypp2[i*(ksecNPointsPerRadii+1)]);
601 // find starting and ending angles for all but cooling tube sections
602 secAngleStart[0] = 0.5 * ksecAngleSide13;
603 for(i = 0; i < ksecNRadii - 2; i++) {
605 for(j=0;j<ksecNCoolingTubeDips;j++) tst = (tst||i==ksecDipIndex[j]);
608 for(j=0;j<ksecNCoolingTubeDips;j++) tst =(tst||(i+1)==ksecDipIndex[j]);
609 if (tst) j = i+2; else j = i+1;
610 AnglesForRoundedCorners(secX[i],secY[i],secR[i],secX[j],secY[j],
613 secAngleStart[j] = t1;
614 if(secR[i] > 0.0 && secR[j] > 0.0) {
615 if(secAngleStart[i] > secAngleEnd[i]) secAngleEnd[i] += 360.0;
616 } // end if(secR[i]>0.0 && secR[j]>0.0)
617 secAngleStart2[i] = secAngleStart[i];
618 secAngleEnd2[i] = secAngleEnd[i];
620 secAngleEnd[ksecNRadii-2] = secAngleStart[ksecNRadii-2] +
621 (secAngleEnd[ksecNRadii-5] - secAngleStart[ksecNRadii-5]);
622 if (secAngleEnd[ksecNRadii-2] < 0.0) secAngleEnd[ksecNRadii-2] += 360.0;
623 secAngleStart[ksecNRadii-1] = secAngleEnd[ksecNRadii-2] - 180.0;
624 secAngleEnd[ksecNRadii-1] = secAngleStart[0];
625 secAngleStart2[ksecNRadii-2] = secAngleStart[ksecNRadii-2];
626 secAngleEnd2[ksecNRadii-2] = secAngleEnd[ksecNRadii-2];
627 secAngleStart2[ksecNRadii-1] = secAngleStart[ksecNRadii-1];
628 secAngleEnd2[ksecNRadii-1] = secAngleEnd[ksecNRadii-1];
630 // find location of circle last rounded corner.
633 t0 = TanD(secAngleStart[i]-90.);
634 t1 = TanD(secAngleEnd[j]-90.);
635 t = secY[i] - secY[j];
636 // NOTE: secR[i=0] < 0; secR[j=18] > 0; and secR[j+1=19] < 0
637 t += (-secR[i]+secR[j+1]) * SinD(secAngleStart[i]);
638 t -= (secR[j]-secR[j+1]) * SinD(secAngleEnd[j]);
639 t += t1 * secX[j] - t0*secX[i];
640 t += t1 * (secR[j] - secR[j+1]) * CosD(secAngleEnd[j]);
641 t -= t0 * (-secR[i]+secR[j+1]) * CosD(secAngleStart[i]);
642 secX[ksecNRadii-1] = t / (t1-t0);
643 secY[ksecNRadii-1] = TanD(90.0+0.5*ksecAngleSide13)*
644 (secX[ksecNRadii-1]-secX[0])+secY[0];
645 secX2[ksecNRadii-1] = secX[ksecNRadii-1];
646 secY2[ksecNRadii-1] = secY[ksecNRadii-1];
647 secX3[ksecNRadii-1] = secX[ksecNRadii-1];
648 secY3[ksecNRadii-1] = secY[ksecNRadii-1];
650 // find location of cooling tube centers
651 for(i = 0; i < ksecNCoolingTubeDips; i++) {
653 x0 = secX[j-1] + TMath::Abs(secR[j-1]) * CosD(secAngleEnd[j-1]);
654 y0 = secY[j-1] + TMath::Abs(secR[j-1]) * SinD(secAngleEnd[j-1]);
655 x1 = secX[j+1] + TMath::Abs(secR[j+1]) * CosD(secAngleStart[j+1]);
656 y1 = secY[j+1] + TMath::Abs(secR[j+1]) * SinD(secAngleStart[j+1]);
657 t0 = TMath::Sqrt((x0-x1)*(x0-x1)+(y0-y1)*(y0-y1));
662 // get location of tube center->Surface for locating
663 // this sector around the beam pipe.
664 // This needs to be double checked, but I need my notes for that.
666 xAAtubeCenter0 = x0 + (x1 - x0) * t * 0.5;
667 yAAtubeCenter0 = y0 + (y1 - y0) * t * 0.5;
669 if(a + b*(a - x0) / (b - y0) > 0.0) {
670 secX[j] = a + TMath::Abs(y1-y0) * 2.0 * ksecDipRadii/t0;
671 secY[j] = b - TMath::Sign(2.0*ksecDipRadii,y1-y0) * (x1-x0)/t0;
672 secX2[j] = a + TMath::Abs(y1-y0) * ksecTl/t0;
673 secY2[j] = b - TMath::Sign(ksecTl,y1-y0) * (x1-x0) / t0;
674 secX3[j] = a + TMath::Abs(y1-y0) *
675 (2.0*ksecDipRadii-0.5*ksecCoolTubeFlatY)/t0;
676 secY3[j] = b - TMath::Sign(2.0*ksecDipRadii-0.5*ksecCoolTubeFlatY,
679 secX[j] = a - TMath::Abs(y1-y0)*2.0*ksecDipRadii/t0;
680 secY[j] = b + TMath::Sign(2.0*ksecDipRadii,y1-y0)*(x1-x0)/t0;
681 secX2[j] = a - TMath::Abs(y1-y0)*ksecTl/t0;
682 secY2[j] = b + TMath::Sign(ksecTl,y1-y0)*(x1-x0)/t0;
683 secX3[j] = a - TMath::Abs(y1-y0)*(2.0*ksecDipRadii-0.5*
684 ksecCoolTubeFlatY)/t0;
685 secY3[j] = b + TMath::Sign(2.0*ksecDipRadii-0.5*ksecCoolTubeFlatY,
687 } // end if(a+b*(a-x0)/(b-y0)>0.0)
689 // Set up Start and End angles to correspond to start/end of dips.
690 t1 = (secDip2[i]-TMath::Abs(secR[j])) / t0;
691 secAngleStart[j] =TMath::RadToDeg()*TMath::ATan2(y0+(y1-y0)*t1-secY[j],
692 x0+(x1-x0)*t1-secX[j]);
693 if (secAngleStart[j]<0.0) secAngleStart[j] += 360.0;
694 secAngleStart2[j] = secAngleStart[j];
695 t1 = (secDip2[i]+TMath::Abs(secR[j]))/t0;
696 secAngleEnd[j] = TMath::RadToDeg()*TMath::ATan2(y0+(y1-y0)*t1-secY[j],
697 x0+(x1-x0)*t1-secX[j]);
698 if (secAngleEnd[j]<0.0) secAngleEnd[j] += 360.0;
699 secAngleEnd2[j] = secAngleEnd[j];
700 if (secAngleEnd[j]>secAngleStart[j]) secAngleEnd[j] -= 360.0;
701 secR[j] = TMath::Sqrt(secR[j]*secR[j]+4.0*ksecDipRadii*ksecDipRadii);
705 secAngleStart2[8] -= 360.;
706 secAngleStart2[11] -= 360.;
708 SPDsectorShape(ksecNRadii, secX, secY, secR, secAngleStart, secAngleEnd,
709 ksecNPointsPerRadii, m, xp, yp);
711 // Fix up dips to be square.
712 for(i = 0; i < ksecNCoolingTubeDips; i++) {
714 t = 0.5*ksecDipLength+ksecDipRadii;
715 t0 = TMath::RadToDeg()*TMath::ATan(2.0*ksecDipRadii/t);
716 t1 = secAngleEnd[j] + t0;
717 t0 = secAngleStart[j] - t0;
718 x0 = xp[j][1] = secX[j] + t*CosD(t0);
719 y0 = yp[j][1] = secY[j] + t*SinD(t0);
720 x1 = xp[j][ksecNPointsPerRadii-1] = secX[j] + t*CosD(t1);
721 y1 = yp[j][ksecNPointsPerRadii-1] = secY[j] + t*SinD(t1);
722 t0 = 1./((Double_t)(ksecNPointsPerRadii-2));
723 for(k = 2; k < ksecNPointsPerRadii - 1; k++) {
724 // extra points spread them out.
725 t = ((Double_t)(k-1)) * t0;
726 xp[j][k] = x0+(x1-x0) * t;
727 yp[j][k] = y0+(y1-y0) * t;
729 secAngleTurbo[i] = -TMath::RadToDeg() * TMath::ATan2(y1-y0, x1-x0);
732 Form("i=%d -- angle=%f -- x0,y0=(%f, %f) -- x1,y1=(%f, %f)",
733 i, secAngleTurbo[i], x0, y0, x1, y1));
734 } // end if GetDebug(3)
736 sA0 = new TGeoXtru(2);
737 sA0->SetName("ITS SPD Carbon fiber support Sector A0");
738 sA0->DefinePolygon(m, xpp, ypp);
739 sA0->DefineSection(0, -ksecDz);
740 sA0->DefineSection(1, ksecDz);
742 // store the edges of each XY segment which defines
743 // one of the plane zones where staves will have to be placed
744 fSPDsectorX0.Set(ksecNCoolingTubeDips);
745 fSPDsectorY0.Set(ksecNCoolingTubeDips);
746 fSPDsectorX1.Set(ksecNCoolingTubeDips);
747 fSPDsectorY1.Set(ksecNCoolingTubeDips);
749 for(i = 0; i < ksecNCoolingTubeDips; i++) {
750 // Find index in xpp[] and ypp[] corresponding to where the
751 // SPD ladders are to be attached. Order them according to
752 // the ALICE numbering schema. Using array of indexes (+-1 for
753 // cooling tubes. For any "bend/dip/edge, there are
754 // ksecNPointsPerRadii+1 points involved.
756 else if (i == 1) j = 0;
758 ixy0 = (ksecDipIndex[j]-1)*(ksecNPointsPerRadii+1)+
759 (ksecNPointsPerRadii);
760 ixy1 = (ksecDipIndex[j]+1) * (ksecNPointsPerRadii+1);
761 fSPDsectorX0[i] = sA0->GetX(ixy0);
762 fSPDsectorY0[i] = sA0->GetY(ixy0);
763 fSPDsectorX1[i] = sA0->GetX(ixy1);
764 fSPDsectorY1[i] = sA0->GetY(ixy1);
767 //printf("SectorA#%d ",0);
768 InsidePoint(xpp[m-1],ypp[m-1],xpp[0],ypp[0],xpp[1],ypp[1],ksecCthick,
770 for(i = 1; i < m - 1; i++) {
771 j = i / (ksecNPointsPerRadii+1);
772 //printf("SectorA#%d ",i);
773 InsidePoint(xpp[i-1],ypp[i-1],xpp[i],ypp[i],xpp[i+1],ypp[i+1],
774 ksecCthick,xpp2[i],ypp2[i]);
776 //printf("SectorA#%d ",m);
777 InsidePoint(xpp[m-2],ypp[m-2],xpp[m-1],ypp[m-1],xpp[0],ypp[0],
778 ksecCthick,xpp2[m-1],ypp2[m-1]);
779 // Fix center value of cooling tube dip and
780 // find location of cooling tube centers
781 for(i = 0; i < ksecNCoolingTubeDips; i++) {
785 x1 = xp2[j][ksecNPointsPerRadii-1];
786 y1 = yp2[j][ksecNPointsPerRadii-1];
787 t0 = TMath::Sqrt((x0-x1)*(x0-x1)+(y0-y1)*(y0-y1));
789 for(k = 2; k < ksecNPointsPerRadii - 1; k++) {
790 // extra points spread them out.
791 t = ((Double_t)(k-1)) * t0;
792 xp2[j][k] = x0+(x1-x0) * t;
793 yp2[j][k] = y0+(y1-y0) * t;
796 sA1 = new TGeoXtru(2);
797 sA1->SetName("ITS SPD Carbon fiber support Sector Air A1");
798 sA1->DefinePolygon(m, xpp2, ypp2);
799 sA1->DefineSection(0, -ksecDz);
800 sA1->DefineSection(1, ksecDz);
802 // Error in TGeoEltu. Semi-axis X must be < Semi-axis Y (?).
803 sTA0 = new TGeoEltu("ITS SPD Cooling Tube TA0", 0.5 * ksecCoolTubeFlatY,
804 0.5 * ksecCoolTubeFlatX, ksecDz);
805 sTA1 = new TGeoEltu("ITS SPD Cooling Tube coolant TA1",
806 sTA0->GetA() - ksecCoolTubeThick,
807 sTA0->GetB()-ksecCoolTubeThick,ksecDz);
808 SPDsectorShape(ksecNRadii,secX2,secY2,secR2,secAngleStart2,secAngleEnd2,
809 ksecNPointsPerRadii, m, xp, yp);
810 sB0 = new TGeoXtru(2);
811 sB0->SetName("ITS SPD Carbon fiber support Sector End B0");
812 sB0->DefinePolygon(m, xpp, ypp);
813 sB0->DefineSection(0, ksecDz);
814 sB0->DefineSection(1, ksecDz + ksecZEndLen);
816 //printf("SectorB#%d ",0);
817 // Points around the most sharpened tips have to be avoided - M.S. 24 feb 09
818 const Int_t nSpecialPoints = 5;
819 const Int_t kSpecialPoints[nSpecialPoints] = {7, 17, 47, 62, 77};
821 InsidePoint(xpp[m-1],ypp[m-1],xpp[0],ypp[0],xpp[1],ypp[1],
822 ksecCthick2,xpp2[i2],ypp2[i2]);
823 for(i = 1; i < m - 1; i++) {
825 for(k = 0; k < ksecNCoolingTubeDips; k++)
826 if((i/(ksecNPointsPerRadii+1))==ksecDipIndex[k])
827 if(!(ksecDipIndex[k]*(ksecNPointsPerRadii+1) == i ||
828 ksecDipIndex[k]*(ksecNPointsPerRadii+1) +
829 ksecNPointsPerRadii == i))
830 t = ksecRCoolOut-ksecRCoolIn;
831 //printf("SectorB#%d ",i);
832 Bool_t useThisPoint = kTRUE;
833 for(Int_t ii = 0; ii < nSpecialPoints; ii++)
834 if ( (i == kSpecialPoints[ii] - 1) ||
835 (i == kSpecialPoints[ii] + 1) ) useThisPoint = kFALSE;
838 InsidePoint(xpp[i-1],ypp[i-1],xpp[i],ypp[i],xpp[i+1],ypp[i+1],t,
842 //printf("SectorB#%d ",m);
844 InsidePoint(xpp[m-2],ypp[m-2],xpp[m-1],ypp[m-1],xpp[0],ypp[0],
845 ksecCthick2,xpp2[i2],ypp2[i2]);
846 sB1 = new TGeoXtru(2);
847 sB1->SetName("ITS SPD Carbon fiber support Sector Air End B1");
848 sB1->DefinePolygon(i2+1, xpp2, ypp2);
849 sB1->DefineSection(0,sB0->GetZ(0));
850 sB1->DefineSection(1,sB0->GetZ(1)-ksecCthick2);
851 const Double_t kspdEndHoleRadius1=5.698*fgkmm;
852 const Double_t kspdEndHoleRadius2=2.336*fgkmm;
853 const Double_t kspdEndHoleDisplacement=6.29*fgkmm;
856 t= ((Double_t)i)/((Double_t)(k));
857 if(!CFHolePoints(t,kspdEndHoleRadius1,kspdEndHoleRadius2,
858 kspdEndHoleDisplacement,xpp2[i],ypp2[i])){
859 Warning("CarbonFiberSector","CFHolePoints failed "
860 "i=%d m=%d k=%d t=%e",i,m,k,t);
862 // simitry in each quadrant.
863 xpp2[2*k-i] = -xpp2[i];
864 ypp2[2*k-i] = ypp2[i];
865 xpp2[2*k+i] = -xpp2[i];
866 ypp2[2*k+i] = -ypp2[i];
867 xpp2[4*k-i] = xpp2[i];
868 ypp2[4*k-i] = -ypp2[i];
870 //xpp2[m-1] = xpp2[0]; // begining point in
871 //ypp2[m-1] = ypp2[0]; // comment with end point
872 sB2 = new TGeoXtru(2);
873 sB2->SetName("ITS SPD Hole in Carbon fiber support End plate");
874 sB2->DefinePolygon(4*k, xpp2, ypp2);
875 sB2->DefineSection(0,sB1->GetZ(1));
876 sB2->DefineSection(1,sB0->GetZ(1));
877 // SPD sector mount blocks
878 const Double_t kMountBlock[3] = {0.5*(1.8-0.2)*fgkmm,0.5*22.0*fgkmm,
880 sB3 = new TGeoBBox((Double_t*)kMountBlock);
881 // SPD sector cooling tubes
882 sTB0 = new TGeoTube("ITS SPD Cooling Tube End TB0", 0.0,
883 0.5*ksecCoolTubeROuter,0.5*(sB1->GetZ(1)-sB1->GetZ(0)));
884 sTB1 = new TGeoTube("ITS SPD Cooling Tube End coolant TB0", 0.0,
885 sTB0->GetRmax() - ksecCoolTubeThick,sTB0->GetDz());
888 if(medSPDcf) medSPDcf->Dump(); else AliInfo("medSPDcf = 0");
889 if(medSPDss) medSPDss->Dump(); else AliInfo("medSPDss = 0");
890 if(medSPDair) medSPDair->Dump(); else AliInfo("medSPDAir = 0");
891 if(medSPDcoolfl) medSPDcoolfl->Dump();else AliInfo("medSPDcoolfl = 0");
897 } // end if(GetDebug(3))
899 // create the assembly of the support and place staves on it
900 TGeoVolumeAssembly *vM0 = new TGeoVolumeAssembly(
901 "ITSSPDSensitiveVirtualvolumeM0");
903 // create other volumes with some graphical settings
904 TGeoVolume *vA0 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorA0",
906 vA0->SetVisibility(kTRUE);
907 vA0->SetLineColor(4); // Blue
908 vA0->SetLineWidth(1);
909 vA0->SetFillColor(vA0->GetLineColor());
910 vA0->SetFillStyle(4010); // 10% transparent
911 TGeoVolume *vA1 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorAirA1",
913 vA1->SetVisibility(kTRUE);
914 vA1->SetLineColor(7); // light Blue
915 vA1->SetLineWidth(1);
916 vA1->SetFillColor(vA1->GetLineColor());
917 vA1->SetFillStyle(4090); // 90% transparent
918 TGeoVolume *vTA0 = new TGeoVolume("ITSSPDCoolingTubeTA0", sTA0, medSPDss);
919 vTA0->SetVisibility(kTRUE);
920 vTA0->SetLineColor(15); // gray
921 vTA0->SetLineWidth(1);
922 vTA0->SetFillColor(vTA0->GetLineColor());
923 vTA0->SetFillStyle(4000); // 0% transparent
924 TGeoVolume *vTA1 = new TGeoVolume("ITSSPDCoolingTubeFluidTA1",
926 vTA1->SetVisibility(kTRUE);
927 vTA1->SetLineColor(6); // Purple
928 vTA1->SetLineWidth(1);
929 vTA1->SetFillColor(vTA1->GetLineColor());
930 vTA1->SetFillStyle(4000); // 0% transparent
931 TGeoVolume *vB0 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorEndB0",
933 vB0->SetVisibility(kTRUE);
934 vB0->SetLineColor(1); // Black
935 vB0->SetLineWidth(1);
936 vB0->SetFillColor(vB0->GetLineColor());
937 vB0->SetFillStyle(4000); // 0% transparent
938 TGeoVolume *vB1 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorEndAirB1",
940 vB1->SetVisibility(kTRUE);
941 vB1->SetLineColor(0); // white
942 vB1->SetLineWidth(1);
943 vB1->SetFillColor(vB1->GetLineColor());
944 vB1->SetFillStyle(4100); // 100% transparent
945 TGeoVolume *vB2 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorEndAirB2",
947 vB2->SetVisibility(kTRUE);
948 vB2->SetLineColor(0); // white
949 vB2->SetLineWidth(1);
950 vB2->SetFillColor(vB2->GetLineColor());
951 vB2->SetFillStyle(4100); // 100% transparent
952 TGeoVolume *vB3 = new TGeoVolume(
953 "ITSSPDCarbonFiberSupportSectorMountBlockB3",sB3, medSPDcf);
954 vB3->SetVisibility(kTRUE);
955 vB3->SetLineColor(1); // Black
956 vB3->SetLineWidth(1);
957 vB3->SetFillColor(vB3->GetLineColor());
958 vB3->SetFillStyle(4000); // 0% transparent
959 TGeoVolume *vTB0 = new TGeoVolume("ITSSPDCoolingTubeEndTB0",sTB0,medSPDss);
960 vTB0->SetVisibility(kTRUE);
961 vTB0->SetLineColor(15); // gray
962 vTB0->SetLineWidth(1);
963 vTB0->SetFillColor(vTB0->GetLineColor());
964 vTB0->SetFillStyle(4000); // 0% transparent
965 TGeoVolume *vTB1 = new TGeoVolume("ITSSPDCoolingTubeEndFluidTB1",sTB1,
967 vTB1->SetVisibility(kTRUE);
968 vTB1->SetLineColor(7); // light blue
969 vTB1->SetLineWidth(1);
970 vTB1->SetFillColor(vTB1->GetLineColor());
971 vTB1->SetFillStyle(4050); // 0% transparent
973 // add volumes to mother container passed as argument of this method
974 moth->AddNode(vM0,1,0); // Add virtual volume to mother
975 vA0->AddNode(vA1,1,0); // Put air inside carbon fiber.
976 vB0->AddNode(vB1,1,0); // Put air inside carbon fiber ends.
977 vB0->AddNode(vB2,1,0); // Put air wholes inside carbon fiber ends
978 vTA0->AddNode(vTA1,1,0); // Put cooling liquid indide tube middel.
979 vTB0->AddNode(vTB1,1,0); // Put cooling liquid inside tube end.
980 Double_t tubeEndLocal[3]={0.0,0.0,sTA0->GetDz()};
981 for(i = 0; i < ksecNCoolingTubeDips; i++) {
982 x0 = secX3[ksecDipIndex[i]];
983 y0 = secY3[ksecDipIndex[i]];
984 t = 90.0 - secAngleTurbo[i];
985 trans = new TGeoTranslation("",x0,y0,0.5*(sB1->GetZ(0)+sB1->GetZ(1)));
986 vB1->AddNode(vTB0, i+1, trans);
987 // Find location of tube ends for later use.
988 trans->LocalToMaster(tubeEndLocal,fTubeEndSector[0][0][i]);
989 rot = new TGeoRotation("", 0.0, 0.0, t);
990 rotrans = new TGeoCombiTrans("", x0, y0, 0.0, rot);
991 vM0->AddNode(vTA0, i+1, rotrans);
993 vM0->AddNode(vA0, 1, 0);
994 vM0->AddNode(vB0, 1, 0);
996 rot = new TGeoRotation("", 90., 0., 90., 90., 180., 0.);
997 vM0->AddNode(vB0,2,rot);
998 // Find location of tube ends for later use.
999 for(i=0;i<ksecNCoolingTubeDips;i++) rot->LocalToMaster(
1000 fTubeEndSector[0][0][i],fTubeEndSector[0][1][i]);
1002 t = -TMath::RadToDeg()*TMath::ATan2(
1003 sB0->GetX(0)-sB0->GetX(sB0->GetNvert()-1),
1004 sB0->GetY(0)-sB0->GetY(sB0->GetNvert()-1));
1005 rot = new TGeoRotation("",t,0.0,0.0);// z axis rotation
1006 x0 = 0.5*(sB0->GetX(0)+sB0->GetX(sB0->GetNvert()-1))+
1007 sB3->GetDX()*TMath::Cos(t*TMath::DegToRad());
1008 y0 = 0.5*(sB0->GetY(0)+sB0->GetY(sB0->GetNvert()-1))+
1009 sB3->GetDX()*TMath::Sin(t*TMath::DegToRad());
1010 z0 = sB0->GetZ(0)+sB3->GetDZ();
1011 rotrans = new TGeoCombiTrans("",x0,y0,z0,rot);
1012 vM0->AddNode(vB3,1,rotrans); // Put Mounting bracket on sector
1013 rotrans = new TGeoCombiTrans("",x0,y0,-z0,rot);
1014 vM0->AddNode(vB3,2,rotrans); // Put Mounting bracket on sector
1016 rot = new TGeoRotation("",t,0.0,0.0); // z axis rotation
1018 x0 = -0.5*(sB0->GetX(0)+sB0->GetX(sB0->GetNvert()-1))-3.5*
1019 sB3->GetDX()*TMath::Cos(t*TMath::DegToRad());
1020 y0 = 0.5*(sB0->GetY(0)+sB0->GetY(sB0->GetNvert()-1))-3.5*
1021 sB3->GetDX()*TMath::Sin(t*TMath::DegToRad());
1022 rotrans = new TGeoCombiTrans("",1.01*x0,y0,z0,rot);
1023 vM0->AddNode(vB3,3,rotrans); // Put Mounting bracket on sector
1024 rotrans = new TGeoCombiTrans("",1.01*x0,y0,-z0,rot);
1025 vM0->AddNode(vB3,4,rotrans); // Put Mounting bracket on sector
1038 } // end if(GetDebug(3))
1040 //______________________________________________________________________
1041 Bool_t AliITSv11GeometrySPD::CFHolePoints(Double_t s,Double_t r1,
1042 Double_t r2,Double_t l,Double_t &x,Double_t &y) const
1045 // Step along arck a distancs ds and compute boundry of
1046 // two holes (radius r1 and r2) a distance l apart (along
1049 // Double_t s fractional Distance along arcs [0-1]
1050 // where 0-> alpha=beta=0, 1-> alpha=90 degrees.
1051 // Double_t r1 radius at center circle
1052 // Double_t r2 radius of displaced circle
1053 // Double_t l Distance displaced circle is displaces (x-axis)
1055 // Double_t x x coordinate along double circle.
1056 // Double_t y y coordinate along double circle.
1058 // logical, kFALSE if an error
1060 Double_t alpha,beta;
1061 Double_t ac,bc,scb,sca,t,alphac,betac; // at intersection of two circles
1064 ac = r1*r1-l*l-r2*r2;
1066 if(bc==0.0) {printf("bc=0 l=%e r2=%e\n",l,r2);return kFALSE;}
1067 betac = TMath::ACos(ac/bc);
1068 alphac = TMath::Sqrt((bc-ac)*(bc+ac))/(2.*l*r1);
1071 t = r1*0.5*TMath::Pi() - sca + scb;
1074 x = r2*TMath::Cos(beta) + l;
1075 y = r2*TMath::Sin(beta);
1076 //printf("betac=%e scb=%e t=%e s=%e beta=%e x=%e y=%e\n",
1077 // betac,scb,t,s,beta,x,y);
1080 beta = (s*t-scb+sca)/(r1*0.5*TMath::Pi());
1081 alpha = beta*0.5*TMath::Pi();
1082 x = r1*TMath::Cos(alpha);
1083 y = r1*TMath::Sin(alpha);
1084 //printf("alphac=%e sca=%e t=%e s=%e beta=%e alpha=%e x=%e y=%e\n",
1085 // alphac,sca,t,s,beta,alpha,x,y);
1090 //______________________________________________________________________
1091 Bool_t AliITSv11GeometrySPD::GetSectorMountingPoints(Int_t index,Double_t &x0,
1092 Double_t &y0, Double_t &x1, Double_t &y1) const
1095 // Returns the edges of the straight borders in the SPD sector shape,
1096 // which are used to mount staves on them.
1097 // Coordinate system is that of the carbon fiber sector volume.
1099 // Index numbering is as follows:
1105 // Arguments [the ones passed by reference contain output values]:
1106 // Int_t index --> location index according to above scheme [0-5]
1107 // Double_t &x0 --> (by ref) x0 location or the ladder sector [cm]
1108 // Double_t &y0 --> (by ref) y0 location of the ladder sector [cm]
1109 // Double_t &x1 --> (by ref) x1 location or the ladder sector [cm]
1110 // Double_t &y1 --> (by ref) y1 location of the ladder sector [cm]
1111 // TGeoManager *mgr --> The TGeo builder
1113 // The location is described by a line going from (x0, y0) to (x1, y1)
1115 // Returns kTRUE if no problems encountered.
1116 // Returns kFALSE if a problem was encountered (e.g.: shape not found).
1118 Int_t isize = fSPDsectorX0.GetSize();
1120 x0 = x1 = y0 = y1 = 0.0;
1121 if(index < 0 || index > isize) {
1122 AliError(Form("index = %d: allowed 0 --> %d", index, isize));
1124 } // end if(index<0||index>isize)
1125 x0 = fSPDsectorX0[index];
1126 x1 = fSPDsectorX1[index];
1127 y0 = fSPDsectorY0[index];
1128 y1 = fSPDsectorY1[index];
1131 //______________________________________________________________________
1132 void AliITSv11GeometrySPD::SPDsectorShape(Int_t n,const Double_t *xc,
1133 const Double_t *yc, const Double_t *r,
1134 const Double_t *ths, const Double_t *the,
1135 Int_t npr, Int_t &m, Double_t **xp, Double_t **yp) const
1138 // Code to compute the points that make up the shape of the SPD
1139 // Carbon fiber support sections
1141 // Int_t n size of arrays xc,yc, and r.
1142 // Double_t *xc array of x values for radii centers.
1143 // Double_t *yc array of y values for radii centers.
1144 // Double_t *r array of signed radii values.
1145 // Double_t *ths array of starting angles [degrees].
1146 // Double_t *the array of ending angles [degrees].
1147 // Int_t npr the number of lines segments to aproximate the arc.
1148 // Outputs (arguments passed by reference):
1149 // Int_t m the number of enetries in the arrays *xp[npr+1]
1151 // Double_t **xp array of x coordinate values of the line segments
1152 // which make up the SPD support sector shape.
1153 // Double_t **yp array of y coordinate values of the line segments
1154 // which make up the SPD support sector shape.
1161 cout <<" X \t Y \t R \t S \t E" << m << endl;
1162 for(i = 0; i < n; i++) {
1163 cout << "{" << xc[i] << ", ";
1164 cout << yc[i] << ", ";
1165 cout << r[i] << ", ";
1166 cout << ths[i] << ", ";
1167 cout << the[i] << "}, " << endl;
1169 } // end if(GetDebug(2))
1170 if (GetDebug(3)) cout << "Double_t sA0 = [" << n*(npr+1)+1<<"][";
1171 if (GetDebug(4)) cout << "3] {";
1172 else if(GetDebug(3)) cout <<"2] {";
1174 for(i = 0; i < n; i++) {
1175 t1 = (the[i] - ths[i]) / t0;
1176 if(GetDebug(5)) cout << "t1 = " << t1 << endl;
1177 for(k = 0; k <= npr; k++) {
1178 t = ths[i] + ((Double_t)k) * t1;
1179 xp[i][k] = TMath::Abs(r[i]) * CosD(t) + xc[i];
1180 yp[i][k] = TMath::Abs(r[i]) * SinD(t) + yc[i];
1182 cout << "{" << xp[i][k] << "," << yp[i][k];
1183 if (GetDebug(4)) cout << "," << t;
1185 } // end if GetDebug
1187 if(GetDebug(3)) cout << endl;
1189 if(GetDebug(3)) cout << "{" << xp[0][0] << ", " << yp[0][0];
1190 if(GetDebug(4)) cout << "," << ths[0];
1191 if(GetDebug(3)) cout << "}}" << endl;
1194 //______________________________________________________________________
1195 TGeoVolume* AliITSv11GeometrySPD::CreateLadder(Int_t layer,TArrayD &sizes,
1196 TGeoManager *mgr) const
1199 // Creates the "ladder" = silicon sensor + 5 chips.
1200 // Returns a TGeoVolume containing the following components:
1201 // - the sensor (TGeoBBox), whose name depends on the layer
1202 // - 5 identical chips (TGeoBBox)
1203 // - a guard ring around the sensor (subtraction of TGeoBBoxes),
1204 // which is separated from the rest of sensor because it is not
1206 // - bump bondings (TGeoBBox stripes for the whole width of the
1207 // sensor, one per column).
1210 // 1 - the owner layer (MUST be 1 or 2 or a fatal error is raised)
1211 // 2 - a TArrayD passed by reference, which will contain relevant
1212 // dimensions related to this object:
1213 // size[0] = 'thickness' (the smallest dimension)
1214 // size[1] = 'length' (the direction along the ALICE Z axis)
1215 // size[2] = 'width' (extension in the direction perp. to the
1217 // 3 - the used TGeoManager
1219 // ** CRITICAL CHECK **
1220 // layer number can be ONLY 1 or 2
1221 if (layer != 1 && layer != 2) AliFatal("Layer number MUST be 1 or 2");
1224 TGeoMedium *medAir = GetMedium("AIR$",mgr);
1225 TGeoMedium *medSPDSiChip = GetMedium("SPD SI CHIP$",mgr); // SPD SI CHIP
1226 TGeoMedium *medSi = GetMedium("SI$",mgr);
1227 TGeoMedium *medBumpBond = GetMedium("COPPER$",mgr); // ??? BumpBond
1230 Double_t chipThickness = fgkmm * 0.150;
1231 Double_t chipWidth = fgkmm * 15.950;
1232 Double_t chipLength = fgkmm * 13.600;
1233 Double_t chipSpacing = fgkmm * 0.400; // separation of chips along Z
1234 Double_t sensThickness = fgkmm * 0.200;
1235 Double_t sensLength = fgkmm * 69.600;
1236 Double_t sensWidth = fgkmm * 12.800;
1237 Double_t guardRingWidth = fgkmm * 0.560; // a border of this thickness
1238 // all around the sensor
1239 Double_t bbLength = fgkmm * 0.042;
1240 Double_t bbWidth = sensWidth;
1241 Double_t bbThickness = fgkmm * 0.012;
1242 Double_t bbPos = 0.080; // Z position w.r. to left pixel edge
1243 // compute the size of the container volume which
1244 // will also be returned in the referenced TArrayD;
1245 // for readability, they are linked by reference to a more meaningful name
1247 Double_t &thickness = sizes[0];
1248 Double_t &length = sizes[1];
1249 Double_t &width = sizes[2];
1250 // the container is a box which exactly enclose all the stuff;
1252 length = sensLength + 2.0*guardRingWidth;
1253 thickness = sensThickness + chipThickness + bbThickness;
1256 // While creating this volume, since it is a sensitive volume,
1257 // we must respect some standard criteria for its local reference frame.
1258 // Local X must correspond to x coordinate of the sensitive volume:
1259 // this means that we are going to create the container with a local
1260 // reference system that is **not** in the middle of the box.
1261 // This is accomplished by calling the shape constructor with an
1262 // additional option ('originShift'):
1263 Double_t xSens = 0.5 * (width - sensWidth - 2.0*guardRingWidth);
1264 Double_t originShift[3] = {-xSens, 0., 0.};
1265 TGeoBBox *shapeContainer = new TGeoBBox(0.5*width,0.5*thickness,
1266 0.5*length,originShift);
1267 // then the volume is made of air, and using this shape
1268 TGeoVolume *container = new TGeoVolume(Form("ITSSPDlay%d-Ladder",layer),
1269 shapeContainer, medAir);
1270 // the chip is a common box
1271 TGeoVolume *volChip = mgr->MakeBox("ITSSPDchip",medSPDSiChip,
1272 0.5*chipWidth,0.5*chipThickness,0.5*chipLength);
1273 // the sensor as well
1274 TGeoVolume *volSens = mgr->MakeBox(GetSenstiveVolumeName(layer),medSi,
1275 0.5*sensWidth,0.5*sensThickness,0.5*sensLength);
1276 // the guard ring shape is the subtraction of two boxes with the
1278 TGeoBBox *shIn = new TGeoBBox(0.5*sensWidth,sensThickness,0.5*sensLength);
1279 TGeoBBox *shOut = new TGeoBBox(0.5*sensWidth+guardRingWidth,
1280 0.5*sensThickness,0.5*sensLength+guardRingWidth);
1281 shIn->SetName("ITSSPDinnerBox");
1282 shOut->SetName("ITSSPDouterBox");
1283 TGeoCompositeShape *shBorder = new TGeoCompositeShape(
1284 "ITSSPDgaurdRingBorder",Form("%s-%s",shOut->GetName(),shIn->GetName()));
1285 TGeoVolume *volBorder = new TGeoVolume("ITSSPDgaurdRing",shBorder,medSi);
1286 // bump bonds for one whole column
1287 TGeoVolume *volBB = mgr->MakeBox("ITSSPDbb",medBumpBond,0.5*bbWidth,
1288 0.5*bbThickness,0.5*bbLength);
1289 // set colors of all objects for visualization
1290 volSens->SetLineColor(kYellow + 1);
1291 volChip->SetLineColor(kGreen);
1292 volBorder->SetLineColor(kYellow + 3);
1293 volBB->SetLineColor(kGray);
1296 // sensor is translated along thickness (X) and width (Y)
1297 Double_t ySens = 0.5 * (thickness - sensThickness);
1298 Double_t zSens = 0.0;
1299 // we want that the x of the ladder is the same as the one of
1300 // its sensitive volume
1301 TGeoTranslation *trSens = new TGeoTranslation(0.0, ySens, zSens);
1302 // bump bonds are translated along all axes:
1303 // keep same Y used for sensors, but change the Z
1304 TGeoTranslation *trBB[160];
1306 Double_t y = 0.5 * (thickness - bbThickness) - sensThickness;
1307 Double_t z = -0.5 * sensLength + guardRingWidth + fgkmm*0.425 - bbPos;
1309 for (i = 0; i < 160; i++) {
1310 trBB[i] = new TGeoTranslation(x, y, z);
1312 case 31:case 63:case 95:case 127:
1313 z += fgkmm * 0.625 + fgkmm * 0.2;
1319 // the chips are translated along the length (Z) and thickness (X)
1320 TGeoTranslation *trChip[5] = {0, 0, 0, 0, 0};
1322 y = 0.5 * (chipThickness - thickness);
1324 for (i = 0; i < 5; i++) {
1325 z = -0.5*length + guardRingWidth
1326 + (Double_t)i*chipSpacing + ((Double_t)(i) + 0.5)*chipLength;
1327 trChip[i] = new TGeoTranslation(x, y, z);
1330 // add nodes to container
1331 container->AddNode(volSens, 1, trSens);
1332 container->AddNode(volBorder, 1, trSens);
1333 for (i = 0; i < 160; i++) container->AddNode(volBB,i+1,trBB[i]);
1334 for (i = 0; i < 5; i++) container->AddNode(volChip,i+3,trChip[i]);
1335 // return the container
1339 //______________________________________________________________________
1340 TGeoVolume* AliITSv11GeometrySPD::CreateClip(TArrayD &sizes,Bool_t isDummy,
1341 TGeoManager *mgr) const
1344 // Creates the carbon fiber clips which are added to the central ladders.
1345 // They have a complicated shape which is approximated by a TGeoXtru
1346 // Implementation of a single clip over an half-stave.
1347 // It has a complicated shape which is approximated to a section like this:
1352 // / 1\\___________________4
1353 // 0 \___________________
1355 // with a finite thickness for all the shape
1356 // Its local reference frame is such that point A corresponds to origin.
1358 Double_t fullLength = fgkmm * 12.6; // = x4 - x0
1359 Double_t flatLength = fgkmm * 5.4; // = x4 - x3
1360 Double_t inclLongLength = fgkmm * 5.0; // = 5-6
1361 Double_t inclShortLength = fgkmm * 2.0; // = 6-7
1362 Double_t fullHeight = fgkmm * 2.8; // = y6 - y3
1363 Double_t thickness = fgkmm * 0.18; // thickness
1364 Double_t totalLength = fgkmm * 52.0; // total length in Z
1365 Double_t holeSize = fgkmm * 5.0; // dimension of cubic
1366 // hole inserted for pt1000
1367 Double_t angle1 = 27.0; // supplementary of angle DCB
1368 Double_t angle2; // angle DCB
1369 Double_t angle3; // angle of GH with vertical
1371 angle2 = 0.5 * (180.0 - angle1);
1372 angle3 = 90.0 - TMath::ACos(fullLength - flatLength -
1373 inclLongLength*TMath::Cos(angle1)) *
1375 angle1 *= TMath::DegToRad();
1376 angle2 *= TMath::DegToRad();
1377 angle3 *= TMath::DegToRad();
1379 Double_t x[8], y[8];
1382 x[1] = x[0] + fullLength - flatLength - inclLongLength*TMath::Cos(angle1);
1383 x[2] = x[0] + fullLength - flatLength;
1384 x[3] = x[0] + fullLength;
1386 x[5] = x[4] - flatLength + thickness * TMath::Cos(angle2);
1391 y[1] = y[0] + inclShortLength * TMath::Cos(angle3);
1392 y[2] = y[1] - inclLongLength * TMath::Sin(angle1);
1394 y[4] = y[3] + thickness;
1396 y[6] = y[1] + thickness;
1397 y[7] = y[0] + thickness;
1400 sizes[0] = totalLength;
1401 sizes[1] = fullHeight;
1408 if(isDummy){// use this argument when on ewant just the
1409 // positions without create any volume
1413 TGeoXtru *shClip = new TGeoXtru(2);
1414 shClip->SetName("ITSSPDshclip");
1415 shClip->DefinePolygon(8, x, y);
1416 shClip->DefineSection(0, -0.5*totalLength, 0., 0., 1.0);
1417 shClip->DefineSection(1, 0.5*totalLength, 0., 0., 1.0);
1419 TGeoBBox *shHole = new TGeoBBox("ITSSPDSHClipHole",0.5*holeSize,
1420 0.5*holeSize,0.5*holeSize);
1421 TGeoTranslation *tr1 = new TGeoTranslation("ITSSPDTRClipHole1",x[2],0.0,
1423 TGeoTranslation *tr2 = new TGeoTranslation("ITSSPDTRClipHole2",x[2],0.0,
1425 TGeoTranslation *tr3 = new TGeoTranslation("ITSSPDTRClipHole3",x[2],0.0,
1427 tr1->RegisterYourself();
1428 tr2->RegisterYourself();
1429 tr3->RegisterYourself();
1431 //TString strExpr("ITSSPDshclip-(");
1432 TString strExpr(shClip->GetName());
1433 strExpr.Append("-(");
1434 strExpr.Append(Form("%s:%s+", shHole->GetName(), tr1->GetName()));
1435 strExpr.Append(Form("%s:%s+", shHole->GetName(), tr2->GetName()));
1436 strExpr.Append(Form("%s:%s)", shHole->GetName(), tr3->GetName()));
1437 TGeoCompositeShape *shClipHole = new TGeoCompositeShape(
1438 "ITSSPDSHClipHoles",strExpr.Data());
1440 TGeoMedium *mat = GetMedium("SPD C (M55J)$", mgr);
1441 TGeoVolume *vClip = new TGeoVolume("ITSSPDclip", shClipHole, mat);
1442 vClip->SetLineColor(kGray + 2);
1446 //______________________________________________________________________
1447 TGeoVolume* AliITSv11GeometrySPD::CreatePatchPanel(TArrayD &sizes,
1448 TGeoManager *mgr) const
1451 // Creates the patch panel approximated with a "L"-shaped TGeoXtru
1452 // with a finite thickness for all the shape
1453 // Its local reference frame is such that point A corresponds to origin.
1455 Double_t hLength = fgkmm * 50.0; // horizontal length
1456 Double_t vLength = fgkmm * 50.0; // vertical length
1457 Double_t angle = 88.3; // angle between hor and vert
1458 Double_t thickness = fgkmm * 4.0; // thickness
1459 Double_t width = fgkmm * 100.0; // width looking from cone
1461 Double_t x[7], y[7];
1464 y[1] = y[0] + hLength;
1466 y[3] = y[0] + thickness;
1467 y[4] = y[3] + vLength * TMath::Cos(angle*TMath::DegToRad());
1468 y[5] = y[4] - thickness / TMath::Sin(angle*TMath::DegToRad());
1473 x[2] = x[1] + thickness;
1475 x[4] = x[3] + vLength * TMath::Sin(angle*TMath::DegToRad());
1477 x[6] = x[0] + thickness;
1482 sizes[2] = thickness;
1484 TGeoXtru *shPatch = new TGeoXtru(2);
1485 shPatch->SetName("ITSSPDpatchShape1");
1486 shPatch->DefinePolygon(7, x, y);
1487 shPatch->DefineSection(0, -0.5*width, 0., 0., 1.0);
1488 shPatch->DefineSection(1, 0.5*width, 0., 0., 1.0);
1491 Double_t subThickness = 10.0 * fgkmm;
1492 Double_t subWidth = 55.0 * fgkmm;
1493 new TGeoBBox("ITSSPDpatchShape2", 0.5*subThickness, 60.0 * fgkmm, 0.5*subWidth);
1494 TGeoRotation *rotSub = new TGeoRotation(*gGeoIdentity);
1495 rotSub->SetName("shPatchSubRot");
1496 rotSub->RotateZ(50.0);
1497 rotSub->RegisterYourself();
1498 TGeoCombiTrans *trSub = new TGeoCombiTrans(0.26*hLength, 0.26*vLength, 0.0, rotSub);
1499 trSub->SetName("shPatchSubTr");
1500 trSub->RegisterYourself();
1502 TGeoCompositeShape *shPatchFinal = new TGeoCompositeShape("ITSSPDpatchShape1-(ITSSPDpatchShape2:shPatchSubTr)");
1505 TGeoMedium *mat = GetMedium("AL$", mgr);
1506 //TGeoVolume *vPatch = new TGeoVolume("ITSSPDpatchPanel", shPatchFinal, mat);
1507 TGeoVolume *vPatch = new TGeoVolume("ITSSPDpatchPanel", shPatch, mat);
1508 vPatch->SetLineColor(kAzure);
1513 //___________________________________________________________________
1514 TGeoCompositeShape* AliITSv11GeometrySPD::CreateGroundingFoilShape
1515 (Int_t itype,Double_t &length,Double_t &width,
1516 Double_t thickness,TArrayD &sizes)
1519 // Creates the typical composite shape of the grounding foil:
1521 // +---------------------------------------------------------+
1523 // | +-----------+ +------------+ 10
1525 // | 3 /-----+ 4 +------+
1532 // This shape is used 4 times: two layers of glue, one in kapton
1533 // and one in aluminum, taking into account that the aliminum
1534 // layer has small differences in the size of some parts.
1536 // In order to overcome problems apparently due to a large number
1537 // of points, the shape creation is done according the following
1539 // 1) a TGeoBBox is created with a size right enough to contain
1540 // the whole shape (0-1-X-13)
1541 // 2) holes are defined as other TGeoBBox which are subtracted
1542 // from the main shape
1543 // 3) a TGeoXtru is defined connecting the points (0-->11-->0)
1544 // and is also subtracted from the main shape
1546 // The argument ("type") is used to choose between all these
1548 // - type = 0 --> kapton layer
1549 // - type = 1 --> aluminum layer
1550 // - type = 2 --> glue layer between support and GF
1551 // - type = 3 --> glue layer between GF and ladders
1552 // Returns: a TGeoCompositeShape which will then be used to shape
1553 // several volumes. Since TGeoXtru is used, the local reference
1554 // frame of this object has X horizontal and Y vertical w.r to
1555 // the shape drawn above, and Z axis going perpendicularly to the screen.
1556 // This is not the correct reference for the half stave, for which
1557 // the "long" dimension is Z and the "short" is X, while Y goes in
1558 // the direction of thickness. This will imply some rotations when
1559 // using the volumes created with this shape.
1561 // suffix to differentiate names
1564 // size of the virtual box containing exactly this volume
1565 length = fgkmm * 243.18;
1566 width = fgkmm * 15.95;
1568 length -= fgkmm * 0.4;
1569 width -= fgkmm * 0.4;
1570 } // end if itype==1
1573 sprintf(type,"Kap");
1576 sprintf(type,"Alu");
1579 sprintf(type,"Glue1");
1582 sprintf(type,"Glue2");
1585 // we divide the shape in several slices along the horizontal
1586 // direction (local X) here we define define the length of all
1587 // sectors (from leftmost to rightmost)
1589 Double_t sliceLength[] = { 140.71, 2.48, 26.78, 4.00,
1590 10.00, 24.40, 10.00, 24.81 };
1591 for (i = 0; i < 8; i++) sliceLength[i] *= fgkmm;
1593 sliceLength[0] -= fgkmm * 0.2;
1594 sliceLength[4] -= fgkmm * 0.2;
1595 sliceLength[5] += fgkmm * 0.4;
1596 sliceLength[6] -= fgkmm * 0.4;
1597 } // end if itype ==1
1599 // as shown in the drawing, we have four different widths
1600 // (along local Y) in this shape:
1601 Double_t widthMax = fgkmm * 15.95;
1602 Double_t widthMed1 = fgkmm * 15.00;
1603 Double_t widthMed2 = fgkmm * 11.00;
1604 Double_t widthMin = fgkmm * 4.40;
1606 widthMax -= fgkmm * 0.4;
1607 widthMed1 -= fgkmm * 0.4;
1608 widthMed2 -= fgkmm * 0.4;
1609 widthMin -= fgkmm * 0.4;
1610 } // end if itype==1
1612 // create the main shape
1613 TGeoBBox *shGroundFull = 0;
1614 shGroundFull = new TGeoBBox(Form("ITSSPDSHgFoil%sFull", type),
1615 0.5*length,0.5*width, 0.5*thickness);
1617 // create the polygonal shape to be subtracted to give the correct
1618 // shape to the borders its vertices are defined in sugh a way that
1619 // this polygonal will be placed in the correct place considered
1620 // that the origin of the local reference frame is in the center
1621 // of the main box: we fix the starting point at the lower-left
1622 // edge of the shape (point 12), and add all points in order,
1623 // following a clockwise rotation
1625 Double_t x[13], y[13];
1626 x[ 0] = -0.5 * length + sliceLength[0];
1627 y[ 0] = -0.5 * widthMax;
1629 x[ 1] = x[0] + sliceLength[1];
1630 y[ 1] = y[0] + (widthMax - widthMed1);
1632 x[ 2] = x[1] + sliceLength[2];
1635 x[ 3] = x[2] + sliceLength[3];
1636 y[ 3] = y[2] + (widthMed1 - widthMed2);
1638 x[ 4] = x[3] + sliceLength[4];
1642 y[ 5] = y[4] + (widthMed2 - widthMin);
1644 x[ 6] = x[5] + sliceLength[5];
1650 x[ 8] = x[7] + sliceLength[6];
1656 x[10] = x[9] + sliceLength[7] + 0.5;
1666 TGeoXtru *shGroundXtru = new TGeoXtru(2);
1667 shGroundXtru->SetName(Form("ITSSPDSHgFoil%sXtru", type));
1668 shGroundXtru->DefinePolygon(13, x, y);
1669 shGroundXtru->DefineSection(0, -thickness, 0., 0., 1.0);
1670 shGroundXtru->DefineSection(1, thickness, 0., 0., 1.0);
1672 // define a string which will express the algebric operations among volumes
1673 // and add the subtraction of this shape from the main one
1674 TString strComposite(Form("ITSSPDSHgFoil%sFull-(%s+", type,
1675 shGroundXtru->GetName()));
1677 // define the holes according to size information coming from drawings:
1678 Double_t holeLength = fgkmm * 10.00;
1679 Double_t holeWidth = fgkmm * 7.50;
1680 Double_t holeSepX0 = fgkmm * 7.05; // separation between center
1681 // of first hole and left border
1682 Double_t holeSepXC = fgkmm * 14.00; // separation between the centers
1683 // of two consecutive holes
1684 Double_t holeSepX1 = fgkmm * 15.42; // separation between centers of
1686 Double_t holeSepX2 = fgkmm * 22.00; // separation between centers of
1687 // 10th and 11th hole
1689 holeSepX0 -= fgkmm * 0.2;
1690 holeLength += fgkmm * 0.4;
1691 holeWidth += fgkmm * 0.4;
1692 } // end if itype==1
1694 sizes[0] = holeLength;
1695 sizes[1] = holeWidth;
1696 sizes[2] = holeSepX0;
1697 sizes[3] = holeSepXC;
1698 sizes[4] = holeSepX1;
1699 sizes[5] = holeSepX2;
1700 sizes[6] = fgkmm * 4.40;
1702 // X position of hole center (will change for each hole)
1703 Double_t holeX = -0.5*length;
1704 // Y position of center of all holes (= 4.4 mm from upper border)
1705 Double_t holeY = 0.5*(width - holeWidth) - widthMin;
1707 // create a shape for the holes (common)
1708 TGeoBBox *shHole = 0;
1709 shHole = new TGeoBBox(Form("ITSSPD%sGfoilHole", type),0.5*holeLength,
1710 0.5*holeWidth, thickness);
1712 // insert the holes in the XTRU shape:
1713 // starting from the first value of X, they are simply
1714 // shifted along this axis
1716 TGeoTranslation *transHole[11];
1717 for (i = 0; i < 11; i++) {
1718 // set the position of the hole, depending on index
1729 } // end if else if's
1730 //cout << i << " --> X = " << holeX << endl;
1731 sprintf(name,"ITSSPDTRgFoil%sHole%d", type, i);
1732 transHole[i] = new TGeoTranslation(name, holeX, holeY, 0.0);
1733 transHole[i]->RegisterYourself();
1734 strComposite.Append(Form("ITSSPD%sGfoilHole:%s", type, name));
1735 if (i < 10) strComposite.Append("+"); else strComposite.Append(")");
1738 // create composite shape
1739 TGeoCompositeShape *shGround = new TGeoCompositeShape(
1740 Form("ITSSPDSHgFoil%s", type), strComposite.Data());
1744 //______________________________________________________________________
1745 TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateGroundingFoil(Bool_t isRight,
1746 TArrayD &sizes, TGeoManager *mgr)
1749 // Create a volume containing all parts of the grounding foil a
1750 // for a half-stave.
1751 // It consists of 4 layers with the same shape but different thickness:
1752 // 1) a layer of glue
1753 // 2) the aluminum layer
1754 // 3) the kapton layer
1755 // 4) another layer of glue
1758 // 1: a boolean value to know if it is the grounding foir for
1759 // the right or left side
1760 // 2: a TArrayD which will contain the dimension of the container box:
1761 // - size[0] = length along Z (the beam line direction)
1762 // - size[1] = the 'width' of the stave, which defines, together
1763 // with Z, the plane of the carbon fiber support
1764 // - size[2] = 'thickness' (= the direction along which all
1765 // stave components are superimposed)
1766 // 3: the TGeoManager
1768 // The return value is a TGeoBBox volume containing all grounding
1770 // to avoid strange behaviour of the geometry manager,
1771 // create a suffix to be used in the names of all shapes
1774 if (isRight) strcpy(suf, "R"); else strcpy(suf, "L");
1775 // this volume will be created in order to ease its placement in
1776 // the half-stave; then, it is added here the small distance of
1777 // the "central" edge of each volume from the Z=0 plane in the stave
1778 // reference (which coincides with ALICE one)
1779 Double_t dist = fgkmm * 0.71;
1782 TGeoMedium *medKap = GetMedium("SPD KAPTON(POLYCH2)$", mgr);
1783 TGeoMedium *medAlu = GetMedium("AL$", mgr);
1784 TGeoMedium *medGlue = GetMedium("EPOXY$", mgr); //??? GLUE_GF_SUPPORT
1786 // compute the volume shapes (thicknesses change from one to the other)
1787 Double_t kpLength, kpWidth, alLength, alWidth;
1788 TArrayD kpSize, alSize, glSize;
1789 Double_t kpThickness = fgkmm * 0.04;
1790 Double_t alThickness = fgkmm * 0.01;
1791 //cout << "AL THICKNESS" << alThickness << endl;
1792 //Double_t g0Thickness = fgkmm * 0.1175 - fgkGapHalfStave;
1793 //Double_t g1Thickness = fgkmm * 0.1175 - fgkGapLadder;
1794 Double_t g0Thickness = fgkmm * 0.1275 - fgkGapHalfStave;
1795 Double_t g1Thickness = fgkmm * 0.1275 - fgkGapLadder;
1796 TGeoCompositeShape *kpShape = CreateGroundingFoilShape(0,kpLength,kpWidth,
1797 kpThickness, kpSize);
1798 TGeoCompositeShape *alShape = CreateGroundingFoilShape(1,alLength,alWidth,
1799 alThickness, alSize);
1800 TGeoCompositeShape *g0Shape = CreateGroundingFoilShape(2,kpLength,kpWidth,
1801 g0Thickness, glSize);
1802 TGeoCompositeShape *g1Shape = CreateGroundingFoilShape(3,kpLength,kpWidth,
1803 g1Thickness, glSize);
1804 // create the component volumes and register their sizes in the
1805 // passed arrays for readability reasons, some reference variables
1806 // explicit the meaning of the array slots
1807 TGeoVolume *kpVol = new TGeoVolume(Form("ITSSPDgFoilKap%s",suf),
1809 TGeoVolume *alVol = new TGeoVolume(Form("ITSSPDgFoilAlu%s",suf),
1811 TGeoVolume *g0Vol = new TGeoVolume(Form("ITSSPDgFoilGlue%s",suf),
1813 TGeoVolume *g1Vol = new TGeoVolume(Form("ITSSPDgFoilGlue%s",suf),
1815 // set colors for the volumes
1816 kpVol->SetLineColor(kRed);
1817 alVol->SetLineColor(kGray);
1818 g0Vol->SetLineColor(kYellow);
1819 g1Vol->SetLineColor(kYellow);
1820 // create references for the final size object
1821 if (sizes.GetSize() != 3) sizes.Set(3);
1822 Double_t &fullThickness = sizes[0];
1823 Double_t &fullLength = sizes[1];
1824 Double_t &fullWidth = sizes[2];
1825 // kapton leads the larger dimensions of the foil
1826 // (including the cited small distance from Z=0 stave reference plane)
1827 // the thickness is the sum of the ones of all components
1828 fullLength = kpLength + dist;
1829 fullWidth = kpWidth;
1830 fullThickness = kpThickness + alThickness + g0Thickness + g1Thickness;
1831 // create the container
1832 // TGeoMedium *air = GetMedium("AIR$", mgr);
1833 TGeoVolumeAssembly *container = new TGeoVolumeAssembly(Form("ITSSPDgFOIL-%s",suf));
1834 // TGeoVolume *container = mgr->MakeBox(Form("ITSSPDgFOIL-%s",suf),
1835 // air, 0.5*fullThickness, 0.5*fullWidth, 0.5*fullLength);
1836 // create the common correction rotation (which depends of what side
1838 TGeoRotation *rotCorr = new TGeoRotation(*gGeoIdentity);
1839 if (isRight) rotCorr->RotateY(90.0);
1840 else rotCorr->RotateY(-90.0);
1841 // compute the translations, which are in the length and
1842 // thickness directions
1843 Double_t x, y, z, shift = 0.0;
1844 if (isRight) shift = dist;
1846 x = -0.5*(fullThickness - g0Thickness);
1847 z = 0.5*(fullLength - kpLength) - shift;
1848 TGeoCombiTrans *glTrans0 = new TGeoCombiTrans(x, 0.0, z, rotCorr);
1850 x += 0.5*(g0Thickness + kpThickness);
1851 TGeoCombiTrans *kpTrans = new TGeoCombiTrans(x, 0.0, z, rotCorr);
1853 x += 0.5*(kpThickness + alThickness);
1854 z = 0.5*(fullLength - alLength) - shift - 0.5*(kpLength - alLength);
1855 TGeoCombiTrans *alTrans = new TGeoCombiTrans(x, 0.0, z, rotCorr);
1857 x += 0.5*(alThickness + g1Thickness);
1858 z = 0.5*(fullLength - kpLength) - shift;
1859 TGeoCombiTrans *glTrans1 = new TGeoCombiTrans(x, 0.0, z, rotCorr);
1861 //cout << fgkGapHalfStave << endl;
1862 //cout << g0Thickness << endl;
1863 //cout << kpThickness << endl;
1864 //cout << alThickness << endl;
1865 //cout << g1Thickness << endl;
1868 container->SetLineColor(kMagenta-10);
1869 container->AddNode(kpVol, 1, kpTrans);
1870 container->AddNode(alVol, 1, alTrans);
1871 container->AddNode(g0Vol, 1, glTrans0);
1872 container->AddNode(g1Vol, 2, glTrans1);
1873 // to add the grease we remember the sizes of the holes, stored as
1874 // additional parameters in the kapton layer size:
1875 // - sizes[3] = hole length
1876 // - sizes[4] = hole width
1877 // - sizes[5] = position of first hole center
1878 // - sizes[6] = standard separation between holes
1879 // - sizes[7] = separation between 5th and 6th hole
1880 // - sizes[8] = separation between 10th and 11th hole
1881 // - sizes[9] = separation between the upper hole border and
1883 Double_t holeLength = kpSize[0];
1884 Double_t holeWidth = kpSize[1];
1885 Double_t holeFirstZ = kpSize[2];
1886 Double_t holeSepZ = kpSize[3];
1887 Double_t holeSep5th6th = kpSize[4];
1888 Double_t holeSep10th11th = kpSize[5];
1889 Double_t holeSepY = kpSize[6];
1891 // Grease has not been defined to date. Need much more information
1892 // no this material!
1893 TGeoMedium *grease = GetMedium("SPD KAPTON(POLYCH2)$", mgr); // ??? GREASE
1894 TGeoVolume *hVol = mgr->MakeBox("ITSSPDGrease", grease,
1895 0.5*fullThickness, 0.5*holeWidth, 0.5*holeLength);
1896 hVol->SetLineColor(kBlue);
1897 // displacement of volumes in the container
1898 Int_t idx = 1; // copy numbers start from 1.
1900 y = 0.5*(fullWidth - holeWidth) - holeSepY;
1901 if (isRight) z = holeFirstZ - 0.5*fullLength + dist;
1902 else z = 0.5*fullLength - holeFirstZ - dist;
1903 for (Int_t i = 0; i < 11; i++) {
1904 TGeoTranslation *t = 0;
1905 t = new TGeoTranslation(x, y, -z);
1906 container->AddNode(hVol, idx++, t);
1907 if (i < 4) shift = holeSepZ;
1908 else if (i == 4) shift = holeSep5th6th;
1909 else if (i < 9) shift = holeSepZ;
1910 else shift = holeSep10th11th;
1911 if (isRight) z += shift;
1916 //___________________________________________________________________
1917 TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateMCM(Bool_t isRight,
1918 TArrayD &sizes, TGeoManager *mgr) const
1921 // Create a TGeoAssembly containing all the components of the MCM.
1922 // The TGeoVolume container is rejected due to the possibility of overlaps
1923 // when placing this object on the carbon fiber sector.
1924 // The assembly contains:
1925 // - the thin part of the MCM (integrated circuit)
1926 // - the MCM chips (specifications from EDMS)
1927 // - the cap which covers the zone where chips are bound to MCM
1929 // The local reference frame of this assembly is defined in such a way
1930 // that all volumes are contained in a virtual box whose center
1931 // is placed exactly in the middle of the occupied space w.r to all
1932 // directions. This will ease the positioning of this object in the
1933 // half-stave. The sizes of this virtual box are stored in
1934 // the array passed by reference.
1937 // - a boolean flag to know if this is the "left" or "right" MCM, when
1938 // looking at the stave from above (i.e. the direction from which
1939 // one sees bus over ladders over grounding foil) and keeping the
1940 // continuous border in the upper part, one sees the thicker part
1941 // on the left or right.
1942 // - an array passed by reference which will contain the size of
1943 // the virtual container.
1944 // - a pointer to the used TGeoManager.
1947 // to distinguish the "left" and "right" objects, a suffix is created
1949 if (isRight) strcpy(suf, "R"); else strcpy(suf, "L");
1952 TGeoMedium *medBase = GetMedium("SPD KAPTON(POLYCH2)$",mgr);// ??? MCM BASE
1953 TGeoMedium *medChip = GetMedium("SPD SI CHIP$",mgr);
1954 TGeoMedium *medCap = GetMedium("AL$",mgr);
1956 // The shape of the MCM is divided into 3 sectors with different
1957 // widths (Y) and lengths (X), like in this sketch:
1960 // +---------------------+-----------------------------------+
1962 // | 6 sect 1 /-------------------+
1963 // | sect 0 /--------------/ 3
1964 // +--------------------/ 5
1967 // the inclination of all oblique borders (6-7, 4-5) is always 45 degrees.
1968 // From drawings we can parametrize the dimensions of all these sectors,
1969 // then the shape of this part of the MCM is implemented as a
1970 // TGeoXtru centerd in the virtual XY space.
1971 // The first step is definig the relevant sizes of this shape:
1973 Double_t mcmThickness = fgkmm * 0.35;
1974 Double_t sizeXtot = fgkmm * 105.6; // total distance (0-2)
1975 // resp. 7-8, 5-6 and 3-4
1976 Double_t sizeXsector[3] = {fgkmm * 28.4, fgkmm * 41.4, fgkmm * 28.8};
1977 // resp. 0-8, 1-6 and 2-3
1978 Double_t sizeYsector[3] = {fgkmm * 15.0, fgkmm * 11.0, fgkmm * 8.0};
1979 Double_t sizeSep01 = fgkmm * 4.0; // x(6)-x(7)
1980 Double_t sizeSep12 = fgkmm * 3.0; // x(4)-x(5)
1982 // define sizes of chips (last is the thickest)
1983 Double_t chipLength[5] = { 4.00, 6.15, 3.85, 5.60, 18.00 };
1984 Double_t chipWidth[5] = { 3.00, 4.10, 3.85, 5.60, 5.45 };
1985 Double_t chipThickness[5] = { 0.60, 0.30, 0.30, 1.00, 1.20 };
1987 name[0] = "ITSSPDanalog";
1988 name[1] = "ITSSPDpilot";
1989 name[2] = "ITSSPDgol";
1990 name[3] = "ITSSPDrx40";
1991 name[4] = "ITSSPDoptical";
1992 Color_t color[5] = { kCyan, kGreen, kYellow, kBlue, kOrange };
1994 // define the sizes of the cover
1995 Double_t capThickness = fgkmm * 0.3;
1996 Double_t capHeight = fgkmm * 1.7;
1998 // compute the total size of the virtual container box
2000 Double_t &thickness = sizes[0];
2001 Double_t &length = sizes[1];
2002 Double_t &width = sizes[2];
2004 width = sizeYsector[0];
2005 thickness = mcmThickness + capHeight;
2007 // define all the relevant vertices of the polygon
2008 // which defines the transverse shape of the MCM.
2009 // These values are used to several purposes, and
2010 // for each one, some points must be excluded
2011 Double_t xRef[9], yRef[9];
2012 xRef[0] = -0.5*sizeXtot;
2013 yRef[0] = 0.5*sizeYsector[0];
2014 xRef[1] = xRef[0] + sizeXsector[0] + sizeSep01;
2019 yRef[3] = yRef[2] - sizeYsector[2];
2020 xRef[4] = xRef[3] - sizeXsector[2];
2022 xRef[5] = xRef[4] - sizeSep12;
2023 yRef[5] = yRef[4] - sizeSep12;
2024 xRef[6] = xRef[5] - sizeXsector[1];
2026 xRef[7] = xRef[6] - sizeSep01;
2027 yRef[7] = yRef[6] - sizeSep01;
2031 // the above points are defined for the "right" MCM (if ve view the
2032 // stave from above) in order to change to the "left" one, we must
2033 // change the sign to all X values:
2034 if (isRight) for (i = 0; i < 9; i++) xRef[i] = -xRef[i];
2036 // the shape of the MCM and glue layer are done excluding point 1,
2037 // which is not necessary and cause the geometry builder to get confused
2039 Double_t xBase[8], yBase[8];
2040 for (i = 0; i < 9; i++) {
2041 if (i == 1) continue;
2047 // the MCM cover is superimposed over the zones 1 and 2 only
2048 Double_t xCap[6], yCap[6];
2050 for (i = 1; i <= 6; i++) {
2056 // define positions of chips,
2057 // which must be added to the bottom-left corner of MCM
2058 // and divided by 1E4;
2059 Double_t chipX[5], chipY[5];
2083 for (i = 0; i < 5; i++) {
2084 chipX[i] *= 0.00001;
2085 chipY[i] *= 0.00001;
2087 chipX[i] += xRef[3];
2088 chipY[i] += yRef[3];
2090 chipX[i] += xRef[8];
2091 chipY[i] += yRef[8];
2092 } // end for isRight
2093 chipLength[i] *= fgkmm;
2094 chipWidth[i] *= fgkmm;
2095 chipThickness[i] *= fgkmm;
2098 // create shapes for MCM
2100 TGeoXtru *shBase = new TGeoXtru(2);
2101 z1 = -0.5*thickness;
2102 z2 = z1 + mcmThickness;
2103 shBase->DefinePolygon(8, xBase, yBase);
2104 shBase->DefineSection(0, z1, 0., 0., 1.0);
2105 shBase->DefineSection(1, z2, 0., 0., 1.0);
2107 // create volumes of MCM
2108 TGeoVolume *volBase = new TGeoVolume("ITSSPDbase", shBase, medBase);
2109 volBase->SetLineColor(kRed);
2111 // to create the border of the MCM cover, it is required the
2112 // subtraction of two shapes the outer is created using the
2113 // reference points defined here
2114 TGeoXtru *shCapOut = new TGeoXtru(2);
2115 shCapOut->SetName(Form("ITSSPDshCAPOUT%s", suf));
2117 z2 = z1 + capHeight - capThickness;
2118 shCapOut->DefinePolygon(6, xCap, yCap);
2119 shCapOut->DefineSection(0, z1, 0., 0., 1.0);
2120 shCapOut->DefineSection(1, z2, 0., 0., 1.0);
2121 // the inner is built similarly but subtracting the thickness
2123 Double_t xin[6], yin[6];
2126 cs = TMath::Cos( 0.5*(TMath::Pi() - angle*TMath::DegToRad()) );
2127 xin[0] = xCap[0] + capThickness;
2128 yin[0] = yCap[0] - capThickness;
2129 xin[1] = xCap[1] - capThickness;
2132 yin[2] = yCap[2] + capThickness;
2133 xin[3] = xCap[3] - capThickness*cs;
2135 xin[4] = xin[3] - sizeSep12;
2136 yin[4] = yCap[4] + capThickness;
2141 cs = TMath::Cos( 0.5*(TMath::Pi() - angle*TMath::DegToRad()) );
2142 xin[0] = xCap[0] - capThickness;
2143 yin[0] = yCap[0] - capThickness;
2144 xin[1] = xCap[1] + capThickness;
2147 yin[2] = yCap[2] + capThickness;
2148 xin[3] = xCap[3] - capThickness*cs;
2150 xin[4] = xin[3] + sizeSep12;
2151 yin[4] = yCap[4] + capThickness;
2154 } // end if !isRight
2155 TGeoXtru *shCapIn = new TGeoXtru(2);
2156 shCapIn->SetName(Form("ITSSPDshCAPIN%s", suf));
2157 shCapIn->DefinePolygon(6, xin, yin);
2158 shCapIn->DefineSection(0, z1 - 0.01, 0., 0., 1.0);
2159 shCapIn->DefineSection(1, z2 + 0.01, 0., 0., 1.0);
2161 TGeoCompositeShape *shCapBorder = new TGeoCompositeShape(
2162 Form("ITSSPDshBORDER%s", suf),
2163 Form("%s-%s", shCapOut->GetName(),
2164 shCapIn->GetName()));
2166 TGeoVolume *volCapBorder = new TGeoVolume("ITSSPDcapBoarder",
2167 shCapBorder,medCap);
2168 volCapBorder->SetLineColor(kGreen);
2169 // finally, we create the top of the cover, which has the same
2170 // shape of outer border and a thickness equal of the one othe
2172 TGeoXtru *shCapTop = new TGeoXtru(2);
2174 z2 = z1 + capThickness;
2175 shCapTop->DefinePolygon(6, xCap, yCap);
2176 shCapTop->DefineSection(0, z1, 0., 0., 1.0);
2177 shCapTop->DefineSection(1, z2, 0., 0., 1.0);
2178 TGeoVolume *volCapTop = new TGeoVolume("ITSSPDcapTop", shCapTop, medCap);
2179 volCapTop->SetLineColor(kBlue);
2181 // create container assembly with right suffix
2182 TGeoVolumeAssembly *mcmAssembly = new TGeoVolumeAssembly(
2183 Form("ITSSPDmcm%s", suf));
2186 mcmAssembly->AddNode(volBase, 1, gGeoIdentity);
2188 for (i = 0; i < 5; i++) {
2189 TGeoVolume *box = gGeoManager->MakeBox(name[i],medChip,
2190 0.5*chipLength[i], 0.5*chipWidth[i], 0.5*chipThickness[i]);
2191 TGeoTranslation *tr = new TGeoTranslation(chipX[i],chipY[i],
2192 0.5*(-thickness + chipThickness[i]) + mcmThickness);
2193 box->SetLineColor(color[i]);
2194 mcmAssembly->AddNode(box, 1, tr);
2197 mcmAssembly->AddNode(volCapBorder, 1, gGeoIdentity);
2199 mcmAssembly->AddNode(volCapTop, 1, gGeoIdentity);
2204 //______________________________________________________________________
2205 TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
2206 (Bool_t isRight, Int_t ilayer, TArrayD &sizes, TGeoManager *mgr) const
2209 // The pixel bus is implemented as a TGeoBBox with some objects on it,
2210 // which could affect the particle energy loss.
2212 // In order to avoid confusion, the bus is directly displaced
2213 // according to the axis orientations which are used in the final stave:
2214 // X --> thickness direction
2215 // Y --> width direction
2216 // Z --> length direction
2219 // ** CRITICAL CHECK ******************************************************
2220 // layer number can be ONLY 1 or 2
2221 if (ilayer != 1 && ilayer != 2) AliFatal("Layer number MUST be 1 or 2");
2225 TGeoMedium *medBus = GetMedium("SPDBUS(AL+KPT+EPOX)$",mgr);
2226 TGeoMedium *medPt1000 = GetMedium("CERAMICS$",mgr); // ??? PT1000
2228 TGeoMedium *medCap = GetMedium("SDD X7R capacitors$",mgr);
2230 //TGeoMedium *medRes = GetMedium("SDD X7R capacitors$",mgr);
2231 TGeoMedium *medRes = GetMedium("ALUMINUM$",mgr);
2232 //TGeoMedium *medExt = GetMedium("SDDKAPTON (POLYCH2)$", mgr);
2233 TGeoMedium *medExt = GetMedium("SPD-MIX CU KAPTON$", mgr);
2234 // ** SIZES & POSITIONS **
2235 Double_t busLength = 170.501 * fgkmm; // length of plane part
2236 Double_t busWidth = 13.800 * fgkmm; // width
2237 Double_t busThickness = 0.280 * fgkmm; // thickness
2238 Double_t pt1000Length = fgkmm * 1.50;
2239 Double_t pt1000Width = fgkmm * 3.10;
2240 Double_t pt1000Thickness = fgkmm * 0.60;
2241 Double_t pt1000Y, pt1000Z[10];// position of the pt1000's along the bus
2242 Double_t capLength = fgkmm * 2.55;
2243 Double_t capWidth = fgkmm * 1.50;
2244 Double_t capThickness = fgkmm * 1.35;
2245 Double_t capY[2], capZ[2];
2247 Double_t resLength = fgkmm * 2.20;
2248 Double_t resWidth = fgkmm * 0.80;
2249 Double_t resThickness = fgkmm * 0.35;
2250 Double_t resY[2], resZ[2];
2252 Double_t extThickness = fgkmm * 0.25;
2253 Double_t ext1Length = fgkmm * (26.7 - 10.0);
2254 Double_t ext2Length = fgkmm * 284.0 - ext1Length + extThickness;
2255 Double_t extWidth = fgkmm * 11.0;
2256 Double_t extHeight = fgkmm * 2.5;
2258 // position of pt1000, resistors and capacitors depends on the
2259 // bus if it's left or right one
2262 pt1000Z[0] = 66160.;
2263 pt1000Z[1] = 206200.;
2264 pt1000Z[2] = 346200.;
2265 pt1000Z[3] = 486200.;
2266 pt1000Z[4] = 626200.;
2267 pt1000Z[5] = 776200.;
2268 pt1000Z[6] = 916200.;
2269 pt1000Z[7] = 1056200.;
2270 pt1000Z[8] = 1196200.;
2271 pt1000Z[9] = 1336200.;
2282 pt1000Z[0] = 319700.;
2283 pt1000Z[1] = 459700.;
2284 pt1000Z[2] = 599700.;
2285 pt1000Z[3] = 739700.;
2286 pt1000Z[4] = 879700.;
2287 pt1000Z[5] = 1029700.;
2288 pt1000Z[6] = 1169700.;
2289 pt1000Z[7] = 1309700.;
2290 pt1000Z[8] = 1449700.;
2291 pt1000Z[9] = 1589700.;
2302 pt1000Y *= 1E-4 * fgkmm;
2303 for (i = 0; i < 10; i++) {
2304 pt1000Z[i] *= 1E-4 * fgkmm;
2306 capZ[i] *= 1E-4 * fgkmm;
2307 capY[i] *= 1E-4 * fgkmm;
2308 resZ[i] *= 1E-4 * fgkmm;
2309 resY[i] *= 1E-4 * fgkmm;
2313 Double_t &fullLength = sizes[1];
2314 Double_t &fullWidth = sizes[2];
2315 Double_t &fullThickness = sizes[0];
2316 fullLength = busLength;
2317 fullWidth = busWidth;
2318 // add the thickness of the thickest component on bus (capacity)
2319 fullThickness = busThickness + capThickness;
2322 TGeoVolumeAssembly *container = new TGeoVolumeAssembly("ITSSPDpixelBus");
2323 TGeoVolume *bus = mgr->MakeBox("ITSSPDbus", medBus, 0.5*busThickness,
2324 0.5*busWidth, 0.5*busLength);
2325 TGeoVolume *pt1000 = mgr->MakeBox("ITSSPDpt1000",medPt1000,
2326 0.5*pt1000Thickness,0.5*pt1000Width, 0.5*pt1000Length);
2327 TGeoVolume *res = mgr->MakeBox("ITSSPDresistor", medRes, 0.5*resThickness,
2328 0.5*resWidth, 0.5*resLength);
2329 TGeoVolume *cap = mgr->MakeBox("ITSSPDcapacitor", medCap, 0.5*capThickness,
2330 0.5*capWidth, 0.5*capLength);
2332 TGeoVolume *ext1 = mgr->MakeBox("Extender1", medExt, 0.5*extThickness, 0.5*extWidth, 0.5*ext1Length);
2333 TGeoVolume *ext2 = mgr->MakeBox("Extender2", medExt, 0.5*extHeight - 2.*extThickness, 0.5*extWidth, 0.5*extThickness);
2334 TGeoVolume *ext3 = mgr->MakeBox("Extender3", medExt, 0.5*extThickness, 0.5*(extWidth-0.8*fgkmm), 0.5*ext2Length + extThickness); // Hardcode fix of a small overlap
2335 bus->SetLineColor(kYellow + 2);
2336 pt1000->SetLineColor(kGreen + 3);
2337 res->SetLineColor(kRed + 1);
2338 cap->SetLineColor(kBlue - 7);
2339 ext1->SetLineColor(kGray);
2340 ext2->SetLineColor(kGray);
2341 ext3->SetLineColor(kGray);
2343 // ** MOVEMENTS AND POSITIONEMENT **
2345 TGeoTranslation *trBus = new TGeoTranslation(0.5 * (busThickness -
2346 fullThickness), 0.0, 0.0);
2347 container->AddNode(bus, 1, trBus);
2348 Double_t zRef, yRef, x, y, z;
2350 zRef = -0.5*fullLength;
2351 yRef = -0.5*fullWidth;
2353 zRef = -0.5*fullLength;
2354 yRef = -0.5*fullWidth;
2357 x = 0.5*(pt1000Thickness - fullThickness) + busThickness;
2358 for (i = 0; i < 10; i++) {
2360 z = zRef + pt1000Z[i];
2361 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2362 container->AddNode(pt1000, i+1, tr);
2365 x = 0.5*(capThickness - fullThickness) + busThickness;
2366 for (i = 0; i < 2; i++) {
2369 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2370 container->AddNode(cap, i+1, tr);
2373 x = 0.5*(resThickness - fullThickness) + busThickness;
2374 for (i = 0; i < 2; i++) {
2377 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2378 container->AddNode(res, i+1, tr);
2384 y = 0.5 * (fullWidth - extWidth) - 0.1;
2385 z = 0.5 * (-fullLength + fgkmm * 10.0);
2388 y = 0.5 * (fullWidth - extWidth) - 0.1;
2389 z = 0.5 * ( fullLength - fgkmm * 10.0);
2394 y = -0.5 * (fullWidth - extWidth);
2395 z = 0.5 * (-fullLength + fgkmm * 10.0);
2398 y = -0.5 * (fullWidth - extWidth);
2399 z = 0.5 * ( fullLength - fgkmm * 10.0);
2402 x = 0.5 * (extThickness - fullThickness) + busThickness;
2403 //y = 0.5 * (fullWidth - extWidth);
2404 TGeoTranslation *trExt1 = new TGeoTranslation(x, y, z);
2406 z -= 0.5 * (ext1Length - extThickness);
2409 z += 0.5 * (ext1Length - extThickness);
2411 x += 0.5*(extHeight - 3.*extThickness);
2412 TGeoTranslation *trExt2 = new TGeoTranslation(x, y, z);
2414 z -= 0.5 * (ext2Length - extThickness) + 2.5*extThickness;
2417 z += 0.5 * (ext2Length - extThickness) + 2.5*extThickness;
2419 x += 0.5*(extHeight - extThickness) - 2.*extThickness;
2420 TGeoTranslation *trExt3 = new TGeoTranslation(x, y, z);
2421 container->AddNode(ext1, 0, trExt1);
2422 container->AddNode(ext2, 0, trExt2);
2423 container->AddNode(ext3, 0, trExt3);
2425 sizes[3] = yRef + pt1000Y;
2426 sizes[4] = zRef + pt1000Z[2];
2427 sizes[5] = zRef + pt1000Z[7];
2432 //______________________________________________________________________
2433 TList* AliITSv11GeometrySPD::CreateConeModule(Bool_t sideC, const Double_t angrot,
2434 TGeoManager *mgr) const
2437 // Creates all services modules and places them in a TList
2438 // angrot is the rotation angle (passed as an argument to avoid
2439 // defining the same quantity in two different places)
2441 // Created: ?? ??? 2008 A. Pulvirenti
2442 // Updated: 03 May 2010 M. Sitta
2443 // Updated: 20 Jun 2010 A. Pulvirenti Optical patch panels
2444 // Updated: 22 Jun 2010 M. Sitta Fiber cables
2445 // Updated: 04 Jul 2010 M. Sitta Water cooling
2446 // Updated: 08 Jul 2010 A. Pulvirenti Air cooling on Side C
2449 TGeoMedium *medInox = GetMedium("INOX$",mgr);
2450 //TGeoMedium *medExt = GetMedium("SDDKAPTON (POLYCH2)$", mgr);
2451 TGeoMedium *medExtB = GetMedium("SPD-BUS CU KAPTON$", mgr);
2452 TGeoMedium *medExtM = GetMedium("SPD-MCM CU KAPTON$", mgr);
2453 TGeoMedium *medPlate = GetMedium("SPD C (M55J)$", mgr);
2454 TGeoMedium *medFreon = GetMedium("Freon$", mgr);
2455 TGeoMedium *medGas = GetMedium("GASEOUS FREON$", mgr);
2456 TGeoMedium *medFibs = GetMedium("SDD OPTICFIB$",mgr);
2457 TGeoMedium *medCopper= GetMedium("COPPER$",mgr);
2458 TGeoMedium *medPVC = GetMedium("PVC$",mgr);
2460 Double_t extThickness = fgkmm * 0.25;
2461 Double_t ext1Length = fgkmm * (26.7 - 10.0);
2462 // Double_t ext2Length = fgkmm * (285.0 - ext1Length + extThickness);
2463 Double_t ext2Length = fgkmm * 285.0 - ext1Length + extThickness;
2465 const Double_t kCableThickness = 1.5 *fgkmm;
2466 Double_t cableL1 = 340.0 * fgkmm - extThickness - ext1Length - ext2Length;
2467 Double_t cableL2 = 300.0 * fgkmm;
2468 //Double_t cableL3 = 570.0 * fgkmm;
2469 Double_t cableL3 = 57.0 * fgkmm;
2470 Double_t cableW1 = 11.0 * fgkmm;
2471 Double_t cableW2 = 30.0 * fgkmm;
2472 Double_t cableW3 = 50.0 * fgkmm;
2474 const Double_t kMCMLength = cableL1 + cableL2 + cableL3;
2475 const Double_t kMCMWidth = cableW1;
2476 const Double_t kMCMThickness = 1.2 *fgkmm;
2478 const Double_t kPlateLength = 200.0 *fgkmm;
2479 const Double_t kPlateWidth = 50.0 *fgkmm;
2480 const Double_t kPlateThickness = 5.0 *fgkmm;
2482 const Double_t kConeTubeRmin = 2.0 *fgkmm;
2483 const Double_t kConeTubeRmax = 3.0 *fgkmm;
2485 const Double_t kHorizTubeLen = 150.0 *fgkmm;
2486 const Double_t kYtoHalfStave = 7.3 *fgkmm;
2488 const Double_t kWaterCoolRMax = 2.6 *fgkmm;
2489 const Double_t kWaterCoolThick = 0.04 *fgkmm;
2490 const Double_t kWaterCoolLen = 250.0 *fgkmm;
2491 const Double_t kWCPlateThick = 0.5 *fgkmm;
2492 const Double_t kWCPlateWide = 33.0 *fgkmm;
2493 const Double_t kWCPlateLen = 230.0 *fgkmm;
2494 const Double_t kWCFittingRext1 = 2.4 *fgkmm;
2495 const Double_t kWCFittingRext2 = 3.7 *fgkmm;
2496 const Double_t kWCFittingRint1 = 1.9 *fgkmm;
2497 const Double_t kWCFittingRint2 = kWaterCoolRMax;
2498 const Double_t kWCFittingLen1 = 7.0 *fgkmm;
2499 const Double_t kWCFittingLen2 = 8.0 *fgkmm;
2501 const Double_t kCollWidth = 40.0 *fgkmm;
2502 const Double_t kCollLength = 60.0 *fgkmm;
2503 const Double_t kCollThickness = 10.0 *fgkmm;
2504 const Double_t kCollTubeThick = 1.0 *fgkmm;
2505 const Double_t kCollTubeRadius = 7.0 *fgkmm;
2506 const Double_t kCollTubeLength = 190.0 *fgkmm;
2508 const Double_t kOptFibDiamet = 4.5 *fgkmm;
2510 Double_t x[12], y[12];
2511 Double_t xloc, yloc, zloc;
2513 Int_t kPurple = 6; // Purple (Root does not define it)
2515 TGeoVolumeAssembly* container[5];
2516 container[0] = new TGeoVolumeAssembly("ITSSPDConeModule");
2517 container[1] = new TGeoVolumeAssembly("ITSSPDCoolingModuleSideA");
2518 container[2] = new TGeoVolumeAssembly("ITSSPDCoolingModuleSideC");
2519 container[3] = new TGeoVolumeAssembly("ITSSPDPatchPanelModule");
2520 container[4] = new TGeoVolumeAssembly("ITSSPDWaterCooling");
2522 // The extender on the cone as a Xtru
2524 y[0] = 0.0 + 0.5 * cableW1;
2526 x[1] = x[0] + cableL1 - 0.5*(cableW2 - cableW1);
2529 x[2] = x[0] + cableL1;
2530 y[2] = y[1] + 0.5*(cableW2 - cableW1);
2532 x[3] = x[2] + cableL2;
2535 x[4] = x[3] + 0.5*(cableW3 - cableW2);
2536 y[4] = y[3] + 0.5*(cableW3 - cableW2);
2538 x[5] = x[4] + cableL3 - 0.5*(cableW3 - cableW2);
2541 for (Int_t i = 6; i < 12; i++) {
2546 TGeoXtru *shCable = new TGeoXtru(2);
2547 shCable->DefinePolygon(12, x, y);
2548 shCable->DefineSection(0, 0.0);
2549 shCable->DefineSection(1, kCableThickness);
2551 TGeoVolume *volCable = new TGeoVolume("ITSSPDExtender", shCable, medExtB);
2552 volCable->SetLineColor(kGreen);
2554 // The MCM extender on the cone as a Xtru
2555 TGeoBBox *shMCMExt = new TGeoBBox(0.5*kMCMLength,
2559 TGeoVolume *volMCMExt = new TGeoVolume("ITSSPDExtenderMCM",
2561 volMCMExt->SetLineColor(kGreen+3);
2563 // The support plate on the cone as a composite shape
2564 Double_t thickness = kCableThickness + kMCMThickness;
2565 TGeoBBox *shOut = new TGeoBBox("ITSSPD_shape_plateout",
2568 0.5*kPlateThickness);
2569 TGeoBBox *shIn = new TGeoBBox("ITSSPD_shape_platein" ,
2574 sprintf(string, "%s-%s", shOut->GetName(), shIn->GetName());
2575 TGeoCompositeShape *shPlate = new TGeoCompositeShape("ITSSPDPlate_shape",
2578 TGeoVolume *volPlate = new TGeoVolume("ITSSPDPlate",
2580 volPlate->SetLineColor(kRed);
2582 // The air cooling tubes
2583 TGeoBBox *shCollBox = new TGeoBBox("ITSSPD_shape_collector_box", 0.5*kCollLength, 0.5*kCollWidth, 0.5*kCollThickness);
2584 TGeoTube *shCollTube = new TGeoTube("ITSSPD_shape_collector_tube",kCollTubeRadius - kCollTubeThick, kCollTubeRadius, 0.5*kCollTubeLength);
2585 TGeoVolume *volCollBox = new TGeoVolume("ITSSPDCollectorBox", shCollBox, medPVC);
2586 TGeoVolume *volCollTube = new TGeoVolume("ITSSPDCollectorTube", shCollTube, medPVC);
2587 volCollBox->SetLineColor(kAzure);
2588 volCollTube->SetLineColor(kAzure);
2590 // The cooling tube on the cone as a Ctub
2591 Double_t tubeLength = shCable->GetX(5) - shCable->GetX(0) + kYtoHalfStave;
2592 TGeoCtub *shTube = new TGeoCtub(0, kConeTubeRmax, 0.5*tubeLength, 0, 360,
2593 0, SinD(angrot/2), -CosD(angrot/2),
2596 TGeoVolume *volTubeA = new TGeoVolume("ITSSPDCoolingTubeOnConeA",
2598 volTubeA->SetLineColor(kGray);
2600 TGeoVolume *volTubeC = new TGeoVolume("ITSSPDCoolingTubeOnConeC",
2602 volTubeC->SetLineColor(kGray);
2604 // The freon in the cooling tubes on the cone as a Ctub
2605 TGeoCtub *shFreon = new TGeoCtub(0, kConeTubeRmin, 0.5*tubeLength, 0, 360,
2606 0, SinD(angrot/2), -CosD(angrot/2),
2609 TGeoVolume *volFreon = new TGeoVolume("ITSSPDCoolingFreonOnCone",
2611 volFreon->SetLineColor(kPurple);
2613 TGeoVolume *volGasFr = new TGeoVolume("ITSSPDCoolingFreonGasOnCone",
2615 volGasFr->SetLineColor(kPurple);
2617 // The cooling tube inside the cylinder as a Ctub
2618 TGeoCtub *shCylTub = new TGeoCtub(0, kConeTubeRmax,
2619 0.5*kHorizTubeLen, 0, 360,
2621 0, SinD(angrot/2), CosD(angrot/2));
2623 TGeoVolume *volCylTubA = new TGeoVolume("ITSSPDCoolingTubeOnCylA",
2625 volCylTubA->SetLineColor(kGray);
2627 TGeoVolume *volCylTubC = new TGeoVolume("ITSSPDCoolingTubeOnCylC",
2629 volCylTubC->SetLineColor(kGray);
2631 // The freon in the cooling tubes in the cylinder as a Ctub
2632 TGeoCtub *shCylFr = new TGeoCtub(0, kConeTubeRmin,
2633 0.5*kHorizTubeLen, 0, 360,
2635 0, SinD(angrot/2), CosD(angrot/2));
2637 TGeoVolume *volCylFr = new TGeoVolume("ITSSPDCoolingFreonOnCyl",
2639 volCylFr->SetLineColor(kPurple);
2641 TGeoVolume *volCylGasFr = new TGeoVolume("ITSSPDCoolingFreonGasOnCyl",
2643 volCylGasFr->SetLineColor(kPurple);
2645 // The optical fibers bundle on the cone as a Tube
2646 Double_t optLength = shCable->GetX(5) - shCable->GetX(0) + kYtoHalfStave;
2647 TGeoTube *shOptFibs = new TGeoTube(0., 0.5*kOptFibDiamet, 0.5*optLength);
2649 TGeoVolume *volOptFibs = new TGeoVolume("ITSSPDOpticalFibersOnCone",
2650 shOptFibs, medFibs);
2651 volOptFibs->SetLineColor(kOrange);
2653 // The optical patch panels
2655 TGeoVolume *volPatch = CreatePatchPanel(psizes, mgr);
2657 // The water cooling tube as a Tube
2658 TGeoTube *shWatCool = new TGeoTube(kWaterCoolRMax-kWaterCoolThick,
2659 kWaterCoolRMax, kWaterCoolLen/2);
2661 TGeoVolume *volWatCool = new TGeoVolume("ITSSPDWaterCoolingOnCone",
2662 shWatCool, medInox);
2663 volWatCool->SetLineColor(kGray);
2665 // The support plate for the water tubes: a Tubs and a BBox
2666 TGeoTubeSeg *shWCPltT = new TGeoTubeSeg(kWaterCoolRMax,
2667 kWaterCoolRMax+kWCPlateThick,
2668 kWCPlateLen/2, 180., 360.);
2670 Double_t plateBoxWide = (kWCPlateWide - 2*kWaterCoolRMax)/2;
2671 TGeoBBox *shWCPltB = new TGeoBBox(plateBoxWide/2,
2675 TGeoVolume *volWCPltT = new TGeoVolume("ITSSPDWaterCoolingTubsPlate",
2676 shWCPltT, medPlate);
2677 volWCPltT->SetLineColor(kRed);
2679 TGeoVolume *volWCPltB = new TGeoVolume("ITSSPDWaterCoolingBoxPlate",
2680 shWCPltB, medPlate);
2681 volWCPltB->SetLineColor(kRed);
2683 // The fitting for the water cooling tube: a Pcon
2684 TGeoPcon *shFitt = new TGeoPcon(0., 360., 4);
2685 shFitt->Z(0) = -kWCFittingLen1;
2686 shFitt->Rmin(0) = kWCFittingRint1;
2687 shFitt->Rmax(0) = kWCFittingRext1;
2690 shFitt->Rmin(1) = kWCFittingRint1;
2691 shFitt->Rmax(1) = kWCFittingRext1;
2694 shFitt->Rmin(2) = kWCFittingRint2;
2695 shFitt->Rmax(2) = kWCFittingRext2;
2697 shFitt->Z(3) = kWCFittingLen2;
2698 shFitt->Rmin(3) = kWCFittingRint2;
2699 shFitt->Rmax(3) = kWCFittingRext2;
2701 TGeoVolume *volFitt = new TGeoVolume("ITSSPDWaterCoolingFitting",
2703 volFitt->SetLineColor(kOrange);
2705 // Now place everything in the containers
2706 volTubeA->AddNode(volGasFr, 1, 0);
2707 volTubeC->AddNode(volFreon, 1, 0);
2709 volCylTubA->AddNode(volCylGasFr, 1, 0);
2710 volCylTubC->AddNode(volCylFr , 1, 0);
2712 container[0]->AddNode(volCable, 1, 0);
2714 xloc = shMCMExt->GetDX();
2715 zloc = shMCMExt->GetDZ();
2716 container[0]->AddNode(volMCMExt, 1,
2717 new TGeoTranslation( xloc, 0.,-zloc));
2719 xloc = shMCMExt->GetDX();
2720 zloc = shCable->GetZ(1)/2 - shMCMExt->GetDZ();
2721 container[0]->AddNode(volPlate, 1,
2722 new TGeoTranslation( xloc, 0., zloc));
2724 TGeoRotation *rot2 = new TGeoRotation(*gGeoIdentity);
2725 rot2->SetName("rotPatch");
2726 rot2->RotateX(90.0);
2727 rot2->RotateY(163.0);
2728 //rot2->RotateZ(132.5);
2730 // add collectors only on side C
2733 TGeoTranslation *trCollBox = new TGeoTranslation(xloc - 0.5*kPlateLength + 0.5*kCollLength, 0.0, +0.5*(kPlateThickness+1.1*kCollThickness));
2734 TGeoRotation *rotCollTube = new TGeoRotation(*gGeoIdentity);
2735 rotCollTube->RotateY(90.0);
2736 TGeoCombiTrans *trCollTube = new TGeoCombiTrans(xloc + 0.5*kCollTubeLength - (0.5*kPlateLength - kCollLength), 0.0, +0.5*(kPlateThickness+2.0*kCollTubeRadius+kCollTubeThick), rotCollTube);
2737 container[0]->AddNode(volCollBox, 1, trCollBox);
2738 container[0]->AddNode(volCollTube, 1, trCollTube);
2741 Double_t dxPatch = 2.9;
2742 Double_t dzPatch = 2.8;
2743 TGeoCombiTrans *tr2 = new TGeoCombiTrans(1.7*ext2Length - dxPatch, 0.0, dzPatch, rot2);
2744 container[3]->AddNode(volPatch, 0, tr2);
2746 xloc = shTube->GetRmax();
2747 yloc = shTube->GetRmax();
2748 zloc = shTube->GetDz() - shTube->GetRmax() - kYtoHalfStave;
2749 container[1]->AddNode(volTubeA, 1,
2750 new TGeoTranslation(-xloc, -yloc, zloc));
2751 container[2]->AddNode(volTubeC, 1,
2752 new TGeoTranslation(-xloc, -yloc, zloc));
2754 xloc = shTube->GetRmax();
2755 yloc = (shCylTub->GetDz())*SinD(angrot) - shTube->GetRmax();
2756 zloc = (shCylTub->GetDz())*CosD(angrot) + shTube->GetRmax() +kYtoHalfStave;
2757 container[1]->AddNode(volCylTubA, 1,
2758 new TGeoCombiTrans(-xloc, yloc,-zloc,
2759 new TGeoRotation("",0.,angrot,0.)));
2760 container[2]->AddNode(volCylTubC, 1,
2761 new TGeoCombiTrans(-xloc, yloc,-zloc,
2762 new TGeoRotation("",0.,angrot,0.)));
2764 xloc = shOptFibs->GetRmax() + 2*shTube->GetRmax();
2765 yloc = 1.6*shOptFibs->GetRmax();
2766 zloc = shOptFibs->GetDZ() - shTube->GetRmax() - kYtoHalfStave;
2767 container[1]->AddNode(volOptFibs, 1,
2768 new TGeoTranslation(-xloc, -yloc, zloc));
2769 container[2]->AddNode(volOptFibs, 1,
2770 new TGeoTranslation(-xloc, -yloc, zloc));
2772 yloc = shWatCool->GetRmax();
2773 zloc = (2*shTube->GetDz() - shTube->GetRmax() - kYtoHalfStave)/2;
2774 container[4]->AddNode(volWatCool, 1,
2775 new TGeoTranslation(0, -yloc, zloc));
2777 container[4]->AddNode(volWCPltT, 1,
2778 new TGeoTranslation(0, -yloc, zloc));
2780 yloc -= shWCPltB->GetDY();
2781 xloc = shWatCool->GetRmax() + shWCPltB->GetDX();
2782 container[4]->AddNode(volWCPltB, 1,
2783 new TGeoTranslation( xloc, -yloc, zloc));
2784 container[4]->AddNode(volWCPltB, 2,
2785 new TGeoTranslation(-xloc, -yloc, zloc));
2787 yloc = shWatCool->GetRmax();
2788 zloc -= shWatCool->GetDz();
2789 container[4]->AddNode(volFitt, 1,
2790 new TGeoTranslation(0, -yloc, zloc));
2792 // Finally create the list of assemblies and return it to the caller
2793 TList* conemodulelist = new TList();
2794 conemodulelist->Add(container[0]);
2795 conemodulelist->Add(container[1]);
2796 conemodulelist->Add(container[2]);
2797 conemodulelist->Add(container[3]);
2798 conemodulelist->Add(container[4]);
2800 return conemodulelist;
2803 //______________________________________________________________________
2804 void AliITSv11GeometrySPD::CreateCones(TGeoVolume *moth) const
2807 // Places all services modules in the mother reference system
2809 // Created: ?? ??? 2008 Alberto Pulvirenti
2810 // Updated: 03 May 2010 Mario Sitta
2811 // Updated: 04 Jul 2010 Mario Sitta Water cooling
2814 const Int_t kNumberOfModules = 10;
2816 const Double_t kInnerRadius = 80.775*fgkmm;
2817 const Double_t kZTrans = 452.000*fgkmm;
2818 const Double_t kAlphaRot = 46.500*fgkDegree;
2819 const Double_t kAlphaSpaceCool = 9.200*fgkDegree;
2821 TList* modulelistA = CreateConeModule(kFALSE, 90-kAlphaRot);
2822 TList* modulelistC = CreateConeModule(kTRUE , 90-kAlphaRot);
2823 TList* &modulelist = modulelistC;
2824 TGeoVolumeAssembly* module, *moduleA, *moduleC;
2826 Double_t xloc, yloc, zloc;
2828 //Double_t angle[10] = {18., 54., 90., 126., 162., -18., -54., -90., -126., -162.};
2829 // anglem for cone modules (cables and cooling tubes)
2830 // anglep for pathc panels
2831 Double_t anglem[10] = {18., 54., 90., 126., 162., 198., 234., 270., 306., 342.};
2832 Double_t anglep[10] = {18., 62., 90., 115., 162., 198., 242., 270., 295., 342.};
2833 // Double_t angle1m[10] = {23., 53., 90., 127., 157., 203.0, 233.0, 270.0, 307.0, 337.0};
2834 // Double_t angle2m[10] = {18., 53., 90., 126., 162., 198.0, 233.0, 270.0, 309.0, 342.0};
2835 // Double_t angle1c[10] = {23., 53., 90., 124., 157., 203.0, 233.0, 270.0, 304.0, 337.0};
2836 // Double_t angle2c[10] = {18., 44., 90., 126., 162., 198.0, 223.0, 270.0, 309.0, 342.0};
2838 // First add the cables
2839 moduleA = (TGeoVolumeAssembly*)modulelistA->At(0);
2840 moduleC = (TGeoVolumeAssembly*)modulelistC->At(0);
2841 for (Int_t i = 0; i < kNumberOfModules; i++) {
2842 TGeoRotation *rot1 = new TGeoRotation(*gGeoIdentity);
2843 rot1->RotateY(-kAlphaRot);
2844 rot1->RotateZ(anglem[i]);
2845 xloc = kInnerRadius*CosD(anglem[i]);
2846 yloc = kInnerRadius*SinD(anglem[i]);
2848 moth->AddNode(moduleA, 2*i+2,
2849 new TGeoCombiTrans( xloc, yloc, zloc, rot1));
2851 TGeoRotation *rot2 = new TGeoRotation(*gGeoIdentity);
2852 rot2->RotateY(180.-kAlphaRot);
2853 rot2->RotateZ(anglem[i]);
2854 xloc = kInnerRadius*CosD(anglem[i]);
2855 yloc = kInnerRadius*SinD(anglem[i]);
2857 moth->AddNode(moduleC, 2*i+1,
2858 new TGeoCombiTrans(-xloc,-yloc,-zloc, rot2));
2861 // Then the cooling tubes on Side A
2862 module = (TGeoVolumeAssembly*)modulelist->At(1);
2864 for (Int_t i = 0; i < kNumberOfModules; i++) {
2865 anglec = anglem[i] + kAlphaSpaceCool;
2866 TGeoRotation *rot1 = new TGeoRotation(*gGeoIdentity);
2867 rot1->RotateX(-90.0+kAlphaRot-0.04); // 0.04 fixes small overlap
2868 rot1->RotateZ(-90.0+anglec);
2869 xloc = kInnerRadius*CosD(anglec);
2870 yloc = kInnerRadius*SinD(anglec);
2871 zloc = kZTrans+0.162; // 0.162 fixes small overlap
2872 moth->AddNode(module, 2*i+2,
2873 new TGeoCombiTrans( xloc, yloc, zloc, rot1));
2876 // And the cooling tubes on Side C
2877 module = (TGeoVolumeAssembly*)modulelist->At(2);
2878 for (Int_t i = 0; i < kNumberOfModules; i++) {
2879 anglec = anglem[i] - kAlphaSpaceCool;
2880 TGeoRotation *rot2 = new TGeoRotation(*gGeoIdentity);
2881 rot2->RotateX(-90.0+kAlphaRot-0.04); // 0.04 fixes small overlap
2882 rot2->RotateY(180.);
2883 rot2->RotateZ(90.0+anglec);
2884 xloc = kInnerRadius*CosD(anglec);
2885 yloc = kInnerRadius*SinD(anglec);
2886 zloc = kZTrans+0.162; // 0.162 fixes small overlap
2887 moth->AddNode(module, 2*i+1,
2888 new TGeoCombiTrans(-xloc,-yloc,-zloc, rot2));
2891 // Then the water cooling tubes
2892 module = (TGeoVolumeAssembly*)modulelist->At(4);
2893 for (Int_t i = 1; i < kNumberOfModules; i++) { // i = 1,2,...,9
2894 if (i != 5) { // There is no tube in this position
2895 anglec = (anglem[i-1]+anglem[i])/2;
2896 TGeoRotation *rot1 = new TGeoRotation(*gGeoIdentity);
2897 rot1->RotateX(-90.0+kAlphaRot);
2898 rot1->RotateZ(-90.0+anglec);
2899 xloc = kInnerRadius*CosD(anglec);
2900 yloc = kInnerRadius*SinD(anglec);
2902 moth->AddNode(module, 2*i+2,
2903 new TGeoCombiTrans( xloc, yloc, zloc, rot1));
2905 TGeoRotation *rot2 = new TGeoRotation(*gGeoIdentity);
2906 rot2->RotateX(-90.0+kAlphaRot);
2907 rot2->RotateY(180.);
2908 rot2->RotateZ(90.0+anglec);
2909 xloc = kInnerRadius*CosD(anglec);
2910 yloc = kInnerRadius*SinD(anglec);
2912 moth->AddNode(module, 2*i+1,
2913 new TGeoCombiTrans(-xloc,-yloc,-zloc, rot2));
2917 // Finally the optical patch panels
2918 module = (TGeoVolumeAssembly*)modulelist->At(3);
2919 for (Int_t i = 0; i < kNumberOfModules; i++) {
2920 TGeoRotation *rot1 = new TGeoRotation(*gGeoIdentity);
2921 rot1->RotateY(-kAlphaRot);
2922 rot1->RotateZ(anglep[i]);
2923 xloc = kInnerRadius*CosD(anglep[i]);
2924 yloc = kInnerRadius*SinD(anglep[i]);
2926 moth->AddNode(module, 2*i+2,
2927 new TGeoCombiTrans( xloc, yloc, zloc, rot1));
2929 TGeoRotation *rot2 = new TGeoRotation(*gGeoIdentity);
2930 rot2->RotateY(180.-kAlphaRot);
2931 rot2->RotateZ(anglep[i]);
2932 xloc = kInnerRadius*CosD(anglep[i]);
2933 yloc = kInnerRadius*SinD(anglep[i]);
2935 moth->AddNode(module, 2*i+1,
2936 new TGeoCombiTrans(-xloc,-yloc,-zloc, rot2));
2942 //______________________________________________________________________
2943 TGeoVolume* AliITSv11GeometrySPD::CreateExtender(
2944 const Double_t *extenderParams, const TGeoMedium *extenderMedium,
2945 TArrayD& sizes) const
2948 // ------------------ CREATE AN EXTENDER ------------------------
2950 // This function creates the following picture (in plane xOy)
2951 // Should be useful for the definition of the pixel bus and MCM extenders
2952 // The origin corresponds to point 0 on the picture, at half-width
2956 // ^ +---+---------------------+
2959 // 0------> X / +---------------------+
2966 // ---> +-----------+---+
2972 // Takes 6 parameters in the following order :
2973 // |--> par 0 : inner length [0-1] / [9-8]
2974 // |--> par 1 : thickness ( = [0-9] / [4-5])
2975 // |--> par 2 : angle of the slope
2976 // |--> par 3 : total height in local Y direction
2977 // |--> par 4 : outer length [3-4] / [6-5]
2978 // |--> par 5 : width in local Z direction
2980 Double_t slopeDeltaX = (extenderParams[3] - extenderParams[1]
2981 * TMath::Cos(extenderParams[2])) /
2982 TMath::Tan(extenderParams[2]);
2983 Double_t extenderXtruX[10] = {
2986 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2]) ,
2987 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
2989 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
2990 slopeDeltaX + extenderParams[4],
2991 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
2992 slopeDeltaX + extenderParams[4],
2993 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
2995 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
2996 slopeDeltaX - extenderParams[1] * TMath::Sin(extenderParams[2]) ,
3000 Double_t extenderXtruY[10] = {
3003 extenderParams[1] * (1-TMath::Cos(extenderParams[2])) ,
3004 extenderParams[3] - extenderParams[1] ,
3005 extenderParams[3] - extenderParams[1] ,
3008 extenderParams[3]-extenderParams[1]*(1-TMath::Cos(extenderParams[2])) ,
3013 if (sizes.GetSize() != 3) sizes.Set(3);
3014 Double_t &thickness = sizes[0];
3015 Double_t &length = sizes[1];
3016 Double_t &width = sizes[2];
3018 thickness = extenderParams[3];
3019 width = extenderParams[5];
3020 length = extenderParams[0]+extenderParams[1]*
3021 TMath::Sin(extenderParams[2])+slopeDeltaX+extenderParams[4];
3023 // creation of the volume
3024 TGeoXtru *extenderXtru = new TGeoXtru(2);
3025 TGeoVolume *extenderXtruVol = new TGeoVolume("ITSSPDextender",extenderXtru,
3027 extenderXtru->DefinePolygon(10,extenderXtruX,extenderXtruY);
3028 extenderXtru->DefineSection(0,-0.5*extenderParams[4]);
3029 extenderXtru->DefineSection(1, 0.5*extenderParams[4]);
3030 return extenderXtruVol;
3033 //______________________________________________________________________
3034 TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateHalfStave(Bool_t isRight,
3035 Int_t layer,Int_t idxCentral,Int_t idxSide,TArrayD &sizes,TGeoManager *mgr)
3038 // Implementation of an half-stave, which depends on the side where
3039 // we are on the stave. The convention for "left" and "right" is the
3040 // same as for the MCM. The return value is a TGeoAssembly which is
3041 // structured in such a way that the origin of its local reference
3042 // frame coincides with the origin of the whole stave.
3043 // The TArrayD passed by reference will contain details of the shape:
3044 // - sizes[0] = thickness
3045 // - sizes[1] = length
3046 // - sizes[2] = width
3047 // - sizes[3] = common 'x' position for eventual clips
3048 // - sizes[4] = common 'y' position for eventual clips
3049 // - sizes[5] = 'z' position of first clip
3050 // - sizes[6] = 'z' position of second clip
3055 // idxCentral and idxSide must be different
3056 if (idxCentral == idxSide) {
3057 AliInfo("Ladders must be inserted in half-stave with "
3058 "different indexes.");
3059 idxSide = idxCentral + 1;
3060 AliInfo(Form("Central ladder will be inserted with index %d",
3062 AliInfo(Form("Side ladder will be inserted with index %d",idxSide));
3065 // define the separations along Z direction between the objects
3066 Double_t sepLadderLadder = fgkmm * 0.2; // sep. btw the 2 ladders
3067 Double_t sepLadderCenter = fgkmm * 0.4; // sep. btw the "central" ladder
3068 // and the Z=0 plane in stave ref.
3069 Double_t sepLadderMCM = fgkmm * 0.3; // sep. btw the "external" ladder
3071 Double_t sepBusCenter = fgkmm * 0.3; // sep. btw the bus central edge
3072 // and the Z=0 plane in stave ref.
3077 TArrayD grndSize(3);
3078 // This one line repalces the 3 bellow, BNS.
3079 TGeoVolume *grndVol = CreateGroundingFoil(isRight, grndSize, mgr);
3080 Double_t &grndThickness = grndSize[0];
3081 Double_t &grndLength = grndSize[1];
3084 TArrayD ladderSize(3);
3085 TGeoVolume *ladder = CreateLadder(layer, ladderSize, mgr);
3086 Double_t ladderThickness = ladderSize[0];
3087 Double_t ladderLength = ladderSize[1];
3088 Double_t ladderWidth = ladderSize[2];
3092 TGeoVolumeAssembly *mcm = CreateMCM(!isRight,mcmSize,mgr);
3093 Double_t mcmThickness = mcmSize[0];
3094 Double_t mcmLength = mcmSize[1];
3095 Double_t mcmWidth = mcmSize[2];
3099 TGeoVolumeAssembly *bus = CreatePixelBus(isRight, layer, busSize, mgr);
3100 Double_t busThickness = busSize[0];
3101 Double_t busLength = busSize[1];
3102 Double_t busWidth = busSize[2];
3104 // glue between ladders and pixel bus
3105 TGeoMedium *medLadGlue = GetMedium("EPOXY$", mgr);
3106 Double_t ladGlueThickness = fgkmm * 0.1175 - fgkGapLadder;
3107 TGeoVolume *ladderGlue = mgr->MakeBox("ITSSPDladderGlue",medLadGlue,
3108 0.5*ladGlueThickness, 0.5*busWidth, 0.5*busLength);
3109 ladderGlue->SetLineColor(kYellow + 5);
3111 // create references for the whole object, as usual
3113 Double_t &fullThickness = sizes[0];
3114 Double_t &fullLength = sizes[1];
3115 Double_t &fullWidth = sizes[2];
3117 // compute the full size of the container
3118 fullLength = sepLadderCenter+2.0*ladderLength+sepLadderMCM+
3119 sepLadderLadder+mcmLength;
3120 fullWidth = ladderWidth;
3121 fullThickness = grndThickness + fgkGapLadder + mcmThickness + busThickness;
3122 //cout << "HSTAVE FULL THICKNESS = " << fullThickness << endl;
3126 // grounding foil (shifted only along thickness)
3127 Double_t xGrnd = -0.5*fullThickness + 0.5*grndThickness;
3128 Double_t zGrnd = -0.5*grndLength;
3129 if (!isRight) zGrnd = -zGrnd;
3130 TGeoTranslation *grndTrans = new TGeoTranslation(xGrnd, 0.0, zGrnd);
3132 // ladders (translations along thickness and length)
3133 // layers must be sorted going from the one at largest Z to the
3134 // one at smallest Z:
3135 // -|Zmax| ------> |Zmax|
3137 // then, for layer 1 ladders they must be placed exactly this way,
3138 // and in layer 2 at the opposite. In order to remember the placements,
3139 // we define as "inner" and "outer" ladder respectively the one close
3140 // to barrel center, and the one closer to MCM, respectively.
3141 Double_t xLad, zLadIn, zLadOut;
3142 xLad = xGrnd + 0.5*(grndThickness + ladderThickness) +
3143 0.01175 - fgkGapLadder;
3144 zLadIn = -sepLadderCenter - 0.5*ladderLength;
3145 zLadOut = zLadIn - sepLadderLadder - ladderLength;
3149 } // end if !isRight
3150 TGeoRotation *rotLad = new TGeoRotation(*gGeoIdentity);
3151 rotLad->RotateZ(90.0);
3152 rotLad->RotateY(180.0);
3153 Double_t sensWidth = fgkmm * 12.800;
3154 Double_t chipWidth = fgkmm * 15.950;
3155 Double_t guardRingWidth = fgkmm * 0.560;
3156 Double_t ladderShift = 0.5 * (chipWidth - sensWidth - 2.0*guardRingWidth);
3157 TGeoCombiTrans *trLadIn = new TGeoCombiTrans(xLad,ladderShift,zLadIn,
3159 TGeoCombiTrans *trLadOut = new TGeoCombiTrans(xLad,ladderShift,zLadOut,
3162 // MCM (length and thickness direction, placing at same level as the
3163 // ladder, which implies to recompute the position of center, because
3164 // ladder and MCM have NOT the same thickness) the two copies of the
3165 // MCM are placed at the same distance from the center, on both sides
3166 Double_t xMCM = xGrnd + 0.5*grndThickness + 0.5*mcmThickness +
3167 0.01175 - fgkGapLadder;
3168 Double_t yMCM = 0.5*(fullWidth - mcmWidth);
3169 Double_t zMCM = zLadOut - 0.5*ladderLength - 0.5*mcmLength - sepLadderMCM;
3170 if (!isRight) zMCM = zLadOut + 0.5*ladderLength + 0.5*mcmLength +
3173 // create the correction rotations
3174 TGeoRotation *rotMCM = new TGeoRotation(*gGeoIdentity);
3175 rotMCM->RotateY(90.0);
3176 TGeoCombiTrans *trMCM = new TGeoCombiTrans(xMCM, yMCM, zMCM, rotMCM);
3178 // glue between ladders and pixel bus
3179 Double_t xLadGlue = xLad + 0.5*ladderThickness + 0.01175 -
3180 fgkGapLadder + 0.5*ladGlueThickness;
3182 // bus (length and thickness direction)
3183 Double_t xBus = xLadGlue + 0.5*ladGlueThickness + 0.5*busThickness;
3184 Double_t yBus = 0.5*(fullWidth - busWidth) + 0.075; // Hardcode fix of a small overlap
3185 Double_t zBus = -0.5*busLength - sepBusCenter;
3186 if (!isRight) zBus = -zBus;
3187 TGeoTranslation *trBus = new TGeoTranslation(xBus, yBus, zBus);
3189 TGeoTranslation *trLadGlue = new TGeoTranslation(xLadGlue, 0.0, zBus);
3191 // create the container
3192 TGeoVolumeAssembly *container = 0;
3193 if (idxCentral+idxSide==5) {
3194 container = new TGeoVolumeAssembly("ITSSPDhalf-Stave1");
3196 container = new TGeoVolumeAssembly("ITSSPDhalf-Stave0");
3199 // add to container all objects
3200 container->AddNode(grndVol, 1, grndTrans);
3201 // ladders are inserted in different order to respect numbering scheme
3202 // which is inverted when going from outer to inner layer
3203 container->AddNode(ladder, idxCentral+1, trLadIn);
3204 container->AddNode(ladder, idxSide+1, trLadOut);
3205 container->AddNode(ladderGlue, 1, trLadGlue);
3206 container->AddNode(mcm, 1, trMCM);
3207 container->AddNode(bus, 1, trBus);
3209 // since the clips are placed in correspondence of two pt1000s,
3210 // their position is computed here, but they are not added by default
3211 // it will be the StavesInSector method which will decide to add them
3212 // anyway, to recovery some size informations on the clip, it must be
3215 // TGeoVolume *clipDummy = CreateClip(clipSize, kTRUE, mgr);
3216 CreateClip(clipSize, kTRUE, mgr);
3217 // define clip movements (width direction)
3218 sizes[3] = xBus + 0.5*busThickness;
3219 sizes[4] = 0.5 * (fullWidth - busWidth) - clipSize[6] - fgkmm*0.48;
3220 sizes[5] = zBus + busSize[4];
3221 sizes[6] = zBus + busSize[5];
3225 //______________________________________________________________________
3226 TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateStave(Int_t layer,
3227 TArrayD &sizes, TGeoManager *mgr)
3230 // This method uses all other ones which create pieces of the stave
3231 // and assemblies everything together, in order to return the whole
3232 // stave implementation, which is returned as a TGeoVolumeAssembly,
3233 // due to the presence of some parts which could generate fake overlaps
3234 // when put on the sector.
3235 // This assembly contains, going from bottom to top in the thickness
3237 // - the complete grounding foil, defined by the "CreateGroundingFoil"
3238 // method which already joins some glue and real groudning foil
3239 // layers for the whole stave (left + right);
3240 // - 4 ladders, which are sorted according to the ALICE numbering
3241 // scheme, which depends on the layer we are building this stave for;
3242 // - 2 MCMs (a left and a right one);
3243 // - 2 pixel buses (a left and a right one);
3246 // - the layer number, which determines the displacement and naming
3247 // of sensitive volumes
3248 // - a TArrayD passed by reference which will contain the size
3249 // of virtual box containing the stave
3250 // - the TGeoManager
3253 // create the container
3254 TGeoVolumeAssembly *container = new TGeoVolumeAssembly(Form(
3255 "ITSSPDlay%d-Stave",layer));
3256 // define the indexes of the ladders in order to have the correct order
3257 // keeping in mind that the staves will be inserted as they are on layer
3258 // 2, while they are rotated around their local Y axis when inserted
3259 // on layer 1, so in this case they must be put in the "wrong" order
3260 // to turn out to be right at the end. The convention is:
3261 // -|Zmax| ------> |Zmax|
3263 // with respect to the "native" stave reference frame, "left" is in
3264 // the positive Z this leads the definition of these indexes:
3265 Int_t idxCentralL, idxSideL, idxCentralR, idxSideR;
3277 } // end if layer ==1
3279 // create the two half-staves
3280 TArrayD sizeL, sizeR;
3281 TGeoVolumeAssembly *hstaveL = CreateHalfStave(kFALSE, layer, idxCentralL,
3282 idxSideL, sizeL,mgr);
3283 TGeoVolumeAssembly *hstaveR = CreateHalfStave(kTRUE, layer, idxCentralR,
3284 idxSideR, sizeR, mgr);
3285 // copy the size to the stave's one
3287 sizes[0] = sizeL[0];
3288 sizes[1] = sizeR[1] + sizeL[1];
3289 sizes[2] = sizeL[2];
3290 sizes[3] = sizeL[3];
3291 sizes[4] = sizeL[4];
3292 sizes[5] = sizeL[5];
3293 sizes[6] = sizeL[6];
3294 sizes[7] = sizeR[5];
3295 sizes[8] = sizeR[6];
3297 // add to container all objects
3298 container->AddNode(hstaveL, 1);
3299 container->AddNode(hstaveR, 1);
3303 //______________________________________________________________________
3304 void AliITSv11GeometrySPD::SetAddStave(Bool_t *mask)
3307 // Define a mask which states qhich staves must be placed.
3308 // It is a string which must contain '0' or '1' depending if
3309 // a stave must be placed or not.
3310 // Each place is referred to one of the staves, so the first
3311 // six characters of the string will be checked.
3315 for (i = 0; i < 6; i++) fAddStave[i] = mask[i];
3317 //______________________________________________________________________
3318 void AliITSv11GeometrySPD::StavesInSector(TGeoVolume *moth, TGeoManager *mgr)
3321 // Unification of essentially two methods:
3322 // - the one which creates the sector structure
3323 // - the one which returns the complete stave
3325 // For compatibility, this method requires the same arguments
3326 // asked by "CarbonFiberSector" method, which is recalled here.
3327 // Like this cited method, this one does not return any value,
3328 // but it inserts in the mother volume (argument 'moth') all the stuff
3329 // which composes the complete SPD sector.
3331 // In the following, the stave numbering order used for arrays is the
3332 // same as defined in the GetSectorMountingPoints():
3338 // Arguments: see description of "CarbonFiberSector" method.
3341 Double_t shift[6]; // shift from the innermost position in the
3342 // sector placement plane (where the stave
3343 // edge is in the point where the rounded
3346 shift[0] = fgkmm * -0.691;
3347 shift[1] = fgkmm * 5.041;
3348 shift[2] = fgkmm * 1.816;
3349 shift[3] = fgkmm * -0.610;
3350 shift[4] = fgkmm * -0.610;
3351 shift[5] = fgkmm * -0.610;
3353 // corrections after interaction with Andrea and CAD
3354 Double_t corrX[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
3355 Double_t corrY[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
3359 corrX[2] = corrX[3] = corrX[4] = corrX[5] = -0.0016;
3363 corrY[2] = corrY[3] = corrY[4] = corrY[5] = -0.0003;
3365 corrX[0] += 0.00026;
3366 corrY[0] += -0.00080;
3368 corrX[1] += 0.00018;
3369 corrY[1] += -0.00086;
3371 corrX[2] += 0.00020;
3372 corrY[2] += -0.00062;
3374 corrX[3] += 0.00017;
3375 corrY[3] += -0.00076;
3377 corrX[4] += 0.00016;
3378 corrY[4] += -0.00096;
3380 corrX[5] += 0.00018;
3381 corrY[5] += -0.00107;
3383 // create stave volumes (different for layer 1 and 2)
3384 TArrayD staveSizes1(9), staveSizes2(9), clipSize(5);
3385 Double_t &staveHeight = staveSizes1[2], &staveThickness = staveSizes1[0];
3386 TGeoVolume *stave1 = CreateStave(1, staveSizes1, mgr);
3387 TGeoVolume *stave2 = CreateStave(2, staveSizes2, mgr);
3388 TGeoVolume *clip = CreateClip(clipSize, kFALSE, mgr);
3390 Double_t xL, yL; // leftmost edge of mounting point (XY projection)
3391 Double_t xR, yR; // rightmost edge of mounting point (XY projection)
3392 Double_t xM, yM; // middle point of the segment L-R
3393 Double_t dx, dy; // (xL - xR) and (yL - yR)
3394 Double_t widthLR; // width of the segment L-R
3395 Double_t angle; // stave rotation angle in degrees
3396 Double_t diffWidth; // difference between mounting plane width and
3397 // stave width (smaller)
3398 Double_t xPos, yPos; // final translation of the stave
3399 Double_t parMovement; // translation in the LR plane direction
3401 staveThickness += fgkGapHalfStave;
3405 for (i = 0; i < 6; i++) {
3406 // in debug mode, if this stave is not required, it is skipped
3407 if (!fAddStave[i]) continue;
3408 // retrieve reference points
3409 GetSectorMountingPoints(i, xL, yL, xR, yR);
3410 xM = 0.5 * (xL + xR);
3411 yM = 0.5 * (yL + yR);
3414 angle = TMath::ATan2(dy, dx);
3415 widthLR = TMath::Sqrt(dx*dx + dy*dy);
3416 diffWidth = 0.5*(widthLR - staveHeight);
3417 // first, a movement along this plane must be done
3418 // by an amount equal to the width difference
3419 // and then the fixed shift must also be added
3420 parMovement = diffWidth + shift[i];
3421 // due to stave thickness, another movement must be done
3422 // in the direction normal to the mounting plane
3423 // which is computed using an internal method, in a reference
3424 // frame where the LR segment has its middle point in the origin
3425 // and axes parallel to the master reference frame
3427 ParallelPosition(-0.5*staveThickness, -parMovement, angle,
3431 ParallelPosition( 0.5*staveThickness, -parMovement, angle,
3434 ParallelPosition( 0.5*staveThickness, parMovement, angle,
3437 // then we go into the true reference frame
3442 // using the parameters found here, compute the
3443 // translation and rotation of this stave:
3444 TGeoRotation *rot = new TGeoRotation(*gGeoIdentity);
3445 if (i == 0 || i == 1) rot->RotateX(180.0);
3446 rot->RotateZ(90.0 + angle * TMath::RadToDeg());
3447 TGeoCombiTrans *trans = new TGeoCombiTrans(xPos, yPos, 0.0, rot);
3448 if (i == 0 || i == 1) {
3449 moth->AddNode(stave1, i+1, trans);
3451 moth->AddNode(stave2, i - 1, trans);
3453 // except in the case of stave #2,
3454 // clips must be added, and this is done directly on the sector
3457 TGeoRotation *rotClip = new TGeoRotation(*gGeoIdentity);
3458 rotClip->RotateZ(-90.0);
3459 rotClip->RotateX(180.0);
3460 Double_t x = staveSizes2[3] + fgkGapHalfStave;
3461 Double_t y = staveSizes2[4];
3462 Double_t z[4] = { staveSizes2[5], staveSizes2[6],
3463 staveSizes2[7], staveSizes2[8] };
3464 for (j = 0; j < 4; j++) {
3465 TGeoCombiTrans *trClip = new TGeoCombiTrans(x, y, z[j],
3467 *trClip = *trans * *trClip;
3468 moth->AddNode(clip, iclip++, trClip);
3471 } // end if i==0||i==1 else
3475 // Add a box representing the collector for cooling tubes
3476 Double_t collWidth = fgkmm * 22.0;
3477 Double_t collLength = fgkmm * 50.0;
3478 Double_t collThickness = fgkmm * 7.0;
3479 Double_t collInSize = fgkmm * 10.5;
3481 TGeoMedium *medColl = GetMedium("INOX$");
3482 TGeoMedium *medCollIn = GetMedium("COPPER$");
3483 TGeoVolume *vColl = mgr->MakeBox("ITSSPDSectorTubeColl" , medColl, 0.5*collWidth, 0.5*collThickness, 0.5*collLength);
3484 TGeoVolume *vCollIn = mgr->MakeBox("ITSSPDSectorTubeCollIn", medCollIn, 0.5*collInSize, 0.5*collInSize, 0.5*collInSize);
3485 vColl->SetLineColor(kGreen+2);
3486 vCollIn->SetLineColor(kYellow);
3488 TGeoTranslation *tr1 = new TGeoTranslation( 0.1, 1.2, 35.0);
3489 TGeoTranslation *tr2 = new TGeoTranslation(-0.1, 1.2, -35.0);
3490 TGeoTranslation *tr3 = new TGeoTranslation( 0.1, 1.2 - 0.5*(collThickness+collInSize), 35.0 + 0.5*(collLength - collInSize));
3491 TGeoTranslation *tr4 = new TGeoTranslation(-0.1, 1.2 - 0.5*(collThickness+collInSize), -35.0 - 0.5*(collLength - collInSize));
3493 moth->AddNode(vColl, 0, tr1);
3494 moth->AddNode(vColl, 1, tr2);
3495 moth->AddNode(vCollIn, 0, tr3);
3496 moth->AddNode(vCollIn, 1, tr4);
3499 //______________________________________________________________________
3500 void AliITSv11GeometrySPD::ParallelPosition(Double_t dist1, Double_t dist2,
3501 Double_t phi, Double_t &x, Double_t &y) const
3504 // Performs the following steps:
3505 // 1 - finds a straight line parallel to the one passing through
3506 // the origin and with angle 'phi' with X axis(phi in RADIANS);
3507 // 2 - finds another line parallel to the previous one, with a
3508 // distance 'dist1' from it
3509 // 3 - takes a reference point in the second line in the intersection
3510 // between the normal to both lines passing through the origin
3511 // 4 - finds a point whith has distance 'dist2' from this reference,
3512 // in the second line (point 2)
3514 // According to the signs given to dist1 and dist2, the point is
3515 // found in different position w.r. to the origin
3516 // compute the point
3518 Double_t cs = TMath::Cos(phi);
3519 Double_t sn = TMath::Sin(phi);
3521 x = dist2*cs - dist1*sn;
3522 y = dist1*cs + dist2*sn;
3524 //______________________________________________________________________
3525 Double_t AliITSv11GeometrySPD::GetSPDSectorTranslation(
3526 Double_t x0,Double_t y0,Double_t x1,Double_t y1,Double_t r) const
3529 // Comutes the radial translation of a sector to give the
3530 // proper distance between SPD detectors and the beam pipe.
3531 // Units in are units out.
3536 <A HREF="http://www.physics.ohio-state.edu/HIRG/SoftWareDoc/SPD_Sector_Position.png">
3537 Figure showing the geometry used in the computation below. </A>
3542 // Double_t x0 Point x0 on Sector surface for the inner
3543 // most detector mounting
3544 // Double_t y0 Point y0 on Sector surface for the innor
3545 // most detector mounting
3546 // Double_t x1 Point x1 on Sector surface for the inner
3547 // most detector mounting
3548 // Double_t y1 Point y1 on Sector surface for the innor
3549 // most detector mounting
3550 // Double_t r The radial distance this mounting surface
3551 // should be from the center of the beam pipe.
3555 // The distance the SPD sector should be displaced radialy.
3560 if(a==0.0) return 0.0;
3562 b = TMath::Sqrt(1.0+a*a);
3567 //______________________________________________________________________
3568 void AliITSv11GeometrySPD::PrintAscii(ostream *os) const
3571 // Print out class data values in Ascii Form to output stream
3573 // ostream *os Output stream where Ascii data is to be writen
3580 #if defined __GNUC__
3582 ios::fmtflags fmt = cout.flags();
3587 #if defined __ICC || defined __ECC || defined __xlC__
3594 *os<< fgkGapLadder <<" "<< fgkGapHalfStave<<" "<< 6 <<" ";
3595 for(i=0;i<6;i++) *os<< fAddStave[i] <<" "<<fSPDsectorX0.GetSize();
3596 for(i=0;i<fSPDsectorX0.GetSize();i++) *os<< fSPDsectorX0.GetAt(i) << " ";
3597 for(i=0;i<fSPDsectorX0.GetSize();i++) *os<< fSPDsectorY0.GetAt(i) << " ";
3598 for(i=0;i<fSPDsectorX1.GetSize();i++) *os<< fSPDsectorX1.GetAt(i) << " ";
3599 for(i=0;i<fSPDsectorX1.GetSize();i++) *os<< fSPDsectorY1.GetAt(i) << " ";
3600 *os<<10<<" "<< 2 <<" " << 6 << " "<< 3 <<" ";
3601 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++)
3602 *os<<fTubeEndSector[k][0][i][j]<<" ";
3603 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++)
3604 *os<<fTubeEndSector[k][1][i][j]<<" ";
3605 os->flags(fmt); // reset back to old Formating.
3609 //______________________________________________________________________
3610 void AliITSv11GeometrySPD::ReadAscii(istream* is)
3613 // Read in class data values in Ascii Form to output stream
3615 // istream *is Input stream where Ascii data is to be read in from
3622 Double_t gapLadder,GapHalfStave;
3624 *is>>gapLadder>>GapHalfStave>>n;
3626 Warning("ReadAscii","fAddStave Array !=6 n=%d",n);
3629 for(i=0;i<n;i++) *is>>fAddStave[i];
3631 fSPDsectorX0.Set(n);
3632 fSPDsectorY0.Set(n);
3633 fSPDsectorX1.Set(n);
3634 fSPDsectorY1.Set(n);
3635 for(i=0;i<n;i++) *is>>fSPDsectorX0[i];
3636 for(i=0;i<n;i++) *is>>fSPDsectorY0[i];
3637 for(i=0;i<n;i++) *is>>fSPDsectorX1[i];
3638 for(i=0;i<n;i++) *is>>fSPDsectorY1[i];
3640 if(i!=2||j!=6||n!=3){
3641 Warning("ReadAscii","fTubeEndSector array wrong size [2][6][3],"
3642 "found [%d][%d][%d]",i,j,n);
3645 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++)
3646 *is>>fTubeEndSector[k][0][i][j];
3647 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++)
3648 *is>>fTubeEndSector[k][1][i][j];
3652 //______________________________________________________________________
3653 ostream &operator<<(ostream &os,const AliITSv11GeometrySPD &s)
3656 // Standard output streaming function
3658 // ostream &os output steam
3659 // AliITSvPPRasymmFMD &s class to be streamed.
3663 // ostream &os The stream pointer
3669 //______________________________________________________________________
3670 istream &operator>>(istream &is,AliITSv11GeometrySPD &s)
3673 // Standard inputput streaming function
3675 // istream &is input steam
3676 // AliITSvPPRasymmFMD &s class to be streamed.
3680 // ostream &os The stream pointer