This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / STRUCT / AliFRAMEv1.cxx
CommitLineData
fe4da5cc 1///////////////////////////////////////////////////////////////////////////////
2// //
3// Space frame class //
4// //
5//Begin_Html
6/*
7<img src="gif/AliFRAMEClass.gif">
8*/
9//End_Html
10// //
11///////////////////////////////////////////////////////////////////////////////
12
13#include "AliFRAMEv1.h"
14#include "AliRun.h"
15#include "AliMC.h"
16
17ClassImp(AliFRAMEv1)
18
19//_____________________________________________________________________________
20AliFRAMEv1::AliFRAMEv1() : AliFRAME()
21{
22 //
23 // Default constructor for space frame
24 //
25}
26
27//_____________________________________________________________________________
28AliFRAMEv1::AliFRAMEv1(const char *name, const char *title)
29 : AliFRAME(name,title)
30{
31 //
32 // Standard constructor for space frame
33 //
34}
35
36//_____________________________________________________________________________
37void AliFRAMEv1::CreateGeometry()
38{
39 //
40 // Create space frame geometry
41 //
42 //Begin_Html
43 /*
44 <img src="gif/AliFRAME.gif">
45 */
46 //End_Html
47 //Begin_Html
48 /*
49 <img src="gif/AliFRAMETree.gif">
50 */
51 //End_Html
52 AliMC* pMC = AliMC::GetMC();
53
54 Int_t *idtmed = gAlice->Idtmed();
55
56 Float_t dphi, dz_small, zpos, ddphi;
57 Float_t tspar[5];
58 Float_t tsparl[5];
59 Float_t par[50], dz_long;
60
61 // R_IN : INNER RADIUS
62 // R_OU : OUTER RADIUS
63 // DR : WALL THICKNESS
64 // 2*Z_IN : FREE SPACE IN Z FOR PHOS
65 // 2*Z_RI : FREE SPACE IN Z FOR RICH
66 // 2*Z_OU : LENGTH
67 // 2*DZ : WIDTH OF FRAME ELEMENTS
68 Float_t r_in = 395;
69 Float_t r_ou = 420;
70 Float_t dr = 0.3;
71 Float_t z_in = 130;
72 Float_t z_ou = 350;
73 Float_t z_ri = 236.25;
74 Float_t dz = 8.75;
75
76
77 // Space Frame
78
79 par[0] = r_in;
80 par[1] = r_ou;
81 par[2] = z_ou;
82 pMC->Gsvolu("BFMO", "TUBE", idtmed[1214], par, 3);
83
84 // Rings perpendicular to the beam
85
86 // full rings at the ends
87
88 par[0] = r_in;
89 par[1] = r_ou;
90 par[2] = dz;
91 pMC->Gsvolu("BRO1", "TUBE", idtmed[1218], par, 3);
92 par[0] = r_in +dr;
93 par[1] = r_ou -dr;
94 par[2] = dz - dr;
95 pMC->Gsvolu("BRI1", "TUBE", idtmed[1214], par, 3);
96 pMC->Gspos("BRI1", 1, "BRO1", 0., 0., 0., 0, "ONLY");
97 zpos = z_ou - dz;
98 pMC->Gspos("BRO1", 1, "BFMO", 0., 0.,-zpos, 0, "ONLY");
99 pMC->Gspos("BRO1", 2, "BFMO", 0., 0., zpos, 0, "ONLY");
100
101 // space for the HMPID
102
103 tspar[0] = r_in;
104 tspar[1] = r_ou;
105 tspar[2] = dz;
106 tspar[3] = -240.;
107 tspar[4] = 60.;
108 pMC->Gsvolu("BRO2", "TUBS", idtmed[1218], tspar, 5);
109 tspar[0] = r_in + dr;
110 tspar[1] = r_ou - dr;
111 tspar[2] = dz - dr;
112 pMC->Gsvolu("BRI2", "TUBS", idtmed[1214], tspar, 5);
113 pMC->Gspos("BRI2", 1, "BRO2", 0., 0., 0., 0, "ONLY");
114 zpos = z_in + dz;
115 pMC->Gspos("BRO2", 1, "BFMO", 0., 0.,-zpos, 0, "ONLY");
116 pMC->Gspos("BRO2", 2, "BFMO", 0., 0., zpos, 0, "ONLY");
117
118
119
120 tspar[0] = r_in;
121 tspar[1] = r_ou;
122 tspar[2] = dz;
123 tspar[3] = 60.;
124 tspar[4] = 120.;
125 pMC->Gsvolu("BRO3", "TUBS", idtmed[1218], tspar, 5);
126 tspar[0] = r_in + dr;
127 tspar[1] = r_ou - dr;
128 tspar[2] = dz - dr;
129 pMC->Gsvolu("BRI3", "TUBS", idtmed[1214], tspar, 5);
130 pMC->Gspos("BRI3", 1, "BRO3", 0., 0., 0., 0, "ONLY");
131 zpos = 245.;
132 pMC->Gspos("BRO3", 1, "BFMO", 0., 0.,-zpos, 0, "ONLY");
133 pMC->Gspos("BRO3", 2, "BFMO", 0., 0., zpos, 0, "ONLY");
134
135 // longitudinal beams
136
137 // outside phi=60-120
138
139 // virtual elements
140
141 dz_small = (z_ou - z_in -4*dz)/2;
142 dz_long = z_in;
143 tsparl[0] = r_in;
144 tsparl[1] = r_ou;
145 tsparl[2] = dz_small;
146
147 // left and right
148
149 tsparl[3] = -240.;
150 tsparl[4] = 60.;
151 pMC->Gsvolu("BLO1", "TUBS", idtmed[1214], tsparl, 5);
152 pMC->Gsdvt("BLD1", "BLO1", 20., 2, idtmed[1214], 15);
153
154 // central, leaving space for rich and phos
155
156 tsparl[2] = dz_long;
157 tsparl[3] = -20.;
158 tsparl[4] = 60.;
159 pMC->Gsvolu("BLO2", "TUBS", idtmed[1214], tsparl, 5);
160 pMC->Gsdvt("BLD2", "BLO2", 20., 2, idtmed[1214], 5);
161 tsparl[3] = 120.;
162 tsparl[4] = 200.;
163 pMC->Gsvolu("BLO3", "TUBS", idtmed[1214], tsparl, 5);
164 pMC->Gsdvt("BLD3", "BLO3", 20., 2, idtmed[1214], 5);
165
166 // real elements
167
168 dphi = dz/(TMath::Pi()*(r_in + r_ou))*360;
169 ddphi = dphi * dr/dz;
170 tspar[0] = tsparl[0];
171 tspar[1] = tsparl[1];
172 tspar[2] = dz_small;
173 tspar[3] = 10. - dphi;
174 tspar[4] = 10.;
175 pMC->Gsvolu("BL01", "TUBS", idtmed[1218], tspar, 5);
176
177 tspar[0] = tsparl[0] + dr;
178 tspar[1] = tsparl[1] - dr;
179 tspar[3] = 10. - dphi + ddphi;
180 tspar[4] = 10. - ddphi;
181 pMC->Gsvolu("BL02", "TUBS", idtmed[1214], tspar, 5);
182 pMC->Gspos("BL02", 1, "BL01", 0., 0., 0., 0, "ONLY");
183
184
185 tspar[0] = tsparl[0];
186 tspar[1] = tsparl[1];
187 tspar[2] = dz_long;
188 tspar[3] = 10. - dphi;
189 tspar[4] = 10.;
190 pMC->Gsvolu("BL11", "TUBS", idtmed[1218], tspar, 5);
191
192 tspar[0] = tsparl[0] + dr;
193 tspar[1] = tsparl[1] - dr;
194 tspar[3] = 10. - dphi + ddphi;
195 tspar[4] = 10. - ddphi;
196 pMC->Gsvolu("BL12", "TUBS", idtmed[1214], tspar, 5);
197 pMC->Gspos("BL12", 1, "BL11", 0., 0., 0., 0, "ONLY");
198
199 pMC->Gspos("BL01", 1, "BLD1", 0., 0., 0., 0, "ONLY");
200 pMC->Gspos("BL11", 1, "BLD2", 0., 0., 0., 0, "ONLY");
201 pMC->Gspos("BL11", 2, "BLD3", 0., 0., 0., 0, "ONLY");
202
203 zpos = z_in +2*dz + dz_small;
204 pMC->Gspos("BLO1", 1, "BFMO", 0., 0.,-zpos, 0, "ONLY");
205 pMC->Gspos("BLO1", 2, "BFMO", 0., 0., zpos, 0, "ONLY");
206 pMC->Gspos("BLO2", 1, "BFMO", 0., 0., 0., 0, "ONLY");
207 pMC->Gspos("BLO3", 1, "BFMO", 0., 0., 0., 0, "ONLY");
208
209 // PHI=60-120 (RICH)
210
211 tsparl[0] = r_in;
212 tsparl[1] = r_ou;
213 tsparl[2] = (z_ou - z_ri -4*dz)/2;
214 tsparl[3] = 60.;
215 tsparl[4] = 120.;
216 pMC->Gsvolu("BLO4", "TUBS", idtmed[1214], tsparl, 5);
217 pMC->Gsdvt("BLD4", "BLO4", 20., 2, idtmed[1214], 3);
218 tspar[0] = tsparl[0];
219 tspar[1] = tsparl[1];
220 tspar[2] = tsparl[2];
221 tspar[3] = 10. - dphi;
222 tspar[4] = 10.;
223 pMC->Gsvolu("BL03", "TUBS", idtmed[1218], tspar, 5);
224
225 tspar[0] = tsparl[0] + dr;
226 tspar[1] = tsparl[1] - dr;
227 tspar[2] = tsparl[2];
228 tspar[3] = 10. - dphi + ddphi;
229 tspar[4] = 10. - ddphi;
230 pMC->Gsvolu("BL04", "TUBS", idtmed[1214], tspar, 5);
231 pMC->Gspos("BL04", 1, "BL03", 0., 0., 0., 0, "ONLY");
232
233 pMC->Gspos("BL03", 1, "BLD4", 0., 0., 0., 0, "ONLY");
234
235 pMC->Gspos("BLO4", 1, "BFMO", 0., 0., 293.125, 0, "ONLY");
236 pMC->Gspos("BLO4", 2, "BFMO", 0., 0.,-293.125, 0, "ONLY");
237
238 pMC->Gspos("BFMO", 1, "ALIC", 0., 0., 0., 0, "ONLY");
239 pMC->Gsatt("BFMO", "SEEN", 0);
240}
241
242//_____________________________________________________________________________
243void AliFRAMEv1::DrawDetector()
244{
245 //
246 // Draw a shaded view of the space frame
247 //
248
249 AliMC* pMC = AliMC::GetMC();
250
251 // Set everything unseen
252 pMC->Gsatt("*", "seen", -1);
253 //
254 // Set ALIC mother transparent
255 pMC->Gsatt("ALIC","SEEN",0);
256 //
257 // Set the volumes visible
258 pMC->Gsatt("BFMO","seen",0);
259 pMC->Gsatt("BRO1","seen",1);
260 pMC->Gsatt("BRI1","seen",0);
261 pMC->Gsatt("BRO2","seen",1);
262 pMC->Gsatt("BRI2","seen",0);
263 pMC->Gsatt("BRO3","seen",1);
264 pMC->Gsatt("BRI3","seen",0);
265 pMC->Gsatt("BLO1","seen",0);
266 pMC->Gsatt("BLD1","seen",0);
267 pMC->Gsatt("BLO2","seen",0);
268 pMC->Gsatt("BLD2","seen",0);
269 pMC->Gsatt("BLO3","seen",0);
270 pMC->Gsatt("BLD3","seen",0);
271 pMC->Gsatt("BL01","seen",1);
272 pMC->Gsatt("BL02","seen",1);
273 pMC->Gsatt("BL11","seen",1);
274 pMC->Gsatt("BL12","seen",1);
275 pMC->Gsatt("BLO4","seen",0);
276 pMC->Gsatt("BLD4","seen",0);
277 pMC->Gsatt("BL03","seen",1);
278 pMC->Gsatt("BL04","seen",1);
279 //
280 pMC->Gdopt("hide", "on");
281 pMC->Gdopt("shad", "on");
282 pMC->Gsatt("*", "fill", 7);
283 pMC->SetClipBox(".");
284 pMC->DefaultRange();
285 pMC->Gdraw("alic", 40, 30, 0, 10, 10, .015, .015);
286 pMC->Gdhead(1111, "Space Frame");
287 pMC->Gdman(18, 4, "MAN");
288}
289
290//_____________________________________________________________________________
291void AliFRAMEv1::CreateMaterials()
292{
293
294 //
295 // Create materials for the space frame
296 //
297
298 Int_t ISXFLD = gAlice->Field()->Integ();
299 Float_t SXMGMX = gAlice->Field()->Max();
300
301 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
302 Float_t zsteel[4] = { 26.,24.,28.,14. };
303 Float_t wsteel[4] = { .715,.18,.1,.005 };
304
305 Float_t epsil, stmin, deemax, tmaxfd, stemax;
306
307 // STEEL
308
309
310 // --- Define the various materials for GEANT ---
311 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
312 AliMixture(19, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
313
314 // ****************
315 // Defines tracking media parameters.
316 // Les valeurs sont commentees pour laisser le defaut
317 // a GEANT (version 3-21, page CONS200), f.m.
318 epsil = .001; // Tracking precision,
319 stemax = -1.; // Maximum displacement for multiple scat
320 tmaxfd = -20.; // Maximum angle due to field deflection
321 deemax = -.3; // Maximum fractional energy loss, DLS
322 stmin = -.8;
323 // ***************
324 //ifield0 = 0; // Field off
325 //ifield1 = 2; // 1.0 T. FIELD (DIPOLE)
326 //ifield3 = 3;
327
328 // Air
329
330 // 0.2 T. FIELD (L3)
331 AliMedium(1215, "AIR_L3_US ", 15, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
332
333 // Steel
334
335 AliMedium(1219, "ST_L3_US ", 19, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
336}
337
338
339
340
341
342
343
344
345
346
347