1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // ALICE Cosmic Ray Trigger //
22 // This class contains the functions for version 0 of the ALICE Cosmic Ray //
23 // Trigger. This version will be used to simulation comic rays in alice with//
24 // all the detectors. It include geometry and hits (posicion and momentum) //
26 // Author: Enrique Gamez //
28 // Send comments to: //
29 // Arturo Fernandez <afernand@fcfm.buap.mx> //
30 // Eleazar Cuautle <ecuautle@nucleares.unam.mx> //
32 // Last update: Nov. 17th. 2009 //
33 // Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch //
34 // FCFM-BUAP, Puebla, Pue. Mexico //
36 ///////////////////////////////////////////////////////////////////////////////
39 #include "AliACORDEv0.h"
40 #include <TClonesArray.h>
41 #include <TLorentzVector.h>
42 #include <TVirtualMC.h>
48 #include "AliACORDEhit.h"
49 #include "AliACORDEConstants.h"
55 //_____________________________________________________________________________
56 AliACORDEv0::AliACORDEv0()
60 // Default constructor
65 //_____________________________________________________________________________
66 AliACORDEv0::AliACORDEv0(const char *name, const char *title)
67 : AliACORDE(name, title)
70 // Standard constructor
72 fIshunt = 1; // All hits are associated with primary particles
73 fHits = new TClonesArray("AliACORDEhit",400);
74 gAlice->GetMCApp()->AddHitList(fHits);
76 //_____________________________________________________________________________
77 AliACORDEv0::~AliACORDEv0()
84 //_____________________________________________________________________________
85 void AliACORDEv0::CreateGeometry()
88 if (GetCreateCavern()) CreateCavern();
91 void AliACORDEv0::CreateCavern()
93 Int_t* idtmed = fIdtmed->GetArray() - 1099 ;
94 // Create the mother volume, the one which will contain all the material
97 pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
99 pbox[1] = AliACORDEConstants::Instance()->Depth();
101 TVirtualMC::GetMC()->Gsvolu("ACORDE", "BOX", idtmed[1114], pbox, 3);
102 TVirtualMC::GetMC()->Gspos("ACORDE", 1, "ALIC", 0, 0, 0, 0, "ONLY");
107 void AliACORDEv0::CreateShafts()
112 Int_t idrotm[2499]; // The rotation matrix.
113 Int_t* idtmed = fIdtmed->GetArray() - 1099 ;
118 AliMatrix(idrotm[2001], 0, 0, 90, 0, 90, 90);
121 // Create a bing cilinder to hold the main structures in the shaft.
122 // All the structures relative to the shaft will be put into
124 // This shaft is composed by an open tube down in the hall, and
125 // a cilinder avobe the level of the ceiling.
127 ptube[0] = 0; // inner radius
128 ptube[1] = 1250; // outer radius
129 ptube[2] = 5150/2; // Half lenght in Z
130 TVirtualMC::GetMC()->Gsvolu("CSF1", "TUBE", idtmed[1114], ptube, 3);
133 // The open section of the PX24
134 ptubs[0] = 1150; // Inner radius
135 ptubs[1] = 1250; // Outer radius
136 ptubs[2] = 1300; // Half length
137 ptubs[3] = 180 + kRaddeg*TMath::ASin(1070/ptubs[0]); // starting angle
138 ptubs[4] = 180 - kRaddeg*TMath::ASin(1070/ptubs[0]);
139 TVirtualMC::GetMC()->Gsvolu("CSF2", "TUBS", idtmed[1116], ptubs, 5);
140 TVirtualMC::GetMC()->Gspos("CSF2", 1, "CSF1", 0, 0, -ptube[2] + ptubs[2], 0, "MANY");
142 // The other part of the shaft.
143 ptube[0] = ptubs[0]; // Inner radius
144 ptube[1] = ptubs[1]; // Outer radius
145 ptube[2] = 5150/2 - ptubs[2]; // Half lenght
146 TVirtualMC::GetMC()->Gsvolu("CSF3", "TUBE", idtmed[1116], ptube, 3);
147 TVirtualMC::GetMC()->Gspos("CSF3", 1, "CSF1", 0, 0, 5150/2 - ptube[2], 0, "MANY");
150 // Concrete walls along the shaft (next to the elevator.)
151 pbox[0] = 480/2; // Half length in X
152 pbox[1] = 120/2; // Half length in Y
153 pbox[2] = 5150/2; // Half length in Z
154 TVirtualMC::GetMC()->Gsvolu("CSW1", "BOX", idtmed[1116], pbox, 3);
155 TVirtualMC::GetMC()->Gspos("CSW1", 1, "CSF1", 820+pbox[0], 150+pbox[1], 0, 0, "MANY");
156 TVirtualMC::GetMC()->Gspos("CSW1", 2, "CSF1", 820+pbox[0], -300-pbox[1], 0, 0, "MANY");
159 pbox[0] = 120/2; // Half length in X
160 pbox[1] = 750/2; // Half length in Y
161 pbox[2] = 5150/2; // Half length in Z
162 TVirtualMC::GetMC()->Gsvolu("CSW2", "BOX", idtmed[1116], pbox, 3);
163 TVirtualMC::GetMC()->Gspos("CSW2", 1, "CSF1", 820-60, 150+pbox[1], 0, 0, "MANY");
166 pbox[0] = 120/2; // Half length in X
167 pbox[1] = 600/2; // Half lenght in Y
168 pbox[2] = 5150/2; // Half length in Z
169 TVirtualMC::GetMC()->Gsvolu("CSW3", "BOX", idtmed[1116], pbox, 3);
170 TVirtualMC::GetMC()->Gspos("CSW3", 1, "CSF1", 820-60, -300-pbox[1], 0, 0, "MANY");
172 // Material below the counting rooms.
176 TVirtualMC::GetMC()->Gsvolu("CSW4", "BOX", idtmed[1116], pbox, 3);
177 TVirtualMC::GetMC()->Gspos("CSW4",1,"CSF1",2300/2-pbox[0],0,3000-5150/2-pbox[2], 0, "MANY");
183 TVirtualMC::GetMC()->Gsvolu("CSW5", "BOX", idtmed[1116], pbox, 3);
184 TVirtualMC::GetMC()->Gspos("CSW5", 1, "CSF1", 0, 0, 3000-5150/2-130, 0, "MANY");
186 // The end of the support for the shielding plug.
190 TVirtualMC::GetMC()->Gsvolu("CSW6", "BOX", idtmed[1116], pbox, 3);
191 TVirtualMC::GetMC()->Gspos("CSW6",1,"CSF1",-1400/2-pbox[0],0,3000-5150/2-pbox[2],0,"MANY");
197 TVirtualMC::GetMC()->Gsvolu("CSW7", "BOX", idtmed[1116], pbox, 3);
198 TVirtualMC::GetMC()->Gspos("CSW7",1,"CSF1",-1400/2-170-pbox[0],0,3000-5150/2+pbox[2],0,"MANY");
200 // Material close to the pipe.
204 TVirtualMC::GetMC()->Gsvolu("CSW8", "BOX", idtmed[1116], pbox, 3);
205 TVirtualMC::GetMC()->Gspos("CSW8",1,"CSF1",-2300/2+pbox[0],0,2500-5150/2,0,"MANY");
207 // Now put the shaft into the mother volume.
208 TVirtualMC::GetMC()->Gspos("CSF1", 1, "ACORDE", 0, AliACORDEConstants::Instance()->Depth() - 5150/2, 2300, idrotm[2001], "MANY");
212 ptube[1] = ptube[0] + 100;
213 ptube[2] = (5150 - 1166)/2;
214 TVirtualMC::GetMC()->Gsvolu("CSF4", "TUBE", idtmed[1116], ptube, 3);
215 TVirtualMC::GetMC()->Gspos("CSF4", 1, "ACORDE", 2100, AliACORDEConstants::Instance()->Depth()-ptube[2], 0, idrotm[2001], "MANY");
219 ptube[1] = ptube[0] + 100;
220 ptube[2] = (5150 - 690)/2;
221 TVirtualMC::GetMC()->Gsvolu("CSF5", "TUBE", idtmed[1116], ptube, 3);
222 TVirtualMC::GetMC()->Gspos("CSF5", 1, "ACORDE", -375, AliACORDEConstants::Instance()->Depth()-ptube[2], -1900 - 2987.7, idrotm[2001], "MANY");
227 void AliACORDEv0::CreateMolasse()
232 Int_t idrotm[2499]; // The rotation matrix.
233 Int_t* idtmed = fIdtmed->GetArray() - 1099 ;
235 Float_t px24radius = 2300/2;
238 Float_t px24Z = 2300;
240 Float_t pm25radius = 910/2;
241 Float_t pm25X = 2100;
245 Float_t pgc2radius = 1100/2;
246 Float_t pgc2X = -375;
248 Float_t pgc2Z = -(1900 + 2987.7);
250 Float_t concreteWidth = 100; // Standard width of the hall walls.
253 // Create a local mother volume.
255 pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
256 pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
258 TVirtualMC::GetMC()->Gsvolu("CMO1", "BOX", idtmed[1114], pbox, 3);
260 // Now put the molasse exactly above the hall. OK
264 ptubs[1] = 2100 - pm25radius;
265 ptubs[2] = 1900/2 + px24radius;
268 TVirtualMC::GetMC()->Gsvolu("CMO2", "TUBS", idtmed[1123], ptubs, 5);
269 TVirtualMC::GetMC()->Gspos("CMO2", 1, "CMO1", 0, 500-AliACORDEConstants::Instance()->Depth()/2, ptubs[2]-1900, 0, "MANY");
271 // Molasse around the RB24/26 Wall. OK
272 ptubs[0] = 220 + 1600;
273 ptubs[1] = AliACORDEConstants::Instance()->Depth() - ptubs[0];
274 ptubs[2] = 2987.7/2 - 1100/4 - concreteWidth/2;
277 TVirtualMC::GetMC()->Gsvolu("CMO3", "TUBS", idtmed[1123], ptubs, 5);
278 TVirtualMC::GetMC()->Gspos("CMO3", 1, "CMO1", 70, 40-AliACORDEConstants::Instance()->Depth()/2, -1900 - ptubs[2], 0, "MANY");
280 // A big block above the RB24/26 wall. OK
281 pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
282 pbox[1] = (AliACORDEConstants::Instance()->Depth() - 220 - 1600)/2;
283 pbox[2] = 2987.7/2 - 1100/4 - concreteWidth/2;
284 TVirtualMC::GetMC()->Gsvolu("CMO4", "BOX", idtmed[1123], pbox, 3);
285 TVirtualMC::GetMC()->Gspos("CMO4", 1, "CMO1", 0, AliACORDEConstants::Instance()->Depth()/2 - pbox[1], -1900 - pbox[2], 0, "MANY");
286 // Small blocks below the volume CMO4 on both sides of the wall RB24/26. OK
287 pbox[0] = (AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) -
289 pbox[1] = AliACORDEConstants::Instance()->Depth()/2 - pbox[1];
290 TVirtualMC::GetMC()->Gsvolu("CM17", "BOX", idtmed[1123], pbox, 3);
291 TVirtualMC::GetMC()->Gspos("CM17", 1, "CMO1", AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - pbox[0], -AliACORDEConstants::Instance()->Depth()/2 + pbox[1], -1900 - pbox[2], 0, "MANY");
292 TVirtualMC::GetMC()->Gspos("CM17", 2, "CMO1", -AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad)+ pbox[0], -AliACORDEConstants::Instance()->Depth()/2 + pbox[1], -1900 - pbox[2], 0, "MANY");
294 // And a big block of molasse above the hall up to the surface. OK
295 pbox[0] = pm25X - pm25radius;
296 pbox[1] = (AliACORDEConstants::Instance()->Depth()-500-1170)/2;
297 pbox[2] = (1900 + 1150)/2;
298 TVirtualMC::GetMC()->Gsvolu("CMO5", "BOX", idtmed[1123], pbox, 3);
299 TVirtualMC::GetMC()->Gspos("CMO5", 1, "CMO1", 0,AliACORDEConstants::Instance()->Depth()/2-pbox[1], pbox[2]-1900, 0, "MANY");
300 // Small blocks of molasse betwen the blocks CMO2, CMO5 and PM25. Ok
301 pbox[0] = (pm25X - pm25radius - 1170)/2;
303 TVirtualMC::GetMC()->Gsvolu("CM16", "BOX", idtmed[1123], pbox, 3);
304 TVirtualMC::GetMC()->Gspos("CM16", 1, "CMO1", 1170 + pbox[0], -AliACORDEConstants::Instance()->Depth()/2+pbox[1], pbox[2] - 1900, 0, "MANY");
306 // Molasse around the shafts.
307 AliMatrix(idrotm[2003], 0, 0, 90, 0, 90, 90);
308 // Around the PX24, the open section. OK
309 ptubs[0] = px24radius + concreteWidth;
310 ptubs[1] = ptubs[0] + 1000;
311 ptubs[2] = (2300 - (5150 - AliACORDEConstants::Instance()->Depth()))/2;
312 ptubs[3] = 180 + kRaddeg*TMath::ASin(1070/ptubs[0]);
313 ptubs[4] = 180 - kRaddeg*TMath::ASin(1070/ptubs[0]);
314 TVirtualMC::GetMC()->Gsvolu("CMO6", "TUBS", idtmed[1123], ptubs, 5);
315 TVirtualMC::GetMC()->Gspos("CMO6", 1, "CMO1", px24X, ptubs[2] - AliACORDEConstants::Instance()->Depth()/2, px24Z, idrotm[2003], "MANY");
316 // Around the PX24, the closed section. OK
318 ptube[0] = px24radius + concreteWidth;
319 ptube[1] = ptube[0] + 1000;
320 ptube[2] = (5150 - 2300)/2;
321 TVirtualMC::GetMC()->Gsvolu("CMO7", "TUBE", idtmed[1123], ptube, 3);
322 TVirtualMC::GetMC()->Gspos("CMO7", 1, "CMO1", px24X, AliACORDEConstants::Instance()->Depth()/2 - ptube[2], px24Z, idrotm[2003], "MANY");
325 ptube[0] = pm25radius + concreteWidth;
326 ptube[1] = ptube[0] + 400;
327 ptube[2] = AliACORDEConstants::Instance()->Depth()/2;
328 TVirtualMC::GetMC()->Gsvolu("CMO8", "TUBE", idtmed[1123], ptube, 3);
329 TVirtualMC::GetMC()->Gspos("CMO8", 1, "CMO1", pm25X, 0, pm25Z, idrotm[2003], "MANY");
330 // On both sides of the PM25 along the HALL.
331 pbox[0] = (2100 + pm25radius - 1170)/2;
332 pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
333 pbox[2] = (3*px24radius - pm25radius)/2;
334 TVirtualMC::GetMC()->Gsvolu("CM18", "BOX", idtmed[1123], pbox, 3);
335 TVirtualMC::GetMC()->Gspos("CM18", 1, "CMO1", 2100, 0, pbox[2] + pm25radius, 0, "MANY");
337 pbox[2] = (1900 - pm25radius)/2;
338 TVirtualMC::GetMC()->Gsvolu("CM19", "BOX", idtmed[1123], pbox, 3);
339 TVirtualMC::GetMC()->Gspos("CM19", 1, "CMO1", 2100, 0, -pbox[2] - pm25radius, 0, "MANY");
341 // Around the PGC2. OK
342 ptube[0] = pgc2radius + concreteWidth;
343 ptube[1] = 2987.7 - 740;
344 ptube[2] = AliACORDEConstants::Instance()->Depth()/2;
345 TVirtualMC::GetMC()->Gsvolu("CMO9", "TUBE", idtmed[1123], ptube, 3);
346 TVirtualMC::GetMC()->Gspos("CMO9", 1, "CMO1", pgc2X, 0, pgc2Z, idrotm[2003], "MANY");
348 // On both sides of the PGC2.OK
349 pbox[0] = (AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) -
351 pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
352 pbox[2] = pgc2radius + concreteWidth;
353 TVirtualMC::GetMC()->Gsvolu("CM10", "BOX", idtmed[1123], pbox, 3);
354 TVirtualMC::GetMC()->Gspos("CM10", 1, "CMO1", AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - pbox[0], 0, pgc2Z, 0, "MANY");
355 TVirtualMC::GetMC()->Gspos("CM10", 2, "CMO1", -AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) + pbox[0], 0, pgc2Z, 0, "MANY");
357 // big block of molasse behind the PX24. OK
358 pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
359 pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
360 pbox[2] = (pbox[0] - (2300 + 1150 + 100))/2;
361 TVirtualMC::GetMC()->Gsvolu("CM12", "BOX", idtmed[1123], pbox, 3);
362 TVirtualMC::GetMC()->Gspos("CM12", 1, "CMO1", px24X, 0, px24Z + px24radius + concreteWidth + pbox[2], 0, "MANY");
364 // big block of molasse in the opposite side of the PM25. OK
365 pbox[0] = (AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) -
367 pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
368 pbox[2] = (1900 + 2300 + 1150)/2;
369 TVirtualMC::GetMC()->Gsvolu("CM13", "BOX", idtmed[1123], pbox, 3);
370 TVirtualMC::GetMC()->Gspos("CM13", 1, "CMO1", -1150 - pbox[0], 0, pbox[2] - 1900, 0, "MANY");
372 // big block of molasse behind the PM25. OK
373 pbox[0] = (AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) -
374 (2100 + 910/2 + 100))/2;
375 pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
376 pbox[2] = (1900 + 2300 + 1150)/2;
377 TVirtualMC::GetMC()->Gsvolu("CM14", "BOX", idtmed[1123], pbox, 3);
378 TVirtualMC::GetMC()->Gspos("CM14", 1, "CMO1", pm25X + pm25radius + concreteWidth + pbox[0], 0, pbox[2] - 1900, 0, "MANY");
380 // big block of molasse behind the PGC2. OK
381 pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
382 pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
383 pbox[2] = (pbox[0] - (2987.7 + 1900 + 1100/2 + 100))/2;
384 TVirtualMC::GetMC()->Gsvolu("CM15", "BOX", idtmed[1123], pbox, 3);
385 TVirtualMC::GetMC()->Gspos("CM15", 1, "CMO1", 0, 0, -pbox[0] + pbox[2], 0, "MANY");
387 TVirtualMC::GetMC()->Gspos("CMO1",1,"ACORDE",0,AliACORDEConstants::Instance()->Depth()/2,0,0,"MANY");
391 void AliACORDEv0::CreateAcorde()
394 // Create geometry for the ACORDE array
395 // done in two main steps
396 // 1.- definition of the modules
397 // 2.- placement of the modules
399 Int_t idrotm[2499]; // The rotation matrix.
400 Int_t* idtmed = fIdtmed->GetArray() - 1099;
401 AliACORDEConstants* constants = AliACORDEConstants::Instance();
405 Float_t small = 0.05; // to separate slightly some volumes
406 // by half a mm so that they do not overlap
409 // 1.- Definition of a module
410 // * ACORDE1 => volume filled with air, representing a module
411 // it contains all other volumes defining the module
412 // there are 60 copies of it
413 // * ACORDE2 => volume defining one scintillator pad
414 // there are 2 copies of it per module
415 // * ACORDE3-6 => volumes representing the Al walls of box
416 // surrounding the plastic
417 // 3: long wall, 2 copies (front, back)
418 // 4: end caps, 2 copies (left, right)
419 // 5: long stripe to model the profile
420 // 4 copies (upper front and back, lower)
421 // 6: short stripe to model the profile
422 // 4 copies (upper left, right; lower)
424 // The full module volume.
425 // This volume will be ocupied by all the material of the module
426 // the scintillators, the aluminium frame, etc.
427 box[0] = constants->ModuleLength()/2;
428 box[1] = constants->ModuleHeight()/2;
429 box[2] = constants->ModuleWidth()/2;
430 TVirtualMC::GetMC()->Gsvolu("ACORDE1", "BOX", idtmed[1114], box, 3);
433 box[0] = constants->PlasticLength()/2;
434 box[1] = constants->PlasticHeight()/2;
435 box[2] = constants->PlasticWidth()/2;
436 TVirtualMC::GetMC()->Gsvolu("ACORDE2", "BOX", idtmed[1112], box, 3);
438 // it is important to keep this order for easy assignment of
439 // a volume to a physical module:
440 placed_at = box[1]+constants->ProfileThickness()
441 - constants->ModuleHeight()/2+small;
442 TVirtualMC::GetMC()->Gspos("ACORDE2", 1, "ACORDE1", 0, placed_at, 0, 0, "MANY");
443 placed_at = placed_at + 2.0*box[1]+small;
444 TVirtualMC::GetMC()->Gspos("ACORDE2", 2, "ACORDE1", 0, placed_at, 0, 0, "MANY");
447 // The metallic frame: long walls of box
448 // back,front,left,right, defined looking
449 // from the + z diraction into alice; i.e.
450 // back ==> z<0, front ==> z>0
451 // left ==> x<0, right ==> x>0
452 // up ==> increasing y, down ==> decreasing y
453 box[0] = constants->ModuleLength()/2;
454 box[1] = constants->ModuleHeight()/2;
455 box[2] = constants->ProfileThickness()/2.0;
456 TVirtualMC::GetMC()->Gsvolu("ACORDE3", "BOX", idtmed[1108], box, 3);
458 placed_at = constants->ModuleWidth()/2-constants->ProfileThickness()/2.0;
459 TVirtualMC::GetMC()->Gspos("ACORDE3", 1, "ACORDE1", 0, 0, placed_at, 0, "MANY");
461 TVirtualMC::GetMC()->Gspos("ACORDE3", 2, "ACORDE1", 0, 0, -placed_at , 0, "MANY");
463 // The metallic frame: end caps
464 box[0] = constants->ProfileThickness()/2.0;
465 box[1] = constants->ModuleHeight()/2;
466 box[2] = constants->ModuleWidth()/2;
467 TVirtualMC::GetMC()->Gsvolu("ACORDE4", "BOX", idtmed[1108], box, 3);
469 placed_at = constants->ModuleLength()/2-constants->ProfileThickness()/2.0;
470 TVirtualMC::GetMC()->Gspos("ACORDE4", 1, "ACORDE1", placed_at, 0, 0, 0, "MANY");
472 TVirtualMC::GetMC()->Gspos("ACORDE4", 2, "ACORDE1", -placed_at, 0, 0, 0, "MANY");
474 // The metallic frame: the profile, long stripes
475 box[0] = constants->ModuleLength()/2.0;
476 box[1] = constants->ProfileThickness()/2;
477 box[2] = constants->ProfileWidth()/2;
478 TVirtualMC::GetMC()->Gsvolu("ACORDE5", "BOX", idtmed[1108], box, 3);
480 placed_at = constants->ModuleHeight()/2-box[1];
481 placed_at2 = constants->ModuleWidth()/2-
482 constants->ProfileThickness()-box[2];
483 TVirtualMC::GetMC()->Gspos("ACORDE5", 1, "ACORDE1",0,placed_at,placed_at2, 0, "MANY");
485 TVirtualMC::GetMC()->Gspos("ACORDE5", 2, "ACORDE1",0,placed_at,-placed_at2, 0, "MANY");
487 TVirtualMC::GetMC()->Gspos("ACORDE5", 3, "ACORDE1",0,-placed_at,placed_at2, 0, "MANY");
489 TVirtualMC::GetMC()->Gspos("ACORDE5", 4, "ACORDE1",0,-placed_at,-placed_at2, 0, "MANY");
491 // The metallic frame: the profile, long stripes
492 box[0] = constants->ProfileWidth()/2.0;
493 box[1] = constants->ProfileThickness()/2;
494 box[2] = constants->ModuleWidth()/2-constants->ProfileWidth();
495 TVirtualMC::GetMC()->Gsvolu("ACORDE6", "BOX", idtmed[1108], box, 3);
497 placed_at = constants->ModuleHeight()/2-box[1];
498 placed_at2 = constants->ModuleLength()/2-
499 constants->ProfileThickness()-box[0];
500 TVirtualMC::GetMC()->Gspos("ACORDE6", 1, "ACORDE1",placed_at2,placed_at,0, 0, "MANY");
502 TVirtualMC::GetMC()->Gspos("ACORDE6", 2, "ACORDE1",-placed_at2,placed_at,0, 0, "MANY");
504 TVirtualMC::GetMC()->Gspos("ACORDE6", 3, "ACORDE1",placed_at2,-placed_at,0, 0, "MANY");
506 TVirtualMC::GetMC()->Gspos("ACORDE6", 4, "ACORDE1",-placed_at2,-placed_at,0, 0, "MANY");
508 // End of MODULE definition
510 ////////////////////////////////////////////////////////////////////
511 ////////////////////////////////////////////////////////////////////
513 // 2.- placement of the module
514 // Now put all of them in the right position in
515 // master volume ALIC
517 // rotation matrices (see Geant manual for conventions)
518 // for columns 4 and 5
519 AliMatrix(idrotm[231], 90, 45, 90, 135, 0, 0);
520 // for columns 0 and 1
521 AliMatrix(idrotm[232], 90, 315, 90, 45, 0, 0);
523 // place each one of the 6 columns in turn
524 // for the first and the last column the position
525 // of the two last modules depends on the value
526 // of the fITSGeometry variable
528 // it is important to keep this order because
529 // the copy number defines the module!
531 // first column, except first and last modules
532 for (Int_t copy = 2; copy < 10; copy++)
533 TVirtualMC::GetMC()->Gspos("ACORDE1",copy,"ALIC",
534 constants->OldModulePositionX(copy-1),
535 constants->OldModulePositionY(copy-1),
536 constants->OldModulePositionZ(copy-1),
537 idrotm[232], "MANY");
539 for (Int_t copy = 11; copy < 21; copy++)
540 TVirtualMC::GetMC()->Gspos("ACORDE1",copy,"ALIC",
541 constants->OldModulePositionX(copy-1),
542 constants->OldModulePositionY(copy-1),
543 constants->OldModulePositionZ(copy-1),
544 idrotm[232], "MANY");
545 // third and fourth columns
546 for (Int_t copy = 21; copy < 41; copy++)
547 TVirtualMC::GetMC()->Gspos("ACORDE1",copy,"ALIC",
548 constants->OldModulePositionX(copy-1),
549 constants->OldModulePositionY(copy-1),
550 constants->OldModulePositionZ(copy-1),
553 for (Int_t copy = 41; copy < 51; copy++)
554 TVirtualMC::GetMC()->Gspos("ACORDE1",copy,"ALIC",
555 constants->OldModulePositionX(copy-1),
556 constants->OldModulePositionY(copy-1),
557 constants->OldModulePositionZ(copy-1),
558 idrotm[231], "MANY");
559 // last column, except first and last modules
560 for (Int_t copy = 52; copy < 60; copy++)
561 TVirtualMC::GetMC()->Gspos("ACORDE1",copy,"ALIC",
562 constants->OldModulePositionX(copy-1),
563 constants->OldModulePositionY(copy-1),
564 constants->OldModulePositionZ(copy-1),
565 idrotm[231], "MANY");
566 // the last four modules
567 if (Get4CentralModulesGeometry()) {
568 TVirtualMC::GetMC()->Gspos("ACORDE1",1,"ALIC",
569 constants->OldExtraModulePositionX(),
570 constants->OldExtraModulePositionY(),
571 constants->OldExtraModulePositionZ(0),
573 TVirtualMC::GetMC()->Gspos("ACORDE1",10,"ALIC",
574 constants->OldExtraModulePositionX(),
575 constants->OldExtraModulePositionY(),
576 constants->OldExtraModulePositionZ(1),
578 TVirtualMC::GetMC()->Gspos("ACORDE1",51,"ALIC",
579 constants->OldExtraModulePositionX(),
580 constants->OldExtraModulePositionY(),
581 constants->OldExtraModulePositionZ(2),
583 TVirtualMC::GetMC()->Gspos("ACORDE1",60,"ALIC",
584 constants->OldExtraModulePositionX(),
585 constants->OldExtraModulePositionY(),
586 constants->OldExtraModulePositionZ(3),
589 TVirtualMC::GetMC()->Gspos("ACORDE1",1,"ALIC",
590 constants->OldModulePositionX(0),
591 constants->OldModulePositionY(0),
592 constants->OldModulePositionZ(0),
593 idrotm[232], "MANY");
594 TVirtualMC::GetMC()->Gspos("ACORDE1",10,"ALIC",
595 constants->OldModulePositionX(9),
596 constants->OldModulePositionY(9),
597 constants->OldModulePositionZ(9),
598 idrotm[232], "MANY");
599 TVirtualMC::GetMC()->Gspos("ACORDE1",51,"ALIC",
600 constants->OldModulePositionX(50),
601 constants->OldModulePositionY(50),
602 constants->OldModulePositionZ(50),
603 idrotm[231], "MANY");
604 TVirtualMC::GetMC()->Gspos("ACORDE1",60,"ALIC",
605 constants->OldModulePositionX(59),
606 constants->OldModulePositionY(59),
607 constants->OldModulePositionZ(59),
608 idrotm[231], "MANY");
609 } // end if (fITSGeometry)
613 //____________________________________________________________________________
615 void AliACORDEv0::Init()
617 // Initialise L3 magnet after it has been built
619 if(AliLog::GetGlobalDebugLevel()>0) {
620 printf("\n%s: ",ClassName());
621 for(i=0;i<35;i++) printf("*");
622 printf(" ACORDEv0_INIT ");
623 for(i=0;i<35;i++) printf("*");
624 printf("\n%s: ",ClassName());
625 // Here the ACORDEv initialisation code (if any!)
626 for(i=0;i<80;i++) printf("*");
629 // AliACORDE::Init();
631 //____________________________________________________________________________
632 void AliACORDEv0::StepManager()
635 // Called for every step in the Cosmic Ray Trigger
640 // [0] = module number 1-60 (1==>(0-0), 60 (5-9)
641 // [1] = Plastic number: 0 (down) to 1 (up)
648 // [5-7] = px, py, pz
651 // [10] = length of track through plastic
652 static Float_t hits[11];
654 // local static variables
655 static Float_t eloss;
657 // scintillator volume
658 static Int_t idScint = TVirtualMC::GetMC()->VolId("ACORDE2");
665 // only charged tracks
666 if ( !TVirtualMC::GetMC()->TrackCharge() || !TVirtualMC::GetMC()->IsTrackAlive() ) return;
668 // only in sensitive material
669 if (TVirtualMC::GetMC()->CurrentVolID(copy) == idScint) {
670 step += TVirtualMC::GetMC()->TrackStep();
671 eloss += TVirtualMC::GetMC()->Edep();
672 // set all hit variables except eloss which is resetted
673 // set volume variables
674 if (TVirtualMC::GetMC()->IsTrackEntering()) {
677 TVirtualMC::GetMC()->TrackPosition(pos);
678 TVirtualMC::GetMC()->TrackMomentum(mom);
683 // [5-7] = px, py, pz
686 hits[0] = (Float_t ) TVirtualMC::GetMC()->TrackPid();
690 hits[4] = TVirtualMC::GetMC()->TrackTime();
694 hits[8] = TVirtualMC::GetMC()->Etot();
696 // [0] = module number 1-60 (1==>(0-0), 60 (5-9)
697 // [1] = Plastic number: 0 (down) to 1 (up)
698 Int_t copyPlastic; // plastic: down=1, up=2
699 Int_t copyModule; // module: 1-60
700 TVirtualMC::GetMC()->CurrentVolID(copyPlastic);
701 TVirtualMC::GetMC()->CurrentVolOffID(1, copyModule);
704 // plastic: 0 = down, 1 = up
705 vol[1] = copyPlastic;
706 } // end if TVirtualMC::GetMC()->IsTrackEntering()
708 // set hit[9] = total energy loss and book hit
709 if( TVirtualMC::GetMC()->IsTrackExiting() ||
710 TVirtualMC::GetMC()->IsTrackStop() ||
711 TVirtualMC::GetMC()->IsTrackDisappeared()){
716 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
718 } // end if in scintillator
722 //_____________________________________________________________________________
723 void AliACORDEv0::AddHit(Int_t track, Int_t *vol, Float_t *hits)
728 TClonesArray &lhits = *fHits;
729 new(lhits[fNhits++]) AliACORDEhit(fIshunt,track,vol,hits);