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 **************************************************************************/
21 ///////////////////////////////////////////////////////////////////////////////
23 // ALICE Cosmic Ray Trigger //
25 // This class contains the functions for version 0 of the ALICE Cosmic Ray //
26 // Trigger. This vesion is suposed to work as standalone module //
31 // Arturo Fernandez <afernand@fcfm.buap.mx>
32 // Enrique Gamez <egamez@fcfm.buap.mx>
34 // Universidad Autonoma de Puebla
39 <img src="picts/AliCRTv1Class.gif">
42 <p>The responsible person for this module is
43 <a href="mailto:egamez@fcfm.buap.mx">Enrique Gamez</a>.
49 ///////////////////////////////////////////////////////////////////////////////
53 #include <TGeometry.h>
56 #include <TLorentzVector.h>
65 #include "AliCRTConstants.h"
69 //_____________________________________________________________________________
70 AliCRTv1::AliCRTv1() : AliCRTv0()
73 // Default constructor for CRT
78 fMagnetStatus = kTRUE;
83 //_____________________________________________________________________________
84 AliCRTv1::AliCRTv1(const char *name, const char *title)
85 : AliCRTv0(name,title)
88 // Standard constructor for CRT
92 <img src="picts/AliCRTv1.gif">
100 fMagnetStatus = kFALSE;
103 //_____________________________________________________________________________
104 AliCRTv1::AliCRTv1(const AliCRTv1& crt)
112 //_____________________________________________________________________________
113 AliCRTv1& AliCRTv1::operator= (const AliCRTv1& crt)
116 // Asingment operator
122 //_____________________________________________________________________________
123 void AliCRTv1::CreateGeometry()
126 // Create geometry for the CRT array
129 Int_t idrotm[2499]; // The rotation matrix.
131 Int_t * idtmed = fIdtmed->GetArray() - 1099 ;
135 this->CreateShafts();
139 this->CreateMolasse();
146 box[0] = AliCRTConstants::fgCageLenght/2.; // Half Length of the box along the X axis, cm.
147 box[1] = AliCRTConstants::fgCageHeight/2.; // Half Length of the box along the Y axis, cm.
148 box[2] = AliCRTConstants::fgCageWidth/2.; // Half Length of the box along the Z axis, cm.
151 // Create a big voluem with air barrel above the magnet
153 Float_t magnetSides = 3.;
154 Float_t planesPerpendicularToZ = 2.;
156 Float_t rMax = rMin + 20.; // 20 cm width
158 barrel[1] = 45*magnetSides;
159 barrel[2] = magnetSides;
160 barrel[3] = planesPerpendicularToZ;
167 gMC->Gsvolu("CRT4", "PGON", idtmed[1114], barrel, 10);
168 gMC->Gspos("CRT4", 1 , "CRT", 0., -30., 0., 0, "ONLY");
171 // Create the current sicuiitllator arry
172 // Define the Scintillators. as a big box.
174 scint[0] = AliCRTConstants::fgActiveAreaLenght/2.; // Half Length in X
175 scint[1] = AliCRTConstants::fgActiveAreaHeight/2.; // Half Length in Y
176 scint[2] = AliCRTConstants::fgActiveAreaWidth/2.; // Half Length in Z
177 gMC->Gsvolu("CRT1", "BOX ", idtmed[1112], scint, 3); // Scintillators
180 // we'll start dawing from the center.
185 Float_t gapY = 30.; // 30 cms. above the barrel.
186 // For the height we staimate the from the center of the ceiling,
187 // if were a cilinder, must be about 280cm.
188 Float_t barrelc = 790.; // Barrel radius.
189 Float_t height = barrelc + gapY - 30.;
190 Float_t initY = height;
194 // we'll start dawing from the center.
197 // Put 4 modules on the top of the magnet
199 for ( Int_t i = 1 ; i <= 4 ; i++ ) {
200 gMC->Gspos("CRT1", i, "CRT", initX, initY, (i-step)*box[2], 0, "ONLY");
204 // Modules on the barrel sides.
205 // Because the openenig angle for each face is 22.5, and if we want to
206 // put the modules right in the middle
207 Float_t xtragap = 10.;
208 Float_t initXside = (height+xtragap)*TMath::Sin(2*22.5*kDegrad);//rigthside
209 Float_t initYside = (height+xtragap)*TMath::Cos(2*22.5*kDegrad);
211 // Put 4 modules on the left side of the magnet
212 // The rotation matrix parameters, for the left side.
213 AliMatrix(idrotm[232], 90., 315., 90., 45., 0., 337.5);
215 for ( Int_t i = 1 ; i <= 4 ; i++ ) {
216 gMC->Gspos("CRT1", i+4, "CRT", initXside, initYside, (i-stepl)*box[2],
217 idrotm[232], "ONLY");
221 // Put 4 modules on the right side of the magnet
222 // The rotation matrix parameters for the right side.
223 AliMatrix(idrotm[231], 90., 45., 90., 315., 180., 202.5);
225 for ( Int_t i = 1 ; i <= 4 ; i++ ) {
226 gMC->Gspos("CRT1", i+8, "CRT", -initXside, initYside, (i-stepr)*box[2],
227 idrotm[231], "ONLY");
231 this->CreateMagnetGeometry();
232 this->CreateRICHGeometry();
233 this->CreateTPCGeometry();
237 //_____________________________________________________________________________
238 void AliCRTv1::CreateMagnetGeometry()
241 cout<<"\n\n\tYou are requiring the CRT with the Magnet Activated!\n\n";
243 Int_t idrotm[2499]; // The rotation matrix.
245 Int_t * idtmed = fIdtmed->GetArray() - 1099 ;
247 // Disable the CRT StepManager method.
251 Float_t magnetSides = 3.;
252 Float_t planesPerpendicularToZ = 2.;
253 //Float_t rMin = 790.;
254 //Float_t rMax = rMin + 20.; // 20 cm width
257 // Create the upper faces of the magnet.
268 gMC->Gsvolu("C3MO", "PGON", idtmed[1114], barrel, 10);
269 gMC->Gspos("C3MO", 1, "CRT", 0., -30., 0., 0, "ONLY");
277 gMC->Gsvolu("C3CO", "PGON", idtmed[1108], barrel, 10); //Aluminium
278 gMC->Gspos("C3CO", 1, "C3MO", 0., 0., 0., 0, "ONLY");
284 gMC->Gsvolu("C3C1", "PGON", idtmed[1128], barrel, 10);// Aluminium
285 gMC->Gspos("C3C1", 1, "C3MO", 0., 0., 0., 0, "ONLY");
293 gMC->Gsvolu("C3YO", "PGON", idtmed[1109], barrel, 10); // Iron
294 gMC->Gspos("C3YO", 1, "C3MO", 0., 0., 0., 0, "ONLY");
297 // Now create one inside the magnet as L3C1
298 // voulme for tracking.
300 barrel[1] = 45*magnetSides;
301 barrel[2] = magnetSides;
302 barrel[3] = planesPerpendicularToZ;
309 gMC->Gsvolu("C3CI", "PGON", idtmed[1134], barrel, 10);
310 gMC->Gspos("C3CI", 1 , "CRT", 0., -30., 0., 0, "ONLY");
312 // And a detector layer in the door 10 cm thick
313 // Volume for tracking.
322 barrel[8] = barrel[5];
323 barrel[9] = barrel[6];
324 gMC->Gsvolu("C3C2", "PGON", idtmed[1154], barrel, 10); // Air
325 gMC->Gspos("C3C2", 1, "CRT", 0., -30., 0., 0, "ONLY");
326 AliMatrix(idrotm[1010], 90., 0., 90., 90., 180., 0.);
327 gMC->Gspos("C3C2", 2, "CRT", 0., -30., 0., idrotm[1010], "ONLY");
335 barrel[8] = barrel[5];
336 barrel[9] = barrel[6];
337 gMC->Gsvolu("C3DO", "PGON", idtmed[1174], barrel, 10); // Air
338 gMC->Gspos("C3DO", 1, "CRT", 0., -30., 0., 0, "ONLY");
339 AliMatrix(idrotm[1010], 90., 0., 90., 90., 180., 0.);
340 gMC->Gspos("C3DO", 2, "CRT", 0., -30., 0., idrotm[1010], "ONLY");
346 barrel[8] = barrel[5];
347 barrel[9] = barrel[6];
348 gMC->Gsvolu("C3FR", "PGON", idtmed[1149], barrel, 10); // Iron
349 gMC->Gspos("C3FR", 1, "C3DO", 0., 0., 0., 0, "ONLY");
354 gMC->Gsvolu("C3IR", "PGON", idtmed[1149], barrel, 10); //Iron
355 gMC->Gspos("C3IR", 1, "C3DO", 0., 0., 0., 0, "ONLY");
359 //_____________________________________________________________________________
360 void AliCRTv1::CreateTPCGeometry()
362 cout<<"\n\n\tYou are requiring the CRT with the TPC Activated!\n\n";
363 Int_t * idtmed = fIdtmed->GetArray() - 1099 ;
365 // Disable the CRT StepManager method.
367 // Disable the MAgnet
368 fMagnetStatus = kFALSE;
370 fRICHStatus = kFALSE;
373 // Tpc SAndwich 1 - Al
381 gMC->Gsvolu("CSA1","TUBS",idtmed[1154],tube,5);
382 // TSA1->TOCV (0.,0.,3.) ->TOIN (0.,0.,0.)->TPC (0.,0.,0.)->ALIC(0.,0.,0.)
383 gMC->Gspos("CSA1 ",1,"CRT",0.,0.,0.,0,"ONLY");
387 //_____________________________________________________________________________
388 void AliCRTv1::CreateRICHGeometry()
391 cout<<"\n\n\tYou are requiring the CRT with the RICH Activated!\n\n";
393 Int_t idrotm[2499]; // The rotation matrix.
395 Int_t * idtmed = fIdtmed->GetArray() - 1099 ;
397 // Disable the CRT StepManager method.
399 // Disable the MAgnet
400 fMagnetStatus = kFALSE;
403 // now create volume to simulate the HMPID volume. CSI
404 Float_t csi_length = 160*.8 + 2.6;
405 Float_t csi_width = 144*.84 + 2*2.6;
407 tbox[0] = csi_width/2;
409 tbox[2] = csi_length/2;
410 gMC->Gsvolu("CRIC ", "BOX ", idtmed[1174], tbox, 3);
412 Double_t dOffset = 490+1.267 - 8/2; // distance from center of mother volume ALIC to methane
414 Double_t dAlpha = 19.5; // angle between centers of chambers - y-z plane
415 Double_t dAlphaRad = dAlpha*kDegrad;
417 Double_t dBeta = 20.; // angle between center of chambers - y-x plane
418 Double_t dBetaRad = dBeta*kDegrad;
420 Double_t dRotAngle = 60.; // the whole RICH is to be rotated in x-y plane + means clockwise rotation
421 Double_t dRotAngleRad = dRotAngle*kDegrad;
424 TRotMatrix *pRotMatrix; // tmp pointer
426 TVector3 vector(0,dOffset,0); // Position of chamber 2 without rotation
428 // Chamber 0 standalone (no other chambers in this row)
429 AliMatrix(idrotm[1000],90, -dRotAngle+360,90-dAlpha, 90-dRotAngle, dAlpha, -90+300);
430 pRotMatrix=new TRotMatrix("rot993","rot993",90,-dRotAngle, 90-dAlpha,90-dRotAngle,dAlpha, -90);
432 vector.SetXYZ(0,dOffset,0); vector.RotateX(dAlphaRad);
433 vector.RotateZ(-dRotAngleRad);
435 gMC->Gspos("CRIC",1,"CRT",vector.X(),vector.Y(),vector.Z(),idrotm[1000], "ONLY");
438 AliMatrix(idrotm[1001],90,-dBeta-dRotAngle,90,90-dBeta-dRotAngle, 0,0);
440 pRotMatrix=new TRotMatrix("rot994","rot994",90,-dBeta-dRotAngle,90,90-dBeta-dRotAngle,0,0);
442 vector.SetXYZ(0,dOffset,0); vector.RotateZ(-dBetaRad);
443 vector.RotateZ(-dRotAngleRad);
445 gMC->Gspos("CRIC",2,"CRT",vector.X(),vector.Y(),vector.Z(),idrotm[1001], "ONLY");
447 // Chamber 2 the top one with no Alpha-Beta rotation
448 AliMatrix(idrotm[1002],90,-dRotAngle,90,90-dRotAngle,0,0);
450 pRotMatrix=new TRotMatrix("rot995","rot995",90,-dRotAngle,90,90-dRotAngle,0,0);
452 vector.SetXYZ(0,dOffset,0);
453 vector.RotateZ(-dRotAngleRad);
455 gMC->Gspos("CRIC",3,"CRT",vector.X(),vector.Y(),vector.Z(),idrotm[1002], "ONLY");
458 AliMatrix(idrotm[1003],90,dBeta-dRotAngle,90.,90+dBeta-dRotAngle,0,0);
459 pRotMatrix=new TRotMatrix("rot996","rot996", 90,dBeta-dRotAngle,90.,90+dBeta-dRotAngle,0,0);
461 vector.SetXYZ(0,dOffset,0); vector.RotateZ(dBetaRad);
462 vector.RotateZ(-dRotAngleRad);
464 gMC->Gspos("CRIC",4,"CRT",vector.X(),vector.Y(),vector.Z(),idrotm[1003], "ONLY");
467 AliMatrix(idrotm[1004],90,360-dBeta-dRotAngle,108.2,90-dBeta-dRotAngle,18.2,90-dBeta-60);
468 pRotMatrix=new TRotMatrix("rot997","rot997",90,360-dBeta-dRotAngle,108.2,90-dBeta-dRotAngle,18.2,90-dBeta);
470 vector.SetXYZ(0,dOffset,0); vector.RotateZ(-dBetaRad); vector.RotateX(-dAlphaRad);
471 vector.RotateZ(-dRotAngleRad);
473 gMC->Gspos("CRIC",5,"CRT",vector.X(),vector.Y(),vector.Z(),idrotm[1004], "ONLY");
476 AliMatrix(idrotm[1005],90,-dRotAngle+360,90+dAlpha,90-dRotAngle,dAlpha,90-60);
478 pRotMatrix=new TRotMatrix("rot998","rot998",90,-dRotAngle,90+dAlpha,90-dRotAngle,dAlpha,90);
480 vector.SetXYZ(0,dOffset,0); vector.RotateX(-dAlphaRad);
481 vector.RotateZ(-dRotAngleRad);
483 gMC->Gspos("CRIC",6,"CRT",vector.X(),vector.Y(),vector.Z(),idrotm[1005], "ONLY");
486 AliMatrix(idrotm[1006],90,dBeta-dRotAngle+360,108.2,90+dBeta-dRotAngle,18.2,90+dBeta-60);
488 pRotMatrix=new TRotMatrix("rot999","rot999",90,dBeta-dRotAngle,108.2,90+dBeta-dRotAngle,18.2,90+dBeta);
490 vector.SetXYZ(0,dOffset,0); vector.RotateZ(dBetaRad); vector.RotateX(-dAlphaRad);
491 vector.RotateZ(-dRotAngleRad);
493 gMC->Gspos("CRIC",7,"CRT",vector.X(),vector.Y(),vector.Z(),idrotm[1006], "ONLY");
497 //_____________________________________________________________________________
498 void AliCRTv1::CreateMolasse()
504 Int_t idrotm[2499]; // The rotation matrix.
506 Int_t * idtmed = fIdtmed->GetArray() - 1099 ;
512 // Exactly above the hall
515 tspar[1] = 1170. + 375.;
516 tspar[2] = (1900.+1150.)/2.+100.;
519 gMC->Gsvolu("CMO1", "TUBS", idtmed[1123], tspar, 5);
520 gMC->Gspos("CMO1", 1, "CRT", 0., 500., 1900.-tspar[2]+400., 0, "MANY");
524 tbox[1] = (4420. - 1670.)/2.;
525 tbox[2] = (1900.+1150.)/2. + 200.;
526 gMC->Gsvolu("CM12", "BOX", idtmed[1123], tbox, 3);
527 gMC->Gspos("CM12", 1, "CRT", 0., 4420. -tbox[1], 1900.-tbox[2]+400., 0, "MANY");
529 AliMatrix(idrotm[2003], 0., 0., 90., 0., 90., 90.);
532 tube[0] = 455. + 100.;
533 tube[1] = 555. + 375.;
534 tube[2] = (5150. - 1166.)/2.;
535 gMC->Gsvolu("CMO2", "TUBE", idtmed[1123], tube, 3);
536 gMC->Gspos("CMO2", 1, "CRT", -2100., 4420.-tube[2], 0., idrotm[2003], "MANY");
542 tube[2] = (5150. - 690.)/2.;
543 gMC->Gsvolu("CMO3", "TUBE", idtmed[1123], tube, 3);
544 gMC->Gspos("CMO3", 1, "CRT", 375., 4420.-tube[2], 1900.+2987.7, idrotm[2003], "MANY");
545 // Behind the PGC2 up to the end of the M. volume.
547 tbox[1] = 2575. + 95.;
548 tbox[2] = (12073. - 1900.-2987.7-650.)/2.;
549 gMC->Gsvolu("CMO7", "BOX", idtmed[1123], tbox, 3);
550 gMC->Gspos("CMO7", 1, "CRT", 0., 4420.-tbox[1], 1900.+2987.7+650.+tbox[2], 0, "MANY");
552 // Along the PX24 , upper part.
555 tube[2] = 2575. - 1300. + 95.;
556 gMC->Gsvolu("CMO4", "TUBE", idtmed[1123], tube, 3);
557 gMC->Gspos("CMO4", 1, "CRT", 0., 404.+1300.+tube[2], -2300., idrotm[2003], "MANY");
559 // Along the PX24 , lower part
563 tspar[3] = kRaddeg*TMath::ASin(1070./1150.);
564 tspar[4] = 360. - tspar[3];
565 gMC->Gsvolu("CMO5", "TUBS", idtmed[1123], tspar, 5);
566 gMC->Gspos("CMO5", 1, "CRT", 0., 404., -2300., idrotm[2003], "MANY");
569 tbox[1] = 2575. + 95.;
571 gMC->Gsvolu("CMO6", "BOX", idtmed[1123], tbox, 3);
572 gMC->Gspos("CMO6", 1, "CRT", 0., 4420.-tbox[1], -3550.-tbox[2], 0, "MANY");
575 // On the right side of th hall
576 tbox[0] = (12073. - 1250.)/2.;
577 tbox[1] = 2575. + 95.;
578 tbox[2] = (8437.7+650.)/2.;
579 gMC->Gsvolu("CMO8", "BOX", idtmed[1123], tbox, 3);
580 gMC->Gspos("CMO8", 1, "CRT", 1250.+tbox[0], 4420.-tbox[1], -3550.+tbox[2], 0, "MANY");
582 // on the left side of the hall, behind
583 tbox[0] = (12073. - 2755.)/2.;
584 tbox[1] = 2575. + 95.;
585 tbox[2] = (8437.7+650.)/2.;
586 gMC->Gsvolu("CMO9", "BOX", idtmed[1123], tbox, 3);
587 gMC->Gspos("CMO9", 1, "CRT", -2755.-tbox[0], 4420.-tbox[1], -3550.+tbox[2], 0, "MANY");
590 // Molasse betwen the PX24 & PM25 on the left side.
591 tbox[0] = (2755. - 1250.)/2.;
592 tbox[1] = 2575. + 95.;
593 tbox[2] = (3550. - 555.)/2.;
594 gMC->Gsvolu("CM10", "BOX", idtmed[1123], tbox, 3);
595 gMC->Gspos("CM10", 1, "CRT", -1250.-tbox[0], 4420.-tbox[1], -tbox[2]-555., 0, "MANY");
598 // Molasse betwen the PGC2 & PM25 on the left side.
599 tbox[0] = (2755. - 1250.)/2.;
600 tbox[1] = 2575. + 95.;
601 tbox[2] = (1900.+2987.7 - 555. + 650.)/2.;
602 gMC->Gsvolu("CM11", "BOX", idtmed[1123], tbox, 3);
603 gMC->Gspos("CM11", 1, "CRT", -1250.-tbox[0], 4420.-tbox[1], 555.+tbox[2], 0, "MANY");
608 //_____________________________________________________________________________
609 void AliCRTv1::CreateShafts()
614 Int_t idrotm[2499]; // The rotation matrix.
616 Int_t * idtmed = fIdtmed->GetArray() - 1099 ;
618 // Create a mother volume.
620 //pbox[0] = AliCRTConstants::fgDepth*TMath::Tan(67.5*kDegrad);
622 pbox[1] = AliCRTConstants::fgDepth;
624 gMC->Gsvolu("CRT", "BOX", idtmed[1114], pbox, 3);
625 gMC->Gspos("CRT", 1, "ALIC", 0., 0., 0., 0, "ONLY");
634 gMC->Gsvolu("CHC1", "TUBS", idtmed[1116], ptubs, 5);
635 gMC->Gspos("CHC1", 1, "CRT", 0., 500., 0., 0, "ONLY");
641 AliMatrix(idrotm[2001], 0., 0., 90., 0., 90., 90.);
647 ptubs[3] = kRaddeg*TMath::ASin(1070./ptubs[0]);
648 ptubs[4] = 360 - ptubs[3];
649 gMC->Gsvolu("CSF1", "TUBS", idtmed[1116], ptubs, 5);
650 gMC->Gspos("CSF1", 1, "CRT", 0., 404., -2300., idrotm[2001], "MANY");
655 ptube[2] = 2575. - ptubs[2] + 95.;
656 gMC->Gsvolu("CSF2", "TUBE", idtmed[1116], ptube, 3);
657 gMC->Gspos("CSF2", 1, "CRT", 0., 404.+ptubs[2]+ptube[2], -2300., idrotm[2001], "MANY");
659 // Concrete walls along the shaft
661 pbox[1] = 2575. + 95.;
663 gMC->Gsvolu("CSW1", "BOX", idtmed[1116], pbox, 3);
664 gMC->Gspos("CSW1", 1, "CRT", -290-pbox[0], 404.-1300.+pbox[1], -3450.+210.*2, 0, "MANY");
668 pbox[1] = 2575. + 95.;
670 gMC->Gsvolu("CSW3", "BOX", idtmed[1116], pbox, 3);
671 gMC->Gspos("CSW3", 1, "CRT", 420.-290.+pbox[0], 404.-1300.+pbox[1], -3450.+210.*2, 0, "MANY");
675 pbox[1] = 2575. + 95.;
677 gMC->Gsvolu("CSW2", "BOX", idtmed[1116], pbox, 3);
678 gMC->Gspos("CSW2", 1, "CRT", -290-pbox[0], 404.-1300.+pbox[1], -3450.+pbox[2], 0, "MANY");
679 gMC->Gspos("CSW2", 2, "CRT", 420.-290.+pbox[0], 404.-1300.+pbox[1], -3450.+pbox[2], 0, "MANY");
686 gMC->Gsvolu("CSP1", "BOX", idtmed[1116], pbox, 3);
687 gMC->Gspos("CSP1", 1, "CRT", 0., 2600.-700., -1150-pbox[2], 0, "MANY");
693 gMC->Gsvolu("CSP2", "BOX", idtmed[1116], pbox, 3);
694 gMC->Gspos("CSP2", 1, "CRT", 0., 2950.-700., -3450+pbox[2], 0, "MANY");
700 gMC->Gsvolu("CSP3", "BOX", idtmed[1116], pbox, 3);
701 gMC->Gspos("CSP3", 1, "CRT", 0., 2950.-700., -1150.-210.-pbox[2], 0, "MANY");
707 gMC->Gsvolu("CSP4", "BOX", idtmed[1116], pbox, 3);
708 gMC->Gspos("CSP4", 1, "CRT", 0., 2950.-700.+155.+pbox[1], -1150.-210.-pbox[2], 0, "MANY");
715 gMC->Gsvolu("CSP5", "BOX", idtmed[1116], pbox, 3);
716 gMC->Gspos("CSP5", 1, "CRT", 0., 2950.-700., -3450.+460.+pbox[2], 0, "MANY");
722 gMC->Gsvolu("CSP6", "BOX", idtmed[1116], pbox, 3);
723 gMC->Gspos("CSP6", 1, "CRT", 1150.-600., 2950.-700., -3450.+460.+pbox[2], 0, "MANY");
724 gMC->Gspos("CSP6", 2, "CRT", -1150.+600., 2950.-700., -3450.+460.+pbox[2], 0, "MANY");
731 gMC->Gsvolu("CSP7", "BOX", idtmed[1116], pbox, 3);
732 gMC->Gspos("CSP7", 1, "CRT", 850.+pbox[0], 2950.-700.+100., -3450.+460.+pbox[2], 0, "MANY");
733 gMC->Gspos("CSP7", 2, "CRT", -850.-pbox[0], 2950.-700.+100., -3450.+460.+pbox[2], 0, "MANY");
738 ptube[1] = ptube[0] + 100.;
739 ptube[2] = (5150. - 1166.)/2.;
740 gMC->Gsvolu("CSF3", "TUBE", idtmed[1116], ptube, 3);
741 gMC->Gspos("CSF3", 1, "CRT", -2100., AliCRTConstants::fgDepth-ptube[2], 0., idrotm[2001], "MANY");
745 ptube[1] = ptube[0] + 100.;
746 ptube[2] = (5150. - 690.)/2.;
747 gMC->Gsvolu("CSF4", "TUBE", idtmed[1116], ptube, 3);
748 gMC->Gspos("CSF4", 1, "CRT", 375., AliCRTConstants::fgDepth-ptube[2], 1900.+2987.7, idrotm[2001], "MANY");
752 //_____________________________________________________________________________
753 void AliCRTv1::DrawDetector()
756 // Draw a shaded view of the L3 magnet
758 cout << "AliCRTv1::DrawModule() : Drawing the module" << endl;
763 gMC->Gsatt("*", "seen", -1);
764 gMC->Gsatt("alic", "seen", 0);
766 gMC->Gsatt("ALIC","seen",enable);
767 gMC->Gsatt("CRT", "seen",enable);
768 gMC->Gsatt("L3MO","seen", able); // L3 Magnet
769 //gMC->Gsatt("CRT1","seen", able); // Scintillators
770 gMC->Gsatt("CRT4","seen", able); // Scintillators barrel
772 // Draw the molasse volumes
773 gMC->Gsatt("CMO1","seen",enable); // Exactly above the HALL
774 gMC->Gsatt("CMO2","seen",enable); // Molasse, along the PM25
775 gMC->Gsatt("CMO3","seen",enable); // molasse along the PGC2
776 gMC->Gsatt("CMO4","seen",enable); // Molasse, behind the PX24 upper part
777 gMC->Gsatt("CMO5","seen",enable); // molasse behind px24, lower part
778 gMC->Gsatt("CMO6","seen",enable); // behind the PX24
779 gMC->Gsatt("CMO7","seen",enable); // behind the PGC2
780 gMC->Gsatt("CMO8","seen",enable); // on the right side.
781 gMC->Gsatt("CMO9","seen",enable); // on the left side.
782 gMC->Gsatt("CM10","seen",enable); // betwen PX24 & PM25.
783 gMC->Gsatt("CM11","seen",enable); // betwen PGC2 & PM25.
784 gMC->Gsatt("CM12","seen",enable); // box above the hall.
786 gMC->Gdopt("hide", "on");
787 gMC->Gdopt("edge","off");
788 gMC->Gdopt("shad", "on");
789 gMC->Gsatt("*", "fill", 7);
790 gMC->SetClipBox("ALIC", 0, 3000, -3000, 3000, -6000, 6000);
792 gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .009, .009);
793 gMC->Gdhead(1111, "View of CRT(ACORDE)");
794 gMC->Gdman(18, 4, "MAN");
799 //_____________________________________________________________________________
800 void AliCRTv1::Init()
803 // Initialise L3 magnet after it has been built
807 printf("\n%s: ",ClassName());
808 for(i=0;i<35;i++) printf("*");
809 printf(" CRTv1_INIT ");
810 for(i=0;i<35;i++) printf("*");
811 printf("\n%s: ",ClassName());
813 // Here the CRTv1 initialisation code (if any!)
814 for(i=0;i<80;i++) printf("*");
820 //____________________________________________________________________________
821 void AliCRTv1::StepManager()
824 // Called for every step in the Cosmic Ray Trigger
831 static Float_t hits[14];
832 static Float_t eloss;
833 static Float_t elossMag;
835 if ( !gMC->IsTrackAlive() ) return;
837 if (gMC->IsNewTrack()) {
838 // Reset the deposited energy
843 // Add th energy loss in each step.
844 eloss += gMC->Edep();
846 gMC->TrackPosition(pos);
852 if ( gMC->IsTrackEntering() && (strcmp(gMC->CurrentVolName(),"CRT4") == 0)
853 &&(gMC->TrackPid() == kMuonMinus || gMC->TrackPid() == kMuonPlus) ) {
855 // Get current particle id(ipart),track position (pos) and momentum (mom)
856 gMC->TrackPosition(pos);
857 gMC->TrackMomentum(mom);
858 ipart = gMC->TrackPid();
866 ipart = gMC->TrackPid();
867 hits[0] = (Float_t)ipart; // (fId)
869 hits[1] = pos[0]; // X coordinate (fX)
870 hits[2] = pos[1]; // Y coordinate (fY)
871 hits[3] = pos[2]; // Z coordinate (fZ)
872 hits[4] = mom[0]; // Px (fpxug)
873 hits[5] = mom[1]; // Py (fpyug)
874 hits[6] = mom[2]; // Pz (fpzug)
876 hits[7] = gMC->GetMedium(); //layer(flay)
877 hits[8] = eloss; // Energy loss
879 hits[9] = 1; // CRT mother activated.
885 //hits[9] = gAlice->CurrentTrack();
887 AddHit(gAlice->CurrentTrack(),vol, hits);
891 } else if (gMC->IsTrackEntering()&&(strcmp(gMC->CurrentVolName(),"CRT1")==0)
892 &&(gMC->TrackPid()==kMuonMinus || gMC->TrackPid()==kMuonPlus)) {
900 hits[9] = 0; // CRT mother activated.
908 //AddHit(gAlice->CurrentTrack(),vol, hits);
913 } else if (gMC->IsTrackEntering()&&(strcmp(gMC->CurrentVolName(),"C3CI")==0)
914 &&(gMC->TrackPid()==kMuonMinus || gMC->TrackPid()==kMuonPlus)) {
917 // Inside the magnet, upper part.
920 // Get current particle id(ipart),track position (pos) and momentum (mom)
928 hits[9] = 0; // CRT mother activated.
934 AddHit(gAlice->CurrentTrack(),vol, hits);
938 } else if ( gMC->IsTrackEntering()&&(strcmp(gMC->CurrentVolName(),"CRIC")==0)
939 && (gMC->TrackPid()==kMuonMinus || gMC->TrackPid()==kMuonPlus) ) {
945 // Get current particle id(ipart),track position (pos) and momentum (mom)
959 AddHit(gAlice->CurrentTrack(),vol, hits);
964 } else if (gMC->IsTrackEntering()&&(strcmp(gMC->CurrentVolName(),"CSA1")==0)
965 &&(gMC->TrackPid()==kMuonMinus || gMC->TrackPid()==kMuonPlus)) {
971 // Get current particle id(ipart),track position (pos) and momentum (mom)
986 AddHit(gAlice->CurrentTrack(),vol, hits);