]>
Commit | Line | Data |
---|---|---|
4c039060 | 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 | ||
88cb7938 | 16 | /* $Id$ */ |
4c039060 | 17 | |
fe4da5cc | 18 | ///////////////////////////////////////////////////////// |
19 | // Manager and hits classes for set:MUON version 0 // | |
20 | ///////////////////////////////////////////////////////// | |
21 | ||
116cbefd | 22 | #include <TLorentzVector.h> |
88cb7938 | 23 | #include <TVirtualMC.h> |
fe4da5cc | 24 | |
fe4da5cc | 25 | #include "AliConst.h" |
88cb7938 | 26 | #include "AliMUONChamber.h" |
d1cd2474 | 27 | #include "AliMUONChamberGeometry.h" |
f665c1ea | 28 | #include "AliMUONConstants.h" |
be3bb6c1 | 29 | #include "AliMUONFactory.h" |
88cb7938 | 30 | #include "AliMUONHit.h" |
88cb7938 | 31 | #include "AliMUONv0.h" |
32 | #include "AliMagF.h" | |
33 | #include "AliRun.h" | |
5d12ce38 | 34 | #include "AliMC.h" |
88cb7938 | 35 | |
fe4da5cc | 36 | ClassImp(AliMUONv0) |
37 | ||
38 | //___________________________________________ | |
30178c30 | 39 | AliMUONv0::AliMUONv0() |
40 | : AliMUON() | |
fe4da5cc | 41 | { |
a9e2aefa | 42 | // Constructor |
fe4da5cc | 43 | fChambers = 0; |
44 | } | |
45 | ||
46 | //___________________________________________ | |
47 | AliMUONv0::AliMUONv0(const char *name, const char *title) | |
30178c30 | 48 | : AliMUON(name,title) |
fe4da5cc | 49 | { |
a9e2aefa | 50 | // Constructor |
ba030c0e | 51 | AliMUONFactory factory; |
52 | factory.Build(this, title); | |
a897a37a | 53 | } |
54 | ||
30178c30 | 55 | //___________________________________________ |
a9e2aefa | 56 | void AliMUONv0::CreateGeometry() |
57 | { | |
58 | // Creates coarse geometry for hit density simulations | |
59 | Int_t *idtmed = fIdtmed->GetArray()-1099; | |
fe4da5cc | 60 | // |
a9e2aefa | 61 | Float_t zpos, dAlu, tpar[3]; |
62 | Int_t idAir=idtmed[1100]; | |
63 | Int_t idAlu=idtmed[1103]; | |
64 | ||
65 | AliMUONChamber *iChamber; | |
66 | // Loop over all chambers (tracking and trigger) | |
f665c1ea | 67 | for (Int_t ch = 0; ch < AliMUONConstants::NCh(); ch++) { |
a9e2aefa | 68 | char alu[8]; |
69 | char gas[8]; | |
70 | ||
71 | iChamber=(AliMUONChamber*) (*fChambers)[ch]; | |
72 | // Z of the chamber | |
73 | zpos=iChamber->Z(); | |
74 | dAlu=iChamber->DAlu(); | |
f665c1ea | 75 | if (ch < AliMUONConstants::NTrackingCh()) { |
a9e2aefa | 76 | // tracking chambers |
b74f1c6a | 77 | sprintf(alu,"SA0%1d",ch); |
78 | sprintf(gas,"SG0%1d",ch); | |
a9e2aefa | 79 | } else { |
80 | // trigger chambers | |
b74f1c6a | 81 | sprintf(alu,"SA%2d",ch); |
82 | sprintf(gas,"SG%2d",ch); | |
a9e2aefa | 83 | } |
84 | // | |
a9e2aefa | 85 | tpar[0] = iChamber->RInner(); |
86 | tpar[1] = iChamber->ROuter(); | |
87 | tpar[2] = (dAlu+0.2)/2.; | |
88 | if (ch !=4 && ch !=5) { | |
89 | gMC->Gsvolu(alu, "TUBE", idAlu, tpar, 3); | |
90 | tpar[2] = 0.1; | |
91 | gMC->Gsvolu(gas, "TUBE", idAir, tpar, 3); | |
92 | } else { | |
93 | gMC->Gsvolu(alu, "TUBE", idAlu, tpar, 3); | |
94 | tpar[2] = 0.1; | |
95 | gMC->Gsvolu(gas, "TUBE", idAir, tpar, 3); | |
96 | } | |
97 | gMC->Gspos(gas, 1, alu, 0., 0., 0., 0, "ONLY"); | |
afa281f0 | 98 | if (ch == 4 || ch ==5) { |
82e22b99 | 99 | if (gMC->VolId("DDIP")) { |
100 | gMC->Gspos(alu, 1, "DDIP", 0., 0., zpos, 0, "ONLY"); | |
101 | } else { | |
102 | gMC->Gspos(alu, 1, "ALIC", 0., 0., zpos, 0, "ONLY"); | |
103 | } | |
afa281f0 | 104 | } else { |
105 | gMC->Gspos(alu, 1, "ALIC", 0., 0., zpos, 0, "ONLY"); | |
106 | } | |
a897a37a | 107 | } |
fe4da5cc | 108 | } |
109 | ||
fe4da5cc | 110 | //___________________________________________ |
111 | void AliMUONv0::CreateMaterials() | |
112 | { | |
a9e2aefa | 113 | // Creates materials for coarse geometry |
97ddb489 | 114 | // Air |
115 | Float_t aAir[4]={12.0107,14.0067,15.9994,39.948}; | |
116 | Float_t zAir[4]={6.,7.,8.,18.}; | |
117 | Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827}; | |
118 | Float_t dAir = 1.20479E-3; | |
119 | AliMixture(15, "AIR$ ", aAir, zAir, dAir,4, wAir); | |
120 | // AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500); | |
121 | AliMaterial( 9, "ALUMINIUM$", 26.98, 13. , 2.7, 8.9, 37.2); | |
fe4da5cc | 122 | |
97ddb489 | 123 | Float_t epsil = .001; // Tracking precision, |
124 | Float_t stemax = -1.; // Maximum displacement for multiple scat | |
125 | Float_t tmaxfd = -20.; // Maximum angle due to field deflection | |
126 | Float_t deemax = -.3; // Maximum fractional energy loss, DLS | |
127 | Float_t stmin = -.8; | |
128 | Int_t isxfld = gAlice->Field()->Integ(); | |
129 | Float_t sxmgmx = gAlice->Field()->Max(); | |
130 | ||
131 | // | |
132 | // Air | |
133 | AliMedium(1, "AIR_CH_US ", 15, 1, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); | |
134 | AliMedium(4, "ALU_CH_US ", 9, 0, isxfld, sxmgmx, tmaxfd, fMaxStepAlu, | |
a897a37a | 135 | fMaxDestepAlu, epsil, stmin); |
97ddb489 | 136 | |
fe4da5cc | 137 | } |
138 | ||
fe4da5cc | 139 | void AliMUONv0::Init() |
140 | { | |
fe4da5cc | 141 | // |
142 | // Initialize Tracking Chambers | |
143 | // | |
b9046b8f | 144 | char vName[8]; |
145 | printf("\n\n\n Start Init for version 0 - CPC chamber type\n\n\n"); | |
146 | for (Int_t i=0; i<AliMUONConstants::NCh(); i++) { | |
147 | // Initialise chamber | |
148 | ((AliMUONChamber*) (*fChambers)[i])->Init(); | |
149 | // Set sensitive volume Id | |
150 | if (i < AliMUONConstants::NTrackingCh()) { | |
151 | // tracking chambers | |
b74f1c6a | 152 | sprintf(vName,"SG0%1d",i); |
b9046b8f | 153 | } else { |
154 | // trigger chambers | |
b74f1c6a | 155 | sprintf(vName,"SG%2d",i); |
b9046b8f | 156 | } |
d1cd2474 | 157 | //((AliMUONChamber*) (*fChambers)[i])->SetGid(gMC->VolId(vName)); |
158 | ((AliMUONChamber*) (*fChambers)[i]) | |
159 | ->GetGeometry()->SetSensitiveVolume(gMC->VolId(vName)); | |
b9046b8f | 160 | } |
fe4da5cc | 161 | } |
162 | ||
fe4da5cc | 163 | void AliMUONv0::StepManager() |
164 | { | |
a9e2aefa | 165 | // |
166 | // Step manager for hit density simulations | |
fe4da5cc | 167 | Int_t copy, id; |
168 | static Int_t idvol; | |
169 | static Int_t vol[2]; | |
170 | Int_t ipart; | |
a897a37a | 171 | TLorentzVector pos; |
172 | TLorentzVector mom; | |
173 | Float_t theta,phi; | |
fe4da5cc | 174 | |
a897a37a | 175 | // modifs perso |
a9e2aefa | 176 | static Float_t hits[15]; |
a897a37a | 177 | |
fe4da5cc | 178 | TClonesArray &lhits = *fHits; |
fe4da5cc | 179 | // |
180 | // Only gas gap inside chamber | |
181 | // Tag chambers and record hits when track enters | |
182 | idvol=-1; | |
0a6d8768 | 183 | id=gMC->CurrentVolID(copy); |
fe4da5cc | 184 | |
f665c1ea | 185 | for (Int_t i=1; i<=AliMUONConstants::NCh(); i++) { |
d1cd2474 | 186 | //if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){ |
187 | if ( ((AliMUONChamber*)(*fChambers)[i-1])->IsSensId(id) ) { | |
fe4da5cc | 188 | vol[0]=i; |
189 | idvol=i-1; | |
190 | } | |
191 | } | |
192 | if (idvol == -1) return; | |
193 | // | |
194 | // Get current particle id (ipart), track position (pos) and momentum (mom) | |
cfce8870 | 195 | gMC->TrackPosition(pos); |
196 | gMC->TrackMomentum(mom); | |
fe4da5cc | 197 | |
cfce8870 | 198 | ipart = gMC->TrackPid(); |
fe4da5cc | 199 | // |
200 | // record hits when track enters ... | |
9fde056a | 201 | if( !(gMC->TrackCharge()) ) return; |
0a6d8768 | 202 | if( gMC->IsTrackEntering()) { |
82e22b99 | 203 | // printf("\n Particle entering %f %f %f", pos[0], pos[1], pos[2] ); |
204 | ||
a897a37a | 205 | Double_t tc = mom[0]*mom[0]+mom[1]*mom[1]; |
206 | Double_t rt = TMath::Sqrt(tc); | |
a897a37a | 207 | theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg; |
208 | phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg; | |
a9e2aefa | 209 | hits[0] = Float_t(ipart); // Geant3 particle type |
210 | hits[1] = pos[0]; // X-position for hit | |
211 | hits[2] = pos[1]; // Y-position for hit | |
212 | hits[3] = pos[2]; // Z-position for hit | |
213 | hits[4] = theta; // theta angle of incidence | |
214 | hits[5] = phi; // phi angle of incidence | |
215 | hits[8] = -1; // first padhit | |
216 | hits[9] = -1; // last pad hit | |
2eb55fab | 217 | hits[10] = mom[3]; // hit Energy |
218 | hits[11] = mom[0]; // Px | |
219 | hits[12] = mom[1]; // Py | |
220 | hits[13] = mom[2]; // Pz | |
221 | hits[14] = gMC->TrackTime(); // time of flight | |
fe4da5cc | 222 | new(lhits[fNhits++]) |
5d12ce38 | 223 | AliMUONHit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits); |
a9e2aefa | 224 | |
fe4da5cc | 225 | } |
82e22b99 | 226 | // if( gMC->IsTrackExiting()) gMC->StopTrack(); |
fe4da5cc | 227 | } |
a9e2aefa | 228 | |
229 | ||
230 | ||
231 | ||
232 | ||
233 | ||
234 | ||
235 | ||
236 |