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 **************************************************************************/
19 /////////////////////////////////////////////////////////////////
20 // Class for the SDD beam test August2004 //
23 /////////////////////////////////////////////////////////////////
25 #include <TGeoGlobalMagField.h>
26 #include <TGeoManager.h>
27 #include <TGeoMatrix.h>
28 #include <TLorentzVector.h>
29 #include <TVirtualMC.h>
34 #include "AliTrackReference.h"
35 #include "AliITShit.h"
36 #include "AliITSgeom.h"
37 #include "AliITSgeomSDD.h"
38 #include "AliITSgeomSSD.h"
39 #include "AliITSDetTypeSim.h"
40 #include "AliITSCalibrationSPD.h"
41 #include "AliITSCalibrationSDD.h"
42 #include "AliITSCalibrationSSD.h"
43 #include "AliITSsegmentationSPD.h"
44 #include "AliITSsegmentationSDD.h"
45 #include "AliITSsegmentationSSD.h"
46 #include "AliITSsimulationSPD.h"
47 #include "AliITSsimulationSDD.h"
48 #include "AliITSsimulationSSD.h"
50 #include "AliITSvSDD03.h"
52 ClassImp(AliITSvSDD03)
54 //______________________________________________________________________
55 AliITSvSDD03::AliITSvSDD03() :
57 fMajorVersion(IsVersion()),
64 ////////////////////////////////////////////////////////////////////////
65 // Standard default constructor for the ITS SDD test beam 2002 version 1.
71 // A default created class.
72 ////////////////////////////////////////////////////////////////////////
78 //______________________________________________________________________
79 AliITSvSDD03::AliITSvSDD03(const char *title,Int_t year):
81 fMajorVersion(IsVersion()),
88 ////////////////////////////////////////////////////////////////////////
89 // Standard constructor for the ITS SDD testbeam 2002 version 1.
91 // const char *title title for this ITS geometry.
95 // A standard created class.
96 ////////////////////////////////////////////////////////////////////////
100 fIdName = new TString[fIdN];
104 fIdSens = new Int_t[fIdN];
105 for(i=0;i<fIdN;i++) fIdSens[i] = 0;
108 //______________________________________________________________________
109 AliITSvSDD03::~AliITSvSDD03() {
110 ////////////////////////////////////////////////////////////////////////
111 // Standard destructor for the ITS SDD test beam 2002 version 1.
118 ////////////////////////////////////////////////////////////////////////
121 //______________________________________________________________________
122 Int_t AliITSvSDD03::DecodeDetector(Int_t id,Int_t cpy,Int_t &lay,
123 Int_t &det,Int_t &lad) const{
124 // Given the Geant id and copy volume number, returns the layer, ladder,
125 // and detector number, allong with the module number of the detector
126 // involved. Returns -1 and lay=0, lad=0, and det=0 if not a sensitive
129 // Int_t id Geometry volume id number
130 // Int_t cpy Geometry copy number
132 // Int_t lay ITS layer number
133 // Int_t lad ITS ladder number
134 // Int_t det ITS detector number
136 // Int_t module number.
139 lay = 0; lad = 0; det = 0; mod = -1;
140 if(id==fIdSens[0]){ // Volume name is IMBS (ITEL)
147 if(id==fIdSens[1]){ // Volume name is ITST (IDet)
148 lad = 1; det = 1;lay = cpy+4;
155 //______________________________________________________________________
156 void AliITSvSDD03::CreateGeometry(){
157 ////////////////////////////////////////////////////////////////////////
158 // This routine defines and Creates the geometry for version 1 of the ITS.
159 // ALIC ALICE Mother Volume
160 // |- ITSV ITS Mother Volume
161 // |- IDET *2 Detector under Test (boxcontaining SDD)
162 // | |-IDAI Air inside box
163 // | |- ITS0 SDD Si Chip
164 // | |- ITST SDD Sensitivve Volume
165 // |- ITEL *10 SSD Telescope (plastic box containting SSD's)
166 // | |- ITAI Air inside box
167 // | |- IMB0 SDD Si Chip
168 // | |- IMBS SDD Sensitive volume
169 // |-ISNT*4 Sintilator triggers
171 // ITEL ITEL ITEL ITEL IDET IDET ITEL ITEL ITEL ITEL ITEL ITEL
172 // Z-> -584 -574 -504 -494 000 +052 +601 +610 +684 +694 +877 +887
173 // | | | | | | | | | | | |
174 // cpn1 1 2 3 4 1 2 5 6 7 8 9 10
182 ////////////////////////////////////////////////////////////////////////
184 // Define media off-set
185 Int_t *idtmed = fIdtmed->GetArray()+1; // array of media indexes
186 Int_t idrotm[4]; // Array of rotation matrix indexes
187 //Float_t ddettest=200.0E-4,ddettelescope=300.0E-4;
188 //Float_t dchipMiniBus=750.0E-4,dchiptest=300.0E-4;
189 //Float_t yposition= 0.0;
190 const Float_t kmm=0.1,kcm=1.0,kmicm=kmm/1000.;
191 // These constant character strings are set by cvs during commit
192 // do not change them unless you know what you are doing!
193 const Char_t *cvsDate="$Date$";
194 const Char_t *cvsRevision="$Revision$";
195 // Define Rotation-reflextion Matrixes needed
196 // 0 is the unit matrix
197 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0); // SDD and SSD X
198 AliMatrix(idrotm[1], 90.0,90.0, 0.0,180.0, 90.0,270.0); // SSD Y
199 AliMatrix(idrotm[2],90.0,90.0,90.0,180.0,0.0,0.0); //Rotate about Z 90 degree
203 data[2] = 1100.0*kmm;
204 gMC->Gsvolu("ITSV","BOX ",idtmed[0],data,3);
205 gMC->Gspos("ITSV",1,"ALIC",0.0,0.0,0.0,0,"ONLY");
207 TGeoVolumeAssembly *itsV = gGeoManager->MakeVolumeAssembly("ITSV");
208 const Int_t kLength=100;
209 Char_t vstrng[kLength];
210 if(fIgm.WriteVersionString(vstrng,kLength,(AliITSVersion_t)IsVersion(),
211 fMinorVersion,cvsDate,cvsRevision))
212 itsV->SetTitle(vstrng);
213 else Error("CreateGeometry","Error writing/setting version string");
214 //printf("Title set to %s\n",vstrng);
215 TGeoVolume *alic = gGeoManager->GetVolume("ALIC");
217 Error("CreateGeometry","alic=0");
220 alic->AddNode(itsV,1,0);
222 // Crossed sintilator triggers (2 in front 2 in back)
226 gMC->Gsvolu("ISNT","BOX ",idtmed[2],data,3);
227 gMC->Gspos("ISNT",1,"ITSV",0.0,0.0,-950.0*kmm,0,"ONLY");
228 gMC->Gspos("ISNT",2,"ITSV",0.0,0.0,-950.0*kmm-data[2],idrotm[2],"ONLY");
229 gMC->Gspos("ISNT",3,"ITSV",0.0,0.0,950.0*kmm+data[2],0,"ONLY");
230 gMC->Gspos("ISNT",4,"ITSV",0.0,0.0,950.0*kmm,idrotm[2],"ONLY");
235 // SSD part of telescope (MiniBuS)
236 Float_t detMiniBusX,detMiniBusY,detMiniBusZ;
237 data[0] = detMiniBusX = 10600.0*kmicm;
238 data[1] = detMiniBusY = 0.150*kmm;
239 data[2] = detMiniBusZ = 1.1*kcm;
240 gMC->Gsvolu("IMB0", "BOX ", idtmed[1], data, 3); // contains detector
241 data[0] = 0.5*384*50*kmicm;
242 data[1] = 0.1499*kmm;
244 gMC->Gsvolu("IMBS","BOX ",idtmed[1],data,3); // sensitive detector volume
245 gMC->Gspos("IMBS",1,"IMB0",0.0,0.0,0.0,0,"ONLY"); // place IMBS inside
246 // Box containing SSD's
247 data[0] = 11600.0*kmicm;
250 gMC->Gsvolu("ITAI","BOX ",idtmed[0],data,3);
251 // Plastic box size = insize + thickness.
252 data[0] = data[0] + 2.0*kmm;
253 data[1] = data[1] + 200.0*kmicm;
254 data[2] = data[2] + 2.0*kmm;
255 gMC->Gsvolu("ITEL","BOX ",idtmed[3],data,3);
256 gMC->Gspos("ITAI",1,"ITEL",0.0,0.0,0.0,0,"ONLY");
257 gMC->Gspos("IMB0",1,"ITAI",0.0,0.0,0.0,0,"ONLY");
260 Float_t sddX,sddY,sddZ;
261 data[0] = sddX = 3.62500*kcm;
262 data[1] = sddY = 0.1500*kmm;
263 data[2] = sddZ = 4.37940*kcm;
264 gMC->Gsvolu("ITS0", "BOX ", idtmed[1], data, 3); // contains detector
265 data[0] = 3.50860*kcm;
266 data[1] = 0.1499*kmm;
267 data[2] = 3.76320*kcm;
268 gMC->Gsvolu("ITST","BOX ",idtmed[1],data,3);// sensitive detecor volume
269 gMC->Gspos("ITST",1,"ITS0",0.0,0.0,0.0,0,"ONLY"); // place ITST inside
270 // Box containing SDD under test
274 gMC->Gsvolu("IDAI","BOX ",idtmed[0],data,3);
275 data[0] = data[0] + 2.0*kmm;
276 data[1] = data[1] + 200.0*kmicm;
277 data[2] = data[2] + 2.0*kmm;
278 gMC->Gsvolu("IDET","BOX ",idtmed[3],data,3);
279 gMC->Gspos("IDAI",1,"IDET",0.0,0.0,0.0,0,"ONLY");
280 gMC->Gspos("ITS0",1,"IDAI",0.0,0.0,0.0,0,"ONLY");
283 //// Position detectors, Beam Axis Z, X to the right, Y up to the sky.
284 // Upsteram planes of the telescope
285 Float_t p00X,p00Y,p00Z,p01X,p01Y,p01Z,p10X,p10Y,p10Z,p11X,p11Y,p11Z;
289 gMC->Gspos("ITEL",1,"ITSV",p00X,p00Y,p00Z,idrotm[0],"ONLY");//SSD X
293 gMC->Gspos("ITEL",2,"ITSV",p01X,p01Y,p01Z,idrotm[1],"ONLY");//SSD Y
297 gMC->Gspos("ITEL",3,"ITSV",p01X,p01Y,p01Z,idrotm[0],"ONLY");//SSD X
301 gMC->Gspos("ITEL",4,"ITSV",p01X,p01Y,p01Z,idrotm[1],"ONLY");//SSD Y
303 // Downstream planes of the telescope
307 gMC->Gspos("ITEL",5,"ITSV",p10X,p10Y,p10Z,idrotm[0],"ONLY");//SSD X
310 p11Z = +610.0*kmm; //611.0
311 gMC->Gspos("ITEL",6,"ITSV",p11X,p11Y,p11Z,idrotm[1],"ONLY");//SSD Y
315 gMC->Gspos("ITEL",7,"ITSV",p11X,p11Y,p11Z,idrotm[0],"ONLY");//SSD X
319 gMC->Gspos("ITEL",8,"ITSV",p11X,p11Y,p11Z,idrotm[1],"ONLY");//SSD Y
323 gMC->Gspos("ITEL",9,"ITSV",p11X,p11Y,p11Z,idrotm[0],"ONLY");//SSD X
327 gMC->Gspos("ITEL",10,"ITSV",p11X,p11Y,p11Z,idrotm[1],"ONLY");//SSD Y
330 Float_t pdet1X,pdet1Y,pdet1Z;
331 Float_t pdet2X,pdet2Y,pdet2Z;
335 gMC->Gspos("IDET",1,"ITSV",pdet1X,pdet1Y,pdet1Z,idrotm[0],"ONLY");// Detector1
338 pdet2Z = 52*kmm; //52
339 gMC->Gspos("IDET",2,"ITSV",pdet2X,pdet2Y,pdet2Z,idrotm[0],"ONLY");// Detector2
341 // Target definition and placement
344 data[1] = fTargThick*kmm; // Target thickness
346 gMC->Gsvolu("ITGT","BOX ",idtmed[fTarg],data,3);
348 Float_t a,z,dens,radl,absl;
349 Float_t* ubuf=0; Int_t nbuf;
351 gMC->Gfmate(idtmed[fTarg],ssss,a,z,dens,radl,absl,ubuf,nbuf);
353 Info("CreateGeometry","Target A=%f, Z=%f, dens=%f",a,z,dens);
354 Info("Creategeometry","Target thickness=%f mm",fTargThick);
356 Float_t ptgtX,ptgtY,ptgtZ;
360 gMC->Gspos("ITGT",1,"ITSV",ptgtX,ptgtY,ptgtZ,idrotm[0],"ONLY");// Target
362 Info("CreateGeometry","No target defined");
365 //______________________________________________________________________
366 void AliITSvSDD03::CreateMaterials(){
367 ////////////////////////////////////////////////////////////////////////
369 // Create ITS SDD test beam materials
370 // This function defines the default materials used in the Geant
371 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
373 // In general it is automatically replaced by
374 // the CreateMaterials routine defined in AliITSv?. Should the function
375 // CreateMaterials not exist for the geometry version you are using this
376 // one is used. See the definition found in AliITSv5 or the other routine
377 // for a complete definition.
385 /////////////////////////////////////////////////////////////////////////
386 Float_t tmaxfdSi = 0.1; // Degree
387 Float_t stemaxSi = 0.0075; // cm //0.0075
388 Float_t deemaxSi = 0.1; // Fraction of particle's energy 0<deemax<=1
389 Float_t epsilSi = 1.0E-4;//
390 Float_t stminSi = 0.0; // cm "Default value used"
392 Float_t tmaxfdAir = 0.1; // Degree
393 Float_t stemaxAir = .10000E+01; // 1 cm //cm
394 Float_t deemaxAir = 0.1; // Fraction of particle's energy 0<deemax<=1
395 Float_t epsilAir = 1.0E-4;//
396 Float_t stminAir = 0.0; // cm "Default value used"
397 Int_t ifield = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
398 Float_t fieldm = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
402 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
403 Float_t zAir[4]={6.,7.,8.,18.};
404 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
405 Float_t dAir = 1.20479E-3;
407 Float_t aLuc[3] = {1.,12.,16.};
408 Float_t zLuc[3] = {1.,6.,8.};
409 Float_t wLuc[3] = {8.,5.,2.};
412 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
413 Float_t zsteel[4] = { 26.,24.,28.,14. };
414 Float_t wsteel[4] = { .715,.18,.1,.005 };
415 Float_t dsteel = 7.88;
417 AliMixture(1, "AIR$",aAir,zAir,dAir,4,wAir);
418 AliMaterial(2,"SI$",28.086,14.0,2.3300,9.3600,999.00);
419 AliMixture(3,"Sintilator$",aLuc,zLuc,dLuc,-3,wLuc);
420 AliMixture(4,"PlasticBox$",aLuc,zLuc,dLuc,-3,wLuc);
421 AliMaterial(5, "IRON$", 55.85, 26., 7.87, 1.76, 999.00);
422 AliMaterial(6, "LEAD$", 207.19, 82., 11.35, .56, 999.00);
423 AliMixture(7, "STAINLESS STEEL$", asteel, zsteel,dsteel, 4, wsteel);
424 AliMaterial(9, "C$", 12.011, 6., 2.265, 18.8, 999.00);
425 AliMaterial(10, "Al$", 26.98, 13., 2.70, 8.9, 999.00);
426 AliMaterial(11, "Be$", 9.012, 4., 1.848, 35.3, 999.00);
427 AliMaterial(12, "Ti$", 47.88, 22., 4.54, 3.56, 999.00);
428 AliMaterial(13, "Sn$", 118.69, 50., 7.31, 1.21, 999.00);
429 AliMaterial(14, "Cu$", 63.55, 29., 8.96, 1.43, 999.00);
430 AliMaterial(15, "Ge$", 72.59, 32., 5.323, 2.30, 999.00);
431 AliMaterial(20, "W$", 183.85, 74., 19.3, 0.35, 999.00);
433 AliMedium(1,"AIR$",1,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,
435 AliMedium(2,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
437 AliMedium(3,"Scintillator$",3,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
439 AliMedium(4,"PlasticBox$",4,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
441 AliMedium(5,"IRON$",5,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
443 AliMedium(6,"LEAD$",6,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
445 AliMedium(7,"StainlessSteel$",7,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
448 AliMedium(9,"C$",9,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
449 AliMedium(10,"Al$",10,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
450 AliMedium(11,"Be$",11,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
451 AliMedium(12,"Ti$",12,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
452 AliMedium(13,"Sn$",13,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
453 AliMedium(14,"Cu$",14,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
454 AliMedium(15,"Ge$",15,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
455 AliMedium(20,"W$",20,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
456 //dummy materials to avoid warning during simulation (galice.cuts)
458 AliMedium(21,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
460 AliMedium(25,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
462 AliMedium(26,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
464 AliMedium(27,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
466 AliMedium(51,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
468 AliMedium(52,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
470 AliMedium(53,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
472 AliMedium(54,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
474 AliMedium(55,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
476 AliMedium(56,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
478 AliMedium(61,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
480 AliMedium(62,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
482 AliMedium(63,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
484 AliMedium(64,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
486 AliMedium(65,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
488 AliMedium(68,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
490 AliMedium(69,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
492 AliMedium(70,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
494 AliMedium(71,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
496 AliMedium(72,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
498 AliMedium(73,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
500 AliMedium(74,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
502 AliMedium(75,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
504 AliMedium(76,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
506 AliMedium(77,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
508 AliMedium(78,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
510 AliMedium(79,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
512 AliMedium(80,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
514 AliMedium(81,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
516 AliMedium(82,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
518 AliMedium(83,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
520 AliMedium(84,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
522 AliMedium(85,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
524 AliMedium(90,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
526 AliMedium(91,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
528 AliMedium(92,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
530 AliMedium(93,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
532 AliMedium(94,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
534 AliMedium(95,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
536 AliMedium(96,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
540 //______________________________________________________________________
541 void AliITSvSDD03::InitAliITSgeom(){
542 // Based on the geometry tree defined in Geant 3.21, this
543 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
551 const Int_t knlayers=12;
552 // const Int_t kndeep=6;
553 const Int_t kltypess=2;
554 const AliITSDetector kidet[knlayers]={kSSD,kSDD};
555 const TString knames[kltypess]={
556 "/ALIC_1/ITSV_1/ITEL_%d/ITAI_1/IMB0_1/IMBS_1",
557 "/ALIC_1/ITSV_1/IDET_%d/IDAI_1/ITS0_1/ITST_1"};
558 const Int_t kitsGeomTreeCopys[kltypess]={10,2};
560 const Float_t kpitch=50.E-4;//cm
561 Float_t box[3]={0.5*kpitch*(Float_t)knp,150.E-4,1.0},p[knp+1],n[knp+1];
562 Int_t nlad[knlayers]={knlayers*1};
563 Int_t ndet[knlayers]={knlayers*1};
564 Int_t mod=knlayers,lay=0,lad=0,det=0,i,j,cp0;
565 TString path,shapeName;
567 Double_t trans[3]={3*0.0},rot[10]={10*0.0};
570 Bool_t isShapeDefined[kltypess]={kltypess*kFALSE};
571 AliITSgeom *geom = new AliITSgeom(0,knlayers,nlad,ndet,mod);
572 if(GetITSgeom()!=0) SetITSgeom(0x0);// delet existing if there.
577 // Fill in anode and cathode strip locations (lower edge)
584 for(i=0;i<kltypess;i++)for(cp0=1;cp0<=kitsGeomTreeCopys[i];cp0++){
585 mod = DecodeDetector(fIdSens[i],cp0,lay,lad,det);
586 path.Form(knames[i].Data(),cp0);
587 gMC->GetTransformation(path.Data(),matrix);
588 gMC->GetShape(path.Data(),shapeName,shapePar);
589 shapeParF.Set(shapePar.GetSize());
590 for(j=0;j<shapePar.GetSize();j++)shapeParF[j]=shapePar[j];
591 geom->CreateMatrix(mod,lay,lad,det,kidet[i],trans,rot);
592 geom->SetTrans(mod,matrix.GetTranslation());
593 geom->SetRotMatrix(mod,matrix.GetRotationMatrix());
594 geom->GetGeomMatrix(mod)->SetPath(path.Data());
596 case kSDD: if(!(GetITSgeom()->IsShapeDefined((Int_t)kSDD))){
597 geom->ReSetShape(kSDD,new AliITSgeomSDD256(shapeParF.GetSize(),
598 shapeParF.GetArray()));
599 isShapeDefined[i]=kTRUE;
601 case kSSD:if(!(GetITSgeom()->IsShapeDefined((Int_t)kSSD))){
602 geom->ReSetShape(kSSD,new AliITSgeomSSD(box,0.0,0.0,
604 isShapeDefined[i]=kTRUE;
611 //______________________________________________________________________
612 void AliITSvSDD03::Init(){
613 ////////////////////////////////////////////////////////////////////////
614 // Initialise the ITS after it has been created.
621 ////////////////////////////////////////////////////////////////////////
624 Info("Init","**********AliITSvSDD03 %d _Init *************",fMinorVersion);
626 AliDebug(1,Form("Init: Major version %d Minor version %d",fMajorVersion,
629 UpdateInternalGeometry();
632 fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID.
635 //______________________________________________________________________
636 void AliITSvSDD03::SetDefaults(){
637 // sets the default segmentation, response, digit and raw cluster classes
645 // const Float_t kconv = 1.0e+04; // convert cm to microns
647 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
648 fDetTypeSim->SetITSgeom(GetITSgeom());
649 fDetTypeSim->ResetCalibrationArray();
650 fDetTypeSim->ResetSegmentation();
654 SetCalibrationModel(GetITSgeom()->GetStartSPD(),new AliITSCalibrationSPD());
655 SetSegmentationModel(kSPD,(AliITSsegmentationSPD*)
656 (GetITSgeom()->GetShape(kSPD)));
657 fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
660 s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);// Get shape info. Do it this way for now.
661 AliITSCalibrationSDD *resp1=new AliITSCalibrationSDD("simulated");
662 SetCalibrationModel(GetITSgeom()->GetStartSDD(),resp1);
664 AliITSsegmentationSDD *seg1 = (AliITSsegmentationSDD*)
665 (GetITSgeom()->GetShape(kSDD));
666 seg1->SetDriftSpeed(AliITSDriftSpeedSDD::DefaultDriftSpeed());
667 seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
668 SetSegmentationModel(kSDD,seg1);
669 const char *kData1=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSDD()))->DataType();
673 s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);// Get shape info. Do it this way for now.
675 AliITSCalibration *resp2= new AliITSCalibrationSSD("simulated");
676 SetCalibrationModel(GetITSgeom()->GetStartSSD(),resp2);
678 AliITSsegmentationSSD *seg2 = (AliITSsegmentationSSD*)
679 (GetITSgeom()->GetShape(kSSD));
680 seg2->SetPadSize(50.,0.); // strip x pitch in microns
681 seg2->SetNPads(384,0); // number of strips on each side.
683 seg2->SetAngles(0.,0.); // strip angles rad P and N side.
684 seg2->SetAnglesLay5(0.,0.); // strip angles rad P and N side.
685 seg2->SetAnglesLay6(0.,0.); // strip angles rad P and N side.
687 SetSegmentationModel(kSSD,seg2);
688 const char *kData2=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSSD()))->DataType();
689 if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit");
690 else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
693 Warning("SetDefaults",
694 "Only the four basic detector types are initialised!");
698 //______________________________________________________________________
699 void AliITSvSDD03::SetDefaultSimulation(){
700 // sets the default simulation.
708 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
709 AliITSsimulation *sim;
710 //AliITSsegmentation *seg;
711 //AliITSCalibration *res;
714 sim = fDetTypeSim->GetSimulationModel(kSPD);
716 //seg =(AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD);
717 //if(seg==0) seg = new AliITSsegmentationSPD();
718 //res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSPD());
719 //if(res==0) res = new AliITSCalibrationSPD();
720 sim = new AliITSsimulationSPD(fDetTypeSim);
721 SetSimulationModel(kSPD,sim);
722 }else{ // simulation exists, make sure it is set up properly.
723 sim->SetSegmentationModel(kSPD,(AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD));
724 sim->SetCalibrationModel(GetITSgeom()->GetStartSPD(),(AliITSCalibration*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSPD()));
730 sim = fDetTypeSim->GetSimulationModel(kSDD);
732 // seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD);
733 //res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD());
734 sim = new AliITSsimulationSDD(fDetTypeSim);
735 SetSimulationModel(kSDD,sim);
736 }else{ // simulation exists, make sure it is set up properly.
737 sim->SetSegmentationModel(kSDD,(AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD));
738 sim->SetCalibrationModel(GetITSgeom()->GetStartSDD(),(AliITSCalibration*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSDD()));
745 sim = fDetTypeSim->GetSimulationModel(kSSD);
747 // seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD);
748 // res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSSD());
749 sim = new AliITSsimulationSSD(fDetTypeSim);
750 SetSimulationModel(kSSD,sim);
751 }else{ // simulation exists, make sure it is set up properly.
752 sim->SetSegmentationModel(kSSD,(AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD));
753 sim->SetCalibrationModel(GetITSgeom()->GetStartSSD(),(AliITSCalibration*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSSD()));
758 //______________________________________________________________________
759 void AliITSvSDD03::DrawModule() const{
760 ////////////////////////////////////////////////////////////////////////
761 // Draw a shaded view of the ITS SDD test beam version 1.
768 ////////////////////////////////////////////////////////////////////////
769 // Set everything unseen
770 gMC->Gsatt("*", "seen", -1);
771 // Set ALIC mother visible
772 gMC->Gsatt("ALIC","SEEN",0);
773 // Set ALIC ITS visible
774 gMC->Gsatt("ITSV","SEEN",1);
775 // Set ALIC Telescopes visible
776 gMC->Gsatt("ITEL","SEEN",1);
777 gMC->Gsatt("ITEL","colo",2);
778 // Set ALIC detetcor visible
779 gMC->Gsatt("IDET","SEEN",1);
780 gMC->Gsatt("IDET","colo",4);
781 // Set ALIC Scintillator visible
782 gMC->Gsatt("ISNT","SEEN",1);
783 gMC->Gsatt("ISNT","colo",3);
784 // Set Detector mother visible and drawn
785 // gMC->Gsatt("ITS0","SEEN",1);
786 // Set minibus mother visible and drawn
787 // gMC->Gsatt("IMB0","SEEN",1);
790 gMC->Gdraw("alic", 60, 30, 180, 10,10, .12, .12);
792 //______________________________________________________________________
793 void AliITSvSDD03::StepManager(){
794 ////////////////////////////////////////////////////////////////////////
795 // Called for every step in the ITS SDD test beam, then calles the
796 // AliITShit class creator with the information to be recoreded about
798 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
799 // printing of information to a file which can be used to create a .det
800 // file read in by the routine CreateGeometry(). If set to 0 or any other
801 // value except 1, the default behavior, then no such file is created nor
802 // it the extra variables and the like used in the printing allocated.
809 ////////////////////////////////////////////////////////////////////////
810 if(!(this->IsActive())) return;
811 if(!(gMC->TrackCharge())) return;
813 Int_t cpy0,cpy1,ncpys=0,status,id,mod;
814 TLorentzVector position, momentum;
815 static AliITShit hit;// Saves on calls to construtors
816 //TClonesArray &lhits = *(GetDetTypeSim()->GetHits());
817 TClonesArray &lhits = *(Hits());
822 if(gMC->IsTrackInside()) status += 1;
823 if(gMC->IsTrackEntering()) status += 2;
824 if(gMC->IsTrackExiting()) status += 4;
825 if(gMC->IsTrackOut()) status += 8;
826 if(gMC->IsTrackDisappeared()) status += 16;
827 if(gMC->IsTrackStop()) status += 32;
828 if(gMC->IsTrackAlive()) status += 64;
830 // Fill hit structure.
831 gMC->TrackPosition(position);
832 gMC->TrackMomentum(momentum);
833 id = gMC->CurrentVolID(cpy0);
834 gMC->CurrentVolOffID(3,cpy1);
835 if(id==fIdSens[0])ncpys=10;
836 if(id==fIdSens[1])ncpys=2;
837 fIgm.DecodeDetector(mod,ncpys,cpy0,cpy1,1);
839 // Fill hit structure.
842 hit.SetTrack(gAlice->GetMCApp()->GetCurrentTrackNumber());
843 gMC->TrackPosition(position);
844 gMC->TrackMomentum(momentum);
845 hit.SetPosition(position);
846 hit.SetTime(gMC->TrackTime());
847 hit.SetMomentum(momentum);
848 hit.SetStatus(status);
849 hit.SetEdep(gMC->Edep());
850 hit.SetShunt(GetIshunt());
851 if(gMC->IsTrackEntering()){
852 hit.SetStartPosition(position);
853 hit.SetStartTime(gMC->TrackTime());
854 hit.SetStartStatus(status);
855 return; // don't save entering hit.
856 } // end if IsEntering
857 // Fill hit structure with this new hit.
858 //Info("StepManager","Calling Copy Constructor");
859 new(lhits[fNhits++]) AliITShit(hit); // Use Copy Construtor.
860 // Save old position... for next hit.
861 hit.SetStartPosition(position);
862 hit.SetStartTime(gMC->TrackTime());
863 hit.SetStartStatus(status);