]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONv0.cxx
Using TGeo as default transport package
[u/mrichter/AliRoot.git] / MUON / AliMUONv0.cxx
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
16 /* $Id$ */
17
18 /////////////////////////////////////////////////////////
19 //  Manager and hits classes for set:MUON version 0    //
20 /////////////////////////////////////////////////////////
21
22 #include <TLorentzVector.h> 
23 #include <TVirtualMC.h>
24
25 #include "AliConst.h" 
26 #include "AliMUONChamber.h"
27 #include "AliMUONGeometryModule.h"
28 #include "AliMUONConstants.h"
29 #include "AliMUONFactory.h"
30 #include "AliMUONHit.h"
31 #include "AliMUONv0.h"
32 #include "AliMagF.h"
33 #include "AliRun.h"
34 #include "AliMC.h"
35 #include "AliLog.h"
36
37 ClassImp(AliMUONv0)
38  
39 //___________________________________________
40 AliMUONv0::AliMUONv0() 
41   : AliMUON()
42 {
43 // Constructor
44     fChambers = 0;
45 }
46  
47 //___________________________________________
48 AliMUONv0::AliMUONv0(const char *name, const char *title)
49   : AliMUON(name,title)
50 {
51 // Constructor
52     AliMUONFactory factory;
53     factory.Build(this, title);
54 }
55
56 //___________________________________________
57 void AliMUONv0::CreateGeometry()
58 {
59 // Creates coarse geometry for hit density simulations
60     Int_t *idtmed = fIdtmed->GetArray()-1099;
61 //
62      Float_t zpos, dAlu, tpar[3];
63      Int_t idAir=idtmed[1100];
64      Int_t idAlu=idtmed[1103];     
65
66      AliMUONChamber *iChamber;
67      // Loop over all chambers (tracking and trigger)
68      for (Int_t ch = 0; ch < AliMUONConstants::NCh(); ch++) {
69          char alu[8];
70          char gas[8];
71      
72          iChamber=(AliMUONChamber*) (*fChambers)[ch];
73          // Z of the chamber
74          zpos=iChamber->Z(); 
75          dAlu=iChamber->DAlu();
76          if (ch < AliMUONConstants::NTrackingCh()) {
77            // tracking chambers
78              sprintf(alu,"SA0%1d",ch);
79              sprintf(gas,"SG0%1d",ch);   
80          } else {
81            // trigger chambers
82              sprintf(alu,"SA%2d",ch);
83              sprintf(gas,"SG%2d",ch);    
84          }
85 //
86          tpar[0] = iChamber->RInner(); 
87          tpar[1] = iChamber->ROuter();
88          tpar[2] = (dAlu+0.2)/2.;
89          if (ch !=4 && ch !=5) {
90              gMC->Gsvolu(alu, "TUBE", idAlu, tpar, 3);
91              tpar[2] = 0.1;
92              gMC->Gsvolu(gas, "TUBE", idAir, tpar, 3);
93          } else {
94              gMC->Gsvolu(alu, "TUBE", idAlu, tpar, 3);
95              tpar[2] = 0.1;
96              gMC->Gsvolu(gas, "TUBE", idAir, tpar, 3);
97          }
98          gMC->Gspos(gas, 1, alu,  0., 0., 0., 0, "ONLY");
99          if (ch == 4 || ch ==5) {
100              if (gMC->VolId("DDIP")) {
101                  gMC->Gspos(alu, 1, "DDIP", 0., 0., zpos, 0, "ONLY");
102              } else {
103                  gMC->Gspos(alu, 1, "ALIC", 0., 0., zpos, 0, "ONLY");
104              }
105          } else {
106              gMC->Gspos(alu, 1, "ALIC", 0., 0., zpos, 0, "ONLY");
107          }
108      }
109 }
110
111 //___________________________________________
112 void AliMUONv0::CreateMaterials()
113 {
114 // Creates materials for coarse geometry
115 // Air
116   Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
117   Float_t zAir[4]={6.,7.,8.,18.};
118   Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
119   Float_t dAir = 1.20479E-3;
120   AliMixture(15, "AIR$      ", aAir,  zAir, dAir,4, wAir);
121   //  AliMaterial(15, "AIR$      ", 14.61,  7.3, .001205, 30423.24, 67500);
122   AliMaterial( 9, "ALUMINIUM$", 26.98, 13. , 2.7, 8.9, 37.2);
123
124   Float_t epsil  = .001; // Tracking precision, 
125   Float_t stemax = -1.;  // Maximum displacement for multiple scat 
126   Float_t tmaxfd = -20.; // Maximum angle due to field deflection 
127   Float_t deemax = -.3;  // Maximum fractional energy loss, DLS 
128   Float_t stmin  = -.8;
129   Int_t isxfld   = gAlice->Field()->Integ();
130   Float_t sxmgmx = gAlice->Field()->Max();
131   
132   //
133   //    Air 
134   AliMedium(1, "AIR_CH_US         ", 15, 1, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
135   AliMedium(4, "ALU_CH_US         ",  9, 0, isxfld, sxmgmx, tmaxfd, fMaxStepAlu, 
136             fMaxDestepAlu, epsil, stmin);
137   
138 }
139
140 void AliMUONv0::Init()
141 {
142    // 
143    // Initialize Tracking Chambers
144    //
145     char vName[8];
146     AliInfo("\n\n\n Start Init for version 0 - CPC chamber type\n\n\n");
147     for (Int_t i=0; i<AliMUONConstants::NCh(); i++) {
148 // Initialise chamber
149         ((AliMUONChamber*) (*fChambers)[i])->Init();
150 // Set sensitive volume Id
151         if (i < AliMUONConstants::NTrackingCh()) {
152             // tracking chambers
153             sprintf(vName,"SG0%1d",i);   
154         } else {
155             // trigger chambers
156             sprintf(vName,"SG%2d",i);    
157         }
158         //((AliMUONChamber*) (*fChambers)[i])->SetGid(gMC->VolId(vName));
159         ((AliMUONChamber*) (*fChambers)[i])
160            ->GetGeometry()->SetSensitiveVolume(gMC->VolId(vName));
161     }
162 }
163
164
165
166
167
168
169
170
171