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 /////////////////////////////////////////////////////////
19 // Manager and hits classes for set:MUON version 0 //
20 /////////////////////////////////////////////////////////
22 #include <TLorentzVector.h>
23 #include <TVirtualMC.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"
39 //___________________________________________
40 AliMUONv0::AliMUONv0()
47 //___________________________________________
48 AliMUONv0::AliMUONv0(const char *name, const char *title)
52 AliMUONFactory factory;
53 factory.Build(this, title);
56 //___________________________________________
57 void AliMUONv0::CreateGeometry()
59 // Creates coarse geometry for hit density simulations
60 Int_t *idtmed = fIdtmed->GetArray()-1099;
62 Float_t zpos, dAlu, tpar[3];
63 Int_t idAir=idtmed[1100];
64 Int_t idAlu=idtmed[1103];
66 AliMUONChamber *iChamber;
67 // Loop over all chambers (tracking and trigger)
68 for (Int_t ch = 0; ch < AliMUONConstants::NCh(); ch++) {
72 iChamber=(AliMUONChamber*) (*fChambers)[ch];
75 dAlu=iChamber->DAlu();
76 if (ch < AliMUONConstants::NTrackingCh()) {
78 sprintf(alu,"SA0%1d",ch);
79 sprintf(gas,"SG0%1d",ch);
82 sprintf(alu,"SA%2d",ch);
83 sprintf(gas,"SG%2d",ch);
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);
92 gMC->Gsvolu(gas, "TUBE", idAir, tpar, 3);
94 gMC->Gsvolu(alu, "TUBE", idAlu, tpar, 3);
96 gMC->Gsvolu(gas, "TUBE", idAir, tpar, 3);
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");
103 gMC->Gspos(alu, 1, "ALIC", 0., 0., zpos, 0, "ONLY");
106 gMC->Gspos(alu, 1, "ALIC", 0., 0., zpos, 0, "ONLY");
111 //___________________________________________
112 void AliMUONv0::CreateMaterials()
114 // Creates materials for coarse geometry
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);
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
129 Int_t isxfld = gAlice->Field()->Integ();
130 Float_t sxmgmx = gAlice->Field()->Max();
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);
140 void AliMUONv0::Init()
143 // Initialize Tracking Chambers
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()) {
153 sprintf(vName,"SG0%1d",i);
156 sprintf(vName,"SG%2d",i);
158 //((AliMUONChamber*) (*fChambers)[i])->SetGid(gMC->VolId(vName));
159 ((AliMUONChamber*) (*fChambers)[i])
160 ->GetGeometry()->SetSensitiveVolume(gMC->VolId(vName));