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