]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSv11GeometrySPD.cxx
Modifications to ITS standalone tracker: 1) improve efficiency at low pt for p-p...
[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
54c9a3d9 17// outside of the central volume (except for the Central support
18// cylinders). Other classes define the rest of the ITS, specifically the
19// SSD support cone, the SSD Support central cylinder, the SDD support cone,
20// the SDD support central cylinder, the SPD Thermal Shield, The supports
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
91const Double_t AliITSv11GeometrySPD::fgkGapLadder =
92 AliITSv11Geometry::fgkmicron*75.; // 75 microns
93const Double_t AliITSv11GeometrySPD::fgkGapHalfStave =
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
106fTubeEndSector() // coordinate of cooling tube ends
107{
108 //
109 // Default constructor.
110 // This does not initialize anything and is provided just for
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
137fTubeEndSector() // coordinate of cooling tube ends
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//______________________________________________________________________
187AliITSv11GeometrySPD& AliITSv11GeometrySPD::operator=(const
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 //
218 // This function is used to recovery any medium
219 // used to build the geometry volumes.
220 // If the required medium does not exists,
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 // ---
238 // NOTE: These are the same old names.
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)
295
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);
301
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);
307
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);
313
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
333 // air defined as a mixture of C-N-O-Ar:
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//______________________________________________________________________
bc3498f4 395void AliITSv11GeometrySPD::InitSPDCentral(Int_t offset, TVirtualMC *vmc) const
396{
54c9a3d9 397 //
398 // Do all SPD Central detector initializations (e.g.: transport cuts).
399 // ---
400 // Here follow some GEANT3 physics switches, which are interesting
401 // for these settings to be defined:
402 // - "MULTS" (MULtiple Scattering):
403 // the variable IMULS controls this process. See [PHYS320/325/328]
404 // 0 - No multiple scattering.
405 // 1 - (DEFAULT) Multiple scattering according to Moliere theory.
406 // 2 - Same as 1. Kept for backward compatibility.
407 // 3 - Pure Gaussian scattering according to the Rossi formula.
408 // - "DRAY" (Delta RAY production)
409 // The variable IDRAY controls this process. See [PHYS430]
410 // 0 - No delta rays production.
411 // 1 - (DEFAULT) Delta rays production with generation of.
412 // 2 - Delta rays production without generation of.
413 // - "LOSS" (continuous energy loss)
414 // The variable ILOSS controls this process.
415 // 0 - No continuous energy loss, IDRAY is set to 0.
416 // 1 - Continuous energy loss with generation of delta rays above
417 // DCUTE (common/GCUTS/) and restricted Landau fluctuations
418 // below DCUTE.
419 // 2 - (DEFAULT) Continuous energy loss without generation of
420 // delta rays
421 // and full Landau-Vavilov-Gauss fluctuations.
422 // In this case the variable IDRAY is forced to 0 to avoid
423 // double counting of fluctuations.
424 // 3 - Same as 1, kept for backward compatibility.
425 // 4 - Energy loss without fluctuation.
426 // The value obtained from the tables is used directly.
427 // ---
428 // Arguments:
429 // Int_t offset --> the material/medium index offset
430 // TVirtualMC *vmc --> pointer to the virtual Monte Carlo default gMC
431 //
432
433 Int_t i, n = 4;
434
435 for(i=0;i<n;i++) {
436 vmc->Gstpar(i+offset, "CUTGAM", 30.0 * fgkKeV);
437 vmc->Gstpar(i+offset, "CUTELE", 30.0 * fgkKeV);
438 vmc->Gstpar(i+offset, "CUTNEU", 30.0 * fgkKeV);
439 vmc->Gstpar(i+offset, "CUTHAD", 30.0 * fgkKeV);
440 vmc->Gstpar(i+offset, "CUTMUO", 30.0 * fgkKeV);
441 vmc->Gstpar(i+offset, "BCUTE", 30.0 * fgkKeV);
442 vmc->Gstpar(i+offset, "BCUTM", 30.0 * fgkKeV);
443 vmc->Gstpar(i+offset, "DCUTE", 30.0 * fgkKeV);
444 vmc->Gstpar(i+offset, "DCUTM", 30.0 * fgkKeV);
445 //vmc->Gstpar(i+offset, "PPCUTM", );
446 //vmc->Gstpar(i+offset, "PAIR", );
447 //vmc->Gstpar(i+offset, "COMPT", );
448 //vmc->Gstpar(i+offset, "PHOT", );
449 //vmc->Gstpar(i+offset, "PFIS", );
450 vmc->Gstpar(i+offset, "DRAY", 1);
451 //vmc->Gstpar(i+offset, "ANNI", );
452 //vmc->Gstpar(i+offset, "BREM", );
453 //vmc->Gstpar(i+offset, "HADR", );
454 //vmc->Gstpar(i+offset, "MUNU", );
455 //vmc->Gstpar(i+offset, "DCAY", );
456 vmc->Gstpar(i+offset, "LOSS", 1);
457 //vmc->Gstpar(i+offset, "MULS", );
458 //vmc->Gstpar(i+offset, "GHCOR1", );
459 //vmc->Gstpar(i+offset, "BIRK1", );
460 //vmc->Gstpar(i+offset, "BRIK2", );
461 //vmc->Gstpar(i+offset, "BRIK3", );
462 //vmc->Gstpar(i+offset, "LABS", );
463 //vmc->Gstpar(i+offset, "SYNC", );
464 //vmc->Gstpar(i+offset, "STRA", );
465 }
a53658c6 466}
54c9a3d9 467//______________________________________________________________________
bc3498f4 468void AliITSv11GeometrySPD::SPDSector(TGeoVolume *moth, TGeoManager *mgr)
469{
54c9a3d9 470 //
471 // Creates a single SPD carbon fiber sector and places it
472 // in a container volume passed as first argument ('moth').
473 // Second argument points to the TGeoManager which coordinates
474 // the overall volume creation.
475 // The position of the sector is based on distance of
476 // closest point of SPD stave to beam pipe
477 // (figures all-sections-modules.ps) of 7.22mm at section A-A.
478 //
479
480 // Begin_Html
481 /*
482 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/assembly.ps"
483 title="SPD Sector drawing with all cross sections defined">
484 <p>The SPD Sector definition. In
485 <a href="http://alice.pd.infn.it/latestdr/Geometric-Revision/assembly.hpgl">HPGL</a> format.
486 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/assembly-10-modules.ps"
487 titile="SPD All Sectors end view with thermal sheald">
488 <p>The SPD all sector end view with thermal sheald.
489 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/assembly.ps"
490 title="SPD side view cross section">
491 <p>SPD side view cross section with condes and thermal shealds.
492 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-A_A.jpg"
493 title="Cross section A-A"><p>Cross section A-A.
494 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-B_B.jpg"
495 title="Cross updated section A-A"><p>Cross updated section A-A.
496 <img src="http://physics.mps.ohio-state.edu/~nilsen/ITSfigures/Sezione_layerAA.pdf"
497 title="Cross section B-B"><p>Cross section B-B.
498 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-C_C.jpg"
499 title-"Cross section C-C"><p>Cross section C-C.
500 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-D_D.jpg"
501 title="Cross section D-D"><p>Cross section D-D.
502 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-E_E.jpg"
503 title="Cross section E-E"><p>Cross section E-E.
504 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-F_F.jpg"
505 title="Cross section F-F"><p>Cross section F-F.
506 <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/SECTION-G_G.jpg"
507 title="Cross section G-G"><p>Cross section G-G.
508 */
509 // End_Html
510
511 // Inputs:
512 // TGeoVolume *moth Pointer to mother volume where this object
513 // is to be placed in
514 // TGeoManager *mgr Pointer to the TGeoManager used, defaule is
515 // gGeoManager.
516 // Outputs:
517 // none.
518 // Return:
519 // none.
520 // Updated values for kSPDclossesStaveAA, kBeamPipeRadius, and
521 // staveThicknessAA are taken from
522 // http://physics.mps.ohio-state.edu/~nilsen/ITSfigures/Sezione_layerAA.pdf
523 //
3ffa185f 524 const Double_t kSPDclossesStaveAA = 7.25* fgkmm;
54c9a3d9 525 const Double_t kSectorStartingAngle = -72.0 * fgkDegree;
3ffa185f 526 const Int_t kNSectorsTotal = 10;
527 const Double_t kSectorRelativeAngle = 36.0 * fgkDegree; // = 360.0 / 10
528 const Double_t kBeamPipeRadius = 0.5 * 59.6 * fgkmm; // diam. = 59.6 mm
529 //const Double_t staveThicknessAA = 0.9 *fgkmm; // nominal thickness
530 const Double_t staveThicknessAA = 1.02 * fgkmm; // get from stave geometry.
531
532 Int_t i, j, k;
54c9a3d9 533 Double_t angle, radiusSector, xAAtubeCenter0, yAAtubeCenter0;
3ffa185f 534 TGeoCombiTrans *secRot = new TGeoCombiTrans(), *comrot;
54c9a3d9 535 TGeoVolume *vCarbonFiberSector;
536 TGeoMedium *medSPDcf;
537
538 // Define an assembly and fill it with the support of
539 // a single carbon fiber sector and staves in it
540 medSPDcf = GetMedium("SPD C (M55J)$", mgr);
541 vCarbonFiberSector = new TGeoVolumeAssembly("ITSSPDCarbonFiberSectorV");
542 vCarbonFiberSector->SetMedium(medSPDcf);
3ffa185f 543 CarbonFiberSector(vCarbonFiberSector, xAAtubeCenter0, yAAtubeCenter0, mgr);
54c9a3d9 544
545 // Compute the radial shift out of the sectors
3ffa185f 546 radiusSector = kBeamPipeRadius + kSPDclossesStaveAA + staveThicknessAA;
547 radiusSector = GetSPDSectorTranslation(fSPDsectorX0.At(1), fSPDsectorY0.At(1),
548 fSPDsectorX1.At(1), fSPDsectorY1.At(1), radiusSector);
549 //radiusSector *= radiusSector; // squaring;
550 //radiusSector -= xAAtubeCenter0 * xAAtubeCenter0;
551 //radiusSector = -yAAtubeCenter0 + TMath::Sqrt(radiusSector);
552
553 AliDebug(1, Form("SPDSector : radiusSector=%f\n",radiusSector));
554 i = 1;
555 AliDebug(1, Form("i= %d x0=%f y0=%f x1=%f y1=%f\n", i,
556 fSPDsectorX0.At(i), fSPDsectorY0.At(i),
557 fSPDsectorX1.At(i),fSPDsectorY1.At(i)));
558
54c9a3d9 559 // add 10 single sectors, by replicating the virtual sector defined above
560 // and placing at different angles
561 Double_t shiftX, shiftY, tub[2][6][3];
3ffa185f 562 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 563 angle = kSectorStartingAngle;
564 secRot->RotateZ(angle);
565 TGeoVolumeAssembly *vcenteral = new TGeoVolumeAssembly("ITSSPD");
3ffa185f 566 moth->AddNode(vcenteral, 1, 0);
567 for(i = 0; i < kNSectorsTotal; i++) {
54c9a3d9 568 shiftX = -radiusSector * TMath::Sin(angle/fgkRadian);
569 shiftY = radiusSector * TMath::Cos(angle/fgkRadian);
ed0e944d 570 //cout << "ANGLE = " << angle << endl;
3ffa185f 571 shiftX += 0.1094 * TMath::Cos((angle + 196.)/fgkRadian);
572 shiftY += 0.1094 * TMath::Sin((angle + 196.)/fgkRadian);
573 //shiftX -= 0.105;
574 //shiftY -= 0.031;
575 //shiftX -= 0.11 * TMath::Cos(angle/fgkRadian); // add by Alberto
576 //shiftY -= 0.11 * TMath::Sin(angle/fgkRadian); // don't ask me where that 0.11 comes from!
54c9a3d9 577 secRot->SetDx(shiftX);
578 secRot->SetDy(shiftY);
579 comrot = new TGeoCombiTrans(*secRot);
580 vcenteral->AddNode(vCarbonFiberSector,i+1,comrot);
581 for(j=0;j<2;j++)for(k=0;k<6;k++) // Transform Tube ends for each sector
582 comrot->LocalToMaster(tub[j][k],fTubeEndSector[i][j][k]);
583 if(GetDebug(5)) {
584 AliInfo(Form("i=%d angle=%g angle[rad]=%g radiusSector=%g "
585 "x=%g y=%g \n",i, angle, angle/fgkRadian,
586 radiusSector, shiftX, shiftY));
587 } // end if GetDebug(5)
588 angle += kSectorRelativeAngle;
589 secRot->RotateZ(kSectorRelativeAngle);
590 } // end for i
591 if(GetDebug(3)) moth->PrintNodes();
592 delete secRot;
7f69c251 593
594 CreateCones(moth);
a53658c6 595}
54c9a3d9 596//______________________________________________________________________
597void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
598 Double_t &xAAtubeCenter0, Double_t &yAAtubeCenter0, TGeoManager *mgr)
bc3498f4 599{
54c9a3d9 600 //
601 // Define the detail SPD Carbon fiber support Sector geometry.
602 // Based on the drawings:
603 /*
604 http:///QA-construzione-profilo-modulo.ps
605 */
606 // - ALICE-Pixel "Costruzione Profilo Modulo" (march 25 2004)
607 // - ALICE-SUPPORTO "Costruzione Profilo Modulo"
608 // ---
609 // Define outside radii as negative, where "outside" means that the
610 // center of the arc is outside of the object (feb 16 2004).
611 // ---
612 // Arguments [the one passed by ref contain output values]:
613 // Inputs:
614 // TGeoVolume *moth the voulme which will contain this object
615 // TGeoManager *mgr TGeo builder defauls is gGeoManager
616 // Outputs:
617 // Double_t &xAAtubeCenter0 (by ref) x location of the outer surface
618 // of the cooling tube center for tube 0.
619 // Double_t &yAAtubeCenter0 (by ref) y location of the outer surface
620 // of the cooling tube center for tube 0.
621 // Return:
622 // none.
623 // ---
624 // Int the two variables passed by reference values will be stored
625 // which will then be used to correctly locate this sector.
626 // The information used for this is the distance between the
627 // center of the #0 detector and the beam pipe.
628 // Measurements are taken at cross section A-A.
629 //
630
631 //TGeoMedium *medSPDfs = 0;//SPD support cone inserto stesalite 4411w
632 //TGeoMedium *medSPDfo = 0;//SPD support cone foam, Rohacell 50A.
633 //TGeoMedium *medSPDal = 0;//SPD support cone SDD mounting bracket Al
634 TGeoMedium *medSPDcf = GetMedium("SPD C (M55J)$", mgr);
635 TGeoMedium *medSPDss = GetMedium("INOX$", mgr);
636 TGeoMedium *medSPDair = GetMedium("AIR$", mgr);
637 TGeoMedium *medSPDcoolfl = GetMedium("Freon$", mgr); //ITSspdCoolingFluid
638 //
639 const Double_t ksecDz = 0.5 * 500.0 * fgkmm;
640 //const Double_t ksecLen = 30.0 * fgkmm;
641 const Double_t ksecCthick = 0.2 * fgkmm;
642 const Double_t ksecDipLength = 3.2 * fgkmm;
643 const Double_t ksecDipRadii = 0.4 * fgkmm;
644 //const Double_t ksecCoolingTubeExtraDepth = 0.86 * fgkmm;
645 //
646 // The following positions ('ksecX#' and 'ksecY#') and radii ('ksecR#')
647 // are the centers and radii of curvature of all the rounded corners
648 // between the straight borders of the SPD sector shape.
649 // To draw this SPD sector, the following steps are followed:
650 // 1) the (ksecX, ksecY) points are plotted
651 // and circles of the specified radii are drawn around them.
652 // 2) each pair of consecutive circles is connected by a line
653 // tangent to them, in accordance with the radii being "internal"
654 // or "external" with respect to the closed shape which describes
655 // the sector itself.
656 // The resulting connected shape is the section
657 // of the SPD sector surface in the transverse plane (XY).
658 //
659 const Double_t ksecX0 = -10.725 * fgkmm;
660 const Double_t ksecY0 = -14.853 * fgkmm;
661 const Double_t ksecR0 = -0.8 * fgkmm; // external
662 const Double_t ksecX1 = -13.187 * fgkmm;
663 const Double_t ksecY1 = -19.964 * fgkmm;
3ffa185f 664 const Double_t ksecR1 = +0.6 * fgkmm; // internal // (modif. by Alberto)
665 //const Double_t ksecR1 = +0.8 * fgkmm; // internal // (modif. by Alberto)
666
54c9a3d9 667 // const Double_t ksecDip0 = 5.9 * fgkmm;
668 //
3ffa185f 669 //const Double_t ksecX2 = -3.883 * fgkmm;
670 const Double_t ksecX2 = -3.833 * fgkmm; // (corr. by Alberto)
54c9a3d9 671 const Double_t ksecY2 = -17.805 * fgkmm;
3ffa185f 672 const Double_t ksecR2 = +0.6 * fgkmm; // internal (guess)
54c9a3d9 673 const Double_t ksecX3 = -3.123 * fgkmm;
674 const Double_t ksecY3 = -14.618 * fgkmm;
675 const Double_t ksecR3 = -0.6 * fgkmm; // external
676 //const Double_t ksecDip1 = 8.035 * fgkmm;
677 //
678 const Double_t ksecX4 = +11.280 * fgkmm;
679 const Double_t ksecY4 = -14.473 * fgkmm;
680 const Double_t ksecR4 = +0.8 * fgkmm; // internal
681 const Double_t ksecX5 = +19.544 * fgkmm;
682 const Double_t ksecY5 = +10.961 * fgkmm;
683 const Double_t ksecR5 = +0.8 * fgkmm; // internal
684 //const Double_t ksecDip2 = 4.553 * fgkmm;
685 //
686 const Double_t ksecX6 = +10.830 * fgkmm;
687 const Double_t ksecY6 = +16.858 * fgkmm;
688 const Double_t ksecR6 = +0.6 * fgkmm; // internal
689 const Double_t ksecX7 = +11.581 * fgkmm;
690 const Double_t ksecY7 = +13.317 * fgkmm;
691 const Double_t ksecR7 = -0.6 * fgkmm; // external
692 //const Double_t ksecDip3 = 6.978 * fgkmm;
693 //
694 const Double_t ksecX8 = -0.733 * fgkmm;
695 const Double_t ksecY8 = +17.486 * fgkmm;
696 const Double_t ksecR8 = +0.6 * fgkmm; // internal
697 const Double_t ksecX9 = +0.562 * fgkmm;
698 //const Double_t ksecY9 = +14.486 * fgkmm; // correction by
699 const Double_t ksecY9 = +14.107 * fgkmm; // Alberto
700 const Double_t ksecR9 = -0.6 * fgkmm; // external
701 //const Double_t ksecDip4 = 6.978 * fgkmm;
702 //
703 const Double_t ksecX10 = -12.252 * fgkmm;
704 const Double_t ksecY10 = +16.298 * fgkmm;
705 const Double_t ksecR10 = +0.6 * fgkmm; // internal
706 const Double_t ksecX11 = -10.445 * fgkmm;
707 const Double_t ksecY11 = +13.162 * fgkmm;
708 const Double_t ksecR11 = -0.6 * fgkmm; // external
709 //const Double_t ksecDip5 = 6.978 * fgkmm;
710 //
711 const Double_t ksecX12 = -22.276 * fgkmm;
712 const Double_t ksecY12 = +12.948 * fgkmm;
713 const Double_t ksecR12 = +0.85 * fgkmm; // internal
714 const Double_t ksecR13 = -0.8 * fgkmm; // external
715 const Double_t ksecAngleSide13 = 36.0 * fgkDegree;
716 //
717 const Int_t ksecNRadii = 20;
718 const Int_t ksecNPointsPerRadii = 4;
719 const Int_t ksecNCoolingTubeDips = 6;
720 //
721 // Since the rounded parts are approximated by a regular polygon
722 // and a cooling tube of the propper diameter must fit, a scaling factor
723 // increases the size of the polygon for the tube to fit.
724 //const Double_t ksecRCoolScale = 1./TMath::Cos(TMath::Pi()/
725 // (Double_t)ksecNPointsPerRadii);
726 const Double_t ksecZEndLen = 30.000 * fgkmm;
727 //const Double_t ksecZFlangLen = 45.000 * fgkmm;
728 const Double_t ksecTl = 0.860 * fgkmm;
729 const Double_t ksecCthick2 = 0.600 * fgkmm;
730 //const Double_t ksecCthick3 = 1.80 * fgkmm;
731 //const Double_t ksecSidelen = 22.0 * fgkmm;
732 //const Double_t ksecSideD5 = 3.679 * fgkmm;
733 //const Double_t ksecSideD12 = 7.066 * fgkmm;
734 const Double_t ksecRCoolOut = 2.400 * fgkmm;
735 const Double_t ksecRCoolIn = 2.000 * fgkmm;
736 const Double_t ksecDl1 = 5.900 * fgkmm;
737 const Double_t ksecDl2 = 8.035 * fgkmm;
738 const Double_t ksecDl3 = 4.553 * fgkmm;
739 const Double_t ksecDl4 = 6.978 * fgkmm;
740 const Double_t ksecDl5 = 6.978 * fgkmm;
741 const Double_t ksecDl6 = 6.978 * fgkmm;
742 const Double_t ksecCoolTubeThick = 0.04 * fgkmm;
743 const Double_t ksecCoolTubeROuter = 2.6 * fgkmm;
744 const Double_t ksecCoolTubeFlatX = 3.696 * fgkmm;
745 const Double_t ksecCoolTubeFlatY = 0.68 * fgkmm;
746 //const Double_t ksecBeamX0 = 0.0 * fgkmm; // guess
747 //const Double_t ksecBeamY0 = (15.223 + 40.) * fgkmm; // guess
748 //
749 // redefine some of the points already defined above
750 // in the format of arrays (???)
751 const Int_t ksecNPoints = (ksecNPointsPerRadii + 1) * ksecNRadii + 8;
752 Double_t secX[ksecNRadii] = {
753 ksecX0, ksecX1, -1000.0,
754 ksecX2, ksecX3, -1000.0,
755 ksecX4, ksecX5, -1000.0,
756 ksecX6, ksecX7, -1000.0,
757 ksecX8, ksecX9, -1000.0,
758 ksecX10, ksecX11, -1000.0,
759 ksecX12, -1000.0
760 };
761 Double_t secY[ksecNRadii] = {
762 ksecY0, ksecY1, -1000.0,
763 ksecY2, ksecY3, -1000.0,
764 ksecY4, ksecY5, -1000.0,
765 ksecY6, ksecY7, -1000.0,
766 ksecY8, ksecY9, -1000.0,
767 ksecY10, ksecY11, -1000.0,
768 ksecY12, -1000.0
769 };
770 Double_t secR[ksecNRadii] = {
771 ksecR0, ksecR1, -.5 * ksecDipLength - ksecDipRadii,
772 ksecR2, ksecR3, -.5 * ksecDipLength - ksecDipRadii,
773 ksecR4, ksecR5, -.5 * ksecDipLength - ksecDipRadii,
774 ksecR6, ksecR7, -.5 * ksecDipLength - ksecDipRadii,
775 ksecR8, ksecR9, -.5 * ksecDipLength - ksecDipRadii,
776 ksecR10, ksecR11, -.5 * ksecDipLength - ksecDipRadii,
777 ksecR12, ksecR13
778 };
779 /*
780 Double_t secDip[ksecNRadii] = {
781 0., 0., ksecDip0, 0., 0., ksecDip1,
782 0., 0., ksecDip2, 0., 0., ksecDip3,
783 0., 0., ksecDip4, 0., 0., ksecDip5,
784 0., 0.
785 };
786 */
787 Double_t secX2[ksecNRadii];
788 Double_t secY2[ksecNRadii];
789 Double_t secR2[ksecNRadii] = {
790 ksecR0, ksecR1, ksecRCoolOut,
791 ksecR2, ksecR3, ksecRCoolOut,
792 ksecR4, ksecR5, ksecRCoolOut,
793 ksecR6, ksecR7, ksecRCoolOut,
794 ksecR8, ksecR9, ksecRCoolOut,
795 ksecR10, ksecR11, ksecRCoolOut,
796 ksecR12, ksecR13
797 };
798 Double_t secDip2[ksecNCoolingTubeDips] = {
799 ksecDl1, ksecDl2, ksecDl3,
800 ksecDl4, ksecDl5, ksecDl6
801 };
802 Double_t secX3[ksecNRadii];
803 Double_t secY3[ksecNRadii];
804 const Int_t ksecDipIndex[ksecNCoolingTubeDips] = {2, 5, 8, 11, 14, 17};
805 Double_t secAngleStart[ksecNRadii];
806 Double_t secAngleEnd[ksecNRadii];
807 Double_t secAngleStart2[ksecNRadii];
808 Double_t secAngleEnd2[ksecNRadii];
809 Double_t secAngleTurbo[ksecNCoolingTubeDips] = {0., 0., 0., 0., 0., 0.0};
810 //Double_t secAngleStart3[ksecNRadii];
811 //Double_t secAngleEnd3[ksecNRadii];
812 Double_t xpp[ksecNPoints], ypp[ksecNPoints];
813 Double_t xpp2[ksecNPoints], ypp2[ksecNPoints];
814 Double_t *xp[ksecNRadii], *xp2[ksecNRadii];
815 Double_t *yp[ksecNRadii], *yp2[ksecNRadii];
816 TGeoXtru *sA0, *sA1, *sB0, *sB1,*sB2;
817 TGeoBBox *sB3;
818 TGeoEltu *sTA0, *sTA1;
819 TGeoTube *sTB0, *sTB1; //,*sM0;
820 TGeoRotation *rot;
821 TGeoTranslation *trans;
822 TGeoCombiTrans *rotrans;
823 Double_t t, t0, t1, a, b, x0, y0,z0, x1, y1;
824 Int_t i, j, k, m;
825 Bool_t tst;
826
827 if(!moth) {
828 AliError("Container volume (argument) is NULL");
829 return;
830 } // end if(!moth)
831 for(i = 0; i < ksecNRadii; i++) {
832 xp[i] = &(xpp[i*(ksecNPointsPerRadii+1)]);
833 yp[i] = &(ypp[i*(ksecNPointsPerRadii+1)]);
834 xp2[i] = &(xpp2[i*(ksecNPointsPerRadii+1)]);
835 yp2[i] = &(ypp2[i*(ksecNPointsPerRadii+1)]);
836 secX2[i] = secX[i];
837 secY2[i] = secY[i];
838 secX3[i] = secX[i];
839 secY3[i] = secY[i];
840 } // end for i
841 //
842 // find starting and ending angles for all but cooling tube sections
843 secAngleStart[0] = 0.5 * ksecAngleSide13;
844 for(i = 0; i < ksecNRadii - 2; i++) {
845 tst = kFALSE;
846 for(j=0;j<ksecNCoolingTubeDips;j++) tst = (tst||i==ksecDipIndex[j]);
847 if (tst) continue;
848 tst = kFALSE;
849 for(j=0;j<ksecNCoolingTubeDips;j++) tst =(tst||(i+1)==ksecDipIndex[j]);
850 if (tst) j = i+2; else j = i+1;
851 AnglesForRoundedCorners(secX[i],secY[i],secR[i],secX[j],secY[j],
852 secR[j],t0,t1);
853 secAngleEnd[i] = t0;
854 secAngleStart[j] = t1;
855 if(secR[i] > 0.0 && secR[j] > 0.0) {
856 if(secAngleStart[i] > secAngleEnd[i]) secAngleEnd[i] += 360.0;
857 } // end if(secR[i]>0.0 && secR[j]>0.0)
858 secAngleStart2[i] = secAngleStart[i];
859 secAngleEnd2[i] = secAngleEnd[i];
860 } // end for i
861 secAngleEnd[ksecNRadii-2] = secAngleStart[ksecNRadii-2] +
862 (secAngleEnd[ksecNRadii-5] - secAngleStart[ksecNRadii-5]);
863 if (secAngleEnd[ksecNRadii-2] < 0.0) secAngleEnd[ksecNRadii-2] += 360.0;
864 secAngleStart[ksecNRadii-1] = secAngleEnd[ksecNRadii-2] - 180.0;
865 secAngleEnd[ksecNRadii-1] = secAngleStart[0];
866 secAngleStart2[ksecNRadii-2] = secAngleStart[ksecNRadii-2];
867 secAngleEnd2[ksecNRadii-2] = secAngleEnd[ksecNRadii-2];
868 secAngleStart2[ksecNRadii-1] = secAngleStart[ksecNRadii-1];
869 secAngleEnd2[ksecNRadii-1] = secAngleEnd[ksecNRadii-1];
870 //
871 // find location of circle last rounded corner.
872 i = 0;
873 j = ksecNRadii - 2;
874 t0 = TanD(secAngleStart[i]-90.);
875 t1 = TanD(secAngleEnd[j]-90.);
876 t = secY[i] - secY[j];
877 // NOTE: secR[i=0] < 0; secR[j=18] > 0; and secR[j+1=19] < 0
878 t += (-secR[i]+secR[j+1]) * SinD(secAngleStart[i]);
879 t -= (secR[j]-secR[j+1]) * SinD(secAngleEnd[j]);
880 t += t1 * secX[j] - t0*secX[i];
881 t += t1 * (secR[j] - secR[j+1]) * CosD(secAngleEnd[j]);
882 t -= t0 * (-secR[i]+secR[j+1]) * CosD(secAngleStart[i]);
883 secX[ksecNRadii-1] = t / (t1-t0);
884 secY[ksecNRadii-1] = TanD(90.0+0.5*ksecAngleSide13)*
885 (secX[ksecNRadii-1]-secX[0])+secY[0];
886 secX2[ksecNRadii-1] = secX[ksecNRadii-1];
887 secY2[ksecNRadii-1] = secY[ksecNRadii-1];
888 secX3[ksecNRadii-1] = secX[ksecNRadii-1];
889 secY3[ksecNRadii-1] = secY[ksecNRadii-1];
890
891 // find location of cooling tube centers
892 for(i = 0; i < ksecNCoolingTubeDips; i++) {
893 j = ksecDipIndex[i];
894 x0 = secX[j-1] + TMath::Abs(secR[j-1]) * CosD(secAngleEnd[j-1]);
895 y0 = secY[j-1] + TMath::Abs(secR[j-1]) * SinD(secAngleEnd[j-1]);
896 x1 = secX[j+1] + TMath::Abs(secR[j+1]) * CosD(secAngleStart[j+1]);
897 y1 = secY[j+1] + TMath::Abs(secR[j+1]) * SinD(secAngleStart[j+1]);
898 t0 = TMath::Sqrt((x0-x1)*(x0-x1)+(y0-y1)*(y0-y1));
899 t = secDip2[i] / t0;
900 a = x0+(x1-x0) * t;
901 b = y0+(y1-y0) * t;
902 if(i == 0) {
903 // get location of tube center->Surface for locating
904 // this sector around the beam pipe.
905 // This needs to be double checked, but I need my notes for that.
906 // (Bjorn Nilsen)
907 xAAtubeCenter0 = x0 + (x1 - x0) * t * 0.5;
908 yAAtubeCenter0 = y0 + (y1 - y0) * t * 0.5;
909 }// end if i==0
910 if(a + b*(a - x0) / (b - y0) > 0.0) {
911 secX[j] = a + TMath::Abs(y1-y0) * 2.0 * ksecDipRadii/t0;
912 secY[j] = b - TMath::Sign(2.0*ksecDipRadii,y1-y0) * (x1-x0)/t0;
913 secX2[j] = a + TMath::Abs(y1-y0) * ksecTl/t0;
914 secY2[j] = b - TMath::Sign(ksecTl,y1-y0) * (x1-x0) / t0;
915 secX3[j] = a + TMath::Abs(y1-y0) *
916 (2.0*ksecDipRadii-0.5*ksecCoolTubeFlatY)/t0;
917 secY3[j] = b - TMath::Sign(2.0*ksecDipRadii-0.5*ksecCoolTubeFlatY,
918 y1-y0)*(x1-x0)/t0;
919 } else {
920 secX[j] = a - TMath::Abs(y1-y0)*2.0*ksecDipRadii/t0;
921 secY[j] = b + TMath::Sign(2.0*ksecDipRadii,y1-y0)*(x1-x0)/t0;
922 secX2[j] = a - TMath::Abs(y1-y0)*ksecTl/t0;
923 secY2[j] = b + TMath::Sign(ksecTl,y1-y0)*(x1-x0)/t0;
924 secX3[j] = a - TMath::Abs(y1-y0)*(2.0*ksecDipRadii-0.5*
925 ksecCoolTubeFlatY)/t0;
926 secY3[j] = b + TMath::Sign(2.0*ksecDipRadii-0.5*ksecCoolTubeFlatY,
927 y1-y0)*(x1-x0)/t0;
928 } // end if(a+b*(a-x0)/(b-y0)>0.0)
929
930 // Set up Start and End angles to correspond to start/end of dips.
931 t1 = (secDip2[i]-TMath::Abs(secR[j])) / t0;
932 secAngleStart[j] =TMath::RadToDeg()*TMath::ATan2(y0+(y1-y0)*t1-secY[j],
933 x0+(x1-x0)*t1-secX[j]);
934 if (secAngleStart[j]<0.0) secAngleStart[j] += 360.0;
935 secAngleStart2[j] = secAngleStart[j];
936 t1 = (secDip2[i]+TMath::Abs(secR[j]))/t0;
937 secAngleEnd[j] = TMath::RadToDeg()*TMath::ATan2(y0+(y1-y0)*t1-secY[j],
938 x0+(x1-x0)*t1-secX[j]);
939 if (secAngleEnd[j]<0.0) secAngleEnd[j] += 360.0;
940 secAngleEnd2[j] = secAngleEnd[j];
941 if (secAngleEnd[j]>secAngleStart[j]) secAngleEnd[j] -= 360.0;
942 secR[j] = TMath::Sqrt(secR[j]*secR[j]+4.0*ksecDipRadii*ksecDipRadii);
943 } // end for i
944
945 // Special cases
946 secAngleStart2[8] -= 360.;
947 secAngleStart2[11] -= 360.;
948
949 SPDsectorShape(ksecNRadii, secX, secY, secR, secAngleStart, secAngleEnd,
950 ksecNPointsPerRadii, m, xp, yp);
951
952 // Fix up dips to be square.
953 for(i = 0; i < ksecNCoolingTubeDips; i++) {
954 j = ksecDipIndex[i];
955 t = 0.5*ksecDipLength+ksecDipRadii;
956 t0 = TMath::RadToDeg()*TMath::ATan(2.0*ksecDipRadii/t);
957 t1 = secAngleEnd[j] + t0;
958 t0 = secAngleStart[j] - t0;
959 x0 = xp[j][1] = secX[j] + t*CosD(t0);
960 y0 = yp[j][1] = secY[j] + t*SinD(t0);
961 x1 = xp[j][ksecNPointsPerRadii-1] = secX[j] + t*CosD(t1);
962 y1 = yp[j][ksecNPointsPerRadii-1] = secY[j] + t*SinD(t1);
963 t0 = 1./((Double_t)(ksecNPointsPerRadii-2));
964 for(k = 2; k < ksecNPointsPerRadii - 1; k++) {
965 // extra points spread them out.
966 t = ((Double_t)(k-1)) * t0;
967 xp[j][k] = x0+(x1-x0) * t;
968 yp[j][k] = y0+(y1-y0) * t;
969 } // end for k
970 secAngleTurbo[i] = -TMath::RadToDeg() * TMath::ATan2(y1-y0, x1-x0);
971 if(GetDebug(3)) {
972 AliInfo(
973 Form("i=%d -- angle=%f -- x0,y0=(%f, %f) -- x1,y1=(%f, %f)",
974 i, secAngleTurbo[i], x0, y0, x1, y1));
975 } // end if GetDebug(3)
976 } // end for i
977 sA0 = new TGeoXtru(2);
978 sA0->SetName("ITS SPD Carbon fiber support Sector A0");
979 sA0->DefinePolygon(m, xpp, ypp);
980 sA0->DefineSection(0, -ksecDz);
981 sA0->DefineSection(1, ksecDz);
982
983 // store the edges of each XY segment which defines
984 // one of the plane zones where staves will have to be placed
985 fSPDsectorX0.Set(ksecNCoolingTubeDips);
986 fSPDsectorY0.Set(ksecNCoolingTubeDips);
987 fSPDsectorX1.Set(ksecNCoolingTubeDips);
988 fSPDsectorY1.Set(ksecNCoolingTubeDips);
989 Int_t ixy0, ixy1;
990 for(i = 0; i < ksecNCoolingTubeDips; i++) {
991 // Find index in xpp[] and ypp[] corresponding to where the
992 // SPD ladders are to be attached. Order them according to
993 // the ALICE numbering schema. Using array of indexes (+-1 for
994 // cooling tubes. For any "bend/dip/edge, there are
995 // ksecNPointsPerRadii+1 points involved.
996 if(i == 0) j = 1;
997 else if (i == 1) j = 0;
998 else j = i;
999 ixy0 = (ksecDipIndex[j]-1)*(ksecNPointsPerRadii+1)+
1000 (ksecNPointsPerRadii);
1001 ixy1 = (ksecDipIndex[j]+1) * (ksecNPointsPerRadii+1);
1002 fSPDsectorX0[i] = sA0->GetX(ixy0);
1003 fSPDsectorY0[i] = sA0->GetY(ixy0);
1004 fSPDsectorX1[i] = sA0->GetX(ixy1);
1005 fSPDsectorY1[i] = sA0->GetY(ixy1);
1006 } // end for i
1007
1008 //printf("SectorA#%d ",0);
1009 InsidePoint(xpp[m-1],ypp[m-1],xpp[0],ypp[0],xpp[1],ypp[1],ksecCthick,
1010 xpp2[0],ypp2[0]);
1011 for(i = 1; i < m - 1; i++) {
1012 j = i / (ksecNPointsPerRadii+1);
1013 //printf("SectorA#%d ",i);
1014 InsidePoint(xpp[i-1],ypp[i-1],xpp[i],ypp[i],xpp[i+1],ypp[i+1],
1015 ksecCthick,xpp2[i],ypp2[i]);
1016 } // end for i
1017 //printf("SectorA#%d ",m);
1018 InsidePoint(xpp[m-2],ypp[m-2],xpp[m-1],ypp[m-1],xpp[0],ypp[0],
1019 ksecCthick,xpp2[m-1],ypp2[m-1]);
1020 // Fix center value of cooling tube dip and
1021 // find location of cooling tube centers
1022 for(i = 0; i < ksecNCoolingTubeDips; i++) {
1023 j = ksecDipIndex[i];
1024 x0 = xp2[j][1];
1025 y0 = yp2[j][1];
1026 x1 = xp2[j][ksecNPointsPerRadii-1];
1027 y1 = yp2[j][ksecNPointsPerRadii-1];
1028 t0 = TMath::Sqrt((x0-x1)*(x0-x1)+(y0-y1)*(y0-y1));
1029 t = secDip2[i]/t0;
1030 for(k = 2; k < ksecNPointsPerRadii - 1; k++) {
1031 // extra points spread them out.
1032 t = ((Double_t)(k-1)) * t0;
1033 xp2[j][k] = x0+(x1-x0) * t;
1034 yp2[j][k] = y0+(y1-y0) * t;
1035 } // end for k
1036 } // end for i
1037 sA1 = new TGeoXtru(2);
1038 sA1->SetName("ITS SPD Carbon fiber support Sector Air A1");
1039 sA1->DefinePolygon(m, xpp2, ypp2);
1040 sA1->DefineSection(0, -ksecDz);
1041 sA1->DefineSection(1, ksecDz);
1042 //
1043 // Error in TGeoEltu. Semi-axis X must be < Semi-axis Y (?).
1044 sTA0 = new TGeoEltu("ITS SPD Cooling Tube TA0", 0.5 * ksecCoolTubeFlatY,
1045 0.5 * ksecCoolTubeFlatX, ksecDz);
1046 sTA1 = new TGeoEltu("ITS SPD Cooling Tube coolant TA1",
1047 sTA0->GetA() - ksecCoolTubeThick,
1048 sTA0->GetB()-ksecCoolTubeThick,ksecDz);
1049 SPDsectorShape(ksecNRadii,secX2,secY2,secR2,secAngleStart2,secAngleEnd2,
1050 ksecNPointsPerRadii, m, xp, yp);
1051 sB0 = new TGeoXtru(2);
1052 sB0->SetName("ITS SPD Carbon fiber support Sector End B0");
1053 sB0->DefinePolygon(m, xpp, ypp);
1054 sB0->DefineSection(0, ksecDz);
1055 sB0->DefineSection(1, ksecDz + ksecZEndLen);
1056
1057 //printf("SectorB#%d ",0);
1058 InsidePoint(xpp[m-1],ypp[m-1],xpp[0],ypp[0],xpp[1],ypp[1],
1059 ksecCthick2,xpp2[0],ypp2[0]);
1060 for(i = 1; i < m - 1; i++) {
1061 t = ksecCthick2;
1062 for(k = 0; k < ksecNCoolingTubeDips; k++)
1063 if((i/(ksecNPointsPerRadii+1))==ksecDipIndex[k])
1064 if(!(ksecDipIndex[k]*(ksecNPointsPerRadii+1) == i ||
1065 ksecDipIndex[k]*(ksecNPointsPerRadii+1) +
1066 ksecNPointsPerRadii == i))
1067 t = ksecRCoolOut-ksecRCoolIn;
1068 //printf("SectorB#%d ",i);
1069 InsidePoint(xpp[i-1],ypp[i-1],xpp[i],ypp[i],xpp[i+1],ypp[i+1],t,
1070 xpp2[i],ypp2[i]);
1071 }// end for i
1072 //printf("SectorB#%d ",m);
1073 InsidePoint(xpp[m-2],ypp[m-2],xpp[m-1],ypp[m-1],xpp[0],ypp[0],
1074 ksecCthick2,xpp2[m-1],ypp2[m-1]);
1075 sB1 = new TGeoXtru(2);
1076 sB1->SetName("ITS SPD Carbon fiber support Sector Air End B1");
1077 sB1->DefinePolygon(m, xpp2, ypp2);
1078 sB1->DefineSection(0,sB0->GetZ(0));
1079 sB1->DefineSection(1,sB0->GetZ(1)-ksecCthick2);
1080 const Double_t kspdEndHoleRadius1=5.698*fgkmm;
1081 const Double_t kspdEndHoleRadius2=2.336*fgkmm;
1082 const Double_t kspdEndHoleDisplacement=6.29*fgkmm;
1083 k = (m-1)/4;
1084 for(i=0;i<=k;i++){
1085 t= ((Double_t)i)/((Double_t)(k));
1086 if(!CFHolePoints(t,kspdEndHoleRadius1,kspdEndHoleRadius2,
1087 kspdEndHoleDisplacement,xpp2[i],ypp2[i])){
1088 Warning("CarbonFiberSector","CFHolePoints failed "
1089 "i=%d m=%d k=%d t=%e",i,m,k,t);
1090 } // end if
1091 // simitry in each quadrant.
1092 xpp2[2*k-i] = -xpp2[i];
1093 ypp2[2*k-i] = ypp2[i];
1094 xpp2[2*k+i] = -xpp2[i];
1095 ypp2[2*k+i] = -ypp2[i];
1096 xpp2[4*k-i] = xpp2[i];
1097 ypp2[4*k-i] = -ypp2[i];
1098 }// end for i
1099 //xpp2[m-1] = xpp2[0]; // begining point in
1100 //ypp2[m-1] = ypp2[0]; // comment with end point
1101 sB2 = new TGeoXtru(2);
1102 sB2->SetName("ITS SPD Hole in Carbon fiber support End plate");
1103 sB2->DefinePolygon(4*k, xpp2, ypp2);
1104 sB2->DefineSection(0,sB1->GetZ(1));
1105 sB2->DefineSection(1,sB0->GetZ(1));
1106 // SPD sector mount blocks
1107 const Double_t kMountBlock[3] = {0.5*(1.8-0.2)*fgkmm,0.5*22.0*fgkmm,
1108 0.5*45.0*fgkmm};
1109 sB3 = new TGeoBBox((Double_t*)kMountBlock);
1110 // SPD sector cooling tubes
1111 sTB0 = new TGeoTube("ITS SPD Cooling Tube End TB0", 0.0,
7708d5f3 1112 0.5*ksecCoolTubeROuter,0.5*(sB1->GetZ(1)-sB1->GetZ(0)));
54c9a3d9 1113 sTB1 = new TGeoTube("ITS SPD Cooling Tube End coolant TB0", 0.0,
1114 sTB0->GetRmax() - ksecCoolTubeThick,sTB0->GetDz());
1115 //
1116 if(GetDebug(3)) {
1117 if(medSPDcf) medSPDcf->Dump(); else AliInfo("medSPDcf = 0");
1118 if(medSPDss) medSPDss->Dump(); else AliInfo("medSPDss = 0");
1119 if(medSPDair) medSPDair->Dump(); else AliInfo("medSPDAir = 0");
1120 if(medSPDcoolfl) medSPDcoolfl->Dump();else AliInfo("medSPDcoolfl = 0");
1121 sA0->InspectShape();
1122 sA1->InspectShape();
1123 sB0->InspectShape();
1124 sB1->InspectShape();
1125 sB2->InspectShape();
1126 } // end if(GetDebug(3))
1127
1128 // create the assembly of the support and place staves on it
1129 TGeoVolumeAssembly *vM0 = new TGeoVolumeAssembly(
1130 "ITSSPDSensitiveVirtualvolumeM0");
1131 StavesInSector(vM0);
1132 // create other volumes with some graphical settings
1133 TGeoVolume *vA0 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorA0",
1134 sA0, medSPDcf);
1135 vA0->SetVisibility(kTRUE);
1136 vA0->SetLineColor(4); // Blue
1137 vA0->SetLineWidth(1);
1138 vA0->SetFillColor(vA0->GetLineColor());
1139 vA0->SetFillStyle(4010); // 10% transparent
1140 TGeoVolume *vA1 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorAirA1",
1141 sA1, medSPDair);
1142 vA1->SetVisibility(kTRUE);
1143 vA1->SetLineColor(7); // light Blue
1144 vA1->SetLineWidth(1);
1145 vA1->SetFillColor(vA1->GetLineColor());
1146 vA1->SetFillStyle(4090); // 90% transparent
1147 TGeoVolume *vTA0 = new TGeoVolume("ITSSPDCoolingTubeTA0", sTA0, medSPDss);
1148 vTA0->SetVisibility(kTRUE);
1149 vTA0->SetLineColor(15); // gray
1150 vTA0->SetLineWidth(1);
1151 vTA0->SetFillColor(vTA0->GetLineColor());
1152 vTA0->SetFillStyle(4000); // 0% transparent
1153 TGeoVolume *vTA1 = new TGeoVolume("ITSSPDCoolingTubeFluidTA1",
1154 sTA1, medSPDcoolfl);
1155 vTA1->SetVisibility(kTRUE);
1156 vTA1->SetLineColor(6); // Purple
1157 vTA1->SetLineWidth(1);
1158 vTA1->SetFillColor(vTA1->GetLineColor());
1159 vTA1->SetFillStyle(4000); // 0% transparent
1160 TGeoVolume *vB0 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorEndB0",
1161 sB0, medSPDcf);
1162 vB0->SetVisibility(kTRUE);
1163 vB0->SetLineColor(1); // Black
1164 vB0->SetLineWidth(1);
1165 vB0->SetFillColor(vB0->GetLineColor());
1166 vB0->SetFillStyle(4000); // 0% transparent
1167 TGeoVolume *vB1 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorEndAirB1",
1168 sB1, medSPDair);
1169 vB1->SetVisibility(kTRUE);
1170 vB1->SetLineColor(0); // white
1171 vB1->SetLineWidth(1);
1172 vB1->SetFillColor(vB1->GetLineColor());
1173 vB1->SetFillStyle(4100); // 100% transparent
1174 TGeoVolume *vB2 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorEndAirB2",
1175 sB2, medSPDair);
1176 vB2->SetVisibility(kTRUE);
1177 vB2->SetLineColor(0); // white
1178 vB2->SetLineWidth(1);
1179 vB2->SetFillColor(vB2->GetLineColor());
1180 vB2->SetFillStyle(4100); // 100% transparent
1181 TGeoVolume *vB3 = new TGeoVolume(
1182 "ITSSPDCarbonFiberSupportSectorMountBlockB3",sB3, medSPDcf);
1183 vB3->SetVisibility(kTRUE);
1184 vB3->SetLineColor(1); // Black
1185 vB3->SetLineWidth(1);
1186 vB3->SetFillColor(vB3->GetLineColor());
1187 vB3->SetFillStyle(4000); // 0% transparent
1188 TGeoVolume *vTB0 = new TGeoVolume("ITSSPDCoolingTubeEndTB0",sTB0,medSPDss);
1189 vTB0->SetVisibility(kTRUE);
1190 vTB0->SetLineColor(15); // gray
1191 vTB0->SetLineWidth(1);
1192 vTB0->SetFillColor(vTB0->GetLineColor());
1193 vTB0->SetFillStyle(4000); // 0% transparent
1194 TGeoVolume *vTB1 = new TGeoVolume("ITSSPDCoolingTubeEndFluidTB1",sTB1,
1195 medSPDcoolfl);
1196 vTB1->SetVisibility(kTRUE);
1197 vTB1->SetLineColor(7); // light blue
1198 vTB1->SetLineWidth(1);
1199 vTB1->SetFillColor(vTB1->GetLineColor());
1200 vTB1->SetFillStyle(4050); // 0% transparent
1201
1202 // add volumes to mother container passed as argument of this method
1203 moth->AddNode(vM0,1,0); // Add virtual volume to mother
1204 vA0->AddNode(vA1,1,0); // Put air inside carbon fiber.
1205 vB0->AddNode(vB1,1,0); // Put air inside carbon fiber ends.
1206 vB0->AddNode(vB2,1,0); // Put air wholes inside carbon fiber ends
1207 vTA0->AddNode(vTA1,1,0); // Put cooling liquid indide tube middel.
1208 vTB0->AddNode(vTB1,1,0); // Put cooling liquid inside tube end.
1209 Double_t tubeEndLocal[3]={0.0,0.0,sTA0->GetDz()};
1210 for(i = 0; i < ksecNCoolingTubeDips; i++) {
1211 x0 = secX3[ksecDipIndex[i]];
1212 y0 = secY3[ksecDipIndex[i]];
1213 t = 90.0 - secAngleTurbo[i];
1214 trans = new TGeoTranslation("",x0,y0,0.5*(sB1->GetZ(0)+sB1->GetZ(1)));
1215 vB1->AddNode(vTB0, i+1, trans);
1216 // Find location of tube ends for later use.
1217 trans->LocalToMaster(tubeEndLocal,fTubeEndSector[0][0][i]);
1218 rot = new TGeoRotation("", 0.0, 0.0, t);
1219 rotrans = new TGeoCombiTrans("", x0, y0, 0.0, rot);
1220 vM0->AddNode(vTA0, i+1, rotrans);
1221 } // end for i
1222 vM0->AddNode(vA0, 1, 0);
1223 vM0->AddNode(vB0, 1, 0);
1224 // Reflection.
1225 rot = new TGeoRotation("", 90., 0., 90., 90., 180., 0.);
1226 vM0->AddNode(vB0,2,rot);
1227 // Find location of tube ends for later use.
1228 for(i=0;i<ksecNCoolingTubeDips;i++) rot->LocalToMaster(
1229 fTubeEndSector[0][0][i],fTubeEndSector[0][1][i]);
1230 // left side
1231 t = -TMath::RadToDeg()*TMath::ATan2(
1232 sB0->GetX(0)-sB0->GetX(sB0->GetNvert()-1),
1233 sB0->GetY(0)-sB0->GetY(sB0->GetNvert()-1));
1234 rot = new TGeoRotation("",t,0.0,0.0);// z axis rotation
1235 x0 = 0.5*(sB0->GetX(0)+sB0->GetX(sB0->GetNvert()-1))+
1236 sB3->GetDX()*TMath::Cos(t*TMath::DegToRad());
1237 y0 = 0.5*(sB0->GetY(0)+sB0->GetY(sB0->GetNvert()-1))+
1238 sB3->GetDX()*TMath::Sin(t*TMath::DegToRad());
1239 z0 = sB0->GetZ(0)+sB3->GetDZ();
1240 rotrans = new TGeoCombiTrans("",x0,y0,z0,rot);
1241 vM0->AddNode(vB3,1,rotrans); // Put Mounting bracket on sector
1242 rotrans = new TGeoCombiTrans("",x0,y0,-z0,rot);
1243 vM0->AddNode(vB3,2,rotrans); // Put Mounting bracket on sector
1244 /*
1245 j = 0; // right side, find point with largest x value
1246 x1 = sB0->GetX(0);
1247 for(i=1;i<sB0->GetNvert();i++)if(sB0->GetX(i)>x1) {j=i;x1=sB0->GetX(i);}
1248 j--; // Too big by 1
1249 //t = -TMath::RadToDeg()*TMath::ATan2(
1250 // sB0->GetX(j)-sB0->GetX(j-1),
1251 // sB0->GetY(j)-sB0->GetY(j-1));
1252 */
1253 t *= -1.0;
1254 rot = new TGeoRotation("",t,0.0,0.0); // z axis rotation
1255 /* // this way gets correct orientation but wrong "height"
1256 x0 = 0.5*(sB0->GetX(j)+sB0->GetX(j-1))+
1257 sB3->GetDX()*TMath::Cos(t*TMath::DegToRad());
1258 y0 = 0.5*(sB0->GetY(j)+sB0->GetY(j-1))+
1259 sB3->GetDX()*TMath::Sin(t*TMath::DegToRad());
1260 z0 = sB0->GetZ(0)+sB3->GetDZ();
1261 */ // I don't understand the need for this factor 3.5.
1262 // posibly the SPD sector as coded isn't symetric which the
1263 // plans would suggest.
1264 x0 = -0.5*(sB0->GetX(0)+sB0->GetX(sB0->GetNvert()-1))-3.5*
1265 sB3->GetDX()*TMath::Cos(t*TMath::DegToRad());
1266 y0 = 0.5*(sB0->GetY(0)+sB0->GetY(sB0->GetNvert()-1))-3.5*
1267 sB3->GetDX()*TMath::Sin(t*TMath::DegToRad());
22726349 1268 rotrans = new TGeoCombiTrans("",1.01*x0,y0,z0,rot);
54c9a3d9 1269 vM0->AddNode(vB3,3,rotrans); // Put Mounting bracket on sector
22726349 1270 rotrans = new TGeoCombiTrans("",1.01*x0,y0,-z0,rot);
54c9a3d9 1271 vM0->AddNode(vB3,4,rotrans); // Put Mounting bracket on sector
1272 if(GetDebug(3)){
1273 vM0->PrintNodes();
1274 vA0->PrintNodes();
1275 vA1->PrintNodes();
1276 vB0->PrintNodes();
1277 vB1->PrintNodes();
1278 vB2->PrintNodes();
1279 vB3->PrintNodes();
1280 vTA0->PrintNodes();
1281 vTA1->PrintNodes();
1282 vTB0->PrintNodes();
1283 vTB1->PrintNodes();
1284 } // end if(GetDebug(3))
bc3498f4 1285}
54c9a3d9 1286//______________________________________________________________________
1287Bool_t AliITSv11GeometrySPD::CFHolePoints(Double_t s,Double_t r1,
1288 Double_t r2,Double_t l,Double_t &x,Double_t &y) const
bc3498f4 1289{
54c9a3d9 1290 //
1291 // Step along arck a distancs ds and compute boundry of
1292 // two holes (radius r1 and r2) a distance l apart (along
1293 // x-axis).
1294 // Inputs:
1295 // Double_t s fractional Distance along arcs [0-1]
1296 // where 0-> alpha=beta=0, 1-> alpha=90 degrees.
1297 // Double_t r1 radius at center circle
1298 // Double_t r2 radius of displaced circle
1299 // Double_t l Distance displaced circle is displaces (x-axis)
1300 // Output:
1301 // Double_t x x coordinate along double circle.
1302 // Double_t y y coordinate along double circle.
1303 // Return:
1304 // logical, kFALSE if an error
1305 //
1306 Double_t alpha,beta;
1307 Double_t ac,bc,scb,sca,t,alphac,betac; // at intersection of two circles
1308
1309 x=y=0.0;
1310 ac = r1*r1-l*l-r2*r2;
1311 bc = 2.*l*r2;
1312 if(bc==0.0) {printf("bc=0 l=%e r2=%e\n",l,r2);return kFALSE;}
1313 betac = TMath::ACos(ac/bc);
60e55aee 1314 alphac = TMath::Sqrt((bc-ac)*(bc+ac))/(2.*l*r1);
54c9a3d9 1315 scb = r2*betac;
1316 sca = r1*alphac;
1317 t = r1*0.5*TMath::Pi() - sca + scb;
1318 if(s<= scb/t){
1319 beta = s*t/r2;
1320 x = r2*TMath::Cos(beta) + l;
1321 y = r2*TMath::Sin(beta);
1322 //printf("betac=%e scb=%e t=%e s=%e beta=%e x=%e y=%e\n",
1323 // betac,scb,t,s,beta,x,y);
1324 return kTRUE;
1325 }else{
1326 beta = (s*t-scb+sca)/(r1*0.5*TMath::Pi());
1327 alpha = beta*0.5*TMath::Pi();
1328 x = r1*TMath::Cos(alpha);
1329 y = r1*TMath::Sin(alpha);
1330 //printf("alphac=%e sca=%e t=%e s=%e beta=%e alpha=%e x=%e y=%e\n",
1331 // alphac,sca,t,s,beta,alpha,x,y);
1332 return kTRUE;
1333 } // end if
1334 return kFALSE;
bc3498f4 1335}
54c9a3d9 1336//______________________________________________________________________
1337Bool_t AliITSv11GeometrySPD::GetSectorMountingPoints(Int_t index,Double_t &x0,
1338 Double_t &y0, Double_t &x1, Double_t &y1) const
bc3498f4 1339{
54c9a3d9 1340 //
1341 // Returns the edges of the straight borders in the SPD sector shape,
1342 // which are used to mount staves on them.
1343 // Coordinate system is that of the carbon fiber sector volume.
1344 // ---
1345 // Index numbering is as follows:
1346 // /5
1347 // /\/4
1348 // 1\ \/3
1349 // 0|___\/2
1350 // ---
1351 // Arguments [the ones passed by reference contain output values]:
1352 // Int_t index --> location index according to above scheme [0-5]
1353 // Double_t &x0 --> (by ref) x0 location or the ladder sector [cm]
1354 // Double_t &y0 --> (by ref) y0 location of the ladder sector [cm]
1355 // Double_t &x1 --> (by ref) x1 location or the ladder sector [cm]
1356 // Double_t &y1 --> (by ref) y1 location of the ladder sector [cm]
1357 // TGeoManager *mgr --> The TGeo builder
1358 // ---
1359 // The location is described by a line going from (x0, y0) to (x1, y1)
1360 // ---
1361 // Returns kTRUE if no problems encountered.
1362 // Returns kFALSE if a problem was encountered (e.g.: shape not found).
1363 //
1364 Int_t isize = fSPDsectorX0.GetSize();
1365
1366 x0 = x1 = y0 = y1 = 0.0;
1367 if(index < 0 || index > isize) {
1368 AliError(Form("index = %d: allowed 0 --> %", index, isize));
1369 return kFALSE;
1370 } // end if(index<0||index>isize)
1371 x0 = fSPDsectorX0[index];
1372 x1 = fSPDsectorX1[index];
1373 y0 = fSPDsectorY0[index];
1374 y1 = fSPDsectorY1[index];
1375 return kTRUE;
bc3498f4 1376}
54c9a3d9 1377//______________________________________________________________________
1378void AliITSv11GeometrySPD::SPDsectorShape(Int_t n,const Double_t *xc,
1379 const Double_t *yc, const Double_t *r,
1380 const Double_t *ths, const Double_t *the,
1381 Int_t npr, Int_t &m, Double_t **xp, Double_t **yp) const
bc3498f4 1382{
54c9a3d9 1383 //
1384 // Code to compute the points that make up the shape of the SPD
1385 // Carbon fiber support sections
1386 // Inputs:
1387 // Int_t n size of arrays xc,yc, and r.
1388 // Double_t *xc array of x values for radii centers.
1389 // Double_t *yc array of y values for radii centers.
1390 // Double_t *r array of signed radii values.
1391 // Double_t *ths array of starting angles [degrees].
1392 // Double_t *the array of ending angles [degrees].
1393 // Int_t npr the number of lines segments to aproximate the arc.
1394 // Outputs (arguments passed by reference):
1395 // Int_t m the number of enetries in the arrays *xp[npr+1]
1396 // and *yp[npr+1].
1397 // Double_t **xp array of x coordinate values of the line segments
1398 // which make up the SPD support sector shape.
1399 // Double_t **yp array of y coordinate values of the line segments
1400 // which make up the SPD support sector shape.
1401 //
1402 Int_t i, k;
1403 Double_t t, t0, t1;
1404
1405 m = n*(npr + 1);
1406 if(GetDebug(2)) {
1407 cout <<" X \t Y \t R \t S \t E" << m << endl;
1408 for(i = 0; i < n; i++) {
1409 cout << "{" << xc[i] << ", ";
1410 cout << yc[i] << ", ";
1411 cout << r[i] << ", ";
1412 cout << ths[i] << ", ";
1413 cout << the[i] << "}, " << endl;
1414 } // end for i
1415 } // end if(GetDebug(2))
1416 if (GetDebug(3)) cout << "Double_t sA0 = [" << n*(npr+1)+1<<"][";
1417 if (GetDebug(4)) cout << "3] {";
1418 else if(GetDebug(3)) cout <<"2] {";
1419 t0 = (Double_t)npr;
1420 for(i = 0; i < n; i++) {
1421 t1 = (the[i] - ths[i]) / t0;
1422 if(GetDebug(5)) cout << "t1 = " << t1 << endl;
1423 for(k = 0; k <= npr; k++) {
1424 t = ths[i] + ((Double_t)k) * t1;
1425 xp[i][k] = TMath::Abs(r[i]) * CosD(t) + xc[i];
1426 yp[i][k] = TMath::Abs(r[i]) * SinD(t) + yc[i];
1427 if(GetDebug(3)) {
1428 cout << "{" << xp[i][k] << "," << yp[i][k];
1429 if (GetDebug(4)) cout << "," << t;
1430 cout << "},";
1431 } // end if GetDebug
1432 } // end for k
1433 if(GetDebug(3)) cout << endl;
1434 } // end of i
1435 if(GetDebug(3)) cout << "{" << xp[0][0] << ", " << yp[0][0];
1436 if(GetDebug(4)) cout << "," << ths[0];
1437 if(GetDebug(3)) cout << "}}" << endl;
592651e2 1438}
22726349 1439
54c9a3d9 1440//______________________________________________________________________
1441TGeoVolume* AliITSv11GeometrySPD::CreateLadder(Int_t layer,TArrayD &sizes,
1442 TGeoManager *mgr) const
bc3498f4 1443{
54c9a3d9 1444 //
1445 // Creates the "ladder" = silicon sensor + 5 chips.
1446 // Returns a TGeoVolume containing the following components:
1447 // - the sensor (TGeoBBox), whose name depends on the layer
1448 // - 5 identical chips (TGeoBBox)
1449 // - a guard ring around the sensor (subtraction of TGeoBBoxes),
1450 // which is separated from the rest of sensor because it is not
1451 // a sensitive part
1452 // - bump bondings (TGeoBBox stripes for the whole width of the
1453 // sensor, one per column).
1454 // ---
1455 // Arguments:
1456 // 1 - the owner layer (MUST be 1 or 2 or a fatal error is raised)
1457 // 2 - a TArrayD passed by reference, which will contain relevant
1458 // dimensions related to this object:
1459 // size[0] = 'thickness' (the smallest dimension)
1460 // size[1] = 'length' (the direction along the ALICE Z axis)
1461 // size[2] = 'width' (extension in the direction perp. to the
1462 // above ones)
1463 // 3 - the used TGeoManager
1464
3ffa185f 1465 // ** CRITICAL CHECK **
54c9a3d9 1466 // layer number can be ONLY 1 or 2
1467 if (layer != 1 && layer != 2) AliFatal("Layer number MUST be 1 or 2");
1468
1469 // ** MEDIA **
1470 TGeoMedium *medAir = GetMedium("AIR$",mgr);
1471 TGeoMedium *medSPDSiChip = GetMedium("SPD SI CHIP$",mgr); // SPD SI CHIP
1472 TGeoMedium *medSi = GetMedium("SI$",mgr);
1473 TGeoMedium *medBumpBond = GetMedium("COPPER$",mgr); // ??? BumpBond
1474
3ffa185f 1475 // ** SIZES **
54c9a3d9 1476 Double_t chipThickness = fgkmm * 0.150;
1477 Double_t chipWidth = fgkmm * 15.950;
1478 Double_t chipLength = fgkmm * 13.600;
1479 Double_t chipSpacing = fgkmm * 0.400; // separation of chips along Z
1480 Double_t sensThickness = fgkmm * 0.200;
1481 Double_t sensLength = fgkmm * 69.600;
1482 Double_t sensWidth = fgkmm * 12.800;
1483 Double_t guardRingWidth = fgkmm * 0.560; // a border of this thickness
1484 // all around the sensor
1485 Double_t bbLength = fgkmm * 0.042;
1486 Double_t bbWidth = sensWidth;
1487 Double_t bbThickness = fgkmm * 0.012;
1488 Double_t bbPos = 0.080; // Z position w.r. to left pixel edge
1489 // compute the size of the container volume which
1490 // will also be returned in the referenced TArrayD;
1491 // for readability, they are linked by reference to a more meaningful name
1492 sizes.Set(3);
1493 Double_t &thickness = sizes[0];
1494 Double_t &length = sizes[1];
1495 Double_t &width = sizes[2];
1496 // the container is a box which exactly enclose all the stuff;
1497 width = chipWidth;
1498 length = sensLength + 2.0*guardRingWidth;
1499 thickness = sensThickness + chipThickness + bbThickness;
1500
1501 // ** VOLUMES **
1502 // While creating this volume, since it is a sensitive volume,
1503 // we must respect some standard criteria for its local reference frame.
1504 // Local X must correspond to x coordinate of the sensitive volume:
1505 // this means that we are going to create the container with a local
1506 // reference system that is **not** in the middle of the box.
1507 // This is accomplished by calling the shape constructor with an
1508 // additional option ('originShift'):
1509 Double_t xSens = 0.5 * (width - sensWidth - 2.0*guardRingWidth);
1510 Double_t originShift[3] = {-xSens, 0., 0.};
1511 TGeoBBox *shapeContainer = new TGeoBBox(0.5*width,0.5*thickness,
1512 0.5*length,originShift);
1513 // then the volume is made of air, and using this shape
1514 TGeoVolume *container = new TGeoVolume(Form("ITSSPDlay%d-Ladder",layer),
1515 shapeContainer, medAir);
1516 // the chip is a common box
1517 TGeoVolume *volChip = mgr->MakeBox("ITSSPDchip",medSPDSiChip,
1518 0.5*chipWidth,0.5*chipThickness,0.5*chipLength);
1519 // the sensor as well
1520 TGeoVolume *volSens = mgr->MakeBox(GetSenstiveVolumeName(layer),medSi,
1521 0.5*sensWidth,0.5*sensThickness,0.5*sensLength);
1522 // the guard ring shape is the subtraction of two boxes with the
1523 // same center.
1524 TGeoBBox *shIn = new TGeoBBox(0.5*sensWidth,sensThickness,0.5*sensLength);
1525 TGeoBBox *shOut = new TGeoBBox(0.5*sensWidth+guardRingWidth,
1526 0.5*sensThickness,0.5*sensLength+guardRingWidth);
1527 shIn->SetName("ITSSPDinnerBox");
1528 shOut->SetName("ITSSPDouterBox");
1529 TGeoCompositeShape *shBorder = new TGeoCompositeShape(
1530 "ITSSPDgaurdRingBorder",Form("%s-%s",shOut->GetName(),shIn->GetName()));
1531 TGeoVolume *volBorder = new TGeoVolume("ITSSPDgaurdRing",shBorder,medSi);
1532 // bump bonds for one whole column
1533 TGeoVolume *volBB = mgr->MakeBox("ITSSPDbb",medBumpBond,0.5*bbWidth,
1534 0.5*bbThickness,0.5*bbLength);
1535 // set colors of all objects for visualization
1536 volSens->SetLineColor(kYellow + 1);
1537 volChip->SetLineColor(kGreen);
1538 volBorder->SetLineColor(kYellow + 3);
1539 volBB->SetLineColor(kGray);
1540
1541 // ** MOVEMENTS **
1542 // sensor is translated along thickness (X) and width (Y)
1543 Double_t ySens = 0.5 * (thickness - sensThickness);
1544 Double_t zSens = 0.0;
1545 // we want that the x of the ladder is the same as the one of
1546 // its sensitive volume
1547 TGeoTranslation *trSens = new TGeoTranslation(0.0, ySens, zSens);
1548 // bump bonds are translated along all axes:
1549 // keep same Y used for sensors, but change the Z
1550 TGeoTranslation *trBB[160];
1551 Double_t x = 0.0;
1552 Double_t y = 0.5 * (thickness - bbThickness) - sensThickness;
1553 Double_t z = -0.5 * sensLength + guardRingWidth + fgkmm*0.425 - bbPos;
1554 Int_t i;
1555 for (i = 0; i < 160; i++) {
1556 trBB[i] = new TGeoTranslation(x, y, z);
1557 switch(i) {
1558 case 31:case 63:case 95:case 127:
1559 z += fgkmm * 0.625 + fgkmm * 0.2;
1560 break;
1561 default:
1562 z += fgkmm * 0.425;
1563 } // end switch
1564 } // end for i
1565 // the chips are translated along the length (Z) and thickness (X)
1566 TGeoTranslation *trChip[5] = {0, 0, 0, 0, 0};
1567 x = -xSens;
1568 y = 0.5 * (chipThickness - thickness);
1569 z = 0.0;
1570 for (i = 0; i < 5; i++) {
1571 z = -0.5*length + guardRingWidth
1572 + (Double_t)i*chipSpacing + ((Double_t)(i) + 0.5)*chipLength;
1573 trChip[i] = new TGeoTranslation(x, y, z);
1574 } // end ofr i
1575
1576 // add nodes to container
1577 container->AddNode(volSens, 1, trSens);
1578 container->AddNode(volBorder, 1, trSens);
1579 for (i = 0; i < 160; i++) container->AddNode(volBB,i+1,trBB[i]);
1580 for (i = 0; i < 5; i++) container->AddNode(volChip,i+3,trChip[i]);
1581 // return the container
1582 return container;
592651e2 1583}
22726349 1584
1585/*
1586//______________________________________________________________________
1587TGeoVolume* AliITSv11GeometrySPD::CreateLadder
1588 (Int_t layer, TArrayD &sizes, TGeoManager *mgr) const
1589{
1590 //
1591 // Creates the "ladder" = silicon sensor + 5 chips.
1592 // Returns a TGeoVolume containing the following components:
1593 // - the sensor (TGeoBBox), whose name depends on the layer
1594 // - 5 identical chips (TGeoBBox)
1595 // - a guard ring around the sensor (subtraction of TGeoBBoxes),
1596 // which is separated from the rest of sensor because it is not
1597 // a sensitive part
1598 // - bump bondings (TGeoBBox stripes for the whole width of the
1599 // sensor, one per column).
1600 // ---
1601 // Arguments:
1602 // 1 - the owner layer (MUST be 1 or 2 or a fatal error is raised)
1603 // 2 - a TArrayD passed by reference, which will contain relevant
1604 // dimensions related to this object:
1605 // size[0] = 'thickness' (the smallest dimension)
1606 // size[1] = 'length' (the direction along the ALICE Z axis)
1607 // size[2] = 'width' (extension in the direction perp. to the
1608 // above ones)
1609 // 3 - the used TGeoManager
1610
1611 // ** CRITICAL CHECK ******************************************************
1612 // layer number can be ONLY 1 or 2
1613 if (layer != 1 && layer != 2) AliFatal("Layer number MUST be 1 or 2");
1614
1615 // ** MEDIA ***************************************************************
1616
1617 TGeoMedium *medAir = GetMedium("AIR$",mgr);
1618 TGeoMedium *medSPDSiChip = GetMedium("SPD SI CHIP$",mgr); // SPD SI CHIP
1619 TGeoMedium *medSi = GetMedium("SI$",mgr);
1620 TGeoMedium *medBumpBond = GetMedium("COPPER$",mgr); // ??? BumpBond
1621
1622 // ** SIZES ***************************************************************
3ffa185f 1623
22726349 1624 Double_t chipThickness = fgkmm * 0.150;
1625 Double_t chipWidth = fgkmm * 15.950;
1626 Double_t chipLength = fgkmm * 13.600;
1627 Double_t chipSpacing = fgkmm * 0.400; // separation of chips along Z
1628 Double_t sensThickness = fgkmm * 0.200;
1629 Double_t sensLength = fgkmm * 69.600;
1630 Double_t sensWidth = fgkmm * 12.800;
1631 Double_t guardRingWidth = fgkmm * 0.560; // guard ring around sensor
1632 Double_t bbLength = fgkmm * 0.042;
1633 Double_t bbWidth = sensWidth;
1634 Double_t bbThickness = fgkmm * 0.012;
1635 Double_t bbPos = 0.080; // Z position w.r. to left pixel edge
1636
1637 // the three dimensions of the box which contains the ladder
1638 // are returned in the 'sizes' argument, and are used for volumes positionement
1639 // for readability purpose, they are linked by reference to a more meaningful name
1640 sizes.Set(3);
1641 Double_t &thickness = sizes[0];
1642 Double_t &length = sizes[1];
1643 Double_t &width = sizes[2];
1644 // the container is a box which exactly enclose all the stuff
1645 width = chipWidth;
1646 length = sensLength + 2.0*guardRingWidth;
1647 thickness = sensThickness + chipThickness + bbThickness;
1648
1649 // ** VOLUMES *************************************************************
1650
1651 // This is a sensitive volume.
1652 // Local X must correspond to x coordinate of the sensitive volume:
1653 // to respect this, the origin of the local reference system
1654 // must be shifted from the middle of the box, using
1655 // an additional option ('originShift') when creating the container shape:
1656 Double_t xSens = 0.5 * (width - sensWidth - 2.0*guardRingWidth);
1657 Double_t originShift[3] = {-xSens, 0., 0.};
1658
1659 // now the container is a TGeoBBox with this shift,
1660 // and the volume is made of air (it does not exist in reality)
1661 TGeoBBox *shLadder = new TGeoBBox(0.5*width, 0.5*thickness, 0.5*length, originShift);
1662 TGeoVolume *vLadder = new TGeoVolume(Form("ITSSPDlay%d-Ladder", layer), shLadder, medAir);
1663
1664 // the chip is a common box
1665 TGeoVolume *vChip = mgr->MakeBox("ITSSPDchip", medSPDSiChip,
1666 0.5*chipWidth, 0.5*chipThickness, 0.5*chipLength);
1667
1668 // to build the sensor with its guard ring, we create a TGeoBBox with the size
1669 // of the sensor + guard ring, and we insert the true sensor into it as an
1670 // internal node: this simplifies the implementation with the same result
1671 TGeoVolume *vSensGuard = mgr->MakeBox(Form("%s-guardRing", GetSenstiveVolumeName(layer)),
1672 medSi,
1673 0.5*sensWidth + guardRingWidth,
1674 0.5*sensThickness,
1675 0.5*sensLength + guardRingWidth);
1676 TGeoVolume *vSens = mgr->MakeBox(GetSenstiveVolumeName(layer), medSi,
1677 0.5*sensWidth,0.5*sensThickness,0.5*sensLength);
1678 vSensGuard->AddNode(vSens, 0);
1679 vSensGuard->SetTransparency(50);
1680
1681 // bump bond is a common box for one whole column
1682 TGeoVolume *vBB = mgr->MakeBox("ITSSPDbb", medBumpBond,
1683 0.5*bbWidth, 0.5*bbThickness, 0.5*bbLength);
1684
1685 // set colors of all objects for visualization
1686 vLadder->SetLineColor(kRed);
1687 vSens->SetLineColor(kYellow + 1);
1688 vChip->SetLineColor(kGreen);
1689 vSensGuard->SetLineColor(kYellow + 3);
1690 vBB->SetLineColor(kGray);
1691
1692 // ** MOVEMENTS **
1693 // sensor is translated along thickness (Y) and width (X)
1694 Double_t ySens = 0.5 * (thickness - sensThickness);
1695 Double_t zSens = 0.0;
1696 // we want that the x of the ladder is the same as the one of
1697 // its sensitive volume
1698 TGeoTranslation *trSens = new TGeoTranslation(0.0, ySens, zSens);
1699 // bump bonds are translated along all axes:
1700 // keep same Y used for sensors, but change the Z
1701 TGeoTranslation *trBB[160];
1702 Double_t x = 0.0;
1703 Double_t y = 0.5 * (thickness - bbThickness) - sensThickness;
1704 Double_t z = -0.5 * sensLength + guardRingWidth + fgkmm*0.425 - bbPos;
1705 Int_t i;
1706 for (i = 0; i < 160; i++) {
1707 trBB[i] = new TGeoTranslation(x, y, z);
1708 switch(i) {
1709 case 31:case 63:case 95:case 127:
1710 z += fgkmm * 0.625 + fgkmm * 0.2;
1711 break;
1712 default:
1713 z += fgkmm * 0.425;
1714 } // end switch
1715 } // end for i
1716 // the chips are translated along the length (Z) and thickness (X)
1717 TGeoTranslation *trChip[5] = {0, 0, 0, 0, 0};
1718 x = -xSens;
1719 y = 0.5 * (chipThickness - thickness);
1720 z = 0.0;
1721 for (i = 0; i < 5; i++) {
1722 z = -0.5*length + guardRingWidth
1723 + (Double_t)i*chipSpacing + ((Double_t)(i) + 0.5)*chipLength;
1724 trChip[i] = new TGeoTranslation(x, y, z);
1725 } // end ofr i
1726
1727 // add nodes to container
1728 vLadder->AddNode(vSensGuard, 1, trSens);
1729 //vLadderAddNode(volBorder, 1, trSens);
1730 for (i = 0; i < 160; i++) vLadder->AddNode(vBB,i+1,trBB[i]);
1731 for (i = 0; i < 5; i++) vLadder->AddNode(vChip,i+3,trChip[i]);
1732 // return the container
1733 return vLadder;
1734}
1735*/
1736
7855ea93 1737//______________________________________________________________________
54c9a3d9 1738TGeoVolume* AliITSv11GeometrySPD::CreateClip(TArrayD &sizes,Bool_t isDummy,
1739 TGeoManager *mgr) const
1740{
1741 //
1742 // Creates the carbon fiber clips which are added to the central ladders.
1743 // They have a complicated shape which is approximated by a TGeoXtru
1744 // Implementation of a single clip over an half-stave.
1745 // It has a complicated shape which is approximated to a section like this:
1746 //
1747 // 6
1748 // /\ .
1749 // 7 //\\ 5
1750 // / 1\\___________________4
1751 // 0 \___________________
1752 // 2 3
1753 // with a finite thickness for all the shape
1754 // Its local reference frame is such that point A corresponds to origin.
1755 //
1756 Double_t fullLength = fgkmm * 12.6; // = x4 - x0
1757 Double_t flatLength = fgkmm * 5.4; // = x4 - x3
1758 Double_t inclLongLength = fgkmm * 5.0; // = 5-6
1759 Double_t inclShortLength = fgkmm * 2.0; // = 6-7
1760 Double_t fullHeight = fgkmm * 2.8; // = y6 - y3
3ffa185f 1761 Double_t thickness = fgkmm * 0.18; // thickness
54c9a3d9 1762 Double_t totalLength = fgkmm * 52.0; // total length in Z
22726349 1763 Double_t holeSize = fgkmm * 5.0; // dimension of cubic
54c9a3d9 1764 // hole inserted for pt1000
1765 Double_t angle1 = 27.0; // supplementary of angle DCB
1766 Double_t angle2; // angle DCB
1767 Double_t angle3; // angle of GH with vertical
1768
1769 angle2 = 0.5 * (180.0 - angle1);
1770 angle3 = 90.0 - TMath::ACos(fullLength - flatLength -
1771 inclLongLength*TMath::Cos(angle1)) *
1772 TMath::RadToDeg();
1773 angle1 *= TMath::DegToRad();
1774 angle2 *= TMath::DegToRad();
1775 angle3 *= TMath::DegToRad();
1776
1777 Double_t x[8], y[8];
1778
1779 x[0] = 0.0;
1780 x[1] = x[0] + fullLength - flatLength - inclLongLength*TMath::Cos(angle1);
1781 x[2] = x[0] + fullLength - flatLength;
1782 x[3] = x[0] + fullLength;
1783 x[4] = x[3];
1784 x[5] = x[4] - flatLength + thickness * TMath::Cos(angle2);
1785 x[6] = x[1];
1786 x[7] = x[0];
1787
1788 y[0] = 0.0;
1789 y[1] = y[0] + inclShortLength * TMath::Cos(angle3);
1790 y[2] = y[1] - inclLongLength * TMath::Sin(angle1);
1791 y[3] = y[2];
1792 y[4] = y[3] + thickness;
1793 y[5] = y[4];
1794 y[6] = y[1] + thickness;
1795 y[7] = y[0] + thickness;
1796
1797 sizes.Set(7);
1798 sizes[0] = totalLength;
1799 sizes[1] = fullHeight;
1800 sizes[2] = y[2];
1801 sizes[3] = y[6];
1802 sizes[4] = x[0];
1803 sizes[5] = x[3];
1804 sizes[6] = x[2];
1805
1806 if(isDummy){// use this argument when on ewant just the
1807 // positions without create any volume
1808 return NULL;
1809 } // end if isDummy
1810
1811 TGeoXtru *shClip = new TGeoXtru(2);
1812 shClip->SetName("ITSSPDshclip");
1813 shClip->DefinePolygon(8, x, y);
1814 shClip->DefineSection(0, -0.5*totalLength, 0., 0., 1.0);
1815 shClip->DefineSection(1, 0.5*totalLength, 0., 0., 1.0);
1816
1817 TGeoBBox *shHole = new TGeoBBox("ITSSPDSHClipHole",0.5*holeSize,
1818 0.5*holeSize,0.5*holeSize);
1819 TGeoTranslation *tr1 = new TGeoTranslation("ITSSPDTRClipHole1",x[2],0.0,
1820 fgkmm*14.);
1821 TGeoTranslation *tr2 = new TGeoTranslation("ITSSPDTRClipHole2",x[2],0.0,
1822 0.0);
1823 TGeoTranslation *tr3 = new TGeoTranslation("ITSSPDTRClipHole3",x[2],0.0,
1824 -fgkmm*14.);
1825 tr1->RegisterYourself();
1826 tr2->RegisterYourself();
1827 tr3->RegisterYourself();
1828
1829 //TString strExpr("ITSSPDshclip-(");
1830 TString strExpr(shClip->GetName());
1831 strExpr.Append("-(");
1832 strExpr.Append(Form("%s:%s+", shHole->GetName(), tr1->GetName()));
1833 strExpr.Append(Form("%s:%s+", shHole->GetName(), tr2->GetName()));
1834 strExpr.Append(Form("%s:%s)", shHole->GetName(), tr3->GetName()));
1835 TGeoCompositeShape *shClipHole = new TGeoCompositeShape(
1836 "ITSSPDSHClipHoles",strExpr.Data());
1837
1838 TGeoMedium *mat = GetMedium("SPD C (M55J)$", mgr);
1839 TGeoVolume *vClip = new TGeoVolume("ITSSPDclip", shClipHole, mat);
1840 vClip->SetLineColor(kGray + 2);
1841 return vClip;
1842}//______________________________________________________________________
7855ea93 1843TGeoCompositeShape* AliITSv11GeometrySPD::CreateGroundingFoilShape
54c9a3d9 1844 (Int_t itype,Double_t &length,Double_t &width,
1845 Double_t thickness,TArrayD &sizes)
bc3498f4 1846{
54c9a3d9 1847 //
1848 // Creates the typical composite shape of the grounding foil:
1849 //
1850 // +---------------------------------------------------------+
1851 // | 5 6 9 |
1852 // | +-----------+ +------------+ 10
1853 // | O | | |
1854 // | 3 /-----+ 4 +------+
1855 // | 1 / 7 8
1856 // | /----------/
1857 // +-----/ 2 +
1858 // 0
1859 // Z + 11
1860 //
1861 // This shape is used 4 times: two layers of glue, one in kapton
1862 // and one in aluminum, taking into account that the aliminum
1863 // layer has small differences in the size of some parts.
1864 // ---
1865 // In order to overcome problems apparently due to a large number
1866 // of points, the shape creation is done according the following
1867 // steps:
1868 // 1) a TGeoBBox is created with a size right enough to contain
1869 // the whole shape (0-1-X-13)
1870 // 2) holes are defined as other TGeoBBox which are subtracted
1871 // from the main shape
1872 // 3) a TGeoXtru is defined connecting the points (0-->11-->0)
1873 // and is also subtracted from the main shape
1874 // ---
1875 // The argument ("type") is used to choose between all these
1876 // possibilities:
1877 // - type = 0 --> kapton layer
1878 // - type = 1 --> aluminum layer
1879 // - type = 2 --> glue layer between support and GF
1880 // - type = 3 --> glue layer between GF and ladders
1881 // Returns: a TGeoCompositeShape which will then be used to shape
1882 // several volumes. Since TGeoXtru is used, the local reference
1883 // frame of this object has X horizontal and Y vertical w.r to
1884 // the shape drawn above, and Z axis going perpendicularly to the screen.
1885 // This is not the correct reference for the half stave, for which
1886 // the "long" dimension is Z and the "short" is X, while Y goes in
1887 // the direction of thickness. This will imply some rotations when
1888 // using the volumes created with this shape.
3ffa185f 1889
54c9a3d9 1890 // suffix to differentiate names
1891 Char_t type[10];
1892
1893 // size of the virtual box containing exactly this volume
1894 length = fgkmm * 243.18;
1895 width = fgkmm * 15.95;
1896 if (itype == 1) {
1897 length -= fgkmm * 0.4;
1898 width -= fgkmm * 0.4;
1899 } // end if itype==1
1900 switch (itype) {
1901 case 0:
1902 sprintf(type,"Kap");
1903 break;
1904 case 1:
1905 sprintf(type,"Alu");
1906 break;
1907 case 2:
1908 sprintf(type,"Glue1");
1909 break;
1910 case 3:
1911 sprintf(type,"Glue2");
1912 break;
1913 }
1914 // we divide the shape in several slices along the horizontal
1915 // direction (local X) here we define define the length of all
1916 // sectors (from leftmost to rightmost)
1917 Int_t i;
1918 Double_t sliceLength[] = { 140.71, 2.48, 26.78, 4.00,
1919 10.00, 24.40, 10.00, 24.81 };
1920 for (i = 0; i < 8; i++) sliceLength[i] *= fgkmm;
1921 if (itype == 1) {
1922 sliceLength[0] -= fgkmm * 0.2;
1923 sliceLength[4] -= fgkmm * 0.2;
1924 sliceLength[5] += fgkmm * 0.4;
1925 sliceLength[6] -= fgkmm * 0.4;
1926 } // end if itype ==1
3ffa185f 1927
54c9a3d9 1928 // as shown in the drawing, we have four different widths
1929 // (along local Y) in this shape:
1930 Double_t widthMax = fgkmm * 15.95;
1931 Double_t widthMed1 = fgkmm * 15.00;
1932 Double_t widthMed2 = fgkmm * 11.00;
1933 Double_t widthMin = fgkmm * 4.40;
1934 if (itype == 1) {
1935 widthMax -= fgkmm * 0.4;
1936 widthMed1 -= fgkmm * 0.4;
1937 widthMed2 -= fgkmm * 0.4;
1938 widthMin -= fgkmm * 0.4;
1939 } // end if itype==1
1940
1941 // create the main shape
1942 TGeoBBox *shGroundFull = 0;
1943 shGroundFull = new TGeoBBox(Form("ITSSPDSHgFoil%sFull", type),
1944 0.5*length,0.5*width, 0.5*thickness);
1945
1946 // create the polygonal shape to be subtracted to give the correct
1947 // shape to the borders its vertices are defined in sugh a way that
1948 // this polygonal will be placed in the correct place considered
1949 // that the origin of the local reference frame is in the center
1950 // of the main box: we fix the starting point at the lower-left
1951 // edge of the shape (point 12), and add all points in order,
1952 // following a clockwise rotation
1953
1954 Double_t x[13], y[13];
1955 x[ 0] = -0.5 * length + sliceLength[0];
1956 y[ 0] = -0.5 * widthMax;
1957
1958 x[ 1] = x[0] + sliceLength[1];
1959 y[ 1] = y[0] + (widthMax - widthMed1);
1960
1961 x[ 2] = x[1] + sliceLength[2];
1962 y[ 2] = y[1];
1963
1964 x[ 3] = x[2] + sliceLength[3];
1965 y[ 3] = y[2] + (widthMed1 - widthMed2);
1966
1967 x[ 4] = x[3] + sliceLength[4];
1968 y[ 4] = y[3];
1969
1970 x[ 5] = x[4];
1971 y[ 5] = y[4] + (widthMed2 - widthMin);
1972
1973 x[ 6] = x[5] + sliceLength[5];
1974 y[ 6] = y[5];
1975
1976 x[ 7] = x[6];
1977 y[ 7] = y[4];
1978
1979 x[ 8] = x[7] + sliceLength[6];
1980 y[ 8] = y[7];
1981
1982 x[ 9] = x[8];
1983 y[ 9] = y[6];
1984
1985 x[10] = x[9] + sliceLength[7] + 0.5;
1986 y[10] = y[9];
1987
1988 x[11] = x[10];
1989 y[11] = y[0] - 0.5;
1990
1991 x[12] = x[0];
1992 y[12] = y[11];
1993
1994 // create the shape
1995 TGeoXtru *shGroundXtru = new TGeoXtru(2);
1996 shGroundXtru->SetName(Form("ITSSPDSHgFoil%sXtru", type));
1997 shGroundXtru->DefinePolygon(13, x, y);
1998 shGroundXtru->DefineSection(0, -thickness, 0., 0., 1.0);
1999 shGroundXtru->DefineSection(1, thickness, 0., 0., 1.0);
2000
2001 // define a string which will express the algebric operations among volumes
2002 // and add the subtraction of this shape from the main one
2003 TString strComposite(Form("ITSSPDSHgFoil%sFull-(%s+", type,
2004 shGroundXtru->GetName()));
2005
2006 // define the holes according to size information coming from drawings:
2007 Double_t holeLength = fgkmm * 10.00;
2008 Double_t holeWidth = fgkmm * 7.50;
2009 Double_t holeSepX0 = fgkmm * 7.05; // separation between center
2010 // of first hole and left border
2011 Double_t holeSepXC = fgkmm * 14.00; // separation between the centers
2012 // of two consecutive holes
2013 Double_t holeSepX1 = fgkmm * 15.42; // separation between centers of
2014 // 5th and 6th hole
2015 Double_t holeSepX2 = fgkmm * 22.00; // separation between centers of
2016 // 10th and 11th hole
2017 if (itype == 1) {
2018 holeSepX0 -= fgkmm * 0.2;
2019 holeLength += fgkmm * 0.4;
2020 holeWidth += fgkmm * 0.4;
2021 } // end if itype==1
2022 sizes.Set(7);
2023 sizes[0] = holeLength;
2024 sizes[1] = holeWidth;
2025 sizes[2] = holeSepX0;
2026 sizes[3] = holeSepXC;
2027 sizes[4] = holeSepX1;
2028 sizes[5] = holeSepX2;
2029 sizes[6] = fgkmm * 4.40;
2030
2031 // X position of hole center (will change for each hole)
2032 Double_t holeX = -0.5*length;
2033 // Y position of center of all holes (= 4.4 mm from upper border)
2034 Double_t holeY = 0.5*(width - holeWidth) - widthMin;
2035
2036 // create a shape for the holes (common)
2037 TGeoBBox *shHole = 0;
2038 shHole = new TGeoBBox(Form("ITSSPD%sGfoilHole", type),0.5*holeLength,
2039 0.5*holeWidth, thickness);
2040
2041 // insert the holes in the XTRU shape:
2042 // starting from the first value of X, they are simply
2043 // shifted along this axis
2044 char name[200];
2045 TGeoTranslation *transHole[11];
4adcf390 2046 for (i = 0; i < 11; i++) {
54c9a3d9 2047 // set the position of the hole, depending on index
2048 if (i == 0) {
2049 holeX += holeSepX0;
2050 }else if (i < 5) {
2051 holeX += holeSepXC;
2052 }else if (i == 5) {
2053 holeX += holeSepX1;
2054 }else if (i < 10) {
2055 holeX += holeSepXC;
2056 }else {
2057 holeX += holeSepX2;
2058 } // end if else if's
2059 //cout << i << " --> X = " << holeX << endl;
2060 sprintf(name,"ITSSPDTRgFoil%sHole%d", type, i);
2061 transHole[i] = new TGeoTranslation(name, holeX, holeY, 0.0);
2062 transHole[i]->RegisterYourself();
2063 strComposite.Append(Form("ITSSPD%sGfoilHole:%s", type, name));
2064 if (i < 10) strComposite.Append("+"); else strComposite.Append(")");
2065 } // end for i
2066
2067 // create composite shape
2068 TGeoCompositeShape *shGround = new TGeoCompositeShape(
2069 Form("ITSSPDSHgFoil%s", type), strComposite.Data());
2070
2071 return shGround;
592651e2 2072}
54c9a3d9 2073//______________________________________________________________________
2074TGeoVolume* AliITSv11GeometrySPD::CreateGroundingFoil(Bool_t isRight,
2075 TArrayD &sizes, TGeoManager *mgr)
bc3498f4 2076{
54c9a3d9 2077 //
2078 // Create a volume containing all parts of the grounding foil a
2079 // for a half-stave.
2080 // It consists of 4 layers with the same shape but different thickness:
2081 // 1) a layer of glue
2082 // 2) the aluminum layer
2083 // 3) the kapton layer
2084 // 4) another layer of glue
2085 // ---
2086 // Arguments:
2087 // 1: a boolean value to know if it is the grounding foir for
2088 // the right or left side
2089 // 2: a TArrayD which will contain the dimension of the container box:
2090 // - size[0] = length along Z (the beam line direction)
2091 // - size[1] = the 'width' of the stave, which defines, together
2092 // with Z, the plane of the carbon fiber support
2093 // - size[2] = 'thickness' (= the direction along which all
2094 // stave components are superimposed)
2095 // 3: the TGeoManager
2096 // ---
2097 // The return value is a TGeoBBox volume containing all grounding
2098 // foil components.
2099 // to avoid strange behaviour of the geometry manager,
2100 // create a suffix to be used in the names of all shapes
2101 //
2102 char suf[5];
2103 if (isRight) strcpy(suf, "R"); else strcpy(suf, "L");
2104 // this volume will be created in order to ease its placement in
2105 // the half-stave; then, it is added here the small distance of
2106 // the "central" edge of each volume from the Z=0 plane in the stave
2107 // reference (which coincides with ALICE one)
2108 Double_t dist = fgkmm * 0.71;
2109
2110 // define materials
2111 TGeoMedium *medKap = GetMedium("SPD KAPTON(POLYCH2)$", mgr);
2112 TGeoMedium *medAlu = GetMedium("AL$", mgr);
2113 TGeoMedium *medGlue = GetMedium("EPOXY$", mgr); //??? GLUE_GF_SUPPORT
2114
2115 // compute the volume shapes (thicknesses change from one to the other)
2116 Double_t kpLength, kpWidth, alLength, alWidth;
2117 TArrayD kpSize, alSize, glSize;
ed0e944d 2118 Double_t kpThickness = fgkmm * 0.04;
2119 Double_t alThickness = fgkmm * 0.01;
2120//cout << "AL THICKNESS" << alThickness << endl;
2121 //Double_t g0Thickness = fgkmm * 0.1175 - fgkGapHalfStave;
2122 //Double_t g1Thickness = fgkmm * 0.1175 - fgkGapLadder;
2123 Double_t g0Thickness = fgkmm * 0.1275 - fgkGapHalfStave;
2124 Double_t g1Thickness = fgkmm * 0.1275 - fgkGapLadder;
54c9a3d9 2125 TGeoCompositeShape *kpShape = CreateGroundingFoilShape(0,kpLength,kpWidth,
2126 kpThickness, kpSize);
2127 TGeoCompositeShape *alShape = CreateGroundingFoilShape(1,alLength,alWidth,
2128 alThickness, alSize);
3ffa185f 2129 TGeoCompositeShape *g0Shape = CreateGroundingFoilShape(2,kpLength,kpWidth,
2130 g0Thickness, glSize);
2131 TGeoCompositeShape *g1Shape = CreateGroundingFoilShape(3,kpLength,kpWidth,
2132 g1Thickness, glSize);
54c9a3d9 2133 // create the component volumes and register their sizes in the
2134 // passed arrays for readability reasons, some reference variables
2135 // explicit the meaning of the array slots
2136 TGeoVolume *kpVol = new TGeoVolume(Form("ITSSPDgFoilKap%s",suf),
2137 kpShape, medKap);
2138 TGeoVolume *alVol = new TGeoVolume(Form("ITSSPDgFoilAlu%s",suf),
2139 alShape, medAlu);
3ffa185f 2140 TGeoVolume *g0Vol = new TGeoVolume(Form("ITSSPDgFoilGlue%s",suf),
2141 g0Shape, medGlue);
2142 TGeoVolume *g1Vol = new TGeoVolume(Form("ITSSPDgFoilGlue%s",suf),
2143 g1Shape, medGlue);
54c9a3d9 2144 // set colors for the volumes
2145 kpVol->SetLineColor(kRed);
2146 alVol->SetLineColor(kGray);
3ffa185f 2147 g0Vol->SetLineColor(kYellow);
2148 g1Vol->SetLineColor(kYellow);
54c9a3d9 2149 // create references for the final size object
2150 if (sizes.GetSize() != 3) sizes.Set(3);
2151 Double_t &fullThickness = sizes[0];
2152 Double_t &fullLength = sizes[1];
2153 Double_t &fullWidth = sizes[2];
2154 // kapton leads the larger dimensions of the foil
2155 // (including the cited small distance from Z=0 stave reference plane)
2156 // the thickness is the sum of the ones of all components
2157 fullLength = kpLength + dist;
2158 fullWidth = kpWidth;
3ffa185f 2159 fullThickness = kpThickness + alThickness + g0Thickness + g1Thickness;
54c9a3d9 2160 // create the container
2161 TGeoMedium *air = GetMedium("AIR$", mgr);
2162 TGeoVolume *container = mgr->MakeBox(Form("ITSSPDgFOIL-%s",suf),
2163 air, 0.5*fullThickness, 0.5*fullWidth, 0.5*fullLength);
2164 // create the common correction rotation (which depends of what side
2165 // we are building)
2166 TGeoRotation *rotCorr = new TGeoRotation(*gGeoIdentity);
2167 if (isRight) rotCorr->RotateY(90.0);
3ffa185f 2168 else rotCorr->RotateY(-90.0);
54c9a3d9 2169 // compute the translations, which are in the length and
2170 // thickness directions
2171 Double_t x, y, z, shift = 0.0;
2172 if (isRight) shift = dist;
2173 // glue (bottom)
3ffa185f 2174 x = -0.5*(fullThickness - g0Thickness);
54c9a3d9 2175 z = 0.5*(fullLength - kpLength) - shift;
2176 TGeoCombiTrans *glTrans0 = new TGeoCombiTrans(x, 0.0, z, rotCorr);
2177 // kapton
3ffa185f 2178 x += 0.5*(g0Thickness + kpThickness);
54c9a3d9 2179 TGeoCombiTrans *kpTrans = new TGeoCombiTrans(x, 0.0, z, rotCorr);
2180 // aluminum
2181 x += 0.5*(kpThickness + alThickness);
2182 z = 0.5*(fullLength - alLength) - shift - 0.5*(kpLength - alLength);
2183 TGeoCombiTrans *alTrans = new TGeoCombiTrans(x, 0.0, z, rotCorr);
2184 // glue (top)
3ffa185f 2185 x += 0.5*(alThickness + g1Thickness);
54c9a3d9 2186 z = 0.5*(fullLength - kpLength) - shift;
2187 TGeoCombiTrans *glTrans1 = new TGeoCombiTrans(x, 0.0, z, rotCorr);
3ffa185f 2188
ed0e944d 2189 //cout << fgkGapHalfStave << endl;
2190 //cout << g0Thickness << endl;
2191 //cout << kpThickness << endl;
2192 //cout << alThickness << endl;
2193 //cout << g1Thickness << endl;
54c9a3d9 2194
2195 // add to container
22726349 2196 container->SetLineColor(kMagenta-10);
54c9a3d9 2197 container->AddNode(kpVol, 1, kpTrans);
2198 container->AddNode(alVol, 1, alTrans);
3ffa185f 2199 container->AddNode(g0Vol, 1, glTrans0);
2200 container->AddNode(g1Vol, 2, glTrans1);
54c9a3d9 2201 // to add the grease we remember the sizes of the holes, stored as
2202 // additional parameters in the kapton layer size:
2203 // - sizes[3] = hole length
2204 // - sizes[4] = hole width
2205 // - sizes[5] = position of first hole center
2206 // - sizes[6] = standard separation between holes
2207 // - sizes[7] = separation between 5th and 6th hole
2208 // - sizes[8] = separation between 10th and 11th hole
2209 // - sizes[9] = separation between the upper hole border and
2210 // the foil border
2211 Double_t holeLength = kpSize[0];
2212 Double_t holeWidth = kpSize[1];
2213 Double_t holeFirstZ = kpSize[2];
2214 Double_t holeSepZ = kpSize[3];
2215 Double_t holeSep5th6th = kpSize[4];
2216 Double_t holeSep10th11th = kpSize[5];
2217 Double_t holeSepY = kpSize[6];
2218 // volume (common)
2219 // Grease has not been defined to date. Need much more information
2220 // no this material!
2221 TGeoMedium *grease = GetMedium("SPD KAPTON(POLYCH2)$", mgr); // ??? GREASE
2222 TGeoVolume *hVol = mgr->MakeBox("ITSSPDGrease", grease,
2223 0.5*fullThickness, 0.5*holeWidth, 0.5*holeLength);
2224 hVol->SetLineColor(kBlue);
2225 // displacement of volumes in the container
2226 Int_t idx = 1; // copy numbers start from 1.
2227 x = 0.0;
2228 y = 0.5*(fullWidth - holeWidth) - holeSepY;
2229 if (isRight) z = holeFirstZ - 0.5*fullLength + dist;
2230 else z = 0.5*fullLength - holeFirstZ - dist;
2231 for (Int_t i = 0; i < 11; i++) {
2232 TGeoTranslation *t = 0;
2233 t = new TGeoTranslation(x, y, -z);
2234 container->AddNode(hVol, idx++, t);
2235 if (i < 4) shift = holeSepZ;
2236 else if (i == 4) shift = holeSep5th6th;
2237 else if (i < 9) shift = holeSepZ;
2238 else shift = holeSep10th11th;
2239 if (isRight) z += shift;
2240 else z -= shift;
2241 } // end for i
2242 return container;
592651e2 2243}
54c9a3d9 2244//___________________________________________________________________
2245TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateMCM(Bool_t isRight,
2246 TArrayD &sizes, TGeoManager *mgr) const
bc3498f4 2247{
54c9a3d9 2248 //
2249 // Create a TGeoAssembly containing all the components of the MCM.
2250 // The TGeoVolume container is rejected due to the possibility of overlaps
2251 // when placing this object on the carbon fiber sector.
2252 // The assembly contains:
2253 // - the thin part of the MCM (integrated circuit)
2254 // - the MCM chips (specifications from EDMS)
2255 // - the cap which covers the zone where chips are bound to MCM
2256 // ---
2257 // The local reference frame of this assembly is defined in such a way
2258 // that all volumes are contained in a virtual box whose center
2259 // is placed exactly in the middle of the occupied space w.r to all
2260 // directions. This will ease the positioning of this object in the
2261 // half-stave. The sizes of this virtual box are stored in
2262 // the array passed by reference.
2263 // ---
2264 // Arguments:
2265 // - a boolean flag to know if this is the "left" or "right" MCM, when
2266 // looking at the stave from above (i.e. the direction from which
2267 // one sees bus over ladders over grounding foil) and keeping the
2268 // continuous border in the upper part, one sees the thicker part
2269 // on the left or right.
2270 // - an array passed by reference which will contain the size of
2271 // the virtual container.
2272 // - a pointer to the used TGeoManager.
2273 //
2274
2275 // to distinguish the "left" and "right" objects, a suffix is created
2276 char suf[5];
2277 if (isRight) strcpy(suf, "R"); else strcpy(suf, "L");
2278
2279 // ** MEDIA **
2280 TGeoMedium *medBase = GetMedium("SPD KAPTON(POLYCH2)$",mgr);// ??? MCM BASE
2281 TGeoMedium *medChip = GetMedium("SPD SI CHIP$",mgr);
2282 TGeoMedium *medCap = GetMedium("AL$",mgr);
2283
2284 // The shape of the MCM is divided into 3 sectors with different
2285 // widths (Y) and lengths (X), like in this sketch:
2286 //
2287 // 0 1 2
2288 // +---------------------+-----------------------------------+
2289 // | 4 sect 2 |
2290 // | 6 sect 1 /-------------------+
2291 // | sect 0 /--------------/ 3
2292 // +--------------------/ 5
2293 // 8 7
2294 //
2295 // the inclination of all oblique borders (6-7, 4-5) is always 45 degrees.
2296 // From drawings we can parametrize the dimensions of all these sectors,
2297 // then the shape of this part of the MCM is implemented as a
2298 // TGeoXtru centerd in the virtual XY space.
2299 // The first step is definig the relevant sizes of this shape:
2300 Int_t i, j;
2301 Double_t mcmThickness = fgkmm * 0.35;
2302 Double_t sizeXtot = fgkmm * 105.6; // total distance (0-2)
2303 // resp. 7-8, 5-6 and 3-4
2304 Double_t sizeXsector[3] = {fgkmm * 28.4, fgkmm * 41.4, fgkmm * 28.8};
2305 // resp. 0-8, 1-6 and 2-3
2306 Double_t sizeYsector[3] = {fgkmm * 15.0, fgkmm * 11.0, fgkmm * 8.0};
2307 Double_t sizeSep01 = fgkmm * 4.0; // x(6)-x(7)
2308 Double_t sizeSep12 = fgkmm * 3.0; // x(4)-x(5)
2309
2310 // define sizes of chips (last is the thickest)
2311 Double_t chipLength[5] = { 4.00, 6.15, 3.85, 5.60, 18.00 };
2312 Double_t chipWidth[5] = { 3.00, 4.10, 3.85, 5.60, 5.45 };
2313 Double_t chipThickness[5] = { 0.60, 0.30, 0.30, 1.00, 1.20 };
2314 TString name[5];
2315 name[0] = "ITSSPDanalog";
2316 name[1] = "ITSSPDpilot";
2317 name[2] = "ITSSPDgol";
2318 name[3] = "ITSSPDrx40";
2319 name[4] = "ITSSPDoptical";
2320 Color_t color[5] = { kCyan, kGreen, kYellow, kBlue, kOrange };
2321
2322 // define the sizes of the cover
2323 Double_t capThickness = fgkmm * 0.3;
2324 Double_t capHeight = fgkmm * 1.7;
2325
2326 // compute the total size of the virtual container box
2327 sizes.Set(3);
2328 Double_t &thickness = sizes[0];
2329 Double_t &length = sizes[1];
2330 Double_t &width = sizes[2];
2331 length = sizeXtot;
2332 width = sizeYsector[0];
2333 thickness = mcmThickness + capHeight;
2334
2335 // define all the relevant vertices of the polygon
2336 // which defines the transverse shape of the MCM.
2337 // These values are used to several purposes, and
2338 // for each one, some points must be excluded
2339 Double_t xRef[9], yRef[9];
2340 xRef[0] = -0.5*sizeXtot;
2341 yRef[0] = 0.5*sizeYsector[0];
2342 xRef[1] = xRef[0] + sizeXsector[0] + sizeSep01;
2343 yRef[1] = yRef[0];
2344 xRef[2] = -xRef[0];
2345 yRef[2] = yRef[0];
2346 xRef[3] = xRef[2];
2347 yRef[3] = yRef[2] - sizeYsector[2];
2348 xRef[4] = xRef[3] - sizeXsector[2];
2349 yRef[4] = yRef[3];
2350 xRef[5] = xRef[4] - sizeSep12;
2351 yRef[5] = yRef[4] - sizeSep12;
2352 xRef[6] = xRef[5] - sizeXsector[1];
2353 yRef[6] = yRef[5];
2354 xRef[7] = xRef[6] - sizeSep01;
2355 yRef[7] = yRef[6] - sizeSep01;
2356 xRef[8] = xRef[0];
2357 yRef[8] = -yRef[0];
2358
2359 // the above points are defined for the "right" MCM (if ve view the
2360 // stave from above) in order to change to the "left" one, we must
2361 // change the sign to all X values:
2362 if (isRight) for (i = 0; i < 9; i++) xRef[i] = -xRef[i];
3ffa185f 2363
54c9a3d9 2364 // the shape of the MCM and glue layer are done excluding point 1,
2365 // which is not necessary and cause the geometry builder to get confused
2366 j = 0;
2367 Double_t xBase[8], yBase[8];
2368 for (i = 0; i < 9; i++) {
2369 if (i == 1) continue;
2370 xBase[j] = xRef[i];
2371 yBase[j] = yRef[i];
2372 j++;
2373 } // end for i
2374
2375 // the MCM cover is superimposed over the zones 1 and 2 only
2376 Double_t xCap[6], yCap[6];
2377 j = 0;
2378 for (i = 1; i <= 6; i++) {
2379 xCap[j] = xRef[i];
2380 yCap[j] = yRef[i];
2381 j++;
2382 } // end for i
2383
2384 // define positions of chips,
2385 // which must be added to the bottom-left corner of MCM
2386 // and divided by 1E4;
2387 Double_t chipX[5], chipY[5];
2388 if (isRight) {
2389 chipX[0] = 666320.;
2390 chipX[1] = 508320.;
2391 chipX[2] = 381320.;
2392 chipX[3] = 295320.;
2393 chipX[4] = 150320.;
2394 chipY[0] = 23750.;
2395 chipY[1] = 27750.;
2396 chipY[2] = 20750.;
2397 chipY[3] = 42750.;
2398 chipY[4] = 39750.;
2399 } else {
2400 chipX[0] = 389730.;
2401 chipX[1] = 548630.;
2402 chipX[2] = 674930.;
2403 chipX[3] = 761430.;
2404 chipX[4] = 905430.;
2405 chipY[0] = 96250.;
2406 chipY[1] = 91950.;
2407 chipY[2] = 99250.;
2408 chipY[3] = 107250.;
2409 chipY[4] = 109750.;
2410 } // end if isRight
2411 for (i = 0; i < 5; i++) {
2412 chipX[i] *= 0.00001;
2413 chipY[i] *= 0.00001;
2414 if (isRight) {
2415 chipX[i] += xRef[3];
2416 chipY[i] += yRef[3];
2417 } else {
2418 chipX[i] += xRef[8];
2419 chipY[i] += yRef[8];
2420 } // end for isRight
2421 chipLength[i] *= fgkmm;
2422 chipWidth[i] *= fgkmm;
2423 chipThickness[i] *= fgkmm;
2424 } // end for i
2425
2426 // create shapes for MCM
2427 Double_t z1, z2;
2428 TGeoXtru *shBase = new TGeoXtru(2);
2429 z1 = -0.5*thickness;
2430 z2 = z1 + mcmThickness;
2431 shBase->DefinePolygon(8, xBase, yBase);
2432 shBase->DefineSection(0, z1, 0., 0., 1.0);
2433 shBase->DefineSection(1, z2, 0., 0., 1.0);
2434
2435 // create volumes of MCM
2436 TGeoVolume *volBase = new TGeoVolume("ITSSPDbase", shBase, medBase);
2437 volBase->SetLineColor(kRed);
2438
2439 // to create the border of the MCM cover, it is required the
2440 // subtraction of two shapes the outer is created using the
2441 // reference points defined here
2442 TGeoXtru *shCapOut = new TGeoXtru(2);
2443 shCapOut->SetName(Form("ITSSPDshCAPOUT%s", suf));
2444 z1 = z2;
2445 z2 = z1 + capHeight - capThickness;
2446 shCapOut->DefinePolygon(6, xCap, yCap);
2447 shCapOut->DefineSection(0, z1, 0., 0., 1.0);
2448 shCapOut->DefineSection(1, z2, 0., 0., 1.0);
2449 // the inner is built similarly but subtracting the thickness
2450 Double_t angle, cs;
2451 Double_t xin[6], yin[6];
2452 if (!isRight) {
2453 angle = 45.0;
2454 cs = TMath::Cos( 0.5*(TMath::Pi() - angle*TMath::DegToRad()) );
2455 xin[0] = xCap[0] + capThickness;
2456 yin[0] = yCap[0] - capThickness;
2457 xin[1] = xCap[1] - capThickness;
2458 yin[1] = yin[0];
2459 xin[2] = xin[1];
2460 yin[2] = yCap[2] + capThickness;
2461 xin[3] = xCap[3] - capThickness*cs;
2462 yin[3] = yin[2];
2463 xin[4] = xin[3] - sizeSep12;
2464 yin[4] = yCap[4] + capThickness;
2465 xin[5] = xin[0];
2466 yin[5] = yin[4];
2467 } else {
2468 angle = 45.0;
2469 cs = TMath::Cos( 0.5*(TMath::Pi() - angle*TMath::DegToRad()) );
2470 xin[0] = xCap[0] - capThickness;
2471 yin[0] = yCap[0] - capThickness;
2472 xin[1] = xCap[1] + capThickness;
2473 yin[1] = yin[0];
2474 xin[2] = xin[1];
2475 yin[2] = yCap[2] + capThickness;
2476 xin[3] = xCap[3] - capThickness*cs;
2477 yin[3] = yin[2];
2478 xin[4] = xin[3] + sizeSep12;
2479 yin[4] = yCap[4] + capThickness;
2480 xin[5] = xin[0];
2481 yin[5] = yin[4];
2482 } // end if !isRight
2483 TGeoXtru *shCapIn = new TGeoXtru(2);
2484 shCapIn->SetName(Form("ITSSPDshCAPIN%s", suf));
2485 shCapIn->DefinePolygon(6, xin, yin);
2486 shCapIn->DefineSection(0, z1 - 0.01, 0., 0., 1.0);
2487 shCapIn->DefineSection(1, z2 + 0.01, 0., 0., 1.0);
2488 // compose shapes
2489 TGeoCompositeShape *shCapBorder = new TGeoCompositeShape(
2490 Form("ITSSPDshBORDER%s", suf),
2491 Form("%s-%s", shCapOut->GetName(),
2492 shCapIn->GetName()));
2493 // create volume
2494 TGeoVolume *volCapBorder = new TGeoVolume("ITSSPDcapBoarder",
2495 shCapBorder,medCap);
2496 volCapBorder->SetLineColor(kGreen);
2497 // finally, we create the top of the cover, which has the same
2498 // shape of outer border and a thickness equal of the one othe
2499 // cover border one
2500 TGeoXtru *shCapTop = new TGeoXtru(2);
2501 z1 = z2;
2502 z2 = z1 + capThickness;
2503 shCapTop->DefinePolygon(6, xCap, yCap);
2504 shCapTop->DefineSection(0, z1, 0., 0., 1.0);
2505 shCapTop->DefineSection(1, z2, 0., 0., 1.0);
2506 TGeoVolume *volCapTop = new TGeoVolume("ITSSPDcapTop", shCapTop, medCap);
2507 volCapTop->SetLineColor(kBlue);
2508
2509 // create container assembly with right suffix
2510 TGeoVolumeAssembly *mcmAssembly = new TGeoVolumeAssembly(
2511 Form("ITSSPDmcm%s", suf));
2512
2513 // add mcm layer
2514 mcmAssembly->AddNode(volBase, 1, gGeoIdentity);
2515 // add chips
2516 for (i = 0; i < 5; i++) {
2517 TGeoVolume *box = gGeoManager->MakeBox(name[i],medChip,
2518 0.5*chipLength[i], 0.5*chipWidth[i], 0.5*chipThickness[i]);
2519 TGeoTranslation *tr = new TGeoTranslation(chipX[i],chipY[i],
2520 0.5*(-thickness + chipThickness[i]) + mcmThickness);
2521 box->SetLineColor(color[i]);
2522 mcmAssembly->AddNode(box, 1, tr);
2523 } // end for i
2524 // add cap border
2525 mcmAssembly->AddNode(volCapBorder, 1, gGeoIdentity);
2526 // add cap top
3ffa185f 2527 mcmAssembly->AddNode(volCapTop, 1, gGeoIdentity);
54c9a3d9 2528
2529 return mcmAssembly;
592651e2 2530}
7f69c251 2531
2532/*
2533//__________________________________________________________________________________________
2534TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
2535(Bool_t isRight, TArrayD &sizes, TGeoManager *mgr) const
2536{
3ffa185f 2537 //
2538 // The pixel bus is implemented as a TGeoBBox with some objects on it,
2539 // which could affect the particle energy loss.
2540 // ---
2541 // In order to avoid confusion, the bus is directly displaced
2542 // according to the axis orientations which are used in the final stave:
2543 // X --> thickness direction
2544 // Y --> width direction
2545 // Z --> length direction
2546 //
7f69c251 2547
3ffa185f 2548
2549 // ** MEDIA **
2550
2551 //PIXEL BUS
2552 TGeoMedium *medBus = GetMedium("SPDBUS(AL+KPT+EPOX)$",mgr);
2553 TGeoMedium *medPt1000 = GetMedium("CERAMICS$",mgr); // ??? PT1000
2554 // Capacity
2555 TGeoMedium *medCap = GetMedium("SDD X7R capacitors$",mgr);
2556 // ??? Resistance
2557 // TGeoMedium *medRes = GetMedium("SDD X7R capacitors$",mgr);
2558 TGeoMedium *medRes = GetMedium("ALUMINUM$",mgr);
2559 TGeoMedium *medExt = GetMedium("SDDKAPTON (POLYCH2)$", mgr);
2560 // ** SIZES & POSITIONS **
2561 Double_t busLength = 170.501 * fgkmm; // length of plane part
2562 Double_t busWidth = 13.800 * fgkmm; // width
2563 Double_t busThickness = 0.280 * fgkmm; // thickness
2564 Double_t pt1000Length = fgkmm * 1.50;
2565 Double_t pt1000Width = fgkmm * 3.10;
2566 Double_t pt1000Thickness = fgkmm * 0.60;
2567 Double_t pt1000Y, pt1000Z[10];// position of the pt1000's along the bus
2568 Double_t capLength = fgkmm * 2.55;
2569 Double_t capWidth = fgkmm * 1.50;
2570 Double_t capThickness = fgkmm * 1.35;
2571 Double_t capY[2], capZ[2];
2572
2573 Double_t resLength = fgkmm * 2.20;
2574 Double_t resWidth = fgkmm * 0.80;
2575 Double_t resThickness = fgkmm * 0.35;
2576 Double_t resY[2], resZ[2];
2577
2578 Double_t extThickness = fgkmm * 0.25;
2579 Double_t ext1Length = fgkmm * (26.7 - 10.0);
2580 Double_t ext2Length = fgkmm * (285.0 - ext1Length + extThickness);
2581 Double_t extWidth = fgkmm * 11.0;
2582 Double_t extHeight = fgkmm * 2.5;
2583
2584
2585 // position of pt1000, resistors and capacitors depends on the
2586 // bus if it's left or right one
2587 if (!isRight) {
2588 pt1000Y = 64400.;
2589 pt1000Z[0] = 66160.;
2590 pt1000Z[1] = 206200.;
2591 pt1000Z[2] = 346200.;
2592 pt1000Z[3] = 486200.;
2593 pt1000Z[4] = 626200.;
2594 pt1000Z[5] = 776200.;
2595 pt1000Z[6] = 916200.;
2596 pt1000Z[7] = 1056200.;
2597 pt1000Z[8] = 1196200.;
2598 pt1000Z[9] = 1336200.;
2599 resZ[0] = 1397500.;
2600 resY[0] = 26900.;
2601 resZ[1] = 682500.;
2602 resY[1] = 27800.;
2603 capZ[0] = 1395700.;
2604 capY[0] = 45700.;
2605 capZ[1] = 692600.;
2606 capY[1] = 45400.;
2607 } else {
2608 pt1000Y = 66100.;
2609 pt1000Z[0] = 319700.;
2610 pt1000Z[1] = 459700.;
2611 pt1000Z[2] = 599700.;
2612 pt1000Z[3] = 739700.;
2613 pt1000Z[4] = 879700.;
2614 pt1000Z[5] = 1029700.;
2615 pt1000Z[6] = 1169700.;
2616 pt1000Z[7] = 1309700.;
2617 pt1000Z[8] = 1449700.;
2618 pt1000Z[9] = 1589700.;
2619 capY[0] = 44500.;
2620 capZ[0] = 266700.;
2621 capY[1] = 44300.;
2622 capZ[1] = 974700.;
2623 resZ[0] = 266500.;
2624 resY[0] = 29200.;
2625 resZ[1] = 974600.;
2626 resY[1] = 29900.;
2627 } // end if isRight
2628 Int_t i;
2629 pt1000Y *= 1E-4 * fgkmm;
2630 for (i = 0; i < 10; i++) {
2631 pt1000Z[i] *= 1E-4 * fgkmm;
2632 if (i < 2) {
2633 capZ[i] *= 1E-4 * fgkmm;
2634 capY[i] *= 1E-4 * fgkmm;
2635 resZ[i] *= 1E-4 * fgkmm;
2636 resY[i] *= 1E-4 * fgkmm;
2637 } // end if iM2
2638 } // end for i
2639
2640 Double_t &fullLength = sizes[1];
2641 Double_t &fullWidth = sizes[2];
2642 Double_t &fullThickness = sizes[0];
2643 fullLength = busLength;
2644 fullWidth = busWidth;
2645 // add the thickness of the thickest component on bus (capacity)
2646 fullThickness = busThickness + capThickness;
2647 // ** VOLUMES **
2648 TGeoVolumeAssembly *container = new TGeoVolumeAssembly("PixelBus");
2649 TGeoVolume *bus = mgr->MakeBox("Bus", medBus, 0.5*busThickness, 0.5*busWidth, 0.5*busLength);
2650 TGeoVolume *pt1000 = mgr->MakeBox("PT1000", medPt1000, 0.5*pt1000Thickness, 0.5*pt1000Width, 0.5*pt1000Length);
2651 TGeoVolume *res = mgr->MakeBox("Resistor", medRes, 0.5*resThickness, 0.5*resWidth, 0.5*resLength);
2652 TGeoVolume *cap = mgr->MakeBox("Capacitor", medCap, 0.5*capThickness, 0.5*capWidth, 0.5*capLength);
2653 TGeoVolume *ext1 = mgr->MakeBox("Extender1", medExt, 0.5*extThickness, 0.5*extWidth, 0.5*ext1Length);
2654 TGeoVolume *ext2 = mgr->MakeBox("Extender2", medExt, 0.5*extHeight - extThickness, 0.5*extWidth, 0.5*extThickness);
2655 TGeoVolume *ext3 = mgr->MakeBox("Extender3", medExt, extThickness, 0.5*extWidth, 0.5*ext2Length);
2656 bus->SetLineColor(kYellow + 2);
2657 pt1000->SetLineColor(kGreen + 3);
2658 res->SetLineColor(kRed + 1);
2659 cap->SetLineColor(kBlue - 7);
2660 ext1->SetLineColor(kGray);
2661 ext2->SetLineColor(kGray);
2662 ext3->SetLineColor(kGray);
2663
2664 // ** MOVEMENTS AND POSITIONEMENT **
2665 // bus
2666 TGeoTranslation *trBus = new TGeoTranslation(0.5 * (busThickness -
2667 fullThickness), 0.0, 0.0);
2668 container->AddNode(bus, 0, trBus);
2669 Double_t zRef, yRef, x, y, z;
2670 if (isRight) {
2671 zRef = -0.5*fullLength;
2672 yRef = -0.5*fullWidth;
2673 } else {
2674 zRef = -0.5*fullLength;
2675 yRef = -0.5*fullWidth;
2676 } // end if isRight
2677 // pt1000
2678 x = 0.5*(pt1000Thickness - fullThickness) + busThickness;
2679 for (i = 0; i < 10; i++) {
2680 y = yRef + pt1000Y;
2681 z = zRef + pt1000Z[i];
2682 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2683 container->AddNode(pt1000, i, tr);
2684 } // end for i
2685 // capacitors
2686 x = 0.5*(capThickness - fullThickness) + busThickness;
2687 for (i = 0; i < 2; i++) {
2688 y = yRef + capY[i];
2689 z = zRef + capZ[i];
2690 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2691 container->AddNode(cap, i, tr);
2692 } // end for i
2693 // resistors
2694 x = 0.5*(resThickness - fullThickness) + busThickness;
2695 for (i = 0; i < 2; i++) {
2696 y = yRef + resY[i];
2697 z = zRef + resZ[i];
2698 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2699 container->AddNode(res, i, tr);
2700 } // end for i
2701 // extender
2702 if (isRight) {
2703 y = 0.5 * (-fullWidth + extWidth);
2704 z = 0.5 * (-fullLength + fgkmm * 10.0);
2705 }
2706 else {
2707 y = 0.5 * (fullWidth - extWidth);
2708 z = 0.5 * ( fullLength - fgkmm * 10.0);
2709 }
2710 x = 0.5 * (extThickness - fullThickness) + busThickness;
2711 //y = 0.5 * (fullWidth - extWidth);
2712 TGeoTranslation *trExt1 = new TGeoTranslation(x, y, z);
2713 if (isRight) {
2714 z -= 0.5 * (ext1Length - extThickness);
2715 }
2716 else {
2717 z += 0.5 * (ext1Length - extThickness);
2718 }
2719 x += 0.5*(extHeight - extThickness);
2720 TGeoTranslation *trExt2 = new TGeoTranslation(x, y, z);
2721 if (isRight) {
2722 z -= 0.5 * (ext2Length - extThickness);
2723 }
2724 else {
2725 z += 0.5 * (ext2Length - extThickness);
2726 }
2727 x += 0.5*(extHeight - extThickness) + extThickness;
2728 TGeoTranslation *trExt3 = new TGeoTranslation(x, y, z);
2729 container->AddNode(ext1, 0, trExt1);
2730 container->AddNode(ext2, 0, trExt2);
2731 container->AddNode(ext3, 0, trExt3);
2732
2733
2734 sizes[3] = yRef + pt1000Y;
2735 sizes[4] = zRef + pt1000Z[2];
2736 sizes[5] = zRef + pt1000Z[7];
2737
2738 return container;
7f69c251 2739}
2740*/
2741
54c9a3d9 2742//______________________________________________________________________
bc3498f4 2743TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
22726349 2744(Bool_t isRight, Int_t ilayer, TArrayD &sizes, TGeoManager *mgr) const
bc3498f4 2745{
54c9a3d9 2746 //
2747 // The pixel bus is implemented as a TGeoBBox with some objects on it,
2748 // which could affect the particle energy loss.
2749 // ---
2750 // In order to avoid confusion, the bus is directly displaced
2751 // according to the axis orientations which are used in the final stave:
2752 // X --> thickness direction
2753 // Y --> width direction
2754 // Z --> length direction
2755 //
22726349 2756
2757 // ** CRITICAL CHECK ******************************************************
2758 // layer number can be ONLY 1 or 2
2759 if (ilayer != 1 && ilayer != 2) AliFatal("Layer number MUST be 1 or 2");
54c9a3d9 2760
2761 // ** MEDIA **
2762 //PIXEL BUS
2763 TGeoMedium *medBus = GetMedium("SPDBUS(AL+KPT+EPOX)$",mgr);
2764 TGeoMedium *medPt1000 = GetMedium("CERAMICS$",mgr); // ??? PT1000
2765 // Capacity
2766 TGeoMedium *medCap = GetMedium("SDD X7R capacitors$",mgr);
2767 // ??? Resistance
7f69c251 2768 //TGeoMedium *medRes = GetMedium("SDD X7R capacitors$",mgr);
2769 TGeoMedium *medRes = GetMedium("ALUMINUM$",mgr);
3ffa185f 2770 TGeoMedium *medExt = GetMedium("SDDKAPTON (POLYCH2)$", mgr);
54c9a3d9 2771 // ** SIZES & POSITIONS **
2772 Double_t busLength = 170.501 * fgkmm; // length of plane part
2773 Double_t busWidth = 13.800 * fgkmm; // width
2774 Double_t busThickness = 0.280 * fgkmm; // thickness
2775 Double_t pt1000Length = fgkmm * 1.50;
2776 Double_t pt1000Width = fgkmm * 3.10;
2777 Double_t pt1000Thickness = fgkmm * 0.60;
2778 Double_t pt1000Y, pt1000Z[10];// position of the pt1000's along the bus
2779 Double_t capLength = fgkmm * 2.55;
2780 Double_t capWidth = fgkmm * 1.50;
2781 Double_t capThickness = fgkmm * 1.35;
2782 Double_t capY[2], capZ[2];
2783
2784 Double_t resLength = fgkmm * 2.20;
2785 Double_t resWidth = fgkmm * 0.80;
2786 Double_t resThickness = fgkmm * 0.35;
2787 Double_t resY[2], resZ[2];
7f69c251 2788
2789 Double_t extThickness = fgkmm * 0.25;
3ffa185f 2790 Double_t ext1Length = fgkmm * (26.7 - 10.0);
2791 Double_t ext2Length = fgkmm * (284.0 - ext1Length + extThickness);
2792 Double_t extWidth = fgkmm * 11.0;
2793 Double_t extHeight = fgkmm * 2.5;
54c9a3d9 2794
2795 // position of pt1000, resistors and capacitors depends on the
2796 // bus if it's left or right one
2797 if (!isRight) {
2798 pt1000Y = 64400.;
2799 pt1000Z[0] = 66160.;
2800 pt1000Z[1] = 206200.;
2801 pt1000Z[2] = 346200.;
2802 pt1000Z[3] = 486200.;
2803 pt1000Z[4] = 626200.;
2804 pt1000Z[5] = 776200.;
2805 pt1000Z[6] = 916200.;
2806 pt1000Z[7] = 1056200.;
2807 pt1000Z[8] = 1196200.;
2808 pt1000Z[9] = 1336200.;
2809 resZ[0] = 1397500.;
2810 resY[0] = 26900.;
2811 resZ[1] = 682500.;
2812 resY[1] = 27800.;
2813 capZ[0] = 1395700.;
2814 capY[0] = 45700.;
2815 capZ[1] = 692600.;
2816 capY[1] = 45400.;
2817 } else {
2818 pt1000Y = 66100.;
2819 pt1000Z[0] = 319700.;
2820 pt1000Z[1] = 459700.;
2821 pt1000Z[2] = 599700.;
2822 pt1000Z[3] = 739700.;
2823 pt1000Z[4] = 879700.;
2824 pt1000Z[5] = 1029700.;
2825 pt1000Z[6] = 1169700.;
2826 pt1000Z[7] = 1309700.;
2827 pt1000Z[8] = 1449700.;
2828 pt1000Z[9] = 1589700.;
2829 capY[0] = 44500.;
2830 capZ[0] = 266700.;
2831 capY[1] = 44300.;
2832 capZ[1] = 974700.;
2833 resZ[0] = 266500.;
2834 resY[0] = 29200.;
2835 resZ[1] = 974600.;
2836 resY[1] = 29900.;
2837 } // end if isRight
2838 Int_t i;
2839 pt1000Y *= 1E-4 * fgkmm;
2840 for (i = 0; i < 10; i++) {
2841 pt1000Z[i] *= 1E-4 * fgkmm;
2842 if (i < 2) {
2843 capZ[i] *= 1E-4 * fgkmm;
2844 capY[i] *= 1E-4 * fgkmm;
2845 resZ[i] *= 1E-4 * fgkmm;
2846 resY[i] *= 1E-4 * fgkmm;
2847 } // end if iM2
2848 } // end for i
2849
2850 Double_t &fullLength = sizes[1];
2851 Double_t &fullWidth = sizes[2];
2852 Double_t &fullThickness = sizes[0];
2853 fullLength = busLength;
2854 fullWidth = busWidth;
2855 // add the thickness of the thickest component on bus (capacity)
2856 fullThickness = busThickness + capThickness;
2857
2858 // ** VOLUMES **
2859 TGeoVolumeAssembly *container = new TGeoVolumeAssembly("ITSSPDpixelBus");
2860 TGeoVolume *bus = mgr->MakeBox("ITSSPDbus", medBus, 0.5*busThickness,
2861 0.5*busWidth, 0.5*busLength);
2862 TGeoVolume *pt1000 = mgr->MakeBox("ITSSPDpt1000",medPt1000,
2863 0.5*pt1000Thickness,0.5*pt1000Width, 0.5*pt1000Length);
2864 TGeoVolume *res = mgr->MakeBox("ITSSPDresistor", medRes, 0.5*resThickness,
2865 0.5*resWidth, 0.5*resLength);
2866 TGeoVolume *cap = mgr->MakeBox("ITSSPDcapacitor", medCap, 0.5*capThickness,
2867 0.5*capWidth, 0.5*capLength);
7f69c251 2868
2869 TGeoVolume *ext1 = mgr->MakeBox("Extender1", medExt, 0.5*extThickness, 0.5*extWidth, 0.5*ext1Length);
3ffa185f 2870 TGeoVolume *ext2 = mgr->MakeBox("Extender2", medExt, 0.5*extHeight - 2.*extThickness, 0.5*extWidth, 0.5*extThickness);
2871 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 2872 bus->SetLineColor(kYellow + 2);
2873 pt1000->SetLineColor(kGreen + 3);
2874 res->SetLineColor(kRed + 1);
2875 cap->SetLineColor(kBlue - 7);
7f69c251 2876 ext1->SetLineColor(kGray);
3ffa185f 2877 ext2->SetLineColor(kGray);
2878 ext3->SetLineColor(kGray);
54c9a3d9 2879
2880 // ** MOVEMENTS AND POSITIONEMENT **
2881 // bus
2882 TGeoTranslation *trBus = new TGeoTranslation(0.5 * (busThickness -
2883 fullThickness), 0.0, 0.0);
2884 container->AddNode(bus, 1, trBus);
2885 Double_t zRef, yRef, x, y, z;
2886 if (isRight) {
2887 zRef = -0.5*fullLength;
2888 yRef = -0.5*fullWidth;
2889 } else {
2890 zRef = -0.5*fullLength;
2891 yRef = -0.5*fullWidth;
2892 } // end if isRight
2893 // pt1000
2894 x = 0.5*(pt1000Thickness - fullThickness) + busThickness;
2895 for (i = 0; i < 10; i++) {
2896 y = yRef + pt1000Y;
2897 z = zRef + pt1000Z[i];
2898 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2899 container->AddNode(pt1000, i+1, tr);
2900 } // end for i
2901 // capacitors
2902 x = 0.5*(capThickness - fullThickness) + busThickness;
2903 for (i = 0; i < 2; i++) {
2904 y = yRef + capY[i];
2905 z = zRef + capZ[i];
2906 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2907 container->AddNode(cap, i+1, tr);
2908 } // end for i
2909 // resistors
2910 x = 0.5*(resThickness - fullThickness) + busThickness;
2911 for (i = 0; i < 2; i++) {
2912 y = yRef + resY[i];
2913 z = zRef + resZ[i];
2914 TGeoTranslation *tr = new TGeoTranslation(x, y, z);
2915 container->AddNode(res, i+1, tr);
2916 } // end for i
2917
7f69c251 2918 // extender
22726349 2919 if (ilayer == 2) {
3ffa185f 2920 if (isRight) {
2921 y = 0.5 * (fullWidth - extWidth) - 0.1;
2922 z = 0.5 * (-fullLength + fgkmm * 10.0);
2923 }
2924 else {
2925 y = 0.5 * (fullWidth - extWidth) - 0.1;
2926 z = 0.5 * ( fullLength - fgkmm * 10.0);
2927 }
22726349 2928 }
2929 else {
2930 if (isRight) {
2931 y = -0.5 * (fullWidth - extWidth);
2932 z = 0.5 * (-fullLength + fgkmm * 10.0);
2933 }
2934 else {
2935 y = -0.5 * (fullWidth - extWidth);
2936 z = 0.5 * ( fullLength - fgkmm * 10.0);
2937 }
2938 }
3ffa185f 2939 x = 0.5 * (extThickness - fullThickness) + busThickness;
2940 //y = 0.5 * (fullWidth - extWidth);
2941 TGeoTranslation *trExt1 = new TGeoTranslation(x, y, z);
2942 if (isRight) {
2943 z -= 0.5 * (ext1Length - extThickness);
2944 }
2945 else {
2946 z += 0.5 * (ext1Length - extThickness);
2947 }
2948 x += 0.5*(extHeight - 3.*extThickness);
2949 TGeoTranslation *trExt2 = new TGeoTranslation(x, y, z);
2950 if (isRight) {
2951 z -= 0.5 * (ext2Length - extThickness) + 2.5*extThickness;
2952 }
2953 else {
2954 z += 0.5 * (ext2Length - extThickness) + 2.5*extThickness;
2955 }
2956 x += 0.5*(extHeight - extThickness) - 2.*extThickness;
2957 TGeoTranslation *trExt3 = new TGeoTranslation(x, y, z);
2958 container->AddNode(ext1, 0, trExt1);
2959 container->AddNode(ext2, 0, trExt2);
2960 container->AddNode(ext3, 0, trExt3);
7f69c251 2961
54c9a3d9 2962 sizes[3] = yRef + pt1000Y;
2963 sizes[4] = zRef + pt1000Z[2];
2964 sizes[5] = zRef + pt1000Z[7];
2965
2966 return container;
592651e2 2967}
7f69c251 2968
2969//______________________________________________________________________
0b9c8a10 2970TList* AliITSv11GeometrySPD::CreateConeModule(TGeoManager *mgr) const
7f69c251 2971{
2972 TGeoMedium *medInox = GetMedium("INOX$",mgr);
3ffa185f 2973 TGeoMedium *medExt = GetMedium("SDDKAPTON (POLYCH2)$", mgr);
2974 TGeoMedium *medPlate = GetMedium("SPD C (M55J)$", mgr);
2975
2976 Double_t extThickness = fgkmm * 0.25;
2977 Double_t ext1Length = fgkmm * (26.7 - 10.0);
2978 Double_t ext2Length = fgkmm * (285.0 - ext1Length + extThickness);
7f69c251 2979
2980 Double_t cableThickness = 1.5 * fgkmm;
2981 Double_t cableL1 = 350.0 * fgkmm - extThickness - ext1Length - ext2Length;
b0d2bb60 2982 Double_t cableL2 = 340.0 * fgkmm;
7f69c251 2983 //Double_t cableL3 = 570.0 * fgkmm;
2984 Double_t cableL3 = 57.0 * fgkmm;
2985 Double_t cableW1 = 11.0 * fgkmm;
2986 Double_t cableW2 = 30.0 * fgkmm;
2987 Double_t cableW3 = 50.0 * fgkmm;
2988
2989 Double_t mcmThickness = 1.2 *fgkmm;
2990 Double_t mcmLength = cableL1 + cableL2 + cableL3;
2991 Double_t mcmWidth = cableW1;
2992
2993 Double_t plateLength = 200.0 * fgkmm;
2994 Double_t plateWidth = 50.0 * fgkmm;
2995 Double_t plateThickness = 5.0 * fgkmm;
2996
2997 Double_t x[12], y[12];
2998
2999 x[0] = 7.5;
3000 y[0] = 0.0 + 0.5 * cableW1;
3001
3002 x[1] = x[0] + cableL1 - 0.5*(cableW2 - cableW1);
3003 y[1] = y[0];
3004
3005 x[2] = x[0] + cableL1;
3006 y[2] = y[1] + 0.5*(cableW2 - cableW1);
3007
3008 x[3] = x[2] + cableL2;
3009 y[3] = y[2];
3010
3011 x[4] = x[3] + 0.5*(cableW3 - cableW2);
3012 y[4] = y[3] + 0.5*(cableW3 - cableW2);
3013
3014 x[5] = x[4] + cableL3 - 0.5*(cableW3 - cableW2);
3015 y[5] = y[4];
3016
3017 for (Int_t i = 6; i < 12; i++) {
3018 x[i] = x[11 - i];
3019 y[i] = -y[11 - i];
3020 }
3021
0b9c8a10 3022 TGeoVolumeAssembly* container[2];
3023 container[0] = new TGeoVolumeAssembly("ITSSPDConeModule");
3024 container[1] = new TGeoVolumeAssembly("ITSSPDCoolingModule");
7f69c251 3025
3026 TGeoXtru *shCable = new TGeoXtru(2);
3027 shCable->DefinePolygon(12, x, y);
3028 shCable->DefineSection(0, 0., 0., 0., 1.0);
3029 shCable->DefineSection(1, cableThickness, 0., 0., 1.0);
3030
3031 TGeoVolume *volCable = new TGeoVolume("ITSSPDExtender", shCable, medExt);
3032 volCable->SetLineColor(kGreen);
3033
0df245e4 3034 TGeoVolume *volTube = gGeoManager->MakeTube("ITSSPDCoolingTubeCone", medInox, 5.*fgkmm, 6.*fgkmm, 0.5*(x[5] - x[0]));
7f69c251 3035 volTube->SetLineColor(kGray);
3036
3037 Double_t thickness = cableThickness + mcmThickness;
3038 TGeoBBox *shOut = new TGeoBBox("ITSSPD_shape_plateout", 0.5*plateThickness, 0.5*plateLength, 0.5*plateWidth);
3039 TGeoBBox *shIn = new TGeoBBox("ITSSPD_shape_platein", 0.5*thickness, 0.52*plateLength, 0.5*cableW2);
3040 Char_t string[255];
3041 sprintf(string, "%s-%s", shOut->GetName(), shIn->GetName());
3042 TGeoCompositeShape *shPlate = new TGeoCompositeShape("ITSSPDPlate_shape", string);
3043 TGeoVolume *volPlate = new TGeoVolume("ITSSPDPlate", shPlate, medPlate);
3044 volPlate->SetLineColor(kRed);
3045
3046 TGeoVolume *volMCMExt = gGeoManager->MakeBox("ITSSPDextenderMCM", medExt, 0.5*mcmThickness, 0.5*mcmLength, 0.5*mcmWidth);
3047 volMCMExt->SetLineColor(kGreen+3);
3048
3049 TGeoRotation *rot = new TGeoRotation(*gGeoIdentity);
3050 rot->RotateX(90.0);
3051 rot->RotateZ(90.0);
0b9c8a10 3052 container[0]->AddNode(volCable, 0, rot);
7f69c251 3053
3054 TGeoTranslation *combi = new TGeoTranslation(cableThickness + 0.5*mcmThickness, x[0] + 0.5*mcmLength, 0.0);
0b9c8a10 3055 container[0]->AddNode(volMCMExt, 0, combi);
7f69c251 3056
3057 TGeoRotation *rot1 = new TGeoRotation(*gGeoIdentity);
93cd1f79 3058 rot1->RotateX(87.5);
0b9c8a10 3059 TGeoCombiTrans *tr = new TGeoCombiTrans(1.15, x[0] + 0.5*(x[5] - x[0]), -2.95, rot1);
3060 container[1]->AddNode(volTube, 0, tr);
7f69c251 3061
3062 TGeoTranslation *tr1 = new TGeoTranslation(0.5*plateThickness - 0.5*(plateThickness-thickness), x[3] - x[0] - 0.52*plateLength, 0.0);
0b9c8a10 3063 container[0]->AddNode(volPlate, 0, tr1);
7f69c251 3064
0b9c8a10 3065 TList* conemodulelist = new TList();
3066
3067 conemodulelist->Add(container[0]);
3068 conemodulelist->Add(container[1]);
3069
3070 return conemodulelist;
7f69c251 3071}
3072
3073//______________________________________________________________________
3074void AliITSv11GeometrySPD::CreateCones(TGeoVolume *moth) const
3075{
3076
0b9c8a10 3077 TList* modulelist = CreateConeModule(gGeoManager);
3078 TGeoVolumeAssembly* module;
3079
7f69c251 3080 //Double_t angle[10] = {18., 54., 90., 126., 162., -18., -54., -90., -126., -162.};
0b9c8a10 3081 // angleNm for cone modules (cables), angleNc for cooling tubes
3082 Double_t angle1m[10] = {18., 54., 90., 129., 165., 201.0, 237.0, 273.0, 309.0, 345.0};
3083 Double_t angle2m[10] = {18., 53., 90., 126., 162., 198.0, 233.0, 270.0, 309.0, 342.0};
3614667b 3084 Double_t angle1c[10] = {18., 54., 90., 124., 165., 201.0, 237.0, 273.0, 304.0, 345.0};
0b9c8a10 3085 Double_t angle2c[10] = {18., 44., 90., 126., 162., 198.0, 223.0, 270.0, 309.0, 342.0};
3086
3087 // First add the cables
3088 module = (TGeoVolumeAssembly*)modulelist->At(0);
7f69c251 3089 for (Int_t i = 0; i < 10; i++) {
3090 TGeoRotation *rot1 = new TGeoRotation(*gGeoIdentity);
3091 rot1->RotateY(-90.0);
b0d2bb60 3092 rot1->RotateX(45.0);
0b9c8a10 3093 angle1m[i] -= 1.5;
3094 rot1->RotateZ(90.0 - angle1m[i]);
b0d2bb60 3095 TGeoCombiTrans *tr1 = new TGeoCombiTrans(0.0, 0.0, 38.5, rot1);
7f69c251 3096 moth->AddNode(module, 2*i, tr1);
3097 TGeoRotation *rot2 = new TGeoRotation(*gGeoIdentity);
3098 rot2->RotateY(90.0);
b0d2bb60 3099 rot2->RotateX(-45.0);
0b9c8a10 3100 angle2m[i] -= 1.5;
3101 rot2->RotateZ(90.0 - angle2m[i]);
3614667b 3102 TGeoCombiTrans *tr2 = new TGeoCombiTrans(0.0, 0.0, -38.4, rot2);
0b9c8a10 3103 moth->AddNode(module, 2*i+1, tr2);
3104 }
3105
3106 // Then the cooling tubes
3107 module = (TGeoVolumeAssembly*)modulelist->At(1);
3108 for (Int_t i = 0; i < 10; i++) {
3109 TGeoRotation *rot1 = new TGeoRotation(*gGeoIdentity);
3110 rot1->RotateY(-90.0);
b0d2bb60 3111 rot1->RotateX(45.0);
0b9c8a10 3112 angle1c[i] -= 1.5;
3113 rot1->RotateZ(90.0 - angle1c[i]);
b0d2bb60 3114 TGeoCombiTrans *tr1 = new TGeoCombiTrans(0.0, 0.0, 38.5, rot1);
0b9c8a10 3115 moth->AddNode(module, 2*i, tr1);
3116 TGeoRotation *rot2 = new TGeoRotation(*gGeoIdentity);
3117 rot2->RotateY(90.0);
b0d2bb60 3118 rot2->RotateX(-45.0);
0b9c8a10 3119 angle2c[i] -= 1.5;
3120 rot2->RotateZ(90.0 - angle2c[i]);
3614667b 3121 TGeoCombiTrans *tr2 = new TGeoCombiTrans(0.0, 0.0, -38.4, rot2);
7f69c251 3122 moth->AddNode(module, 2*i+1, tr2);
3123 }
3124}
3125
54c9a3d9 3126//______________________________________________________________________
3127TGeoVolume* AliITSv11GeometrySPD::CreateExtender(
3128 const Double_t *extenderParams, const TGeoMedium *extenderMedium,
3129 TArrayD& sizes) const
bc3498f4 3130{
54c9a3d9 3131 //
3132 // ------------------ CREATE AN EXTENDER ------------------------
3133 //
3134 // This function creates the following picture (in plane xOy)
3135 // Should be useful for the definition of the pixel bus and MCM extenders
3136 // The origin corresponds to point 0 on the picture, at half-width
3137 // in Z direction
3138 //
3139 // Y 7 6 5
3140 // ^ +---+---------------------+
3141 // | / |
3142 // | / |
3143 // 0------> X / +---------------------+
3144 // / / 3 4
3145 // / /
3146 // 9 8 / /
3147 // +-----------+ /
3148 // | /
3149 // | /
3150 // ---> +-----------+---+
3151 // | 0 1 2
3152 // |
3153 // origin (0,0,0)
3154 //
3155 //
3156 // Takes 6 parameters in the following order :
3157 // |--> par 0 : inner length [0-1] / [9-8]
3158 // |--> par 1 : thickness ( = [0-9] / [4-5])
3159 // |--> par 2 : angle of the slope
3160 // |--> par 3 : total height in local Y direction
3161 // |--> par 4 : outer length [3-4] / [6-5]
3162 // |--> par 5 : width in local Z direction
3163 //
3164 Double_t slopeDeltaX = (extenderParams[3] - extenderParams[1]
3165 * TMath::Cos(extenderParams[2])) /
3166 TMath::Tan(extenderParams[2]);
3167 Double_t extenderXtruX[10] = {
3168 0 ,
3169 extenderParams[0] ,
3170 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2]) ,
3171 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
3172 slopeDeltaX ,
3173 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
3174 slopeDeltaX + extenderParams[4],
3175 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
3176 slopeDeltaX + extenderParams[4],
3177 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
3178 slopeDeltaX ,
3179 extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
3180 slopeDeltaX - extenderParams[1] * TMath::Sin(extenderParams[2]) ,
3181 extenderParams[0] ,
3182 0
3183 };
3184 Double_t extenderXtruY[10] = {
3185 0 ,
3186 0 ,
3187 extenderParams[1] * (1-TMath::Cos(extenderParams[2])) ,
3188 extenderParams[3] - extenderParams[1] ,
3189 extenderParams[3] - extenderParams[1] ,
3190 extenderParams[3] ,
3191 extenderParams[3] ,
3192 extenderParams[3]-extenderParams[1]*(1-TMath::Cos(extenderParams[2])) ,
3193 extenderParams[1] ,
3194 extenderParams[1]
3195 };
592651e2 3196
54c9a3d9 3197 if (sizes.GetSize() != 3) sizes.Set(3);
3198 Double_t &thickness = sizes[0];
3199 Double_t &length = sizes[1];
3200 Double_t &width = sizes[2];
3201
3202 thickness = extenderParams[3];
3203 width = extenderParams[5];
3204 length = extenderParams[0]+extenderParams[1]*
3205 TMath::Sin(extenderParams[2])+slopeDeltaX+extenderParams[4];
3206
3207 // creation of the volume
3208 TGeoXtru *extenderXtru = new TGeoXtru(2);
3209 TGeoVolume *extenderXtruVol = new TGeoVolume("ITSSPDextender",extenderXtru,
3210 extenderMedium);
3211 extenderXtru->DefinePolygon(10,extenderXtruX,extenderXtruY);
3212 extenderXtru->DefineSection(0,-0.5*extenderParams[4]);
3213 extenderXtru->DefineSection(1, 0.5*extenderParams[4]);
3214 return extenderXtruVol;
3215}
bc3498f4 3216//______________________________________________________________________
3217TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBusAndExtensions
3218(Bool_t /*zpos*/, TGeoManager *mgr) const
3219{
54c9a3d9 3220 //
3221 // Creates an assembly which contains the pixel bus and its extension
3222 // and the extension of the MCM.
3223 // By: Renaud Vernet
3224 // NOTE: to be defined its material and its extension in the outside
3225 // direction
3226 //
3227 // ==== constants =====
3228 //get the media
3229 // PIXEL BUS
3230 //TGeoMedium *medPixelBus = GetMedium("SPDBUS(AL+KPT+EPOX)$",mgr);
3231 // IXEL BUS EXTENDER
3232 TGeoMedium *medPBExtender = GetMedium("SDDKAPTON (POLYCH2)$",mgr);
3233 //MCM EXTENDER
3234 TGeoMedium *medMCMExtender = GetMedium("SDDKAPTON (POLYCH2)$",mgr);
3235 // //geometrical constants
3236 const Double_t kPbextenderThickness = 0.07 * fgkmm;
3237 //design=?? 70 deg. seems OK
3238 const Double_t kPbExtenderSlopeAngle = 70.0 * TMath::Pi()/180.;
3239 // = 2.6 - (0.28+0.05+0.35) cf design
3240 const Double_t kPbExtenderHeight = 1.92 * fgkmm;
3241 const Double_t kPbExtenderWidthY = 11.0 * fgkmm;
3242 //design=?? 70 deg. seems OK
3243 const Double_t kMcmExtenderSlopeAngle = 70.0 * TMath::Pi()/180.;
3244 const Double_t kMcmExtenderThickness = 0.10 * fgkmm;
3245 const Double_t kMcmExtenderHeight = 1.8 * fgkmm;
3246 const Double_t kMcmExtenderWidthY = kPbExtenderWidthY;
3247 // const Double_t groundingThickness = 0.07 * fgkmm;
3248 // const Double_t grounding2pixelBusDz = 0.625 * fgkmm;
3249 // const Double_t pixelBusThickness = 0.28 * fgkmm;
3250 // const Double_t groundingWidthX = 170.501 * fgkmm;
3251 // const Double_t pixelBusContactDx = 1.099 * fgkmm;
3252 // const Double_t pixelBusWidthY = 13.8 * fgkmm;
3253 //design=20 deg.
3254 // const Double_t pixelBusContactPhi = 20.0 * TMath::Pi()/180.
3255 // const Double_t pbExtenderTopZ = 2.72 * fgkmm;
3256 // const Double_t mcmThickness = 0.35 * fgkmm;
3257 // const Double_t halfStaveTotalLength = 247.64 * fgkmm;
3258 // const Double_t deltaYOrigin = 15.95/2.* fgkmm;
3259 // const Double_t deltaXOrigin = 1.1 * fgkmm;
3260 // const Double_t deltaZOrigin = halfStaveTotalLength / 2.;
3261 // const Double_t grounding2pixelBusDz2 = grounding2pixelBusDz+
3262 // groundingThickness/2. + pixelBusThickness/2.;
3263 // const Double_t pixelBusWidthX = groundingWidthX;
3264 // const Double_t pixelBusRaiseLength = (pixelBusContactDx-
3265 // pixelBusThickness*TMath::Sin(pixelBusContactPhi))/
3266 // TMath::Cos(pixelBusContactPhi);
3267 // const Double_t pbExtenderBaseZ = grounding2pixelBusDz2 +
3268 // pixelBusRaiseLength*TMath::Sin(pixelBusContactPhi) +
3269 // 2*pixelBusThickness*TMath::Sin(pixelBusContactPhi)*
3270 // TMath::Tan(pixelBusContactPhi);
3271 // const Double_t pbExtenderDeltaZ = pbExtenderTopZ-pbExtenderBaseZ;
3272 // const Double_t pbExtenderEndPointX = 2*deltaZOrigin -
3273 // groundingWidthX - 2*pixelBusThickness*TMath::Sin(pixelBusContactPhi);
3274 // const Double_t pbExtenderXtru3L = 1.5 * fgkmm; //arbitrary ?
3275 // const Double_t pbExtenderXtru4L = (pbExtenderDeltaZ +
3276 // pixelBusThickness*(TMath::Cos(extenderSlope)-2))/
3277 // TMath::Sin(extenderSlope);
3278 // const Double_t kMcmExtenderEndPointX = deltaZOrigin - 48.2 * fgkmm;
3279 // const Double_t kMcmExtenderXtru3L = 1.5 * fgkmm;
3280 // //===== end constants =====
3281 const Double_t kPbExtenderInnerLength = 10. * fgkmm;
3282 const Double_t kPbExtenderOuterLength = 15. * fgkmm;
3283 const Double_t kMcmExtenderInnerLength = 10. * fgkmm;
3284 const Double_t kMcmExtenderOuterLength = 15. * fgkmm;
3285 Double_t pbExtenderParams[6] = {kPbExtenderInnerLength, //0
3286 kPbextenderThickness, //1
3287 kPbExtenderSlopeAngle, //2
3288 kPbExtenderHeight, //3
3289 kPbExtenderOuterLength, //4
3290 kPbExtenderWidthY}; //5
3291
3292 Double_t mcmExtenderParams[6] = {kMcmExtenderInnerLength, //0
3293 kMcmExtenderThickness, //1
3294 kMcmExtenderSlopeAngle, //2
3295 kMcmExtenderHeight, //3
3296 kMcmExtenderOuterLength, //4
3297 kMcmExtenderWidthY}; //5
3298
3299 TArrayD sizes(3);
3300 TGeoVolume* pbExtender = CreateExtender(pbExtenderParams,medPBExtender,
3301 sizes);
3302 if(GetDebug(1))printf("CREATED AN EXTENDER : THICKNESS = %5.5f cm\t"
3303 "LENGTH=%5.5f cm\tWIDTH=%5.5f cm\n",sizes[0],sizes[1],sizes[2]);
3304 TGeoVolume* mcmExtender = CreateExtender(mcmExtenderParams,medMCMExtender,
3305 sizes);
3306 if(GetDebug(1))printf("CREATED AN EXTENDER : THICKNESS = %5.5f cm\t"
3307 "LENGTH=%5.5f cm\tWIDTH=%5.5f cm\n",sizes[0],sizes[1],sizes[2]);
3308 // Double_t pixelBusValues[5] = {pixelBusWidthX, //0
3309 // pixelBusThickness, //1
3310 // pixelBusContactPhi, //2
3311 // pixelBusRaiseLength, //3
3312 // pixelBusWidthY}; //4
3313
3314 // Double_t pbExtenderValues[8] = {pixelBusRaiseLength, //0
3315 // pixelBusContactPhi, //1
3316 // pbExtenderXtru3L, //2
3317 // pixelBusThickness, //3
3318 // extenderSlope, //4
3319 // pbExtenderXtru4L, //5
3320 // pbExtenderEndPointX, //6
3321 // kPbExtenderWidthY}; //7
3322
3323 // Double_t mcmExtenderValues[6] = {mcmExtenderXtru3L, //0
3324 // mcmExtenderThickness, //1
3325 // extenderSlope, //2
3326 // deltaMcmMcmExtender, //3
3327 // mcmExtenderEndPointX, //4
3328 // mcmExtenderWidthY}; //5
3329 // TGeoVolumeAssembly *pixelBus=new TGeoVolumeAssembly("ITSSPDpixelBus");
3330 // CreatePixelBus(pixelBus,pixelBusValues,medPixelBus);
3331 // TGeoVolumeAssembly *pbExtender = new TGeoVolumeAssembly(
3332 // "ITSSPDpixelBusExtender");
3333 // CreatePixelBusExtender(pbExtender,pbExtenderValues,medPBExtender);
3334 // TGeoVolumeAssembly *mcmExtender = new TGeoVolumeAssembly(
3335 // "ITSSPDmcmExtender");
3336 // CreateMCMExtender(mcmExtender,mcmExtenderValues,medMCMExtender);
3337 //-------------- DEFINITION OF GEOMETRICAL TRANSFORMATIONS --------
3338 // TGeoRotation * commonRot = new TGeoRotation("commonRot",0,90,0);
3339 // commonRot->MultiplyBy(new TGeoRotation("rot",-90,0,0));
3340 // TGeoTranslation * pixelBusTrans = new TGeoTranslation(
3341 // pixelBusThickness/2. - deltaXOrigin + 0.52*fgkmm ,
3342 // -pixelBusWidthY/2. + deltaYOrigin ,
3343 // -groundingWidthX/2. + deltaZOrigin);
3344 // TGeoRotation *pixelBusRot = new TGeoRotation(*commonRot);
3345 // TGeoTranslation *pbExtenderTrans =new TGeoTranslation(*pixelBusTrans);
3346 // TGeoRotation *pbExtenderRot = new TGeoRotation(*pixelBusRot);
3347 // pbExtenderTrans->SetDz(*(pbExtenderTrans->GetTranslation()+2) -
3348 // pixelBusWidthX/2. - 2*pixelBusThickness*
3349 // TMath::Sin(pixelBusContactPhi));
3350 // if (!zpos) {
3351 // pbExtenderTrans->SetDy(*(pbExtenderTrans->GetTranslation()+1) -
3352 // (pixelBusWidthY - kPbExtenderWidthY)/2.);
3353 // } else {
3354 // pbExtenderTrans->SetDy(*(pbExtenderTrans->GetTranslation()+1) +
3355 // (pixelBusWidthY - kPbExtenderWidthY)/2.);
3356 // }
3357 // pbExtenderTrans->SetDx(*(pbExtenderTrans->GetTranslation()) +
3358 // pixelBusThickness/2 + 2*pixelBusThickness*
3359 // TMath::Sin(pixelBusContactPhi)*
3360 // TMath::Tan(pixelBusContactPhi));
3361 // TGeoTranslation * mcmExtenderTrans = new TGeoTranslation(0.12*fgkmm +
3362 // mcmThickness - deltaXOrigin,
3363 // pbExtenderTrans->GetTranslation()[1],
3364 // -4.82);
3365 // TGeoRotation * mcmExtenderRot = new TGeoRotation(*pbExtenderRot);
3366 // // add pt1000 components
3367 // Double_t pt1000Z = fgkmm * 64400. * 1E-4;
3368 // //Double_t pt1000X[10] = {319700., 459700., 599700., 739700.,
3369 // 879700., 1029700., 1169700., 1309700.,
3370 // 1449700., 1589700.};
3371 // Double_t pt1000X[10] ={66160., 206200., 346200., 486200., 626200.,
3372 // 776200., 916200., 1056200., 1196200., 1336200.};
3373 // Double_t pt1000size[3] = {fgkmm*1.5, fgkmm*0.6, fgkmm*3.1};
3374 // Int_t i;
3375 // for (i = 0; i < 10; i++) {
3376 // pt1000X[i] *= fgkmm * 1E-4;
3377 // }
3378 // TGeoVolume *pt1000 = mgr->MakeBox("ITSSPDpt1000",0,0.5*pt1000size[0],
3379 // 0.5*pt1000size[1], 0.5*pt1000size[2]);
3380 // pt1000->SetLineColor(kGray);
3381 // Double_t refThickness = - pixelBusThickness;
3382 // for (i = 0; i < 10; i++) {
3383 // TGeoTranslation *tr = new TGeoTranslation(pt1000X[i]-
3384 // 0.5*pixelBusWidthX, 0.002+0.5*(-3.*refThickness+pt1000size[3]),
3385 // pt1000Z -0.5*pixelBusWidthY);
3386 // pixelBus->AddNode(pt1000, i+1, tr);
3387 // }
3388
3389 //CREATE FINAL VOLUME ASSEMBLY AND ROTATE IT
3390 TGeoVolumeAssembly *assembly = new TGeoVolumeAssembly("ITSSPDextenders");
3391 // assembly->AddNode((TGeoVolume*)pixelBus,1,
3392 // new TGeoCombiTrans(*pixelBusTrans,*pixelBusRot));
3393 // assembly->AddNode((TGeoVolume*)pbExtender,1,
3394 // new TGeoCombiTrans(*pbExtenderTrans,*pbExtenderRot));
3395 // assembly->AddNode((TGeoVolume*)mcmExtender,1,
3396 // new TGeoCombiTrans(*mcmExtenderTrans,*mcmExtenderRot));
3397 // assembly->AddNode(mcmExtender,1,new TGeoIdentity());
3398 assembly->AddNode(pbExtender,1);
3399 assembly->AddNode(mcmExtender,1);
3400 // assembly->SetTransparency(50);
3401
3402 return assembly;
592651e2 3403}
54c9a3d9 3404//______________________________________________________________________
3405TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateHalfStave(Bool_t isRight,
3406Int_t layer,Int_t idxCentral,Int_t idxSide,TArrayD &sizes,TGeoManager *mgr)
bc3498f4 3407{
54c9a3d9 3408 //
3409 // Implementation of an half-stave, which depends on the side where
3410 // we are on the stave. The convention for "left" and "right" is the
3411 // same as for the MCM. The return value is a TGeoAssembly which is
3412 // structured in such a way that the origin of its local reference
3413 // frame coincides with the origin of the whole stave.
3414 // The TArrayD passed by reference will contain details of the shape:
3415 // - sizes[0] = thickness
3416 // - sizes[1] = length
3417 // - sizes[2] = width
3418 // - sizes[3] = common 'x' position for eventual clips
3419 // - sizes[4] = common 'y' position for eventual clips
3420 // - sizes[5] = 'z' position of first clip
3421 // - sizes[6] = 'z' position of second clip
3422 //
3423
3424 // ** CHECK **
3425
3426 // idxCentral and idxSide must be different
3427 if (idxCentral == idxSide) {
3428 AliInfo("Ladders must be inserted in half-stave with "
3429 "different indexes.");
3430 idxSide = idxCentral + 1;
3431 AliInfo(Form("Central ladder will be inserted with index %d",
3432 idxCentral));
3433 AliInfo(Form("Side ladder will be inserted with index %d",idxSide));
3434 } // end if
3435
3436 // define the separations along Z direction between the objects
3437 Double_t sepLadderLadder = fgkmm * 0.2; // sep. btw the 2 ladders
3438 Double_t sepLadderCenter = fgkmm * 0.4; // sep. btw the "central" ladder
3439 // and the Z=0 plane in stave ref.
3440 Double_t sepLadderMCM = fgkmm * 0.3; // sep. btw the "external" ladder
3441 // and MCM
3442 Double_t sepBusCenter = fgkmm * 0.3; // sep. btw the bus central edge
3443 // and the Z=0 plane in stave ref.
3444
3445 // ** VOLUMES **
3446
3447 // grounding foil
3448 TArrayD grndSize(3);
3449 // This one line repalces the 3 bellow, BNS.
3450 TGeoVolume *grndVol = CreateGroundingFoil(isRight, grndSize, mgr);
3451 Double_t &grndThickness = grndSize[0];
3452 Double_t &grndLength = grndSize[1];
3453
3454 // ladder
3455 TArrayD ladderSize(3);
3456 TGeoVolume *ladder = CreateLadder(layer, ladderSize, mgr);
3457 Double_t ladderThickness = ladderSize[0];
3458 Double_t ladderLength = ladderSize[1];
3459 Double_t ladderWidth = ladderSize[2];
3460
3461 // MCM
3462 TArrayD mcmSize(3);
3463 TGeoVolumeAssembly *mcm = CreateMCM(!isRight,mcmSize,mgr);
3464 Double_t mcmThickness = mcmSize[0];
3465 Double_t mcmLength = mcmSize[1];
3466 Double_t mcmWidth = mcmSize[2];
3ffa185f 3467
54c9a3d9 3468 // bus
3469 TArrayD busSize(6);
22726349 3470 TGeoVolumeAssembly *bus = CreatePixelBus(isRight, layer, busSize, mgr);
54c9a3d9 3471 Double_t busThickness = busSize[0];
3472 Double_t busLength = busSize[1];
3473 Double_t busWidth = busSize[2];
3474
3475 // glue between ladders and pixel bus
3476 TGeoMedium *medLadGlue = GetMedium("EPOXY$", mgr);
3477 Double_t ladGlueThickness = fgkmm * 0.1175 - fgkGapLadder;
3478 TGeoVolume *ladderGlue = mgr->MakeBox("ITSSPDladderGlue",medLadGlue,
3479 0.5*ladGlueThickness, 0.5*busWidth, 0.5*busLength);
3480 ladderGlue->SetLineColor(kYellow + 5);
3481
3482 // create references for the whole object, as usual
3483 sizes.Set(7);
3484 Double_t &fullThickness = sizes[0];
3485 Double_t &fullLength = sizes[1];
3486 Double_t &fullWidth = sizes[2];
3ffa185f 3487
54c9a3d9 3488 // compute the full size of the container
3489 fullLength = sepLadderCenter+2.0*ladderLength+sepLadderMCM+
3490 sepLadderLadder+mcmLength;
3491 fullWidth = ladderWidth;
3492 fullThickness = grndThickness + fgkGapLadder + mcmThickness + busThickness;
ed0e944d 3493 //cout << "HSTAVE FULL THICKNESS = " << fullThickness << endl;
54c9a3d9 3494
3495 // ** MOVEMENTS **
3496
3497 // grounding foil (shifted only along thickness)
3498 Double_t xGrnd = -0.5*fullThickness + 0.5*grndThickness;
3499 Double_t zGrnd = -0.5*grndLength;
3500 if (!isRight) zGrnd = -zGrnd;
3501 TGeoTranslation *grndTrans = new TGeoTranslation(xGrnd, 0.0, zGrnd);
3502
3503 // ladders (translations along thickness and length)
3504 // layers must be sorted going from the one at largest Z to the
3505 // one at smallest Z:
3506 // -|Zmax| ------> |Zmax|
3507 // 3 2 1 0
3508 // then, for layer 1 ladders they must be placed exactly this way,
3509 // and in layer 2 at the opposite. In order to remember the placements,
3510 // we define as "inner" and "outer" ladder respectively the one close
3511 // to barrel center, and the one closer to MCM, respectively.
3512 Double_t xLad, zLadIn, zLadOut;
3513 xLad = xGrnd + 0.5*(grndThickness + ladderThickness) +
3514 0.01175 - fgkGapLadder;
3515 zLadIn = -sepLadderCenter - 0.5*ladderLength;
3516 zLadOut = zLadIn - sepLadderLadder - ladderLength;
3517 if (!isRight) {
3518 zLadIn = -zLadIn;
3519 zLadOut = -zLadOut;
3520 } // end if !isRight
3521 TGeoRotation *rotLad = new TGeoRotation(*gGeoIdentity);
3522 rotLad->RotateZ(90.0);
3523 rotLad->RotateY(180.0);
3524 Double_t sensWidth = fgkmm * 12.800;
3525 Double_t chipWidth = fgkmm * 15.950;
3526 Double_t guardRingWidth = fgkmm * 0.560;
3527 Double_t ladderShift = 0.5 * (chipWidth - sensWidth - 2.0*guardRingWidth);
3528 TGeoCombiTrans *trLadIn = new TGeoCombiTrans(xLad,ladderShift,zLadIn,
3529 rotLad);
3530 TGeoCombiTrans *trLadOut = new TGeoCombiTrans(xLad,ladderShift,zLadOut,
3531 rotLad);
3532
3533 // MCM (length and thickness direction, placing at same level as the
3534 // ladder, which implies to recompute the position of center, because
3535 // ladder and MCM have NOT the same thickness) the two copies of the
3536 // MCM are placed at the same distance from the center, on both sides
3537 Double_t xMCM = xGrnd + 0.5*grndThickness + 0.5*mcmThickness +
3538 0.01175 - fgkGapLadder;
3539 Double_t yMCM = 0.5*(fullWidth - mcmWidth);
3540 Double_t zMCM = zLadOut - 0.5*ladderLength - 0.5*mcmLength - sepLadderMCM;
3541 if (!isRight) zMCM = zLadOut + 0.5*ladderLength + 0.5*mcmLength +
3542 sepLadderMCM;
3543
3544 // create the correction rotations
3545 TGeoRotation *rotMCM = new TGeoRotation(*gGeoIdentity);
3546 rotMCM->RotateY(90.0);
3547 TGeoCombiTrans *trMCM = new TGeoCombiTrans(xMCM, yMCM, zMCM, rotMCM);
3548
3549 // glue between ladders and pixel bus
3550 Double_t xLadGlue = xLad + 0.5*ladderThickness + 0.01175 -
3551 fgkGapLadder + 0.5*ladGlueThickness;
3552
3553 // bus (length and thickness direction)
3554 Double_t xBus = xLadGlue + 0.5*ladGlueThickness + 0.5*busThickness;
7708d5f3 3555 Double_t yBus = 0.5*(fullWidth - busWidth) + 0.075; // Hardcode fix of a small overlap
54c9a3d9 3556 Double_t zBus = -0.5*busLength - sepBusCenter;
3557 if (!isRight) zBus = -zBus;
3558 TGeoTranslation *trBus = new TGeoTranslation(xBus, yBus, zBus);
3559
3560 TGeoTranslation *trLadGlue = new TGeoTranslation(xLadGlue, 0.0, zBus);
3561
3562 // create the container
3563 TGeoVolumeAssembly *container = 0;
3564 if (idxCentral+idxSide==5) {
3565 container = new TGeoVolumeAssembly("ITSSPDhalf-Stave1");
3566 } else {
3567 container = new TGeoVolumeAssembly("ITSSPDhalf-Stave0");
3568 } // end if
3569
3570 // add to container all objects
3571 container->AddNode(grndVol, 1, grndTrans);
3572 // ladders are inserted in different order to respect numbering scheme
3573 // which is inverted when going from outer to inner layer
3574 container->AddNode(ladder, idxCentral+1, trLadIn);
3575 container->AddNode(ladder, idxSide+1, trLadOut);
3576 container->AddNode(ladderGlue, 1, trLadGlue);
3577 container->AddNode(mcm, 1, trMCM);
3578 container->AddNode(bus, 1, trBus);
3579
3580 // since the clips are placed in correspondence of two pt1000s,
3581 // their position is computed here, but they are not added by default
3582 // it will be the StavesInSector method which will decide to add them
3583 // anyway, to recovery some size informations on the clip, it must be
3584 // created
3585 TArrayD clipSize;
3ffa185f 3586 // TGeoVolume *clipDummy = CreateClip(clipSize, kTRUE, mgr);
54c9a3d9 3587 CreateClip(clipSize, kTRUE, mgr);
3588 // define clip movements (width direction)
3589 sizes[3] = xBus + 0.5*busThickness;
3590 sizes[4] = 0.5 * (fullWidth - busWidth) - clipSize[6] - fgkmm*0.48;
3591 sizes[5] = zBus + busSize[4];
3592 sizes[6] = zBus + busSize[5];
3593
3594 return container;
592651e2 3595}
54c9a3d9 3596//______________________________________________________________________
3597TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateStave(Int_t layer,
3598 TArrayD &sizes, TGeoManager *mgr)
7855ea93 3599{
54c9a3d9 3600 //
3601 // This method uses all other ones which create pieces of the stave
3602 // and assemblies everything together, in order to return the whole
3603 // stave implementation, which is returned as a TGeoVolumeAssembly,
3604 // due to the presence of some parts which could generate fake overlaps
3605 // when put on the sector.
3606 // This assembly contains, going from bottom to top in the thickness
3607 // direction:
3608 // - the complete grounding foil, defined by the "CreateGroundingFoil"
3609 // method which already joins some glue and real groudning foil
3610 // layers for the whole stave (left + right);
3611 // - 4 ladders, which are sorted according to the ALICE numbering
3612 // scheme, which depends on the layer we are building this stave for;
3613 // - 2 MCMs (a left and a right one);
3614 // - 2 pixel buses (a left and a right one);
3615 // ---
3616 // Arguments:
3617 // - the layer number, which determines the displacement and naming
3618 // of sensitive volumes
3619 // - a TArrayD passed by reference which will contain the size
3620 // of virtual box containing the stave
3621 // - the TGeoManager
3622 //
3623
3624 // create the container
3625 TGeoVolumeAssembly *container = new TGeoVolumeAssembly(Form(
3626 "ITSSPDlay%d-Stave",layer));
3627 // define the indexes of the ladders in order to have the correct order
3628 // keeping in mind that the staves will be inserted as they are on layer
3629 // 2, while they are rotated around their local Y axis when inserted
3630 // on layer 1, so in this case they must be put in the "wrong" order
3631 // to turn out to be right at the end. The convention is:
3632 // -|Zmax| ------> |Zmax|
3633 // 3 2 1 0
3634 // with respect to the "native" stave reference frame, "left" is in
3635 // the positive Z this leads the definition of these indexes:
3636 Int_t idxCentralL, idxSideL, idxCentralR, idxSideR;
3637
3638 if (layer == 1) {
3639 idxSideL = 3;
3640 idxCentralL = 2;
3641 idxCentralR = 1;
3642 idxSideR = 0;
3643 } else {
3644 idxSideL = 0;
3645 idxCentralL = 1;
3646 idxCentralR = 2;
3647 idxSideR = 3;
3648 } // end if layer ==1
3649
3650 // create the two half-staves
3651 TArrayD sizeL, sizeR;
3652 TGeoVolumeAssembly *hstaveL = CreateHalfStave(kFALSE, layer, idxCentralL,
3653 idxSideL, sizeL,mgr);
3654 TGeoVolumeAssembly *hstaveR = CreateHalfStave(kTRUE, layer, idxCentralR,
3655 idxSideR, sizeR, mgr);
3656 // copy the size to the stave's one
3657 sizes.Set(9);
3658 sizes[0] = sizeL[0];
3659 sizes[1] = sizeR[1] + sizeL[1];
3660 sizes[2] = sizeL[2];
3661 sizes[3] = sizeL[3];
3662 sizes[4] = sizeL[4];
3663 sizes[5] = sizeL[5];
3664 sizes[6] = sizeL[6];
3665 sizes[7] = sizeR[5];
3666 sizes[8] = sizeR[6];
3667
3668 // add to container all objects
3669 container->AddNode(hstaveL, 1);
3670 container->AddNode(hstaveR, 1);
3671
3672 return container;
bc3498f4 3673}
54c9a3d9 3674//______________________________________________________________________
bc3498f4 3675void AliITSv11GeometrySPD::SetAddStave(Bool_t *mask)
3676{
54c9a3d9 3677 //
3678 // Define a mask which states qhich staves must be placed.
3679 // It is a string which must contain '0' or '1' depending if
3680 // a stave must be placed or not.
3681 // Each place is referred to one of the staves, so the first
3682 // six characters of the string will be checked.
3683 //
3684 Int_t i;
3685
3686 for (i = 0; i < 6; i++) fAddStave[i] = mask[i];
bc3498f4 3687}
54c9a3d9 3688//______________________________________________________________________
3689void AliITSv11GeometrySPD::StavesInSector(TGeoVolume *moth, TGeoManager *mgr)
3690{
3691 //
3692 // Unification of essentially two methods:
3693 // - the one which creates the sector structure
3694 // - the one which returns the complete stave
3695 // ---
3696 // For compatibility, this method requires the same arguments
3697 // asked by "CarbonFiberSector" method, which is recalled here.
3698 // Like this cited method, this one does not return any value,
3699 // but it inserts in the mother volume (argument 'moth') all the stuff
3700 // which composes the complete SPD sector.
3701 // ---
3702 // In the following, the stave numbering order used for arrays is the
3703 // same as defined in the GetSectorMountingPoints():
3704 // /5
3705 // /\/4
3706 // 1\ \/3
3707 // 0|___\/2
3708 // ---
3709 // Arguments: see description of "CarbonFiberSector" method.
3710 //
3711
3712 Double_t shift[6]; // shift from the innermost position in the
3713 // sector placement plane (where the stave
3714 // edge is in the point where the rounded
3715 // corner begins)
3716
3717 shift[0] = fgkmm * -0.691;
3718 shift[1] = fgkmm * 5.041;
3719 shift[2] = fgkmm * 1.816;
3720 shift[3] = fgkmm * -0.610;
3721 shift[4] = fgkmm * -0.610;
3722 shift[5] = fgkmm * -0.610;
3ffa185f 3723
3724 // corrections after interaction with Andrea and CAD
3725 Double_t corrX[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
3726 Double_t corrY[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
3727
3728 corrX[0] = 0.0046;
3729 corrX[1] = -0.0041;
3730 corrX[2] = corrX[3] = corrX[4] = corrX[5] = -0.0016;
3731
3732 corrY[0] = -0.0007;
3733 corrY[1] = -0.0009;
3734 corrY[2] = corrY[3] = corrY[4] = corrY[5] = -0.0003;
3735
3736 corrX[0] += 0.00026;
3737 corrY[0] += -0.00080;
3738
3739 corrX[1] += 0.00018;
3740 corrY[1] += -0.00086;
3741
3742 corrX[2] += 0.00020;
3743 corrY[2] += -0.00062;
3744
3745 corrX[3] += 0.00017;
3746 corrY[3] += -0.00076;
3747
3748 corrX[4] += 0.00016;
3749 corrY[4] += -0.00096;
3750
3751 corrX[5] += 0.00018;
3752 corrY[5] += -0.00107;
3753
54c9a3d9 3754 // create stave volumes (different for layer 1 and 2)
3755 TArrayD staveSizes1(9), staveSizes2(9), clipSize(5);
3756 Double_t &staveHeight = staveSizes1[2], &staveThickness = staveSizes1[0];
3757 TGeoVolume *stave1 = CreateStave(1, staveSizes1, mgr);
3758 TGeoVolume *stave2 = CreateStave(2, staveSizes2, mgr);
3759 TGeoVolume *clip = CreateClip(clipSize, kFALSE, mgr);
3760
3761 Double_t xL, yL; // leftmost edge of mounting point (XY projection)
3762 Double_t xR, yR; // rightmost edge of mounting point (XY projection)
3763 Double_t xM, yM; // middle point of the segment L-R
3764 Double_t dx, dy; // (xL - xR) and (yL - yR)
3765 Double_t widthLR; // width of the segment L-R
3766 Double_t angle; // stave rotation angle in degrees
3767 Double_t diffWidth; // difference between mounting plane width and
3768 // stave width (smaller)
3769 Double_t xPos, yPos; // final translation of the stave
3770 Double_t parMovement; // translation in the LR plane direction
3ffa185f 3771
54c9a3d9 3772 staveThickness += fgkGapHalfStave;
3ffa185f 3773
54c9a3d9 3774 // loop on staves
3775 Int_t i, iclip = 1;
3776 for (i = 0; i < 6; i++) {
3777 // in debug mode, if this stave is not required, it is skipped
3778 if (!fAddStave[i]) continue;
3779 // retrieve reference points
3780 GetSectorMountingPoints(i, xL, yL, xR, yR);
3781 xM = 0.5 * (xL + xR);
3782 yM = 0.5 * (yL + yR);
3783 dx = xL - xR;
3784 dy = yL - yR;
3785 angle = TMath::ATan2(dy, dx);
3786 widthLR = TMath::Sqrt(dx*dx + dy*dy);
3787 diffWidth = 0.5*(widthLR - staveHeight);
3788 // first, a movement along this plane must be done
3789 // by an amount equal to the width difference
3790 // and then the fixed shift must also be added
3791 parMovement = diffWidth + shift[i];
3792 // due to stave thickness, another movement must be done
3793 // in the direction normal to the mounting plane
3794 // which is computed using an internal method, in a reference
3795 // frame where the LR segment has its middle point in the origin
3796 // and axes parallel to the master reference frame
3797 if (i == 0) {
3798 ParallelPosition(-0.5*staveThickness, -parMovement, angle,
3799 xPos, yPos);
3800 } // end if i==0
3801 if (i == 1) {
3802 ParallelPosition( 0.5*staveThickness, -parMovement, angle,
3803 xPos, yPos);
3804 }else {
3805 ParallelPosition( 0.5*staveThickness, parMovement, angle,
3806 xPos, yPos);
3807 } // end if i==1
3808 // then we go into the true reference frame
3809 xPos += xM;
3810 yPos += yM;
3ffa185f 3811 xPos += corrX[i];
3812 yPos += corrY[i];
54c9a3d9 3813 // using the parameters found here, compute the
3814 // translation and rotation of this stave:
3815 TGeoRotation *rot = new TGeoRotation(*gGeoIdentity);
3816 if (i == 0 || i == 1) rot->RotateX(180.0);
3817 rot->RotateZ(90.0 + angle * TMath::RadToDeg());
3818 TGeoCombiTrans *trans = new TGeoCombiTrans(xPos, yPos, 0.0, rot);
3819 if (i == 0 || i == 1) {
3820 moth->AddNode(stave1, i+1, trans);
3821 }else {
3822 moth->AddNode(stave2, i - 1, trans);
3823 if (i != 2) {
3824 // except in the case of stave #2,
3825 // clips must be added, and this is done directly on the sector
3826 Int_t j;
4adcf390 3827 //TArrayD clipSize;
54c9a3d9 3828 TGeoRotation *rotClip = new TGeoRotation(*gGeoIdentity);
3829 rotClip->RotateZ(-90.0);
3830 rotClip->RotateX(180.0);
3831 Double_t x = staveSizes2[3] + fgkGapHalfStave;
3832 Double_t y = staveSizes2[4];
3833 Double_t z[4] = { staveSizes2[5], staveSizes2[6],
3834 staveSizes2[7], staveSizes2[8] };
3835 for (j = 0; j < 4; j++) {
3836 TGeoCombiTrans *trClip = new TGeoCombiTrans(x, y, z[j],
3837 rotClip);
3838 *trClip = *trans * *trClip;
3839 moth->AddNode(clip, iclip++, trClip);
3840 } // end for j
3841 } // end if i!=2
3842 } // end if i==0||i==1 else
3843 } // end for i
592651e2 3844}
54c9a3d9 3845//______________________________________________________________________
bc3498f4 3846void AliITSv11GeometrySPD::ParallelPosition(Double_t dist1, Double_t dist2,
54c9a3d9 3847 Double_t phi, Double_t &x, Double_t &y) const
3848{
3849 //
3850 // Performs the following steps:
3851 // 1 - finds a straight line parallel to the one passing through
3852 // the origin and with angle 'phi' with X axis(phi in RADIANS);
3853 // 2 - finds another line parallel to the previous one, with a
3854 // distance 'dist1' from it
3855 // 3 - takes a reference point in the second line in the intersection
3856 // between the normal to both lines passing through the origin
3857 // 4 - finds a point whith has distance 'dist2' from this reference,
3858 // in the second line (point 2)
3859 // ----
3860 // According to the signs given to dist1 and dist2, the point is
3861 // found in different position w.r. to the origin
3862 // compute the point
3863 //
3864 Double_t cs = TMath::Cos(phi);
3865 Double_t sn = TMath::Sin(phi);
3866
3867 x = dist2*cs - dist1*sn;
3868 y = dist1*cs + dist2*sn;
592651e2 3869}
54c9a3d9 3870//______________________________________________________________________
3871Double_t AliITSv11GeometrySPD::GetSPDSectorTranslation(
3872 Double_t x0,Double_t y0,Double_t x1,Double_t y1,Double_t r) const
3873{
3874 //
3875 // Comutes the radial translation of a sector to give the
3876 // proper distance between SPD detectors and the beam pipe.
3877 // Units in are units out.
3878 //
3879
3880 //Begin_Html
3881 /*
3882 <A HREF="http://www.physics.ohio-state.edu/HIRG/SoftWareDoc/SPD_Sector_Position.png">
3883 Figure showing the geometry used in the computation below. </A>
3884 */
3885 //End_Html
3886
3887 // Inputs:
3888 // Double_t x0 Point x0 on Sector surface for the inner
3889 // most detector mounting
3890 // Double_t y0 Point y0 on Sector surface for the innor
3891 // most detector mounting
3892 // Double_t x1 Point x1 on Sector surface for the inner
3893 // most detector mounting
3894 // Double_t y1 Point y1 on Sector surface for the innor
3895 // most detector mounting
3896 // Double_t r The radial distance this mounting surface
3897 // should be from the center of the beam pipe.
3898 // Outputs:
3899 // none.
3900 // Return:
3901 // The distance the SPD sector should be displaced radialy.
3902 //
3903 Double_t a,b,c;
3904
3905 a = x0-x1;
3906 if(a==0.0) return 0.0;
3907 a = (y0-y1)/a;
3908 b = TMath::Sqrt(1.0+a*a);
3909 c = y0-a*x0-r*b;
3910 return -c;
3911}
3912//______________________________________________________________________
bc3498f4 3913void AliITSv11GeometrySPD::CreateFigure0(const Char_t *filepath,
3914 const Char_t *type,
54c9a3d9 3915 TGeoManager *mgr) const
3916{
3917 //
bc3498f4 3918 // Creates Figure 0 for the documentation of this class. In this
3919 // specific case, it creates the X,Y cross section of the SPD suport
3920 // section, center and ends. The output is written to a standard
3921 // file name to the path specificed.
3922 // Inputs:
3923 // const Char_t *filepath Path where the figure is to be drawn
3924 // const Char_t *type The type of file, default is gif.
3925 // TGeoManager *mgr The TGeoManager default gGeoManager
3926 // Output:
3927 // none.
3928 // Return:
3929 // none.
54c9a3d9 3930 //
bc3498f4 3931 TGeoXtru *sA0,*sA1,*sB0,*sB1;
3932 //TPolyMarker *pmA,*pmB;
3933 TPolyLine plA0,plA1,plB0,plB1;
3934 TCanvas *canvas;
3935 TLatex txt;
3936 Double_t x=0.0,y=0.0;
3937 Int_t i,kNRadii=6;
3938
3939 if(strcmp(filepath,"")){
3940 Error("CreateFigure0","filepath=%s type=%s",filepath,type);
3941 } // end if
3942 //
54c9a3d9 3943 sA0 = (TGeoXtru*) mgr->GetVolume("ITSSPDCarbonFiberSupportSectorA0_1")->
3944 GetShape();
3945 sA1 = (TGeoXtru*) mgr->GetVolume("ITSSPDCarbonFiberSupportSectorAirA1_1")->
3946 GetShape();
3947 sB0 = (TGeoXtru*) mgr->GetVolume("ITSSPDCarbonFiberSupportSectorEndB0_1")->
3948 GetShape();
3949 sB1 = (TGeoXtru*) mgr->GetVolume("ITSSPDCarbonFiberSupportSectorEndAirB1_1"
3950 )->GetShape();
bc3498f4 3951 //pmA = new TPolyMarker();
3952 //pmA.SetMarkerStyle(2); // +
3953 //pmA.SetMarkerColor(7); // light blue
3954 //pmB = new TPolyMarker();
3955 //pmB.SetMarkerStyle(5); // X
3956 //pmB.SetMarkerColor(6); // purple
3957 plA0.SetPolyLine(sA0->GetNvert());
3958 plA0.SetLineColor(1); // black
3959 plA0.SetLineStyle(1);
3960 plA1.SetPolyLine(sA1->GetNvert());
3961 plA1.SetLineColor(2); // red
3962 plA1.SetLineStyle(1);
3963 plB0.SetPolyLine(sB0->GetNvert());
3964 plB0.SetLineColor(3); // Green
3965 plB0.SetLineStyle(2);
3966 plB1.SetPolyLine(sB1->GetNvert());
3967 plB1.SetLineColor(4); // Blue
3968 plB1.SetLineStyle(2);
3969 //for(i=0;i<kNRadii;i++) pmA.SetPoint(i,xyB1p[i][0],xyB1p[i][1]);
3970 //for(i=0;i<kNRadii;i++) pmB.SetPoint(i,xyB1p[i][0],xyB1p[i][1]);
3971 for(i=0;i<sA0->GetNvert();i++) plA0.SetPoint(i,sA0->GetX(i),sA0->GetY(i));
3972 for(i=0;i<sA1->GetNvert();i++) plA1.SetPoint(i,sA1->GetX(i),sA1->GetY(i));
3973 for(i=0;i<sB0->GetNvert();i++) plB0.SetPoint(i,sB0->GetX(i),sB0->GetY(i));
3974 for(i=0;i<sB1->GetNvert();i++) plB1.SetPoint(i,sB1->GetX(i),sB1->GetY(i));
3975 canvas = new TCanvas("AliITSv11GeometrySPDFig0","",1000,1000);
3976 canvas->Range(-3.,-3.,3.,3.);
3977 txt.SetTextSize(0.05);
3978 txt.SetTextAlign(33);
3979 txt.SetTextColor(1);
3980 txt.DrawLatex(2.9,2.9,"Section A-A outer Carbon Fiber surface");
3981 txt.SetTextColor(2);
3982 txt.DrawLatex(2.9,2.5,"Section A-A Inner Carbon Fiber surface");
3983 txt.SetTextColor(3);
3984 txt.DrawLatex(2.9,2.1,"Section E-E outer Carbon Fiber surface");
3985 txt.SetTextColor(4);
3986 txt.DrawLatex(2.9,1.7,"Section E-E Inner Carbon Fiber surface");
3987 plA0.Draw();
3988 plA1.Draw();
3989 plB0.Draw();
3990 plB1.Draw();
3991 //pmA.Draw();
3992 //pmB.Draw();
3993 //
3994 x = 1.0;
3995 y = -2.5;
3996 Char_t chr[3];
3997 for(i=0;i<kNRadii;i++){
3998 sprintf(chr,"%2d",i);txt.DrawLatex(x-0.1,y,chr);
3999 sprintf(chr,"%8.4f",5.000);txt.DrawLatex(x,y,chr);
4000 sprintf(chr,"%8.4f",5.000);txt.DrawLatex(x+0.5,y,chr);
4001 sprintf(chr,"%8.4f",5.000);txt.DrawLatex(x+1.0,y,chr);
4002 sprintf(chr,"%8.4f",5.000);txt.DrawLatex(x+1.5,y,chr);
4003 sprintf(chr,"%8.4f",5.000);txt.DrawLatex(x+2.0,y,chr);
4004 if(kTRUE) txt.DrawLatex(x+2.5,y,"A-A/E-E");
4005 else txt.DrawLatex(x+2.5,y,"E-E");
4006 } // end for i
4007 txt.DrawLatex(x,y,"x_{c} mm");
4008 txt.DrawLatex(x+0.5,y,"y_{c} mm");
4009 txt.DrawLatex(x+1.0,y,"R mm");
4010 txt.DrawLatex(x+1.5,y,"#theta_{start}^{#circle}");
4011 txt.DrawLatex(x+2.0,y,"#theta_{end}^{#circle}");
4012 txt.DrawLatex(x+2.5,y,"Section");
4013 //
4014}
54c9a3d9 4015//______________________________________________________________________
4016void AliITSv11GeometrySPD::PrintAscii(ostream *os) const
4017{
4018 //
bc3498f4 4019 // Print out class data values in Ascii Form to output stream
4020 // Inputs:
4021 // ostream *os Output stream where Ascii data is to be writen
4022 // Outputs:
4023 // none.
4024 // Return:
4025 // none.
54c9a3d9 4026 //
4027 Int_t i,j,k;
bc3498f4 4028#if defined __GNUC__
4029#if __GNUC__ > 2
4030 ios::fmtflags fmt = cout.flags();
4031#else
4032 Int_t fmt;
4033#endif
4034#else
4035#if defined __ICC || defined __ECC || defined __xlC__
4036 ios::fmtflags fmt;
4037#else
4038 Int_t fmt;
4039#endif
4040#endif
54c9a3d9 4041
4042 *os<< fgkGapLadder <<" "<< fgkGapHalfStave<<" "<< 6 <<" ";
4043 for(i=0;i<6;i++) *os<< fAddStave[i] <<" "<<fSPDsectorX0.GetSize();
4044 for(i=0;i<fSPDsectorX0.GetSize();i++) *os<< fSPDsectorX0.GetAt(i) << " ";
4045 for(i=0;i<fSPDsectorX0.GetSize();i++) *os<< fSPDsectorY0.GetAt(i) << " ";
4046 for(i=0;i<fSPDsectorX1.GetSize();i++) *os<< fSPDsectorX1.GetAt(i) << " ";
4047 for(i=0;i<fSPDsectorX1.GetSize();i++) *os<< fSPDsectorY1.GetAt(i) << " ";
4048 *os<<10<<" "<< 2 <<" " << 6 << " "<< 3 <<" ";
4049 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++)
4050 *os<<fTubeEndSector[k][0][i][j]<<" ";
4051 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++)
4052 *os<<fTubeEndSector[k][1][i][j]<<" ";
bc3498f4 4053 os->flags(fmt); // reset back to old Formating.
4054 return;
4055}
4056//
54c9a3d9 4057//______________________________________________________________________
4058void AliITSv11GeometrySPD::ReadAscii(istream* is)
4059{
4060 //
bc3498f4 4061 // Read in class data values in Ascii Form to output stream
4062 // Inputs:
4063 // istream *is Input stream where Ascii data is to be read in from
4064 // Outputs:
4065 // none.
4066 // Return:
4067 // none.
54c9a3d9 4068 //
4069 Int_t i,j,k,n;
4070 Double_t gapLadder,GapHalfStave;
4071
4072 *is>>gapLadder>>GapHalfStave>>n;
4073 if(n!=6){
4074 Warning("ReadAscii","fAddStave Array !=6 n=%d",n);
4075 return;
4076 } // end if
4077 for(i=0;i<n;i++) *is>>fAddStave[i];
4078 *is>>n;
4079 fSPDsectorX0.Set(n);
4080 fSPDsectorY0.Set(n);
4081 fSPDsectorX1.Set(n);
4082 fSPDsectorY1.Set(n);
4083 for(i=0;i<n;i++) *is>>fSPDsectorX0[i];
4084 for(i=0;i<n;i++) *is>>fSPDsectorY0[i];
4085 for(i=0;i<n;i++) *is>>fSPDsectorX1[i];
4086 for(i=0;i<n;i++) *is>>fSPDsectorY1[i];
4087 *is>> i>>j>>n;
4088 if(i!=2||j!=6||n!=3){
4089 Warning("ReadAscii","fTubeEndSector array wrong size [2][6][3],"
4090 "found [%d][%d][%d]",i,j,n);
4091 return;
4092 } // end if
4093 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++)
4094 *is>>fTubeEndSector[k][0][i][j];
4095 for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++)
4096 *is>>fTubeEndSector[k][1][i][j];
4097 return;
bc3498f4 4098}
4099//
54c9a3d9 4100//______________________________________________________________________
4101ostream &operator<<(ostream &os,const AliITSv11GeometrySPD &s)
4102{
4103 //
bc3498f4 4104 // Standard output streaming function
4105 // Inputs:
4106 // ostream &os output steam
4107 // AliITSvPPRasymmFMD &s class to be streamed.
4108 // Output:
4109 // none.
4110 // Return:
4111 // ostream &os The stream pointer
54c9a3d9 4112 //
bc3498f4 4113 s.PrintAscii(&os);
4114 return os;
4115}
4116//
54c9a3d9 4117//______________________________________________________________________
4118istream &operator>>(istream &is,AliITSv11GeometrySPD &s)
4119{
4120 //
bc3498f4 4121 // Standard inputput streaming function
4122 // Inputs:
4123 // istream &is input steam
4124 // AliITSvPPRasymmFMD &s class to be streamed.
4125 // Output:
4126 // none.
4127 // Return:
4128 // ostream &os The stream pointer
54c9a3d9 4129 //
bc3498f4 4130 s.ReadAscii(&is);
4131 return is;
4132}
4133//
54c9a3d9 4134//______________________________________________________________________
bc3498f4 4135Bool_t AliITSv11GeometrySPD::Make2DCrossSections(TPolyLine &a0,TPolyLine &a1,
54c9a3d9 4136 TPolyLine &b0,TPolyLine &b1,TPolyMarker &p)const
4137{
4138 //
297369a1 4139 // Fill the objects with the points representing
4140 // a0 the outer carbon fiber SPD sector shape Cross Section A
4141 // a1 the inner carbon fiber SPD sector shape Cross Section A
4142 // b0 the outer carbon fiber SPD sector shape Cross Section B
4143 // b1 the inner carbon fiber SPD sector shape Cross Section B
4144 //
4145 // Inputs:
4146 // TPolyLine &a0 The outer carbon fiber SPD sector shape
4147 // TPolyLine &a1 The Inner carbon fiber SPD sector shape
4148 // TPolyLine &b0 The outer carbon fiber SPD sector shape
4149 // TPolyLine &b1 The Inner carbon fiber SPD sector shape
4150 // TPolyMarker &p The points where the ladders are to be placed
4151 // Outputs:
4152 // TPolyLine &a0 The shape filled with the points
4153 // TPolyLine &a1 The shape filled with the points
4154 // TPolyLine &b0 The shape filled with the points
4155 // TPolyLine &b1 The shape filled with the points
4156 // TPolyMarker &p The filled array of points
4157 // Return:
4158 // An error flag.
54c9a3d9 4159 //
297369a1 4160 Int_t n0,n1,i;
4161 Double_t x,y;
4162 TGeoVolume *a0V,*a1V,*b0V,*b1V;
4163 TGeoXtru *a0S,*a1S,*b0S,*b1S;
4164 TGeoManager *mgr = gGeoManager;
4165
bc3498f4 4166 a0V = mgr->GetVolume("ITS SPD Carbon fiber support Sector A0");
297369a1 4167 a0S = dynamic_cast<TGeoXtru*>(a0V->GetShape());
4168 n0 = a0S->GetNvert();
4169 a0.SetPolyLine(n0+1);
4170 //for(i=0;i<fSPDsectorPoints0.GetSize();i++)
4171 // printf("%d %d %d\n",i,fSPDsectorPoints0[i],fSPDsectorPoints1[i]);
4172 for(i=0;i<n0;i++){
4173 x = a0S->GetX(i);
54c9a3d9 4174 y = a0S->GetY(i);
4175 //printf("%d %g %g\n",i,x,y);
297369a1 4176 a0.SetPoint(i,x,y);
54c9a3d9 4177 if(i==0) a0.SetPoint(n0,x,y);
297369a1 4178 } // end for i
4179 a1V = mgr->GetVolume("ITSSPDCarbonFiberSupportSectorAirA1");
4180 a1S = dynamic_cast<TGeoXtru*>(a1V->GetShape());
4181 n1 = a1S->GetNvert();
4182 a1.SetPolyLine(n1+1);
4183 for(i=0;i<n1;i++){
4184 x = a1S->GetX(i);
54c9a3d9 4185 y = a1S->GetY(i);
297369a1 4186 a1.SetPoint(i,x,y);
54c9a3d9 4187 if(i==0) a1.SetPoint(n1,x,y);
297369a1 4188 } // end for i
4189 // Cross Section B
4190 b0V = mgr->GetVolume("ITSSPDCarbonFiberSupportSectorEndB0");
4191 b0S = dynamic_cast<TGeoXtru*>(b0V->GetShape());
4192 n0 = b0S->GetNvert();
4193 b0.SetPolyLine(n0+1);
4194 for(i=0;i<n0;i++){
4195 x = b0S->GetX(i);
54c9a3d9 4196 y = b0S->GetY(i);
297369a1 4197 b0.SetPoint(i,x,y);
54c9a3d9 4198 if(i==0) b0.SetPoint(n0,x,y);
297369a1 4199 } // end for i
4200 b1V = mgr->GetVolume("ITSSPDCarbonFiberSupportSectorEndAirB1");
4201 b1S = dynamic_cast<TGeoXtru*>(b1V->GetShape());
4202 n1 = b1S->GetNvert();
4203 b1.SetPolyLine(n1+1);
4204 for(i=0;i<n1;i++){
4205 x = b1S->GetX(i);
54c9a3d9 4206 y = b1S->GetY(i);
297369a1 4207 b1.SetPoint(i,x,y);
54c9a3d9 4208 if(i==0) b1.SetPoint(n1,x,y);
297369a1 4209 } // end for i
4210 //
4211 Double_t x0,y0,x1,y1;
bc3498f4 4212 p.SetPolyMarker(2*fSPDsectorX0.GetSize());
4213 for(i=0;i<fSPDsectorX0.GetSize();i++){
54c9a3d9 4214 GetSectorMountingPoints(i,x0,y0,x1,y1);
4215 p.SetPoint(2*i,x0,y0);
4216 p.SetPoint(2*i+1,x1,y1);
297369a1 4217 } // end for i
4218 return kTRUE;
4219}