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