Variable number of modules introduced
[u/mrichter/AliRoot.git] / STRUCT / AliPIPEv1.cxx
CommitLineData
fe4da5cc 1///////////////////////////////////////////////////////////////////////////////
2// //
3// Beam pipe class //
4// //
5//Begin_Html
6/*
1439f98e 7<img src="picts/AliPIPEClass.gif">
fe4da5cc 8*/
9//End_Html
10// //
11///////////////////////////////////////////////////////////////////////////////
12
13#include "AliPIPEv1.h"
14#include "AliRun.h"
15#include "AliMC.h"
16
17ClassImp(AliPIPEv1)
18
19//_____________________________________________________________________________
b8032157 20AliPIPEv1::AliPIPEv1()
fe4da5cc 21{
22 //
23 // Default constructor for beam pipe
24 //
25}
26
27//_____________________________________________________________________________
28AliPIPEv1::AliPIPEv1(const char *name, const char *title)
29 : AliPIPE(name,title)
30{
31 //
32 // Standard constructor for beam pipe
33 //
34}
35
36//_____________________________________________________________________________
37void AliPIPEv1::CreateGeometry()
38{
39 //
40 // Create Beam Pipe geometry
41 //
42 //Begin_Html
43 /*
1439f98e 44 <img src="picts/AliPIPE.gif">
fe4da5cc 45 */
46 //End_Html
47 //Begin_Html
48 /*
1439f98e 49 <img src="picts/AliPIPETree.gif">
fe4da5cc 50 */
51 //End_Html
52
53 AliMC* pMC = AliMC::GetMC();
54
55 Float_t tpar[3], dzmo, zpos, abs_d, abs_l;
56 Float_t r2, dr;
57
58 const Double_t z_flange = 150;
59
ad51aeb0 60 Int_t *idtmed = fIdtmed->GetArray()-1999;
fe4da5cc 61
62
63 abs_d = 90.; // DEFINES DRIFT LENGTH
64 //z_nose = 102.;
65 //z_cone = 285.;
66 //theta1 = 24.; // 1. angle defining the front absorber
67 //theta2 = 5.; // 2. angle defining the front absorbe
68 //acc_max = 9.; // ANGLE POLAIRE MAXIMUM
69 //acc_min = 2.; // ANGLE POLAIRE MINIMUM DE DETECTION
70 abs_l = 503.;
71 //d_steel = 1.; // THICKNESS OF STEEL SUPPORT
72 //d_poly = 7.5;
73 //d_pb = 2.5;
74 //abs_cc = 315.; // DEFINES LENGTH OF CARBON
75 //abs_c = 358.;
76 //abs_s = 150.; // DEFINES W-SHIELD LENGTH
77 //abs_n = 80.; // START OF NOSE
78 //r_abs = 4.;
79 //r_pb = .1;
80 //epsilon = .01;
81 //theta_r = 3.;
82 //d_rear = 35.;
83 //theta_open = .75;
84
85 //z_l3 = 700.;
86 //zmag_in = 725.;
87 //zmag_out = 1225.;
88 //zfil_in = 1471.;
89 //zfil_out = 1591.;
90 //zcon_in = 1900.;
91 //zcon_out = 2e3;
92 //zcone_e = 859.0875;
93 //spec_l = 1800.;
94 //zplug_in = 1780.;
95 //zplug_out = 1900.;
96
97 // Chamber position
98 // CZ1=515.5
99 //cz1 = 511.;
100 //cz2 = 686.;
101 //cz3 = 971.;
102 //cz4 = 1245.;
103 //cz5 = 1445.;
104 //cz6 = 1610.;
105 //cz7 = 1710.;
106
107
108 // the mother of all beam pipes
109
110 tpar[0] = 0.;
111 tpar[1] = 3.;
112 tpar[2] = (abs_d + 700.) / 2.;
113 dzmo = tpar[2] - abs_d;
114 pMC->Gsvolu("QQMO", "TUBE", idtmed[2015], tpar, 3);
115 pMC->Gspos("QQMO", 1, "ALIC", 0., 0., -dzmo, 0, "ONLY");
116
117 // BEAM PIPE IN DRIFT SPACE
118
119 // -30-z_flange
120 tpar[0] = 0.;
121 tpar[1] = 3.;
122 tpar[2] = 30;
123 pMC->Gsvolu("QDT1", "TUBE", idtmed[2015], tpar, 3);
124
125 tpar[0] = 2.9;
126 pMC->Gsvolu("QTB1", "TUBE", idtmed[2004], tpar, 3);
127 pMC->Gspos("QTB1", 1, "QDT1", 0., 0., 0., 0, "ONLY");
128 pMC->Gspos("QDT1", 1, "QQMO", 0., 0., dzmo, 0, "ONLY");
129
130
131 // 30-90
132 tpar[0] = 0.;
133 tpar[1] = 3.;
134 tpar[2] = 30.;
135 pMC->Gsvolu("QDT2", "TUBE", idtmed[2015], tpar, 3);
136
137 tpar[0] = 2.9;
138 pMC->Gsvolu("QTB2", "TUBE", idtmed[2004], tpar, 3);
139 pMC->Gspos("QTB2", 1, "QDT2", 0., 0., 0., 0, "ONLY");
140 pMC->Gspos("QDT2", 1, "QQMO", 0., 0., dzmo, 0, "ONLY");
141
142 // beam pipe outside absorber on the left side
143
144
145
146 // -30 - Z_FLANGE
147 tpar[0] = 0.;
148 tpar[1] = 3.;
149 tpar[2] = (z_flange - 30)/2;
150 pMC->Gsvolu("QDT5", "TUBE", idtmed[2015], tpar, 3);
151
152 tpar[0] = 2.9;
153 zpos = -30. - tpar[2] + dzmo;
154 pMC->Gsvolu("QTB5", "TUBE", idtmed[2004], tpar, 3);
155 pMC->Gspos("QTB5", 1, "QDT5", 0., 0., 0., 0, "ONLY");
156 pMC->Gspos("QDT5", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
157
158 // STRAIGHT STEEL PIECE
159
160 zpos = -z_flange;
161 r2 = 2.9;
162 dr = .015;
163 tpar[0] = 0.;
164 tpar[1] = r2 + dr;
165 tpar[2] = (zpos + 700.) / 2.;
166 pMC->Gsvolu("QDT7", "TUBE", idtmed[2015], tpar, 3);
167 tpar[0] = r2;
168 pMC->Gsvolu("QTB7", "TUBE", idtmed[2018], tpar, 3);
169 pMC->Gspos("QTB7", 1, "QDT7", 0., 0., 0., 0, "ONLY");
170 zpos = zpos - tpar[2] + dzmo;
171 pMC->Gspos("QDT7", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
172
173 // flange dn 63
174
175 tpar[0] = 3.;
176 tpar[1] = 5.7;
177 tpar[2] = 2.;
178 pMC->Gsvolu("QN63", "TUBE", idtmed[2018], tpar, 3);
179 zpos = tpar[2] - z_flange;
180 pMC->Gspos("QN63", 1, "ALIC", 0., 0., zpos, 0, "ONLY");
181
182
183 // Replace Absorber or Shield by Beam-Pipe
184 // in case they are not selected
185
b8032157 186 if (gAlice->GetModule("ABSO") == 0) {
fe4da5cc 187
188 pMC->Gspos("QN63", 2, "ALIC", 0., 0., z_flange, 0, "ONLY");
189 r2 = 2.9;
190 dr = .1;
191 tpar[0] = 0.;
192 tpar[1] = r2 + dr;
193 tpar[2] = (z_flange - abs_d) / 2.;
194 pMC->Gsvolu("QDT8", "TUBE", idtmed[2015], tpar, 3);
195 tpar[0] = r2;
196 pMC->Gsvolu("QTB8", "TUBE", idtmed[2004], tpar, 3);
197 pMC->Gspos("QTB8", 1, "QDT8", 0., 0., 0., 0, "ONLY");
198 zpos = abs_d + tpar[2];
199 pMC->Gspos("QDT8", 1, "ALIC", 0., 0., zpos, 0, "ONLY");
200 dr = .015;
201 tpar[0] = 0.;
202 tpar[1] = r2 + dr;
203 tpar[2] = (abs_l - z_flange) / 2.;
204 pMC->Gsvolu("QDTS", "TUBE", idtmed[2015], tpar, 3);
205 tpar[0] = r2;
206 pMC->Gsvolu("QTBS", "TUBE", idtmed[2018], tpar, 3);
207 pMC->Gspos("QTBS", 1, "QDTS", 0., 0., 0., 0, "ONLY");
208 zpos = tpar[2] + z_flange;
209 pMC->Gspos("QDTS", 1, "ALIC", 0., 0., zpos, 0, "ONLY");
210 }
b8032157 211 if (gAlice->GetModule("SHIL") == 0) {
fe4da5cc 212 r2 = 2.9;
213 dr = .015;
214 tpar[0] = 0.;
215 tpar[1] = r2 + dr;
216 tpar[2] = (700. - abs_l) / 2.;
217 pMC->Gsvolu("QDT9", "TUBE", idtmed[2015], tpar, 3);
218 tpar[0] = r2;
219 pMC->Gsvolu("QTB9", "TUBE", idtmed[2018], tpar, 3);
220 pMC->Gspos("QTB9", 1, "QDT9", 0., 0., 0., 0, "ONLY");
221 zpos = abs_l + tpar[2];
222 pMC->Gspos("QDT9", 1, "ALIC", 0., 0., zpos, 0, "ONLY");
223 }
224}
225
226//_____________________________________________________________________________
b8032157 227void AliPIPEv1::DrawModule()
fe4da5cc 228{
229 //
230 // Draw a shaded view of the Beam Pipe
231 //
232
233 AliMC* pMC = AliMC::GetMC();
234
235 // Set everything unseen
236 pMC->Gsatt("*", "seen", -1);
237 //
238 // Set ALIC mother transparent
239 pMC->Gsatt("ALIC","SEEN",0);
240 //
241 // Set the volumes visible
242 pMC->Gsatt("QQMO","seen",1);
243 pMC->Gsatt("QDT1","seen",1);
244 pMC->Gsatt("QTB1","seen",1);
245 pMC->Gsatt("QDT2","seen",1);
246 pMC->Gsatt("QTB2","seen",1);
247 pMC->Gsatt("QDT5","seen",1);
248 pMC->Gsatt("QTB5","seen",1);
249 pMC->Gsatt("QDT7","seen",1);
250 pMC->Gsatt("QTB7","seen",1);
251 pMC->Gsatt("QN63","seen",1);
252 //
253 pMC->Gdopt("hide", "on");
254 pMC->Gdopt("shad", "on");
255 pMC->Gsatt("*", "fill", 7);
256 pMC->SetClipBox(".");
257 pMC->SetClipBox("*", 0, 3000, -3000, 3000, -6000, 6000);
258 pMC->DefaultRange();
259 pMC->Gdraw("alic", 40, 30, 0, 3, 5, .04, .04);
260 pMC->Gdhead(1111, "Beam Pipe");
261 pMC->Gdman(16, 6, "MAN");
262 pMC->Gdopt("hide","off");
263}
264
265//_____________________________________________________________________________
266void AliPIPEv1::CreateMaterials()
267{
268 //
269 // Create materials for beam pipe
270 //
271
272 Int_t ISXFLD = gAlice->Field()->Integ();
273 Float_t SXMGMX = gAlice->Field()->Max();
274
275 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
276 Float_t zsteel[4] = { 26.,24.,28.,14. };
277 Float_t wsteel[4] = { .715,.18,.1,.005 };
278
279 Float_t epsil, stmin, tmaxfd, deemax, stemax;
280
281 // STEEL
282
283
284 // --- Define the various materials for GEANT ---
285 AliMaterial(5, "BERILLIUM$", 9.01, 4., 1.848, 35.3, 36.7);
286 AliMaterial(16, "VACUUM$ ", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
287 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
288 AliMixture(19, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
289
290 // ****************
291 // Defines tracking media parameters.
292 // Les valeurs sont commentees pour laisser le defaut
293 // a GEANT (version 3-21, page CONS200), f.m.
294 epsil = .001; // Tracking precision,
295 stemax = -1.; // Maximum displacement for multiple scat
296 tmaxfd = -20.; // Maximum angle due to field deflection
297 deemax = -.3; // Maximum fractional energy loss, DLS
298 stmin = -.8;
299
300 // Air
301
ad51aeb0 302 AliMedium(15, "AIR_L3_US", 15, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 303
304 // Beryllium
305
ad51aeb0 306 AliMedium(5, "BE_L3_US", 5, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 307
308 // Vacuum
309
ad51aeb0 310 AliMedium(16, "VA_L3_US", 16, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 311
312 // Steel
313
ad51aeb0 314 AliMedium(19, "ST_L3_US", 19, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
fe4da5cc 315}
316