]>
Commit | Line | Data |
---|---|---|
53d2a7cd | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
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 | **************************************************************************/ | |
15 | ||
88cb7938 | 16 | /* $Id$ */ |
53d2a7cd | 17 | |
18 | /////////////////////////////////////////////////////////////////////////////// | |
19 | // // | |
20 | // ALICE Cosmic Ray Trigger // | |
21 | // // | |
22 | // This class contains the functions for version 0 of the ALICE Cosmic Ray // | |
23 | // Trigger. This vesion is suposed to work as standalone module // | |
24 | // // | |
25 | // | |
26 | // Authors: | |
27 | // | |
28 | // Arturo Fernandez <afernand@fcfm.buap.mx> | |
29 | // Enrique Gamez <egamez@fcfm.buap.mx> | |
30 | // | |
31 | // Universidad Autonoma de Puebla | |
32 | // | |
33 | // | |
34 | //Begin_Html | |
35 | /* | |
36 | <img src="picts/AliCRTv1Class.gif"> | |
37 | </pre> | |
38 | <br clear=left> | |
39 | <p>The responsible person for this module is | |
40 | <a href="mailto:egamez@fcfm.buap.mx">Enrique Gamez</a>. | |
41 | </font> | |
42 | <pre> | |
43 | */ | |
44 | //End_Html | |
45 | // // | |
46 | /////////////////////////////////////////////////////////////////////////////// | |
47 | ||
0b61c88b | 48 | #include "AliCRTv1.h" |
53d2a7cd | 49 | |
0b61c88b | 50 | #include <TClonesArray.h> |
53d2a7cd | 51 | #include <TLorentzVector.h> |
116cbefd | 52 | #include <TPDGCode.h> |
5d12ce38 | 53 | #include <TVirtualMC.h> |
53d2a7cd | 54 | |
116cbefd | 55 | #include "AliRun.h" |
0b61c88b | 56 | #include "AliConst.h" |
57 | ||
58 | #include "AliCRThit.h" | |
59 | #include "AliCRTConstants.h" | |
5d12ce38 | 60 | #include "AliMC.h" |
53d2a7cd | 61 | |
62 | ClassImp(AliCRTv1) | |
63 | ||
64 | //_____________________________________________________________________________ | |
0b61c88b | 65 | AliCRTv1::AliCRTv1() |
fddb5247 | 66 | : AliCRT() |
53d2a7cd | 67 | { |
68 | // | |
0b61c88b | 69 | // Default constructor |
53d2a7cd | 70 | // |
0b61c88b | 71 | fIshunt = 0; |
72 | fHits = 0; | |
53d2a7cd | 73 | } |
74 | ||
75 | //_____________________________________________________________________________ | |
76 | AliCRTv1::AliCRTv1(const char *name, const char *title) | |
fddb5247 | 77 | : AliCRT(name, title) |
53d2a7cd | 78 | { |
79 | // | |
0b61c88b | 80 | // Standard constructor |
53d2a7cd | 81 | // |
82 | //Begin_Html | |
83 | /* | |
84 | <img src="picts/AliCRTv1.gif"> | |
85 | */ | |
86 | //End_Html | |
0b61c88b | 87 | fIshunt = 1; // All hits are associated with primary particles |
88 | ||
89 | fHits = new TClonesArray("AliCRThit",400); | |
5d12ce38 | 90 | gAlice->GetMCApp()->AddHitList(fHits); |
53d2a7cd | 91 | |
0b61c88b | 92 | SetMarkerColor(7); |
93 | SetMarkerStyle(2); | |
94 | SetMarkerSize(0.4); | |
53d2a7cd | 95 | } |
96 | ||
97 | //_____________________________________________________________________________ | |
98 | AliCRTv1::AliCRTv1(const AliCRTv1& crt) | |
fddb5247 | 99 | : AliCRT(crt) |
53d2a7cd | 100 | { |
101 | // | |
102 | // Copy ctor. | |
103 | // | |
104 | crt.Copy(*this); | |
105 | } | |
106 | ||
107 | //_____________________________________________________________________________ | |
0b61c88b | 108 | AliCRTv1::~AliCRTv1() |
109 | { | |
110 | // | |
111 | // Default destructor | |
112 | // | |
113 | } | |
114 | ||
115 | //_____________________________________________________________________________ | |
116 | AliCRTv1& AliCRTv1::operator=(const AliCRTv1& crt) | |
53d2a7cd | 117 | { |
118 | // | |
119 | // Asingment operator | |
120 | // | |
121 | crt.Copy(*this); | |
122 | return *this; | |
123 | } | |
124 | ||
0b61c88b | 125 | //_____________________________________________________________________________ |
126 | void AliCRTv1::CreateMaterials() | |
127 | { | |
128 | // | |
129 | // Create Materials. | |
130 | // Use the parent class definition of the materials | |
131 | // | |
132 | AliCRT::CreateMaterials(); | |
133 | } | |
134 | ||
53d2a7cd | 135 | //_____________________________________________________________________________ |
136 | void AliCRTv1::CreateGeometry() | |
137 | { | |
138 | // | |
139 | // Create geometry for the CRT array | |
140 | // | |
141 | ||
142 | Int_t idrotm[2499]; // The rotation matrix. | |
0b61c88b | 143 | Int_t* idtmed = fIdtmed->GetArray() - 1099 ; |
53d2a7cd | 144 | |
53d2a7cd | 145 | // Shafts. |
146 | this->CreateShafts(); | |
147 | ||
53d2a7cd | 148 | // Molasse. |
149 | this->CreateMolasse(); | |
150 | ||
fddb5247 | 151 | AliCRTConstants* crtConstants = AliCRTConstants::Instance(); |
152 | ||
0b61c88b | 153 | // Create a big volume with air barrel above the magnet |
53d2a7cd | 154 | Float_t barrel[10]; |
155 | Float_t magnetSides = 3.; | |
156 | Float_t planesPerpendicularToZ = 2.; | |
53d2a7cd | 157 | barrel[0] = 22.5; |
158 | barrel[1] = 45*magnetSides; | |
159 | barrel[2] = magnetSides; | |
160 | barrel[3] = planesPerpendicularToZ; | |
0b61c88b | 161 | barrel[4] = -700.; |
fddb5247 | 162 | barrel[5] = crtConstants->MagMinRadius(); |
163 | barrel[6] = crtConstants->MagMinRadius() + 2.; // 2 cm width | |
0b61c88b | 164 | barrel[7] = -barrel[4]; |
165 | barrel[8] = barrel[5]; | |
166 | barrel[9] = barrel[6]; | |
167 | gMC->Gsvolu("CRT4", "PGON", idtmed[1112], barrel, 10); | |
53d2a7cd | 168 | gMC->Gspos("CRT4", 1 , "CRT", 0., -30., 0., 0, "ONLY"); |
53d2a7cd | 169 | |
53d2a7cd | 170 | // |
0b61c88b | 171 | Float_t box[3]; |
fddb5247 | 172 | box[0] = crtConstants->SinglePaletteLenght()/4; |
173 | box[1] = crtConstants->SinglePaletteHeight()/2; | |
174 | box[2] = crtConstants->SinglePaletteWidth()/2; | |
0b61c88b | 175 | gMC->Gsvolu("CRT6", "BOX", idtmed[1113], box, 3); |
53d2a7cd | 176 | |
0b61c88b | 177 | // In the right side side of the magnet |
178 | AliMatrix(idrotm[231], 90., 45., 90., 315., 180., 202.5); | |
53d2a7cd | 179 | |
0b61c88b | 180 | // In the left side side of the magnet |
181 | //AliMatrix(idrotm[232], 90., 315., 90., 315., 0.0000040, 263.0707092); | |
182 | AliMatrix(idrotm[232], 90, 315, 90, 315, 0, 263); | |
183 | ||
184 | // Now put them into the volume created above | |
185 | // First above the magnet. | |
fddb5247 | 186 | Float_t away = (2.*barrel[5]*TMath::Sin(kDegrad*22.5))/4.; |
187 | Int_t nModules = 10; | |
0b61c88b | 188 | for (Int_t i = 0; i < nModules; i++) { |
189 | Float_t zCoordinate = i*100 - 450; | |
190 | // In the lef side | |
191 | gMC->Gspos("CRT6", i, "CRT4", -away, barrel[5]+1., zCoordinate, 0, "ONLY"); | |
192 | // In the rigth side | |
193 | gMC->Gspos("CRT6",i+10,"CRT4", away, barrel[5]+1., zCoordinate, 0, "ONLY"); | |
194 | ||
195 | // The most away part (left side) | |
196 | gMC->Gspos("CRT6", i+20, "CRT4", 3*away, barrel[5]+21 - away, zCoordinate, idrotm[232], "ONLY"); | |
197 | // The inner part (left side) | |
198 | gMC->Gspos("CRT6", i+30, "CRT4", 4*away, barrel[5]+21 - 2*away, zCoordinate, idrotm[232], "ONLY"); | |
199 | ||
200 | // The most away part (rigth side) | |
201 | gMC->Gspos("CRT6", i+40, "CRT4", -3*away, barrel[5]+21. - away, zCoordinate, idrotm[231], "ONLY"); | |
202 | // The inner part (rigth side) | |
203 | gMC->Gspos("CRT6", i+50, "CRT4", -4*away, barrel[5]+21 - 2*away, zCoordinate, idrotm[231], "ONLY"); | |
204 | } | |
53d2a7cd | 205 | |
0b61c88b | 206 | // Now the magnet doors |
207 | magnetSides = 8.; | |
53d2a7cd | 208 | barrel[1] = 45*magnetSides; |
209 | barrel[2] = magnetSides; | |
0b61c88b | 210 | barrel[4] = 700.; |
211 | barrel[5] = 0; | |
212 | barrel[6] = 790; | |
213 | barrel[7] = barrel[4] + 2.; | |
53d2a7cd | 214 | barrel[8] = barrel[5]; |
215 | barrel[9] = barrel[6]; | |
0b61c88b | 216 | gMC->Gsvolu("CRT5", "PGON", idtmed[1111], barrel, 10); |
217 | gMC->Gspos("CRT5", 1, "CRT", 0., -30., 0., 0, "ONLY"); | |
53d2a7cd | 218 | |
0b61c88b | 219 | AliMatrix(idrotm[300], 90., 0., 90., 90., 180., 0.); |
220 | gMC->Gspos("CRT5", 2, "CRT", 0., -30., 0., idrotm[300], "ONLY"); | |
53d2a7cd | 221 | |
222 | } | |
223 | ||
53d2a7cd | 224 | //_____________________________________________________________________________ |
225 | void AliCRTv1::CreateMolasse() | |
226 | { | |
227 | // | |
228 | // | |
229 | // | |
53d2a7cd | 230 | Int_t idrotm[2499]; // The rotation matrix. |
0b61c88b | 231 | Int_t* idtmed = fIdtmed->GetArray() - 1099 ; |
53d2a7cd | 232 | |
233 | // Exactly above the hall | |
234 | Float_t tspar[5]; | |
0b61c88b | 235 | tspar[0] = 1170; |
236 | tspar[1] = 1170 + 375; | |
237 | tspar[2] = (1900 + 1150)/2 + 100; | |
238 | tspar[3] = 0; | |
239 | tspar[4] = 180; | |
53d2a7cd | 240 | gMC->Gsvolu("CMO1", "TUBS", idtmed[1123], tspar, 5); |
0b61c88b | 241 | gMC->Gspos("CMO1", 1, "CRT", 0, 500., 1900 - tspar[2] + 400, 0, "MANY"); |
53d2a7cd | 242 | |
243 | Float_t tbox[3]; | |
0b61c88b | 244 | tbox[0] = 1250; |
245 | tbox[1] = (4420 - 1670)/2; | |
246 | tbox[2] = (1900 + 1150)/2 + 200; | |
53d2a7cd | 247 | gMC->Gsvolu("CM12", "BOX", idtmed[1123], tbox, 3); |
0b61c88b | 248 | gMC->Gspos("CM12",1,"CRT",0, 4420 - tbox[1], 1900 - tbox[2] + 400, 0,"MANY"); |
53d2a7cd | 249 | |
250 | AliMatrix(idrotm[2003], 0., 0., 90., 0., 90., 90.); | |
251 | // Along the PM25 | |
252 | Float_t tube[3]; | |
0b61c88b | 253 | tube[0] = 455 + 100; |
254 | tube[1] = 555 + 375; | |
255 | tube[2] = (5150 - 1166)/2; | |
53d2a7cd | 256 | gMC->Gsvolu("CMO2", "TUBE", idtmed[1123], tube, 3); |
0b61c88b | 257 | gMC->Gspos("CMO2", 1, "CRT", -2100, 4420 - tube[2], 0, idrotm[2003], "MANY"); |
53d2a7cd | 258 | |
259 | // Along the PGC2 | |
0b61c88b | 260 | tube[0] = 650; |
53d2a7cd | 261 | tube[1] = 2987.7; |
0b61c88b | 262 | tube[2] = (5150 - 690)/2; |
53d2a7cd | 263 | gMC->Gsvolu("CMO3", "TUBE", idtmed[1123], tube, 3); |
0b61c88b | 264 | gMC->Gspos("CMO3",1,"CRT", 375, 4420 - tube[2], 1900 + 2987.7,idrotm[2003],"MANY"); |
265 | ||
53d2a7cd | 266 | // Behind the PGC2 up to the end of the M. volume. |
0b61c88b | 267 | tbox[0] = 12073; |
268 | tbox[1] = 2575 + 95; | |
269 | tbox[2] = (12073 - 1900 - 2987.7 - 650)/2.; | |
53d2a7cd | 270 | gMC->Gsvolu("CMO7", "BOX", idtmed[1123], tbox, 3); |
0b61c88b | 271 | gMC->Gspos("CMO7", 1, "CRT", 0, 4420 - tbox[1], 1900 + 2987.7 + 650 + tbox[2], 0, "MANY"); |
53d2a7cd | 272 | |
273 | // Along the PX24 , upper part. | |
0b61c88b | 274 | tube[0] = 1250; |
53d2a7cd | 275 | tube[1] = 2300; |
0b61c88b | 276 | tube[2] = 2575 - 1300 + 95; |
53d2a7cd | 277 | gMC->Gsvolu("CMO4", "TUBE", idtmed[1123], tube, 3); |
0b61c88b | 278 | gMC->Gspos("CMO4", 1, "CRT", 0, 404 + 1300 + tube[2], -2300, idrotm[2003], "MANY"); |
53d2a7cd | 279 | |
280 | // Along the PX24 , lower part | |
0b61c88b | 281 | tspar[0] = 1250; |
53d2a7cd | 282 | tspar[1] = 2300; |
0b61c88b | 283 | tspar[2] = 1300; |
53d2a7cd | 284 | tspar[3] = kRaddeg*TMath::ASin(1070./1150.); |
0b61c88b | 285 | tspar[4] = 360 - tspar[3]; |
53d2a7cd | 286 | gMC->Gsvolu("CMO5", "TUBS", idtmed[1123], tspar, 5); |
0b61c88b | 287 | gMC->Gspos("CMO5", 1, "CRT", 0., 404, -2300, idrotm[2003], "MANY"); |
53d2a7cd | 288 | // behind the PX24 |
0b61c88b | 289 | tbox[0] = 12073; |
290 | tbox[1] = 2575 + 95; | |
291 | tbox[2] = 8523/2; | |
53d2a7cd | 292 | gMC->Gsvolu("CMO6", "BOX", idtmed[1123], tbox, 3); |
0b61c88b | 293 | gMC->Gspos("CMO6", 1, "CRT", 0., 4420 - tbox[1], -3550 - tbox[2], 0, "MANY"); |
53d2a7cd | 294 | |
295 | // On the right side of th hall | |
0b61c88b | 296 | tbox[0] = (12073 - 1250)/2; |
297 | tbox[1] = 2575 + 95; | |
298 | tbox[2] = (8437.7+650)/2; | |
53d2a7cd | 299 | gMC->Gsvolu("CMO8", "BOX", idtmed[1123], tbox, 3); |
0b61c88b | 300 | gMC->Gspos("CMO8", 1, "CRT", 1250 + tbox[0], 4420 - tbox[1], -3550 + tbox[2], 0, "MANY"); |
53d2a7cd | 301 | |
302 | // on the left side of the hall, behind | |
0b61c88b | 303 | tbox[0] = (12073 - 2755)/2; |
304 | tbox[1] = 2575 + 95; | |
305 | tbox[2] = (8437.7 + 650)/2.; | |
53d2a7cd | 306 | gMC->Gsvolu("CMO9", "BOX", idtmed[1123], tbox, 3); |
0b61c88b | 307 | gMC->Gspos("CMO9", 1, "CRT", -2755 - tbox[0], 4420 - tbox[1], -3550 + tbox[2], 0, "MANY"); |
53d2a7cd | 308 | |
309 | // Molasse betwen the PX24 & PM25 on the left side. | |
0b61c88b | 310 | tbox[0] = (2755 - 1250)/2; |
311 | tbox[1] = 2575 + 95; | |
312 | tbox[2] = (3550 - 555)/2; | |
53d2a7cd | 313 | gMC->Gsvolu("CM10", "BOX", idtmed[1123], tbox, 3); |
0b61c88b | 314 | gMC->Gspos("CM10", 1, "CRT", -1250 - tbox[0], 4420 - tbox[1], -tbox[2] - 555, 0, "MANY"); |
53d2a7cd | 315 | |
316 | // Molasse betwen the PGC2 & PM25 on the left side. | |
0b61c88b | 317 | tbox[0] = (2755 - 1250)/2; |
318 | tbox[1] = 2575 + 95; | |
319 | tbox[2] = (1900 + 2987.7 - 555 + 650)/2; | |
53d2a7cd | 320 | gMC->Gsvolu("CM11", "BOX", idtmed[1123], tbox, 3); |
0b61c88b | 321 | gMC->Gspos("CM11", 1, "CRT", -1250 - tbox[0], 4420 - tbox[1], 555 + tbox[2], 0, "MANY"); |
53d2a7cd | 322 | |
323 | } | |
324 | ||
325 | //_____________________________________________________________________________ | |
326 | void AliCRTv1::CreateShafts() | |
327 | { | |
328 | // | |
329 | // | |
330 | // | |
331 | Int_t idrotm[2499]; // The rotation matrix. | |
0b61c88b | 332 | Int_t* idtmed = fIdtmed->GetArray() - 1099 ; |
53d2a7cd | 333 | |
334 | // Create a mother volume. | |
335 | Float_t pbox[3]; | |
fddb5247 | 336 | //pbox[0] = AliCRTConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad); |
53d2a7cd | 337 | pbox[0] = 12073.; |
fddb5247 | 338 | pbox[1] = AliCRTConstants::Instance()->Depth(); |
53d2a7cd | 339 | pbox[2] = pbox[0]; |
340 | gMC->Gsvolu("CRT", "BOX", idtmed[1114], pbox, 3); | |
0b61c88b | 341 | gMC->Gspos("CRT", 1, "ALIC", 0, 0, 0, 0, "ONLY"); |
53d2a7cd | 342 | |
343 | // HAll ceiling | |
344 | Float_t ptubs[5]; | |
0b61c88b | 345 | ptubs[0] = 1070; |
346 | ptubs[1] = 1170; | |
347 | ptubs[2] = 1900; | |
348 | ptubs[3] = 0; | |
349 | ptubs[4] = 180; | |
53d2a7cd | 350 | gMC->Gsvolu("CHC1", "TUBS", idtmed[1116], ptubs, 5); |
0b61c88b | 351 | gMC->Gspos("CHC1", 1, "CRT", 0, 500, 0, 0, "ONLY"); |
53d2a7cd | 352 | |
353 | // | |
354 | // Acces shafts | |
355 | // | |
356 | AliMatrix(idrotm[2001], 0., 0., 90., 0., 90., 90.); | |
0b61c88b | 357 | |
53d2a7cd | 358 | // PX24 |
0b61c88b | 359 | ptubs[0] = 1150; |
360 | ptubs[1] = 1250; | |
361 | ptubs[2] = 1300; | |
362 | ptubs[3] = kRaddeg*TMath::ASin(1070/ptubs[0]); | |
53d2a7cd | 363 | ptubs[4] = 360 - ptubs[3]; |
364 | gMC->Gsvolu("CSF1", "TUBS", idtmed[1116], ptubs, 5); | |
0b61c88b | 365 | gMC->Gspos("CSF1", 1, "CRT", 0., 404, -2300, idrotm[2001], "MANY"); |
53d2a7cd | 366 | |
367 | Float_t ptube[3]; | |
368 | ptube[0] = ptubs[0]; | |
369 | ptube[1] = ptubs[1]; | |
0b61c88b | 370 | ptube[2] = 2575 - ptubs[2] + 95; |
53d2a7cd | 371 | gMC->Gsvolu("CSF2", "TUBE", idtmed[1116], ptube, 3); |
0b61c88b | 372 | gMC->Gspos("CSF2", 1, "CRT", 0, 404 + ptubs[2] + ptube[2], -2300, idrotm[2001], "MANY"); |
373 | ||
53d2a7cd | 374 | // Concrete walls along the shaft |
0b61c88b | 375 | pbox[0] = 585/2; |
376 | pbox[1] = 2575 + 95; | |
377 | pbox[2] = 20; | |
53d2a7cd | 378 | gMC->Gsvolu("CSW1", "BOX", idtmed[1116], pbox, 3); |
0b61c88b | 379 | gMC->Gspos("CSW1", 1, "CRT", -290 - pbox[0], 404 - 1300 + pbox[1], -3450 + 210*2, 0, "MANY"); |
380 | ||
53d2a7cd | 381 | // |
0b61c88b | 382 | pbox[0] = 750/2; |
383 | pbox[1] = 2575 + 95; | |
384 | pbox[2] = 20; | |
53d2a7cd | 385 | gMC->Gsvolu("CSW3", "BOX", idtmed[1116], pbox, 3); |
0b61c88b | 386 | gMC->Gspos("CSW3", 1, "CRT", 420 - 290 +pbox[0], 404 - 1300 + pbox[1], -3450 + 210*2, 0, "MANY"); |
387 | ||
53d2a7cd | 388 | // |
0b61c88b | 389 | pbox[0] = 60; |
390 | pbox[1] = 2575 + 95; | |
391 | pbox[2] = 210; | |
53d2a7cd | 392 | gMC->Gsvolu("CSW2", "BOX", idtmed[1116], pbox, 3); |
0b61c88b | 393 | gMC->Gspos("CSW2", 1, "CRT", -290 - pbox[0], 404 - 1300 + pbox[1], -3450 + pbox[2], 0, "MANY"); |
394 | gMC->Gspos("CSW2", 2, "CRT", 420 - 290 + pbox[0], 404 - 1300 + pbox[1], -3450 + pbox[2], 0, "MANY"); | |
395 | ||
53d2a7cd | 396 | // |
0b61c88b | 397 | pbox[0] = 1000; |
398 | pbox[1] = 80; | |
399 | pbox[2] = 200; | |
53d2a7cd | 400 | gMC->Gsvolu("CSP1", "BOX", idtmed[1116], pbox, 3); |
0b61c88b | 401 | gMC->Gspos("CSP1", 1, "CRT", 0, 2600 - 700, -1150 - pbox[2], 0, "MANY"); |
402 | ||
53d2a7cd | 403 | // |
404 | pbox[0] = 340.8; | |
0b61c88b | 405 | pbox[1] = 300/2.; |
406 | pbox[2] = 460/2.; | |
53d2a7cd | 407 | gMC->Gsvolu("CSP2", "BOX", idtmed[1116], pbox, 3); |
0b61c88b | 408 | gMC->Gspos("CSP2", 1, "CRT", 0, 2950.-700., -3450+pbox[2], 0, "MANY"); |
409 | ||
53d2a7cd | 410 | // |
0b61c88b | 411 | pbox[0] = 600; |
412 | pbox[1] = 150; | |
413 | pbox[2] = 75; | |
53d2a7cd | 414 | gMC->Gsvolu("CSP3", "BOX", idtmed[1116], pbox, 3); |
0b61c88b | 415 | gMC->Gspos("CSP3", 1, "CRT", 0, 2950.-700., -1150.-210.-pbox[2], 0, "MANY"); |
416 | ||
53d2a7cd | 417 | // |
0b61c88b | 418 | pbox[0] = 600; |
419 | pbox[1] = 250; | |
420 | pbox[2] = 38; | |
53d2a7cd | 421 | gMC->Gsvolu("CSP4", "BOX", idtmed[1116], pbox, 3); |
0b61c88b | 422 | gMC->Gspos("CSP4", 1, "CRT", 0, 2950 - 700 + 155+pbox[1], -1150 - 210 - pbox[2], 0, "MANY"); |
423 | ||
53d2a7cd | 424 | // Shielding plug |
0b61c88b | 425 | pbox[0] = 850; |
426 | pbox[1] = 90; | |
427 | pbox[2] = 720; | |
53d2a7cd | 428 | gMC->Gsvolu("CSP5", "BOX", idtmed[1116], pbox, 3); |
0b61c88b | 429 | gMC->Gspos("CSP5", 1, "CRT", 0, 2950 - 700, -3450 + 460 + pbox[2], 0,"MANY"); |
430 | ||
53d2a7cd | 431 | // |
0b61c88b | 432 | pbox[0] = 80; |
433 | pbox[1] = 150; | |
434 | pbox[2] = 720; | |
53d2a7cd | 435 | gMC->Gsvolu("CSP6", "BOX", idtmed[1116], pbox, 3); |
0b61c88b | 436 | gMC->Gspos("CSP6", 1, "CRT", 1150 - 600 , 2950 - 700, -3450 + 460 + pbox[2], 0, "MANY"); |
437 | gMC->Gspos("CSP6", 2, "CRT", -1150 + 600, 2950 - 700, -3450 + 460 + pbox[2], 0, "MANY"); | |
438 | ||
53d2a7cd | 439 | // |
0b61c88b | 440 | pbox[0] = 130; |
441 | pbox[1] = 60; | |
442 | pbox[2] = 750; | |
53d2a7cd | 443 | gMC->Gsvolu("CSP7", "BOX", idtmed[1116], pbox, 3); |
0b61c88b | 444 | gMC->Gspos("CSP7", 1, "CRT", 850 + pbox[0], 2950 - 700 + 100, -3450 + 460 + pbox[2], 0, "MANY"); |
445 | gMC->Gspos("CSP7", 2, "CRT", -850 - pbox[0], 2950 - 700+ 100, -3450 + 460 + pbox[2], 0, "MANY"); | |
446 | ||
53d2a7cd | 447 | // PM25 Acces Shaft |
0b61c88b | 448 | ptube[0] = 910/2; |
449 | ptube[1] = ptube[0] + 100; | |
450 | ptube[2] = (5150 - 1166)/2; | |
53d2a7cd | 451 | gMC->Gsvolu("CSF3", "TUBE", idtmed[1116], ptube, 3); |
fddb5247 | 452 | gMC->Gspos("CSF3", 1, "CRT", -2100, AliCRTConstants::Instance()->Depth()-ptube[2], 0, idrotm[2001], "MANY"); |
0b61c88b | 453 | |
53d2a7cd | 454 | // PGC2 Access Shaft |
0b61c88b | 455 | ptube[0] = 1100/2; |
456 | ptube[1] = ptube[0] + 100; | |
457 | ptube[2] = (5150 - 690)/2; | |
53d2a7cd | 458 | gMC->Gsvolu("CSF4", "TUBE", idtmed[1116], ptube, 3); |
fddb5247 | 459 | gMC->Gspos("CSF4", 1, "CRT", 375, AliCRTConstants::Instance()->Depth()-ptube[2], 1900 + 2987.7, idrotm[2001], "MANY"); |
53d2a7cd | 460 | |
461 | } | |
462 | ||
463 | //_____________________________________________________________________________ | |
fddb5247 | 464 | void AliCRTv1::DrawDetector() const |
53d2a7cd | 465 | { |
466 | // | |
467 | // Draw a shaded view of the L3 magnet | |
468 | // | |
0b61c88b | 469 | //cout << "AliCRTv1::DrawModule() : Drawing the module" << endl; |
53d2a7cd | 470 | |
471 | ||
472 | Int_t able = 1; | |
473 | Int_t enable = 0; | |
474 | gMC->Gsatt("*", "seen", -1); | |
475 | gMC->Gsatt("alic", "seen", 0); | |
476 | ||
477 | gMC->Gsatt("ALIC","seen",enable); | |
478 | gMC->Gsatt("CRT", "seen",enable); | |
479 | gMC->Gsatt("L3MO","seen", able); // L3 Magnet | |
480 | //gMC->Gsatt("CRT1","seen", able); // Scintillators | |
481 | gMC->Gsatt("CRT4","seen", able); // Scintillators barrel | |
482 | ||
483 | // Draw the molasse volumes | |
484 | gMC->Gsatt("CMO1","seen",enable); // Exactly above the HALL | |
485 | gMC->Gsatt("CMO2","seen",enable); // Molasse, along the PM25 | |
486 | gMC->Gsatt("CMO3","seen",enable); // molasse along the PGC2 | |
487 | gMC->Gsatt("CMO4","seen",enable); // Molasse, behind the PX24 upper part | |
488 | gMC->Gsatt("CMO5","seen",enable); // molasse behind px24, lower part | |
489 | gMC->Gsatt("CMO6","seen",enable); // behind the PX24 | |
490 | gMC->Gsatt("CMO7","seen",enable); // behind the PGC2 | |
491 | gMC->Gsatt("CMO8","seen",enable); // on the right side. | |
492 | gMC->Gsatt("CMO9","seen",enable); // on the left side. | |
493 | gMC->Gsatt("CM10","seen",enable); // betwen PX24 & PM25. | |
494 | gMC->Gsatt("CM11","seen",enable); // betwen PGC2 & PM25. | |
495 | gMC->Gsatt("CM12","seen",enable); // box above the hall. | |
496 | ||
497 | gMC->Gdopt("hide", "on"); | |
498 | gMC->Gdopt("edge","off"); | |
499 | gMC->Gdopt("shad", "on"); | |
500 | gMC->Gsatt("*", "fill", 7); | |
501 | gMC->SetClipBox("ALIC", 0, 3000, -3000, 3000, -6000, 6000); | |
502 | gMC->DefaultRange(); | |
503 | gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .009, .009); | |
504 | gMC->Gdhead(1111, "View of CRT(ACORDE)"); | |
505 | gMC->Gdman(18, 4, "MAN"); | |
506 | ||
507 | ||
508 | } | |
509 | ||
510 | //_____________________________________________________________________________ | |
511 | void AliCRTv1::Init() | |
512 | { | |
513 | // | |
514 | // Initialise L3 magnet after it has been built | |
515 | Int_t i; | |
516 | // | |
517 | if(fDebug) { | |
518 | printf("\n%s: ",ClassName()); | |
519 | for(i=0;i<35;i++) printf("*"); | |
520 | printf(" CRTv1_INIT "); | |
521 | for(i=0;i<35;i++) printf("*"); | |
522 | printf("\n%s: ",ClassName()); | |
523 | // | |
524 | // Here the CRTv1 initialisation code (if any!) | |
525 | for(i=0;i<80;i++) printf("*"); | |
526 | printf("\n"); | |
527 | } | |
528 | ||
529 | } | |
530 | ||
531 | //____________________________________________________________________________ | |
532 | void AliCRTv1::StepManager() | |
533 | { | |
534 | // | |
535 | // Called for every step in the Cosmic Ray Trigger | |
536 | // | |
0b61c88b | 537 | static Int_t vol[1]; |
53d2a7cd | 538 | Int_t ipart; |
539 | TLorentzVector pos; | |
540 | TLorentzVector mom; | |
541 | ||
542 | static Float_t hits[14]; | |
543 | static Float_t eloss; | |
53d2a7cd | 544 | |
0b61c88b | 545 | if ( gMC->TrackPid() != kMuonMinus ) return; |
546 | ||
547 | // Only charged tracks | |
548 | if ( !(gMC->TrackCharge()) ) return; | |
53d2a7cd | 549 | |
550 | if (gMC->IsNewTrack()) { | |
551 | // Reset the deposited energy | |
0b61c88b | 552 | eloss = 0; |
53d2a7cd | 553 | } |
554 | ||
555 | // Add th energy loss in each step. | |
556 | eloss += gMC->Edep(); | |
557 | ||
0b61c88b | 558 | if ( ( (strcmp(gMC->CurrentVolName(),"CRT4") == 0) || // Magnet |
559 | (strcmp(gMC->CurrentVolName(),"CRT5") == 0) || // CRT | |
560 | (strcmp(gMC->CurrentVolName(),"CRT6") == 0) || // Magnet Doors | |
561 | (strcmp(gMC->CurrentVolName(),"CSF2") == 0) || // PX24 | |
562 | (strcmp(gMC->CurrentVolName(),"CSF3") == 0) || // PM25 | |
563 | (strcmp(gMC->CurrentVolName(),"CSF4") == 0) ) // PGC2 | |
564 | && gMC->IsTrackEntering() ) { | |
53d2a7cd | 565 | |
53d2a7cd | 566 | // Get current particle id(ipart),track position (pos) and momentum (mom) |
567 | gMC->TrackPosition(pos); | |
568 | gMC->TrackMomentum(mom); | |
569 | ipart = gMC->TrackPid(); | |
53d2a7cd | 570 | |
571 | ipart = gMC->TrackPid(); | |
572 | hits[0] = (Float_t)ipart; // (fId) | |
573 | ||
0b61c88b | 574 | hits[1] = pos[0]; // X coordinate (fX) |
575 | hits[2] = pos[1]; // Y coordinate (fY) | |
576 | hits[3] = pos[2]; // Z coordinate (fZ) | |
577 | hits[4] = mom[0]; // Px (fpxug) | |
578 | hits[5] = mom[1]; // Py (fpyug) | |
579 | hits[6] = mom[2]; // Pz (fpzug) | |
580 | hits[7] = eloss; // Energy loss | |
581 | ||
582 | // Tag the volumes | |
583 | if ( (strcmp(gMC->CurrentVolName(),"CRT4")==0) ) vol[0] = 1; // Magnet | |
584 | else if ( (strcmp(gMC->CurrentVolName(),"CRT5")==0) ) vol[0] = 2; // CRT | |
585 | else if ( (strcmp(gMC->CurrentVolName(),"CRT6")==0) ) vol[0] = 3; // Doors | |
586 | else if ( (strcmp(gMC->CurrentVolName(),"CSF2")==0) ) vol[0] = 4; // PX24 | |
587 | else if ( (strcmp(gMC->CurrentVolName(),"CSF3")==0) ) vol[0] = 5; // PM25 | |
588 | else if ( (strcmp(gMC->CurrentVolName(),"CSF4")==0) ) vol[0] = 6; // PGC2 | |
589 | else vol[0] = -1;// ? | |
590 | //vol[0] = gMC->GetMedium(); //layer(flay) | |
53d2a7cd | 591 | |
5d12ce38 | 592 | AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits); |
53d2a7cd | 593 | |
0b61c88b | 594 | // Reset the deposited energy only when you reach the Magnet |
595 | if ( (strcmp(gMC->CurrentVolName(),"CRT4")==0) ) eloss = 0; | |
53d2a7cd | 596 | |
597 | } else { | |
598 | return; | |
599 | } | |
600 | ||
0b61c88b | 601 | } |
602 | ||
603 | //_____________________________________________________________________________ | |
604 | void AliCRTv1::AddHit(Int_t track, Int_t *vol, Float_t *hits) | |
605 | { | |
606 | // | |
607 | // Add a CRT hit | |
608 | // | |
609 | TClonesArray &lhits = *fHits; | |
610 | new(lhits[fNhits++]) AliCRThit(fIshunt,track,vol,hits); | |
611 | } | |
53d2a7cd | 612 | |
0b61c88b | 613 | //_____________________________________________________________________________ |
614 | void AliCRTv1::ResetHits() | |
615 | { | |
616 | // Reset number of clusters and the cluster array for this detector | |
617 | AliDetector::ResetHits(); | |
618 | } | |
619 | ||
620 | //_____________________________________________________________________________ | |
621 | void AliCRTv1::ResetDigits() | |
622 | { | |
623 | // | |
624 | // Reset number of digits and the digits array for this detector | |
625 | AliDetector::ResetDigits(); | |
626 | } | |
627 | ||
628 | //____________________________________________________________________________ | |
629 | void AliCRTv1::FinishEvent() | |
630 | { | |
631 | // | |
632 | // | |
53d2a7cd | 633 | } |