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