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 // START ( T-zero) detector version 0 //
24 <img src="gif/AliSTARTv2Class.gif">
29 //////////////////////////////////////////////////////////////////////
34 #include <Riostream.h>
37 #include <TGeometry.h>
38 #include <TLorentzVector.h>
42 #include <TVirtualMC.h>
46 #include "AliSTARThit.h"
47 #include "AliSTARTv2.h"
49 //#include "AliSTARThitPhoton.h"
50 //#include "TGeant3.h"
55 //////////////////////////////////////////////////////////////////////
56 // Standart constructor for START Detector version 2
57 //////////////////////////////////////////////////////////////////////
58 AliSTARTv2::AliSTARTv2(const char *name, const char *title):
62 // setBufferSize(128000);
66 //////////////////////////////////////////////////////////////////////
67 // Create the geometry of START Detector version 2
68 //////////////////////////////////////////////////////////////////////
69 void AliSTARTv2::CreateGeometry()
72 <img src="gif/AliSTARTv2.gif">
85 Float_t pstart[3] = {4.5, 10.7, 5.3};
86 Float_t pinstart[3] = {0., 1.31, 5.25};
87 Float_t ppmt[3] = {0., 1.31, 3.5};
88 Float_t ptop[3] = {0., 1.3, 1.5};
89 // Float_t preg[3] = {0., 1.3, 0.005};
90 Float_t preg[3] = {0., 0.875, 0.005};
91 Float_t pdes[3] = {0.875, 1.3, 0.005};
96 theta = (180 / TMath::Pi()) * TMath::ATan(6.5 / zRight);
97 angel = 2 * TMath::Pi() / 12;
98 idtmed = fIdtmed->GetArray();
101 AliMatrix (idrotm[901], 90., 0., 90., 90., 180., 0.);
103 gMC->Gsvolu ("0RST", "TUBE", idtmed[3], pstart, 3);
104 gMC->Gsvolu ("0LST", "TUBE", idtmed[3], pstart, 3);
105 gMC->Gspos ("0RST", 1, "ALIC", 0., 0., -zRight, 0, "ONLY");
106 gMC->Gspos ("0LST", 1, "ALIC", 0., 0., zLeft, idrotm[901], "ONLY");
108 // 12 unit: PMT + divider
109 gMC->Gsvolu("0INS", "TUBE", idtmed[3], pinstart, 3);
111 for (i = 0; i < 12; i++)
113 x = 6.5 * TMath::Sin(i * angel);
114 y = 6.5 * TMath::Cos(i * angel);
117 phi[1] = 90 - i * 30;
118 phi[2] = 90 - i * 30;
119 for (j = 0; j < 3; j++)
120 if (phi[j] < 0) phi[j] += 360;
122 AliMatrix (idrotm[902 + i], 90., phi[0],
126 gMC->Gspos ("0INS", i + 1, "0RST", x, y, z, idrotm[902 + i], "ONLY");
127 gMC->Gspos ("0INS", i + 13, "0LST", x, y, z, 0, "ONLY");
130 gMC->Gsvolu ("0PMT", "TUBE", idtmed[1], ppmt, 3);
132 z = -pinstart[2] + ppmt[2];
133 gMC->Gspos ("0PMT", 1, "0INS", x, y, z, 0, "ONLY");
136 // Entry window (glass)
137 gMC->Gsvolu ("0TOP", "TUBE", idtmed[6], ptop, 3);
138 z = -ppmt[2] + ptop[2];
139 gMC->Gspos ("0TOP", 1, "0PMT", 0, 0, z, 0, "ONLY");
141 gMC->Gsvolu ("0REG", "TUBE", idtmed[6], preg, 3);
142 z = -ppmt[2] + 2 * ptop[2] + preg[2];
143 gMC->Gspos ("0REG", 1, "0PMT", 0, 0, z, 0, "ONLY");
145 gMC->Gsvolu ("0DES", "TUBE", idtmed[6], pdes, 3);
146 z = -ppmt[2] + 2 * ptop[2] + preg[2];
147 gMC->Gspos ("0DES", 1, "0PMT", 0, 0, z, 0, "ONLY");
151 //////////////////////////////////////////////////////////////////////
152 // Definition of avaible START materials
153 //////////////////////////////////////////////////////////////////////
154 void AliSTARTv2::CreateMaterials()
156 Int_t isxfld = gAlice->Field()->Integ();
157 Float_t sxmgmx = gAlice->Field()->Max();
159 Float_t a, z, d, radl, absl, buf[1];
163 Float_t ascin[2] = {1.01, 12.01};
164 Float_t zscin[2] = {1., 6.};
165 Float_t wscin[2] = {1., 1.};
166 Float_t denscin = 1.03;
169 Float_t aglass[2] = {28.0855, 15.9994};
170 Float_t zglass[2] = {14., 8.};
171 Float_t wglass[2] = { 1., 2.};
172 Float_t dglass = 2.65;
174 // Ceramic 97.2% Al2O3 , 2.8% SiO2
175 Float_t acer[2], zcer[2];
176 Float_t wcer[2] = { 0.972, 0.028};
177 Float_t aal2o3[2] = {26.981539, 15.9994 };
178 Float_t zal2o3[2] = {13., 8.};
179 Float_t wal2o3[2] = { 2., 3.};
180 Float_t denscer = 3.6;
182 // Brass 80% Cu, 20% Zn
183 Float_t abrass[2] = {63.546, 65.39};
184 Float_t zbrass[2] = {29., 30.};
185 Float_t wbrass[2] = { 0.8, 0.2};
186 Float_t denbrass = 8.96;
189 Float_t aribber[3] = {12., 1., 32.};
190 Float_t zribber[3] = { 6., 1., 16.};
191 Float_t wribber[3] = { 6., 12., 1.};
192 Float_t denribber = 0.8;
194 // Definition Cherenkov parameters
195 const Int_t NUMENTRIES = 32;
197 Float_t ppckov[NUMENTRIES] =
198 { 2.034E-9, 2.068E-9, 2.103E-9, 2.139E-9,
199 2.177E-9, 2.216E-9, 2.256E-9, 2.298E-9,
200 2.341E-9, 2.386E-9, 2.433E-9, 2.481E-9,
201 2.532E-9, 2.585E-9, 2.640E-9, 2.697E-9,
202 2.757E-9, 2.820E-9, 2.885E-9, 2.954E-9,
203 3.026E-9, 3.102E-9, 3.181E-9, 3.265E-9,
204 3.353E-9, 3.446E-9, 3.545E-9, 3.649E-9,
205 3.760E-9, 3.877E-9, 4.002E-9, 4.136E-9 };
207 Float_t rindex_qwarz[NUMENTRIES] =
208 { 1.458, 1.458, 1.458, 1.458, 1.458, 1.458, 1.458,
209 1.458, 1.458, 1.458, 1.458, 1.458, 1.458, 1.458,
210 1.458, 1.458, 1.458, 1.458, 1.458, 1.458, 1.458,
211 1.458, 1.458, 1.458, 1.458, 1.458, 1.458, 1.458,
212 1.458, 1.458, 1.458, 1.458 };
214 Float_t rindex_air[NUMENTRIES] =
215 { 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
216 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
219 Float_t effic_all[NUMENTRIES] =
220 { 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
221 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
224 Float_t absor_qwarz[NUMENTRIES] =
225 { 2000., 2000., 2000., 2000., 2000., 2000., 2000.,
226 2000., 2000., 2000., 2000., 2000., 2000., 2000.,
227 2000., 2000., 2000., 2000., 2000., 2000., 2000.,
228 2000., 2000., 2000., 2000., 2000., 2000., 2000.,
229 2000., 2000., 2000., 2000. };
231 Float_t absor_air[NUMENTRIES] =
232 { 200., 200., 200., 200., 200., 200., 200.,
233 200., 200., 200., 200., 200., 200., 200.,
234 200., 200., 200., 200., 200., 200., 200.,
235 200., 200., 200., 200., 200., 200., 200.,
236 200., 200., 200., 200. };
238 Int_t *idtmed = fIdtmed->GetArray();
241 AliMaterial (0, "START Steel$", 55.850, 26., 7.87, 1.76, 999);
242 AliMaterial (1, "START Vacuum$", 1.e-16, 1.e-16, 1.e-16, 1.e16, 999);
243 AliMaterial (2, "START Air$", 14.61, 7.3, .001205, 30423., 999);
245 AliMixture (3, "Al2O3 $", aal2o3, zal2o3, denscer, -2, wal2o3);
246 AliMixture (4, "PMT glass $", aglass, zglass, dglass, -2, wglass);
248 gMC->Gfmate ((*fIdmate)[3], namate, a, z, d, radl, absl, buf, nbuf);
251 gMC->Gfmate ((*fIdmate)[4], namate, a, z, d, radl, absl, buf, nbuf);
255 AliMixture (5, "Scintillator$",ascin,zscin,denscin,-2,wscin);
256 AliMixture (6, "Brass $", abrass, zbrass, denbrass, 2, wbrass);
257 AliMixture (7, "Ribber $",aribber,zribber,denribber,-3,wribber);
258 AliMixture (9, "Ceramic $", acer, zcer, denscer, 2, wcer);
260 AliMedium (1, "START Air$", 2, 0, isxfld, sxmgmx, 10., .1, 1., .003, .003);
261 AliMedium (2, "Scintillator$", 5, 1, isxfld, sxmgmx, 10., .01, 1., .003, .003);
262 AliMedium (3, "Vacuum$", 1, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
263 AliMedium (4, "Ceramic$", 9, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
264 AliMedium (6, "Glass$", 4, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
265 AliMedium (8, "Steel$", 0, 0, isxfld, sxmgmx, 1., .001, 1., .001, .001);
266 AliMedium (9, "Ribber $", 7, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
267 AliMedium(11, "Brass $", 6, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
269 gMC->SetCerenkov (idtmed[6], NUMENTRIES, ppckov, absor_qwarz, effic_all, rindex_qwarz);
270 gMC->SetCerenkov (idtmed[1], NUMENTRIES, ppckov, absor_air, effic_all, rindex_air);
274 //////////////////////////////////////////////////////////////////////
275 // Draw a shaded view of the Forward multiplicity detector version 2
276 //////////////////////////////////////////////////////////////////////
277 void AliSTARTv2::DrawModule() const
279 //Set ALIC mother transparent
280 gMC->Gsatt ("ALIC", "SEEN", 0);
282 //Set volumes visible
283 gMC->Gsatt ("0STA", "SEEN", 0);
284 gMC->Gsatt ("0PMT", "SEEN", 1);
285 gMC->Gsatt ("0DIV", "SEEN", 1);
287 gMC->Gdopt ("hide", "on");
288 gMC->Gdopt ("shad", "on");
289 gMC->SetClipBox (".");
290 gMC->SetClipBox ("*", 0, 1000, -1000, 1000, -1000, 1000);
292 gMC->Gdraw ("alic", 40, 30, 0, 12, 9.5, 0.7, 0.7);
293 gMC->Gdhead (1111, "T-Zero detector");
294 gMC->Gdopt ("hide", "off");
298 //////////////////////////////////////////////////////////////////////
299 // Initialises version 2 of the Forward Multiplicity Detector
300 //////////////////////////////////////////////////////////////////////
301 void AliSTARTv2::Init()
303 //Int_t *idtmed = gAlice->Idtmed();
306 fIdSens1 = gMC->VolId ("0REG");
308 printf ("*** START version 2 initialized ***\n");
312 //////////////////////////////////////////////////////////////////////
313 // Called for every step in the START Detector
314 //////////////////////////////////////////////////////////////////////
315 void AliSTARTv2::StepManager()
322 Float_t hitPhoton[6];
323 static Float_t hits[7];
330 if(!gMC->IsTrackAlive()) return; // particle has disappeared
332 // TGeant3 *g3 = (TGeant3*) gMC;
335 TClonesArray &lhits = *fHits;
338 ///////////////////////////////////////////////
339 // If particles is photon then ...
341 if (gMC->TrackPid() == 50000050)
343 id = gMC->CurrentVolID(copy);
345 // Check the sensetive volume
348 if (gMC->IsTrackEntering())
350 gMC->CurrentVolOffID(2,copy);
353 vol[0] = RIGHT_ARRAY;
362 gMC->TrackPosition(pos);
363 gMC->TrackMomentum(mom);
367 gMC->Gmtod (XYZ, xyz, 1);
369 hitPhoton[0] = sqrt (xyz[0] * xyz[0] + xyz[1] * xyz[1]);
370 hitPhoton[1] = mom[0];
371 hitPhoton[2] = mom[1];
372 hitPhoton[3] = mom[2];
373 hitPhoton[4] = 1e9 * gMC->TrackTime();
374 hitPhoton[5] = 1e9 * gMC->Etot();
376 AddHitPhoton (gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hitPhoton);
381 if (id == gMC->VolId ("0DES")) gMC->StopTrack();
384 // end photon particalary
385 ///////////////////////////////////////////////
388 ///////////////////////////////////////////////
389 // If particles is charge then ...
391 // Float_t charge = gMC->TrackCharge();
392 // if(TMath::Abs(charge) <= 0.) return;
393 id = gMC->CurrentVolID(copy);
396 // printf("gMC->ckine->ipart %d",gMC->ckine->ipart);
397 // Check the sensetive volume
398 if(id==gMC->VolId("0TOP") ) {
399 if(gMC->IsTrackEntering()) {
400 gMC->CurrentVolOffID(2,copy);
403 vol[0] = RIGHT_ARRAY;
412 gMC->TrackPosition(pos);
416 Float_t etot = gMC->Etot();
418 Int_t part = gMC->TrackPid();
420 Float_t ttime = gMC->TrackTime();
424 if(gMC->IsTrackInside()) {
425 Float_t de = gMC->Edep();
427 // printf ("E deposition %f\n",edep);
428 // for (i=0; i<=6; i++){
429 // printf(" HITS on START inside %f\n",hits[i]); }
431 if(gMC->IsTrackExiting()) {
432 Float_t de = gMC->Edep();
434 hits[3] = edep * 1e3;
436 // for (i=0; i<=6; i++){
437 // printf(" HITS on START Exit %f\n",hits[i]); }
438 //for (i=0; i<=1; i++) { printf("START vol %d\n",vol[i]);}
440 new(lhits[fNhits++]) AliSTARThit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
444 // end charge particles particalary
445 ///////////////////////////////////////////////