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