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 vesion is suposed to work as standalone module //
28 // Arturo Fernandez <afernand@fcfm.buap.mx>
29 // Enrique Gamez <egamez@fcfm.buap.mx>
31 // Universidad Autonoma de Puebla
36 <img src="picts/AliCRTv1Class.gif">
39 <p>The responsible person for this module is
40 <a href="mailto:egamez@fcfm.buap.mx">Enrique Gamez</a>.
46 ///////////////////////////////////////////////////////////////////////////////
50 #include <TClonesArray.h>
51 #include <TLorentzVector.h>
53 #include <TVirtualMC.h>
58 #include "AliCRThit.h"
59 #include "AliCRTModule.h"
60 #include "AliCRTConstants.h"
65 //_____________________________________________________________________________
70 // Default constructor
76 //_____________________________________________________________________________
77 AliCRTv1::AliCRTv1(const char *name, const char *title)
81 // Standard constructor
85 <img src="picts/AliCRTv1.gif">
88 fIshunt = 1; // All hits are associated with primary particles
90 fHits = new TClonesArray("AliCRThit",400);
91 gAlice->GetMCApp()->AddHitList(fHits);
98 //_____________________________________________________________________________
99 AliCRTv1::AliCRTv1(const AliCRTv1& crt)
108 //_____________________________________________________________________________
109 AliCRTv1::~AliCRTv1()
112 // Default destructor
116 //_____________________________________________________________________________
117 AliCRTv1& AliCRTv1::operator=(const AliCRTv1& crt)
120 // Asingment operator
126 //_____________________________________________________________________________
127 void AliCRTv1::CreateMaterials()
131 // Use the parent class definition of the materials
133 AliCRT::CreateMaterials();
136 //_____________________________________________________________________________
137 void AliCRTv1::CreateGeometry()
140 // Create geometry for the CRT array
143 Int_t idrotm[2499]; // The rotation matrix.
144 Int_t* idtmed = fIdtmed->GetArray() - 1099 ;
145 AliCRTConstants* crtConstants = AliCRTConstants::Instance();
147 // Create the mother volume, the one which will contain all the material
150 pbox[0] = AliCRTConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
152 pbox[1] = crtConstants->Depth();
154 gMC->Gsvolu("CRT", "BOX", idtmed[1114], pbox, 3);
155 gMC->Gspos("CRT", 1, "ALIC", 0, 0, 0, 0, "ONLY");
158 this->CreateShafts();
161 this->CreateMolasse();
163 // This volume can be seen as the volume which ACORDE will ocupate
164 // above the upper face of the L3 magnet. Inside this volume the detectors
165 // aboce the magnet will be, then there will be two copies of this volume,
166 // one for each side.
168 //box[0] = 2*crtConstants->MagMinRadius()*TMath::Sin(kDegrad*22.5);
169 box[0] = crtConstants->MagMinRadius()*TMath::Sin(kDegrad*22.5);
170 box[1] = crtConstants->MagMaxRadius() - crtConstants->MagMinRadius();
171 box[2] = crtConstants->MagnetLenght()/2;
172 gMC->Gsvolu("CRT1", "BOX", idtmed[1112], box, 3);
174 // Check if the AliCRTModule instance have been set, otherwise
175 // use the default values
177 Info("CreateGeometry", "Using default dimensions");
178 fModule = new AliCRTModule("CRTmod", "Default module dimensions");
181 // The full module volume.
182 // This volume will be ocupied by all the material of the module
183 // the scintillators, the aluminium frame, etc.
184 box[0] = fModule->FrameLength()/2;
185 box[1] = fModule->FrameThickness()/2;
186 box[2] = fModule->FrameWidth()/2;
187 gMC->Gsvolu("CRT2", "BOX", idtmed[1114], box, 3);
190 box[0] = crtConstants->SinglePaletteLenght()/4;
191 box[1] = crtConstants->SinglePaletteHeight();
192 box[2] = crtConstants->SinglePaletteWidth()/2;
193 gMC->Gsvolu("CRT3", "BOX", idtmed[1112], box, 3);
194 gMC->Gspos("CRT3", 1, "CRT2", 0, 2, 0, 0, "ONLY");
196 // The metallic frame
197 box[0] = fModule->FrameLength()/2;
198 box[1] = fModule->FrameThickness()/2;
200 gMC->Gsvolu("CRT4", "BOX", idtmed[1108], box, 3);
201 gMC->Gspos("CRT4", 1, "CRT2", 0, 0, 13 - box[2], 0, "MANY");
202 gMC->Gspos("CRT4", 2, "CRT2", 0, 0, -13 + box[2], 0, "MANY");
205 box[1] = fModule->FrameThickness()/2;
206 box[2] = fModule->FrameWidth()/2;
207 gMC->Gsvolu("CRT5", "BOX", idtmed[1108], box, 3);
208 gMC->Gspos("CRT5", 1, "CRT2", 140 - box[0], 0, 0, 0, "MANY");
209 gMC->Gspos("CRT5", 2, "CRT2", -140 + box[0], 0, 0, 0, "MANY");
213 box[1] = fModule->FrameThickness()/2;
215 gMC->Gsvolu("CRT6", "BOX", idtmed[1108], box, 3);
217 // Now put into the volume CR11 all the above volumes.
218 // 20 scintillation modules
220 Int_t copyNumber = 0;
221 for ( Int_t k = 0; k < fModule->NumberOfRows(); k++ ) {
222 Float_t zCoordinate = k*fModule->ZGap() - 450;
223 gMC->Gspos("CRT2",++copyNumber,"CRT1",-150, 15, zCoordinate, 0, "MANY");
224 gMC->Gspos("CRT2",++copyNumber,"CRT1",150, 15, zCoordinate, 0, "MANY");
228 // Put the support bars
229 gMC->Gspos("CRT6", 1, "CRT1", -75, 5, 0, 0, "ONLY");
230 gMC->Gspos("CRT6", 2, "CRT1", -225, 5, 0, 0, "ONLY");
231 gMC->Gspos("CRT6", 3, "CRT1", 75, 5, 0, 0, "ONLY");
232 gMC->Gspos("CRT6", 4, "CRT1", 225, 5, 0, 0, "ONLY");
234 // Now put a copy of CR11 on the 3 upper faces of the magnet
235 // In the right side side of the magnet
236 AliMatrix(idrotm[231], 90, 45, 90, 135, 0, 0);
237 // In the left side side of the magnet
238 AliMatrix(idrotm[232], 90, 315, 90, 45, 0, 0);
240 Float_t x = crtConstants->MagMinRadius()+10;
241 gMC->Gspos("CRT1", 1, "ALIC", 0, x, 0, 0, "MANY");
242 gMC->Gspos("CRT1", 2, "ALIC", -x*TMath::Sin(kDegrad*45), x*TMath::Cos(kDegrad*45), 0, idrotm[231], "MANY");
243 gMC->Gspos("CRT1", 3, "ALIC", x*TMath::Sin(kDegrad*45), x*TMath::Cos(kDegrad*45), 0, idrotm[232], "MANY");
247 //_____________________________________________________________________________
248 void AliCRTv1::CreateMolasse()
253 Int_t idrotm[2499]; // The rotation matrix.
254 Int_t* idtmed = fIdtmed->GetArray() - 1099 ;
256 Float_t px24radius = 2300/2;
259 Float_t px24Z = 2300;
261 Float_t pm25radius = 910/2;
262 Float_t pm25X = 2100;
266 Float_t pgc2radius = 1100/2;
267 Float_t pgc2X = -375;
269 Float_t pgc2Z = -(1900 + 2987.7);
271 Float_t concreteWidth = 100; // Standard width of the hall walls.
274 // Create a local mother volume.
276 pbox[0] = AliCRTConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
277 pbox[1] = AliCRTConstants::Instance()->Depth()/2;
279 gMC->Gsvolu("CMO1", "BOX", idtmed[1114], pbox, 3);
281 // Now put the molasse exactly above the hall. OK
285 ptubs[1] = 2100 - pm25radius;
286 ptubs[2] = 1900/2 + px24radius;
289 gMC->Gsvolu("CMO2", "TUBS", idtmed[1123], ptubs, 5);
290 gMC->Gspos("CMO2", 1, "CMO1", 0, 500-AliCRTConstants::Instance()->Depth()/2, ptubs[2]-1900, 0, "MANY");
292 // Molasse around the RB24/26 Wall. OK
293 ptubs[0] = 220 + 1600;
294 ptubs[1] = AliCRTConstants::Instance()->Depth() - ptubs[0];
295 ptubs[2] = 2987.7/2 - 1100/4 - concreteWidth/2;
298 gMC->Gsvolu("CMO3", "TUBS", idtmed[1123], ptubs, 5);
299 gMC->Gspos("CMO3", 1, "CMO1", 70, 40-AliCRTConstants::Instance()->Depth()/2, -1900 - ptubs[2], 0, "MANY");
301 // A big block above the RB24/26 wall. OK
302 pbox[0] = AliCRTConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
303 pbox[1] = (AliCRTConstants::Instance()->Depth() - 220 - 1600)/2;
304 pbox[2] = 2987.7/2 - 1100/4 - concreteWidth/2;
305 gMC->Gsvolu("CMO4", "BOX", idtmed[1123], pbox, 3);
306 gMC->Gspos("CMO4", 1, "CMO1", 0, AliCRTConstants::Instance()->Depth()/2 - pbox[1], -1900 - pbox[2], 0, "MANY");
307 // Small blocks below the volume CMO4 on both sides of the wall RB24/26. OK
308 pbox[0] = (AliCRTConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - ptubs[0])/2;
309 pbox[1] = AliCRTConstants::Instance()->Depth()/2 - pbox[1];
310 gMC->Gsvolu("CM17", "BOX", idtmed[1123], pbox, 3);
311 gMC->Gspos("CM17", 1, "CMO1", AliCRTConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - pbox[0], -AliCRTConstants::Instance()->Depth()/2 + pbox[1], -1900 - pbox[2], 0, "MANY");
312 gMC->Gspos("CM17", 2, "CMO1", -AliCRTConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad)+ pbox[0], -AliCRTConstants::Instance()->Depth()/2 + pbox[1], -1900 - pbox[2], 0, "MANY");
314 // And a big block of molasse above the hall up to the surface. OK
315 pbox[0] = pm25X - pm25radius;
316 pbox[1] = (AliCRTConstants::Instance()->Depth()-500-1170)/2;
317 pbox[2] = (1900 + 1150)/2;
318 gMC->Gsvolu("CMO5", "BOX", idtmed[1123], pbox, 3);
319 gMC->Gspos("CMO5", 1, "CMO1", 0,AliCRTConstants::Instance()->Depth()/2-pbox[1], pbox[2]-1900, 0, "MANY");
320 // Small blocks of molasse betwen the blocks CMO2, CMO5 and PM25. Ok
321 pbox[0] = (pm25X - pm25radius - 1170)/2;
323 gMC->Gsvolu("CM16", "BOX", idtmed[1123], pbox, 3);
324 gMC->Gspos("CM16", 1, "CMO1", 1170 + pbox[0], -AliCRTConstants::Instance()->Depth()/2+pbox[1], pbox[2] - 1900, 0, "MANY");
326 // Molasse around the shafts.
327 AliMatrix(idrotm[2003], 0, 0, 90, 0, 90, 90);
328 // Around the PX24, the open section. OK
329 ptubs[0] = px24radius + concreteWidth;
330 ptubs[1] = ptubs[0] + 1000;
331 ptubs[2] = (2300 - (5150 - AliCRTConstants::Instance()->Depth()))/2;
332 ptubs[3] = 180 + kRaddeg*TMath::ASin(1070/ptubs[0]);
333 ptubs[4] = 180 - kRaddeg*TMath::ASin(1070/ptubs[0]);
334 gMC->Gsvolu("CMO6", "TUBS", idtmed[1123], ptubs, 5);
335 gMC->Gspos("CMO6", 1, "CMO1", px24X, ptubs[2] - AliCRTConstants::Instance()->Depth()/2, px24Z, idrotm[2003], "MANY");
337 // Around the PX24, the closed section. OK
339 ptube[0] = px24radius + concreteWidth;
340 ptube[1] = ptube[0] + 1000;
341 ptube[2] = (5150 - 2300)/2;
342 gMC->Gsvolu("CMO7", "TUBE", idtmed[1123], ptube, 3);
343 gMC->Gspos("CMO7", 1, "CMO1", px24X, AliCRTConstants::Instance()->Depth()/2 - ptube[2], px24Z, idrotm[2003], "MANY");
346 ptube[0] = pm25radius + concreteWidth;
347 ptube[1] = ptube[0] + 400;
348 ptube[2] = AliCRTConstants::Instance()->Depth()/2;
349 gMC->Gsvolu("CMO8", "TUBE", idtmed[1123], ptube, 3);
350 gMC->Gspos("CMO8", 1, "CMO1", pm25X, 0, pm25Z, idrotm[2003], "MANY");
351 // On both sides of the PM25 along the HALL.
352 pbox[0] = (2100 + pm25radius - 1170)/2;
353 pbox[1] = AliCRTConstants::Instance()->Depth()/2;
354 pbox[2] = (3*px24radius - pm25radius)/2;
355 gMC->Gsvolu("CM18", "BOX", idtmed[1123], pbox, 3);
356 gMC->Gspos("CM18", 1, "CMO1", 2100, 0, pbox[2] + pm25radius, 0, "MANY");
358 pbox[2] = (1900 - pm25radius)/2;
359 gMC->Gsvolu("CM19", "BOX", idtmed[1123], pbox, 3);
360 gMC->Gspos("CM19", 1, "CMO1", 2100, 0, -pbox[2] - pm25radius, 0, "MANY");
362 // Around the PGC2. OK
363 ptube[0] = pgc2radius + concreteWidth;
364 ptube[1] = 2987.7 - 740;
365 ptube[2] = AliCRTConstants::Instance()->Depth()/2;
366 gMC->Gsvolu("CMO9", "TUBE", idtmed[1123], ptube, 3);
367 gMC->Gspos("CMO9", 1, "CMO1", pgc2X, 0, pgc2Z, idrotm[2003], "MANY");
369 // On both sides of the PGC2.OK
370 pbox[0] = (AliCRTConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - 1100 - 375)/2;
371 pbox[1] = AliCRTConstants::Instance()->Depth()/2;
372 pbox[2] = pgc2radius + concreteWidth;
373 gMC->Gsvolu("CM10", "BOX", idtmed[1123], pbox, 3);
374 gMC->Gspos("CM10", 1, "CMO1", AliCRTConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - pbox[0], 0, pgc2Z, 0, "MANY");
375 gMC->Gspos("CM10", 2, "CMO1", -AliCRTConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) + pbox[0], 0, pgc2Z, 0, "MANY");
377 // big block of molasse behind the PX24. OK
378 pbox[0] = AliCRTConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
379 pbox[1] = AliCRTConstants::Instance()->Depth()/2;
380 pbox[2] = (pbox[0] - (2300 + 1150 + 100))/2;
381 gMC->Gsvolu("CM12", "BOX", idtmed[1123], pbox, 3);
382 gMC->Gspos("CM12", 1, "CMO1", px24X, 0, px24Z + px24radius + concreteWidth + pbox[2], 0, "MANY");
384 // big block of molasse in the opposite side of the PM25. OK
385 pbox[0] = (AliCRTConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - 1150)/2;
386 pbox[1] = AliCRTConstants::Instance()->Depth()/2;
387 pbox[2] = (1900 + 2300 + 1150)/2;
388 gMC->Gsvolu("CM13", "BOX", idtmed[1123], pbox, 3);
389 gMC->Gspos("CM13", 1, "CMO1", -1150 - pbox[0], 0, pbox[2] - 1900, 0, "MANY");
391 // big block of molasse behind the PM25. OK
392 pbox[0] = (AliCRTConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - (2100 + 910/2 + 100))/2;
393 pbox[1] = AliCRTConstants::Instance()->Depth()/2;
394 pbox[2] = (1900 + 2300 + 1150)/2;
395 gMC->Gsvolu("CM14", "BOX", idtmed[1123], pbox, 3);
396 gMC->Gspos("CM14", 1, "CMO1", pm25X + pm25radius + concreteWidth + pbox[0], 0, pbox[2] - 1900, 0, "MANY");
398 // big block of molasse behind the PGC2. OK
399 pbox[0] = AliCRTConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
400 pbox[1] = AliCRTConstants::Instance()->Depth()/2;
401 pbox[2] = (pbox[0] - (2987.7 + 1900 + 1100/2 + 100))/2;
402 gMC->Gsvolu("CM15", "BOX", idtmed[1123], pbox, 3);
403 gMC->Gspos("CM15", 1, "CMO1", 0, 0, -pbox[0] + pbox[2], 0, "MANY");
405 gMC->Gspos("CMO1",1,"CRT",0,AliCRTConstants::Instance()->Depth()/2,0,0,"MANY");
409 //_____________________________________________________________________________
410 void AliCRTv1::CreateShafts()
415 Int_t idrotm[2499]; // The rotation matrix.
416 Int_t* idtmed = fIdtmed->GetArray() - 1099 ;
421 AliMatrix(idrotm[2001], 0, 0, 90, 0, 90, 90);
424 // Create a bing cilinder to hold the main structures in the shaft.
425 // All the structures relative to the shaft will be put into
427 // This shaft is composed by an open tube down in the hall, and
428 // a cilinder avobe the level of the ceiling.
430 ptube[0] = 0; // inner radius
431 ptube[1] = 1250; // outer radius
432 ptube[2] = 5150/2; // Half lenght in Z
433 gMC->Gsvolu("CSF1", "TUBE", idtmed[1114], ptube, 3);
436 // The open section of the PX24
437 ptubs[0] = 1150; // Inner radius
438 ptubs[1] = 1250; // Outer radius
439 ptubs[2] = 1300; // Half length
440 ptubs[3] = 180 + kRaddeg*TMath::ASin(1070/ptubs[0]); // starting angle
441 ptubs[4] = 180 - kRaddeg*TMath::ASin(1070/ptubs[0]);
442 gMC->Gsvolu("CSF2", "TUBS", idtmed[1116], ptubs, 5);
443 gMC->Gspos("CSF2", 1, "CSF1", 0, 0, -ptube[2] + ptubs[2], 0, "MANY");
445 // The other part of the shaft.
446 ptube[0] = ptubs[0]; // Inner radius
447 ptube[1] = ptubs[1]; // Outer radius
448 ptube[2] = 5150/2 - ptubs[2]; // Half lenght
449 gMC->Gsvolu("CSF3", "TUBE", idtmed[1116], ptube, 3);
450 gMC->Gspos("CSF3", 1, "CSF1", 0, 0, 5150/2 - ptube[2], 0, "MANY");
453 // Concrete walls along the shaft (next to the elevator.)
454 pbox[0] = 480/2; // Half length in X
455 pbox[1] = 120/2; // Half length in Y
456 pbox[2] = 5150/2; // Half length in Z
457 gMC->Gsvolu("CSW1", "BOX", idtmed[1116], pbox, 3);
458 gMC->Gspos("CSW1", 1, "CSF1", 820+pbox[0], 150+pbox[1], 0, 0, "MANY");
459 gMC->Gspos("CSW1", 2, "CSF1", 820+pbox[0], -300-pbox[1], 0, 0, "MANY");
462 pbox[0] = 120/2; // Half length in X
463 pbox[1] = 750/2; // Half length in Y
464 pbox[2] = 5150/2; // Half length in Z
465 gMC->Gsvolu("CSW2", "BOX", idtmed[1116], pbox, 3);
466 gMC->Gspos("CSW2", 1, "CSF1", 820-60, 150+pbox[1], 0, 0, "MANY");
469 pbox[0] = 120/2; // Half length in X
470 pbox[1] = 600/2; // Half lenght in Y
471 pbox[2] = 5150/2; // Half length in Z
472 gMC->Gsvolu("CSW3", "BOX", idtmed[1116], pbox, 3);
473 gMC->Gspos("CSW3", 1, "CSF1", 820-60, -300-pbox[1], 0, 0, "MANY");
475 // Material below the counting rooms.
479 gMC->Gsvolu("CSW4", "BOX", idtmed[1116], pbox, 3);
480 gMC->Gspos("CSW4",1,"CSF1",2300/2-pbox[0],0,3000-5150/2-pbox[2], 0, "MANY");
486 gMC->Gsvolu("CSW5", "BOX", idtmed[1116], pbox, 3);
487 gMC->Gspos("CSW5", 1, "CSF1", 0, 0, 3000-5150/2-130, 0, "MANY");
489 // The end of the support for the shielding plug.
493 gMC->Gsvolu("CSW6", "BOX", idtmed[1116], pbox, 3);
494 gMC->Gspos("CSW6",1,"CSF1",-1400/2-pbox[0],0,3000-5150/2-pbox[2],0,"MANY");
500 gMC->Gsvolu("CSW7", "BOX", idtmed[1116], pbox, 3);
501 gMC->Gspos("CSW7",1,"CSF1",-1400/2-170-pbox[0],0,3000-5150/2+pbox[2],0,"MANY");
503 // Material close to the pipe.
507 gMC->Gsvolu("CSW8", "BOX", idtmed[1116], pbox, 3);
508 gMC->Gspos("CSW8",1,"CSF1",-2300/2+pbox[0],0,2500-5150/2,0,"MANY");
510 // Now put the shaft into the mother volume.
511 gMC->Gspos("CSF1", 1, "CRT", 0, AliCRTConstants::Instance()->Depth() - 5150/2, 2300, idrotm[2001], "MANY");
515 ptube[1] = ptube[0] + 100;
516 ptube[2] = (5150 - 1166)/2;
517 gMC->Gsvolu("CSF4", "TUBE", idtmed[1116], ptube, 3);
518 gMC->Gspos("CSF4", 1, "CRT", 2100, AliCRTConstants::Instance()->Depth()-ptube[2], 0, idrotm[2001], "MANY");
522 ptube[1] = ptube[0] + 100;
523 ptube[2] = (5150 - 690)/2;
524 gMC->Gsvolu("CSF5", "TUBE", idtmed[1116], ptube, 3);
525 gMC->Gspos("CSF5", 1, "CRT", -375, AliCRTConstants::Instance()->Depth()-ptube[2], -1900 - 2987.7, idrotm[2001], "MANY");
529 //_____________________________________________________________________________
530 void AliCRTv1::DrawDetector() const
533 // Draw a shaded view of the L3 magnet
535 Info("DrawDetector", "Drawing CRT module");
537 gMC->Gsatt("*", "seen", -1);
538 gMC->Gsatt("ALIC", "seen", 0);
540 gMC->Gsatt("L3MO","seen",0); // L3 Magnet, Mother
541 gMC->Gsatt("L3CO","seen",1); // Coils
542 gMC->Gsatt("L3C1","seen",1); // Coils
543 gMC->Gsatt("L3YO","seen",1); // Yoke
544 gMC->Gsatt("L3DO","seen",0); // return Yoke (DOOR)
545 gMC->Gsatt("L3FR","seen",1); // DOOR
546 gMC->Gsatt("L3IR","seen",0); // Inner layer
547 gMC->Gsatt("L3O1","seen",1); // Door opening
548 gMC->Gsatt("L3O2","seen",1); // Door opening
550 gMC->Gsatt("CRT", "seen",0); // CRT mother volume.
552 gMC->Gsatt("CMO1","seen",0); // Molasse.
554 gMC->Gsatt("CSF1","seen",0); // PX24 access shaft.
555 gMC->Gsatt("CSF2", "seen", 1); // PX24 open section
556 gMC->Gsatt("CSF3", "seen", 1); // PX24, upper part.
557 gMC->Gsatt("CSW1", "seen", 1);
558 gMC->Gsatt("CSW2", "seen", 1);
559 gMC->Gsatt("CSW3", "seen", 1);
560 gMC->Gsatt("CSW4", "seen", 1);
561 gMC->Gsatt("CSW5", "seen", 1);
562 gMC->Gsatt("CSW6", "seen", 1);
563 gMC->Gsatt("CSW7", "seen", 1);
564 gMC->Gsatt("CSW8", "seen", 1);
566 gMC->Gsatt("CSF4","seen",1); // PM25 access shaft.
567 gMC->Gsatt("CSF5","seen",1); // PGC2 access shaft.
569 gMC->Gsatt("CRT", "seen", 0); // CRT Mother volume.
570 gMC->Gsatt("CRT1", "seen", 0); // ?
571 gMC->Gsatt("CRT2", "seen", 0); // Module air box
572 gMC->Gsatt("CRT3", "seen", 1); // Scintillators
573 gMC->Gsatt("CRT3", "colo", 2); // Scintillators
574 gMC->Gsatt("CRT4", "seen", 1); // Aluminium frame (long bars)
575 gMC->Gsatt("CRT4", "colo", 3); //
576 gMC->Gsatt("CRT5", "seen", 1); // Aluminium frame (short bars)
577 gMC->Gsatt("CRT5", "colo", 3); //
578 gMC->Gsatt("CRT6", "seen", 1); // Module support
579 gMC->Gsatt("CRT6", "colo", 3); //
581 gMC->Gdopt("hide", "on");
582 gMC->Gdopt("edge","off");
583 gMC->Gdopt("shad", "on");
584 gMC->Gsatt("*", "fill", 7);
585 gMC->SetClipBox("ALIC", 0, 3000, -3000, 3000, -6000, 6000);
587 gMC->Gdraw("alic", 70, 30, 0, 10, 9.5, .001, .001);
588 gMC->Gdhead(1111, "View of CRT(ACORDE)");
589 gMC->Gdman(18, 4, "MAN");
593 //_____________________________________________________________________________
594 void AliCRTv1::Init()
597 // Initialise L3 magnet after it has been built
601 printf("\n%s: ",ClassName());
602 for(i=0;i<35;i++) printf("*");
603 printf(" CRTv1_INIT ");
604 for(i=0;i<35;i++) printf("*");
605 printf("\n%s: ",ClassName());
607 // Here the CRTv1 initialisation code (if any!)
608 for(i=0;i<80;i++) printf("*");
614 //____________________________________________________________________________
615 void AliCRTv1::StepManager()
618 // Called for every step in the Cosmic Ray Trigger
625 static Float_t hits[14];
626 static Float_t eloss;
628 if ( gMC->TrackPid() != kMuonMinus ) return;
630 // Only charged tracks
631 if ( !(gMC->TrackCharge()) ) return;
633 if (gMC->IsNewTrack()) {
634 // Reset the deposited energy
638 // Add th energy loss in each step.
639 eloss += gMC->Edep();
641 if ( ( (strcmp(gMC->CurrentVolName(),"CRT4") == 0) || // Magnet
642 (strcmp(gMC->CurrentVolName(),"CRT5") == 0) || // CRT
643 (strcmp(gMC->CurrentVolName(),"CRT6") == 0) || // Magnet Doors
644 (strcmp(gMC->CurrentVolName(),"CSF2") == 0) || // PX24
645 (strcmp(gMC->CurrentVolName(),"CSF3") == 0) || // PM25
646 (strcmp(gMC->CurrentVolName(),"CSF4") == 0) ) // PGC2
647 && gMC->IsTrackEntering() ) {
650 if ( (strcmp(gMC->CurrentVolName(),"CRT3") == 0)
651 && gMC->IsTrackEntering() ) {
653 // Get current particle id(ipart),track position (pos) and momentum (mom)
654 gMC->TrackPosition(pos);
655 gMC->TrackMomentum(mom);
656 ipart = gMC->TrackPid();
658 ipart = gMC->TrackPid();
659 hits[0] = (Float_t)ipart; // (fId)
661 hits[1] = pos[0]; // X coordinate (fX)
662 hits[2] = pos[1]; // Y coordinate (fY)
663 hits[3] = pos[2]; // Z coordinate (fZ)
664 hits[4] = mom[0]; // Px (fpxug)
665 hits[5] = mom[1]; // Py (fpyug)
666 hits[6] = mom[2]; // Pz (fpzug)
667 hits[7] = eloss; // Energy loss
669 Info("StepManager", "X=%f", pos[0]);
672 if ( (strcmp(gMC->CurrentVolName(),"CRT4")==0) ) vol[0] = 1; // Magnet
673 else if ( (strcmp(gMC->CurrentVolName(),"CRT5")==0) ) vol[0] = 2; // CRT
674 else if ( (strcmp(gMC->CurrentVolName(),"CRT6")==0) ) vol[0] = 3; // Doors
675 else if ( (strcmp(gMC->CurrentVolName(),"CSF2")==0) ) vol[0] = 4; // PX24
676 else if ( (strcmp(gMC->CurrentVolName(),"CSF3")==0) ) vol[0] = 5; // PM25
677 else if ( (strcmp(gMC->CurrentVolName(),"CSF4")==0) ) vol[0] = 6; // PGC2
678 else vol[0] = -1;// ?
679 //vol[0] = gMC->GetMedium(); //layer(flay)
680 Info("StepManager", "Adding hit");
681 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
682 Info("StepManager", "Hit added");
683 // Reset the deposited energy only when you reach the Magnet
684 if ( (strcmp(gMC->CurrentVolName(),"CRT4")==0) ) eloss = 0;
692 //_____________________________________________________________________________
693 void AliCRTv1::AddHit(Int_t track, Int_t *vol, Float_t *hits)
698 TClonesArray &lhits = *fHits;
699 new(lhits[fNhits++]) AliCRThit(fIshunt,track,vol,hits);