]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSv11GeometrySPD.cxx
Improved treatment of track labels (F. Prino)
[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;
1782}//______________________________________________________________________
7855ea93 1783TGeoCompositeShape* AliITSv11GeometrySPD::CreateGroundingFoilShape
54c9a3d9 1784 (Int_t itype,Double_t &length,Double_t &width,
1785 Double_t thickness,TArrayD &sizes)
bc3498f4 1786{
54c9a3d9 1787 //
d0048cec 1788 // Creates the typical composite shape of the grounding foil:
1789 //
54c9a3d9 1790 // +---------------------------------------------------------+
1791 // | 5 6 9 |
1792 // | +-----------+ +------------+ 10
1793 // | O | | |
1794 // | 3 /-----+ 4 +------+
1795 // | 1 / 7 8
1796 // | /----------/
1797 // +-----/ 2 +
1798 // 0
1799 // Z + 11
1800 //
d0048cec 1801 // This shape is used 4 times: two layers of glue, one in kapton
1802 // and one in aluminum, taking into account that the aliminum
54c9a3d9 1803 // layer has small differences in the size of some parts.
1804 // ---
d0048cec 1805 // In order to overcome problems apparently due to a large number
1806 // of points, the shape creation is done according the following
54c9a3d9 1807 // steps:
d0048cec 1808 // 1) a TGeoBBox is created with a size right enough to contain
54c9a3d9 1809 // the whole shape (0-1-X-13)
d0048cec 1810 // 2) holes are defined as other TGeoBBox which are subtracted
54c9a3d9 1811 // from the main shape
d0048cec 1812 // 3) a TGeoXtru is defined connecting the points (0-->11-->0)
54c9a3d9 1813 // and is also subtracted from the main shape
1814 // ---
d0048cec 1815 // The argument ("type") is used to choose between all these
54c9a3d9 1816 // possibilities:
1817 // - type = 0 --> kapton layer
1818 // - type = 1 --> aluminum layer
1819 // - type = 2 --> glue layer between support and GF
1820 // - type = 3 --> glue layer between GF and ladders
d0048cec 1821 // Returns: a TGeoCompositeShape which will then be used to shape
1822 // several volumes. Since TGeoXtru is used, the local reference
54c9a3d9 1823 // frame of this object has X horizontal and Y vertical w.r to
1824 // the shape drawn above, and Z axis going perpendicularly to the screen.
d0048cec 1825 // This is not the correct reference for the half stave, for which
1826 // the "long" dimension is Z and the "short" is X, while Y goes in
1827 // the direction of thickness. This will imply some rotations when
54c9a3d9 1828 // using the volumes created with this shape.
d0048cec 1829
54c9a3d9 1830 // suffix to differentiate names
1831 Char_t type[10];
d0048cec 1832
54c9a3d9 1833 // size of the virtual box containing exactly this volume
1834 length = fgkmm * 243.18;
1835 width = fgkmm * 15.95;
1836 if (itype == 1) {
1837 length -= fgkmm * 0.4;
1838 width -= fgkmm * 0.4;
1839 } // end if itype==1
1840 switch (itype) {
1841 case 0:
1842 sprintf(type,"Kap");
1843 break;
1844 case 1:
1845 sprintf(type,"Alu");
1846 break;
1847 case 2:
1848 sprintf(type,"Glue1");
1849 break;
1850 case 3:
1851 sprintf(type,"Glue2");
1852 break;
1853 }
d0048cec 1854 // we divide the shape in several slices along the horizontal
1855 // direction (local X) here we define define the length of all
54c9a3d9 1856 // sectors (from leftmost to rightmost)
1857 Int_t i;
1858 Double_t sliceLength[] = { 140.71, 2.48, 26.78, 4.00,
1859 10.00, 24.40, 10.00, 24.81 };
1860 for (i = 0; i < 8; i++) sliceLength[i] *= fgkmm;
1861 if (itype == 1) {
1862 sliceLength[0] -= fgkmm * 0.2;
1863 sliceLength[4] -= fgkmm * 0.2;
1864 sliceLength[5] += fgkmm * 0.4;
1865 sliceLength[6] -= fgkmm * 0.4;
1866 } // end if itype ==1
d0048cec 1867
1868 // as shown in the drawing, we have four different widths
54c9a3d9 1869 // (along local Y) in this shape:
1870 Double_t widthMax = fgkmm * 15.95;
1871 Double_t widthMed1 = fgkmm * 15.00;
1872 Double_t widthMed2 = fgkmm * 11.00;
1873 Double_t widthMin = fgkmm * 4.40;
1874 if (itype == 1) {
1875 widthMax -= fgkmm * 0.4;
1876 widthMed1 -= fgkmm * 0.4;
1877 widthMed2 -= fgkmm * 0.4;
1878 widthMin -= fgkmm * 0.4;
1879 } // end if itype==1
d0048cec 1880
54c9a3d9 1881 // create the main shape
1882 TGeoBBox *shGroundFull = 0;
1883 shGroundFull = new TGeoBBox(Form("ITSSPDSHgFoil%sFull", type),
1884 0.5*length,0.5*width, 0.5*thickness);
d0048cec 1885
1886 // create the polygonal shape to be subtracted to give the correct
1887 // shape to the borders its vertices are defined in sugh a way that
1888 // this polygonal will be placed in the correct place considered
1889 // that the origin of the local reference frame is in the center
1890 // of the main box: we fix the starting point at the lower-left
1891 // edge of the shape (point 12), and add all points in order,
54c9a3d9 1892 // following a clockwise rotation
d0048cec 1893
54c9a3d9 1894 Double_t x[13], y[13];
1895 x[ 0] = -0.5 * length + sliceLength[0];
1896 y[ 0] = -0.5 * widthMax;
1897
1898 x[ 1] = x[0] + sliceLength[1];
1899 y[ 1] = y[0] + (widthMax - widthMed1);
1900
1901 x[ 2] = x[1] + sliceLength[2];
1902 y[ 2] = y[1];
1903
1904 x[ 3] = x[2] + sliceLength[3];
1905 y[ 3] = y[2] + (widthMed1 - widthMed2);
1906
1907 x[ 4] = x[3] + sliceLength[4];
1908 y[ 4] = y[3];
1909
1910 x[ 5] = x[4];
1911 y[ 5] = y[4] + (widthMed2 - widthMin);
1912
1913 x[ 6] = x[5] + sliceLength[5];
1914 y[ 6] = y[5];
1915
1916 x[ 7] = x[6];
1917 y[ 7] = y[4];
1918
1919 x[ 8] = x[7] + sliceLength[6];
1920 y[ 8] = y[7];
1921
1922 x[ 9] = x[8];
1923 y[ 9] = y[6];
1924
1925 x[10] = x[9] + sliceLength[7] + 0.5;
1926 y[10] = y[9];
1927
1928 x[11] = x[10];
1929 y[11] = y[0] - 0.5;
1930
1931 x[12] = x[0];
1932 y[12] = y[11];
1933
1934 // create the shape
1935 TGeoXtru *shGroundXtru = new TGeoXtru(2);
1936 shGroundXtru->SetName(Form("ITSSPDSHgFoil%sXtru", type));
1937 shGroundXtru->DefinePolygon(13, x, y);
1938 shGroundXtru->DefineSection(0, -thickness, 0., 0., 1.0);
1939 shGroundXtru->DefineSection(1, thickness, 0., 0., 1.0);
d0048cec 1940
54c9a3d9 1941 // define a string which will express the algebric operations among volumes
1942 // and add the subtraction of this shape from the main one
1943 TString strComposite(Form("ITSSPDSHgFoil%sFull-(%s+", type,
1944 shGroundXtru->GetName()));
d0048cec 1945
54c9a3d9 1946 // define the holes according to size information coming from drawings:
1947 Double_t holeLength = fgkmm * 10.00;
1948 Double_t holeWidth = fgkmm * 7.50;
d0048cec 1949 Double_t holeSepX0 = fgkmm * 7.05; // separation between center
54c9a3d9 1950 // of first hole and left border
d0048cec 1951 Double_t holeSepXC = fgkmm * 14.00; // separation between the centers
54c9a3d9 1952 // of two consecutive holes
d0048cec 1953 Double_t holeSepX1 = fgkmm * 15.42; // separation between centers of
54c9a3d9 1954 // 5th and 6th hole
d0048cec 1955 Double_t holeSepX2 = fgkmm * 22.00; // separation between centers of
54c9a3d9 1956 // 10th and 11th hole
1957 if (itype == 1) {
1958 holeSepX0 -= fgkmm * 0.2;
1959 holeLength += fgkmm * 0.4;
1960 holeWidth += fgkmm * 0.4;
1961 } // end if itype==1
1962 sizes.Set(7);
1963 sizes[0] = holeLength;
1964 sizes[1] = holeWidth;
1965 sizes[2] = holeSepX0;
1966 sizes[3] = holeSepXC;
1967 sizes[4] = holeSepX1;
1968 sizes[5] = holeSepX2;
1969 sizes[6] = fgkmm * 4.40;
d0048cec 1970
54c9a3d9 1971 // X position of hole center (will change for each hole)
1972 Double_t holeX = -0.5*length;
1973 // Y position of center of all holes (= 4.4 mm from upper border)
1974 Double_t holeY = 0.5*(width - holeWidth) - widthMin;
d0048cec 1975
54c9a3d9 1976 // create a shape for the holes (common)
1977 TGeoBBox *shHole = 0;
1978 shHole = new TGeoBBox(Form("ITSSPD%sGfoilHole", type),0.5*holeLength,
1979 0.5*holeWidth, thickness);
d0048cec 1980
54c9a3d9 1981 // insert the holes in the XTRU shape:
d0048cec 1982 // starting from the first value of X, they are simply
54c9a3d9 1983 // shifted along this axis
1984 char name[200];
1985 TGeoTranslation *transHole[11];
4adcf390 1986 for (i = 0; i < 11; i++) {
54c9a3d9 1987 // set the position of the hole, depending on index
1988 if (i == 0) {
1989 holeX += holeSepX0;
1990 }else if (i < 5) {
1991 holeX += holeSepXC;
1992 }else if (i == 5) {
1993 holeX += holeSepX1;
1994 }else if (i < 10) {
1995 holeX += holeSepXC;
1996 }else {
1997 holeX += holeSepX2;
1998 } // end if else if's
1999 //cout << i << " --> X = " << holeX << endl;
2000 sprintf(name,"ITSSPDTRgFoil%sHole%d", type, i);
2001 transHole[i] = new TGeoTranslation(name, holeX, holeY, 0.0);
2002 transHole[i]->RegisterYourself();
2003 strComposite.Append(Form("ITSSPD%sGfoilHole:%s", type, name));
2004 if (i < 10) strComposite.Append("+"); else strComposite.Append(")");
2005 } // end for i
d0048cec 2006
54c9a3d9 2007 // create composite shape
2008 TGeoCompositeShape *shGround = new TGeoCompositeShape(
2009 Form("ITSSPDSHgFoil%s", type), strComposite.Data());
2010
2011 return shGround;
592651e2 2012}
54c9a3d9 2013//______________________________________________________________________
d0048cec 2014TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateGroundingFoil(Bool_t isRight,
54c9a3d9 2015 TArrayD &sizes, TGeoManager *mgr)
bc3498f4 2016{
54c9a3d9 2017 //
d0048cec 2018 // Create a volume containing all parts of the grounding foil a
2019 // for a half-stave.
54c9a3d9 2020 // It consists of 4 layers with the same shape but different thickness:
2021 // 1) a layer of glue
2022 // 2) the aluminum layer
2023 // 3) the kapton layer
2024 // 4) another layer of glue
2025 // ---
2026 // Arguments:
d0048cec 2027 // 1: a boolean value to know if it is the grounding foir for
54c9a3d9 2028 // the right or left side
2029 // 2: a TArrayD which will contain the dimension of the container box:
2030 // - size[0] = length along Z (the beam line direction)
d0048cec 2031 // - size[1] = the 'width' of the stave, which defines, together
54c9a3d9 2032 // with Z, the plane of the carbon fiber support
d0048cec 2033 // - size[2] = 'thickness' (= the direction along which all
54c9a3d9 2034 // stave components are superimposed)
2035 // 3: the TGeoManager
2036 // ---
d0048cec 2037 // The return value is a TGeoBBox volume containing all grounding
54c9a3d9 2038 // foil components.
2039 // to avoid strange behaviour of the geometry manager,
2040 // create a suffix to be used in the names of all shapes
2041 //
2042 char suf[5];
2043 if (isRight) strcpy(suf, "R"); else strcpy(suf, "L");
d0048cec 2044 // this volume will be created in order to ease its placement in
2045 // the half-stave; then, it is added here the small distance of
2046 // the "central" edge of each volume from the Z=0 plane in the stave
54c9a3d9 2047 // reference (which coincides with ALICE one)
2048 Double_t dist = fgkmm * 0.71;
d0048cec 2049
54c9a3d9 2050 // define materials
2051 TGeoMedium *medKap = GetMedium("SPD KAPTON(POLYCH2)$", mgr);
2052 TGeoMedium *medAlu = GetMedium("AL$", mgr);
2053 TGeoMedium *medGlue = GetMedium("EPOXY$", mgr); //??? GLUE_GF_SUPPORT
d0048cec 2054
54c9a3d9 2055 // compute the volume shapes (thicknesses change from one to the other)
2056 Double_t kpLength, kpWidth, alLength, alWidth;
2057 TArrayD kpSize, alSize, glSize;
ed0e944d 2058 Double_t kpThickness = fgkmm * 0.04;
2059 Double_t alThickness = fgkmm * 0.01;
2060//cout << "AL THICKNESS" << alThickness << endl;
2061 //Double_t g0Thickness = fgkmm * 0.1175 - fgkGapHalfStave;
2062 //Double_t g1Thickness = fgkmm * 0.1175 - fgkGapLadder;
2063 Double_t g0Thickness = fgkmm * 0.1275 - fgkGapHalfStave;
2064 Double_t g1Thickness = fgkmm * 0.1275 - fgkGapLadder;
54c9a3d9 2065 TGeoCompositeShape *kpShape = CreateGroundingFoilShape(0,kpLength,kpWidth,
2066 kpThickness, kpSize);
2067 TGeoCompositeShape *alShape = CreateGroundingFoilShape(1,alLength,alWidth,
2068 alThickness, alSize);
3ffa185f 2069 TGeoCompositeShape *g0Shape = CreateGroundingFoilShape(2,kpLength,kpWidth,
2070 g0Thickness, glSize);
2071 TGeoCompositeShape *g1Shape = CreateGroundingFoilShape(3,kpLength,kpWidth,
2072 g1Thickness, glSize);
d0048cec 2073 // create the component volumes and register their sizes in the
2074 // passed arrays for readability reasons, some reference variables
54c9a3d9 2075 // explicit the meaning of the array slots
2076 TGeoVolume *kpVol = new TGeoVolume(Form("ITSSPDgFoilKap%s",suf),
2077 kpShape, medKap);
2078 TGeoVolume *alVol = new TGeoVolume(Form("ITSSPDgFoilAlu%s",suf),
2079 alShape, medAlu);
3ffa185f 2080 TGeoVolume *g0Vol = new TGeoVolume(Form("ITSSPDgFoilGlue%s",suf),
2081 g0Shape, medGlue);
2082 TGeoVolume *g1Vol = new TGeoVolume(Form("ITSSPDgFoilGlue%s",suf),
2083 g1Shape, medGlue);
54c9a3d9 2084 // set colors for the volumes
2085 kpVol->SetLineColor(kRed);
2086 alVol->SetLineColor(kGray);
3ffa185f 2087 g0Vol->SetLineColor(kYellow);
2088 g1Vol->SetLineColor(kYellow);
54c9a3d9 2089 // create references for the final size object
2090 if (sizes.GetSize() != 3) sizes.Set(3);
2091 Double_t &fullThickness = sizes[0];
2092 Double_t &fullLength = sizes[1];
2093 Double_t &fullWidth = sizes[2];
d0048cec 2094 // kapton leads the larger dimensions of the foil
54c9a3d9 2095 // (including the cited small distance from Z=0 stave reference plane)
2096 // the thickness is the sum of the ones of all components
2097 fullLength = kpLength + dist;
2098 fullWidth = kpWidth;
3ffa185f 2099 fullThickness = kpThickness + alThickness + g0Thickness + g1Thickness;
54c9a3d9 2100 // create the container
d0048cec 2101// TGeoMedium *air = GetMedium("AIR$", mgr);
2102 TGeoVolumeAssembly *container = new TGeoVolumeAssembly(Form("ITSSPDgFOIL-%s",suf));
2103// TGeoVolume *container = mgr->MakeBox(Form("ITSSPDgFOIL-%s",suf),
2104// air, 0.5*fullThickness, 0.5*fullWidth, 0.5*fullLength);
2105 // create the common correction rotation (which depends of what side
54c9a3d9 2106 // we are building)
2107 TGeoRotation *rotCorr = new TGeoRotation(*gGeoIdentity);
2108 if (isRight) rotCorr->RotateY(90.0);
d0048cec 2109 else rotCorr->RotateY(-90.0);
2110 // compute the translations, which are in the length and
54c9a3d9 2111 // thickness directions
2112 Double_t x, y, z, shift = 0.0;
2113 if (isRight) shift = dist;
2114 // glue (bottom)
3ffa185f 2115 x = -0.5*(fullThickness - g0Thickness);
54c9a3d9 2116 z = 0.5*(fullLength - kpLength) - shift;
2117 TGeoCombiTrans *glTrans0 = new TGeoCombiTrans(x, 0.0, z, rotCorr);
2118 // kapton
3ffa185f 2119 x += 0.5*(g0Thickness + kpThickness);
54c9a3d9 2120 TGeoCombiTrans *kpTrans = new TGeoCombiTrans(x, 0.0, z, rotCorr);
2121 // aluminum
2122 x += 0.5*(kpThickness + alThickness);
2123 z = 0.5*(fullLength - alLength) - shift - 0.5*(kpLength - alLength);
2124 TGeoCombiTrans *alTrans = new TGeoCombiTrans(x, 0.0, z, rotCorr);
2125 // glue (top)
3ffa185f 2126 x += 0.5*(alThickness + g1Thickness);
54c9a3d9 2127 z = 0.5*(fullLength - kpLength) - shift;
2128 TGeoCombiTrans *glTrans1 = new TGeoCombiTrans(x, 0.0, z, rotCorr);
d0048cec 2129
ed0e944d 2130 //cout << fgkGapHalfStave << endl;
2131 //cout << g0Thickness << endl;
2132 //cout << kpThickness << endl;
2133 //cout << alThickness << endl;
2134 //cout << g1Thickness << endl;
54c9a3d9 2135
2136 // add to container
22726349 2137 container->SetLineColor(kMagenta-10);
54c9a3d9 2138 container->AddNode(kpVol, 1, kpTrans);
2139 container->AddNode(alVol, 1, alTrans);
3ffa185f 2140 container->AddNode(g0Vol, 1, glTrans0);
d0048cec 2141 container->AddNode(g1Vol, 2, glTrans1);
2142 // to add the grease we remember the sizes of the holes, stored as
54c9a3d9 2143 // additional parameters in the kapton layer size:
2144 // - sizes[3] = hole length
2145 // - sizes[4] = hole width
2146 // - sizes[5] = position of first hole center
2147 // - sizes[6] = standard separation between holes
2148 // - sizes[7] = separation between 5th and 6th hole
2149 // - sizes[8] = separation between 10th and 11th hole
d0048cec 2150 // - sizes[9] = separation between the upper hole border and
54c9a3d9 2151 // the foil border
2152 Double_t holeLength = kpSize[0];
2153 Double_t holeWidth = kpSize[1];
2154 Double_t holeFirstZ = kpSize[2];
2155 Double_t holeSepZ = kpSize[3];
2156 Double_t holeSep5th6th = kpSize[4];
2157 Double_t holeSep10th11th = kpSize[5];
2158 Double_t holeSepY = kpSize[6];
2159 // volume (common)
2160 // Grease has not been defined to date. Need much more information
2161 // no this material!
2162 TGeoMedium *grease = GetMedium("SPD KAPTON(POLYCH2)$", mgr); // ??? GREASE
2163 TGeoVolume *hVol = mgr->MakeBox("ITSSPDGrease", grease,
2164 0.5*fullThickness, 0.5*holeWidth, 0.5*holeLength);
2165 hVol->SetLineColor(kBlue);
2166 // displacement of volumes in the container
2167 Int_t idx = 1; // copy numbers start from 1.
2168 x = 0.0;
2169 y = 0.5*(fullWidth - holeWidth) - holeSepY;
2170 if (isRight) z = holeFirstZ - 0.5*fullLength + dist;
2171 else z = 0.5*fullLength - holeFirstZ - dist;
2172 for (Int_t i = 0; i < 11; i++) {
2173 TGeoTranslation *t = 0;
2174 t = new TGeoTranslation(x, y, -z);
2175 container->AddNode(hVol, idx++, t);
2176 if (i < 4) shift = holeSepZ;
2177 else if (i == 4) shift = holeSep5th6th;
2178 else if (i < 9) shift = holeSepZ;
2179 else shift = holeSep10th11th;
2180 if (isRight) z += shift;
2181 else z -= shift;
2182 } // end for i
2183 return container;
592651e2 2184}
54c9a3d9 2185//___________________________________________________________________
2186TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateMCM(Bool_t isRight,
2187 TArrayD &sizes, TGeoManager *mgr) const
bc3498f4 2188{
54c9a3d9 2189 //
2190 // Create a TGeoAssembly containing all the components of the MCM.
2191 // The TGeoVolume container is rejected due to the possibility of overlaps
2192 // when placing this object on the carbon fiber sector.
2193 // The assembly contains:
2194 // - the thin part of the MCM (integrated circuit)
2195 // - the MCM chips (specifications from EDMS)
2196 // - the cap which covers the zone where chips are bound to MCM
2197 // ---
d0048cec 2198 // The local reference frame of this assembly is defined in such a way
2199 // that all volumes are contained in a virtual box whose center
2200 // is placed exactly in the middle of the occupied space w.r to all
2201 // directions. This will ease the positioning of this object in the
2202 // half-stave. The sizes of this virtual box are stored in
54c9a3d9 2203 // the array passed by reference.
2204 // ---
2205 // Arguments:
d0048cec 2206 // - a boolean flag to know if this is the "left" or "right" MCM, when
2207 // looking at the stave from above (i.e. the direction from which
2208 // one sees bus over ladders over grounding foil) and keeping the
2209 // continuous border in the upper part, one sees the thicker part
54c9a3d9 2210 // on the left or right.
d0048cec 2211 // - an array passed by reference which will contain the size of
54c9a3d9 2212 // the virtual container.
2213 // - a pointer to the used TGeoManager.
2214 //
2215
2216 // to distinguish the "left" and "right" objects, a suffix is created
2217 char suf[5];
2218 if (isRight) strcpy(suf, "R"); else strcpy(suf, "L");
2219
2220 // ** MEDIA **
2221 TGeoMedium *medBase = GetMedium("SPD KAPTON(POLYCH2)$",mgr);// ??? MCM BASE
2222 TGeoMedium *medChip = GetMedium("SPD SI CHIP$",mgr);
2223 TGeoMedium *medCap = GetMedium("AL$",mgr);
2224
d0048cec 2225 // The shape of the MCM is divided into 3 sectors with different
54c9a3d9 2226 // widths (Y) and lengths (X), like in this sketch:
2227 //
d0048cec 2228 // 0 1 2
54c9a3d9 2229 // +---------------------+-----------------------------------+
2230 // | 4 sect 2 |
2231 // | 6 sect 1 /-------------------+
2232 // | sect 0 /--------------/ 3
2233 // +--------------------/ 5
2234 // 8 7
2235 //
2236 // the inclination of all oblique borders (6-7, 4-5) is always 45 degrees.
2237 // From drawings we can parametrize the dimensions of all these sectors,
2238 // then the shape of this part of the MCM is implemented as a
d0048cec 2239 // TGeoXtru centerd in the virtual XY space.
54c9a3d9 2240 // The first step is definig the relevant sizes of this shape:
2241 Int_t i, j;
2242 Double_t mcmThickness = fgkmm * 0.35;
2243 Double_t sizeXtot = fgkmm * 105.6; // total distance (0-2)
2244 // resp. 7-8, 5-6 and 3-4
2245 Double_t sizeXsector[3] = {fgkmm * 28.4, fgkmm * 41.4, fgkmm * 28.8};
2246 // resp. 0-8, 1-6 and 2-3
2247 Double_t sizeYsector[3] = {fgkmm * 15.0, fgkmm * 11.0, fgkmm * 8.0};
2248 Double_t sizeSep01 = fgkmm * 4.0; // x(6)-x(7)
2249 Double_t sizeSep12 = fgkmm * 3.0; // x(4)-x(5)
2250
2251 // define sizes of chips (last is the thickest)
2252 Double_t chipLength[5] = { 4.00, 6.15, 3.85, 5.60, 18.00 };
2253 Double_t chipWidth[5] = { 3.00, 4.10, 3.85, 5.60, 5.45 };
2254 Double_t chipThickness[5] = { 0.60, 0.30, 0.30, 1.00, 1.20 };
2255 TString name[5];
2256 name[0] = "ITSSPDanalog";
2257 name[1] = "ITSSPDpilot";
2258 name[2] = "ITSSPDgol";
2259 name[3] = "ITSSPDrx40";
2260 name[4] = "ITSSPDoptical";
2261 Color_t color[5] = { kCyan, kGreen, kYellow, kBlue, kOrange };
2262
2263 // define the sizes of the cover
2264 Double_t capThickness = fgkmm * 0.3;
2265 Double_t capHeight = fgkmm * 1.7;
2266
2267 // compute the total size of the virtual container box
2268 sizes.Set(3);
2269 Double_t &thickness = sizes[0];
2270 Double_t &length = sizes[1];
2271 Double_t &width = sizes[2];
2272 length = sizeXtot;
2273 width = sizeYsector[0];
2274 thickness = mcmThickness + capHeight;
2275
d0048cec 2276 // define all the relevant vertices of the polygon
54c9a3d9 2277 // which defines the transverse shape of the MCM.
d0048cec 2278 // These values are used to several purposes, and
54c9a3d9 2279 // for each one, some points must be excluded
2280 Double_t xRef[9], yRef[9];
2281 xRef[0] = -0.5*sizeXtot;
2282 yRef[0] = 0.5*sizeYsector[0];
2283 xRef[1] = xRef[0] + sizeXsector[0] + sizeSep01;
2284 yRef[1] = yRef[0];
2285 xRef[2] = -xRef[0];
2286 yRef[2] = yRef[0];
2287 xRef[3] = xRef[2];
2288 yRef[3] = yRef[2] - sizeYsector[2];
2289 xRef[4] = xRef[3] - sizeXsector[2];
2290 yRef[4] = yRef[3];
2291 xRef[5] = xRef[4] - sizeSep12;
2292 yRef[5] = yRef[4] - sizeSep12;
2293 xRef[6] = xRef[5] - sizeXsector[1];
2294 yRef[6] = yRef[5];
2295 xRef[7] = xRef[6] - sizeSep01;
2296 yRef[7] = yRef[6] - sizeSep01;
2297 xRef[8] = xRef[0];
2298 yRef[8] = -yRef[0];
2299
d0048cec 2300 // the above points are defined for the "right" MCM (if ve view the
2301 // stave from above) in order to change to the "left" one, we must
54c9a3d9 2302 // change the sign to all X values:
2303 if (isRight) for (i = 0; i < 9; i++) xRef[i] = -xRef[i];
d0048cec 2304
2305 // the shape of the MCM and glue layer are done excluding point 1,
54c9a3d9 2306 // which is not necessary and cause the geometry builder to get confused
2307 j = 0;
2308 Double_t xBase[8], yBase[8];
2309 for (i = 0; i < 9; i++) {
2310 if (i == 1) continue;
2311 xBase[j] = xRef[i];
2312 yBase[j] = yRef[i];
2313 j++;
2314 } // end for i
2315
2316 // the MCM cover is superimposed over the zones 1 and 2 only
2317 Double_t xCap[6], yCap[6];
2318 j = 0;
2319 for (i = 1; i <= 6; i++) {
2320 xCap[j] = xRef[i];
2321 yCap[j] = yRef[i];
2322 j++;
2323 } // end for i
2324
d0048cec 2325 // define positions of chips,
54c9a3d9 2326 // which must be added to the bottom-left corner of MCM
2327 // and divided by 1E4;
2328 Double_t chipX[5], chipY[5];
2329 if (isRight) {
2330 chipX[0] = 666320.;
2331 chipX[1] = 508320.;
2332 chipX[2] = 381320.;
2333 chipX[3] = 295320.;
2334 chipX[4] = 150320.;
2335 chipY[0] = 23750.;
2336 chipY[1] = 27750.;
2337 chipY[2] = 20750.;
2338 chipY[3] = 42750.;
2339 chipY[4] = 39750.;
2340 } else {
2341 chipX[0] = 389730.;
2342 chipX[1] = 548630.;
2343 chipX[2] = 674930.;
2344 chipX[3] = 761430.;
2345 chipX[4] = 905430.;
2346 chipY[0] = 96250.;
2347 chipY[1] = 91950.;
2348 chipY[2] = 99250.;
2349 chipY[3] = 107250.;
2350 chipY[4] = 109750.;
2351 } // end if isRight
2352 for (i = 0; i < 5; i++) {
2353 chipX[i] *= 0.00001;
2354 chipY[i] *= 0.00001;
2355 if (isRight) {
2356 chipX[i] += xRef[3];
2357 chipY[i] += yRef[3];
2358 } else {
2359 chipX[i] += xRef[8];
2360 chipY[i] += yRef[8];
2361 } // end for isRight
2362 chipLength[i] *= fgkmm;
2363 chipWidth[i] *= fgkmm;
2364 chipThickness[i] *= fgkmm;
2365 } // end for i
2366
d0048cec 2367 // create shapes for MCM
54c9a3d9 2368 Double_t z1, z2;
2369 TGeoXtru *shBase = new TGeoXtru(2);
2370 z1 = -0.5*thickness;
2371 z2 = z1 + mcmThickness;
2372 shBase->DefinePolygon(8, xBase, yBase);
2373 shBase->DefineSection(0, z1, 0., 0., 1.0);
2374 shBase->DefineSection(1, z2, 0., 0., 1.0);
2375
2376 // create volumes of MCM
2377 TGeoVolume *volBase = new TGeoVolume("ITSSPDbase", shBase, medBase);
2378 volBase->SetLineColor(kRed);
2379
d0048cec 2380 // to create the border of the MCM cover, it is required the
2381 // subtraction of two shapes the outer is created using the
54c9a3d9 2382 // reference points defined here
2383 TGeoXtru *shCapOut = new TGeoXtru(2);
2384 shCapOut->SetName(Form("ITSSPDshCAPOUT%s", suf));
2385 z1 = z2;
2386 z2 = z1 + capHeight - capThickness;
2387 shCapOut->DefinePolygon(6, xCap, yCap);
2388 shCapOut->DefineSection(0, z1, 0., 0., 1.0);
2389 shCapOut->DefineSection(1, z2, 0., 0., 1.0);
2390 // the inner is built similarly but subtracting the thickness
2391 Double_t angle, cs;
2392 Double_t xin[6], yin[6];
2393 if (!isRight) {
2394 angle = 45.0;
2395 cs = TMath::Cos( 0.5*(TMath::Pi() - angle*TMath::DegToRad()) );
2396 xin[0] = xCap[0] + capThickness;
2397 yin[0] = yCap[0] - capThickness;
2398 xin[1] = xCap[1] - capThickness;
2399 yin[1] = yin[0];
2400 xin[2] = xin[1];
2401 yin[2] = yCap[2] + capThickness;
2402 xin[3] = xCap[3] - capThickness*cs;
2403 yin[3] = yin[2];
2404 xin[4] = xin[3] - sizeSep12;
2405 yin[4] = yCap[4] + capThickness;
2406 xin[5] = xin[0];
2407 yin[5] = yin[4];
2408 } else {
2409 angle = 45.0;
2410 cs = TMath::Cos( 0.5*(TMath::Pi() - angle*TMath::DegToRad()) );
2411 xin[0] = xCap[0] - capThickness;
2412 yin[0] = yCap[0] - capThickness;
2413 xin[1] = xCap[1] + capThickness;
2414 yin[1] = yin[0];
2415 xin[2] = xin[1];
2416 yin[2] = yCap[2] + capThickness;
2417 xin[3] = xCap[3] - capThickness*cs;
2418 yin[3] = yin[2];
2419 xin[4] = xin[3] + sizeSep12;
2420 yin[4] = yCap[4] + capThickness;
2421 xin[5] = xin[0];
2422 yin[5] = yin[4];
2423 } // end if !isRight
2424 TGeoXtru *shCapIn = new TGeoXtru(2);
2425 shCapIn->SetName(Form("ITSSPDshCAPIN%s", suf));
2426 shCapIn->DefinePolygon(6, xin, yin);
2427 shCapIn->DefineSection(0, z1 - 0.01, 0., 0., 1.0);
2428 shCapIn->DefineSection(1, z2 + 0.01, 0., 0., 1.0);
2429 // compose shapes
2430 TGeoCompositeShape *shCapBorder = new TGeoCompositeShape(
d0048cec 2431 Form("ITSSPDshBORDER%s", suf),
54c9a3d9 2432 Form("%s-%s", shCapOut->GetName(),
2433 shCapIn->GetName()));
2434 // create volume
2435 TGeoVolume *volCapBorder = new TGeoVolume("ITSSPDcapBoarder",
2436 shCapBorder,medCap);
2437 volCapBorder->SetLineColor(kGreen);
d0048cec 2438 // finally, we create the top of the cover, which has the same
2439 // shape of outer border and a thickness equal of the one othe
54c9a3d9 2440 // cover border one
2441 TGeoXtru *shCapTop = new TGeoXtru(2);
2442 z1 = z2;
2443 z2 = z1 + capThickness;
2444 shCapTop->DefinePolygon(6, xCap, yCap);
2445 shCapTop->DefineSection(0, z1, 0., 0., 1.0);
2446 shCapTop->DefineSection(1, z2, 0., 0., 1.0);
2447 TGeoVolume *volCapTop = new TGeoVolume("ITSSPDcapTop", shCapTop, medCap);
2448 volCapTop->SetLineColor(kBlue);
2449
2450 // create container assembly with right suffix
2451 TGeoVolumeAssembly *mcmAssembly = new TGeoVolumeAssembly(
2452 Form("ITSSPDmcm%s", suf));
2453
2454 // add mcm layer
2455 mcmAssembly->AddNode(volBase, 1, gGeoIdentity);
2456 // add chips
2457 for (i = 0; i < 5; i++) {
2458 TGeoVolume *box = gGeoManager->MakeBox(name[i],medChip,
2459 0.5*chipLength[i], 0.5*chipWidth[i], 0.5*chipThickness[i]);
2460 TGeoTranslation *tr = new TGeoTranslation(chipX[i],chipY[i],
2461 0.5*(-thickness + chipThickness[i]) + mcmThickness);
2462 box->SetLineColor(color[i]);
2463 mcmAssembly->AddNode(box, 1, tr);
2464 } // end for i
2465 // add cap border
2466 mcmAssembly->AddNode(volCapBorder, 1, gGeoIdentity);
2467 // add cap top
d0048cec 2468 mcmAssembly->AddNode(volCapTop, 1, gGeoIdentity);
54c9a3d9 2469
2470 return mcmAssembly;
592651e2 2471}
7f69c251 2472
2473/*
2474//__________________________________________________________________________________________
2475TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
2476(Bool_t isRight, TArrayD &sizes, TGeoManager *mgr) const
2477{
3ffa185f 2478 //
d0048cec 2479 // The pixel bus is implemented as a TGeoBBox with some objects on it,
3ffa185f 2480 // which could affect the particle energy loss.
2481 // ---
d0048cec 2482 // In order to avoid confusion, the bus is directly displaced
3ffa185f 2483 // according to the axis orientations which are used in the final stave:
2484 // X --> thickness direction
2485 // Y --> width direction
2486 // Z --> length direction
2487 //
d0048cec 2488
2489
3ffa185f 2490 // ** MEDIA **
d0048cec 2491
3ffa185f 2492 //PIXEL BUS
2493 TGeoMedium *medBus = GetMedium("SPDBUS(AL+KPT+EPOX)$",mgr);
2494 TGeoMedium *medPt1000 = GetMedium("CERAMICS$",mgr); // ??? PT1000
2495 // Capacity
2496 TGeoMedium *medCap = GetMedium("SDD X7R capacitors$",mgr);
2497 // ??? Resistance
2498 // TGeoMedium *medRes = GetMedium("SDD X7R capacitors$",mgr);
2499 TGeoMedium *medRes = GetMedium("ALUMINUM$",mgr);
2500 TGeoMedium *medExt = GetMedium("SDDKAPTON (POLYCH2)$", mgr);
2501 // ** SIZES & POSITIONS **
2502 Double_t busLength = 170.501 * fgkmm; // length of plane part
2503 Double_t busWidth = 13.800 * fgkmm; // width
2504 Double_t busThickness = 0.280 * fgkmm; // thickness
2505 Double_t pt1000Length = fgkmm * 1.50;
2506 Double_t pt1000Width = fgkmm * 3.10;
2507 Double_t pt1000Thickness = fgkmm * 0.60;
2508 Double_t pt1000Y, pt1000Z[10];// position of the pt1000's along the bus
2509 Double_t capLength = fgkmm * 2.55;
2510 Double_t capWidth = fgkmm * 1.50;
2511 Double_t capThickness = fgkmm * 1.35;
2512 Double_t capY[2], capZ[2];
d0048cec 2513
3ffa185f 2514 Double_t resLength = fgkmm * 2.20;
2515 Double_t resWidth = fgkmm * 0.80;
2516 Double_t resThickness = fgkmm * 0.35;
2517 Double_t resY[2], resZ[2];
d0048cec 2518
3ffa185f 2519 Double_t extThickness = fgkmm * 0.25;
2520 Double_t ext1Length = fgkmm * (26.7 - 10.0);
2521 Double_t ext2Length = fgkmm * (285.0 - ext1Length + extThickness);
2522 Double_t extWidth = fgkmm * 11.0;
2523 Double_t extHeight = fgkmm * 2.5;
d0048cec 2524
2525
2526 // position of pt1000, resistors and capacitors depends on the
3ffa185f 2527 // bus if it's left or right one
2528 if (!isRight) {
2529 pt1000Y = 64400.;
2530 pt1000Z[0] = 66160.;
2531 pt1000Z[1] = 206200.;
2532 pt1000Z[2] = 346200.;
2533 pt1000Z[3] = 486200.;
2534 pt1000Z[4] = 626200.;
2535 pt1000Z[5] = 776200.;
2536 pt1000Z[6] = 916200.;
2537 pt1000Z[7] = 1056200.;
2538 pt1000Z[8] = 1196200.;
d0048cec 2539 pt1000Z[9] = 1336200.;
3ffa185f 2540 resZ[0] = 1397500.;
2541 resY[0] = 26900.;
2542 resZ[1] = 682500.;
2543 resY[1] = 27800.;
2544 capZ[0] = 1395700.;
2545 capY[0] = 45700.;
2546 capZ[1] = 692600.;
2547 capY[1] = 45400.;
2548 } else {
2549 pt1000Y = 66100.;
2550 pt1000Z[0] = 319700.;
2551 pt1000Z[1] = 459700.;
2552 pt1000Z[2] = 599700.;
2553 pt1000Z[3] = 739700.;
2554 pt1000Z[4] = 879700.;
2555 pt1000Z[5] = 1029700.;
2556 pt1000Z[6] = 1169700.;
2557 pt1000Z[7] = 1309700.;
2558 pt1000Z[8] = 1449700.;
d0048cec 2559 pt1000Z[9] = 1589700.;
3ffa185f 2560 capY[0] = 44500.;
2561 capZ[0] = 266700.;
2562 capY[1] = 44300.;
2563 capZ[1] = 974700.;
2564 resZ[0] = 266500.;
2565 resY[0] = 29200.;
2566 resZ[1] = 974600.;
2567 resY[1] = 29900.;
2568 } // end if isRight
2569 Int_t i;
2570 pt1000Y *= 1E-4 * fgkmm;
2571 for (i = 0; i < 10; i++) {
2572 pt1000Z[i] *= 1E-4 * fgkmm;
2573 if (i < 2) {
2574 capZ[i] *= 1E-4 * fgkmm;
2575 capY[i] *= 1E-4 * fgkmm;
2576 resZ[i] *= 1E-4 * fgkmm;
2577 resY[i] *= 1E-4 * fgkmm;
2578 } // end if iM2
2579 } // end for i
d0048cec 2580
3ffa185f 2581 Double_t &fullLength = sizes[1];
2582 Double_t &fullWidth = sizes[2];
2583 Double_t &fullThickness = sizes[0];
2584 fullLength = busLength;
2585 fullWidth = busWidth;
2586 // add the thickness of the thickest component on bus (capacity)
d0048cec 2587 fullThickness = busThickness + capThickness;
3ffa185f 2588 // ** VOLUMES **
2589 TGeoVolumeAssembly *container = new TGeoVolumeAssembly("PixelBus");
2590 TGeoVolume *bus = mgr->MakeBox("Bus", medBus, 0.5*busThickness, 0.5*busWidth, 0.5*busLength);
2591 TGeoVolume *pt1000 = mgr->MakeBox("PT1000", medPt1000, 0.5*pt1000Thickness, 0.5*pt1000Width, 0.5*pt1000Length);
2592 TGeoVolume *res = mgr->MakeBox("Resistor", medRes, 0.5*resThickness, 0.5*resWidth, 0.5*resLength);
2593 TGeoVolume *cap = mgr->MakeBox("Capacitor", medCap, 0.5*capThickness, 0.5*capWidth, 0.5*capLength);
2594 TGeoVolume *ext1 = mgr->MakeBox("Extender1", medExt, 0.5*extThickness, 0.5*extWidth, 0.5*ext1Length);
2595 TGeoVolume *ext2 = mgr->MakeBox("Extender2", medExt, 0.5*extHeight - extThickness, 0.5*extWidth, 0.5*extThickness);
2596 TGeoVolume *ext3 = mgr->MakeBox("Extender3", medExt, extThickness, 0.5*extWidth, 0.5*ext2Length);
2597 bus->SetLineColor(kYellow + 2);
2598 pt1000->SetLineColor(kGreen + 3);
2599 res->SetLineColor(kRed + 1);
2600 cap->SetLineColor(kBlue - 7);
2601 ext1->SetLineColor(kGray);
2602 ext2->SetLineColor(kGray);
2603 ext3->SetLineColor(kGray);
d0048cec 2604
3ffa185f 2605 // ** MOVEMENTS AND POSITIONEMENT **
2606 // bus
d0048cec 2607 TGeoTranslation *trBus = new TGeoTranslation(0.5 * (busThickness -
3ffa185f 2608 fullThickness), 0.0, 0.0);
2609 container->AddNode(bus, 0, trBus);
2610 Double_t zRef, yRef, x, y, z;
2611 if (isRight) {
2612 zRef = -0.5*fullLength;
2613 yRef = -0.5*fullWidth;
2614 } else {
2615 zRef = -0.5*fullLength;
2616 yRef = -0.5*fullWidth;
2617 } // end if isRight
2618 // pt1000
2619 x = 0.5*(pt1000Thickness - fullThickness) + busThickness;
2620 for (i = 0; i < 10; i++) {
2621 y = yRef + pt1000Y;
2622 z = zRef + pt1000Z[i];
2623 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2624 container->AddNode(pt1000, i, tr);
2625 } // end for i
2626 // capacitors
2627 x = 0.5*(capThickness - fullThickness) + busThickness;
2628 for (i = 0; i < 2; i++) {
2629 y = yRef + capY[i];
2630 z = zRef + capZ[i];
2631 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2632 container->AddNode(cap, i, tr);
2633 } // end for i
2634 // resistors
2635 x = 0.5*(resThickness - fullThickness) + busThickness;
2636 for (i = 0; i < 2; i++) {
2637 y = yRef + resY[i];
2638 z = zRef + resZ[i];
2639 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2640 container->AddNode(res, i, tr);
2641 } // end for i
2642 // extender
2643 if (isRight) {
2644 y = 0.5 * (-fullWidth + extWidth);
2645 z = 0.5 * (-fullLength + fgkmm * 10.0);
2646 }
2647 else {
2648 y = 0.5 * (fullWidth - extWidth);
2649 z = 0.5 * ( fullLength - fgkmm * 10.0);
2650 }
2651 x = 0.5 * (extThickness - fullThickness) + busThickness;
2652 //y = 0.5 * (fullWidth - extWidth);
2653 TGeoTranslation *trExt1 = new TGeoTranslation(x, y, z);
2654 if (isRight) {
2655 z -= 0.5 * (ext1Length - extThickness);
2656 }
2657 else {
2658 z += 0.5 * (ext1Length - extThickness);
2659 }
2660 x += 0.5*(extHeight - extThickness);
2661 TGeoTranslation *trExt2 = new TGeoTranslation(x, y, z);
2662 if (isRight) {
2663 z -= 0.5 * (ext2Length - extThickness);
2664 }
2665 else {
2666 z += 0.5 * (ext2Length - extThickness);
2667 }
2668 x += 0.5*(extHeight - extThickness) + extThickness;
2669 TGeoTranslation *trExt3 = new TGeoTranslation(x, y, z);
2670 container->AddNode(ext1, 0, trExt1);
2671 container->AddNode(ext2, 0, trExt2);
2672 container->AddNode(ext3, 0, trExt3);
d0048cec 2673
2674
3ffa185f 2675 sizes[3] = yRef + pt1000Y;
2676 sizes[4] = zRef + pt1000Z[2];
2677 sizes[5] = zRef + pt1000Z[7];
d0048cec 2678
3ffa185f 2679 return container;
7f69c251 2680}
2681*/
2682
54c9a3d9 2683//______________________________________________________________________
bc3498f4 2684TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
22726349 2685(Bool_t isRight, Int_t ilayer, TArrayD &sizes, TGeoManager *mgr) const
bc3498f4 2686{
54c9a3d9 2687 //
d0048cec 2688 // The pixel bus is implemented as a TGeoBBox with some objects on it,
54c9a3d9 2689 // which could affect the particle energy loss.
2690 // ---
d0048cec 2691 // In order to avoid confusion, the bus is directly displaced
54c9a3d9 2692 // according to the axis orientations which are used in the final stave:
2693 // X --> thickness direction
2694 // Y --> width direction
2695 // Z --> length direction
2696 //
d0048cec 2697
22726349 2698 // ** CRITICAL CHECK ******************************************************
2699 // layer number can be ONLY 1 or 2
2700 if (ilayer != 1 && ilayer != 2) AliFatal("Layer number MUST be 1 or 2");
54c9a3d9 2701
2702 // ** MEDIA **
2703 //PIXEL BUS
2704 TGeoMedium *medBus = GetMedium("SPDBUS(AL+KPT+EPOX)$",mgr);
2705 TGeoMedium *medPt1000 = GetMedium("CERAMICS$",mgr); // ??? PT1000
2706 // Capacity
2707 TGeoMedium *medCap = GetMedium("SDD X7R capacitors$",mgr);
2708 // ??? Resistance
d0048cec 2709 //TGeoMedium *medRes = GetMedium("SDD X7R capacitors$",mgr);
7f69c251 2710 TGeoMedium *medRes = GetMedium("ALUMINUM$",mgr);
3ffa185f 2711 TGeoMedium *medExt = GetMedium("SDDKAPTON (POLYCH2)$", mgr);
54c9a3d9 2712 // ** SIZES & POSITIONS **
2713 Double_t busLength = 170.501 * fgkmm; // length of plane part
2714 Double_t busWidth = 13.800 * fgkmm; // width
2715 Double_t busThickness = 0.280 * fgkmm; // thickness
2716 Double_t pt1000Length = fgkmm * 1.50;
2717 Double_t pt1000Width = fgkmm * 3.10;
2718 Double_t pt1000Thickness = fgkmm * 0.60;
2719 Double_t pt1000Y, pt1000Z[10];// position of the pt1000's along the bus
2720 Double_t capLength = fgkmm * 2.55;
2721 Double_t capWidth = fgkmm * 1.50;
2722 Double_t capThickness = fgkmm * 1.35;
2723 Double_t capY[2], capZ[2];
d0048cec 2724
54c9a3d9 2725 Double_t resLength = fgkmm * 2.20;
2726 Double_t resWidth = fgkmm * 0.80;
2727 Double_t resThickness = fgkmm * 0.35;
2728 Double_t resY[2], resZ[2];
d0048cec 2729
7f69c251 2730 Double_t extThickness = fgkmm * 0.25;
3ffa185f 2731 Double_t ext1Length = fgkmm * (26.7 - 10.0);
ddf00e3c 2732 Double_t ext2Length = fgkmm * 284.0 - ext1Length + extThickness;
3ffa185f 2733 Double_t extWidth = fgkmm * 11.0;
2734 Double_t extHeight = fgkmm * 2.5;
d0048cec 2735
2736 // position of pt1000, resistors and capacitors depends on the
54c9a3d9 2737 // bus if it's left or right one
2738 if (!isRight) {
2739 pt1000Y = 64400.;
2740 pt1000Z[0] = 66160.;
2741 pt1000Z[1] = 206200.;
2742 pt1000Z[2] = 346200.;
2743 pt1000Z[3] = 486200.;
2744 pt1000Z[4] = 626200.;
2745 pt1000Z[5] = 776200.;
2746 pt1000Z[6] = 916200.;
2747 pt1000Z[7] = 1056200.;
2748 pt1000Z[8] = 1196200.;
d0048cec 2749 pt1000Z[9] = 1336200.;
54c9a3d9 2750 resZ[0] = 1397500.;
2751 resY[0] = 26900.;
2752 resZ[1] = 682500.;
2753 resY[1] = 27800.;
2754 capZ[0] = 1395700.;
2755 capY[0] = 45700.;
2756 capZ[1] = 692600.;
2757 capY[1] = 45400.;
2758 } else {
2759 pt1000Y = 66100.;
2760 pt1000Z[0] = 319700.;
2761 pt1000Z[1] = 459700.;
2762 pt1000Z[2] = 599700.;
2763 pt1000Z[3] = 739700.;
2764 pt1000Z[4] = 879700.;
2765 pt1000Z[5] = 1029700.;
2766 pt1000Z[6] = 1169700.;
2767 pt1000Z[7] = 1309700.;
2768 pt1000Z[8] = 1449700.;
d0048cec 2769 pt1000Z[9] = 1589700.;
54c9a3d9 2770 capY[0] = 44500.;
2771 capZ[0] = 266700.;
2772 capY[1] = 44300.;
2773 capZ[1] = 974700.;
2774 resZ[0] = 266500.;
2775 resY[0] = 29200.;
2776 resZ[1] = 974600.;
2777 resY[1] = 29900.;
2778 } // end if isRight
2779 Int_t i;
2780 pt1000Y *= 1E-4 * fgkmm;
2781 for (i = 0; i < 10; i++) {
2782 pt1000Z[i] *= 1E-4 * fgkmm;
2783 if (i < 2) {
2784 capZ[i] *= 1E-4 * fgkmm;
2785 capY[i] *= 1E-4 * fgkmm;
2786 resZ[i] *= 1E-4 * fgkmm;
2787 resY[i] *= 1E-4 * fgkmm;
2788 } // end if iM2
2789 } // end for i
d0048cec 2790
54c9a3d9 2791 Double_t &fullLength = sizes[1];
2792 Double_t &fullWidth = sizes[2];
2793 Double_t &fullThickness = sizes[0];
2794 fullLength = busLength;
2795 fullWidth = busWidth;
2796 // add the thickness of the thickest component on bus (capacity)
d0048cec 2797 fullThickness = busThickness + capThickness;
54c9a3d9 2798
2799 // ** VOLUMES **
2800 TGeoVolumeAssembly *container = new TGeoVolumeAssembly("ITSSPDpixelBus");
d0048cec 2801 TGeoVolume *bus = mgr->MakeBox("ITSSPDbus", medBus, 0.5*busThickness,
54c9a3d9 2802 0.5*busWidth, 0.5*busLength);
2803 TGeoVolume *pt1000 = mgr->MakeBox("ITSSPDpt1000",medPt1000,
2804 0.5*pt1000Thickness,0.5*pt1000Width, 0.5*pt1000Length);
2805 TGeoVolume *res = mgr->MakeBox("ITSSPDresistor", medRes, 0.5*resThickness,
2806 0.5*resWidth, 0.5*resLength);
2807 TGeoVolume *cap = mgr->MakeBox("ITSSPDcapacitor", medCap, 0.5*capThickness,
2808 0.5*capWidth, 0.5*capLength);
d0048cec 2809
7f69c251 2810 TGeoVolume *ext1 = mgr->MakeBox("Extender1", medExt, 0.5*extThickness, 0.5*extWidth, 0.5*ext1Length);
3ffa185f 2811 TGeoVolume *ext2 = mgr->MakeBox("Extender2", medExt, 0.5*extHeight - 2.*extThickness, 0.5*extWidth, 0.5*extThickness);
2812 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 2813 bus->SetLineColor(kYellow + 2);
2814 pt1000->SetLineColor(kGreen + 3);
2815 res->SetLineColor(kRed + 1);
2816 cap->SetLineColor(kBlue - 7);
7f69c251 2817 ext1->SetLineColor(kGray);
3ffa185f 2818 ext2->SetLineColor(kGray);
2819 ext3->SetLineColor(kGray);
54c9a3d9 2820
2821 // ** MOVEMENTS AND POSITIONEMENT **
2822 // bus
d0048cec 2823 TGeoTranslation *trBus = new TGeoTranslation(0.5 * (busThickness -
54c9a3d9 2824 fullThickness), 0.0, 0.0);
2825 container->AddNode(bus, 1, trBus);
2826 Double_t zRef, yRef, x, y, z;
2827 if (isRight) {
2828 zRef = -0.5*fullLength;
2829 yRef = -0.5*fullWidth;
2830 } else {
2831 zRef = -0.5*fullLength;
2832 yRef = -0.5*fullWidth;
2833 } // end if isRight
2834 // pt1000
2835 x = 0.5*(pt1000Thickness - fullThickness) + busThickness;
2836 for (i = 0; i < 10; i++) {
2837 y = yRef + pt1000Y;
2838 z = zRef + pt1000Z[i];
2839 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2840 container->AddNode(pt1000, i+1, tr);
2841 } // end for i
2842 // capacitors
2843 x = 0.5*(capThickness - fullThickness) + busThickness;
2844 for (i = 0; i < 2; i++) {
2845 y = yRef + capY[i];
2846 z = zRef + capZ[i];
2847 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2848 container->AddNode(cap, i+1, tr);
2849 } // end for i
2850 // resistors
2851 x = 0.5*(resThickness - fullThickness) + busThickness;
2852 for (i = 0; i < 2; i++) {
2853 y = yRef + resY[i];
2854 z = zRef + resZ[i];
2855 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2856 container->AddNode(res, i+1, tr);
2857 } // end for i
d0048cec 2858
7f69c251 2859 // extender
22726349 2860 if (ilayer == 2) {
3ffa185f 2861 if (isRight) {
2862 y = 0.5 * (fullWidth - extWidth) - 0.1;
2863 z = 0.5 * (-fullLength + fgkmm * 10.0);
2864 }
2865 else {
2866 y = 0.5 * (fullWidth - extWidth) - 0.1;
2867 z = 0.5 * ( fullLength - fgkmm * 10.0);
2868 }
22726349 2869 }
2870 else {
2871 if (isRight) {
2872 y = -0.5 * (fullWidth - extWidth);
2873 z = 0.5 * (-fullLength + fgkmm * 10.0);
2874 }
2875 else {
2876 y = -0.5 * (fullWidth - extWidth);
2877 z = 0.5 * ( fullLength - fgkmm * 10.0);
2878 }
2879 }
3ffa185f 2880 x = 0.5 * (extThickness - fullThickness) + busThickness;
2881 //y = 0.5 * (fullWidth - extWidth);
2882 TGeoTranslation *trExt1 = new TGeoTranslation(x, y, z);
2883 if (isRight) {
2884 z -= 0.5 * (ext1Length - extThickness);
2885 }
2886 else {
2887 z += 0.5 * (ext1Length - extThickness);
2888 }
2889 x += 0.5*(extHeight - 3.*extThickness);
2890 TGeoTranslation *trExt2 = new TGeoTranslation(x, y, z);
2891 if (isRight) {
2892 z -= 0.5 * (ext2Length - extThickness) + 2.5*extThickness;
2893 }
2894 else {
2895 z += 0.5 * (ext2Length - extThickness) + 2.5*extThickness;
2896 }
2897 x += 0.5*(extHeight - extThickness) - 2.*extThickness;
2898 TGeoTranslation *trExt3 = new TGeoTranslation(x, y, z);
2899 container->AddNode(ext1, 0, trExt1);
2900 container->AddNode(ext2, 0, trExt2);
2901 container->AddNode(ext3, 0, trExt3);
d0048cec 2902
54c9a3d9 2903 sizes[3] = yRef + pt1000Y;
2904 sizes[4] = zRef + pt1000Z[2];
2905 sizes[5] = zRef + pt1000Z[7];
d0048cec 2906
54c9a3d9 2907 return container;
592651e2 2908}
7f69c251 2909
2910//______________________________________________________________________
96eb8210 2911TList* AliITSv11GeometrySPD::CreateConeModule(const Double_t angrot,
2912 TGeoManager *mgr) const
7f69c251 2913{
96eb8210 2914 //
2915 // Creates all services modules and places them in a TList
2916 // angrot is the rotation angle (passed as an argument to avoid
2917 // defining the same quantity in two different places)
2918 //
2919 // Created: ?? ??? 2008 Alberto Pulvirenti
2920 // Updated: 03 May 2010 Mario Sitta
2921 //
2922
7f69c251 2923 TGeoMedium *medInox = GetMedium("INOX$",mgr);
3ffa185f 2924 TGeoMedium *medExt = GetMedium("SDDKAPTON (POLYCH2)$", mgr);
2925 TGeoMedium *medPlate = GetMedium("SPD C (M55J)$", mgr);
96eb8210 2926 TGeoMedium *medFreon = GetMedium("Freon$", mgr);
2927 TGeoMedium *medGas = GetMedium("GASEOUS FREON$", mgr);
d0048cec 2928
3ffa185f 2929 Double_t extThickness = fgkmm * 0.25;
2930 Double_t ext1Length = fgkmm * (26.7 - 10.0);
96eb8210 2931// Double_t ext2Length = fgkmm * (285.0 - ext1Length + extThickness);
2932 Double_t ext2Length = fgkmm * 285.0 - ext1Length + extThickness;
d0048cec 2933
96eb8210 2934 const Double_t kCableThickness = 1.5 *fgkmm;
2935 Double_t cableL1 = 340.0 * fgkmm - extThickness - ext1Length - ext2Length;
2936 Double_t cableL2 = 300.0 * fgkmm;
7f69c251 2937 //Double_t cableL3 = 570.0 * fgkmm;
2938 Double_t cableL3 = 57.0 * fgkmm;
2939 Double_t cableW1 = 11.0 * fgkmm;
2940 Double_t cableW2 = 30.0 * fgkmm;
2941 Double_t cableW3 = 50.0 * fgkmm;
d0048cec 2942
96eb8210 2943 const Double_t kMCMLength = cableL1 + cableL2 + cableL3;
2944 const Double_t kMCMWidth = cableW1;
2945 const Double_t kMCMThickness = 1.2 *fgkmm;
d0048cec 2946
96eb8210 2947 const Double_t kPlateLength = 200.0 *fgkmm;
2948 const Double_t kPlateWidth = 50.0 *fgkmm;
2949 const Double_t kPlateThickness = 5.0 *fgkmm;
2950
2951 const Double_t kConeTubeRmin = 5.0 *fgkmm;
2952 const Double_t kConeTubeRmax = 6.0 *fgkmm;
2953
2954 const Double_t kHorizTubeLen = 150.0 *fgkmm; //!!!TO BE CHECKED!!!
2955 const Double_t kYtoHalfStave = 6.8 *fgkmm; //!!!TO BE CHECKED!!!
d0048cec 2956
7f69c251 2957 Double_t x[12], y[12];
96eb8210 2958 Double_t xloc, yloc, zloc;
2959
2960 Int_t kPurple = 6; // Purple (Root does not define it)
2961
2962 TGeoVolumeAssembly* container[3];
2963 container[0] = new TGeoVolumeAssembly("ITSSPDConeModule");
2964 container[1] = new TGeoVolumeAssembly("ITSSPDCoolingModuleSideA");
2965 container[2] = new TGeoVolumeAssembly("ITSSPDCoolingModuleSideC");
d0048cec 2966
96eb8210 2967 // The extender on the cone as a Xtru
2968 x[0] = 0.0;
7f69c251 2969 y[0] = 0.0 + 0.5 * cableW1;
d0048cec 2970
7f69c251 2971 x[1] = x[0] + cableL1 - 0.5*(cableW2 - cableW1);
2972 y[1] = y[0];
d0048cec 2973
2974 x[2] = x[0] + cableL1;
7f69c251 2975 y[2] = y[1] + 0.5*(cableW2 - cableW1);
d0048cec 2976
7f69c251 2977 x[3] = x[2] + cableL2;
2978 y[3] = y[2];
d0048cec 2979
7f69c251 2980 x[4] = x[3] + 0.5*(cableW3 - cableW2);
2981 y[4] = y[3] + 0.5*(cableW3 - cableW2);
d0048cec 2982
7f69c251 2983 x[5] = x[4] + cableL3 - 0.5*(cableW3 - cableW2);
2984 y[5] = y[4];
d0048cec 2985
7f69c251 2986 for (Int_t i = 6; i < 12; i++) {
2987 x[i] = x[11 - i];
2988 y[i] = -y[11 - i];
2989 }
d0048cec 2990
7f69c251 2991 TGeoXtru *shCable = new TGeoXtru(2);
2992 shCable->DefinePolygon(12, x, y);
96eb8210 2993 shCable->DefineSection(0, 0.0);
2994 shCable->DefineSection(1, kCableThickness);
d0048cec 2995
7f69c251 2996 TGeoVolume *volCable = new TGeoVolume("ITSSPDExtender", shCable, medExt);
2997 volCable->SetLineColor(kGreen);
d0048cec 2998
96eb8210 2999 // The MCM extender on the cone as a Xtru
3000 TGeoBBox *shMCMExt = new TGeoBBox(0.5*kMCMLength,
3001 0.5*kMCMWidth,
3002 0.5*kMCMThickness);
d0048cec 3003
96eb8210 3004 TGeoVolume *volMCMExt = new TGeoVolume("ITSSPDExtenderMCM",
3005 shMCMExt, medExt);
7f69c251 3006 volMCMExt->SetLineColor(kGreen+3);
d0048cec 3007
96eb8210 3008 // The support plate on the cone as a composite shape
3009 Double_t thickness = kCableThickness + kMCMThickness;
3010 TGeoBBox *shOut = new TGeoBBox("ITSSPD_shape_plateout",
3011 0.5*kPlateLength,
3012 0.5*kPlateWidth,
3013 0.5*kPlateThickness);
3014 TGeoBBox *shIn = new TGeoBBox("ITSSPD_shape_platein" ,
3015 0.5*kPlateLength,
3016 0.5*cableW2,
3017 0.5*thickness);
3018 Char_t string[255];
3019 sprintf(string, "%s-%s", shOut->GetName(), shIn->GetName());
3020 TGeoCompositeShape *shPlate = new TGeoCompositeShape("ITSSPDPlate_shape",
3021 string);
d0048cec 3022
96eb8210 3023 TGeoVolume *volPlate = new TGeoVolume("ITSSPDPlate",
3024 shPlate, medPlate);
3025 volPlate->SetLineColor(kRed);
d0048cec 3026
96eb8210 3027 // The cooling tube on the cone as a Ctub
3028 Double_t tubeLength = shCable->GetX(5) - shCable->GetX(0) + kYtoHalfStave;
3029 TGeoCtub *shTube = new TGeoCtub(0, kConeTubeRmax, 0.5*tubeLength, 0, 360,
3030 0, SinD(angrot/2), -CosD(angrot/2),
3031 0, 0, 1);
3032
3033 TGeoVolume *volTubeA = new TGeoVolume("ITSSPDCoolingTubeOnConeA",
3034 shTube, medInox);
3035 volTubeA->SetLineColor(kGray);
3036
3037 TGeoVolume *volTubeC = new TGeoVolume("ITSSPDCoolingTubeOnConeC",
3038 shTube, medInox);
3039 volTubeC->SetLineColor(kGray);
3040
3041 // The freon in the cooling tubes on the cone as a Ctub
3042 TGeoCtub *shFreon = new TGeoCtub(0, kConeTubeRmin, 0.5*tubeLength, 0, 360,
3043 0, SinD(angrot/2), -CosD(angrot/2),
3044 0, 0, 1);
3045
3046 TGeoVolume *volFreon = new TGeoVolume("ITSSPDCoolingFreonOnCone",
3047 shFreon, medFreon);
3048 volFreon->SetLineColor(kPurple);
3049
3050 TGeoVolume *volGasFr = new TGeoVolume("ITSSPDCoolingFreonGasOnCone",
3051 shFreon, medGas);
3052 volGasFr->SetLineColor(kPurple);
3053
3054 // The cooling tube inside the cylinder as a Ctub
3055 TGeoCtub *shCylTub = new TGeoCtub(0, kConeTubeRmax,
3056 0.5*kHorizTubeLen, 0, 360,
3057 0, 0, -1,
3058 0, SinD(angrot/2), CosD(angrot/2));
3059
3060 TGeoVolume *volCylTubA = new TGeoVolume("ITSSPDCoolingTubeOnCylA",
3061 shCylTub, medInox);
3062 volCylTubA->SetLineColor(kGray);
3063
3064 TGeoVolume *volCylTubC = new TGeoVolume("ITSSPDCoolingTubeOnCylC",
3065 shCylTub, medInox);
3066 volCylTubC->SetLineColor(kGray);
3067
3068 // The freon in the cooling tubes in the cylinder as a Ctub
3069 TGeoCtub *shCylFr = new TGeoCtub(0, kConeTubeRmin,
3070 0.5*kHorizTubeLen, 0, 360,
3071 0, 0, -1,
3072 0, SinD(angrot/2), CosD(angrot/2));
3073
3074 TGeoVolume *volCylFr = new TGeoVolume("ITSSPDCoolingFreonOnCyl",
3075 shCylFr, medFreon);
3076 volCylFr->SetLineColor(kPurple);
3077
3078 TGeoVolume *volCylGasFr = new TGeoVolume("ITSSPDCoolingFreonGasOnCyl",
3079 shCylFr, medGas);
3080 volCylGasFr->SetLineColor(kPurple);
3081
3082 // Now place everything in the containers
3083 volTubeA->AddNode(volGasFr, 1, 0);
3084 volTubeC->AddNode(volFreon, 1, 0);
3085
3086 volCylTubA->AddNode(volCylGasFr, 1, 0);
3087 volCylTubC->AddNode(volCylFr , 1, 0);
3088
3089 container[0]->AddNode(volCable, 1, 0);
3090
3091 xloc = shMCMExt->GetDX();
3092 zloc = shMCMExt->GetDZ();
3093 container[0]->AddNode(volMCMExt, 1,
3094 new TGeoTranslation( xloc, 0.,-zloc));
3095
3096 xloc = shMCMExt->GetDX();
3097 zloc = shCable->GetZ(1)/2 - shMCMExt->GetDZ();
3098 container[0]->AddNode(volPlate, 1,
3099 new TGeoTranslation( xloc, 0., zloc));
3100
3101 xloc = shTube->GetRmax();
3102 yloc = shTube->GetRmax();
3103 zloc = shTube->GetDz() - shTube->GetRmax() - kYtoHalfStave;
3104 container[1]->AddNode(volTubeA, 1,
3105 new TGeoTranslation(-xloc, -yloc, zloc));
3106 container[2]->AddNode(volTubeC, 1,
3107 new TGeoTranslation(-xloc, -yloc, zloc));
3108
3109 xloc = shTube->GetRmax();
3110 yloc = (shCylTub->GetDz())*SinD(angrot) - shTube->GetRmax();
3111 zloc = (shCylTub->GetDz())*CosD(angrot) + shTube->GetRmax() +kYtoHalfStave;
3112 container[1]->AddNode(volCylTubA, 1,
3113 new TGeoCombiTrans(-xloc, yloc,-zloc,
3114 new TGeoRotation("",0.,angrot,0.)));
3115 container[2]->AddNode(volCylTubC, 1,
3116 new TGeoCombiTrans(-xloc, yloc,-zloc,
3117 new TGeoRotation("",0.,angrot,0.)));
3118
3119 // Finally create the list of assemblies and return it to the caller
0b9c8a10 3120 TList* conemodulelist = new TList();
0b9c8a10 3121 conemodulelist->Add(container[0]);
3122 conemodulelist->Add(container[1]);
96eb8210 3123 conemodulelist->Add(container[2]);
d0048cec 3124
0b9c8a10 3125 return conemodulelist;
7f69c251 3126}
3127
3128//______________________________________________________________________
3129void AliITSv11GeometrySPD::CreateCones(TGeoVolume *moth) const
3130{
96eb8210 3131 //
3132 // Places all services modules in the mother reference system
3133 //
3134 // Created: ?? ??? 2008 Alberto Pulvirenti
3135 // Updated: 03 May 2010 Mario Sitta
3136 //
d0048cec 3137
96eb8210 3138 const Int_t kNumberOfModules = 10;
3139
3140 const Double_t kInnerRadius = 80.775*fgkmm;
3141 const Double_t kZTrans = 452.000*fgkmm;
3142 const Double_t kAlphaRot = 46.500*fgkDegree;
3143 const Double_t kAlphaSpaceCool = 8.500*fgkDegree;
3144
3145 TList* modulelist = CreateConeModule(90-kAlphaRot);
0b9c8a10 3146 TGeoVolumeAssembly* module;
d0048cec 3147
96eb8210 3148 Double_t xloc, yloc, zloc;
3149
7f69c251 3150 //Double_t angle[10] = {18., 54., 90., 126., 162., -18., -54., -90., -126., -162.};
0b9c8a10 3151 // angleNm for cone modules (cables), angleNc for cooling tubes
96eb8210 3152 Double_t anglem[10] = {18., 54., 90., 126., 162., 198., 234., 270., 306., 342.};
3153// Double_t angle1m[10] = {23., 53., 90., 127., 157., 203.0, 233.0, 270.0, 307.0, 337.0};
3154// Double_t angle2m[10] = {18., 53., 90., 126., 162., 198.0, 233.0, 270.0, 309.0, 342.0};
3155// Double_t angle1c[10] = {23., 53., 90., 124., 157., 203.0, 233.0, 270.0, 304.0, 337.0};
3156// Double_t angle2c[10] = {18., 44., 90., 126., 162., 198.0, 223.0, 270.0, 309.0, 342.0};
0b9c8a10 3157
3158 // First add the cables
3159 module = (TGeoVolumeAssembly*)modulelist->At(0);
96eb8210 3160 for (Int_t i = 0; i < kNumberOfModules; i++) {
7f69c251 3161 TGeoRotation *rot1 = new TGeoRotation(*gGeoIdentity);
96eb8210 3162 rot1->RotateY(-kAlphaRot);
3163 rot1->RotateZ(anglem[i]);
3164 xloc = kInnerRadius*CosD(anglem[i]);
3165 yloc = kInnerRadius*SinD(anglem[i]);
3166 zloc = kZTrans;
3167 moth->AddNode(module, 2*i,
3168 new TGeoCombiTrans( xloc, yloc, zloc, rot1));
3169
7f69c251 3170 TGeoRotation *rot2 = new TGeoRotation(*gGeoIdentity);
96eb8210 3171 rot2->RotateY(180.-kAlphaRot);
3172 rot2->RotateZ(anglem[i]);
3173 xloc = kInnerRadius*CosD(anglem[i]);
3174 yloc = kInnerRadius*SinD(anglem[i]);
3175 zloc = kZTrans;
3176 moth->AddNode(module, 2*i+1,
3177 new TGeoCombiTrans(-xloc,-yloc,-zloc, rot2));
0b9c8a10 3178 }
3179
96eb8210 3180 // Then the cooling tubes on Side A
0b9c8a10 3181 module = (TGeoVolumeAssembly*)modulelist->At(1);
96eb8210 3182 Double_t anglec;
3183 for (Int_t i = 0; i < kNumberOfModules; i++) {
3184 anglec = anglem[i] + kAlphaSpaceCool;
0b9c8a10 3185 TGeoRotation *rot1 = new TGeoRotation(*gGeoIdentity);
96eb8210 3186 rot1->RotateX(-90.0+kAlphaRot);
3187 rot1->RotateZ(-90+anglec);
3188 xloc = kInnerRadius*CosD(anglec);
3189 yloc = kInnerRadius*SinD(anglec);
3190 zloc = kZTrans;
3191 moth->AddNode(module, 2*i,
3192 new TGeoCombiTrans( xloc, yloc, zloc, rot1));
3193 }
3194
3195 // Finally the cooling tubes on Side C
3196 module = (TGeoVolumeAssembly*)modulelist->At(2);
3197 for (Int_t i = 0; i < kNumberOfModules; i++) {
3198 anglec = anglem[i] - kAlphaSpaceCool;
0b9c8a10 3199 TGeoRotation *rot2 = new TGeoRotation(*gGeoIdentity);
96eb8210 3200 rot2->RotateX(-90.0+kAlphaRot);
3201 rot2->RotateY(180.);
3202 rot2->RotateZ(90.+anglec);
3203 xloc = kInnerRadius*CosD(anglec);
3204 yloc = kInnerRadius*SinD(anglec);
3205 zloc = kZTrans;
3206 moth->AddNode(module, 2*i+1,
3207 new TGeoCombiTrans(-xloc,-yloc,-zloc, rot2));
7f69c251 3208 }
96eb8210 3209
7f69c251 3210}
3211
54c9a3d9 3212//______________________________________________________________________
3213TGeoVolume* AliITSv11GeometrySPD::CreateExtender(
3214 const Double_t *extenderParams, const TGeoMedium *extenderMedium,
3215 TArrayD& sizes) const
bc3498f4 3216{
54c9a3d9 3217 //
3218 // ------------------ CREATE AN EXTENDER ------------------------
3219 //
3220 // This function creates the following picture (in plane xOy)
3221 // Should be useful for the definition of the pixel bus and MCM extenders
d0048cec 3222 // The origin corresponds to point 0 on the picture, at half-width
3223 // in Z direction
54c9a3d9 3224 //
3225 // Y 7 6 5
3226 // ^ +---+---------------------+
3227 // | / |
3228 // | / |
3229 // 0------> X / +---------------------+
3230 // / / 3 4
3231 // / /
3232 // 9 8 / /
3233 // +-----------+ /
3234 // | /
3235 // | /
3236 // ---> +-----------+---+
3237 // | 0 1 2
3238 // |
3239 // origin (0,0,0)
3240 //
3241 //
3242 // Takes 6 parameters in the following order :
3243 // |--> par 0 : inner length [0-1] / [9-8]
3244 // |--> par 1 : thickness ( = [0-9] / [4-5])
3245 // |--> par 2 : angle of the slope
3246 // |--> par 3 : total height in local Y direction
3247 // |--> par 4 : outer length [3-4] / [6-5]
3248 // |--> par 5 : width in local Z direction
3249 //
d0048cec 3250 Double_t slopeDeltaX = (extenderParams[3] - extenderParams[1]
3251 * TMath::Cos(extenderParams[2])) /
54c9a3d9 3252 TMath::Tan(extenderParams[2]);
3253 Double_t extenderXtruX[10] = {
3254 0 ,
3255 extenderParams[0] ,
d0048cec 3256 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2]) ,
54c9a3d9 3257 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
3258 slopeDeltaX ,
3259 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
d0048cec 3260 slopeDeltaX + extenderParams[4],
54c9a3d9 3261 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
d0048cec 3262 slopeDeltaX + extenderParams[4],
54c9a3d9 3263 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
d0048cec 3264 slopeDeltaX ,
54c9a3d9 3265 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
3266 slopeDeltaX - extenderParams[1] * TMath::Sin(extenderParams[2]) ,
3267 extenderParams[0] ,
3268 0
3269 };
3270 Double_t extenderXtruY[10] = {
3271 0 ,
3272 0 ,
3273 extenderParams[1] * (1-TMath::Cos(extenderParams[2])) ,
3274 extenderParams[3] - extenderParams[1] ,
3275 extenderParams[3] - extenderParams[1] ,
3276 extenderParams[3] ,
3277 extenderParams[3] ,
3278 extenderParams[3]-extenderParams[1]*(1-TMath::Cos(extenderParams[2])) ,
3279 extenderParams[1] ,
3280 extenderParams[1]
3281 };
592651e2 3282
54c9a3d9 3283 if (sizes.GetSize() != 3) sizes.Set(3);
3284 Double_t &thickness = sizes[0];
3285 Double_t &length = sizes[1];
3286 Double_t &width = sizes[2];
3287
3288 thickness = extenderParams[3];
3289 width = extenderParams[5];
3290 length = extenderParams[0]+extenderParams[1]*
3291 TMath::Sin(extenderParams[2])+slopeDeltaX+extenderParams[4];
3292
3293 // creation of the volume
3294 TGeoXtru *extenderXtru = new TGeoXtru(2);
3295 TGeoVolume *extenderXtruVol = new TGeoVolume("ITSSPDextender",extenderXtru,
3296 extenderMedium);
3297 extenderXtru->DefinePolygon(10,extenderXtruX,extenderXtruY);
3298 extenderXtru->DefineSection(0,-0.5*extenderParams[4]);
3299 extenderXtru->DefineSection(1, 0.5*extenderParams[4]);
3300 return extenderXtruVol;
3301}
bc3498f4 3302//______________________________________________________________________
3303TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBusAndExtensions
3304(Bool_t /*zpos*/, TGeoManager *mgr) const
3305{
54c9a3d9 3306 //
3307 // Creates an assembly which contains the pixel bus and its extension
3308 // and the extension of the MCM.
3309 // By: Renaud Vernet
d0048cec 3310 // NOTE: to be defined its material and its extension in the outside
54c9a3d9 3311 // direction
3312 //
3313 // ==== constants =====
3314 //get the media
3315 // PIXEL BUS
3316 //TGeoMedium *medPixelBus = GetMedium("SPDBUS(AL+KPT+EPOX)$",mgr);
3317 // IXEL BUS EXTENDER
3318 TGeoMedium *medPBExtender = GetMedium("SDDKAPTON (POLYCH2)$",mgr);
3319 //MCM EXTENDER
3320 TGeoMedium *medMCMExtender = GetMedium("SDDKAPTON (POLYCH2)$",mgr);
3321 // //geometrical constants
3322 const Double_t kPbextenderThickness = 0.07 * fgkmm;
3323 //design=?? 70 deg. seems OK
3324 const Double_t kPbExtenderSlopeAngle = 70.0 * TMath::Pi()/180.;
3325 // = 2.6 - (0.28+0.05+0.35) cf design
3326 const Double_t kPbExtenderHeight = 1.92 * fgkmm;
3327 const Double_t kPbExtenderWidthY = 11.0 * fgkmm;
3328 //design=?? 70 deg. seems OK
3329 const Double_t kMcmExtenderSlopeAngle = 70.0 * TMath::Pi()/180.;
3330 const Double_t kMcmExtenderThickness = 0.10 * fgkmm;
3331 const Double_t kMcmExtenderHeight = 1.8 * fgkmm;
3332 const Double_t kMcmExtenderWidthY = kPbExtenderWidthY;
3333 // const Double_t groundingThickness = 0.07 * fgkmm;
3334 // const Double_t grounding2pixelBusDz = 0.625 * fgkmm;
3335 // const Double_t pixelBusThickness = 0.28 * fgkmm;
3336 // const Double_t groundingWidthX = 170.501 * fgkmm;
3337 // const Double_t pixelBusContactDx = 1.099 * fgkmm;
3338 // const Double_t pixelBusWidthY = 13.8 * fgkmm;
3339 //design=20 deg.
3340 // const Double_t pixelBusContactPhi = 20.0 * TMath::Pi()/180.
3341 // const Double_t pbExtenderTopZ = 2.72 * fgkmm;
3342 // const Double_t mcmThickness = 0.35 * fgkmm;
3343 // const Double_t halfStaveTotalLength = 247.64 * fgkmm;
3344 // const Double_t deltaYOrigin = 15.95/2.* fgkmm;
3345 // const Double_t deltaXOrigin = 1.1 * fgkmm;
3346 // const Double_t deltaZOrigin = halfStaveTotalLength / 2.;
3347 // const Double_t grounding2pixelBusDz2 = grounding2pixelBusDz+
3348 // groundingThickness/2. + pixelBusThickness/2.;
3349 // const Double_t pixelBusWidthX = groundingWidthX;
3350 // const Double_t pixelBusRaiseLength = (pixelBusContactDx-
3351 // pixelBusThickness*TMath::Sin(pixelBusContactPhi))/
3352 // TMath::Cos(pixelBusContactPhi);
3353 // const Double_t pbExtenderBaseZ = grounding2pixelBusDz2 +
3354 // pixelBusRaiseLength*TMath::Sin(pixelBusContactPhi) +
3355 // 2*pixelBusThickness*TMath::Sin(pixelBusContactPhi)*
3356 // TMath::Tan(pixelBusContactPhi);
3357 // const Double_t pbExtenderDeltaZ = pbExtenderTopZ-pbExtenderBaseZ;
d0048cec 3358 // const Double_t pbExtenderEndPointX = 2*deltaZOrigin -
54c9a3d9 3359 // groundingWidthX - 2*pixelBusThickness*TMath::Sin(pixelBusContactPhi);
3360 // const Double_t pbExtenderXtru3L = 1.5 * fgkmm; //arbitrary ?
d0048cec 3361 // const Double_t pbExtenderXtru4L = (pbExtenderDeltaZ +
54c9a3d9 3362 // pixelBusThickness*(TMath::Cos(extenderSlope)-2))/
3363 // TMath::Sin(extenderSlope);
3364 // const Double_t kMcmExtenderEndPointX = deltaZOrigin - 48.2 * fgkmm;
3365 // const Double_t kMcmExtenderXtru3L = 1.5 * fgkmm;
3366 // //===== end constants =====
3367 const Double_t kPbExtenderInnerLength = 10. * fgkmm;
3368 const Double_t kPbExtenderOuterLength = 15. * fgkmm;
3369 const Double_t kMcmExtenderInnerLength = 10. * fgkmm;
3370 const Double_t kMcmExtenderOuterLength = 15. * fgkmm;
3371 Double_t pbExtenderParams[6] = {kPbExtenderInnerLength, //0
3372 kPbextenderThickness, //1
3373 kPbExtenderSlopeAngle, //2
3374 kPbExtenderHeight, //3
3375 kPbExtenderOuterLength, //4
3376 kPbExtenderWidthY}; //5
d0048cec 3377
54c9a3d9 3378 Double_t mcmExtenderParams[6] = {kMcmExtenderInnerLength, //0
3379 kMcmExtenderThickness, //1
3380 kMcmExtenderSlopeAngle, //2
3381 kMcmExtenderHeight, //3
3382 kMcmExtenderOuterLength, //4
3383 kMcmExtenderWidthY}; //5
d0048cec 3384
54c9a3d9 3385 TArrayD sizes(3);
3386 TGeoVolume* pbExtender = CreateExtender(pbExtenderParams,medPBExtender,
3387 sizes);
3388 if(GetDebug(1))printf("CREATED AN EXTENDER : THICKNESS = %5.5f cm\t"
3389 "LENGTH=%5.5f cm\tWIDTH=%5.5f cm\n",sizes[0],sizes[1],sizes[2]);
3390 TGeoVolume* mcmExtender = CreateExtender(mcmExtenderParams,medMCMExtender,
3391 sizes);
3392 if(GetDebug(1))printf("CREATED AN EXTENDER : THICKNESS = %5.5f cm\t"
3393 "LENGTH=%5.5f cm\tWIDTH=%5.5f cm\n",sizes[0],sizes[1],sizes[2]);
3394 // Double_t pixelBusValues[5] = {pixelBusWidthX, //0
3395 // pixelBusThickness, //1
3396 // pixelBusContactPhi, //2
3397 // pixelBusRaiseLength, //3
3398 // pixelBusWidthY}; //4
d0048cec 3399
54c9a3d9 3400 // Double_t pbExtenderValues[8] = {pixelBusRaiseLength, //0
3401 // pixelBusContactPhi, //1
3402 // pbExtenderXtru3L, //2
3403 // pixelBusThickness, //3
3404 // extenderSlope, //4
3405 // pbExtenderXtru4L, //5
3406 // pbExtenderEndPointX, //6
3407 // kPbExtenderWidthY}; //7
d0048cec 3408
54c9a3d9 3409 // Double_t mcmExtenderValues[6] = {mcmExtenderXtru3L, //0
3410 // mcmExtenderThickness, //1
3411 // extenderSlope, //2
3412 // deltaMcmMcmExtender, //3
3413 // mcmExtenderEndPointX, //4
3414 // mcmExtenderWidthY}; //5
3415 // TGeoVolumeAssembly *pixelBus=new TGeoVolumeAssembly("ITSSPDpixelBus");
d0048cec 3416 // CreatePixelBus(pixelBus,pixelBusValues,medPixelBus);
54c9a3d9 3417 // TGeoVolumeAssembly *pbExtender = new TGeoVolumeAssembly(
3418 // "ITSSPDpixelBusExtender");
3419 // CreatePixelBusExtender(pbExtender,pbExtenderValues,medPBExtender);
3420 // TGeoVolumeAssembly *mcmExtender = new TGeoVolumeAssembly(
3421 // "ITSSPDmcmExtender");
3422 // CreateMCMExtender(mcmExtender,mcmExtenderValues,medMCMExtender);
3423 //-------------- DEFINITION OF GEOMETRICAL TRANSFORMATIONS --------
3424 // TGeoRotation * commonRot = new TGeoRotation("commonRot",0,90,0);
3425 // commonRot->MultiplyBy(new TGeoRotation("rot",-90,0,0));
3426 // TGeoTranslation * pixelBusTrans = new TGeoTranslation(
3427 // pixelBusThickness/2. - deltaXOrigin + 0.52*fgkmm ,
d0048cec 3428 // -pixelBusWidthY/2. + deltaYOrigin ,
54c9a3d9 3429 // -groundingWidthX/2. + deltaZOrigin);
3430 // TGeoRotation *pixelBusRot = new TGeoRotation(*commonRot);
3431 // TGeoTranslation *pbExtenderTrans =new TGeoTranslation(*pixelBusTrans);
3432 // TGeoRotation *pbExtenderRot = new TGeoRotation(*pixelBusRot);
3433 // pbExtenderTrans->SetDz(*(pbExtenderTrans->GetTranslation()+2) -
3434 // pixelBusWidthX/2. - 2*pixelBusThickness*
d0048cec 3435 // TMath::Sin(pixelBusContactPhi));
54c9a3d9 3436 // if (!zpos) {
3437 // pbExtenderTrans->SetDy(*(pbExtenderTrans->GetTranslation()+1) -
3438 // (pixelBusWidthY - kPbExtenderWidthY)/2.);
3439 // } else {
3440 // pbExtenderTrans->SetDy(*(pbExtenderTrans->GetTranslation()+1) +
3441 // (pixelBusWidthY - kPbExtenderWidthY)/2.);
3442 // }
3443 // pbExtenderTrans->SetDx(*(pbExtenderTrans->GetTranslation()) +
3444 // pixelBusThickness/2 + 2*pixelBusThickness*
3445 // TMath::Sin(pixelBusContactPhi)*
3446 // TMath::Tan(pixelBusContactPhi));
3447 // TGeoTranslation * mcmExtenderTrans = new TGeoTranslation(0.12*fgkmm +
3448 // mcmThickness - deltaXOrigin,
3449 // pbExtenderTrans->GetTranslation()[1],
3450 // -4.82);
3451 // TGeoRotation * mcmExtenderRot = new TGeoRotation(*pbExtenderRot);
3452 // // add pt1000 components
3453 // Double_t pt1000Z = fgkmm * 64400. * 1E-4;
d0048cec 3454 // //Double_t pt1000X[10] = {319700., 459700., 599700., 739700.,
54c9a3d9 3455 // 879700., 1029700., 1169700., 1309700.,
3456 // 1449700., 1589700.};
3457 // Double_t pt1000X[10] ={66160., 206200., 346200., 486200., 626200.,
3458 // 776200., 916200., 1056200., 1196200., 1336200.};
3459 // Double_t pt1000size[3] = {fgkmm*1.5, fgkmm*0.6, fgkmm*3.1};
3460 // Int_t i;
3461 // for (i = 0; i < 10; i++) {
3462 // pt1000X[i] *= fgkmm * 1E-4;
3463 // }
3464 // TGeoVolume *pt1000 = mgr->MakeBox("ITSSPDpt1000",0,0.5*pt1000size[0],
3465 // 0.5*pt1000size[1], 0.5*pt1000size[2]);
3466 // pt1000->SetLineColor(kGray);
3467 // Double_t refThickness = - pixelBusThickness;
3468 // for (i = 0; i < 10; i++) {
3469 // TGeoTranslation *tr = new TGeoTranslation(pt1000X[i]-
3470 // 0.5*pixelBusWidthX, 0.002+0.5*(-3.*refThickness+pt1000size[3]),
3471 // pt1000Z -0.5*pixelBusWidthY);
3472 // pixelBus->AddNode(pt1000, i+1, tr);
3473 // }
d0048cec 3474
54c9a3d9 3475 //CREATE FINAL VOLUME ASSEMBLY AND ROTATE IT
3476 TGeoVolumeAssembly *assembly = new TGeoVolumeAssembly("ITSSPDextenders");
3477 // assembly->AddNode((TGeoVolume*)pixelBus,1,
3478 // new TGeoCombiTrans(*pixelBusTrans,*pixelBusRot));
3479 // assembly->AddNode((TGeoVolume*)pbExtender,1,
3480 // new TGeoCombiTrans(*pbExtenderTrans,*pbExtenderRot));
3481 // assembly->AddNode((TGeoVolume*)mcmExtender,1,
3482 // new TGeoCombiTrans(*mcmExtenderTrans,*mcmExtenderRot));
3483 // assembly->AddNode(mcmExtender,1,new TGeoIdentity());
3484 assembly->AddNode(pbExtender,1);
3485 assembly->AddNode(mcmExtender,1);
3486 // assembly->SetTransparency(50);
d0048cec 3487
54c9a3d9 3488 return assembly;
592651e2 3489}
54c9a3d9 3490//______________________________________________________________________
3491TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateHalfStave(Bool_t isRight,
3492Int_t layer,Int_t idxCentral,Int_t idxSide,TArrayD &sizes,TGeoManager *mgr)
bc3498f4 3493{
54c9a3d9 3494 //
d0048cec 3495 // Implementation of an half-stave, which depends on the side where
3496 // we are on the stave. The convention for "left" and "right" is the
3497 // same as for the MCM. The return value is a TGeoAssembly which is
3498 // structured in such a way that the origin of its local reference
54c9a3d9 3499 // frame coincides with the origin of the whole stave.
3500 // The TArrayD passed by reference will contain details of the shape:
3501 // - sizes[0] = thickness
3502 // - sizes[1] = length
3503 // - sizes[2] = width
3504 // - sizes[3] = common 'x' position for eventual clips
3505 // - sizes[4] = common 'y' position for eventual clips
3506 // - sizes[5] = 'z' position of first clip
3507 // - sizes[6] = 'z' position of second clip
3508 //
3509
3510 // ** CHECK **
3511
3512 // idxCentral and idxSide must be different
3513 if (idxCentral == idxSide) {
3514 AliInfo("Ladders must be inserted in half-stave with "
3515 "different indexes.");
3516 idxSide = idxCentral + 1;
3517 AliInfo(Form("Central ladder will be inserted with index %d",
3518 idxCentral));
3519 AliInfo(Form("Side ladder will be inserted with index %d",idxSide));
3520 } // end if
3521
3522 // define the separations along Z direction between the objects
3523 Double_t sepLadderLadder = fgkmm * 0.2; // sep. btw the 2 ladders
d0048cec 3524 Double_t sepLadderCenter = fgkmm * 0.4; // sep. btw the "central" ladder
54c9a3d9 3525 // and the Z=0 plane in stave ref.
3526 Double_t sepLadderMCM = fgkmm * 0.3; // sep. btw the "external" ladder
3527 // and MCM
d0048cec 3528 Double_t sepBusCenter = fgkmm * 0.3; // sep. btw the bus central edge
54c9a3d9 3529 // and the Z=0 plane in stave ref.
3530
3531 // ** VOLUMES **
3532
3533 // grounding foil
3534 TArrayD grndSize(3);
3535 // This one line repalces the 3 bellow, BNS.
3536 TGeoVolume *grndVol = CreateGroundingFoil(isRight, grndSize, mgr);
3537 Double_t &grndThickness = grndSize[0];
3538 Double_t &grndLength = grndSize[1];
3539
3540 // ladder
3541 TArrayD ladderSize(3);
3542 TGeoVolume *ladder = CreateLadder(layer, ladderSize, mgr);
3543 Double_t ladderThickness = ladderSize[0];
3544 Double_t ladderLength = ladderSize[1];
3545 Double_t ladderWidth = ladderSize[2];
3546
3547 // MCM
3548 TArrayD mcmSize(3);
3549 TGeoVolumeAssembly *mcm = CreateMCM(!isRight,mcmSize,mgr);
3550 Double_t mcmThickness = mcmSize[0];
3551 Double_t mcmLength = mcmSize[1];
3552 Double_t mcmWidth = mcmSize[2];
d0048cec 3553
54c9a3d9 3554 // bus
3555 TArrayD busSize(6);
22726349 3556 TGeoVolumeAssembly *bus = CreatePixelBus(isRight, layer, busSize, mgr);
54c9a3d9 3557 Double_t busThickness = busSize[0];
3558 Double_t busLength = busSize[1];
3559 Double_t busWidth = busSize[2];
3560
3561 // glue between ladders and pixel bus
3562 TGeoMedium *medLadGlue = GetMedium("EPOXY$", mgr);
3563 Double_t ladGlueThickness = fgkmm * 0.1175 - fgkGapLadder;
3564 TGeoVolume *ladderGlue = mgr->MakeBox("ITSSPDladderGlue",medLadGlue,
3565 0.5*ladGlueThickness, 0.5*busWidth, 0.5*busLength);
3566 ladderGlue->SetLineColor(kYellow + 5);
3567
3568 // create references for the whole object, as usual
3569 sizes.Set(7);
3570 Double_t &fullThickness = sizes[0];
3571 Double_t &fullLength = sizes[1];
3572 Double_t &fullWidth = sizes[2];
d0048cec 3573
54c9a3d9 3574 // compute the full size of the container
3575 fullLength = sepLadderCenter+2.0*ladderLength+sepLadderMCM+
3576 sepLadderLadder+mcmLength;
3577 fullWidth = ladderWidth;
3578 fullThickness = grndThickness + fgkGapLadder + mcmThickness + busThickness;
ed0e944d 3579 //cout << "HSTAVE FULL THICKNESS = " << fullThickness << endl;
54c9a3d9 3580
3581 // ** MOVEMENTS **
3582
3583 // grounding foil (shifted only along thickness)
3584 Double_t xGrnd = -0.5*fullThickness + 0.5*grndThickness;
3585 Double_t zGrnd = -0.5*grndLength;
3586 if (!isRight) zGrnd = -zGrnd;
3587 TGeoTranslation *grndTrans = new TGeoTranslation(xGrnd, 0.0, zGrnd);
3588
3589 // ladders (translations along thickness and length)
d0048cec 3590 // layers must be sorted going from the one at largest Z to the
54c9a3d9 3591 // one at smallest Z:
3592 // -|Zmax| ------> |Zmax|
3593 // 3 2 1 0
d0048cec 3594 // then, for layer 1 ladders they must be placed exactly this way,
3595 // and in layer 2 at the opposite. In order to remember the placements,
3596 // we define as "inner" and "outer" ladder respectively the one close
54c9a3d9 3597 // to barrel center, and the one closer to MCM, respectively.
3598 Double_t xLad, zLadIn, zLadOut;
3599 xLad = xGrnd + 0.5*(grndThickness + ladderThickness) +
3600 0.01175 - fgkGapLadder;
3601 zLadIn = -sepLadderCenter - 0.5*ladderLength;
3602 zLadOut = zLadIn - sepLadderLadder - ladderLength;
3603 if (!isRight) {
3604 zLadIn = -zLadIn;
3605 zLadOut = -zLadOut;
3606 } // end if !isRight
3607 TGeoRotation *rotLad = new TGeoRotation(*gGeoIdentity);
3608 rotLad->RotateZ(90.0);
3609 rotLad->RotateY(180.0);
3610 Double_t sensWidth = fgkmm * 12.800;
3611 Double_t chipWidth = fgkmm * 15.950;
3612 Double_t guardRingWidth = fgkmm * 0.560;
3613 Double_t ladderShift = 0.5 * (chipWidth - sensWidth - 2.0*guardRingWidth);
3614 TGeoCombiTrans *trLadIn = new TGeoCombiTrans(xLad,ladderShift,zLadIn,
3615 rotLad);
3616 TGeoCombiTrans *trLadOut = new TGeoCombiTrans(xLad,ladderShift,zLadOut,
3617 rotLad);
3618
d0048cec 3619 // MCM (length and thickness direction, placing at same level as the
3620 // ladder, which implies to recompute the position of center, because
3621 // ladder and MCM have NOT the same thickness) the two copies of the
54c9a3d9 3622 // MCM are placed at the same distance from the center, on both sides
d0048cec 3623 Double_t xMCM = xGrnd + 0.5*grndThickness + 0.5*mcmThickness +
54c9a3d9 3624 0.01175 - fgkGapLadder;
3625 Double_t yMCM = 0.5*(fullWidth - mcmWidth);
3626 Double_t zMCM = zLadOut - 0.5*ladderLength - 0.5*mcmLength - sepLadderMCM;
d0048cec 3627 if (!isRight) zMCM = zLadOut + 0.5*ladderLength + 0.5*mcmLength +
54c9a3d9 3628 sepLadderMCM;
3629
3630 // create the correction rotations
3631 TGeoRotation *rotMCM = new TGeoRotation(*gGeoIdentity);
3632 rotMCM->RotateY(90.0);
3633 TGeoCombiTrans *trMCM = new TGeoCombiTrans(xMCM, yMCM, zMCM, rotMCM);
3634
3635 // glue between ladders and pixel bus
d0048cec 3636 Double_t xLadGlue = xLad + 0.5*ladderThickness + 0.01175 -
54c9a3d9 3637 fgkGapLadder + 0.5*ladGlueThickness;
3638
3639 // bus (length and thickness direction)
3640 Double_t xBus = xLadGlue + 0.5*ladGlueThickness + 0.5*busThickness;
7708d5f3 3641 Double_t yBus = 0.5*(fullWidth - busWidth) + 0.075; // Hardcode fix of a small overlap
54c9a3d9 3642 Double_t zBus = -0.5*busLength - sepBusCenter;
3643 if (!isRight) zBus = -zBus;
3644 TGeoTranslation *trBus = new TGeoTranslation(xBus, yBus, zBus);
3645
3646 TGeoTranslation *trLadGlue = new TGeoTranslation(xLadGlue, 0.0, zBus);
3647
3648 // create the container
3649 TGeoVolumeAssembly *container = 0;
3650 if (idxCentral+idxSide==5) {
3651 container = new TGeoVolumeAssembly("ITSSPDhalf-Stave1");
3652 } else {
3653 container = new TGeoVolumeAssembly("ITSSPDhalf-Stave0");
3654 } // end if
3655
3656 // add to container all objects
3657 container->AddNode(grndVol, 1, grndTrans);
3658 // ladders are inserted in different order to respect numbering scheme
3659 // which is inverted when going from outer to inner layer
3660 container->AddNode(ladder, idxCentral+1, trLadIn);
3661 container->AddNode(ladder, idxSide+1, trLadOut);
3662 container->AddNode(ladderGlue, 1, trLadGlue);
3663 container->AddNode(mcm, 1, trMCM);
3664 container->AddNode(bus, 1, trBus);
3665
3666 // since the clips are placed in correspondence of two pt1000s,
3667 // their position is computed here, but they are not added by default
3668 // it will be the StavesInSector method which will decide to add them
3669 // anyway, to recovery some size informations on the clip, it must be
3670 // created
3671 TArrayD clipSize;
3ffa185f 3672 // TGeoVolume *clipDummy = CreateClip(clipSize, kTRUE, mgr);
54c9a3d9 3673 CreateClip(clipSize, kTRUE, mgr);
3674 // define clip movements (width direction)
3675 sizes[3] = xBus + 0.5*busThickness;
3676 sizes[4] = 0.5 * (fullWidth - busWidth) - clipSize[6] - fgkmm*0.48;
3677 sizes[5] = zBus + busSize[4];
3678 sizes[6] = zBus + busSize[5];
3679
3680 return container;
592651e2 3681}
54c9a3d9 3682//______________________________________________________________________
3683TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateStave(Int_t layer,
3684 TArrayD &sizes, TGeoManager *mgr)
7855ea93 3685{
54c9a3d9 3686 //
3687 // This method uses all other ones which create pieces of the stave
3688 // and assemblies everything together, in order to return the whole
3689 // stave implementation, which is returned as a TGeoVolumeAssembly,
3690 // due to the presence of some parts which could generate fake overlaps
3691 // when put on the sector.
3692 // This assembly contains, going from bottom to top in the thickness
3693 // direction:
d0048cec 3694 // - the complete grounding foil, defined by the "CreateGroundingFoil"
3695 // method which already joins some glue and real groudning foil
54c9a3d9 3696 // layers for the whole stave (left + right);
d0048cec 3697 // - 4 ladders, which are sorted according to the ALICE numbering
54c9a3d9 3698 // scheme, which depends on the layer we are building this stave for;
3699 // - 2 MCMs (a left and a right one);
3700 // - 2 pixel buses (a left and a right one);
3701 // ---
3702 // Arguments:
d0048cec 3703 // - the layer number, which determines the displacement and naming
54c9a3d9 3704 // of sensitive volumes
d0048cec 3705 // - a TArrayD passed by reference which will contain the size
54c9a3d9 3706 // of virtual box containing the stave
3707 // - the TGeoManager
3708 //
3709
3710 // create the container
3711 TGeoVolumeAssembly *container = new TGeoVolumeAssembly(Form(
3712 "ITSSPDlay%d-Stave",layer));
3713 // define the indexes of the ladders in order to have the correct order
d0048cec 3714 // keeping in mind that the staves will be inserted as they are on layer
3715 // 2, while they are rotated around their local Y axis when inserted
3716 // on layer 1, so in this case they must be put in the "wrong" order
3717 // to turn out to be right at the end. The convention is:
54c9a3d9 3718 // -|Zmax| ------> |Zmax|
3719 // 3 2 1 0
d0048cec 3720 // with respect to the "native" stave reference frame, "left" is in
54c9a3d9 3721 // the positive Z this leads the definition of these indexes:
3722 Int_t idxCentralL, idxSideL, idxCentralR, idxSideR;
3723
3724 if (layer == 1) {
3725 idxSideL = 3;
3726 idxCentralL = 2;
3727 idxCentralR = 1;
3728 idxSideR = 0;
3729 } else {
3730 idxSideL = 0;
3731 idxCentralL = 1;
3732 idxCentralR = 2;
3733 idxSideR = 3;
3734 } // end if layer ==1
d0048cec 3735
54c9a3d9 3736 // create the two half-staves
3737 TArrayD sizeL, sizeR;
3738 TGeoVolumeAssembly *hstaveL = CreateHalfStave(kFALSE, layer, idxCentralL,
3739 idxSideL, sizeL,mgr);
3740 TGeoVolumeAssembly *hstaveR = CreateHalfStave(kTRUE, layer, idxCentralR,
3741 idxSideR, sizeR, mgr);
3742 // copy the size to the stave's one
3743 sizes.Set(9);
3744 sizes[0] = sizeL[0];
3745 sizes[1] = sizeR[1] + sizeL[1];
3746 sizes[2] = sizeL[2];
3747 sizes[3] = sizeL[3];
3748 sizes[4] = sizeL[4];
3749 sizes[5] = sizeL[5];
3750 sizes[6] = sizeL[6];
3751 sizes[7] = sizeR[5];
3752 sizes[8] = sizeR[6];
3753
3754 // add to container all objects
3755 container->AddNode(hstaveL, 1);
3756 container->AddNode(hstaveR, 1);
3757
3758 return container;
bc3498f4 3759}
54c9a3d9 3760//______________________________________________________________________
bc3498f4 3761void AliITSv11GeometrySPD::SetAddStave(Bool_t *mask)
3762{
54c9a3d9 3763 //
3764 // Define a mask which states qhich staves must be placed.
d0048cec 3765 // It is a string which must contain '0' or '1' depending if
54c9a3d9 3766 // a stave must be placed or not.
d0048cec 3767 // Each place is referred to one of the staves, so the first
54c9a3d9 3768 // six characters of the string will be checked.
3769 //
3770 Int_t i;
3771
3772 for (i = 0; i < 6; i++) fAddStave[i] = mask[i];
bc3498f4 3773}
54c9a3d9 3774//______________________________________________________________________
3775void AliITSv11GeometrySPD::StavesInSector(TGeoVolume *moth, TGeoManager *mgr)
3776{
3777 //
3778 // Unification of essentially two methods:
3779 // - the one which creates the sector structure
3780 // - the one which returns the complete stave
3781 // ---
3782 // For compatibility, this method requires the same arguments
3783 // asked by "CarbonFiberSector" method, which is recalled here.
3784 // Like this cited method, this one does not return any value,
3785 // but it inserts in the mother volume (argument 'moth') all the stuff
3786 // which composes the complete SPD sector.
3787 // ---
d0048cec 3788 // In the following, the stave numbering order used for arrays is the
54c9a3d9 3789 // same as defined in the GetSectorMountingPoints():
3790 // /5
3791 // /\/4
3792 // 1\ \/3
3793 // 0|___\/2
3794 // ---
3795 // Arguments: see description of "CarbonFiberSector" method.
3796 //
3797
d0048cec 3798 Double_t shift[6]; // shift from the innermost position in the
3799 // sector placement plane (where the stave
3800 // edge is in the point where the rounded
54c9a3d9 3801 // corner begins)
3802
3803 shift[0] = fgkmm * -0.691;
3804 shift[1] = fgkmm * 5.041;
3805 shift[2] = fgkmm * 1.816;
3806 shift[3] = fgkmm * -0.610;
3807 shift[4] = fgkmm * -0.610;
3808 shift[5] = fgkmm * -0.610;
d0048cec 3809
3ffa185f 3810 // corrections after interaction with Andrea and CAD
3811 Double_t corrX[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
3812 Double_t corrY[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
d0048cec 3813
3ffa185f 3814 corrX[0] = 0.0046;
3815 corrX[1] = -0.0041;
3816 corrX[2] = corrX[3] = corrX[4] = corrX[5] = -0.0016;
d0048cec 3817
3ffa185f 3818 corrY[0] = -0.0007;
3819 corrY[1] = -0.0009;
3820 corrY[2] = corrY[3] = corrY[4] = corrY[5] = -0.0003;
d0048cec 3821
3ffa185f 3822 corrX[0] += 0.00026;
3823 corrY[0] += -0.00080;
d0048cec 3824
3ffa185f 3825 corrX[1] += 0.00018;
3826 corrY[1] += -0.00086;
d0048cec 3827
3ffa185f 3828 corrX[2] += 0.00020;
3829 corrY[2] += -0.00062;
d0048cec 3830
3ffa185f 3831 corrX[3] += 0.00017;
3832 corrY[3] += -0.00076;
d0048cec 3833
3ffa185f 3834 corrX[4] += 0.00016;
3835 corrY[4] += -0.00096;
d0048cec 3836
3ffa185f 3837 corrX[5] += 0.00018;
3838 corrY[5] += -0.00107;
d0048cec 3839
54c9a3d9 3840 // create stave volumes (different for layer 1 and 2)
3841 TArrayD staveSizes1(9), staveSizes2(9), clipSize(5);
3842 Double_t &staveHeight = staveSizes1[2], &staveThickness = staveSizes1[0];
3843 TGeoVolume *stave1 = CreateStave(1, staveSizes1, mgr);
3844 TGeoVolume *stave2 = CreateStave(2, staveSizes2, mgr);
3845 TGeoVolume *clip = CreateClip(clipSize, kFALSE, mgr);
3846
3847 Double_t xL, yL; // leftmost edge of mounting point (XY projection)
3848 Double_t xR, yR; // rightmost edge of mounting point (XY projection)
3849 Double_t xM, yM; // middle point of the segment L-R
3850 Double_t dx, dy; // (xL - xR) and (yL - yR)
3851 Double_t widthLR; // width of the segment L-R
3852 Double_t angle; // stave rotation angle in degrees
d0048cec 3853 Double_t diffWidth; // difference between mounting plane width and
54c9a3d9 3854 // stave width (smaller)
3855 Double_t xPos, yPos; // final translation of the stave
3856 Double_t parMovement; // translation in the LR plane direction
d0048cec 3857
54c9a3d9 3858 staveThickness += fgkGapHalfStave;
d0048cec 3859
54c9a3d9 3860 // loop on staves
3861 Int_t i, iclip = 1;
3862 for (i = 0; i < 6; i++) {
3863 // in debug mode, if this stave is not required, it is skipped
3864 if (!fAddStave[i]) continue;
3865 // retrieve reference points
3866 GetSectorMountingPoints(i, xL, yL, xR, yR);
3867 xM = 0.5 * (xL + xR);
3868 yM = 0.5 * (yL + yR);
3869 dx = xL - xR;
3870 dy = yL - yR;
3871 angle = TMath::ATan2(dy, dx);
3872 widthLR = TMath::Sqrt(dx*dx + dy*dy);
3873 diffWidth = 0.5*(widthLR - staveHeight);
3874 // first, a movement along this plane must be done
3875 // by an amount equal to the width difference
3876 // and then the fixed shift must also be added
3877 parMovement = diffWidth + shift[i];
d0048cec 3878 // due to stave thickness, another movement must be done
54c9a3d9 3879 // in the direction normal to the mounting plane
d0048cec 3880 // which is computed using an internal method, in a reference
3881 // frame where the LR segment has its middle point in the origin
54c9a3d9 3882 // and axes parallel to the master reference frame
3883 if (i == 0) {
d0048cec 3884 ParallelPosition(-0.5*staveThickness, -parMovement, angle,
54c9a3d9 3885 xPos, yPos);
3886 } // end if i==0
3887 if (i == 1) {
d0048cec 3888 ParallelPosition( 0.5*staveThickness, -parMovement, angle,
54c9a3d9 3889 xPos, yPos);
3890 }else {
d0048cec 3891 ParallelPosition( 0.5*staveThickness, parMovement, angle,
54c9a3d9 3892 xPos, yPos);
3893 } // end if i==1
3894 // then we go into the true reference frame
3895 xPos += xM;
3896 yPos += yM;
3ffa185f 3897 xPos += corrX[i];
3898 yPos += corrY[i];
d0048cec 3899 // using the parameters found here, compute the
54c9a3d9 3900 // translation and rotation of this stave:
3901 TGeoRotation *rot = new TGeoRotation(*gGeoIdentity);
3902 if (i == 0 || i == 1) rot->RotateX(180.0);
3903 rot->RotateZ(90.0 + angle * TMath::RadToDeg());
3904 TGeoCombiTrans *trans = new TGeoCombiTrans(xPos, yPos, 0.0, rot);
3905 if (i == 0 || i == 1) {
3906 moth->AddNode(stave1, i+1, trans);
3907 }else {
3908 moth->AddNode(stave2, i - 1, trans);
3909 if (i != 2) {
3910 // except in the case of stave #2,
3911 // clips must be added, and this is done directly on the sector
3912 Int_t j;
4adcf390 3913 //TArrayD clipSize;
54c9a3d9 3914 TGeoRotation *rotClip = new TGeoRotation(*gGeoIdentity);
3915 rotClip->RotateZ(-90.0);
3916 rotClip->RotateX(180.0);
3917 Double_t x = staveSizes2[3] + fgkGapHalfStave;
3918 Double_t y = staveSizes2[4];
d0048cec 3919 Double_t z[4] = { staveSizes2[5], staveSizes2[6],
54c9a3d9 3920 staveSizes2[7], staveSizes2[8] };
3921 for (j = 0; j < 4; j++) {
3922 TGeoCombiTrans *trClip = new TGeoCombiTrans(x, y, z[j],
3923 rotClip);
3924 *trClip = *trans * *trClip;
3925 moth->AddNode(clip, iclip++, trClip);
3926 } // end for j
3927 } // end if i!=2
3928 } // end if i==0||i==1 else
3929 } // end for i
592651e2 3930}
54c9a3d9 3931//______________________________________________________________________
bc3498f4 3932void AliITSv11GeometrySPD::ParallelPosition(Double_t dist1, Double_t dist2,
54c9a3d9 3933 Double_t phi, Double_t &x, Double_t &y) const
3934{
3935 //
3936 // Performs the following steps:
d0048cec 3937 // 1 - finds a straight line parallel to the one passing through
54c9a3d9 3938 // the origin and with angle 'phi' with X axis(phi in RADIANS);
d0048cec 3939 // 2 - finds another line parallel to the previous one, with a
54c9a3d9 3940 // distance 'dist1' from it
d0048cec 3941 // 3 - takes a reference point in the second line in the intersection
54c9a3d9 3942 // between the normal to both lines passing through the origin
d0048cec 3943 // 4 - finds a point whith has distance 'dist2' from this reference,
54c9a3d9 3944 // in the second line (point 2)
3945 // ----
d0048cec 3946 // According to the signs given to dist1 and dist2, the point is
54c9a3d9 3947 // found in different position w.r. to the origin
3948 // compute the point
3949 //
3950 Double_t cs = TMath::Cos(phi);
3951 Double_t sn = TMath::Sin(phi);
3952
3953 x = dist2*cs - dist1*sn;
3954 y = dist1*cs + dist2*sn;
592651e2 3955}
54c9a3d9 3956//______________________________________________________________________
3957Double_t AliITSv11GeometrySPD::GetSPDSectorTranslation(
3958 Double_t x0,Double_t y0,Double_t x1,Double_t y1,Double_t r) const
3959{
3960 //
3961 // Comutes the radial translation of a sector to give the
3962 // proper distance between SPD detectors and the beam pipe.
3963 // Units in are units out.
3964 //
3965
3966 //Begin_Html
3967 /*
3968 <A HREF="http://www.physics.ohio-state.edu/HIRG/SoftWareDoc/SPD_Sector_Position.png">
3969 Figure showing the geometry used in the computation below. </A>
3970 */
3971 //End_Html
3972
3973 // Inputs:
3974 // Double_t x0 Point x0 on Sector surface for the inner
3975 // most detector mounting
3976 // Double_t y0 Point y0 on Sector surface for the innor
3977 // most detector mounting
3978 // Double_t x1 Point x1 on Sector surface for the inner
3979 // most detector mounting
3980 // Double_t y1 Point y1 on Sector surface for the innor
3981 // most detector mounting
3982 // Double_t r The radial distance this mounting surface
3983 // should be from the center of the beam pipe.
3984 // Outputs:
3985 // none.
3986 // Return:
3987 // The distance the SPD sector should be displaced radialy.
3988 //
3989 Double_t a,b,c;
3990
3991 a = x0-x1;
3992 if(a==0.0) return 0.0;
3993 a = (y0-y1)/a;
3994 b = TMath::Sqrt(1.0+a*a);
3995 c = y0-a*x0-r*b;
3996 return -c;
3997}
3998//______________________________________________________________________
bc3498f4 3999void AliITSv11GeometrySPD::CreateFigure0(const Char_t *filepath,
4000 const Char_t *type,
54c9a3d9 4001 TGeoManager *mgr) const
4002{
4003 //
bc3498f4 4004 // Creates Figure 0 for the documentation of this class. In this
4005 // specific case, it creates the X,Y cross section of the SPD suport
4006 // section, center and ends. The output is written to a standard
4007 // file name to the path specificed.
4008 // Inputs:
4009 // const Char_t *filepath Path where the figure is to be drawn
4010 // const Char_t *type The type of file, default is gif.
4011 // TGeoManager *mgr The TGeoManager default gGeoManager
4012 // Output:
4013 // none.
4014 // Return:
4015 // none.
54c9a3d9 4016 //
bc3498f4 4017 TGeoXtru *sA0,*sA1,*sB0,*sB1;
4018 //TPolyMarker *pmA,*pmB;
4019 TPolyLine plA0,plA1,plB0,plB1;
4020 TCanvas *canvas;
4021 TLatex txt;
4022 Double_t x=0.0,y=0.0;
4023 Int_t i,kNRadii=6;
4024
4025 if(strcmp(filepath,"")){
4026 Error("CreateFigure0","filepath=%s type=%s",filepath,type);
4027 } // end if
4028 //
54c9a3d9 4029 sA0 = (TGeoXtru*) mgr->GetVolume("ITSSPDCarbonFiberSupportSectorA0_1")->
4030 GetShape();
4031 sA1 = (TGeoXtru*) mgr->GetVolume("ITSSPDCarbonFiberSupportSectorAirA1_1")->
4032 GetShape();
4033 sB0 = (TGeoXtru*) mgr->GetVolume("ITSSPDCarbonFiberSupportSectorEndB0_1")->
4034 GetShape();
4035 sB1 = (TGeoXtru*) mgr->GetVolume("ITSSPDCarbonFiberSupportSectorEndAirB1_1"
4036 )->GetShape();
bc3498f4 4037 //pmA = new TPolyMarker();
4038 //pmA.SetMarkerStyle(2); // +
4039 //pmA.SetMarkerColor(7); // light blue
4040 //pmB = new TPolyMarker();
4041 //pmB.SetMarkerStyle(5); // X
4042 //pmB.SetMarkerColor(6); // purple
4043 plA0.SetPolyLine(sA0->GetNvert());
4044 plA0.SetLineColor(1); // black
4045 plA0.SetLineStyle(1);
4046 plA1.SetPolyLine(sA1->GetNvert());
4047 plA1.SetLineColor(2); // red
4048 plA1.SetLineStyle(1);
4049 plB0.SetPolyLine(sB0->GetNvert());
4050 plB0.SetLineColor(3); // Green
4051 plB0.SetLineStyle(2);
4052 plB1.SetPolyLine(sB1->GetNvert());
4053 plB1.SetLineColor(4); // Blue
4054 plB1.SetLineStyle(2);
4055 //for(i=0;i<kNRadii;i++) pmA.SetPoint(i,xyB1p[i][0],xyB1p[i][1]);
4056 //for(i=0;i<kNRadii;i++) pmB.SetPoint(i,xyB1p[i][0],xyB1p[i][1]);
4057 for(i=0;i<sA0->GetNvert();i++) plA0.SetPoint(i,sA0->GetX(i),sA0->GetY(i));
4058 for(i=0;i<sA1->GetNvert();i++) plA1.SetPoint(i,sA1->GetX(i),sA1->GetY(i));
4059 for(i=0;i<sB0->GetNvert();i++) plB0.SetPoint(i,sB0->GetX(i),sB0->GetY(i));
4060 for(i=0;i<sB1->GetNvert();i++) plB1.SetPoint(i,sB1->GetX(i),sB1->GetY(i));
4061 canvas = new TCanvas("AliITSv11GeometrySPDFig0","",1000,1000);
4062 canvas->Range(-3.,-3.,3.,3.);
4063 txt.SetTextSize(0.05);
4064 txt.SetTextAlign(33);
4065 txt.SetTextColor(1);
4066 txt.DrawLatex(2.9,2.9,"Section A-A outer Carbon Fiber surface");
4067 txt.SetTextColor(2);
4068 txt.DrawLatex(2.9,2.5,"Section A-A Inner Carbon Fiber surface");
4069 txt.SetTextColor(3);
4070 txt.DrawLatex(2.9,2.1,"Section E-E outer Carbon Fiber surface");
4071 txt.SetTextColor(4);
4072 txt.DrawLatex(2.9,1.7,"Section E-E Inner Carbon Fiber surface");
4073 plA0.Draw();
4074 plA1.Draw();
4075 plB0.Draw();
4076 plB1.Draw();
4077 //pmA.Draw();
4078 //pmB.Draw();
4079 //
4080 x = 1.0;
4081 y = -2.5;
4082 Char_t chr[3];
4083 for(i=0;i<kNRadii;i++){
4084 sprintf(chr,"%2d",i);txt.DrawLatex(x-0.1,y,chr);
4085 sprintf(chr,"%8.4f",5.000);txt.DrawLatex(x,y,chr);
4086 sprintf(chr,"%8.4f",5.000);txt.DrawLatex(x+0.5,y,chr);
4087 sprintf(chr,"%8.4f",5.000);txt.DrawLatex(x+1.0,y,chr);
4088 sprintf(chr,"%8.4f",5.000);txt.DrawLatex(x+1.5,y,chr);
4089 sprintf(chr,"%8.4f",5.000);txt.DrawLatex(x+2.0,y,chr);
4090 if(kTRUE) txt.DrawLatex(x+2.5,y,"A-A/E-E");
4091 else txt.DrawLatex(x+2.5,y,"E-E");
4092 } // end for i
4093 txt.DrawLatex(x,y,"x_{c} mm");
4094 txt.DrawLatex(x+0.5,y,"y_{c} mm");
4095 txt.DrawLatex(x+1.0,y,"R mm");
4096 txt.DrawLatex(x+1.5,y,"#theta_{start}^{#circle}");
4097 txt.DrawLatex(x+2.0,y,"#theta_{end}^{#circle}");
4098 txt.DrawLatex(x+2.5,y,"Section");
4099 //
4100}
54c9a3d9 4101//______________________________________________________________________
4102void AliITSv11GeometrySPD::PrintAscii(ostream *os) const
4103{
4104 //
bc3498f4 4105 // Print out class data values in Ascii Form to output stream
4106 // Inputs:
4107 // ostream *os Output stream where Ascii data is to be writen
4108 // Outputs:
4109 // none.
4110 // Return:
4111 // none.
54c9a3d9 4112 //
4113 Int_t i,j,k;
bc3498f4 4114#if defined __GNUC__
4115#if __GNUC__ > 2
4116 ios::fmtflags fmt = cout.flags();
4117#else
4118 Int_t fmt;
4119#endif
4120#else
4121#if defined __ICC || defined __ECC || defined __xlC__
4122 ios::fmtflags fmt;
4123#else
4124 Int_t fmt;
4125#endif
4126#endif
54c9a3d9 4127
4128 *os<< fgkGapLadder <<" "<< fgkGapHalfStave<<" "<< 6 <<" ";
4129 for(i=0;i<6;i++) *os<< fAddStave[i] <<" "<<fSPDsectorX0.GetSize();
4130 for(i=0;i<fSPDsectorX0.GetSize();i++) *os<< fSPDsectorX0.GetAt(i) << " ";
4131 for(i=0;i<fSPDsectorX0.GetSize();i++) *os<< fSPDsectorY0.GetAt(i) << " ";
4132 for(i=0;i<fSPDsectorX1.GetSize();i++) *os<< fSPDsectorX1.GetAt(i) << " ";
4133 for(i=0;i<fSPDsectorX1.GetSize();i++) *os<< fSPDsectorY1.GetAt(i) << " ";
4134 *os<<10<<" "<< 2 <<" " << 6 << " "<< 3 <<" ";
d0048cec 4135 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++)
54c9a3d9 4136 *os<<fTubeEndSector[k][0][i][j]<<" ";
d0048cec 4137 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++)
54c9a3d9 4138 *os<<fTubeEndSector[k][1][i][j]<<" ";
bc3498f4 4139 os->flags(fmt); // reset back to old Formating.
4140 return;
4141}
4142//
54c9a3d9 4143//______________________________________________________________________
4144void AliITSv11GeometrySPD::ReadAscii(istream* is)
4145{
4146 //
bc3498f4 4147 // Read in class data values in Ascii Form to output stream
4148 // Inputs:
4149 // istream *is Input stream where Ascii data is to be read in from
4150 // Outputs:
4151 // none.
4152 // Return:
4153 // none.
54c9a3d9 4154 //
4155 Int_t i,j,k,n;
4156 Double_t gapLadder,GapHalfStave;
4157
4158 *is>>gapLadder>>GapHalfStave>>n;
4159 if(n!=6){
4160 Warning("ReadAscii","fAddStave Array !=6 n=%d",n);
4161 return;
4162 } // end if
4163 for(i=0;i<n;i++) *is>>fAddStave[i];
4164 *is>>n;
4165 fSPDsectorX0.Set(n);
4166 fSPDsectorY0.Set(n);
4167 fSPDsectorX1.Set(n);
4168 fSPDsectorY1.Set(n);
4169 for(i=0;i<n;i++) *is>>fSPDsectorX0[i];
4170 for(i=0;i<n;i++) *is>>fSPDsectorY0[i];
4171 for(i=0;i<n;i++) *is>>fSPDsectorX1[i];
4172 for(i=0;i<n;i++) *is>>fSPDsectorY1[i];
4173 *is>> i>>j>>n;
4174 if(i!=2||j!=6||n!=3){
4175 Warning("ReadAscii","fTubeEndSector array wrong size [2][6][3],"
4176 "found [%d][%d][%d]",i,j,n);
4177 return;
4178 } // end if
d0048cec 4179 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++)
54c9a3d9 4180 *is>>fTubeEndSector[k][0][i][j];
d0048cec 4181 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++)
54c9a3d9 4182 *is>>fTubeEndSector[k][1][i][j];
4183 return;
bc3498f4 4184}
4185//
54c9a3d9 4186//______________________________________________________________________
4187ostream &operator<<(ostream &os,const AliITSv11GeometrySPD &s)
4188{
4189 //
bc3498f4 4190 // Standard output streaming function
4191 // Inputs:
4192 // ostream &os output steam
4193 // AliITSvPPRasymmFMD &s class to be streamed.
4194 // Output:
4195 // none.
4196 // Return:
4197 // ostream &os The stream pointer
54c9a3d9 4198 //
bc3498f4 4199 s.PrintAscii(&os);
4200 return os;
4201}
4202//
54c9a3d9 4203//______________________________________________________________________
4204istream &operator>>(istream &is,AliITSv11GeometrySPD &s)
4205{
4206 //
bc3498f4 4207 // Standard inputput streaming function
4208 // Inputs:
4209 // istream &is input steam
4210 // AliITSvPPRasymmFMD &s class to be streamed.
4211 // Output:
4212 // none.
4213 // Return:
4214 // ostream &os The stream pointer
54c9a3d9 4215 //
bc3498f4 4216 s.ReadAscii(&is);
4217 return is;
4218}
4219//
54c9a3d9 4220//______________________________________________________________________
bc3498f4 4221Bool_t AliITSv11GeometrySPD::Make2DCrossSections(TPolyLine &a0,TPolyLine &a1,
54c9a3d9 4222 TPolyLine &b0,TPolyLine &b1,TPolyMarker &p)const
4223{
4224 //
297369a1 4225 // Fill the objects with the points representing
4226 // a0 the outer carbon fiber SPD sector shape Cross Section A
4227 // a1 the inner carbon fiber SPD sector shape Cross Section A
4228 // b0 the outer carbon fiber SPD sector shape Cross Section B
4229 // b1 the inner carbon fiber SPD sector shape Cross Section B
4230 //
4231 // Inputs:
4232 // TPolyLine &a0 The outer carbon fiber SPD sector shape
4233 // TPolyLine &a1 The Inner carbon fiber SPD sector shape
4234 // TPolyLine &b0 The outer carbon fiber SPD sector shape
4235 // TPolyLine &b1 The Inner carbon fiber SPD sector shape
4236 // TPolyMarker &p The points where the ladders are to be placed
4237 // Outputs:
4238 // TPolyLine &a0 The shape filled with the points
4239 // TPolyLine &a1 The shape filled with the points
4240 // TPolyLine &b0 The shape filled with the points
4241 // TPolyLine &b1 The shape filled with the points
4242 // TPolyMarker &p The filled array of points
4243 // Return:
4244 // An error flag.
54c9a3d9 4245 //
297369a1 4246 Int_t n0,n1,i;
4247 Double_t x,y;
4248 TGeoVolume *a0V,*a1V,*b0V,*b1V;
4249 TGeoXtru *a0S,*a1S,*b0S,*b1S;
4250 TGeoManager *mgr = gGeoManager;
4251
bc3498f4 4252 a0V = mgr->GetVolume("ITS SPD Carbon fiber support Sector A0");
297369a1 4253 a0S = dynamic_cast<TGeoXtru*>(a0V->GetShape());
4254 n0 = a0S->GetNvert();
4255 a0.SetPolyLine(n0+1);
d0048cec 4256 //for(i=0;i<fSPDsectorPoints0.GetSize();i++)
297369a1 4257 // printf("%d %d %d\n",i,fSPDsectorPoints0[i],fSPDsectorPoints1[i]);
4258 for(i=0;i<n0;i++){
4259 x = a0S->GetX(i);
54c9a3d9 4260 y = a0S->GetY(i);
4261 //printf("%d %g %g\n",i,x,y);
297369a1 4262 a0.SetPoint(i,x,y);
54c9a3d9 4263 if(i==0) a0.SetPoint(n0,x,y);
297369a1 4264 } // end for i
4265 a1V = mgr->GetVolume("ITSSPDCarbonFiberSupportSectorAirA1");
4266 a1S = dynamic_cast<TGeoXtru*>(a1V->GetShape());
4267 n1 = a1S->GetNvert();
4268 a1.SetPolyLine(n1+1);
4269 for(i=0;i<n1;i++){
4270 x = a1S->GetX(i);
54c9a3d9 4271 y = a1S->GetY(i);
297369a1 4272 a1.SetPoint(i,x,y);
54c9a3d9 4273 if(i==0) a1.SetPoint(n1,x,y);
297369a1 4274 } // end for i
4275 // Cross Section B
4276 b0V = mgr->GetVolume("ITSSPDCarbonFiberSupportSectorEndB0");
4277 b0S = dynamic_cast<TGeoXtru*>(b0V->GetShape());
4278 n0 = b0S->GetNvert();
4279 b0.SetPolyLine(n0+1);
4280 for(i=0;i<n0;i++){
4281 x = b0S->GetX(i);
54c9a3d9 4282 y = b0S->GetY(i);
297369a1 4283 b0.SetPoint(i,x,y);
54c9a3d9 4284 if(i==0) b0.SetPoint(n0,x,y);
297369a1 4285 } // end for i
4286 b1V = mgr->GetVolume("ITSSPDCarbonFiberSupportSectorEndAirB1");
4287 b1S = dynamic_cast<TGeoXtru*>(b1V->GetShape());
4288 n1 = b1S->GetNvert();
4289 b1.SetPolyLine(n1+1);
4290 for(i=0;i<n1;i++){
4291 x = b1S->GetX(i);
54c9a3d9 4292 y = b1S->GetY(i);
297369a1 4293 b1.SetPoint(i,x,y);
54c9a3d9 4294 if(i==0) b1.SetPoint(n1,x,y);
297369a1 4295 } // end for i
4296 //
4297 Double_t x0,y0,x1,y1;
bc3498f4 4298 p.SetPolyMarker(2*fSPDsectorX0.GetSize());
4299 for(i=0;i<fSPDsectorX0.GetSize();i++){
54c9a3d9 4300 GetSectorMountingPoints(i,x0,y0,x1,y1);
4301 p.SetPoint(2*i,x0,y0);
4302 p.SetPoint(2*i+1,x1,y1);
297369a1 4303 } // end for i
4304 return kTRUE;
4305}