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 <TGeoManager.h>
26 #include <TLorentzVector.h>
27 #include <TVirtualMC.h>
28 #include <TGeoMatrix.h>
33 #include "AliTrackReference.h"
34 #include "AliITShit.h"
35 #include "AliITSgeom.h"
36 #include "AliITSgeomSDD.h"
37 #include "AliITSgeomSSD.h"
38 #include "AliITSDetTypeSim.h"
39 #include "AliITSCalibrationSPD.h"
40 #include "AliITSCalibrationSDD.h"
41 #include "AliITSCalibrationSSD.h"
42 #include "AliITSsegmentationSPD.h"
43 #include "AliITSsegmentationSDD.h"
44 #include "AliITSsegmentationSSD.h"
45 #include "AliITSsimulationSPD.h"
46 #include "AliITSsimulationSDD.h"
47 #include "AliITSsimulationSSD.h"
49 #include "AliITSvSDD03.h"
51 ClassImp(AliITSvSDD03)
53 //______________________________________________________________________
54 AliITSvSDD03::AliITSvSDD03() :
56 fMajorVersion(IsVersion()),
63 ////////////////////////////////////////////////////////////////////////
64 // Standard default constructor for the ITS SDD test beam 2002 version 1.
70 // A default created class.
71 ////////////////////////////////////////////////////////////////////////
77 //______________________________________________________________________
78 AliITSvSDD03::AliITSvSDD03(const char *title,Int_t year):
80 fMajorVersion(IsVersion()),
87 ////////////////////////////////////////////////////////////////////////
88 // Standard constructor for the ITS SDD testbeam 2002 version 1.
90 // const char *title title for this ITS geometry.
94 // A standard created class.
95 ////////////////////////////////////////////////////////////////////////
99 fIdName = new TString[fIdN];
103 fIdSens = new Int_t[fIdN];
104 for(i=0;i<fIdN;i++) fIdSens[i] = 0;
107 //______________________________________________________________________
108 AliITSvSDD03::~AliITSvSDD03() {
109 ////////////////////////////////////////////////////////////////////////
110 // Standard destructor for the ITS SDD test beam 2002 version 1.
117 ////////////////////////////////////////////////////////////////////////
120 //______________________________________________________________________
121 Int_t AliITSvSDD03::DecodeDetector(Int_t id,Int_t cpy,Int_t &lay,
122 Int_t &det,Int_t &lad) const{
123 // Given the Geant id and copy volume number, returns the layer, ladder,
124 // and detector number, allong with the module number of the detector
125 // involved. Returns -1 and lay=0, lad=0, and det=0 if not a sensitive
128 // Int_t id Geometry volume id number
129 // Int_t cpy Geometry copy number
131 // Int_t lay ITS layer number
132 // Int_t lad ITS ladder number
133 // Int_t det ITS detector number
135 // Int_t module number.
138 lay = 0; lad = 0; det = 0; mod = -1;
139 if(id==fIdSens[0]){ // Volume name is IMBS (ITEL)
146 if(id==fIdSens[1]){ // Volume name is ITST (IDet)
147 lad = 1; det = 1;lay = cpy+4;
154 //______________________________________________________________________
155 void AliITSvSDD03::CreateGeometry(){
156 ////////////////////////////////////////////////////////////////////////
157 // This routine defines and Creates the geometry for version 1 of the ITS.
158 // ALIC ALICE Mother Volume
159 // |- ITSV ITS Mother Volume
160 // |- IDET *2 Detector under Test (boxcontaining SDD)
161 // | |-IDAI Air inside box
162 // | |- ITS0 SDD Si Chip
163 // | |- ITST SDD Sensitivve Volume
164 // |- ITEL *10 SSD Telescope (plastic box containting SSD's)
165 // | |- ITAI Air inside box
166 // | |- IMB0 SDD Si Chip
167 // | |- IMBS SDD Sensitive volume
168 // |-ISNT*4 Sintilator triggers
170 // ITEL ITEL ITEL ITEL IDET IDET ITEL ITEL ITEL ITEL ITEL ITEL
171 // Z-> -584 -574 -504 -494 000 +052 +601 +610 +684 +694 +877 +887
172 // | | | | | | | | | | | |
173 // cpn1 1 2 3 4 1 2 5 6 7 8 9 10
181 ////////////////////////////////////////////////////////////////////////
183 // Define media off-set
184 Int_t *idtmed = fIdtmed->GetArray()+1; // array of media indexes
185 Int_t idrotm[4]; // Array of rotation matrix indexes
186 //Float_t ddettest=200.0E-4,ddettelescope=300.0E-4;
187 //Float_t dchipMiniBus=750.0E-4,dchiptest=300.0E-4;
188 //Float_t yposition= 0.0;
189 const Float_t kmm=0.1,kcm=1.0,kmicm=kmm/1000.;
190 // These constant character strings are set by cvs during commit
191 // do not change them unless you know what you are doing!
192 const Char_t *cvsDate="$Date$";
193 const Char_t *cvsRevision="$Revision$";
194 // Define Rotation-reflextion Matrixes needed
195 // 0 is the unit matrix
196 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0); // SDD and SSD X
197 AliMatrix(idrotm[1], 90.0,90.0, 0.0,180.0, 90.0,270.0); // SSD Y
198 AliMatrix(idrotm[2],90.0,90.0,90.0,180.0,0.0,0.0); //Rotate about Z 90 degree
202 data[2] = 1100.0*kmm;
203 gMC->Gsvolu("ITSV","BOX ",idtmed[0],data,3);
204 gMC->Gspos("ITSV",1,"ALIC",0.0,0.0,0.0,0,"ONLY");
206 TGeoVolumeAssembly *itsV = gGeoManager->MakeVolumeAssembly("ITSV");
207 const Int_t kLength=100;
208 Char_t vstrng[kLength];
209 if(fIgm.WriteVersionString(vstrng,kLength,(AliITSVersion_t)IsVersion(),
210 fMinorVersion,cvsDate,cvsRevision))
211 itsV->SetTitle(vstrng);
212 else Error("CreateGeometry","Error writing/setting version string");
213 //printf("Title set to %s\n",vstrng);
214 TGeoVolume *alic = gGeoManager->GetVolume("ALIC");
216 Error("CreateGeometry","alic=0");
219 alic->AddNode(itsV,1,0);
221 // Crossed sintilator triggers (2 in front 2 in back)
225 gMC->Gsvolu("ISNT","BOX ",idtmed[2],data,3);
226 gMC->Gspos("ISNT",1,"ITSV",0.0,0.0,-950.0*kmm,0,"ONLY");
227 gMC->Gspos("ISNT",2,"ITSV",0.0,0.0,-950.0*kmm-data[2],idrotm[2],"ONLY");
228 gMC->Gspos("ISNT",3,"ITSV",0.0,0.0,950.0*kmm+data[2],0,"ONLY");
229 gMC->Gspos("ISNT",4,"ITSV",0.0,0.0,950.0*kmm,idrotm[2],"ONLY");
234 // SSD part of telescope (MiniBuS)
235 Float_t detMiniBusX,detMiniBusY,detMiniBusZ;
236 data[0] = detMiniBusX = 10600.0*kmicm;
237 data[1] = detMiniBusY = 0.150*kmm;
238 data[2] = detMiniBusZ = 1.1*kcm;
239 gMC->Gsvolu("IMB0", "BOX ", idtmed[1], data, 3); // contains detector
240 data[0] = 0.5*384*50*kmicm;
241 data[1] = 0.1499*kmm;
243 gMC->Gsvolu("IMBS","BOX ",idtmed[1],data,3); // sensitive detector volume
244 gMC->Gspos("IMBS",1,"IMB0",0.0,0.0,0.0,0,"ONLY"); // place IMBS inside
245 // Box containing SSD's
246 data[0] = 11600.0*kmicm;
249 gMC->Gsvolu("ITAI","BOX ",idtmed[0],data,3);
250 // Plastic box size = insize + thickness.
251 data[0] = data[0] + 2.0*kmm;
252 data[1] = data[1] + 200.0*kmicm;
253 data[2] = data[2] + 2.0*kmm;
254 gMC->Gsvolu("ITEL","BOX ",idtmed[3],data,3);
255 gMC->Gspos("ITAI",1,"ITEL",0.0,0.0,0.0,0,"ONLY");
256 gMC->Gspos("IMB0",1,"ITAI",0.0,0.0,0.0,0,"ONLY");
259 Float_t sddX,sddY,sddZ;
260 data[0] = sddX = 3.62500*kcm;
261 data[1] = sddY = 0.1500*kmm;
262 data[2] = sddZ = 4.37940*kcm;
263 gMC->Gsvolu("ITS0", "BOX ", idtmed[1], data, 3); // contains detector
264 data[0] = 3.50860*kcm;
265 data[1] = 0.1499*kmm;
266 data[2] = 3.76320*kcm;
267 gMC->Gsvolu("ITST","BOX ",idtmed[1],data,3);// sensitive detecor volume
268 gMC->Gspos("ITST",1,"ITS0",0.0,0.0,0.0,0,"ONLY"); // place ITST inside
269 // Box containing SDD under test
273 gMC->Gsvolu("IDAI","BOX ",idtmed[0],data,3);
274 data[0] = data[0] + 2.0*kmm;
275 data[1] = data[1] + 200.0*kmicm;
276 data[2] = data[2] + 2.0*kmm;
277 gMC->Gsvolu("IDET","BOX ",idtmed[3],data,3);
278 gMC->Gspos("IDAI",1,"IDET",0.0,0.0,0.0,0,"ONLY");
279 gMC->Gspos("ITS0",1,"IDAI",0.0,0.0,0.0,0,"ONLY");
282 //// Position detectors, Beam Axis Z, X to the right, Y up to the sky.
283 // Upsteram planes of the telescope
284 Float_t p00X,p00Y,p00Z,p01X,p01Y,p01Z,p10X,p10Y,p10Z,p11X,p11Y,p11Z;
288 gMC->Gspos("ITEL",1,"ITSV",p00X,p00Y,p00Z,idrotm[0],"ONLY");//SSD X
292 gMC->Gspos("ITEL",2,"ITSV",p01X,p01Y,p01Z,idrotm[1],"ONLY");//SSD Y
296 gMC->Gspos("ITEL",3,"ITSV",p01X,p01Y,p01Z,idrotm[0],"ONLY");//SSD X
300 gMC->Gspos("ITEL",4,"ITSV",p01X,p01Y,p01Z,idrotm[1],"ONLY");//SSD Y
302 // Downstream planes of the telescope
306 gMC->Gspos("ITEL",5,"ITSV",p10X,p10Y,p10Z,idrotm[0],"ONLY");//SSD X
309 p11Z = +610.0*kmm; //611.0
310 gMC->Gspos("ITEL",6,"ITSV",p11X,p11Y,p11Z,idrotm[1],"ONLY");//SSD Y
314 gMC->Gspos("ITEL",7,"ITSV",p11X,p11Y,p11Z,idrotm[0],"ONLY");//SSD X
318 gMC->Gspos("ITEL",8,"ITSV",p11X,p11Y,p11Z,idrotm[1],"ONLY");//SSD Y
322 gMC->Gspos("ITEL",9,"ITSV",p11X,p11Y,p11Z,idrotm[0],"ONLY");//SSD X
326 gMC->Gspos("ITEL",10,"ITSV",p11X,p11Y,p11Z,idrotm[1],"ONLY");//SSD Y
329 Float_t pdet1X,pdet1Y,pdet1Z;
330 Float_t pdet2X,pdet2Y,pdet2Z;
334 gMC->Gspos("IDET",1,"ITSV",pdet1X,pdet1Y,pdet1Z,idrotm[0],"ONLY");// Detector1
337 pdet2Z = 52*kmm; //52
338 gMC->Gspos("IDET",2,"ITSV",pdet2X,pdet2Y,pdet2Z,idrotm[0],"ONLY");// Detector2
340 // Target definition and placement
343 data[1] = fTargThick*kmm; // Target thickness
345 gMC->Gsvolu("ITGT","BOX ",idtmed[fTarg],data,3);
347 Float_t a,z,dens,radl,absl;
348 Float_t* ubuf=0; Int_t nbuf;
350 gMC->Gfmate(idtmed[fTarg],ssss,a,z,dens,radl,absl,ubuf,nbuf);
352 Info("CreateGeometry","Target A=%f, Z=%f, dens=%f",a,z,dens);
353 Info("Creategeometry","Target thickness=%f mm",fTargThick);
355 Float_t ptgtX,ptgtY,ptgtZ;
359 gMC->Gspos("ITGT",1,"ITSV",ptgtX,ptgtY,ptgtZ,idrotm[0],"ONLY");// Target
361 Info("CreateGeometry","No target defined");
364 //______________________________________________________________________
365 void AliITSvSDD03::CreateMaterials(){
366 ////////////////////////////////////////////////////////////////////////
368 // Create ITS SDD test beam materials
369 // This function defines the default materials used in the Geant
370 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
372 // In general it is automatically replaced by
373 // the CreateMaterials routine defined in AliITSv?. Should the function
374 // CreateMaterials not exist for the geometry version you are using this
375 // one is used. See the definition found in AliITSv5 or the other routine
376 // for a complete definition.
384 /////////////////////////////////////////////////////////////////////////
385 Float_t tmaxfdSi = 0.1; // Degree
386 Float_t stemaxSi = 0.0075; // cm //0.0075
387 Float_t deemaxSi = 0.1; // Fraction of particle's energy 0<deemax<=1
388 Float_t epsilSi = 1.0E-4;//
389 Float_t stminSi = 0.0; // cm "Default value used"
391 Float_t tmaxfdAir = 0.1; // Degree
392 Float_t stemaxAir = .10000E+01; // 1 cm //cm
393 Float_t deemaxAir = 0.1; // Fraction of particle's energy 0<deemax<=1
394 Float_t epsilAir = 1.0E-4;//
395 Float_t stminAir = 0.0; // cm "Default value used"
396 Int_t ifield = gAlice->Field()->Integ();
397 Float_t fieldm = gAlice->Field()->Max();
401 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
402 Float_t zAir[4]={6.,7.,8.,18.};
403 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
404 Float_t dAir = 1.20479E-3;
406 Float_t aLuc[3] = {1.,12.,16.};
407 Float_t zLuc[3] = {1.,6.,8.};
408 Float_t wLuc[3] = {8.,5.,2.};
411 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
412 Float_t zsteel[4] = { 26.,24.,28.,14. };
413 Float_t wsteel[4] = { .715,.18,.1,.005 };
414 Float_t dsteel = 7.88;
416 AliMixture(1, "AIR$",aAir,zAir,dAir,4,wAir);
417 AliMaterial(2,"SI$",28.086,14.0,2.3300,9.3600,999.00);
418 AliMixture(3,"Sintilator$",aLuc,zLuc,dLuc,-3,wLuc);
419 AliMixture(4,"PlasticBox$",aLuc,zLuc,dLuc,-3,wLuc);
420 AliMaterial(5, "IRON$", 55.85, 26., 7.87, 1.76, 999.00);
421 AliMaterial(6, "LEAD$", 207.19, 82., 11.35, .56, 999.00);
422 AliMixture(7, "STAINLESS STEEL$", asteel, zsteel,dsteel, 4, wsteel);
423 AliMaterial(9, "C$", 12.011, 6., 2.265, 18.8, 999.00);
424 AliMaterial(10, "Al$", 26.98, 13., 2.70, 8.9, 999.00);
425 AliMaterial(11, "Be$", 9.012, 4., 1.848, 35.3, 999.00);
426 AliMaterial(12, "Ti$", 47.88, 22., 4.54, 3.56, 999.00);
427 AliMaterial(13, "Sn$", 118.69, 50., 7.31, 1.21, 999.00);
428 AliMaterial(14, "Cu$", 63.55, 29., 8.96, 1.43, 999.00);
429 AliMaterial(15, "Ge$", 72.59, 32., 5.323, 2.30, 999.00);
430 AliMaterial(20, "W$", 183.85, 74., 19.3, 0.35, 999.00);
432 AliMedium(1,"AIR$",1,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,
434 AliMedium(2,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
436 AliMedium(3,"Scintillator$",3,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
438 AliMedium(4,"PlasticBox$",4,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
440 AliMedium(5,"IRON$",5,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
442 AliMedium(6,"LEAD$",6,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
444 AliMedium(7,"StainlessSteel$",7,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
447 AliMedium(9,"C$",9,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
448 AliMedium(10,"Al$",10,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
449 AliMedium(11,"Be$",11,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
450 AliMedium(12,"Ti$",12,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
451 AliMedium(13,"Sn$",13,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
452 AliMedium(14,"Cu$",14,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
453 AliMedium(15,"Ge$",15,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
454 AliMedium(20,"W$",20,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
455 //dummy materials to avoid warning during simulation (galice.cuts)
457 AliMedium(21,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
459 AliMedium(25,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
461 AliMedium(26,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
463 AliMedium(27,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
465 AliMedium(51,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
467 AliMedium(52,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
469 AliMedium(53,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
471 AliMedium(54,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
473 AliMedium(55,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
475 AliMedium(56,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
477 AliMedium(61,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
479 AliMedium(62,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
481 AliMedium(63,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
483 AliMedium(64,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
485 AliMedium(65,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
487 AliMedium(68,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
489 AliMedium(69,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
491 AliMedium(70,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
493 AliMedium(71,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
495 AliMedium(72,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
497 AliMedium(73,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
499 AliMedium(74,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
501 AliMedium(75,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
503 AliMedium(76,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
505 AliMedium(77,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
507 AliMedium(78,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
509 AliMedium(79,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
511 AliMedium(80,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
513 AliMedium(81,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
515 AliMedium(82,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
517 AliMedium(83,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
519 AliMedium(84,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
521 AliMedium(85,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
523 AliMedium(90,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
525 AliMedium(91,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
527 AliMedium(92,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
529 AliMedium(93,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
531 AliMedium(94,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
533 AliMedium(95,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
535 AliMedium(96,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
539 //______________________________________________________________________
540 void AliITSvSDD03::InitAliITSgeom(){
541 // Based on the geometry tree defined in Geant 3.21, this
542 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
550 const Int_t knlayers=12;
551 // const Int_t kndeep=6;
552 const Int_t kltypess=2;
553 const AliITSDetector kidet[knlayers]={kSSD,kSDD};
554 const TString knames[kltypess]={
555 "/ALIC_1/ITSV_1/ITEL_%d/ITAI_1/IMB0_1/IMBS_1",
556 "/ALIC_1/ITSV_1/IDET_%d/IDAI_1/ITS0_1/ITST_1"};
557 const Int_t kitsGeomTreeCopys[kltypess]={10,2};
559 const Float_t kpitch=50.E-4;//cm
560 Float_t box[3]={0.5*kpitch*(Float_t)knp,150.E-4,1.0},p[knp+1],n[knp+1];
561 Int_t nlad[knlayers]={knlayers*1};
562 Int_t ndet[knlayers]={knlayers*1};
563 Int_t mod=knlayers,lay=0,lad=0,det=0,i,j,cp0;
564 TString path,shapeName;
566 Double_t trans[3]={3*0.0},rot[10]={10*0.0};
569 Bool_t isShapeDefined[kltypess]={kltypess*kFALSE};
570 AliITSgeom *geom = new AliITSgeom(0,knlayers,nlad,ndet,mod);
571 if(GetITSgeom()!=0) SetITSgeom(0x0);// delet existing if there.
576 // Fill in anode and cathode strip locations (lower edge)
583 for(i=0;i<kltypess;i++)for(cp0=1;cp0<=kitsGeomTreeCopys[i];cp0++){
584 mod = DecodeDetector(fIdSens[i],cp0,lay,lad,det);
585 path.Form(knames[i].Data(),cp0);
586 gMC->GetTransformation(path.Data(),matrix);
587 gMC->GetShape(path.Data(),shapeName,shapePar);
588 shapeParF.Set(shapePar.GetSize());
589 for(j=0;j<shapePar.GetSize();j++)shapeParF[j]=shapePar[j];
590 geom->CreateMatrix(mod,lay,lad,det,kidet[i],trans,rot);
591 geom->SetTrans(mod,matrix.GetTranslation());
592 geom->SetRotMatrix(mod,matrix.GetRotationMatrix());
593 geom->GetGeomMatrix(mod)->SetPath(path.Data());
595 case kSDD: if(!(GetITSgeom()->IsShapeDefined((Int_t)kSDD))){
596 geom->ReSetShape(kSDD,new AliITSgeomSDD256(shapeParF.GetSize(),
597 shapeParF.GetArray()));
598 isShapeDefined[i]=kTRUE;
600 case kSSD:if(!(GetITSgeom()->IsShapeDefined((Int_t)kSSD))){
601 geom->ReSetShape(kSSD,new AliITSgeomSSD(box,0.0,0.0,
603 isShapeDefined[i]=kTRUE;
610 //______________________________________________________________________
611 void AliITSvSDD03::Init(){
612 ////////////////////////////////////////////////////////////////////////
613 // Initialise the ITS after it has been created.
620 ////////////////////////////////////////////////////////////////////////
623 Info("Init","**********AliITSvSDD03 %d _Init *************",fMinorVersion);
625 AliDebug(1,Form("Init: Major version %d Minor version %d",fMajorVersion,
628 UpdateInternalGeometry();
631 fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID.
634 //______________________________________________________________________
635 void AliITSvSDD03::SetDefaults(){
636 // sets the default segmentation, response, digit and raw cluster classes
644 // const Float_t kconv = 1.0e+04; // convert cm to microns
646 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
647 fDetTypeSim->SetITSgeom(GetITSgeom());
648 fDetTypeSim->ResetCalibrationArray();
649 fDetTypeSim->ResetSegmentation();
653 SetCalibrationModel(GetITSgeom()->GetStartSPD(),new AliITSCalibrationSPD());
654 SetSegmentationModel(kSPD,(AliITSsegmentationSPD*)
655 (GetITSgeom()->GetShape(kSPD)));
656 fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
659 s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);// Get shape info. Do it this way for now.
660 AliITSCalibrationSDD *resp1=new AliITSCalibrationSDD("simulated");
661 SetCalibrationModel(GetITSgeom()->GetStartSDD(),resp1);
663 AliITSsegmentationSDD *seg1 = (AliITSsegmentationSDD*)
664 (GetITSgeom()->GetShape(kSDD));
665 seg1->SetDriftSpeed(AliITSDriftSpeedSDD::DefaultDriftSpeed());
666 seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
667 SetSegmentationModel(kSDD,seg1);
668 const char *kData1=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSDD()))->DataType();
672 s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);// Get shape info. Do it this way for now.
674 AliITSCalibration *resp2= new AliITSCalibrationSSD("simulated");
675 SetCalibrationModel(GetITSgeom()->GetStartSSD(),resp2);
677 AliITSsegmentationSSD *seg2 = (AliITSsegmentationSSD*)
678 (GetITSgeom()->GetShape(kSSD));
679 seg2->SetPadSize(50.,0.); // strip x pitch in microns
680 seg2->SetNPads(384,0); // number of strips on each side.
682 seg2->SetAngles(0.,0.); // strip angles rad P and N side.
683 seg2->SetAnglesLay5(0.,0.); // strip angles rad P and N side.
684 seg2->SetAnglesLay6(0.,0.); // strip angles rad P and N side.
686 SetSegmentationModel(kSSD,seg2);
687 const char *kData2=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSSD()))->DataType();
688 if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit");
689 else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
692 Warning("SetDefaults",
693 "Only the four basic detector types are initialised!");
697 //______________________________________________________________________
698 void AliITSvSDD03::SetDefaultSimulation(){
699 // sets the default simulation.
707 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
708 AliITSsimulation *sim;
709 //AliITSsegmentation *seg;
710 //AliITSCalibration *res;
713 sim = fDetTypeSim->GetSimulationModel(kSPD);
715 //seg =(AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD);
716 //if(seg==0) seg = new AliITSsegmentationSPD();
717 //res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSPD());
718 //if(res==0) res = new AliITSCalibrationSPD();
719 sim = new AliITSsimulationSPD(fDetTypeSim);
720 SetSimulationModel(kSPD,sim);
721 }else{ // simulation exists, make sure it is set up properly.
722 sim->SetSegmentationModel(kSPD,(AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD));
723 sim->SetCalibrationModel(GetITSgeom()->GetStartSPD(),(AliITSCalibration*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSPD()));
729 sim = fDetTypeSim->GetSimulationModel(kSDD);
731 // seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD);
732 //res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD());
733 sim = new AliITSsimulationSDD(fDetTypeSim);
734 SetSimulationModel(kSDD,sim);
735 }else{ // simulation exists, make sure it is set up properly.
736 sim->SetSegmentationModel(kSDD,(AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD));
737 sim->SetCalibrationModel(GetITSgeom()->GetStartSDD(),(AliITSCalibration*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSDD()));
744 sim = fDetTypeSim->GetSimulationModel(kSSD);
746 // seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD);
747 // res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSSD());
748 sim = new AliITSsimulationSSD(fDetTypeSim);
749 SetSimulationModel(kSSD,sim);
750 }else{ // simulation exists, make sure it is set up properly.
751 sim->SetSegmentationModel(kSSD,(AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD));
752 sim->SetCalibrationModel(GetITSgeom()->GetStartSSD(),(AliITSCalibration*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSSD()));
757 //______________________________________________________________________
758 void AliITSvSDD03::DrawModule() const{
759 ////////////////////////////////////////////////////////////////////////
760 // Draw a shaded view of the ITS SDD test beam version 1.
767 ////////////////////////////////////////////////////////////////////////
768 // Set everything unseen
769 gMC->Gsatt("*", "seen", -1);
770 // Set ALIC mother visible
771 gMC->Gsatt("ALIC","SEEN",0);
772 // Set ALIC ITS visible
773 gMC->Gsatt("ITSV","SEEN",1);
774 // Set ALIC Telescopes visible
775 gMC->Gsatt("ITEL","SEEN",1);
776 gMC->Gsatt("ITEL","colo",2);
777 // Set ALIC detetcor visible
778 gMC->Gsatt("IDET","SEEN",1);
779 gMC->Gsatt("IDET","colo",4);
780 // Set ALIC Scintillator visible
781 gMC->Gsatt("ISNT","SEEN",1);
782 gMC->Gsatt("ISNT","colo",3);
783 // Set Detector mother visible and drawn
784 // gMC->Gsatt("ITS0","SEEN",1);
785 // Set minibus mother visible and drawn
786 // gMC->Gsatt("IMB0","SEEN",1);
789 gMC->Gdraw("alic", 60, 30, 180, 10,10, .12, .12);
791 //______________________________________________________________________
792 void AliITSvSDD03::StepManager(){
793 ////////////////////////////////////////////////////////////////////////
794 // Called for every step in the ITS SDD test beam, then calles the
795 // AliITShit class creator with the information to be recoreded about
797 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
798 // printing of information to a file which can be used to create a .det
799 // file read in by the routine CreateGeometry(). If set to 0 or any other
800 // value except 1, the default behavior, then no such file is created nor
801 // it the extra variables and the like used in the printing allocated.
808 ////////////////////////////////////////////////////////////////////////
809 if(!(this->IsActive())) return;
810 if(!(gMC->TrackCharge())) return;
812 Int_t cpy0,cpy1,ncpys=0,status,id,mod;
813 TLorentzVector position, momentum;
814 static AliITShit hit;// Saves on calls to construtors
815 //TClonesArray &lhits = *(GetDetTypeSim()->GetHits());
816 TClonesArray &lhits = *(Hits());
821 if(gMC->IsTrackInside()) status += 1;
822 if(gMC->IsTrackEntering()) status += 2;
823 if(gMC->IsTrackExiting()) status += 4;
824 if(gMC->IsTrackOut()) status += 8;
825 if(gMC->IsTrackDisappeared()) status += 16;
826 if(gMC->IsTrackStop()) status += 32;
827 if(gMC->IsTrackAlive()) status += 64;
829 // Fill hit structure.
830 gMC->TrackPosition(position);
831 gMC->TrackMomentum(momentum);
832 id = gMC->CurrentVolID(cpy0);
833 gMC->CurrentVolOffID(3,cpy1);
834 if(id==fIdSens[0])ncpys=10;
835 if(id==fIdSens[1])ncpys=2;
836 fIgm.DecodeDetector(mod,ncpys,cpy0,cpy1,1);
838 // Fill hit structure.
841 hit.SetTrack(gAlice->GetMCApp()->GetCurrentTrackNumber());
842 gMC->TrackPosition(position);
843 gMC->TrackMomentum(momentum);
844 hit.SetPosition(position);
845 hit.SetTime(gMC->TrackTime());
846 hit.SetMomentum(momentum);
847 hit.SetStatus(status);
848 hit.SetEdep(gMC->Edep());
849 hit.SetShunt(GetIshunt());
850 if(gMC->IsTrackEntering()){
851 hit.SetStartPosition(position);
852 hit.SetStartTime(gMC->TrackTime());
853 hit.SetStartStatus(status);
854 return; // don't save entering hit.
855 } // end if IsEntering
856 // Fill hit structure with this new hit.
857 //Info("StepManager","Calling Copy Constructor");
858 new(lhits[fNhits++]) AliITShit(hit); // Use Copy Construtor.
859 // Save old position... for next hit.
860 hit.SetStartPosition(position);
861 hit.SetStartTime(gMC->TrackTime());
862 hit.SetStartStatus(status);