Added macro to draw 1 sensor of each ladded and its tracking frame
[u/mrichter/AliRoot.git] / ITS / AliITSv11GeometrySPD.cxx
CommitLineData
db486a6e 1/**************************************************************************
59da35b6 2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
db486a6e 3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
592651e2 15//
db486a6e 16// This class Defines the Geometry for the ITS services and support cones
d0048cec 17// outside of the central volume (except for the Central support
54c9a3d9 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
db486a6e 21// and cable trays on both the RB26 (muon dump) and RB24 sides, and all of
592651e2 22// the cabling from the ladders/stave ends out past the TPC.
23//
54c9a3d9 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,
53// | Double_t y1)
54// -----3* ParallelPosition(Double_t dist1,Double_t dist2,
55// Double_t phi,Double_t &x,Double_t &y)
56//
57// Obsoleate or presently unused routines are: setAddStave(Bool_t *mask),
58// CreatePixelBusAndExtensions(...) which calles CreateExtender(...).
db486a6e 59
543b7370 60/* $Id$ */
592651e2 61
4098f5dd 62
db486a6e 63// General Root includes
64#include <Riostream.h>
65#include <TMath.h>
66#include <TLatex.h>
67#include <TCanvas.h>
68#include <TPolyLine.h>
297369a1 69#include <TPolyMarker.h>
bc3498f4 70
db486a6e 71// Root Geometry includes
f7a1cc68 72#include <TGeoCompositeShape.h>
db486a6e 73#include <TGeoEltu.h>
f7a1cc68 74#include <TGeoGlobalMagField.h>
a53658c6 75#include <TGeoMaterial.h>
f7a1cc68 76#include <TGeoMatrix.h>
a53658c6 77#include <TGeoMedium.h>
f7a1cc68 78#include <TGeoTube.h> // contains TGeoTubeSeg
79#include <TGeoVolume.h>
80#include <TGeoXtru.h>
c890eba4 81#include <TGeoPcon.h>
c33a0330 82#include <TGeoArb8.h>
bc3498f4 83
592651e2 84// AliRoot includes
bc3498f4 85#include "AliLog.h"
a53658c6 86#include "AliMagF.h"
87#include "AliRun.h"
bc3498f4 88
592651e2 89// Declaration file
db486a6e 90#include "AliITSv11GeometrySPD.h"
c33a0330 91#include "AliITSv11GeomCableRound.h"
db486a6e 92
54c9a3d9 93// Constant definistions
d0048cec 94const Double_t AliITSv11GeometrySPD::fgkGapLadder =
54c9a3d9 95 AliITSv11Geometry::fgkmicron*75.; // 75 microns
d0048cec 96const Double_t AliITSv11GeometrySPD::fgkGapHalfStave =
54c9a3d9 97 AliITSv11Geometry::fgkmicron*120.; // 120 microns
7855ea93 98
fe7d86eb 99using std::endl;
100using std::cout;
101using std::ios;
db486a6e 102ClassImp(AliITSv11GeometrySPD)
54c9a3d9 103//______________________________________________________________________
104AliITSv11GeometrySPD::AliITSv11GeometrySPD(/*Double_t gap*/):
105AliITSv11Geometry(),// Default constructor of base class
106fAddStave(), // [DEBUG] must be TRUE for all staves which will be
107 // mounted in the sector (used to check overlaps)
108fSPDsectorX0(0), // X of first edge of sector plane for stave
109fSPDsectorY0(0), // Y of first edge of sector plane for stave
110fSPDsectorX1(0), // X of second edge of sector plane for stave
111fSPDsectorY1(0), // Y of second edge of sector plane for stave
d0048cec 112fTubeEndSector() // coordinate of cooling tube ends
54c9a3d9 113{
114 //
115 // Default constructor.
d0048cec 116 // This does not initialize anything and is provided just for
54c9a3d9 117 // completeness. It is recommended to use the other one.
118 // The alignment gap is specified as argument (default = 0.0075 cm).
119 // Inputs:
120 // none.
121 // Outputs:
122 // none.
123 // Return:
124 // A default constructed AliITSv11GeometrySPD class.
125 //
126 Int_t i = 0,j=0,k=0;
db486a6e 127
54c9a3d9 128 for (i = 0; i < 6; i++) fAddStave[i] = kTRUE;
129 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++){
130 this->fTubeEndSector[k][0][i][j] = 0.0;
131 this->fTubeEndSector[k][1][i][j] = 0.0;
132 } // end for i,j
133}
134//______________________________________________________________________
135AliITSv11GeometrySPD::AliITSv11GeometrySPD(Int_t debug/*, Double_t gap*/):
136AliITSv11Geometry(debug),// Default constructor of base class
137fAddStave(), // [DEBUG] must be TRUE for all staves which will be
138 // mounted in the sector (used to check overlaps)
139fSPDsectorX0(0), // X of first edge of sector plane for stave
140fSPDsectorY0(0), // Y of first edge of sector plane for stave
141fSPDsectorX1(0), // X of second edge of sector plane for stave
142fSPDsectorY1(0), // Y of second edge of sector plane for stave
d0048cec 143fTubeEndSector() // coordinate of cooling tube ends
54c9a3d9 144{
145 //
146 // Constructor with debug setting argument
147 // This is the constructor which is recommended to be used.
148 // It sets a debug level, and initializes the name of the object.
149 // The alignment gap is specified as argument (default = 0.0075 cm).
150 // Inputs:
151 // Int_t debug Debug level, 0= no debug output.
152 // Outputs:
153 // none.
154 // Return:
155 // A default constructed AliITSv11GeometrySPD class.
156 //
157 Int_t i = 0,j=0,k=0;
db486a6e 158
54c9a3d9 159 for (i = 0; i < 6; i++) fAddStave[i] = kTRUE;
160 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++){
161 this->fTubeEndSector[k][0][i][j] = 0.0;
162 this->fTubeEndSector[k][1][i][j] = 0.0;
163 } // end for i,j
164}
165//______________________________________________________________________
166AliITSv11GeometrySPD::AliITSv11GeometrySPD(const AliITSv11GeometrySPD &s):
167AliITSv11Geometry(s),// Base Class Copy constructor
168fAddStave(), // [DEBUG] must be TRUE for all staves which will be
169 // mounted in the sector (used to check overlaps)
170fSPDsectorX0(s.fSPDsectorX0), // X of first edge of sector plane for stave
171fSPDsectorY0(s.fSPDsectorY0), // Y of first edge of sector plane for stave
172fSPDsectorX1(s.fSPDsectorX1), // X of second edge of sector plane for stave
173fSPDsectorY1(s.fSPDsectorY1) // Y of second edge of sector plane for stave
bc3498f4 174{
54c9a3d9 175 //
176 // Copy Constructor
177 // Inputs:
178 // AliITSv11GeometrySPD &s source class
179 // Outputs:
180 // none.
181 // Return:
182 // A copy of a AliITSv11GeometrySPD class.
183 //
184 Int_t i=0,j=0,k=0;
185
186 for (i = 0; i < 6; i++) this->fAddStave[i] = s.fAddStave[i];
187 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++){
188 this->fTubeEndSector[k][0][i][j] = s.fTubeEndSector[k][0][i][j];
189 this->fTubeEndSector[k][1][i][j] = s.fTubeEndSector[k][1][i][j];
190 } // end for i,j
bc3498f4 191}
54c9a3d9 192//______________________________________________________________________
d0048cec 193AliITSv11GeometrySPD& AliITSv11GeometrySPD::operator=(const
54c9a3d9 194 AliITSv11GeometrySPD &s)
bc3498f4 195{
54c9a3d9 196 //
197 // = operator
198 // Inputs:
199 // AliITSv11GeometrySPD &s source class
200 // Outputs:
201 // none.
202 // Return:
203 // A copy of a AliITSv11GeometrySPD class.
204 //
205 Int_t i=0,j=0,k=0;
206
207 if(this==&s) return *this;
208 for (i = 0; i < 6; i++) this->fAddStave[i] = s.fAddStave[i];
209 this->fSPDsectorX0=s.fSPDsectorX0;
210 this->fSPDsectorY0=s.fSPDsectorY0;
211 this->fSPDsectorX1=s.fSPDsectorX1;
212 this->fSPDsectorY1=s.fSPDsectorY1;
213 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++){
214 this->fTubeEndSector[k][0][i][j] = s.fTubeEndSector[k][0][i][j];
215 this->fTubeEndSector[k][1][i][j] = s.fTubeEndSector[k][1][i][j];
216 } // end for i,j
217 return *this;
bc3498f4 218}
54c9a3d9 219//______________________________________________________________________
220TGeoMedium* AliITSv11GeometrySPD::GetMedium(const char* mediumName,
43aefea7 221 const TGeoManager *mgr) const
bc3498f4 222{
54c9a3d9 223 //
d0048cec 224 // This function is used to recovery any medium
225 // used to build the geometry volumes.
226 // If the required medium does not exists,
54c9a3d9 227 // a NULL pointer is returned, and an error message is written.
228 //
229 Char_t itsMediumName[30];
230
6932f314 231 snprintf(itsMediumName, 30, "ITS_%s", mediumName);
54c9a3d9 232 TGeoMedium* medium = mgr->GetMedium(itsMediumName);
233 if (!medium) AliError(Form("Medium <%s> not found", mediumName));
234
235 return medium;
bc3498f4 236}
54c9a3d9 237
54c9a3d9 238//______________________________________________________________________
bc3498f4 239void AliITSv11GeometrySPD::SPDSector(TGeoVolume *moth, TGeoManager *mgr)
240{
54c9a3d9 241 //
d0048cec 242 // Creates a single SPD carbon fiber sector and places it
54c9a3d9 243 // in a container volume passed as first argument ('moth').
244 // Second argument points to the TGeoManager which coordinates
245 // the overall volume creation.
d0048cec 246 // The position of the sector is based on distance of
247 // closest point of SPD stave to beam pipe
54c9a3d9 248 // (figures all-sections-modules.ps) of 7.22mm at section A-A.
249 //
250
251 // Begin_Html
252 /*
253 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/assembly.ps"
254 title="SPD Sector drawing with all cross sections defined">
d0048cec 255 <p>The SPD Sector definition. In
54c9a3d9 256 <a href="http://alice.pd.infn.it/latestdr/Geometric-Revision/assembly.hpgl">HPGL</a> format.
257 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/assembly-10-modules.ps"
258 titile="SPD All Sectors end view with thermal sheald">
259 <p>The SPD all sector end view with thermal sheald.
260 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/assembly.ps"
261 title="SPD side view cross section">
262 <p>SPD side view cross section with condes and thermal shealds.
263 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-A_A.jpg"
264 title="Cross section A-A"><p>Cross section A-A.
265 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-B_B.jpg"
266 title="Cross updated section A-A"><p>Cross updated section A-A.
267 <img src="http://physics.mps.ohio-state.edu/~nilsen/ITSfigures/Sezione_layerAA.pdf"
268 title="Cross section B-B"><p>Cross section B-B.
269 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-C_C.jpg"
270 title-"Cross section C-C"><p>Cross section C-C.
271 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-D_D.jpg"
272 title="Cross section D-D"><p>Cross section D-D.
273 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-E_E.jpg"
274 title="Cross section E-E"><p>Cross section E-E.
275 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-F_F.jpg"
276 title="Cross section F-F"><p>Cross section F-F.
277 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-G_G.jpg"
278 title="Cross section G-G"><p>Cross section G-G.
279 */
280 // End_Html
281
282 // Inputs:
283 // TGeoVolume *moth Pointer to mother volume where this object
284 // is to be placed in
285 // TGeoManager *mgr Pointer to the TGeoManager used, defaule is
286 // gGeoManager.
287 // Outputs:
288 // none.
289 // Return:
290 // none.
291 // Updated values for kSPDclossesStaveAA, kBeamPipeRadius, and
d0048cec 292 // staveThicknessAA are taken from
54c9a3d9 293 // http://physics.mps.ohio-state.edu/~nilsen/ITSfigures/Sezione_layerAA.pdf
294 //
3ffa185f 295 const Double_t kSPDclossesStaveAA = 7.25* fgkmm;
54c9a3d9 296 const Double_t kSectorStartingAngle = -72.0 * fgkDegree;
3ffa185f 297 const Int_t kNSectorsTotal = 10;
298 const Double_t kSectorRelativeAngle = 36.0 * fgkDegree; // = 360.0 / 10
299 const Double_t kBeamPipeRadius = 0.5 * 59.6 * fgkmm; // diam. = 59.6 mm
300 //const Double_t staveThicknessAA = 0.9 *fgkmm; // nominal thickness
301 const Double_t staveThicknessAA = 1.02 * fgkmm; // get from stave geometry.
d0048cec 302
3ffa185f 303 Int_t i, j, k;
54c9a3d9 304 Double_t angle, radiusSector, xAAtubeCenter0, yAAtubeCenter0;
3ffa185f 305 TGeoCombiTrans *secRot = new TGeoCombiTrans(), *comrot;
30611568 306 TGeoVolume *vCarbonFiberSector[10];
54c9a3d9 307 TGeoMedium *medSPDcf;
308
d0048cec 309 // Define an assembly and fill it with the support of
54c9a3d9 310 // a single carbon fiber sector and staves in it
311 medSPDcf = GetMedium("SPD C (M55J)$", mgr);
30611568 312 for(Int_t is=0; is<10; is++)
313 {
314 vCarbonFiberSector[is] = new TGeoVolumeAssembly("ITSSPDCarbonFiberSectorV");
315 vCarbonFiberSector[is]->SetMedium(medSPDcf);
316 CarbonFiberSector(vCarbonFiberSector[is], is, xAAtubeCenter0, yAAtubeCenter0, mgr);
317 }
54c9a3d9 318
319 // Compute the radial shift out of the sectors
3ffa185f 320 radiusSector = kBeamPipeRadius + kSPDclossesStaveAA + staveThicknessAA;
321 radiusSector = GetSPDSectorTranslation(fSPDsectorX0.At(1), fSPDsectorY0.At(1),
322 fSPDsectorX1.At(1), fSPDsectorY1.At(1), radiusSector);
323 //radiusSector *= radiusSector; // squaring;
324 //radiusSector -= xAAtubeCenter0 * xAAtubeCenter0;
325 //radiusSector = -yAAtubeCenter0 + TMath::Sqrt(radiusSector);
d0048cec 326
3ffa185f 327 AliDebug(1, Form("SPDSector : radiusSector=%f\n",radiusSector));
328 i = 1;
329 AliDebug(1, Form("i= %d x0=%f y0=%f x1=%f y1=%f\n", i,
330 fSPDsectorX0.At(i), fSPDsectorY0.At(i),
331 fSPDsectorX1.At(i),fSPDsectorY1.At(i)));
d0048cec 332
54c9a3d9 333 // add 10 single sectors, by replicating the virtual sector defined above
334 // and placing at different angles
335 Double_t shiftX, shiftY, tub[2][6][3];
3ffa185f 336 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];
54c9a3d9 337 angle = kSectorStartingAngle;
338 secRot->RotateZ(angle);
339 TGeoVolumeAssembly *vcenteral = new TGeoVolumeAssembly("ITSSPD");
3ffa185f 340 moth->AddNode(vcenteral, 1, 0);
341 for(i = 0; i < kNSectorsTotal; i++) {
54c9a3d9 342 shiftX = -radiusSector * TMath::Sin(angle/fgkRadian);
343 shiftY = radiusSector * TMath::Cos(angle/fgkRadian);
d0048cec 344 //cout << "ANGLE = " << angle << endl;
3ffa185f 345 shiftX += 0.1094 * TMath::Cos((angle + 196.)/fgkRadian);
346 shiftY += 0.1094 * TMath::Sin((angle + 196.)/fgkRadian);
347 //shiftX -= 0.105;
348 //shiftY -= 0.031;
349 //shiftX -= 0.11 * TMath::Cos(angle/fgkRadian); // add by Alberto
350 //shiftY -= 0.11 * TMath::Sin(angle/fgkRadian); // don't ask me where that 0.11 comes from!
54c9a3d9 351 secRot->SetDx(shiftX);
352 secRot->SetDy(shiftY);
353 comrot = new TGeoCombiTrans(*secRot);
30611568 354 vcenteral->AddNode(vCarbonFiberSector[i],i+1,comrot);
54c9a3d9 355 for(j=0;j<2;j++)for(k=0;k<6;k++) // Transform Tube ends for each sector
356 comrot->LocalToMaster(tub[j][k],fTubeEndSector[i][j][k]);
357 if(GetDebug(5)) {
358 AliInfo(Form("i=%d angle=%g angle[rad]=%g radiusSector=%g "
359 "x=%g y=%g \n",i, angle, angle/fgkRadian,
360 radiusSector, shiftX, shiftY));
361 } // end if GetDebug(5)
362 angle += kSectorRelativeAngle;
363 secRot->RotateZ(kSectorRelativeAngle);
364 } // end for i
365 if(GetDebug(3)) moth->PrintNodes();
366 delete secRot;
d0048cec 367
7f69c251 368 CreateCones(moth);
15b84e14 369 CreateServices(moth);
a53658c6 370}
54c9a3d9 371//______________________________________________________________________
30611568 372void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth, Int_t sect,
54c9a3d9 373 Double_t &xAAtubeCenter0, Double_t &yAAtubeCenter0, TGeoManager *mgr)
bc3498f4 374{
30611568 375 // The method has been modified in order to build a support sector
376 // whose shape is dependent on the sector number; the aim is to get
377 // as close as possible to the shape inferred from alignment
378 // and avoid as much as possible overlaps generated by alignment.
54c9a3d9 379 //
380 // Define the detail SPD Carbon fiber support Sector geometry.
381 // Based on the drawings:
382 /*
383 http:///QA-construzione-profilo-modulo.ps
384 */
385 // - ALICE-Pixel "Costruzione Profilo Modulo" (march 25 2004)
386 // - ALICE-SUPPORTO "Costruzione Profilo Modulo"
387 // ---
388 // Define outside radii as negative, where "outside" means that the
389 // center of the arc is outside of the object (feb 16 2004).
390 // ---
391 // Arguments [the one passed by ref contain output values]:
392 // Inputs:
393 // TGeoVolume *moth the voulme which will contain this object
394 // TGeoManager *mgr TGeo builder defauls is gGeoManager
395 // Outputs:
396 // Double_t &xAAtubeCenter0 (by ref) x location of the outer surface
397 // of the cooling tube center for tube 0.
398 // Double_t &yAAtubeCenter0 (by ref) y location of the outer surface
399 // of the cooling tube center for tube 0.
400 // Return:
401 // none.
402 // ---
403 // Int the two variables passed by reference values will be stored
404 // which will then be used to correctly locate this sector.
405 // The information used for this is the distance between the
406 // center of the #0 detector and the beam pipe.
407 // Measurements are taken at cross section A-A.
408 //
d0048cec 409
54c9a3d9 410 //TGeoMedium *medSPDfs = 0;//SPD support cone inserto stesalite 4411w
411 //TGeoMedium *medSPDfo = 0;//SPD support cone foam, Rohacell 50A.
412 //TGeoMedium *medSPDal = 0;//SPD support cone SDD mounting bracket Al
413 TGeoMedium *medSPDcf = GetMedium("SPD C (M55J)$", mgr);
414 TGeoMedium *medSPDss = GetMedium("INOX$", mgr);
415 TGeoMedium *medSPDair = GetMedium("AIR$", mgr);
416 TGeoMedium *medSPDcoolfl = GetMedium("Freon$", mgr); //ITSspdCoolingFluid
417 //
418 const Double_t ksecDz = 0.5 * 500.0 * fgkmm;
419 //const Double_t ksecLen = 30.0 * fgkmm;
420 const Double_t ksecCthick = 0.2 * fgkmm;
421 const Double_t ksecDipLength = 3.2 * fgkmm;
422 const Double_t ksecDipRadii = 0.4 * fgkmm;
423 //const Double_t ksecCoolingTubeExtraDepth = 0.86 * fgkmm;
424 //
425 // The following positions ('ksecX#' and 'ksecY#') and radii ('ksecR#')
426 // are the centers and radii of curvature of all the rounded corners
427 // between the straight borders of the SPD sector shape.
428 // To draw this SPD sector, the following steps are followed:
429 // 1) the (ksecX, ksecY) points are plotted
430 // and circles of the specified radii are drawn around them.
431 // 2) each pair of consecutive circles is connected by a line
d0048cec 432 // tangent to them, in accordance with the radii being "internal"
433 // or "external" with respect to the closed shape which describes
54c9a3d9 434 // the sector itself.
d0048cec 435 // The resulting connected shape is the section
54c9a3d9 436 // of the SPD sector surface in the transverse plane (XY).
437 //
438 const Double_t ksecX0 = -10.725 * fgkmm;
439 const Double_t ksecY0 = -14.853 * fgkmm;
440 const Double_t ksecR0 = -0.8 * fgkmm; // external
3ffa185f 441
30611568 442 const Double_t ksecR1 = +0.6 * fgkmm;
443 const Double_t ksecR2 = +0.6 * fgkmm;
444 const Double_t ksecR3 = -0.6 * fgkmm;
445 const Double_t ksecR4 = +0.8 * fgkmm;
446 const Double_t ksecR5 = +0.8 * fgkmm;
447 const Double_t ksecR6 = +0.6 * fgkmm;
448 const Double_t ksecR7 = -0.6 * fgkmm;
449 const Double_t ksecR8 = +0.6 * fgkmm;
450 const Double_t ksecR9 = -0.6 * fgkmm;
451 const Double_t ksecR10 = +0.6 * fgkmm;
452 const Double_t ksecR11 = -0.6 * fgkmm;
453 const Double_t ksecR12 = +0.85 * fgkmm;
454
455// // IDEAL GEOMETRY
456// const Double_t ksecX1[10] ={-1.3187,-1.3187,-1.3187,-1.3187,-1.3187,-1.3187,-1.3187,-1.3187,-1.3187,-1.3187};
457// const Double_t ksecY1[10] ={-1.9964,-1.9964,-1.9964,-1.9964,-1.9964,-1.9964,-1.9964,-1.9964,-1.9964,-1.9964};
458// const Double_t ksecX2[10] ={-0.3833,-0.3833,-0.3833,-0.3833,-0.3833,-0.3833,-0.3833,-0.3833,-0.3833,-0.3833};
459// const Double_t ksecY2[10] ={-1.7805,-1.7805,-1.7805,-1.7805,-1.7805,-1.7805,-1.7805,-1.7805,-1.7805,-1.7805};
460// const Double_t ksecX3[10] ={-0.3123,-0.3123,-0.3123,-0.3123,-0.3123,-0.3123,-0.3123,-0.3123,-0.3123,-0.3123};
461// const Double_t ksecY3[10] ={-1.4618,-1.4618,-1.4618,-1.4618,-1.4618,-1.4618,-1.4618,-1.4618,-1.4618,-1.4618};
462// const Double_t ksecX4[10] ={+1.1280,+1.1280,+1.1280,+1.1280,+1.1280,+1.1280,+1.1280,+1.1280,+1.1280,+1.1280};
463// const Double_t ksecY4[10] ={-1.4473,-1.4473,-1.4473,-1.4473,-1.4473,-1.4473,-1.4473,-1.4473,-1.4473,-1.4473};
464// const Double_t ksecX5[10] ={+1.9544,+1.9544,+1.9544,+1.9544,+1.9544,+1.9544,+1.9544,+1.9544,+1.9544,+1.9544};
465// const Double_t ksecY5[10] ={+1.0961,+1.0961,+1.0961,+1.0961,+1.0961,+1.0961,+1.0961,+1.0961,+1.0961,+1.0961};
466// const Double_t ksecX6[10] ={+1.0830,+1.0830,+1.0830,+1.0830,+1.0830,+1.0830,+1.0830,+1.0830,+1.0830,+1.0830};
467// const Double_t ksecY6[10] ={+1.6868,+1.6868,+1.6868,+1.6868,+1.6868,+1.6868,+1.6868,+1.6868,+1.6868,+1.6868};
468// const Double_t ksecX7[10] ={+1.1581,+1.1581,+1.1581,+1.1581,+1.1581,+1.1581,+1.1581,+1.1581,+1.1581,+1.1581};
469// const Double_t ksecY7[10] ={+1.3317,+1.3317,+1.3317,+1.3317,+1.3317,+1.3317,+1.3317,+1.3317,+1.3317,+1.3317};
470// const Double_t ksecX8[10] ={-0.0733,-0.0733,-0.0733,-0.0733,-0.0733,-0.0733,-0.0733,-0.0733,-0.0733,-0.0733};
471// const Double_t ksecY8[10] ={+1.7486,+1.7486,+1.7486,+1.7486,+1.7486,+1.7486,+1.7486,+1.7486,+1.7486,+1.7486};
472// const Double_t ksecX9[10] ={+0.0562,+0.0562,+0.0562,+0.0562,+0.0562,+0.0562,+0.0562,+0.0562,+0.0562,+0.0562};
473// const Double_t ksecY9[10] ={+1.4107,+1.4107,+1.4107,+1.4107,+1.4107,+1.4107,+1.4107,+1.4107,+1.4107,+1.4107};
474// const Double_t ksecX10[10]={-1.2252,-1.2252,-1.2252,-1.2252,-1.2252,-1.2252,-1.2252,-1.2252,-1.2252,-1.2252};
475// const Double_t ksecY10[10]={+1.6298,+1.6298,+1.6298,+1.6298,+1.6298,+1.6298,+1.6298,+1.6298,+1.6298,+1.6298};
476// const Double_t ksecX11[10]={-1.0445,-1.0445,-1.0445,-1.0445,-1.0445,-1.0445,-1.0445,-1.0445,-1.0445,-1.0445};
477// const Double_t ksecY11[10]={+1.3162,+1.3162,+1.3162,+1.3162,+1.3162,+1.3162,+1.3162,+1.3162,+1.3162,+1.3162};
478// const Double_t ksecX12[10]={-2.2276,-2.2276,-2.2276,-2.2276,-2.2276,-2.2276,-2.2276,-2.2276,-2.2276,-2.2276};
479// const Double_t ksecY12[10]={+1.2948,+1.2948,+1.2948,+1.2948,+1.2948,+1.2948,+1.2948,+1.2948,+1.2948,+1.2948};
480
481
482// MODIFIED GEOMETRY according with partial alignment of Staves relative to Sectors
483// last numbers: 2010/06/11 (ML)
484
485 const Double_t ksecX1[10]={-1.305917, -1.322242, -1.300649, -1.298700, -1.290830, -1.274307, -1.276433, -1.286468, -1.274381, -1.314864};
486 const Double_t ksecY1[10]={-1.997857, -2.018611, -2.005854, -2.004897, -1.995517, -2.002552, -1.995860, -2.021062, -2.012931, -2.043967};
487 const Double_t ksecX2[10]={-0.366115, -0.385562, -0.372689, -0.365682, -0.348432, -0.348442, -0.342468, -0.354071, -0.346900, -0.381275};
488 const Double_t ksecY2[10]={-1.801679, -1.808306, -1.759315, -1.778851, -1.811655, -1.747888, -1.773811, -1.792427, -1.764514, -1.820324};
489// const Double_t ksecX1[10]={-1.305917, -1.322242, -1.300649, -1.298700, -1.290830, -1.274307, -1.276433, -1.286468, -1.274381, -1.325864};
490// const Double_t ksecY1[10]={-1.997857, -2.018611, -2.005854, -2.004897, -1.995517, -2.002552, -1.995860, -2.021062, -2.012931, -2.032967};
491// const Double_t ksecX2[10]={-0.366115, -0.385562, -0.372689, -0.365682, -0.348432, -0.348442, -0.342468, -0.354071, -0.346900, -0.392275};
492// const Double_t ksecY2[10]={-1.801679, -1.808306, -1.759315, -1.778851, -1.811655, -1.747888, -1.773811, -1.792427, -1.764514, -1.809324};
493 const Double_t ksecX3[10]={-0.314030, -0.315531, -0.347521, -0.337675, -0.300420, -0.378487, -0.330729, -0.330850, -0.362360, -0.321097};
494 const Double_t ksecY3[10]={-1.452488, -1.460418, -1.447060, -1.443146, -1.472410, -1.430019, -1.469073, -1.472048, -1.462010, -1.444355};
495 const Double_t ksecX4[10]={1.124299, 1.124162, 1.089523, 1.095520, 1.136171, 1.058616, 1.105626, 1.106433, 1.077455, 1.117946};
496 const Double_t ksecY4[10]={-1.458714, -1.452649, -1.465297, -1.492717, -1.494665, -1.447732, -1.493369, -1.488126, -1.452925, -1.443447};
497 const Double_t ksecX5[10]={1.951621, 1.939284, 1.931830, 1.935235, 1.952206, 1.939082, 1.924822, 1.940114, 1.918160, 1.960017};
498 const Double_t ksecY5[10]={1.092731, 1.118870, 1.129765, 1.129422, 1.081511, 1.127387, 1.103960, 1.101784, 1.121428, 1.150110};
499 const Double_t ksecX6[10]={1.070070, 1.048297, 1.035920, 1.049049, 1.083621, 1.045882, 1.050399, 1.067823, 1.037967, 1.070850};
500 const Double_t ksecY6[10]={1.667590, 1.678571, 1.681383, 1.696892, 1.676520, 1.683470, 1.689988, 1.691111, 1.698432, 1.712770};
501 const Double_t ksecX7[10]={1.139398, 1.150471, 1.150074, 1.132807, 1.150192, 1.124064, 1.124335, 1.137723, 1.143056, 1.130568};
502 const Double_t ksecY7[10]={1.345588, 1.356062, 1.342468, 1.320467, 1.335807, 1.334477, 1.328622, 1.347184, 1.319861, 1.308420};
503 const Double_t ksecX8[10]={-0.096963, -0.098603, -0.095286, -0.099990, -0.075132, -0.121593, -0.108673, -0.104237, -0.092082, -0.104044};
504 const Double_t ksecY8[10]={1.751207, 1.731467, 1.726908, 1.734219, 1.766159, 1.718203, 1.741891, 1.739743, 1.728288, 1.718046};
505 const Double_t ksecX9[10]={0.047615, 0.087875, 0.034917, 0.071603, 0.026468, 0.091619, 0.051994, 0.059947, 0.079785, 0.043443};
506 const Double_t ksecY9[10]={1.414699, 1.403187, 1.399061, 1.403430, 1.435056, 1.384557, 1.397692, 1.420269, 1.391372, 1.398954};
507 const Double_t ksecX10[10]={-1.233255, -1.186874, -1.246702, -1.213368, -1.259425, -1.190067, -1.225655, -1.224171, -1.197833, -1.237182};
508 const Double_t ksecY10[10]={1.635767, 1.646249, 1.617336, 1.608928, 1.636944, 1.602583, 1.630504, 1.629065, 1.624295, 1.620934};
509 const Double_t ksecX11[10]={-1.018270, -1.031317, -0.960524, -1.001155, -1.045437, -0.986867, -1.002685, -1.017369, -1.005614, -0.985385};
510 const Double_t ksecY11[10]={1.318108, 1.330683, 1.301572, 1.314410, 1.326680, 1.295226, 1.306372, 1.309414, 1.306542, 1.307086};
511 const Double_t ksecX12[10]={-2.199004, -2.214964, -2.139247, -2.180547, -2.224505, -2.165324, -2.175883, -2.193485, -2.183227, -2.161570};
512 const Double_t ksecY12[10]={1.317677, 1.303982, 1.317057, 1.324766, 1.339537, 1.312715, 1.359642, 1.343638, 1.330234, 1.340836};
513
514
54c9a3d9 515 const Double_t ksecR13 = -0.8 * fgkmm; // external
516 const Double_t ksecAngleSide13 = 36.0 * fgkDegree;
517 //
518 const Int_t ksecNRadii = 20;
519 const Int_t ksecNPointsPerRadii = 4;
520 const Int_t ksecNCoolingTubeDips = 6;
521 //
522 // Since the rounded parts are approximated by a regular polygon
523 // and a cooling tube of the propper diameter must fit, a scaling factor
524 // increases the size of the polygon for the tube to fit.
525 //const Double_t ksecRCoolScale = 1./TMath::Cos(TMath::Pi()/
526 // (Double_t)ksecNPointsPerRadii);
527 const Double_t ksecZEndLen = 30.000 * fgkmm;
528 //const Double_t ksecZFlangLen = 45.000 * fgkmm;
529 const Double_t ksecTl = 0.860 * fgkmm;
530 const Double_t ksecCthick2 = 0.600 * fgkmm;
531 //const Double_t ksecCthick3 = 1.80 * fgkmm;
532 //const Double_t ksecSidelen = 22.0 * fgkmm;
533 //const Double_t ksecSideD5 = 3.679 * fgkmm;
534 //const Double_t ksecSideD12 = 7.066 * fgkmm;
535 const Double_t ksecRCoolOut = 2.400 * fgkmm;
536 const Double_t ksecRCoolIn = 2.000 * fgkmm;
537 const Double_t ksecDl1 = 5.900 * fgkmm;
538 const Double_t ksecDl2 = 8.035 * fgkmm;
539 const Double_t ksecDl3 = 4.553 * fgkmm;
540 const Double_t ksecDl4 = 6.978 * fgkmm;
541 const Double_t ksecDl5 = 6.978 * fgkmm;
542 const Double_t ksecDl6 = 6.978 * fgkmm;
543 const Double_t ksecCoolTubeThick = 0.04 * fgkmm;
544 const Double_t ksecCoolTubeROuter = 2.6 * fgkmm;
545 const Double_t ksecCoolTubeFlatX = 3.696 * fgkmm;
546 const Double_t ksecCoolTubeFlatY = 0.68 * fgkmm;
547 //const Double_t ksecBeamX0 = 0.0 * fgkmm; // guess
548 //const Double_t ksecBeamY0 = (15.223 + 40.) * fgkmm; // guess
549 //
550 // redefine some of the points already defined above
551 // in the format of arrays (???)
552 const Int_t ksecNPoints = (ksecNPointsPerRadii + 1) * ksecNRadii + 8;
553 Double_t secX[ksecNRadii] = {
30611568 554 ksecX0, ksecX1[sect], -1000.0,
555 ksecX2[sect], ksecX3[sect], -1000.0,
556 ksecX4[sect], ksecX5[sect], -1000.0,
557 ksecX6[sect], ksecX7[sect], -1000.0,
558 ksecX8[sect], ksecX9[sect], -1000.0,
559 ksecX10[sect], ksecX11[sect], -1000.0,
560 ksecX12[sect], -1000.0
54c9a3d9 561 };
562 Double_t secY[ksecNRadii] = {
30611568 563 ksecY0, ksecY1[sect], -1000.0,
564 ksecY2[sect], ksecY3[sect], -1000.0,
565 ksecY4[sect], ksecY5[sect], -1000.0,
566 ksecY6[sect], ksecY7[sect], -1000.0,
567 ksecY8[sect], ksecY9[sect], -1000.0,
568 ksecY10[sect], ksecY11[sect], -1000.0,
569 ksecY12[sect], -1000.0
54c9a3d9 570 };
d0048cec 571 Double_t secR[ksecNRadii] = {
54c9a3d9 572 ksecR0, ksecR1, -.5 * ksecDipLength - ksecDipRadii,
573 ksecR2, ksecR3, -.5 * ksecDipLength - ksecDipRadii,
574 ksecR4, ksecR5, -.5 * ksecDipLength - ksecDipRadii,
575 ksecR6, ksecR7, -.5 * ksecDipLength - ksecDipRadii,
576 ksecR8, ksecR9, -.5 * ksecDipLength - ksecDipRadii,
577 ksecR10, ksecR11, -.5 * ksecDipLength - ksecDipRadii,
578 ksecR12, ksecR13
579 };
c890eba4 580
54c9a3d9 581 Double_t secX2[ksecNRadii];
582 Double_t secY2[ksecNRadii];
583 Double_t secR2[ksecNRadii] = {
584 ksecR0, ksecR1, ksecRCoolOut,
585 ksecR2, ksecR3, ksecRCoolOut,
586 ksecR4, ksecR5, ksecRCoolOut,
587 ksecR6, ksecR7, ksecRCoolOut,
588 ksecR8, ksecR9, ksecRCoolOut,
589 ksecR10, ksecR11, ksecRCoolOut,
590 ksecR12, ksecR13
591 };
d0048cec 592 Double_t secDip2[ksecNCoolingTubeDips] = {
593 ksecDl1, ksecDl2, ksecDl3,
594 ksecDl4, ksecDl5, ksecDl6
54c9a3d9 595 };
596 Double_t secX3[ksecNRadii];
597 Double_t secY3[ksecNRadii];
598 const Int_t ksecDipIndex[ksecNCoolingTubeDips] = {2, 5, 8, 11, 14, 17};
599 Double_t secAngleStart[ksecNRadii];
600 Double_t secAngleEnd[ksecNRadii];
3b81eea3 601 for(Int_t i = 0; i < ksecNRadii; i++)secAngleEnd[i] = 0.;
54c9a3d9 602 Double_t secAngleStart2[ksecNRadii];
603 Double_t secAngleEnd2[ksecNRadii];
604 Double_t secAngleTurbo[ksecNCoolingTubeDips] = {0., 0., 0., 0., 0., 0.0};
605 //Double_t secAngleStart3[ksecNRadii];
606 //Double_t secAngleEnd3[ksecNRadii];
607 Double_t xpp[ksecNPoints], ypp[ksecNPoints];
608 Double_t xpp2[ksecNPoints], ypp2[ksecNPoints];
609 Double_t *xp[ksecNRadii], *xp2[ksecNRadii];
610 Double_t *yp[ksecNRadii], *yp2[ksecNRadii];
611 TGeoXtru *sA0, *sA1, *sB0, *sB1,*sB2;
612 TGeoBBox *sB3;
613 TGeoEltu *sTA0, *sTA1;
614 TGeoTube *sTB0, *sTB1; //,*sM0;
615 TGeoRotation *rot;
616 TGeoTranslation *trans;
617 TGeoCombiTrans *rotrans;
618 Double_t t, t0, t1, a, b, x0, y0,z0, x1, y1;
619 Int_t i, j, k, m;
620 Bool_t tst;
621
622 if(!moth) {
623 AliError("Container volume (argument) is NULL");
624 return;
625 } // end if(!moth)
626 for(i = 0; i < ksecNRadii; i++) {
627 xp[i] = &(xpp[i*(ksecNPointsPerRadii+1)]);
628 yp[i] = &(ypp[i*(ksecNPointsPerRadii+1)]);
629 xp2[i] = &(xpp2[i*(ksecNPointsPerRadii+1)]);
630 yp2[i] = &(ypp2[i*(ksecNPointsPerRadii+1)]);
631 secX2[i] = secX[i];
632 secY2[i] = secY[i];
633 secX3[i] = secX[i];
634 secY3[i] = secY[i];
635 } // end for i
636 //
637 // find starting and ending angles for all but cooling tube sections
638 secAngleStart[0] = 0.5 * ksecAngleSide13;
639 for(i = 0; i < ksecNRadii - 2; i++) {
640 tst = kFALSE;
641 for(j=0;j<ksecNCoolingTubeDips;j++) tst = (tst||i==ksecDipIndex[j]);
642 if (tst) continue;
643 tst = kFALSE;
644 for(j=0;j<ksecNCoolingTubeDips;j++) tst =(tst||(i+1)==ksecDipIndex[j]);
645 if (tst) j = i+2; else j = i+1;
646 AnglesForRoundedCorners(secX[i],secY[i],secR[i],secX[j],secY[j],
647 secR[j],t0,t1);
648 secAngleEnd[i] = t0;
649 secAngleStart[j] = t1;
650 if(secR[i] > 0.0 && secR[j] > 0.0) {
651 if(secAngleStart[i] > secAngleEnd[i]) secAngleEnd[i] += 360.0;
652 } // end if(secR[i]>0.0 && secR[j]>0.0)
653 secAngleStart2[i] = secAngleStart[i];
654 secAngleEnd2[i] = secAngleEnd[i];
655 } // end for i
656 secAngleEnd[ksecNRadii-2] = secAngleStart[ksecNRadii-2] +
657 (secAngleEnd[ksecNRadii-5] - secAngleStart[ksecNRadii-5]);
658 if (secAngleEnd[ksecNRadii-2] < 0.0) secAngleEnd[ksecNRadii-2] += 360.0;
659 secAngleStart[ksecNRadii-1] = secAngleEnd[ksecNRadii-2] - 180.0;
660 secAngleEnd[ksecNRadii-1] = secAngleStart[0];
661 secAngleStart2[ksecNRadii-2] = secAngleStart[ksecNRadii-2];
662 secAngleEnd2[ksecNRadii-2] = secAngleEnd[ksecNRadii-2];
663 secAngleStart2[ksecNRadii-1] = secAngleStart[ksecNRadii-1];
664 secAngleEnd2[ksecNRadii-1] = secAngleEnd[ksecNRadii-1];
665 //
666 // find location of circle last rounded corner.
667 i = 0;
668 j = ksecNRadii - 2;
669 t0 = TanD(secAngleStart[i]-90.);
670 t1 = TanD(secAngleEnd[j]-90.);
671 t = secY[i] - secY[j];
672 // NOTE: secR[i=0] < 0; secR[j=18] > 0; and secR[j+1=19] < 0
673 t += (-secR[i]+secR[j+1]) * SinD(secAngleStart[i]);
674 t -= (secR[j]-secR[j+1]) * SinD(secAngleEnd[j]);
675 t += t1 * secX[j] - t0*secX[i];
676 t += t1 * (secR[j] - secR[j+1]) * CosD(secAngleEnd[j]);
677 t -= t0 * (-secR[i]+secR[j+1]) * CosD(secAngleStart[i]);
678 secX[ksecNRadii-1] = t / (t1-t0);
679 secY[ksecNRadii-1] = TanD(90.0+0.5*ksecAngleSide13)*
680 (secX[ksecNRadii-1]-secX[0])+secY[0];
681 secX2[ksecNRadii-1] = secX[ksecNRadii-1];
682 secY2[ksecNRadii-1] = secY[ksecNRadii-1];
683 secX3[ksecNRadii-1] = secX[ksecNRadii-1];
684 secY3[ksecNRadii-1] = secY[ksecNRadii-1];
d0048cec 685
54c9a3d9 686 // find location of cooling tube centers
687 for(i = 0; i < ksecNCoolingTubeDips; i++) {
688 j = ksecDipIndex[i];
689 x0 = secX[j-1] + TMath::Abs(secR[j-1]) * CosD(secAngleEnd[j-1]);
690 y0 = secY[j-1] + TMath::Abs(secR[j-1]) * SinD(secAngleEnd[j-1]);
691 x1 = secX[j+1] + TMath::Abs(secR[j+1]) * CosD(secAngleStart[j+1]);
692 y1 = secY[j+1] + TMath::Abs(secR[j+1]) * SinD(secAngleStart[j+1]);
693 t0 = TMath::Sqrt((x0-x1)*(x0-x1)+(y0-y1)*(y0-y1));
694 t = secDip2[i] / t0;
695 a = x0+(x1-x0) * t;
696 b = y0+(y1-y0) * t;
d0048cec 697 if(i == 0) {
54c9a3d9 698 // get location of tube center->Surface for locating
699 // this sector around the beam pipe.
700 // This needs to be double checked, but I need my notes for that.
701 // (Bjorn Nilsen)
702 xAAtubeCenter0 = x0 + (x1 - x0) * t * 0.5;
703 yAAtubeCenter0 = y0 + (y1 - y0) * t * 0.5;
704 }// end if i==0
705 if(a + b*(a - x0) / (b - y0) > 0.0) {
706 secX[j] = a + TMath::Abs(y1-y0) * 2.0 * ksecDipRadii/t0;
707 secY[j] = b - TMath::Sign(2.0*ksecDipRadii,y1-y0) * (x1-x0)/t0;
708 secX2[j] = a + TMath::Abs(y1-y0) * ksecTl/t0;
709 secY2[j] = b - TMath::Sign(ksecTl,y1-y0) * (x1-x0) / t0;
d0048cec 710 secX3[j] = a + TMath::Abs(y1-y0) *
54c9a3d9 711 (2.0*ksecDipRadii-0.5*ksecCoolTubeFlatY)/t0;
712 secY3[j] = b - TMath::Sign(2.0*ksecDipRadii-0.5*ksecCoolTubeFlatY,
713 y1-y0)*(x1-x0)/t0;
714 } else {
715 secX[j] = a - TMath::Abs(y1-y0)*2.0*ksecDipRadii/t0;
716 secY[j] = b + TMath::Sign(2.0*ksecDipRadii,y1-y0)*(x1-x0)/t0;
717 secX2[j] = a - TMath::Abs(y1-y0)*ksecTl/t0;
718 secY2[j] = b + TMath::Sign(ksecTl,y1-y0)*(x1-x0)/t0;
719 secX3[j] = a - TMath::Abs(y1-y0)*(2.0*ksecDipRadii-0.5*
720 ksecCoolTubeFlatY)/t0;
721 secY3[j] = b + TMath::Sign(2.0*ksecDipRadii-0.5*ksecCoolTubeFlatY,
722 y1-y0)*(x1-x0)/t0;
723 } // end if(a+b*(a-x0)/(b-y0)>0.0)
d0048cec 724
54c9a3d9 725 // Set up Start and End angles to correspond to start/end of dips.
726 t1 = (secDip2[i]-TMath::Abs(secR[j])) / t0;
727 secAngleStart[j] =TMath::RadToDeg()*TMath::ATan2(y0+(y1-y0)*t1-secY[j],
728 x0+(x1-x0)*t1-secX[j]);
729 if (secAngleStart[j]<0.0) secAngleStart[j] += 360.0;
730 secAngleStart2[j] = secAngleStart[j];
731 t1 = (secDip2[i]+TMath::Abs(secR[j]))/t0;
732 secAngleEnd[j] = TMath::RadToDeg()*TMath::ATan2(y0+(y1-y0)*t1-secY[j],
733 x0+(x1-x0)*t1-secX[j]);
734 if (secAngleEnd[j]<0.0) secAngleEnd[j] += 360.0;
735 secAngleEnd2[j] = secAngleEnd[j];
736 if (secAngleEnd[j]>secAngleStart[j]) secAngleEnd[j] -= 360.0;
737 secR[j] = TMath::Sqrt(secR[j]*secR[j]+4.0*ksecDipRadii*ksecDipRadii);
738 } // end for i
d0048cec 739
54c9a3d9 740 // Special cases
741 secAngleStart2[8] -= 360.;
742 secAngleStart2[11] -= 360.;
743
744 SPDsectorShape(ksecNRadii, secX, secY, secR, secAngleStart, secAngleEnd,
745 ksecNPointsPerRadii, m, xp, yp);
746
747 // Fix up dips to be square.
748 for(i = 0; i < ksecNCoolingTubeDips; i++) {
749 j = ksecDipIndex[i];
750 t = 0.5*ksecDipLength+ksecDipRadii;
751 t0 = TMath::RadToDeg()*TMath::ATan(2.0*ksecDipRadii/t);
752 t1 = secAngleEnd[j] + t0;
753 t0 = secAngleStart[j] - t0;
754 x0 = xp[j][1] = secX[j] + t*CosD(t0);
755 y0 = yp[j][1] = secY[j] + t*SinD(t0);
756 x1 = xp[j][ksecNPointsPerRadii-1] = secX[j] + t*CosD(t1);
757 y1 = yp[j][ksecNPointsPerRadii-1] = secY[j] + t*SinD(t1);
758 t0 = 1./((Double_t)(ksecNPointsPerRadii-2));
759 for(k = 2; k < ksecNPointsPerRadii - 1; k++) {
760 // extra points spread them out.
761 t = ((Double_t)(k-1)) * t0;
762 xp[j][k] = x0+(x1-x0) * t;
763 yp[j][k] = y0+(y1-y0) * t;
764 } // end for k
765 secAngleTurbo[i] = -TMath::RadToDeg() * TMath::ATan2(y1-y0, x1-x0);
d0048cec 766 if(GetDebug(3)) {
54c9a3d9 767 AliInfo(
768 Form("i=%d -- angle=%f -- x0,y0=(%f, %f) -- x1,y1=(%f, %f)",
769 i, secAngleTurbo[i], x0, y0, x1, y1));
770 } // end if GetDebug(3)
771 } // end for i
772 sA0 = new TGeoXtru(2);
773 sA0->SetName("ITS SPD Carbon fiber support Sector A0");
774 sA0->DefinePolygon(m, xpp, ypp);
775 sA0->DefineSection(0, -ksecDz);
776 sA0->DefineSection(1, ksecDz);
d0048cec 777
54c9a3d9 778 // store the edges of each XY segment which defines
779 // one of the plane zones where staves will have to be placed
780 fSPDsectorX0.Set(ksecNCoolingTubeDips);
781 fSPDsectorY0.Set(ksecNCoolingTubeDips);
782 fSPDsectorX1.Set(ksecNCoolingTubeDips);
783 fSPDsectorY1.Set(ksecNCoolingTubeDips);
784 Int_t ixy0, ixy1;
785 for(i = 0; i < ksecNCoolingTubeDips; i++) {
786 // Find index in xpp[] and ypp[] corresponding to where the
787 // SPD ladders are to be attached. Order them according to
788 // the ALICE numbering schema. Using array of indexes (+-1 for
d0048cec 789 // cooling tubes. For any "bend/dip/edge, there are
54c9a3d9 790 // ksecNPointsPerRadii+1 points involved.
791 if(i == 0) j = 1;
792 else if (i == 1) j = 0;
793 else j = i;
794 ixy0 = (ksecDipIndex[j]-1)*(ksecNPointsPerRadii+1)+
795 (ksecNPointsPerRadii);
796 ixy1 = (ksecDipIndex[j]+1) * (ksecNPointsPerRadii+1);
797 fSPDsectorX0[i] = sA0->GetX(ixy0);
798 fSPDsectorY0[i] = sA0->GetY(ixy0);
799 fSPDsectorX1[i] = sA0->GetX(ixy1);
800 fSPDsectorY1[i] = sA0->GetY(ixy1);
801 } // end for i
d0048cec 802
54c9a3d9 803 //printf("SectorA#%d ",0);
804 InsidePoint(xpp[m-1],ypp[m-1],xpp[0],ypp[0],xpp[1],ypp[1],ksecCthick,
805 xpp2[0],ypp2[0]);
806 for(i = 1; i < m - 1; i++) {
807 j = i / (ksecNPointsPerRadii+1);
808 //printf("SectorA#%d ",i);
809 InsidePoint(xpp[i-1],ypp[i-1],xpp[i],ypp[i],xpp[i+1],ypp[i+1],
810 ksecCthick,xpp2[i],ypp2[i]);
811 } // end for i
812 //printf("SectorA#%d ",m);
813 InsidePoint(xpp[m-2],ypp[m-2],xpp[m-1],ypp[m-1],xpp[0],ypp[0],
814 ksecCthick,xpp2[m-1],ypp2[m-1]);
815 // Fix center value of cooling tube dip and
816 // find location of cooling tube centers
817 for(i = 0; i < ksecNCoolingTubeDips; i++) {
818 j = ksecDipIndex[i];
819 x0 = xp2[j][1];
820 y0 = yp2[j][1];
821 x1 = xp2[j][ksecNPointsPerRadii-1];
822 y1 = yp2[j][ksecNPointsPerRadii-1];
823 t0 = TMath::Sqrt((x0-x1)*(x0-x1)+(y0-y1)*(y0-y1));
824 t = secDip2[i]/t0;
825 for(k = 2; k < ksecNPointsPerRadii - 1; k++) {
826 // extra points spread them out.
827 t = ((Double_t)(k-1)) * t0;
828 xp2[j][k] = x0+(x1-x0) * t;
829 yp2[j][k] = y0+(y1-y0) * t;
830 } // end for k
831 } // end for i
832 sA1 = new TGeoXtru(2);
833 sA1->SetName("ITS SPD Carbon fiber support Sector Air A1");
834 sA1->DefinePolygon(m, xpp2, ypp2);
835 sA1->DefineSection(0, -ksecDz);
836 sA1->DefineSection(1, ksecDz);
837 //
838 // Error in TGeoEltu. Semi-axis X must be < Semi-axis Y (?).
839 sTA0 = new TGeoEltu("ITS SPD Cooling Tube TA0", 0.5 * ksecCoolTubeFlatY,
840 0.5 * ksecCoolTubeFlatX, ksecDz);
d0048cec 841 sTA1 = new TGeoEltu("ITS SPD Cooling Tube coolant TA1",
54c9a3d9 842 sTA0->GetA() - ksecCoolTubeThick,
843 sTA0->GetB()-ksecCoolTubeThick,ksecDz);
844 SPDsectorShape(ksecNRadii,secX2,secY2,secR2,secAngleStart2,secAngleEnd2,
845 ksecNPointsPerRadii, m, xp, yp);
846 sB0 = new TGeoXtru(2);
847 sB0->SetName("ITS SPD Carbon fiber support Sector End B0");
848 sB0->DefinePolygon(m, xpp, ypp);
849 sB0->DefineSection(0, ksecDz);
850 sB0->DefineSection(1, ksecDz + ksecZEndLen);
851
852 //printf("SectorB#%d ",0);
53506676 853 // Points around the most sharpened tips have to be avoided - M.S. 24 feb 09
854 const Int_t nSpecialPoints = 5;
855 const Int_t kSpecialPoints[nSpecialPoints] = {7, 17, 47, 62, 77};
856 Int_t i2 = 0;
54c9a3d9 857 InsidePoint(xpp[m-1],ypp[m-1],xpp[0],ypp[0],xpp[1],ypp[1],
53506676 858 ksecCthick2,xpp2[i2],ypp2[i2]);
54c9a3d9 859 for(i = 1; i < m - 1; i++) {
860 t = ksecCthick2;
861 for(k = 0; k < ksecNCoolingTubeDips; k++)
862 if((i/(ksecNPointsPerRadii+1))==ksecDipIndex[k])
863 if(!(ksecDipIndex[k]*(ksecNPointsPerRadii+1) == i ||
864 ksecDipIndex[k]*(ksecNPointsPerRadii+1) +
865 ksecNPointsPerRadii == i))
866 t = ksecRCoolOut-ksecRCoolIn;
867 //printf("SectorB#%d ",i);
53506676 868 Bool_t useThisPoint = kTRUE;
869 for(Int_t ii = 0; ii < nSpecialPoints; ii++)
870 if ( (i == kSpecialPoints[ii] - 1) ||
871 (i == kSpecialPoints[ii] + 1) ) useThisPoint = kFALSE;
872 if (useThisPoint) {
873 i2++;
874 InsidePoint(xpp[i-1],ypp[i-1],xpp[i],ypp[i],xpp[i+1],ypp[i+1],t,
875 xpp2[i2],ypp2[i2]);
876 }
54c9a3d9 877 }// end for i
878 //printf("SectorB#%d ",m);
53506676 879 i2++;
54c9a3d9 880 InsidePoint(xpp[m-2],ypp[m-2],xpp[m-1],ypp[m-1],xpp[0],ypp[0],
53506676 881 ksecCthick2,xpp2[i2],ypp2[i2]);
54c9a3d9 882 sB1 = new TGeoXtru(2);
883 sB1->SetName("ITS SPD Carbon fiber support Sector Air End B1");
53506676 884 sB1->DefinePolygon(i2+1, xpp2, ypp2);
54c9a3d9 885 sB1->DefineSection(0,sB0->GetZ(0));
886 sB1->DefineSection(1,sB0->GetZ(1)-ksecCthick2);
887 const Double_t kspdEndHoleRadius1=5.698*fgkmm;
888 const Double_t kspdEndHoleRadius2=2.336*fgkmm;
889 const Double_t kspdEndHoleDisplacement=6.29*fgkmm;
890 k = (m-1)/4;
891 for(i=0;i<=k;i++){
892 t= ((Double_t)i)/((Double_t)(k));
893 if(!CFHolePoints(t,kspdEndHoleRadius1,kspdEndHoleRadius2,
894 kspdEndHoleDisplacement,xpp2[i],ypp2[i])){
895 Warning("CarbonFiberSector","CFHolePoints failed "
896 "i=%d m=%d k=%d t=%e",i,m,k,t);
897 } // end if
898 // simitry in each quadrant.
899 xpp2[2*k-i] = -xpp2[i];
900 ypp2[2*k-i] = ypp2[i];
901 xpp2[2*k+i] = -xpp2[i];
902 ypp2[2*k+i] = -ypp2[i];
903 xpp2[4*k-i] = xpp2[i];
904 ypp2[4*k-i] = -ypp2[i];
905 }// end for i
906 //xpp2[m-1] = xpp2[0]; // begining point in
907 //ypp2[m-1] = ypp2[0]; // comment with end point
908 sB2 = new TGeoXtru(2);
909 sB2->SetName("ITS SPD Hole in Carbon fiber support End plate");
910 sB2->DefinePolygon(4*k, xpp2, ypp2);
911 sB2->DefineSection(0,sB1->GetZ(1));
912 sB2->DefineSection(1,sB0->GetZ(1));
913 // SPD sector mount blocks
914 const Double_t kMountBlock[3] = {0.5*(1.8-0.2)*fgkmm,0.5*22.0*fgkmm,
915 0.5*45.0*fgkmm};
916 sB3 = new TGeoBBox((Double_t*)kMountBlock);
917 // SPD sector cooling tubes
918 sTB0 = new TGeoTube("ITS SPD Cooling Tube End TB0", 0.0,
7708d5f3 919 0.5*ksecCoolTubeROuter,0.5*(sB1->GetZ(1)-sB1->GetZ(0)));
54c9a3d9 920 sTB1 = new TGeoTube("ITS SPD Cooling Tube End coolant TB0", 0.0,
921 sTB0->GetRmax() - ksecCoolTubeThick,sTB0->GetDz());
922 //
923 if(GetDebug(3)) {
924 if(medSPDcf) medSPDcf->Dump(); else AliInfo("medSPDcf = 0");
925 if(medSPDss) medSPDss->Dump(); else AliInfo("medSPDss = 0");
926 if(medSPDair) medSPDair->Dump(); else AliInfo("medSPDAir = 0");
927 if(medSPDcoolfl) medSPDcoolfl->Dump();else AliInfo("medSPDcoolfl = 0");
928 sA0->InspectShape();
929 sA1->InspectShape();
930 sB0->InspectShape();
931 sB1->InspectShape();
932 sB2->InspectShape();
933 } // end if(GetDebug(3))
d0048cec 934
54c9a3d9 935 // create the assembly of the support and place staves on it
936 TGeoVolumeAssembly *vM0 = new TGeoVolumeAssembly(
937 "ITSSPDSensitiveVirtualvolumeM0");
938 StavesInSector(vM0);
939 // create other volumes with some graphical settings
940 TGeoVolume *vA0 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorA0",
941 sA0, medSPDcf);
942 vA0->SetVisibility(kTRUE);
943 vA0->SetLineColor(4); // Blue
944 vA0->SetLineWidth(1);
945 vA0->SetFillColor(vA0->GetLineColor());
946 vA0->SetFillStyle(4010); // 10% transparent
947 TGeoVolume *vA1 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorAirA1",
948 sA1, medSPDair);
949 vA1->SetVisibility(kTRUE);
950 vA1->SetLineColor(7); // light Blue
951 vA1->SetLineWidth(1);
952 vA1->SetFillColor(vA1->GetLineColor());
953 vA1->SetFillStyle(4090); // 90% transparent
954 TGeoVolume *vTA0 = new TGeoVolume("ITSSPDCoolingTubeTA0", sTA0, medSPDss);
955 vTA0->SetVisibility(kTRUE);
956 vTA0->SetLineColor(15); // gray
957 vTA0->SetLineWidth(1);
958 vTA0->SetFillColor(vTA0->GetLineColor());
959 vTA0->SetFillStyle(4000); // 0% transparent
960 TGeoVolume *vTA1 = new TGeoVolume("ITSSPDCoolingTubeFluidTA1",
961 sTA1, medSPDcoolfl);
962 vTA1->SetVisibility(kTRUE);
963 vTA1->SetLineColor(6); // Purple
964 vTA1->SetLineWidth(1);
965 vTA1->SetFillColor(vTA1->GetLineColor());
966 vTA1->SetFillStyle(4000); // 0% transparent
967 TGeoVolume *vB0 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorEndB0",
968 sB0, medSPDcf);
969 vB0->SetVisibility(kTRUE);
970 vB0->SetLineColor(1); // Black
971 vB0->SetLineWidth(1);
972 vB0->SetFillColor(vB0->GetLineColor());
973 vB0->SetFillStyle(4000); // 0% transparent
974 TGeoVolume *vB1 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorEndAirB1",
975 sB1, medSPDair);
976 vB1->SetVisibility(kTRUE);
977 vB1->SetLineColor(0); // white
978 vB1->SetLineWidth(1);
979 vB1->SetFillColor(vB1->GetLineColor());
980 vB1->SetFillStyle(4100); // 100% transparent
981 TGeoVolume *vB2 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorEndAirB2",
982 sB2, medSPDair);
983 vB2->SetVisibility(kTRUE);
984 vB2->SetLineColor(0); // white
985 vB2->SetLineWidth(1);
986 vB2->SetFillColor(vB2->GetLineColor());
987 vB2->SetFillStyle(4100); // 100% transparent
988 TGeoVolume *vB3 = new TGeoVolume(
989 "ITSSPDCarbonFiberSupportSectorMountBlockB3",sB3, medSPDcf);
990 vB3->SetVisibility(kTRUE);
991 vB3->SetLineColor(1); // Black
992 vB3->SetLineWidth(1);
993 vB3->SetFillColor(vB3->GetLineColor());
994 vB3->SetFillStyle(4000); // 0% transparent
995 TGeoVolume *vTB0 = new TGeoVolume("ITSSPDCoolingTubeEndTB0",sTB0,medSPDss);
996 vTB0->SetVisibility(kTRUE);
997 vTB0->SetLineColor(15); // gray
998 vTB0->SetLineWidth(1);
999 vTB0->SetFillColor(vTB0->GetLineColor());
1000 vTB0->SetFillStyle(4000); // 0% transparent
1001 TGeoVolume *vTB1 = new TGeoVolume("ITSSPDCoolingTubeEndFluidTB1",sTB1,
1002 medSPDcoolfl);
1003 vTB1->SetVisibility(kTRUE);
1004 vTB1->SetLineColor(7); // light blue
1005 vTB1->SetLineWidth(1);
1006 vTB1->SetFillColor(vTB1->GetLineColor());
1007 vTB1->SetFillStyle(4050); // 0% transparent
d0048cec 1008
54c9a3d9 1009 // add volumes to mother container passed as argument of this method
1010 moth->AddNode(vM0,1,0); // Add virtual volume to mother
1011 vA0->AddNode(vA1,1,0); // Put air inside carbon fiber.
1012 vB0->AddNode(vB1,1,0); // Put air inside carbon fiber ends.
1013 vB0->AddNode(vB2,1,0); // Put air wholes inside carbon fiber ends
1014 vTA0->AddNode(vTA1,1,0); // Put cooling liquid indide tube middel.
1015 vTB0->AddNode(vTB1,1,0); // Put cooling liquid inside tube end.
1016 Double_t tubeEndLocal[3]={0.0,0.0,sTA0->GetDz()};
1017 for(i = 0; i < ksecNCoolingTubeDips; i++) {
1018 x0 = secX3[ksecDipIndex[i]];
1019 y0 = secY3[ksecDipIndex[i]];
1020 t = 90.0 - secAngleTurbo[i];
1021 trans = new TGeoTranslation("",x0,y0,0.5*(sB1->GetZ(0)+sB1->GetZ(1)));
1022 vB1->AddNode(vTB0, i+1, trans);
1023 // Find location of tube ends for later use.
1024 trans->LocalToMaster(tubeEndLocal,fTubeEndSector[0][0][i]);
1025 rot = new TGeoRotation("", 0.0, 0.0, t);
1026 rotrans = new TGeoCombiTrans("", x0, y0, 0.0, rot);
1027 vM0->AddNode(vTA0, i+1, rotrans);
1028 } // end for i
1029 vM0->AddNode(vA0, 1, 0);
1030 vM0->AddNode(vB0, 1, 0);
1031 // Reflection.
1032 rot = new TGeoRotation("", 90., 0., 90., 90., 180., 0.);
1033 vM0->AddNode(vB0,2,rot);
1034 // Find location of tube ends for later use.
1035 for(i=0;i<ksecNCoolingTubeDips;i++) rot->LocalToMaster(
1036 fTubeEndSector[0][0][i],fTubeEndSector[0][1][i]);
1037 // left side
1038 t = -TMath::RadToDeg()*TMath::ATan2(
1039 sB0->GetX(0)-sB0->GetX(sB0->GetNvert()-1),
1040 sB0->GetY(0)-sB0->GetY(sB0->GetNvert()-1));
1041 rot = new TGeoRotation("",t,0.0,0.0);// z axis rotation
1042 x0 = 0.5*(sB0->GetX(0)+sB0->GetX(sB0->GetNvert()-1))+
1043 sB3->GetDX()*TMath::Cos(t*TMath::DegToRad());
1044 y0 = 0.5*(sB0->GetY(0)+sB0->GetY(sB0->GetNvert()-1))+
1045 sB3->GetDX()*TMath::Sin(t*TMath::DegToRad());
1046 z0 = sB0->GetZ(0)+sB3->GetDZ();
1047 rotrans = new TGeoCombiTrans("",x0,y0,z0,rot);
1048 vM0->AddNode(vB3,1,rotrans); // Put Mounting bracket on sector
1049 rotrans = new TGeoCombiTrans("",x0,y0,-z0,rot);
1050 vM0->AddNode(vB3,2,rotrans); // Put Mounting bracket on sector
54c9a3d9 1051 t *= -1.0;
1052 rot = new TGeoRotation("",t,0.0,0.0); // z axis rotation
c890eba4 1053
54c9a3d9 1054 x0 = -0.5*(sB0->GetX(0)+sB0->GetX(sB0->GetNvert()-1))-3.5*
1055 sB3->GetDX()*TMath::Cos(t*TMath::DegToRad());
1056 y0 = 0.5*(sB0->GetY(0)+sB0->GetY(sB0->GetNvert()-1))-3.5*
1057 sB3->GetDX()*TMath::Sin(t*TMath::DegToRad());
22726349 1058 rotrans = new TGeoCombiTrans("",1.01*x0,y0,z0,rot);
54c9a3d9 1059 vM0->AddNode(vB3,3,rotrans); // Put Mounting bracket on sector
22726349 1060 rotrans = new TGeoCombiTrans("",1.01*x0,y0,-z0,rot);
54c9a3d9 1061 vM0->AddNode(vB3,4,rotrans); // Put Mounting bracket on sector
1062 if(GetDebug(3)){
1063 vM0->PrintNodes();
1064 vA0->PrintNodes();
1065 vA1->PrintNodes();
1066 vB0->PrintNodes();
1067 vB1->PrintNodes();
1068 vB2->PrintNodes();
1069 vB3->PrintNodes();
1070 vTA0->PrintNodes();
1071 vTA1->PrintNodes();
1072 vTB0->PrintNodes();
1073 vTB1->PrintNodes();
1074 } // end if(GetDebug(3))
bc3498f4 1075}
54c9a3d9 1076//______________________________________________________________________
1077Bool_t AliITSv11GeometrySPD::CFHolePoints(Double_t s,Double_t r1,
1078 Double_t r2,Double_t l,Double_t &x,Double_t &y) const
bc3498f4 1079{
54c9a3d9 1080 //
1081 // Step along arck a distancs ds and compute boundry of
1082 // two holes (radius r1 and r2) a distance l apart (along
1083 // x-axis).
1084 // Inputs:
1085 // Double_t s fractional Distance along arcs [0-1]
1086 // where 0-> alpha=beta=0, 1-> alpha=90 degrees.
1087 // Double_t r1 radius at center circle
1088 // Double_t r2 radius of displaced circle
1089 // Double_t l Distance displaced circle is displaces (x-axis)
1090 // Output:
1091 // Double_t x x coordinate along double circle.
1092 // Double_t y y coordinate along double circle.
1093 // Return:
1094 // logical, kFALSE if an error
1095 //
1096 Double_t alpha,beta;
1097 Double_t ac,bc,scb,sca,t,alphac,betac; // at intersection of two circles
1098
1099 x=y=0.0;
1100 ac = r1*r1-l*l-r2*r2;
1101 bc = 2.*l*r2;
1102 if(bc==0.0) {printf("bc=0 l=%e r2=%e\n",l,r2);return kFALSE;}
1103 betac = TMath::ACos(ac/bc);
60e55aee 1104 alphac = TMath::Sqrt((bc-ac)*(bc+ac))/(2.*l*r1);
54c9a3d9 1105 scb = r2*betac;
1106 sca = r1*alphac;
1107 t = r1*0.5*TMath::Pi() - sca + scb;
1108 if(s<= scb/t){
1109 beta = s*t/r2;
1110 x = r2*TMath::Cos(beta) + l;
1111 y = r2*TMath::Sin(beta);
1112 //printf("betac=%e scb=%e t=%e s=%e beta=%e x=%e y=%e\n",
1113 // betac,scb,t,s,beta,x,y);
1114 return kTRUE;
1115 }else{
1116 beta = (s*t-scb+sca)/(r1*0.5*TMath::Pi());
1117 alpha = beta*0.5*TMath::Pi();
1118 x = r1*TMath::Cos(alpha);
1119 y = r1*TMath::Sin(alpha);
1120 //printf("alphac=%e sca=%e t=%e s=%e beta=%e alpha=%e x=%e y=%e\n",
1121 // alphac,sca,t,s,beta,alpha,x,y);
1122 return kTRUE;
1123 } // end if
1124 return kFALSE;
bc3498f4 1125}
54c9a3d9 1126//______________________________________________________________________
1127Bool_t AliITSv11GeometrySPD::GetSectorMountingPoints(Int_t index,Double_t &x0,
1128 Double_t &y0, Double_t &x1, Double_t &y1) const
bc3498f4 1129{
54c9a3d9 1130 //
1131 // Returns the edges of the straight borders in the SPD sector shape,
1132 // which are used to mount staves on them.
1133 // Coordinate system is that of the carbon fiber sector volume.
1134 // ---
1135 // Index numbering is as follows:
1136 // /5
1137 // /\/4
1138 // 1\ \/3
1139 // 0|___\/2
1140 // ---
1141 // Arguments [the ones passed by reference contain output values]:
1142 // Int_t index --> location index according to above scheme [0-5]
1143 // Double_t &x0 --> (by ref) x0 location or the ladder sector [cm]
1144 // Double_t &y0 --> (by ref) y0 location of the ladder sector [cm]
1145 // Double_t &x1 --> (by ref) x1 location or the ladder sector [cm]
1146 // Double_t &y1 --> (by ref) y1 location of the ladder sector [cm]
1147 // TGeoManager *mgr --> The TGeo builder
1148 // ---
1149 // The location is described by a line going from (x0, y0) to (x1, y1)
1150 // ---
1151 // Returns kTRUE if no problems encountered.
1152 // Returns kFALSE if a problem was encountered (e.g.: shape not found).
d0048cec 1153 //
54c9a3d9 1154 Int_t isize = fSPDsectorX0.GetSize();
1155
1156 x0 = x1 = y0 = y1 = 0.0;
1157 if(index < 0 || index > isize) {
c890eba4 1158 AliError(Form("index = %d: allowed 0 --> %d", index, isize));
1159 return kFALSE;
54c9a3d9 1160 } // end if(index<0||index>isize)
1161 x0 = fSPDsectorX0[index];
1162 x1 = fSPDsectorX1[index];
1163 y0 = fSPDsectorY0[index];
1164 y1 = fSPDsectorY1[index];
1165 return kTRUE;
bc3498f4 1166}
54c9a3d9 1167//______________________________________________________________________
d0048cec 1168void AliITSv11GeometrySPD::SPDsectorShape(Int_t n,const Double_t *xc,
54c9a3d9 1169 const Double_t *yc, const Double_t *r,
d0048cec 1170 const Double_t *ths, const Double_t *the,
54c9a3d9 1171 Int_t npr, Int_t &m, Double_t **xp, Double_t **yp) const
bc3498f4 1172{
54c9a3d9 1173 //
1174 // Code to compute the points that make up the shape of the SPD
1175 // Carbon fiber support sections
1176 // Inputs:
1177 // Int_t n size of arrays xc,yc, and r.
1178 // Double_t *xc array of x values for radii centers.
1179 // Double_t *yc array of y values for radii centers.
1180 // Double_t *r array of signed radii values.
1181 // Double_t *ths array of starting angles [degrees].
1182 // Double_t *the array of ending angles [degrees].
1183 // Int_t npr the number of lines segments to aproximate the arc.
1184 // Outputs (arguments passed by reference):
d0048cec 1185 // Int_t m the number of enetries in the arrays *xp[npr+1]
54c9a3d9 1186 // and *yp[npr+1].
1187 // Double_t **xp array of x coordinate values of the line segments
1188 // which make up the SPD support sector shape.
1189 // Double_t **yp array of y coordinate values of the line segments
1190 // which make up the SPD support sector shape.
1191 //
1192 Int_t i, k;
1193 Double_t t, t0, t1;
1194
1195 m = n*(npr + 1);
1196 if(GetDebug(2)) {
1197 cout <<" X \t Y \t R \t S \t E" << m << endl;
1198 for(i = 0; i < n; i++) {
1199 cout << "{" << xc[i] << ", ";
1200 cout << yc[i] << ", ";
1201 cout << r[i] << ", ";
1202 cout << ths[i] << ", ";
1203 cout << the[i] << "}, " << endl;
1204 } // end for i
1205 } // end if(GetDebug(2))
1206 if (GetDebug(3)) cout << "Double_t sA0 = [" << n*(npr+1)+1<<"][";
1207 if (GetDebug(4)) cout << "3] {";
1208 else if(GetDebug(3)) cout <<"2] {";
1209 t0 = (Double_t)npr;
1210 for(i = 0; i < n; i++) {
1211 t1 = (the[i] - ths[i]) / t0;
1212 if(GetDebug(5)) cout << "t1 = " << t1 << endl;
1213 for(k = 0; k <= npr; k++) {
1214 t = ths[i] + ((Double_t)k) * t1;
1215 xp[i][k] = TMath::Abs(r[i]) * CosD(t) + xc[i];
1216 yp[i][k] = TMath::Abs(r[i]) * SinD(t) + yc[i];
1217 if(GetDebug(3)) {
1218 cout << "{" << xp[i][k] << "," << yp[i][k];
1219 if (GetDebug(4)) cout << "," << t;
1220 cout << "},";
1221 } // end if GetDebug
1222 } // end for k
1223 if(GetDebug(3)) cout << endl;
1224 } // end of i
1225 if(GetDebug(3)) cout << "{" << xp[0][0] << ", " << yp[0][0];
1226 if(GetDebug(4)) cout << "," << ths[0];
1227 if(GetDebug(3)) cout << "}}" << endl;
592651e2 1228}
22726349 1229
54c9a3d9 1230//______________________________________________________________________
1231TGeoVolume* AliITSv11GeometrySPD::CreateLadder(Int_t layer,TArrayD &sizes,
1232 TGeoManager *mgr) const
bc3498f4 1233{
54c9a3d9 1234 //
1235 // Creates the "ladder" = silicon sensor + 5 chips.
1236 // Returns a TGeoVolume containing the following components:
1237 // - the sensor (TGeoBBox), whose name depends on the layer
1238 // - 5 identical chips (TGeoBBox)
1239 // - a guard ring around the sensor (subtraction of TGeoBBoxes),
1240 // which is separated from the rest of sensor because it is not
1241 // a sensitive part
1242 // - bump bondings (TGeoBBox stripes for the whole width of the
1243 // sensor, one per column).
1244 // ---
1245 // Arguments:
1246 // 1 - the owner layer (MUST be 1 or 2 or a fatal error is raised)
1247 // 2 - a TArrayD passed by reference, which will contain relevant
1248 // dimensions related to this object:
1249 // size[0] = 'thickness' (the smallest dimension)
1250 // size[1] = 'length' (the direction along the ALICE Z axis)
d0048cec 1251 // size[2] = 'width' (extension in the direction perp. to the
54c9a3d9 1252 // above ones)
1253 // 3 - the used TGeoManager
1254
d0048cec 1255 // ** CRITICAL CHECK **
54c9a3d9 1256 // layer number can be ONLY 1 or 2
1257 if (layer != 1 && layer != 2) AliFatal("Layer number MUST be 1 or 2");
1258
1259 // ** MEDIA **
1260 TGeoMedium *medAir = GetMedium("AIR$",mgr);
1261 TGeoMedium *medSPDSiChip = GetMedium("SPD SI CHIP$",mgr); // SPD SI CHIP
1262 TGeoMedium *medSi = GetMedium("SI$",mgr);
1263 TGeoMedium *medBumpBond = GetMedium("COPPER$",mgr); // ??? BumpBond
d0048cec 1264
1265 // ** SIZES **
54c9a3d9 1266 Double_t chipThickness = fgkmm * 0.150;
1267 Double_t chipWidth = fgkmm * 15.950;
1268 Double_t chipLength = fgkmm * 13.600;
1269 Double_t chipSpacing = fgkmm * 0.400; // separation of chips along Z
1270 Double_t sensThickness = fgkmm * 0.200;
1271 Double_t sensLength = fgkmm * 69.600;
1272 Double_t sensWidth = fgkmm * 12.800;
d0048cec 1273 Double_t guardRingWidth = fgkmm * 0.560; // a border of this thickness
54c9a3d9 1274 // all around the sensor
1275 Double_t bbLength = fgkmm * 0.042;
1276 Double_t bbWidth = sensWidth;
1277 Double_t bbThickness = fgkmm * 0.012;
1278 Double_t bbPos = 0.080; // Z position w.r. to left pixel edge
1279 // compute the size of the container volume which
1280 // will also be returned in the referenced TArrayD;
1281 // for readability, they are linked by reference to a more meaningful name
1282 sizes.Set(3);
1283 Double_t &thickness = sizes[0];
1284 Double_t &length = sizes[1];
1285 Double_t &width = sizes[2];
1286 // the container is a box which exactly enclose all the stuff;
1287 width = chipWidth;
1288 length = sensLength + 2.0*guardRingWidth;
1289 thickness = sensThickness + chipThickness + bbThickness;
1290
1291 // ** VOLUMES **
1292 // While creating this volume, since it is a sensitive volume,
1293 // we must respect some standard criteria for its local reference frame.
1294 // Local X must correspond to x coordinate of the sensitive volume:
d0048cec 1295 // this means that we are going to create the container with a local
54c9a3d9 1296 // reference system that is **not** in the middle of the box.
d0048cec 1297 // This is accomplished by calling the shape constructor with an
54c9a3d9 1298 // additional option ('originShift'):
1299 Double_t xSens = 0.5 * (width - sensWidth - 2.0*guardRingWidth);
1300 Double_t originShift[3] = {-xSens, 0., 0.};
1301 TGeoBBox *shapeContainer = new TGeoBBox(0.5*width,0.5*thickness,
1302 0.5*length,originShift);
1303 // then the volume is made of air, and using this shape
1304 TGeoVolume *container = new TGeoVolume(Form("ITSSPDlay%d-Ladder",layer),
1305 shapeContainer, medAir);
1306 // the chip is a common box
1307 TGeoVolume *volChip = mgr->MakeBox("ITSSPDchip",medSPDSiChip,
1308 0.5*chipWidth,0.5*chipThickness,0.5*chipLength);
1309 // the sensor as well
1310 TGeoVolume *volSens = mgr->MakeBox(GetSenstiveVolumeName(layer),medSi,
1311 0.5*sensWidth,0.5*sensThickness,0.5*sensLength);
d0048cec 1312 // the guard ring shape is the subtraction of two boxes with the
54c9a3d9 1313 // same center.
1314 TGeoBBox *shIn = new TGeoBBox(0.5*sensWidth,sensThickness,0.5*sensLength);
1315 TGeoBBox *shOut = new TGeoBBox(0.5*sensWidth+guardRingWidth,
1316 0.5*sensThickness,0.5*sensLength+guardRingWidth);
1317 shIn->SetName("ITSSPDinnerBox");
1318 shOut->SetName("ITSSPDouterBox");
1319 TGeoCompositeShape *shBorder = new TGeoCompositeShape(
1320 "ITSSPDgaurdRingBorder",Form("%s-%s",shOut->GetName(),shIn->GetName()));
1321 TGeoVolume *volBorder = new TGeoVolume("ITSSPDgaurdRing",shBorder,medSi);
1322 // bump bonds for one whole column
1323 TGeoVolume *volBB = mgr->MakeBox("ITSSPDbb",medBumpBond,0.5*bbWidth,
1324 0.5*bbThickness,0.5*bbLength);
1325 // set colors of all objects for visualization
1326 volSens->SetLineColor(kYellow + 1);
1327 volChip->SetLineColor(kGreen);
1328 volBorder->SetLineColor(kYellow + 3);
1329 volBB->SetLineColor(kGray);
1330
1331 // ** MOVEMENTS **
1332 // sensor is translated along thickness (X) and width (Y)
1333 Double_t ySens = 0.5 * (thickness - sensThickness);
1334 Double_t zSens = 0.0;
d0048cec 1335 // we want that the x of the ladder is the same as the one of
54c9a3d9 1336 // its sensitive volume
1337 TGeoTranslation *trSens = new TGeoTranslation(0.0, ySens, zSens);
1338 // bump bonds are translated along all axes:
1339 // keep same Y used for sensors, but change the Z
1340 TGeoTranslation *trBB[160];
1341 Double_t x = 0.0;
1342 Double_t y = 0.5 * (thickness - bbThickness) - sensThickness;
1343 Double_t z = -0.5 * sensLength + guardRingWidth + fgkmm*0.425 - bbPos;
1344 Int_t i;
1345 for (i = 0; i < 160; i++) {
1346 trBB[i] = new TGeoTranslation(x, y, z);
1347 switch(i) {
1348 case 31:case 63:case 95:case 127:
1349 z += fgkmm * 0.625 + fgkmm * 0.2;
1350 break;
1351 default:
1352 z += fgkmm * 0.425;
1353 } // end switch
1354 } // end for i
1355 // the chips are translated along the length (Z) and thickness (X)
1356 TGeoTranslation *trChip[5] = {0, 0, 0, 0, 0};
1357 x = -xSens;
1358 y = 0.5 * (chipThickness - thickness);
1359 z = 0.0;
1360 for (i = 0; i < 5; i++) {
d0048cec 1361 z = -0.5*length + guardRingWidth
54c9a3d9 1362 + (Double_t)i*chipSpacing + ((Double_t)(i) + 0.5)*chipLength;
1363 trChip[i] = new TGeoTranslation(x, y, z);
1364 } // end ofr i
d0048cec 1365
54c9a3d9 1366 // add nodes to container
1367 container->AddNode(volSens, 1, trSens);
1368 container->AddNode(volBorder, 1, trSens);
1369 for (i = 0; i < 160; i++) container->AddNode(volBB,i+1,trBB[i]);
1370 for (i = 0; i < 5; i++) container->AddNode(volChip,i+3,trChip[i]);
1371 // return the container
1372 return container;
592651e2 1373}
22726349 1374
7855ea93 1375//______________________________________________________________________
54c9a3d9 1376TGeoVolume* AliITSv11GeometrySPD::CreateClip(TArrayD &sizes,Bool_t isDummy,
1377 TGeoManager *mgr) const
1378{
1379 //
1380 // Creates the carbon fiber clips which are added to the central ladders.
1381 // They have a complicated shape which is approximated by a TGeoXtru
1382 // Implementation of a single clip over an half-stave.
1383 // It has a complicated shape which is approximated to a section like this:
d0048cec 1384 //
54c9a3d9 1385 // 6
1386 // /\ .
1387 // 7 //\\ 5
1388 // / 1\\___________________4
1389 // 0 \___________________
1390 // 2 3
d0048cec 1391 // with a finite thickness for all the shape
54c9a3d9 1392 // Its local reference frame is such that point A corresponds to origin.
d0048cec 1393 //
30611568 1394
1395 // MODIFIED geometry
1396 Double_t sposty = fgkmm * -0.5; // lower internal side to avoid overlaps with modified geometry
1397
54c9a3d9 1398 Double_t fullLength = fgkmm * 12.6; // = x4 - x0
1399 Double_t flatLength = fgkmm * 5.4; // = x4 - x3
1400 Double_t inclLongLength = fgkmm * 5.0; // = 5-6
1401 Double_t inclShortLength = fgkmm * 2.0; // = 6-7
1402 Double_t fullHeight = fgkmm * 2.8; // = y6 - y3
3ffa185f 1403 Double_t thickness = fgkmm * 0.18; // thickness
54c9a3d9 1404 Double_t totalLength = fgkmm * 52.0; // total length in Z
d0048cec 1405 Double_t holeSize = fgkmm * 5.0; // dimension of cubic
54c9a3d9 1406 // hole inserted for pt1000
1407 Double_t angle1 = 27.0; // supplementary of angle DCB
1408 Double_t angle2; // angle DCB
1409 Double_t angle3; // angle of GH with vertical
d0048cec 1410
54c9a3d9 1411 angle2 = 0.5 * (180.0 - angle1);
d0048cec 1412 angle3 = 90.0 - TMath::ACos(fullLength - flatLength -
1413 inclLongLength*TMath::Cos(angle1)) *
54c9a3d9 1414 TMath::RadToDeg();
1415 angle1 *= TMath::DegToRad();
1416 angle2 *= TMath::DegToRad();
1417 angle3 *= TMath::DegToRad();
1418
1419 Double_t x[8], y[8];
d0048cec 1420
54c9a3d9 1421 x[0] = 0.0;
1422 x[1] = x[0] + fullLength - flatLength - inclLongLength*TMath::Cos(angle1);
1423 x[2] = x[0] + fullLength - flatLength;
1424 x[3] = x[0] + fullLength;
1425 x[4] = x[3];
1426 x[5] = x[4] - flatLength + thickness * TMath::Cos(angle2);
1427 x[6] = x[1];
1428 x[7] = x[0];
d0048cec 1429
54c9a3d9 1430 y[0] = 0.0;
1431 y[1] = y[0] + inclShortLength * TMath::Cos(angle3);
1432 y[2] = y[1] - inclLongLength * TMath::Sin(angle1);
1433 y[3] = y[2];
1434 y[4] = y[3] + thickness;
1435 y[5] = y[4];
1436 y[6] = y[1] + thickness;
1437 y[7] = y[0] + thickness;
d0048cec 1438
30611568 1439 y[0] += sposty;
1440 y[7] += sposty;
1441
54c9a3d9 1442 sizes.Set(7);
1443 sizes[0] = totalLength;
1444 sizes[1] = fullHeight;
1445 sizes[2] = y[2];
1446 sizes[3] = y[6];
1447 sizes[4] = x[0];
1448 sizes[5] = x[3];
1449 sizes[6] = x[2];
1450
1451 if(isDummy){// use this argument when on ewant just the
1452 // positions without create any volume
1453 return NULL;
1454 } // end if isDummy
1455
1456 TGeoXtru *shClip = new TGeoXtru(2);
1457 shClip->SetName("ITSSPDshclip");
1458 shClip->DefinePolygon(8, x, y);
1459 shClip->DefineSection(0, -0.5*totalLength, 0., 0., 1.0);
1460 shClip->DefineSection(1, 0.5*totalLength, 0., 0., 1.0);
d0048cec 1461
54c9a3d9 1462 TGeoBBox *shHole = new TGeoBBox("ITSSPDSHClipHole",0.5*holeSize,
1463 0.5*holeSize,0.5*holeSize);
1464 TGeoTranslation *tr1 = new TGeoTranslation("ITSSPDTRClipHole1",x[2],0.0,
1465 fgkmm*14.);
1466 TGeoTranslation *tr2 = new TGeoTranslation("ITSSPDTRClipHole2",x[2],0.0,
1467 0.0);
1468 TGeoTranslation *tr3 = new TGeoTranslation("ITSSPDTRClipHole3",x[2],0.0,
1469 -fgkmm*14.);
1470 tr1->RegisterYourself();
1471 tr2->RegisterYourself();
1472 tr3->RegisterYourself();
1473
1474 //TString strExpr("ITSSPDshclip-(");
1475 TString strExpr(shClip->GetName());
1476 strExpr.Append("-(");
1477 strExpr.Append(Form("%s:%s+", shHole->GetName(), tr1->GetName()));
1478 strExpr.Append(Form("%s:%s+", shHole->GetName(), tr2->GetName()));
1479 strExpr.Append(Form("%s:%s)", shHole->GetName(), tr3->GetName()));
1480 TGeoCompositeShape *shClipHole = new TGeoCompositeShape(
1481 "ITSSPDSHClipHoles",strExpr.Data());
1482
1483 TGeoMedium *mat = GetMedium("SPD C (M55J)$", mgr);
1484 TGeoVolume *vClip = new TGeoVolume("ITSSPDclip", shClipHole, mat);
1485 vClip->SetLineColor(kGray + 2);
1486 return vClip;
45c52bb2 1487}
1488
1489//______________________________________________________________________
1490TGeoVolume* AliITSv11GeometrySPD::CreatePatchPanel(TArrayD &sizes,
1491 TGeoManager *mgr) const
1492{
1493 //
1494 // Creates the patch panel approximated with a "L"-shaped TGeoXtru
1495 // with a finite thickness for all the shape
1496 // Its local reference frame is such that point A corresponds to origin.
1497 //
1498 Double_t hLength = fgkmm * 50.0; // horizontal length
1499 Double_t vLength = fgkmm * 50.0; // vertical length
c890eba4 1500 Double_t angle = 88.3; // angle between hor and vert
45c52bb2 1501 Double_t thickness = fgkmm * 4.0; // thickness
1502 Double_t width = fgkmm * 100.0; // width looking from cone
1503
1504 Double_t x[7], y[7];
1505
1506 y[0] = 0.0;
1507 y[1] = y[0] + hLength;
1508 y[2] = y[1];
1509 y[3] = y[0] + thickness;
1510 y[4] = y[3] + vLength * TMath::Cos(angle*TMath::DegToRad());
1511 y[5] = y[4] - thickness / TMath::Sin(angle*TMath::DegToRad());
1512 y[6] = y[0];
1513
1514 x[0] = 0.0;
1515 x[1] = x[0];
1516 x[2] = x[1] + thickness;
1517 x[3] = x[2];
1518 x[4] = x[3] + vLength * TMath::Sin(angle*TMath::DegToRad());
1519 x[5] = x[4];
1520 x[6] = x[0] + thickness;
1521
1522 sizes.Set(3);
1523 sizes[0] = hLength;
1524 sizes[1] = vLength;
1525 sizes[2] = thickness;
1526
1527 TGeoXtru *shPatch = new TGeoXtru(2);
1528 shPatch->SetName("ITSSPDpatchShape1");
1529 shPatch->DefinePolygon(7, x, y);
1530 shPatch->DefineSection(0, -0.5*width, 0., 0., 1.0);
1531 shPatch->DefineSection(1, 0.5*width, 0., 0., 1.0);
1532
1533 /*
1534 Double_t subThickness = 10.0 * fgkmm;
1535 Double_t subWidth = 55.0 * fgkmm;
1536 new TGeoBBox("ITSSPDpatchShape2", 0.5*subThickness, 60.0 * fgkmm, 0.5*subWidth);
1537 TGeoRotation *rotSub = new TGeoRotation(*gGeoIdentity);
1538 rotSub->SetName("shPatchSubRot");
1539 rotSub->RotateZ(50.0);
1540 rotSub->RegisterYourself();
1541 TGeoCombiTrans *trSub = new TGeoCombiTrans(0.26*hLength, 0.26*vLength, 0.0, rotSub);
1542 trSub->SetName("shPatchSubTr");
1543 trSub->RegisterYourself();
1544
1545 TGeoCompositeShape *shPatchFinal = new TGeoCompositeShape("ITSSPDpatchShape1-(ITSSPDpatchShape2:shPatchSubTr)");
1546 */
1547
1548 TGeoMedium *mat = GetMedium("AL$", mgr);
1549 //TGeoVolume *vPatch = new TGeoVolume("ITSSPDpatchPanel", shPatchFinal, mat);
1550 TGeoVolume *vPatch = new TGeoVolume("ITSSPDpatchPanel", shPatch, mat);
1551 vPatch->SetLineColor(kAzure);
1552
1553 return vPatch;
1554}
1555
c890eba4 1556//___________________________________________________________________
7855ea93 1557TGeoCompositeShape* AliITSv11GeometrySPD::CreateGroundingFoilShape
54c9a3d9 1558 (Int_t itype,Double_t &length,Double_t &width,
1559 Double_t thickness,TArrayD &sizes)
bc3498f4 1560{
54c9a3d9 1561 //
d0048cec 1562 // Creates the typical composite shape of the grounding foil:
1563 //
54c9a3d9 1564 // +---------------------------------------------------------+
1565 // | 5 6 9 |
1566 // | +-----------+ +------------+ 10
1567 // | O | | |
1568 // | 3 /-----+ 4 +------+
1569 // | 1 / 7 8
1570 // | /----------/
1571 // +-----/ 2 +
1572 // 0
1573 // Z + 11
1574 //
d0048cec 1575 // This shape is used 4 times: two layers of glue, one in kapton
1576 // and one in aluminum, taking into account that the aliminum
54c9a3d9 1577 // layer has small differences in the size of some parts.
1578 // ---
d0048cec 1579 // In order to overcome problems apparently due to a large number
1580 // of points, the shape creation is done according the following
54c9a3d9 1581 // steps:
d0048cec 1582 // 1) a TGeoBBox is created with a size right enough to contain
54c9a3d9 1583 // the whole shape (0-1-X-13)
d0048cec 1584 // 2) holes are defined as other TGeoBBox which are subtracted
54c9a3d9 1585 // from the main shape
d0048cec 1586 // 3) a TGeoXtru is defined connecting the points (0-->11-->0)
54c9a3d9 1587 // and is also subtracted from the main shape
1588 // ---
d0048cec 1589 // The argument ("type") is used to choose between all these
54c9a3d9 1590 // possibilities:
1591 // - type = 0 --> kapton layer
1592 // - type = 1 --> aluminum layer
1593 // - type = 2 --> glue layer between support and GF
1594 // - type = 3 --> glue layer between GF and ladders
d0048cec 1595 // Returns: a TGeoCompositeShape which will then be used to shape
1596 // several volumes. Since TGeoXtru is used, the local reference
54c9a3d9 1597 // frame of this object has X horizontal and Y vertical w.r to
1598 // the shape drawn above, and Z axis going perpendicularly to the screen.
d0048cec 1599 // This is not the correct reference for the half stave, for which
1600 // the "long" dimension is Z and the "short" is X, while Y goes in
1601 // the direction of thickness. This will imply some rotations when
54c9a3d9 1602 // using the volumes created with this shape.
d0048cec 1603
54c9a3d9 1604 // suffix to differentiate names
1605 Char_t type[10];
d0048cec 1606
54c9a3d9 1607 // size of the virtual box containing exactly this volume
1608 length = fgkmm * 243.18;
1609 width = fgkmm * 15.95;
1610 if (itype == 1) {
1611 length -= fgkmm * 0.4;
1612 width -= fgkmm * 0.4;
1613 } // end if itype==1
1614 switch (itype) {
1615 case 0:
6932f314 1616 snprintf(type,10,"Kap");
54c9a3d9 1617 break;
1618 case 1:
6932f314 1619 snprintf(type,10, "Alu");
54c9a3d9 1620 break;
1621 case 2:
6932f314 1622 snprintf(type,10,"Glue1");
54c9a3d9 1623 break;
1624 case 3:
6932f314 1625 snprintf(type,10,"Glue2");
54c9a3d9 1626 break;
1627 }
d0048cec 1628 // we divide the shape in several slices along the horizontal
1629 // direction (local X) here we define define the length of all
54c9a3d9 1630 // sectors (from leftmost to rightmost)
1631 Int_t i;
1632 Double_t sliceLength[] = { 140.71, 2.48, 26.78, 4.00,
1633 10.00, 24.40, 10.00, 24.81 };
1634 for (i = 0; i < 8; i++) sliceLength[i] *= fgkmm;
1635 if (itype == 1) {
1636 sliceLength[0] -= fgkmm * 0.2;
1637 sliceLength[4] -= fgkmm * 0.2;
1638 sliceLength[5] += fgkmm * 0.4;
1639 sliceLength[6] -= fgkmm * 0.4;
1640 } // end if itype ==1
d0048cec 1641
1642 // as shown in the drawing, we have four different widths
54c9a3d9 1643 // (along local Y) in this shape:
1644 Double_t widthMax = fgkmm * 15.95;
1645 Double_t widthMed1 = fgkmm * 15.00;
1646 Double_t widthMed2 = fgkmm * 11.00;
1647 Double_t widthMin = fgkmm * 4.40;
1648 if (itype == 1) {
1649 widthMax -= fgkmm * 0.4;
1650 widthMed1 -= fgkmm * 0.4;
1651 widthMed2 -= fgkmm * 0.4;
1652 widthMin -= fgkmm * 0.4;
1653 } // end if itype==1
d0048cec 1654
54c9a3d9 1655 // create the main shape
1656 TGeoBBox *shGroundFull = 0;
1657 shGroundFull = new TGeoBBox(Form("ITSSPDSHgFoil%sFull", type),
1658 0.5*length,0.5*width, 0.5*thickness);
d0048cec 1659
6932f314 1660 if(GetDebug(5)) shGroundFull->Print(); // Avoid Coverity warning
1661
d0048cec 1662 // create the polygonal shape to be subtracted to give the correct
1663 // shape to the borders its vertices are defined in sugh a way that
1664 // this polygonal will be placed in the correct place considered
1665 // that the origin of the local reference frame is in the center
1666 // of the main box: we fix the starting point at the lower-left
1667 // edge of the shape (point 12), and add all points in order,
54c9a3d9 1668 // following a clockwise rotation
d0048cec 1669
54c9a3d9 1670 Double_t x[13], y[13];
1671 x[ 0] = -0.5 * length + sliceLength[0];
1672 y[ 0] = -0.5 * widthMax;
1673
1674 x[ 1] = x[0] + sliceLength[1];
1675 y[ 1] = y[0] + (widthMax - widthMed1);
1676
1677 x[ 2] = x[1] + sliceLength[2];
1678 y[ 2] = y[1];
1679
1680 x[ 3] = x[2] + sliceLength[3];
1681 y[ 3] = y[2] + (widthMed1 - widthMed2);
1682
1683 x[ 4] = x[3] + sliceLength[4];
1684 y[ 4] = y[3];
1685
1686 x[ 5] = x[4];
1687 y[ 5] = y[4] + (widthMed2 - widthMin);
1688
1689 x[ 6] = x[5] + sliceLength[5];
1690 y[ 6] = y[5];
1691
1692 x[ 7] = x[6];
1693 y[ 7] = y[4];
1694
1695 x[ 8] = x[7] + sliceLength[6];
1696 y[ 8] = y[7];
1697
1698 x[ 9] = x[8];
1699 y[ 9] = y[6];
1700
1701 x[10] = x[9] + sliceLength[7] + 0.5;
1702 y[10] = y[9];
1703
1704 x[11] = x[10];
1705 y[11] = y[0] - 0.5;
1706
1707 x[12] = x[0];
1708 y[12] = y[11];
1709
1710 // create the shape
1711 TGeoXtru *shGroundXtru = new TGeoXtru(2);
1712 shGroundXtru->SetName(Form("ITSSPDSHgFoil%sXtru", type));
1713 shGroundXtru->DefinePolygon(13, x, y);
1714 shGroundXtru->DefineSection(0, -thickness, 0., 0., 1.0);
1715 shGroundXtru->DefineSection(1, thickness, 0., 0., 1.0);
d0048cec 1716
54c9a3d9 1717 // define a string which will express the algebric operations among volumes
1718 // and add the subtraction of this shape from the main one
1719 TString strComposite(Form("ITSSPDSHgFoil%sFull-(%s+", type,
1720 shGroundXtru->GetName()));
d0048cec 1721
54c9a3d9 1722 // define the holes according to size information coming from drawings:
1723 Double_t holeLength = fgkmm * 10.00;
1724 Double_t holeWidth = fgkmm * 7.50;
d0048cec 1725 Double_t holeSepX0 = fgkmm * 7.05; // separation between center
54c9a3d9 1726 // of first hole and left border
d0048cec 1727 Double_t holeSepXC = fgkmm * 14.00; // separation between the centers
54c9a3d9 1728 // of two consecutive holes
d0048cec 1729 Double_t holeSepX1 = fgkmm * 15.42; // separation between centers of
54c9a3d9 1730 // 5th and 6th hole
d0048cec 1731 Double_t holeSepX2 = fgkmm * 22.00; // separation between centers of
54c9a3d9 1732 // 10th and 11th hole
1733 if (itype == 1) {
1734 holeSepX0 -= fgkmm * 0.2;
1735 holeLength += fgkmm * 0.4;
1736 holeWidth += fgkmm * 0.4;
1737 } // end if itype==1
1738 sizes.Set(7);
1739 sizes[0] = holeLength;
1740 sizes[1] = holeWidth;
1741 sizes[2] = holeSepX0;
1742 sizes[3] = holeSepXC;
1743 sizes[4] = holeSepX1;
1744 sizes[5] = holeSepX2;
1745 sizes[6] = fgkmm * 4.40;
d0048cec 1746
54c9a3d9 1747 // X position of hole center (will change for each hole)
1748 Double_t holeX = -0.5*length;
1749 // Y position of center of all holes (= 4.4 mm from upper border)
1750 Double_t holeY = 0.5*(width - holeWidth) - widthMin;
d0048cec 1751
54c9a3d9 1752 // create a shape for the holes (common)
c0fc8108 1753 new TGeoBBox(Form("ITSSPD%sGfoilHole", type),0.5*holeLength,
1754 0.5*holeWidth, thickness);
d0048cec 1755
54c9a3d9 1756 // insert the holes in the XTRU shape:
d0048cec 1757 // starting from the first value of X, they are simply
54c9a3d9 1758 // shifted along this axis
1759 char name[200];
1760 TGeoTranslation *transHole[11];
4adcf390 1761 for (i = 0; i < 11; i++) {
54c9a3d9 1762 // set the position of the hole, depending on index
1763 if (i == 0) {
1764 holeX += holeSepX0;
1765 }else if (i < 5) {
1766 holeX += holeSepXC;
1767 }else if (i == 5) {
1768 holeX += holeSepX1;
1769 }else if (i < 10) {
1770 holeX += holeSepXC;
1771 }else {
1772 holeX += holeSepX2;
1773 } // end if else if's
1774 //cout << i << " --> X = " << holeX << endl;
6932f314 1775 snprintf(name,200,"ITSSPDTRgFoil%sHole%d", type, i);
54c9a3d9 1776 transHole[i] = new TGeoTranslation(name, holeX, holeY, 0.0);
1777 transHole[i]->RegisterYourself();
1778 strComposite.Append(Form("ITSSPD%sGfoilHole:%s", type, name));
1779 if (i < 10) strComposite.Append("+"); else strComposite.Append(")");
1780 } // end for i
d0048cec 1781
54c9a3d9 1782 // create composite shape
1783 TGeoCompositeShape *shGround = new TGeoCompositeShape(
1784 Form("ITSSPDSHgFoil%s", type), strComposite.Data());
1785
1786 return shGround;
592651e2 1787}
54c9a3d9 1788//______________________________________________________________________
d0048cec 1789TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateGroundingFoil(Bool_t isRight,
54c9a3d9 1790 TArrayD &sizes, TGeoManager *mgr)
bc3498f4 1791{
54c9a3d9 1792 //
d0048cec 1793 // Create a volume containing all parts of the grounding foil a
1794 // for a half-stave.
54c9a3d9 1795 // It consists of 4 layers with the same shape but different thickness:
1796 // 1) a layer of glue
1797 // 2) the aluminum layer
1798 // 3) the kapton layer
1799 // 4) another layer of glue
1800 // ---
1801 // Arguments:
d0048cec 1802 // 1: a boolean value to know if it is the grounding foir for
54c9a3d9 1803 // the right or left side
1804 // 2: a TArrayD which will contain the dimension of the container box:
1805 // - size[0] = length along Z (the beam line direction)
d0048cec 1806 // - size[1] = the 'width' of the stave, which defines, together
54c9a3d9 1807 // with Z, the plane of the carbon fiber support
d0048cec 1808 // - size[2] = 'thickness' (= the direction along which all
54c9a3d9 1809 // stave components are superimposed)
1810 // 3: the TGeoManager
1811 // ---
d0048cec 1812 // The return value is a TGeoBBox volume containing all grounding
54c9a3d9 1813 // foil components.
1814 // to avoid strange behaviour of the geometry manager,
1815 // create a suffix to be used in the names of all shapes
1816 //
1817 char suf[5];
6932f314 1818 if (isRight) strncpy(suf, "R", 5); else strncpy(suf, "L", 5);
d0048cec 1819 // this volume will be created in order to ease its placement in
1820 // the half-stave; then, it is added here the small distance of
1821 // the "central" edge of each volume from the Z=0 plane in the stave
54c9a3d9 1822 // reference (which coincides with ALICE one)
1823 Double_t dist = fgkmm * 0.71;
d0048cec 1824
54c9a3d9 1825 // define materials
1826 TGeoMedium *medKap = GetMedium("SPD KAPTON(POLYCH2)$", mgr);
1827 TGeoMedium *medAlu = GetMedium("AL$", mgr);
1828 TGeoMedium *medGlue = GetMedium("EPOXY$", mgr); //??? GLUE_GF_SUPPORT
d0048cec 1829
54c9a3d9 1830 // compute the volume shapes (thicknesses change from one to the other)
1831 Double_t kpLength, kpWidth, alLength, alWidth;
1832 TArrayD kpSize, alSize, glSize;
ed0e944d 1833 Double_t kpThickness = fgkmm * 0.04;
1834 Double_t alThickness = fgkmm * 0.01;
1835//cout << "AL THICKNESS" << alThickness << endl;
1836 //Double_t g0Thickness = fgkmm * 0.1175 - fgkGapHalfStave;
1837 //Double_t g1Thickness = fgkmm * 0.1175 - fgkGapLadder;
1838 Double_t g0Thickness = fgkmm * 0.1275 - fgkGapHalfStave;
1839 Double_t g1Thickness = fgkmm * 0.1275 - fgkGapLadder;
54c9a3d9 1840 TGeoCompositeShape *kpShape = CreateGroundingFoilShape(0,kpLength,kpWidth,
1841 kpThickness, kpSize);
1842 TGeoCompositeShape *alShape = CreateGroundingFoilShape(1,alLength,alWidth,
1843 alThickness, alSize);
3ffa185f 1844 TGeoCompositeShape *g0Shape = CreateGroundingFoilShape(2,kpLength,kpWidth,
1845 g0Thickness, glSize);
1846 TGeoCompositeShape *g1Shape = CreateGroundingFoilShape(3,kpLength,kpWidth,
1847 g1Thickness, glSize);
d0048cec 1848 // create the component volumes and register their sizes in the
1849 // passed arrays for readability reasons, some reference variables
54c9a3d9 1850 // explicit the meaning of the array slots
1851 TGeoVolume *kpVol = new TGeoVolume(Form("ITSSPDgFoilKap%s",suf),
1852 kpShape, medKap);
1853 TGeoVolume *alVol = new TGeoVolume(Form("ITSSPDgFoilAlu%s",suf),
1854 alShape, medAlu);
3ffa185f 1855 TGeoVolume *g0Vol = new TGeoVolume(Form("ITSSPDgFoilGlue%s",suf),
1856 g0Shape, medGlue);
1857 TGeoVolume *g1Vol = new TGeoVolume(Form("ITSSPDgFoilGlue%s",suf),
1858 g1Shape, medGlue);
54c9a3d9 1859 // set colors for the volumes
1860 kpVol->SetLineColor(kRed);
1861 alVol->SetLineColor(kGray);
3ffa185f 1862 g0Vol->SetLineColor(kYellow);
1863 g1Vol->SetLineColor(kYellow);
54c9a3d9 1864 // create references for the final size object
1865 if (sizes.GetSize() != 3) sizes.Set(3);
1866 Double_t &fullThickness = sizes[0];
1867 Double_t &fullLength = sizes[1];
1868 Double_t &fullWidth = sizes[2];
d0048cec 1869 // kapton leads the larger dimensions of the foil
54c9a3d9 1870 // (including the cited small distance from Z=0 stave reference plane)
1871 // the thickness is the sum of the ones of all components
1872 fullLength = kpLength + dist;
1873 fullWidth = kpWidth;
3ffa185f 1874 fullThickness = kpThickness + alThickness + g0Thickness + g1Thickness;
54c9a3d9 1875 // create the container
d0048cec 1876// TGeoMedium *air = GetMedium("AIR$", mgr);
1877 TGeoVolumeAssembly *container = new TGeoVolumeAssembly(Form("ITSSPDgFOIL-%s",suf));
1878// TGeoVolume *container = mgr->MakeBox(Form("ITSSPDgFOIL-%s",suf),
1879// air, 0.5*fullThickness, 0.5*fullWidth, 0.5*fullLength);
1880 // create the common correction rotation (which depends of what side
54c9a3d9 1881 // we are building)
1882 TGeoRotation *rotCorr = new TGeoRotation(*gGeoIdentity);
1883 if (isRight) rotCorr->RotateY(90.0);
d0048cec 1884 else rotCorr->RotateY(-90.0);
1885 // compute the translations, which are in the length and
54c9a3d9 1886 // thickness directions
1887 Double_t x, y, z, shift = 0.0;
1888 if (isRight) shift = dist;
1889 // glue (bottom)
3ffa185f 1890 x = -0.5*(fullThickness - g0Thickness);
54c9a3d9 1891 z = 0.5*(fullLength - kpLength) - shift;
1892 TGeoCombiTrans *glTrans0 = new TGeoCombiTrans(x, 0.0, z, rotCorr);
1893 // kapton
3ffa185f 1894 x += 0.5*(g0Thickness + kpThickness);
54c9a3d9 1895 TGeoCombiTrans *kpTrans = new TGeoCombiTrans(x, 0.0, z, rotCorr);
1896 // aluminum
1897 x += 0.5*(kpThickness + alThickness);
1898 z = 0.5*(fullLength - alLength) - shift - 0.5*(kpLength - alLength);
1899 TGeoCombiTrans *alTrans = new TGeoCombiTrans(x, 0.0, z, rotCorr);
1900 // glue (top)
3ffa185f 1901 x += 0.5*(alThickness + g1Thickness);
54c9a3d9 1902 z = 0.5*(fullLength - kpLength) - shift;
1903 TGeoCombiTrans *glTrans1 = new TGeoCombiTrans(x, 0.0, z, rotCorr);
d0048cec 1904
ed0e944d 1905 //cout << fgkGapHalfStave << endl;
1906 //cout << g0Thickness << endl;
1907 //cout << kpThickness << endl;
1908 //cout << alThickness << endl;
1909 //cout << g1Thickness << endl;
54c9a3d9 1910
1911 // add to container
22726349 1912 container->SetLineColor(kMagenta-10);
54c9a3d9 1913 container->AddNode(kpVol, 1, kpTrans);
1914 container->AddNode(alVol, 1, alTrans);
3ffa185f 1915 container->AddNode(g0Vol, 1, glTrans0);
d0048cec 1916 container->AddNode(g1Vol, 2, glTrans1);
1917 // to add the grease we remember the sizes of the holes, stored as
54c9a3d9 1918 // additional parameters in the kapton layer size:
1919 // - sizes[3] = hole length
1920 // - sizes[4] = hole width
1921 // - sizes[5] = position of first hole center
1922 // - sizes[6] = standard separation between holes
1923 // - sizes[7] = separation between 5th and 6th hole
1924 // - sizes[8] = separation between 10th and 11th hole
d0048cec 1925 // - sizes[9] = separation between the upper hole border and
54c9a3d9 1926 // the foil border
1927 Double_t holeLength = kpSize[0];
1928 Double_t holeWidth = kpSize[1];
1929 Double_t holeFirstZ = kpSize[2];
1930 Double_t holeSepZ = kpSize[3];
1931 Double_t holeSep5th6th = kpSize[4];
1932 Double_t holeSep10th11th = kpSize[5];
1933 Double_t holeSepY = kpSize[6];
1934 // volume (common)
1935 // Grease has not been defined to date. Need much more information
1936 // no this material!
1937 TGeoMedium *grease = GetMedium("SPD KAPTON(POLYCH2)$", mgr); // ??? GREASE
1938 TGeoVolume *hVol = mgr->MakeBox("ITSSPDGrease", grease,
1939 0.5*fullThickness, 0.5*holeWidth, 0.5*holeLength);
1940 hVol->SetLineColor(kBlue);
1941 // displacement of volumes in the container
1942 Int_t idx = 1; // copy numbers start from 1.
1943 x = 0.0;
1944 y = 0.5*(fullWidth - holeWidth) - holeSepY;
1945 if (isRight) z = holeFirstZ - 0.5*fullLength + dist;
1946 else z = 0.5*fullLength - holeFirstZ - dist;
1947 for (Int_t i = 0; i < 11; i++) {
1948 TGeoTranslation *t = 0;
1949 t = new TGeoTranslation(x, y, -z);
1950 container->AddNode(hVol, idx++, t);
1951 if (i < 4) shift = holeSepZ;
1952 else if (i == 4) shift = holeSep5th6th;
1953 else if (i < 9) shift = holeSepZ;
1954 else shift = holeSep10th11th;
1955 if (isRight) z += shift;
1956 else z -= shift;
1957 } // end for i
1958 return container;
592651e2 1959}
54c9a3d9 1960//___________________________________________________________________
1961TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateMCM(Bool_t isRight,
1962 TArrayD &sizes, TGeoManager *mgr) const
bc3498f4 1963{
54c9a3d9 1964 //
1965 // Create a TGeoAssembly containing all the components of the MCM.
1966 // The TGeoVolume container is rejected due to the possibility of overlaps
1967 // when placing this object on the carbon fiber sector.
1968 // The assembly contains:
1969 // - the thin part of the MCM (integrated circuit)
1970 // - the MCM chips (specifications from EDMS)
1971 // - the cap which covers the zone where chips are bound to MCM
1972 // ---
d0048cec 1973 // The local reference frame of this assembly is defined in such a way
1974 // that all volumes are contained in a virtual box whose center
1975 // is placed exactly in the middle of the occupied space w.r to all
1976 // directions. This will ease the positioning of this object in the
1977 // half-stave. The sizes of this virtual box are stored in
54c9a3d9 1978 // the array passed by reference.
1979 // ---
1980 // Arguments:
d0048cec 1981 // - a boolean flag to know if this is the "left" or "right" MCM, when
1982 // looking at the stave from above (i.e. the direction from which
1983 // one sees bus over ladders over grounding foil) and keeping the
1984 // continuous border in the upper part, one sees the thicker part
54c9a3d9 1985 // on the left or right.
d0048cec 1986 // - an array passed by reference which will contain the size of
54c9a3d9 1987 // the virtual container.
1988 // - a pointer to the used TGeoManager.
1989 //
1990
1991 // to distinguish the "left" and "right" objects, a suffix is created
1992 char suf[5];
6932f314 1993 if (isRight) strncpy(suf, "R", 5); else strncpy(suf, "L", 5);
54c9a3d9 1994
1995 // ** MEDIA **
1996 TGeoMedium *medBase = GetMedium("SPD KAPTON(POLYCH2)$",mgr);// ??? MCM BASE
1997 TGeoMedium *medChip = GetMedium("SPD SI CHIP$",mgr);
1998 TGeoMedium *medCap = GetMedium("AL$",mgr);
1999
d0048cec 2000 // The shape of the MCM is divided into 3 sectors with different
54c9a3d9 2001 // widths (Y) and lengths (X), like in this sketch:
2002 //
d0048cec 2003 // 0 1 2
54c9a3d9 2004 // +---------------------+-----------------------------------+
2005 // | 4 sect 2 |
2006 // | 6 sect 1 /-------------------+
2007 // | sect 0 /--------------/ 3
2008 // +--------------------/ 5
2009 // 8 7
2010 //
2011 // the inclination of all oblique borders (6-7, 4-5) is always 45 degrees.
2012 // From drawings we can parametrize the dimensions of all these sectors,
2013 // then the shape of this part of the MCM is implemented as a
d0048cec 2014 // TGeoXtru centerd in the virtual XY space.
54c9a3d9 2015 // The first step is definig the relevant sizes of this shape:
2016 Int_t i, j;
2017 Double_t mcmThickness = fgkmm * 0.35;
2018 Double_t sizeXtot = fgkmm * 105.6; // total distance (0-2)
2019 // resp. 7-8, 5-6 and 3-4
2020 Double_t sizeXsector[3] = {fgkmm * 28.4, fgkmm * 41.4, fgkmm * 28.8};
2021 // resp. 0-8, 1-6 and 2-3
2022 Double_t sizeYsector[3] = {fgkmm * 15.0, fgkmm * 11.0, fgkmm * 8.0};
2023 Double_t sizeSep01 = fgkmm * 4.0; // x(6)-x(7)
2024 Double_t sizeSep12 = fgkmm * 3.0; // x(4)-x(5)
2025
2026 // define sizes of chips (last is the thickest)
2027 Double_t chipLength[5] = { 4.00, 6.15, 3.85, 5.60, 18.00 };
2028 Double_t chipWidth[5] = { 3.00, 4.10, 3.85, 5.60, 5.45 };
2029 Double_t chipThickness[5] = { 0.60, 0.30, 0.30, 1.00, 1.20 };
2030 TString name[5];
2031 name[0] = "ITSSPDanalog";
2032 name[1] = "ITSSPDpilot";
2033 name[2] = "ITSSPDgol";
2034 name[3] = "ITSSPDrx40";
2035 name[4] = "ITSSPDoptical";
2036 Color_t color[5] = { kCyan, kGreen, kYellow, kBlue, kOrange };
2037
2038 // define the sizes of the cover
2039 Double_t capThickness = fgkmm * 0.3;
2040 Double_t capHeight = fgkmm * 1.7;
2041
2042 // compute the total size of the virtual container box
2043 sizes.Set(3);
2044 Double_t &thickness = sizes[0];
2045 Double_t &length = sizes[1];
2046 Double_t &width = sizes[2];
2047 length = sizeXtot;
2048 width = sizeYsector[0];
2049 thickness = mcmThickness + capHeight;
2050
d0048cec 2051 // define all the relevant vertices of the polygon
54c9a3d9 2052 // which defines the transverse shape of the MCM.
d0048cec 2053 // These values are used to several purposes, and
54c9a3d9 2054 // for each one, some points must be excluded
2055 Double_t xRef[9], yRef[9];
2056 xRef[0] = -0.5*sizeXtot;
2057 yRef[0] = 0.5*sizeYsector[0];
2058 xRef[1] = xRef[0] + sizeXsector[0] + sizeSep01;
2059 yRef[1] = yRef[0];
2060 xRef[2] = -xRef[0];
2061 yRef[2] = yRef[0];
2062 xRef[3] = xRef[2];
2063 yRef[3] = yRef[2] - sizeYsector[2];
2064 xRef[4] = xRef[3] - sizeXsector[2];
2065 yRef[4] = yRef[3];
2066 xRef[5] = xRef[4] - sizeSep12;
2067 yRef[5] = yRef[4] - sizeSep12;
2068 xRef[6] = xRef[5] - sizeXsector[1];
2069 yRef[6] = yRef[5];
2070 xRef[7] = xRef[6] - sizeSep01;
2071 yRef[7] = yRef[6] - sizeSep01;
2072 xRef[8] = xRef[0];
2073 yRef[8] = -yRef[0];
2074
d0048cec 2075 // the above points are defined for the "right" MCM (if ve view the
2076 // stave from above) in order to change to the "left" one, we must
54c9a3d9 2077 // change the sign to all X values:
2078 if (isRight) for (i = 0; i < 9; i++) xRef[i] = -xRef[i];
d0048cec 2079
2080 // the shape of the MCM and glue layer are done excluding point 1,
54c9a3d9 2081 // which is not necessary and cause the geometry builder to get confused
2082 j = 0;
2083 Double_t xBase[8], yBase[8];
2084 for (i = 0; i < 9; i++) {
2085 if (i == 1) continue;
2086 xBase[j] = xRef[i];
2087 yBase[j] = yRef[i];
2088 j++;
2089 } // end for i
2090
2091 // the MCM cover is superimposed over the zones 1 and 2 only
2092 Double_t xCap[6], yCap[6];
2093 j = 0;
2094 for (i = 1; i <= 6; i++) {
2095 xCap[j] = xRef[i];
2096 yCap[j] = yRef[i];
2097 j++;
2098 } // end for i
2099
d0048cec 2100 // define positions of chips,
54c9a3d9 2101 // which must be added to the bottom-left corner of MCM
2102 // and divided by 1E4;
2103 Double_t chipX[5], chipY[5];
2104 if (isRight) {
2105 chipX[0] = 666320.;
2106 chipX[1] = 508320.;
2107 chipX[2] = 381320.;
2108 chipX[3] = 295320.;
2109 chipX[4] = 150320.;
2110 chipY[0] = 23750.;
2111 chipY[1] = 27750.;
2112 chipY[2] = 20750.;
2113 chipY[3] = 42750.;
2114 chipY[4] = 39750.;
2115 } else {
2116 chipX[0] = 389730.;
2117 chipX[1] = 548630.;
2118 chipX[2] = 674930.;
2119 chipX[3] = 761430.;
2120 chipX[4] = 905430.;
2121 chipY[0] = 96250.;
2122 chipY[1] = 91950.;
2123 chipY[2] = 99250.;
2124 chipY[3] = 107250.;
2125 chipY[4] = 109750.;
2126 } // end if isRight
2127 for (i = 0; i < 5; i++) {
2128 chipX[i] *= 0.00001;
2129 chipY[i] *= 0.00001;
2130 if (isRight) {
2131 chipX[i] += xRef[3];
2132 chipY[i] += yRef[3];
2133 } else {
2134 chipX[i] += xRef[8];
2135 chipY[i] += yRef[8];
2136 } // end for isRight
2137 chipLength[i] *= fgkmm;
2138 chipWidth[i] *= fgkmm;
2139 chipThickness[i] *= fgkmm;
2140 } // end for i
2141
d0048cec 2142 // create shapes for MCM
54c9a3d9 2143 Double_t z1, z2;
2144 TGeoXtru *shBase = new TGeoXtru(2);
2145 z1 = -0.5*thickness;
2146 z2 = z1 + mcmThickness;
2147 shBase->DefinePolygon(8, xBase, yBase);
2148 shBase->DefineSection(0, z1, 0., 0., 1.0);
2149 shBase->DefineSection(1, z2, 0., 0., 1.0);
2150
2151 // create volumes of MCM
2152 TGeoVolume *volBase = new TGeoVolume("ITSSPDbase", shBase, medBase);
2153 volBase->SetLineColor(kRed);
2154
d0048cec 2155 // to create the border of the MCM cover, it is required the
2156 // subtraction of two shapes the outer is created using the
54c9a3d9 2157 // reference points defined here
2158 TGeoXtru *shCapOut = new TGeoXtru(2);
2159 shCapOut->SetName(Form("ITSSPDshCAPOUT%s", suf));
2160 z1 = z2;
2161 z2 = z1 + capHeight - capThickness;
2162 shCapOut->DefinePolygon(6, xCap, yCap);
2163 shCapOut->DefineSection(0, z1, 0., 0., 1.0);
2164 shCapOut->DefineSection(1, z2, 0., 0., 1.0);
2165 // the inner is built similarly but subtracting the thickness
2166 Double_t angle, cs;
2167 Double_t xin[6], yin[6];
2168 if (!isRight) {
2169 angle = 45.0;
2170 cs = TMath::Cos( 0.5*(TMath::Pi() - angle*TMath::DegToRad()) );
2171 xin[0] = xCap[0] + capThickness;
2172 yin[0] = yCap[0] - capThickness;
2173 xin[1] = xCap[1] - capThickness;
2174 yin[1] = yin[0];
2175 xin[2] = xin[1];
2176 yin[2] = yCap[2] + capThickness;
2177 xin[3] = xCap[3] - capThickness*cs;
2178 yin[3] = yin[2];
2179 xin[4] = xin[3] - sizeSep12;
2180 yin[4] = yCap[4] + capThickness;
2181 xin[5] = xin[0];
2182 yin[5] = yin[4];
2183 } else {
2184 angle = 45.0;
2185 cs = TMath::Cos( 0.5*(TMath::Pi() - angle*TMath::DegToRad()) );
2186 xin[0] = xCap[0] - capThickness;
2187 yin[0] = yCap[0] - capThickness;
2188 xin[1] = xCap[1] + capThickness;
2189 yin[1] = yin[0];
2190 xin[2] = xin[1];
2191 yin[2] = yCap[2] + capThickness;
2192 xin[3] = xCap[3] - capThickness*cs;
2193 yin[3] = yin[2];
2194 xin[4] = xin[3] + sizeSep12;
2195 yin[4] = yCap[4] + capThickness;
2196 xin[5] = xin[0];
2197 yin[5] = yin[4];
2198 } // end if !isRight
2199 TGeoXtru *shCapIn = new TGeoXtru(2);
2200 shCapIn->SetName(Form("ITSSPDshCAPIN%s", suf));
2201 shCapIn->DefinePolygon(6, xin, yin);
2202 shCapIn->DefineSection(0, z1 - 0.01, 0., 0., 1.0);
2203 shCapIn->DefineSection(1, z2 + 0.01, 0., 0., 1.0);
2204 // compose shapes
2205 TGeoCompositeShape *shCapBorder = new TGeoCompositeShape(
d0048cec 2206 Form("ITSSPDshBORDER%s", suf),
54c9a3d9 2207 Form("%s-%s", shCapOut->GetName(),
2208 shCapIn->GetName()));
2209 // create volume
2210 TGeoVolume *volCapBorder = new TGeoVolume("ITSSPDcapBoarder",
2211 shCapBorder,medCap);
2212 volCapBorder->SetLineColor(kGreen);
d0048cec 2213 // finally, we create the top of the cover, which has the same
2214 // shape of outer border and a thickness equal of the one othe
54c9a3d9 2215 // cover border one
2216 TGeoXtru *shCapTop = new TGeoXtru(2);
2217 z1 = z2;
2218 z2 = z1 + capThickness;
2219 shCapTop->DefinePolygon(6, xCap, yCap);
2220 shCapTop->DefineSection(0, z1, 0., 0., 1.0);
2221 shCapTop->DefineSection(1, z2, 0., 0., 1.0);
2222 TGeoVolume *volCapTop = new TGeoVolume("ITSSPDcapTop", shCapTop, medCap);
2223 volCapTop->SetLineColor(kBlue);
2224
2225 // create container assembly with right suffix
2226 TGeoVolumeAssembly *mcmAssembly = new TGeoVolumeAssembly(
2227 Form("ITSSPDmcm%s", suf));
2228
2229 // add mcm layer
2230 mcmAssembly->AddNode(volBase, 1, gGeoIdentity);
2231 // add chips
2232 for (i = 0; i < 5; i++) {
2233 TGeoVolume *box = gGeoManager->MakeBox(name[i],medChip,
2234 0.5*chipLength[i], 0.5*chipWidth[i], 0.5*chipThickness[i]);
2235 TGeoTranslation *tr = new TGeoTranslation(chipX[i],chipY[i],
2236 0.5*(-thickness + chipThickness[i]) + mcmThickness);
2237 box->SetLineColor(color[i]);
2238 mcmAssembly->AddNode(box, 1, tr);
2239 } // end for i
2240 // add cap border
2241 mcmAssembly->AddNode(volCapBorder, 1, gGeoIdentity);
2242 // add cap top
d0048cec 2243 mcmAssembly->AddNode(volCapTop, 1, gGeoIdentity);
54c9a3d9 2244
2245 return mcmAssembly;
592651e2 2246}
7f69c251 2247
54c9a3d9 2248//______________________________________________________________________
bc3498f4 2249TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
22726349 2250(Bool_t isRight, Int_t ilayer, TArrayD &sizes, TGeoManager *mgr) const
bc3498f4 2251{
54c9a3d9 2252 //
d0048cec 2253 // The pixel bus is implemented as a TGeoBBox with some objects on it,
54c9a3d9 2254 // which could affect the particle energy loss.
2255 // ---
d0048cec 2256 // In order to avoid confusion, the bus is directly displaced
54c9a3d9 2257 // according to the axis orientations which are used in the final stave:
2258 // X --> thickness direction
2259 // Y --> width direction
2260 // Z --> length direction
2261 //
d0048cec 2262
22726349 2263 // ** CRITICAL CHECK ******************************************************
2264 // layer number can be ONLY 1 or 2
2265 if (ilayer != 1 && ilayer != 2) AliFatal("Layer number MUST be 1 or 2");
54c9a3d9 2266
2267 // ** MEDIA **
2268 //PIXEL BUS
2269 TGeoMedium *medBus = GetMedium("SPDBUS(AL+KPT+EPOX)$",mgr);
2270 TGeoMedium *medPt1000 = GetMedium("CERAMICS$",mgr); // ??? PT1000
2271 // Capacity
2272 TGeoMedium *medCap = GetMedium("SDD X7R capacitors$",mgr);
2273 // ??? Resistance
d0048cec 2274 //TGeoMedium *medRes = GetMedium("SDD X7R capacitors$",mgr);
7f69c251 2275 TGeoMedium *medRes = GetMedium("ALUMINUM$",mgr);
45c52bb2 2276 //TGeoMedium *medExt = GetMedium("SDDKAPTON (POLYCH2)$", mgr);
2277 TGeoMedium *medExt = GetMedium("SPD-MIX CU KAPTON$", mgr);
54c9a3d9 2278 // ** SIZES & POSITIONS **
2279 Double_t busLength = 170.501 * fgkmm; // length of plane part
2280 Double_t busWidth = 13.800 * fgkmm; // width
2281 Double_t busThickness = 0.280 * fgkmm; // thickness
2282 Double_t pt1000Length = fgkmm * 1.50;
2283 Double_t pt1000Width = fgkmm * 3.10;
2284 Double_t pt1000Thickness = fgkmm * 0.60;
2285 Double_t pt1000Y, pt1000Z[10];// position of the pt1000's along the bus
2286 Double_t capLength = fgkmm * 2.55;
2287 Double_t capWidth = fgkmm * 1.50;
2288 Double_t capThickness = fgkmm * 1.35;
2289 Double_t capY[2], capZ[2];
d0048cec 2290
54c9a3d9 2291 Double_t resLength = fgkmm * 2.20;
2292 Double_t resWidth = fgkmm * 0.80;
2293 Double_t resThickness = fgkmm * 0.35;
2294 Double_t resY[2], resZ[2];
d0048cec 2295
7f69c251 2296 Double_t extThickness = fgkmm * 0.25;
3ffa185f 2297 Double_t ext1Length = fgkmm * (26.7 - 10.0);
ddf00e3c 2298 Double_t ext2Length = fgkmm * 284.0 - ext1Length + extThickness;
c33a0330 2299 Double_t ext2LengthL2 = fgkmm * 130.0;
2300 Double_t ext4Length = fgkmm * 40.0;
2301 Double_t ext4Twist = 66.54; //deg
3ffa185f 2302 Double_t extWidth = fgkmm * 11.0;
2303 Double_t extHeight = fgkmm * 2.5;
d0048cec 2304
2305 // position of pt1000, resistors and capacitors depends on the
54c9a3d9 2306 // bus if it's left or right one
2307 if (!isRight) {
2308 pt1000Y = 64400.;
2309 pt1000Z[0] = 66160.;
2310 pt1000Z[1] = 206200.;
2311 pt1000Z[2] = 346200.;
2312 pt1000Z[3] = 486200.;
2313 pt1000Z[4] = 626200.;
2314 pt1000Z[5] = 776200.;
2315 pt1000Z[6] = 916200.;
2316 pt1000Z[7] = 1056200.;
2317 pt1000Z[8] = 1196200.;
d0048cec 2318 pt1000Z[9] = 1336200.;
54c9a3d9 2319 resZ[0] = 1397500.;
2320 resY[0] = 26900.;
2321 resZ[1] = 682500.;
2322 resY[1] = 27800.;
2323 capZ[0] = 1395700.;
2324 capY[0] = 45700.;
2325 capZ[1] = 692600.;
2326 capY[1] = 45400.;
2327 } else {
2328 pt1000Y = 66100.;
2329 pt1000Z[0] = 319700.;
2330 pt1000Z[1] = 459700.;
2331 pt1000Z[2] = 599700.;
2332 pt1000Z[3] = 739700.;
2333 pt1000Z[4] = 879700.;
2334 pt1000Z[5] = 1029700.;
2335 pt1000Z[6] = 1169700.;
2336 pt1000Z[7] = 1309700.;
2337 pt1000Z[8] = 1449700.;
d0048cec 2338 pt1000Z[9] = 1589700.;
54c9a3d9 2339 capY[0] = 44500.;
2340 capZ[0] = 266700.;
2341 capY[1] = 44300.;
2342 capZ[1] = 974700.;
2343 resZ[0] = 266500.;
2344 resY[0] = 29200.;
2345 resZ[1] = 974600.;
2346 resY[1] = 29900.;
2347 } // end if isRight
2348 Int_t i;
2349 pt1000Y *= 1E-4 * fgkmm;
2350 for (i = 0; i < 10; i++) {
2351 pt1000Z[i] *= 1E-4 * fgkmm;
2352 if (i < 2) {
2353 capZ[i] *= 1E-4 * fgkmm;
2354 capY[i] *= 1E-4 * fgkmm;
2355 resZ[i] *= 1E-4 * fgkmm;
2356 resY[i] *= 1E-4 * fgkmm;
2357 } // end if iM2
2358 } // end for i
d0048cec 2359
54c9a3d9 2360 Double_t &fullLength = sizes[1];
2361 Double_t &fullWidth = sizes[2];
2362 Double_t &fullThickness = sizes[0];
2363 fullLength = busLength;
2364 fullWidth = busWidth;
2365 // add the thickness of the thickest component on bus (capacity)
d0048cec 2366 fullThickness = busThickness + capThickness;
54c9a3d9 2367
2368 // ** VOLUMES **
2369 TGeoVolumeAssembly *container = new TGeoVolumeAssembly("ITSSPDpixelBus");
d0048cec 2370 TGeoVolume *bus = mgr->MakeBox("ITSSPDbus", medBus, 0.5*busThickness,
54c9a3d9 2371 0.5*busWidth, 0.5*busLength);
2372 TGeoVolume *pt1000 = mgr->MakeBox("ITSSPDpt1000",medPt1000,
2373 0.5*pt1000Thickness,0.5*pt1000Width, 0.5*pt1000Length);
2374 TGeoVolume *res = mgr->MakeBox("ITSSPDresistor", medRes, 0.5*resThickness,
2375 0.5*resWidth, 0.5*resLength);
2376 TGeoVolume *cap = mgr->MakeBox("ITSSPDcapacitor", medCap, 0.5*capThickness,
2377 0.5*capWidth, 0.5*capLength);
d0048cec 2378
954323d3 2379 char extname[12];
6932f314 2380 snprintf(extname,12,"Extender1l%d",ilayer);
954323d3 2381 TGeoVolume *ext1 = mgr->MakeBox(extname, medExt, 0.5*extThickness, 0.5*extWidth, 0.5*ext1Length);
6932f314 2382 snprintf(extname,12,"Extender2l%d",ilayer);
954323d3 2383 TGeoVolume *ext2 = mgr->MakeBox(extname, medExt, 0.5*extHeight - 2.*extThickness, 0.5*extWidth, 0.5*extThickness);
2384 TGeoVolume *ext3=0;
6932f314 2385 snprintf(extname,12,"Extender3l%d",ilayer);
c33a0330 2386 TGeoVolume *ext4=0;
2387 snprintf(extname,12,"Extender3l%d",ilayer);
954323d3 2388 if (ilayer==1) {
2389 Double_t halflen=(0.5*ext2Length + extThickness);
2390 Double_t xprof[6],yprof[6];
2391 Double_t alpha=24;
2392 xprof[0] = -halflen;
2393 yprof[0] = -0.5*extThickness;
2394 xprof[1] = halflen/2;
2395 yprof[1] = yprof[0];
2396 xprof[2] = xprof[1] + 0.5*halflen*CosD(alpha);
2397 yprof[2] = yprof[1] + 0.5*halflen*SinD(alpha);
2398 xprof[3] = xprof[2] - extThickness*SinD(alpha);
2399 yprof[3] = yprof[2] + extThickness*CosD(alpha);
2400 InsidePoint(xprof[0], yprof[0], xprof[1], yprof[1], xprof[2], yprof[2],
2401 extThickness, xprof[4], yprof[4]);
2402 xprof[5] = xprof[0];
2403 yprof[5] = 0.5*extThickness;
2404 TGeoXtru *ext3sh = new TGeoXtru(2);
2405 ext3sh->DefinePolygon(6, xprof, yprof);
2406 ext3sh->DefineSection(0, -0.5*(extWidth-0.8*fgkmm));
2407 ext3sh->DefineSection(1, 0.5*(extWidth-0.8*fgkmm));
2408 ext3 = new TGeoVolume(extname, ext3sh, medExt);
c33a0330 2409 } else {
2410 ext3 = mgr->MakeBox(extname, medExt, 0.5*extThickness, 0.5*(extWidth-0.8*fgkmm), 0.5*ext2LengthL2 + extThickness); // Hardcode fix of a small overlap
2411 ext4= mgr->MakeGtra("Extender4l2", medExt, 0.5*ext4Length, 0, 0, ext4Twist, 0.5*(extWidth-0.8*fgkmm), 0.5*extThickness, 0.5*extThickness, 0, 0.5*(extWidth-0.8*fgkmm), 0.5*extThickness, 0.5*extThickness, 0);
2412 ext4->SetLineColor(kGray);
2413 }
54c9a3d9 2414 bus->SetLineColor(kYellow + 2);
2415 pt1000->SetLineColor(kGreen + 3);
2416 res->SetLineColor(kRed + 1);
2417 cap->SetLineColor(kBlue - 7);
7f69c251 2418 ext1->SetLineColor(kGray);
3ffa185f 2419 ext2->SetLineColor(kGray);
2420 ext3->SetLineColor(kGray);
54c9a3d9 2421
2422 // ** MOVEMENTS AND POSITIONEMENT **
2423 // bus
d0048cec 2424 TGeoTranslation *trBus = new TGeoTranslation(0.5 * (busThickness -
54c9a3d9 2425 fullThickness), 0.0, 0.0);
2426 container->AddNode(bus, 1, trBus);
2427 Double_t zRef, yRef, x, y, z;
2428 if (isRight) {
2429 zRef = -0.5*fullLength;
2430 yRef = -0.5*fullWidth;
2431 } else {
2432 zRef = -0.5*fullLength;
2433 yRef = -0.5*fullWidth;
2434 } // end if isRight
2435 // pt1000
2436 x = 0.5*(pt1000Thickness - fullThickness) + busThickness;
2437 for (i = 0; i < 10; i++) {
2438 y = yRef + pt1000Y;
2439 z = zRef + pt1000Z[i];
2440 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2441 container->AddNode(pt1000, i+1, tr);
2442 } // end for i
2443 // capacitors
2444 x = 0.5*(capThickness - fullThickness) + busThickness;
2445 for (i = 0; i < 2; i++) {
2446 y = yRef + capY[i];
2447 z = zRef + capZ[i];
2448 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2449 container->AddNode(cap, i+1, tr);
2450 } // end for i
2451 // resistors
2452 x = 0.5*(resThickness - fullThickness) + busThickness;
2453 for (i = 0; i < 2; i++) {
2454 y = yRef + resY[i];
2455 z = zRef + resZ[i];
2456 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2457 container->AddNode(res, i+1, tr);
2458 } // end for i
d0048cec 2459
7f69c251 2460 // extender
22726349 2461 if (ilayer == 2) {
3ffa185f 2462 if (isRight) {
2463 y = 0.5 * (fullWidth - extWidth) - 0.1;
2464 z = 0.5 * (-fullLength + fgkmm * 10.0);
2465 }
2466 else {
2467 y = 0.5 * (fullWidth - extWidth) - 0.1;
2468 z = 0.5 * ( fullLength - fgkmm * 10.0);
2469 }
22726349 2470 }
2471 else {
2472 if (isRight) {
2473 y = -0.5 * (fullWidth - extWidth);
2474 z = 0.5 * (-fullLength + fgkmm * 10.0);
2475 }
2476 else {
2477 y = -0.5 * (fullWidth - extWidth);
2478 z = 0.5 * ( fullLength - fgkmm * 10.0);
2479 }
2480 }
3ffa185f 2481 x = 0.5 * (extThickness - fullThickness) + busThickness;
2482 //y = 0.5 * (fullWidth - extWidth);
2483 TGeoTranslation *trExt1 = new TGeoTranslation(x, y, z);
2484 if (isRight) {
2485 z -= 0.5 * (ext1Length - extThickness);
2486 }
2487 else {
2488 z += 0.5 * (ext1Length - extThickness);
2489 }
2490 x += 0.5*(extHeight - 3.*extThickness);
2491 TGeoTranslation *trExt2 = new TGeoTranslation(x, y, z);
2492 if (isRight) {
c33a0330 2493 if (ilayer==1)
3ffa185f 2494 z -= 0.5 * (ext2Length - extThickness) + 2.5*extThickness;
c33a0330 2495 else
2496 z -= 0.5 * (ext2LengthL2 - extThickness) + 2.5*extThickness;
3ffa185f 2497 }
2498 else {
c33a0330 2499 if (ilayer==1)
3ffa185f 2500 z += 0.5 * (ext2Length - extThickness) + 2.5*extThickness;
c33a0330 2501 else
2502 z += 0.5 * (ext2LengthL2 - extThickness) + 2.5*extThickness;
3ffa185f 2503 }
2504 x += 0.5*(extHeight - extThickness) - 2.*extThickness;
954323d3 2505 TGeoCombiTrans *trExt3=0;
2506 if (ilayer==1) {
2507 if (isRight)
2508 trExt3 = new TGeoCombiTrans(x, y, z, new TGeoRotation("",0.,-90.,90.));
2509 else
2510 trExt3 = new TGeoCombiTrans(x, y, z, new TGeoRotation("",0., 90.,90.));
2511 } else
2512 trExt3 = new TGeoCombiTrans(x, y, z, 0);
3ffa185f 2513 container->AddNode(ext1, 0, trExt1);
2514 container->AddNode(ext2, 0, trExt2);
2515 container->AddNode(ext3, 0, trExt3);
c33a0330 2516 if (ilayer==2) {
2517 TGeoCombiTrans *trExt4=0;
2518 if (isRight) {
2519 z -= ( ((TGeoBBox*)ext3->GetShape())->GetDZ() + ((TGeoGtra*)ext4->GetShape())->GetDZ() );
2520 trExt4 = new TGeoCombiTrans(x, y, z, new TGeoRotation("", ext4Twist/2,0,0));
2521 } else {
2522 z += ( ((TGeoBBox*)ext3->GetShape())->GetDZ() + ((TGeoGtra*)ext4->GetShape())->GetDZ() );
2523 trExt4 = new TGeoCombiTrans(x, y, z, new TGeoRotation("",-ext4Twist/2,0,0));
2524 }
2525 container->AddNode(ext4, 0, trExt4);
2526 }
54c9a3d9 2527 sizes[3] = yRef + pt1000Y;
2528 sizes[4] = zRef + pt1000Z[2];
2529 sizes[5] = zRef + pt1000Z[7];
d0048cec 2530
54c9a3d9 2531 return container;
592651e2 2532}
7f69c251 2533
2534//______________________________________________________________________
44d18d38 2535TList* AliITSv11GeometrySPD::CreateConeModule(Bool_t sideC, const Double_t angrot,
96eb8210 2536 TGeoManager *mgr) const
7f69c251 2537{
96eb8210 2538 //
2539 // Creates all services modules and places them in a TList
2540 // angrot is the rotation angle (passed as an argument to avoid
2541 // defining the same quantity in two different places)
2542 //
45c52bb2 2543 // Created: ?? ??? 2008 A. Pulvirenti
2544 // Updated: 03 May 2010 M. Sitta
2545 // Updated: 20 Jun 2010 A. Pulvirenti Optical patch panels
2546 // Updated: 22 Jun 2010 M. Sitta Fiber cables
c890eba4 2547 // Updated: 04 Jul 2010 M. Sitta Water cooling
44d18d38 2548 // Updated: 08 Jul 2010 A. Pulvirenti Air cooling on Side C
96eb8210 2549 //
2550
7f69c251 2551 TGeoMedium *medInox = GetMedium("INOX$",mgr);
45c52bb2 2552 //TGeoMedium *medExt = GetMedium("SDDKAPTON (POLYCH2)$", mgr);
2553 TGeoMedium *medExtB = GetMedium("SPD-BUS CU KAPTON$", mgr);
2554 TGeoMedium *medExtM = GetMedium("SPD-MCM CU KAPTON$", mgr);
3ffa185f 2555 TGeoMedium *medPlate = GetMedium("SPD C (M55J)$", mgr);
96eb8210 2556 TGeoMedium *medFreon = GetMedium("Freon$", mgr);
2557 TGeoMedium *medGas = GetMedium("GASEOUS FREON$", mgr);
45c52bb2 2558 TGeoMedium *medFibs = GetMedium("SDD OPTICFIB$",mgr);
c890eba4 2559 TGeoMedium *medCopper= GetMedium("COPPER$",mgr);
44d18d38 2560 TGeoMedium *medPVC = GetMedium("PVC$",mgr);
d0048cec 2561
3ffa185f 2562 Double_t extThickness = fgkmm * 0.25;
2563 Double_t ext1Length = fgkmm * (26.7 - 10.0);
96eb8210 2564// Double_t ext2Length = fgkmm * (285.0 - ext1Length + extThickness);
2565 Double_t ext2Length = fgkmm * 285.0 - ext1Length + extThickness;
d0048cec 2566
96eb8210 2567 const Double_t kCableThickness = 1.5 *fgkmm;
954323d3 2568 Double_t cableL0 = 10.0 * fgkmm;
96eb8210 2569 Double_t cableL1 = 340.0 * fgkmm - extThickness - ext1Length - ext2Length;
2570 Double_t cableL2 = 300.0 * fgkmm;
7f69c251 2571 //Double_t cableL3 = 570.0 * fgkmm;
2572 Double_t cableL3 = 57.0 * fgkmm;
2573 Double_t cableW1 = 11.0 * fgkmm;
2574 Double_t cableW2 = 30.0 * fgkmm;
2575 Double_t cableW3 = 50.0 * fgkmm;
d0048cec 2576
954323d3 2577 const Double_t kMCMLength = cableL0 + cableL1 + cableL2 + cableL3;
96eb8210 2578 const Double_t kMCMWidth = cableW1;
2579 const Double_t kMCMThickness = 1.2 *fgkmm;
d0048cec 2580
96eb8210 2581 const Double_t kPlateLength = 200.0 *fgkmm;
2582 const Double_t kPlateWidth = 50.0 *fgkmm;
2583 const Double_t kPlateThickness = 5.0 *fgkmm;
2584
45c52bb2 2585 const Double_t kConeTubeRmin = 2.0 *fgkmm;
2586 const Double_t kConeTubeRmax = 3.0 *fgkmm;
96eb8210 2587
45c52bb2 2588 const Double_t kHorizTubeLen = 150.0 *fgkmm;
4c8afd2e 2589 const Double_t kYtoHalfStave = 9.5 *fgkmm;
c890eba4 2590
2591 const Double_t kWaterCoolRMax = 2.6 *fgkmm;
2592 const Double_t kWaterCoolThick = 0.04 *fgkmm;
2593 const Double_t kWaterCoolLen = 250.0 *fgkmm;
2594 const Double_t kWCPlateThick = 0.5 *fgkmm;
2595 const Double_t kWCPlateWide = 33.0 *fgkmm;
2596 const Double_t kWCPlateLen = 230.0 *fgkmm;
2597 const Double_t kWCFittingRext1 = 2.4 *fgkmm;
2598 const Double_t kWCFittingRext2 = 3.7 *fgkmm;
2599 const Double_t kWCFittingRint1 = 1.9 *fgkmm;
2600 const Double_t kWCFittingRint2 = kWaterCoolRMax;
2601 const Double_t kWCFittingLen1 = 7.0 *fgkmm;
2602 const Double_t kWCFittingLen2 = 8.0 *fgkmm;
44d18d38 2603
2604 const Double_t kCollWidth = 40.0 *fgkmm;
2605 const Double_t kCollLength = 60.0 *fgkmm;
2606 const Double_t kCollThickness = 10.0 *fgkmm;
2607 const Double_t kCollTubeThick = 1.0 *fgkmm;
2608 const Double_t kCollTubeRadius = 7.0 *fgkmm;
8bb39321 2609 const Double_t kCollTubeLength = 205.0 *fgkmm;
45c52bb2 2610
2611 const Double_t kOptFibDiamet = 4.5 *fgkmm;
d0048cec 2612
7f69c251 2613 Double_t x[12], y[12];
96eb8210 2614 Double_t xloc, yloc, zloc;
2615
2616 Int_t kPurple = 6; // Purple (Root does not define it)
2617
c890eba4 2618 TGeoVolumeAssembly* container[5];
8bb39321 2619 if (sideC)
2620 container[0] = new TGeoVolumeAssembly("ITSSPDConeModuleC");
2621 else
2622 container[0] = new TGeoVolumeAssembly("ITSSPDConeModuleA");
96eb8210 2623 container[1] = new TGeoVolumeAssembly("ITSSPDCoolingModuleSideA");
2624 container[2] = new TGeoVolumeAssembly("ITSSPDCoolingModuleSideC");
45c52bb2 2625 container[3] = new TGeoVolumeAssembly("ITSSPDPatchPanelModule");
c890eba4 2626 container[4] = new TGeoVolumeAssembly("ITSSPDWaterCooling");
d0048cec 2627
96eb8210 2628 // The extender on the cone as a Xtru
954323d3 2629 x[0] = -cableL0;
7f69c251 2630 y[0] = 0.0 + 0.5 * cableW1;
d0048cec 2631
954323d3 2632 x[1] = x[0] + cableL0 + cableL1 - 0.5*(cableW2 - cableW1);
7f69c251 2633 y[1] = y[0];
d0048cec 2634
954323d3 2635 x[2] = x[0] + cableL0 + cableL1;
7f69c251 2636 y[2] = y[1] + 0.5*(cableW2 - cableW1);
d0048cec 2637
7f69c251 2638 x[3] = x[2] + cableL2;
2639 y[3] = y[2];
d0048cec 2640
7f69c251 2641 x[4] = x[3] + 0.5*(cableW3 - cableW2);
2642 y[4] = y[3] + 0.5*(cableW3 - cableW2);
d0048cec 2643
7f69c251 2644 x[5] = x[4] + cableL3 - 0.5*(cableW3 - cableW2);
2645 y[5] = y[4];
d0048cec 2646
7f69c251 2647 for (Int_t i = 6; i < 12; i++) {
2648 x[i] = x[11 - i];
2649 y[i] = -y[11 - i];
2650 }
d0048cec 2651
7f69c251 2652 TGeoXtru *shCable = new TGeoXtru(2);
2653 shCable->DefinePolygon(12, x, y);
96eb8210 2654 shCable->DefineSection(0, 0.0);
2655 shCable->DefineSection(1, kCableThickness);
d0048cec 2656
45c52bb2 2657 TGeoVolume *volCable = new TGeoVolume("ITSSPDExtender", shCable, medExtB);
7f69c251 2658 volCable->SetLineColor(kGreen);
d0048cec 2659
96eb8210 2660 // The MCM extender on the cone as a Xtru
2661 TGeoBBox *shMCMExt = new TGeoBBox(0.5*kMCMLength,
2662 0.5*kMCMWidth,
2663 0.5*kMCMThickness);
d0048cec 2664
96eb8210 2665 TGeoVolume *volMCMExt = new TGeoVolume("ITSSPDExtenderMCM",
45c52bb2 2666 shMCMExt, medExtM);
7f69c251 2667 volMCMExt->SetLineColor(kGreen+3);
d0048cec 2668
96eb8210 2669 // The support plate on the cone as a composite shape
2670 Double_t thickness = kCableThickness + kMCMThickness;
2671 TGeoBBox *shOut = new TGeoBBox("ITSSPD_shape_plateout",
2672 0.5*kPlateLength,
2673 0.5*kPlateWidth,
2674 0.5*kPlateThickness);
2675 TGeoBBox *shIn = new TGeoBBox("ITSSPD_shape_platein" ,
2676 0.5*kPlateLength,
2677 0.5*cableW2,
2678 0.5*thickness);
2679 Char_t string[255];
6932f314 2680 snprintf(string, 255, "%s-%s", shOut->GetName(), shIn->GetName());
96eb8210 2681 TGeoCompositeShape *shPlate = new TGeoCompositeShape("ITSSPDPlate_shape",
2682 string);
d0048cec 2683
96eb8210 2684 TGeoVolume *volPlate = new TGeoVolume("ITSSPDPlate",
2685 shPlate, medPlate);
2686 volPlate->SetLineColor(kRed);
44d18d38 2687
2688 // The air cooling tubes
2689 TGeoBBox *shCollBox = new TGeoBBox("ITSSPD_shape_collector_box", 0.5*kCollLength, 0.5*kCollWidth, 0.5*kCollThickness);
2690 TGeoTube *shCollTube = new TGeoTube("ITSSPD_shape_collector_tube",kCollTubeRadius - kCollTubeThick, kCollTubeRadius, 0.5*kCollTubeLength);
2691 TGeoVolume *volCollBox = new TGeoVolume("ITSSPDCollectorBox", shCollBox, medPVC);
2692 TGeoVolume *volCollTube = new TGeoVolume("ITSSPDCollectorTube", shCollTube, medPVC);
2693 volCollBox->SetLineColor(kAzure);
2694 volCollTube->SetLineColor(kAzure);
d0048cec 2695
96eb8210 2696 // The cooling tube on the cone as a Ctub
8bb39321 2697 Double_t tubeLength = shCable->GetX(5) - shCable->GetX(0) + kYtoHalfStave -0.85;
96eb8210 2698 TGeoCtub *shTube = new TGeoCtub(0, kConeTubeRmax, 0.5*tubeLength, 0, 360,
2699 0, SinD(angrot/2), -CosD(angrot/2),
2700 0, 0, 1);
2701
2702 TGeoVolume *volTubeA = new TGeoVolume("ITSSPDCoolingTubeOnConeA",
2703 shTube, medInox);
2704 volTubeA->SetLineColor(kGray);
2705
2706 TGeoVolume *volTubeC = new TGeoVolume("ITSSPDCoolingTubeOnConeC",
2707 shTube, medInox);
2708 volTubeC->SetLineColor(kGray);
2709
2710 // The freon in the cooling tubes on the cone as a Ctub
2711 TGeoCtub *shFreon = new TGeoCtub(0, kConeTubeRmin, 0.5*tubeLength, 0, 360,
2712 0, SinD(angrot/2), -CosD(angrot/2),
2713 0, 0, 1);
2714
2715 TGeoVolume *volFreon = new TGeoVolume("ITSSPDCoolingFreonOnCone",
2716 shFreon, medFreon);
2717 volFreon->SetLineColor(kPurple);
2718
2719 TGeoVolume *volGasFr = new TGeoVolume("ITSSPDCoolingFreonGasOnCone",
2720 shFreon, medGas);
2721 volGasFr->SetLineColor(kPurple);
2722
2723 // The cooling tube inside the cylinder as a Ctub
2724 TGeoCtub *shCylTub = new TGeoCtub(0, kConeTubeRmax,
2725 0.5*kHorizTubeLen, 0, 360,
2726 0, 0, -1,
2727 0, SinD(angrot/2), CosD(angrot/2));
2728
2729 TGeoVolume *volCylTubA = new TGeoVolume("ITSSPDCoolingTubeOnCylA",
2730 shCylTub, medInox);
2731 volCylTubA->SetLineColor(kGray);
2732
2733 TGeoVolume *volCylTubC = new TGeoVolume("ITSSPDCoolingTubeOnCylC",
2734 shCylTub, medInox);
2735 volCylTubC->SetLineColor(kGray);
2736
2737 // The freon in the cooling tubes in the cylinder as a Ctub
2738 TGeoCtub *shCylFr = new TGeoCtub(0, kConeTubeRmin,
2739 0.5*kHorizTubeLen, 0, 360,
2740 0, 0, -1,
2741 0, SinD(angrot/2), CosD(angrot/2));
2742
2743 TGeoVolume *volCylFr = new TGeoVolume("ITSSPDCoolingFreonOnCyl",
2744 shCylFr, medFreon);
2745 volCylFr->SetLineColor(kPurple);
2746
2747 TGeoVolume *volCylGasFr = new TGeoVolume("ITSSPDCoolingFreonGasOnCyl",
2748 shCylFr, medGas);
2749 volCylGasFr->SetLineColor(kPurple);
2750
45c52bb2 2751 // The optical fibers bundle on the cone as a Tube
5d9d4033 2752 Double_t optLength = shCable->GetX(5) - shCable->GetX(0) + kYtoHalfStave -0.85;
45c52bb2 2753 TGeoTube *shOptFibs = new TGeoTube(0., 0.5*kOptFibDiamet, 0.5*optLength);
2754
2755 TGeoVolume *volOptFibs = new TGeoVolume("ITSSPDOpticalFibersOnCone",
2756 shOptFibs, medFibs);
2757 volOptFibs->SetLineColor(kOrange);
2758
2759 // The optical patch panels
2760 TArrayD psizes;
2761 TGeoVolume *volPatch = CreatePatchPanel(psizes, mgr);
2762
c890eba4 2763 // The water cooling tube as a Tube
2764 TGeoTube *shWatCool = new TGeoTube(kWaterCoolRMax-kWaterCoolThick,
2765 kWaterCoolRMax, kWaterCoolLen/2);
2766
2767 TGeoVolume *volWatCool = new TGeoVolume("ITSSPDWaterCoolingOnCone",
2768 shWatCool, medInox);
2769 volWatCool->SetLineColor(kGray);
2770
2771 // The support plate for the water tubes: a Tubs and a BBox
2772 TGeoTubeSeg *shWCPltT = new TGeoTubeSeg(kWaterCoolRMax,
2773 kWaterCoolRMax+kWCPlateThick,
2774 kWCPlateLen/2, 180., 360.);
2775
2776 Double_t plateBoxWide = (kWCPlateWide - 2*kWaterCoolRMax)/2;
2777 TGeoBBox *shWCPltB = new TGeoBBox(plateBoxWide/2,
2778 kWCPlateThick/2,
2779 kWCPlateLen/2);
2780
2781 TGeoVolume *volWCPltT = new TGeoVolume("ITSSPDWaterCoolingTubsPlate",
2782 shWCPltT, medPlate);
2783 volWCPltT->SetLineColor(kRed);
2784
2785 TGeoVolume *volWCPltB = new TGeoVolume("ITSSPDWaterCoolingBoxPlate",
2786 shWCPltB, medPlate);
2787 volWCPltB->SetLineColor(kRed);
2788
2789 // The fitting for the water cooling tube: a Pcon
2790 TGeoPcon *shFitt = new TGeoPcon(0., 360., 4);
2791 shFitt->Z(0) = -kWCFittingLen1;
2792 shFitt->Rmin(0) = kWCFittingRint1;
2793 shFitt->Rmax(0) = kWCFittingRext1;
2794
2795 shFitt->Z(1) = 0;
2796 shFitt->Rmin(1) = kWCFittingRint1;
2797 shFitt->Rmax(1) = kWCFittingRext1;
2798
2799 shFitt->Z(2) = 0;
2800 shFitt->Rmin(2) = kWCFittingRint2;
2801 shFitt->Rmax(2) = kWCFittingRext2;
2802
2803 shFitt->Z(3) = kWCFittingLen2;
2804 shFitt->Rmin(3) = kWCFittingRint2;
2805 shFitt->Rmax(3) = kWCFittingRext2;
2806
2807 TGeoVolume *volFitt = new TGeoVolume("ITSSPDWaterCoolingFitting",
2808 shFitt, medCopper);
2809 volFitt->SetLineColor(kOrange);
2810
96eb8210 2811 // Now place everything in the containers
2812 volTubeA->AddNode(volGasFr, 1, 0);
2813 volTubeC->AddNode(volFreon, 1, 0);
2814
2815 volCylTubA->AddNode(volCylGasFr, 1, 0);
2816 volCylTubC->AddNode(volCylFr , 1, 0);
2817
2818 container[0]->AddNode(volCable, 1, 0);
2819
954323d3 2820 xloc = shMCMExt->GetDX() - cableL0;
96eb8210 2821 zloc = shMCMExt->GetDZ();
2822 container[0]->AddNode(volMCMExt, 1,
2823 new TGeoTranslation( xloc, 0.,-zloc));
2824
2825 xloc = shMCMExt->GetDX();
2826 zloc = shCable->GetZ(1)/2 - shMCMExt->GetDZ();
2827 container[0]->AddNode(volPlate, 1,
2828 new TGeoTranslation( xloc, 0., zloc));
2829
45c52bb2 2830 TGeoRotation *rot2 = new TGeoRotation(*gGeoIdentity);
2831 rot2->SetName("rotPatch");
2832 rot2->RotateX(90.0);
2833 rot2->RotateY(163.0);
2834 //rot2->RotateZ(132.5);
2835
44d18d38 2836 // add collectors only on side C
2837 if (sideC)
2838 {
2839 TGeoTranslation *trCollBox = new TGeoTranslation(xloc - 0.5*kPlateLength + 0.5*kCollLength, 0.0, +0.5*(kPlateThickness+1.1*kCollThickness));
2840 TGeoRotation *rotCollTube = new TGeoRotation(*gGeoIdentity);
2841 rotCollTube->RotateY(90.0);
2842 TGeoCombiTrans *trCollTube = new TGeoCombiTrans(xloc + 0.5*kCollTubeLength - (0.5*kPlateLength - kCollLength), 0.0, +0.5*(kPlateThickness+2.0*kCollTubeRadius+kCollTubeThick), rotCollTube);
2843 container[0]->AddNode(volCollBox, 1, trCollBox);
2844 container[0]->AddNode(volCollTube, 1, trCollTube);
2845 }
2846
5d9d4033 2847 Double_t dxPatch = 2.75;
45c52bb2 2848 Double_t dzPatch = 2.8;
2849 TGeoCombiTrans *tr2 = new TGeoCombiTrans(1.7*ext2Length - dxPatch, 0.0, dzPatch, rot2);
2850 container[3]->AddNode(volPatch, 0, tr2);
2851
96eb8210 2852 xloc = shTube->GetRmax();
2853 yloc = shTube->GetRmax();
2854 zloc = shTube->GetDz() - shTube->GetRmax() - kYtoHalfStave;
2855 container[1]->AddNode(volTubeA, 1,
2856 new TGeoTranslation(-xloc, -yloc, zloc));
2857 container[2]->AddNode(volTubeC, 1,
2858 new TGeoTranslation(-xloc, -yloc, zloc));
2859
2860 xloc = shTube->GetRmax();
2861 yloc = (shCylTub->GetDz())*SinD(angrot) - shTube->GetRmax();
2862 zloc = (shCylTub->GetDz())*CosD(angrot) + shTube->GetRmax() +kYtoHalfStave;
2863 container[1]->AddNode(volCylTubA, 1,
2864 new TGeoCombiTrans(-xloc, yloc,-zloc,
2865 new TGeoRotation("",0.,angrot,0.)));
2866 container[2]->AddNode(volCylTubC, 1,
2867 new TGeoCombiTrans(-xloc, yloc,-zloc,
2868 new TGeoRotation("",0.,angrot,0.)));
2869
45c52bb2 2870 xloc = shOptFibs->GetRmax() + 2*shTube->GetRmax();
c890eba4 2871 yloc = 1.6*shOptFibs->GetRmax();
45c52bb2 2872 zloc = shOptFibs->GetDZ() - shTube->GetRmax() - kYtoHalfStave;
2873 container[1]->AddNode(volOptFibs, 1,
2874 new TGeoTranslation(-xloc, -yloc, zloc));
2875 container[2]->AddNode(volOptFibs, 1,
2876 new TGeoTranslation(-xloc, -yloc, zloc));
2877
c890eba4 2878 yloc = shWatCool->GetRmax();
2879 zloc = (2*shTube->GetDz() - shTube->GetRmax() - kYtoHalfStave)/2;
2880 container[4]->AddNode(volWatCool, 1,
2881 new TGeoTranslation(0, -yloc, zloc));
2882
2883 container[4]->AddNode(volWCPltT, 1,
2884 new TGeoTranslation(0, -yloc, zloc));
2885
2886 yloc -= shWCPltB->GetDY();
2887 xloc = shWatCool->GetRmax() + shWCPltB->GetDX();
2888 container[4]->AddNode(volWCPltB, 1,
2889 new TGeoTranslation( xloc, -yloc, zloc));
2890 container[4]->AddNode(volWCPltB, 2,
2891 new TGeoTranslation(-xloc, -yloc, zloc));
2892
2893 yloc = shWatCool->GetRmax();
2894 zloc -= shWatCool->GetDz();
2895 container[4]->AddNode(volFitt, 1,
2896 new TGeoTranslation(0, -yloc, zloc));
2897
96eb8210 2898 // Finally create the list of assemblies and return it to the caller
0b9c8a10 2899 TList* conemodulelist = new TList();
0b9c8a10 2900 conemodulelist->Add(container[0]);
2901 conemodulelist->Add(container[1]);
96eb8210 2902 conemodulelist->Add(container[2]);
45c52bb2 2903 conemodulelist->Add(container[3]);
c890eba4 2904 conemodulelist->Add(container[4]);
d0048cec 2905
0b9c8a10 2906 return conemodulelist;
7f69c251 2907}
2908
2909//______________________________________________________________________
2910void AliITSv11GeometrySPD::CreateCones(TGeoVolume *moth) const
2911{
96eb8210 2912 //
2913 // Places all services modules in the mother reference system
2914 //
2915 // Created: ?? ??? 2008 Alberto Pulvirenti
2916 // Updated: 03 May 2010 Mario Sitta
c890eba4 2917 // Updated: 04 Jul 2010 Mario Sitta Water cooling
96eb8210 2918 //
d0048cec 2919
96eb8210 2920 const Int_t kNumberOfModules = 10;
2921
2922 const Double_t kInnerRadius = 80.775*fgkmm;
8bb39321 2923 const Double_t kZTrans = 451.800*fgkmm;
96eb8210 2924 const Double_t kAlphaRot = 46.500*fgkDegree;
c890eba4 2925 const Double_t kAlphaSpaceCool = 9.200*fgkDegree;
96eb8210 2926
44d18d38 2927 TList* modulelistA = CreateConeModule(kFALSE, 90-kAlphaRot);
2928 TList* modulelistC = CreateConeModule(kTRUE , 90-kAlphaRot);
2929 TList* &modulelist = modulelistC;
2930 TGeoVolumeAssembly* module, *moduleA, *moduleC;
d0048cec 2931
96eb8210 2932 Double_t xloc, yloc, zloc;
2933
7f69c251 2934 //Double_t angle[10] = {18., 54., 90., 126., 162., -18., -54., -90., -126., -162.};
45c52bb2 2935 // anglem for cone modules (cables and cooling tubes)
2936 // anglep for pathc panels
96eb8210 2937 Double_t anglem[10] = {18., 54., 90., 126., 162., 198., 234., 270., 306., 342.};
45c52bb2 2938 Double_t anglep[10] = {18., 62., 90., 115., 162., 198., 242., 270., 295., 342.};
96eb8210 2939// Double_t angle1m[10] = {23., 53., 90., 127., 157., 203.0, 233.0, 270.0, 307.0, 337.0};
2940// Double_t angle2m[10] = {18., 53., 90., 126., 162., 198.0, 233.0, 270.0, 309.0, 342.0};
2941// Double_t angle1c[10] = {23., 53., 90., 124., 157., 203.0, 233.0, 270.0, 304.0, 337.0};
2942// Double_t angle2c[10] = {18., 44., 90., 126., 162., 198.0, 223.0, 270.0, 309.0, 342.0};
0b9c8a10 2943
2944 // First add the cables
44d18d38 2945 moduleA = (TGeoVolumeAssembly*)modulelistA->At(0);
2946 moduleC = (TGeoVolumeAssembly*)modulelistC->At(0);
96eb8210 2947 for (Int_t i = 0; i < kNumberOfModules; i++) {
7f69c251 2948 TGeoRotation *rot1 = new TGeoRotation(*gGeoIdentity);
96eb8210 2949 rot1->RotateY(-kAlphaRot);
2950 rot1->RotateZ(anglem[i]);
2951 xloc = kInnerRadius*CosD(anglem[i]);
2952 yloc = kInnerRadius*SinD(anglem[i]);
2953 zloc = kZTrans;
44d18d38 2954 moth->AddNode(moduleA, 2*i+2,
96eb8210 2955 new TGeoCombiTrans( xloc, yloc, zloc, rot1));
2956
7f69c251 2957 TGeoRotation *rot2 = new TGeoRotation(*gGeoIdentity);
96eb8210 2958 rot2->RotateY(180.-kAlphaRot);
2959 rot2->RotateZ(anglem[i]);
2960 xloc = kInnerRadius*CosD(anglem[i]);
2961 yloc = kInnerRadius*SinD(anglem[i]);
2962 zloc = kZTrans;
44d18d38 2963 moth->AddNode(moduleC, 2*i+1,
96eb8210 2964 new TGeoCombiTrans(-xloc,-yloc,-zloc, rot2));
0b9c8a10 2965 }
2966
96eb8210 2967 // Then the cooling tubes on Side A
0b9c8a10 2968 module = (TGeoVolumeAssembly*)modulelist->At(1);
96eb8210 2969 Double_t anglec;
2970 for (Int_t i = 0; i < kNumberOfModules; i++) {
2971 anglec = anglem[i] + kAlphaSpaceCool;
0b9c8a10 2972 TGeoRotation *rot1 = new TGeoRotation(*gGeoIdentity);
c890eba4 2973 rot1->RotateX(-90.0+kAlphaRot-0.04); // 0.04 fixes small overlap
2974 rot1->RotateZ(-90.0+anglec);
96eb8210 2975 xloc = kInnerRadius*CosD(anglec);
2976 yloc = kInnerRadius*SinD(anglec);
c890eba4 2977 zloc = kZTrans+0.162; // 0.162 fixes small overlap
2978 moth->AddNode(module, 2*i+2,
96eb8210 2979 new TGeoCombiTrans( xloc, yloc, zloc, rot1));
2980 }
2981
45c52bb2 2982 // And the cooling tubes on Side C
96eb8210 2983 module = (TGeoVolumeAssembly*)modulelist->At(2);
2984 for (Int_t i = 0; i < kNumberOfModules; i++) {
2985 anglec = anglem[i] - kAlphaSpaceCool;
0b9c8a10 2986 TGeoRotation *rot2 = new TGeoRotation(*gGeoIdentity);
c890eba4 2987 rot2->RotateX(-90.0+kAlphaRot-0.04); // 0.04 fixes small overlap
96eb8210 2988 rot2->RotateY(180.);
c890eba4 2989 rot2->RotateZ(90.0+anglec);
96eb8210 2990 xloc = kInnerRadius*CosD(anglec);
2991 yloc = kInnerRadius*SinD(anglec);
c890eba4 2992 zloc = kZTrans+0.162; // 0.162 fixes small overlap
96eb8210 2993 moth->AddNode(module, 2*i+1,
2994 new TGeoCombiTrans(-xloc,-yloc,-zloc, rot2));
7f69c251 2995 }
96eb8210 2996
c890eba4 2997 // Then the water cooling tubes
2998 module = (TGeoVolumeAssembly*)modulelist->At(4);
2999 for (Int_t i = 1; i < kNumberOfModules; i++) { // i = 1,2,...,9
3000 if (i != 5) { // There is no tube in this position
3001 anglec = (anglem[i-1]+anglem[i])/2;
3002 TGeoRotation *rot1 = new TGeoRotation(*gGeoIdentity);
3003 rot1->RotateX(-90.0+kAlphaRot);
3004 rot1->RotateZ(-90.0+anglec);
3005 xloc = kInnerRadius*CosD(anglec);
3006 yloc = kInnerRadius*SinD(anglec);
3007 zloc = kZTrans;
3008 moth->AddNode(module, 2*i+2,
3009 new TGeoCombiTrans( xloc, yloc, zloc, rot1));
3010
3011 TGeoRotation *rot2 = new TGeoRotation(*gGeoIdentity);
3012 rot2->RotateX(-90.0+kAlphaRot);
3013 rot2->RotateY(180.);
3014 rot2->RotateZ(90.0+anglec);
3015 xloc = kInnerRadius*CosD(anglec);
3016 yloc = kInnerRadius*SinD(anglec);
3017 zloc = kZTrans;
3018 moth->AddNode(module, 2*i+1,
3019 new TGeoCombiTrans(-xloc,-yloc,-zloc, rot2));
3020 }
3021 }
3022
45c52bb2 3023 // Finally the optical patch panels
3024 module = (TGeoVolumeAssembly*)modulelist->At(3);
3025 for (Int_t i = 0; i < kNumberOfModules; i++) {
3026 TGeoRotation *rot1 = new TGeoRotation(*gGeoIdentity);
3027 rot1->RotateY(-kAlphaRot);
3028 rot1->RotateZ(anglep[i]);
3029 xloc = kInnerRadius*CosD(anglep[i]);
3030 yloc = kInnerRadius*SinD(anglep[i]);
3031 zloc = kZTrans;
c890eba4 3032 moth->AddNode(module, 2*i+2,
45c52bb2 3033 new TGeoCombiTrans( xloc, yloc, zloc, rot1));
3034
3035 TGeoRotation *rot2 = new TGeoRotation(*gGeoIdentity);
3036 rot2->RotateY(180.-kAlphaRot);
3037 rot2->RotateZ(anglep[i]);
3038 xloc = kInnerRadius*CosD(anglep[i]);
3039 yloc = kInnerRadius*SinD(anglep[i]);
3040 zloc = kZTrans;
3041 moth->AddNode(module, 2*i+1,
3042 new TGeoCombiTrans(-xloc,-yloc,-zloc, rot2));
3043 }
3044
7f69c251 3045}
3046
c890eba4 3047
54c9a3d9 3048//______________________________________________________________________
15b84e14 3049void AliITSv11GeometrySPD::CreateServices(TGeoVolume *moth) const
3050{
3051 //
3052 // New method to implement SPD services
3053 //
3054 // Created: 25 Jul 2012 Mario Sitta
3055 //
3056 // Data provided by C.Gargiulo from CAD
3057
3058 // Cooling manifolds
3059 const Double_t kCoolManifWidth = fgkmm * 22.0;
3060 const Double_t kCoolManifLength = fgkmm * 50.0;
3061 const Double_t kCoolManifThick = fgkmm * 7.0;
c33a0330 3062 const Double_t kCoolManifFitR1out = fgkmm * 4.0;
15b84e14 3063 const Double_t kCoolManifFitH1 = fgkmm * 2.5;
3064 const Double_t kCoolManifFitR2out = fgkmm * 4.0;
3065 const Double_t kCoolManifFitR2in = fgkmm * 3.2;
3066 const Double_t kCoolManifFitH2 = fgkmm * 7.0;
3067 const Double_t kCoolManifFitZPos = fgkmm * 2.0; // TO BE CHECKED!
3068 const Double_t kCoolManifCollR1 = fgkmm * 3.0;
3069 const Double_t kCoolManifCollH1 = fgkmm * 2.5;
3070 const Double_t kCoolManifCollR2 = fgkmm * 1.5;
3071 const Double_t kCoolManifCollH2 = fgkmm * 5.0;
c33a0330 3072 const Double_t kCoolManifCollXPos = fgkmm * 5.0;
15b84e14 3073 const Double_t kCoolManifCollDZ = fgkmm * 13.0;
c33a0330 3074 const Double_t kCoolManifCollZ0 = fgkmm * 9.0;
3075
3076 const Double_t kCoolManifRPosCAD = fgkmm * 76.2;
3077 const Double_t kCoolManifZPos = fgkcm * 33.97;// 34.0 - 0.03 toll.
3078 // Manifold supports
3079 const Double_t kManifSuppWidth = fgkmm * 24.0; // TO BE CHECKED!
3080 const Double_t kManifSuppLen1 = fgkmm * 17.9;
3081 const Double_t kManifSuppLen2 = fgkmm * 54.2;
3082 const Double_t kManifSuppLen3 = fgkmm * 7.9;
3083 const Double_t kManifSuppThick = fgkmm * 1.5;
3084 const Double_t kSuppScrewXPos = fgkmm * 4.0;
3085 const Double_t kSuppScrewZPos = fgkmm * 3.0;
3086 const Double_t kRThermalShield = fgkcm * 9.9255; // MUST match with GeometrySupport
97f79b63 3087 // Sector supports
3088 const Double_t kSectSuppWidth = fgkmm * 15.0;
3089 const Double_t kSectSuppLen1 = fgkmm * 16.9; // TO BE CHECKED!
3090 const Double_t kSectSuppLen2 = fgkmm * 35.1; // TO BE CHECKED!
3091 const Double_t kSectSuppThick = fgkmm * 1.5;
3092 const Double_t kSectSuppDepth = fgkmm * 17.78; // MUST match with GeometrySupport
3093 const Double_t kSectScrewZPos = fgkmm * 5.1; // TO BE CHECKED!
3094
3095 const Double_t kSectSuppZPos = fgkcm * 26.5;
3096 // Sector clips
3097 const Double_t kSectClipLength = fgkmm * 30.0;
3098 const Double_t kSectClipWidth = fgkmm * 28.53;
3099 const Double_t kSectClipThick1 = fgkmm * 2.0;
3100 const Double_t kSectClipThick2 = fgkmm * 0.715;
3101 const Double_t kSectClipInStave = fgkmm * 11.0; // Tuned
3102 const Double_t kSectClipAngle = 29.0; // Degree. Tuned
c33a0330 3103 // M3 screws
3104 const Double_t kScrewM3Diam = fgkmm * 3.0;
3105 const Double_t kScrewM3HeadThick = fgkmm * 2.0;
3106 const Double_t kScrewM3HeadRmin = fgkmm * 1.5;
3107 const Double_t kScrewM3HeadRmax = fgkmm * 2.5;
97f79b63 3108 const Double_t kScrewM3OutManifH = fgkmm * 1.5;
3109 // Central set pin (in sector support)
3110 const Double_t kSetPinDiam = fgkmm * 6.0;
3111 const Double_t kSetPinHeadDiam = fgkmm * 8.0;
3112 const Double_t kSetPinHeadRmin = fgkmm * 1.5;
3113 const Double_t kSetPinHeadThick = fgkmm * 1.5;
3114 const Double_t kSetPinOutClipH = fgkmm * 1.0;
c33a0330 3115 // Cooling pipes
3116 const Double_t kCoolPipeSideARin = fgkmm * 1.5;
3117 const Double_t kCoolPipeSideARout = fgkmm * 1.8;
3118 const Double_t kCoolPipeSideCRin = fgkmm * 0.5;
3119 const Double_t kCoolPipeSideCRout = fgkmm * 0.85;
3120 const Double_t kCoolPipeHeight[3] = {11.0, 14.0, 18.0}; // TO BE CHECKED!
3121 const Double_t kCoolPipeRadius[3] = {12.0, 14.0, 15.0}; // TO BE CHECKED!
3122 const Double_t kCoolPipeZSPD = fgkcm * 8.45; // TO BE CHECKED!
15b84e14 3123
c33a0330 3124 Int_t kPurple = 6; // Purple (Root does not define it)
15b84e14 3125
3126 // Local variables
c33a0330 3127 Double_t xprof[12], yprof[12];
15b84e14 3128 Double_t radius, theta;
3129 Double_t xpos, ypos, zpos;
97f79b63 3130 Double_t tmp;
15b84e14 3131
c33a0330 3132
15b84e14 3133 // The cooling manifold: an Assembly
c33a0330 3134 TGeoVolumeAssembly *coolmanifA = new TGeoVolumeAssembly("ITSSPDCoolManifSideA");
3135 TGeoVolumeAssembly *coolmanifC = new TGeoVolumeAssembly("ITSSPDCoolManifSideC");
15b84e14 3136
3137 // The various parts of the manifold
3138 TGeoBBox *manifblksh = new TGeoBBox(kCoolManifWidth/2,
3139 kCoolManifThick/2,
3140 kCoolManifLength/2);
3141
3142 TGeoBBox *manifinscubesh = new TGeoBBox(kCoolManifFitR2out,
3143 kCoolManifFitR2out,
3144 kCoolManifFitR2out);
3145
3146 TGeoTube *manifinscyl1sh = new TGeoTube(0, // TO BE CHECKED!
3147 kCoolManifFitR1out,
3148 kCoolManifFitH1/2);
3149
3150 TGeoTube *manifinscyl2sh = new TGeoTube(kCoolManifFitR2in,
3151 kCoolManifFitR2out,
3152 kCoolManifFitH2/2);
3153
3154 TGeoTube *manifcollcyl1sh = new TGeoTube(0,
3155 kCoolManifCollR1,
3156 kCoolManifCollH1/2);
3157
3158 TGeoTube *manifcollcyl2sh = new TGeoTube(0,
3159 kCoolManifCollR2,
3160 kCoolManifCollH2/2);
3161
c33a0330 3162 // The cooling manifold supports
3163 const Double_t kCoolManifRPos = kCoolManifRPosCAD +
3164 (manifinscubesh->GetDY() +
3165 2*manifinscyl1sh->GetDz() +
3166 manifblksh->GetDY() );
3167
3168 const Double_t kManifSuppDepth = kRThermalShield -
3169 (kCoolManifRPos + manifblksh->GetDY());
3170
3171 TGeoXtru *suppmanifsh = new TGeoXtru(2);
3172
3173 xprof[ 0] = kManifSuppLen2/2 + kManifSuppThick;
3174 yprof[ 0] = 0;
3175 xprof[ 1] = xprof[0];
3176 yprof[ 1] = kManifSuppDepth;
3177 xprof[ 2] = kManifSuppLen2/2 + kManifSuppLen3;
3178 yprof[ 2] = yprof[1];
3179 xprof[ 3] = xprof[2];
3180 yprof[ 3] = yprof[2] + kManifSuppThick;
3181 xprof[ 4] = kManifSuppLen2/2;
3182 yprof[ 4] = yprof[3];
3183 xprof[ 5] = xprof[4];
3184 yprof[ 5] = kManifSuppThick;
3185 xprof[ 6] = -xprof[5];
3186 yprof[ 6] = yprof[5];
3187 xprof[ 7] = -xprof[4];
3188 yprof[ 7] = yprof[4];
3189 xprof[ 8] = -(kManifSuppLen2/2 + kManifSuppLen1);
3190 yprof[ 8] = yprof[3];
3191 xprof[ 9] = xprof[8];
3192 yprof[ 9] = yprof[2];
3193 xprof[10] = -xprof[1];
3194 yprof[10] = yprof[1];
3195 xprof[11] = -xprof[0];
3196 yprof[11] = yprof[0];
3197
3198 suppmanifsh->DefinePolygon(12,xprof,yprof);
3199 suppmanifsh->DefineSection(0,-kManifSuppWidth/2);
3200 suppmanifsh->DefineSection(1, kManifSuppWidth/2);
3201
3202 // The screw head and body
3203 TGeoTube *suppscrewbodysh = new TGeoTube(0, kScrewM3Diam/2,
3204 kManifSuppThick/2);
3205
3206 TGeoPcon *suppscrewheadsh = new TGeoPcon(0, 360, 4);
3207 suppscrewheadsh->DefineSection(0,-kScrewM3HeadThick/2,0, kScrewM3HeadRmax);
3208 suppscrewheadsh->DefineSection(1, 0, 0, kScrewM3HeadRmax);
3209 suppscrewheadsh->DefineSection(2, 0, kScrewM3HeadRmin, kScrewM3HeadRmax);
3210 suppscrewheadsh->DefineSection(3, kScrewM3HeadThick/2,
3211 kScrewM3HeadRmin, kScrewM3HeadRmax);
3212
97f79b63 3213 TGeoTube *clipscrewbodysh = new TGeoTube(0, kScrewM3Diam/2,
3214 kSectClipThick1/2);
3215
3216 // The screw segment below the manifold and the sector clip
3217 TGeoTube *screwoutmanifsh = new TGeoTube(0, kScrewM3Diam/2,
3218 kScrewM3OutManifH/2);
3219
3220 // The sector supports
3221 TGeoXtru *suppsectsh = new TGeoXtru(2);
3222
3223 xprof[ 0] = kSectSuppLen2/2 + kSectSuppThick;
3224 yprof[ 0] = 0;
3225 xprof[ 1] = xprof[0];
3226 yprof[ 1] = kSectSuppDepth;
3227 xprof[ 2] = kSectSuppLen2/2 + kSectSuppLen1;
3228 yprof[ 2] = yprof[1];
3229 xprof[ 3] = xprof[2];
3230 yprof[ 3] = yprof[2] + kSectSuppThick;
3231 xprof[ 4] = kSectSuppLen2/2;
3232 yprof[ 4] = yprof[3];
3233 xprof[ 5] = xprof[4];
3234 yprof[ 5] = kSectSuppThick;
3235 xprof[ 6] = -xprof[5];
3236 yprof[ 6] = yprof[5];
3237 xprof[ 7] = -xprof[4];
3238 yprof[ 7] = yprof[4];
3239 xprof[ 8] = -xprof[3];
3240 yprof[ 8] = yprof[3];
3241 xprof[ 9] = -xprof[2];
3242 yprof[ 9] = yprof[2];