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 **************************************************************************/
20 #include <Riostream.h>
24 #include <TGeometry.h>
29 #include <TFile.h> // only required for Tracking function?
31 #include <TObjArray.h>
32 #include <TLorentzVector.h>
33 #include <TObjString.h>
34 #include <TClonesArray.h>
37 #include <TVirtualMC.h>
43 #include "AliITSGeant3Geometry.h"
44 #include "AliTrackReference.h"
45 #include "AliITShit.h"
47 #include "AliITSvSDD03.h"
48 #include "AliITSgeom.h"
49 #include "AliITSgeomSPD.h"
50 #include "AliITSgeomSDD.h"
51 #include "AliITSgeomSSD.h"
52 #include "AliITSDetType.h"
53 #include "AliITSresponseSPD.h"
54 #include "AliITSresponseSDD.h"
55 #include "AliITSresponseSSD.h"
56 #include "AliITSsegmentationSPD.h"
57 #include "AliITSsegmentationSDD.h"
58 #include "AliITSsegmentationSSD.h"
59 #include "AliITSsimulationSPD.h"
60 #include "AliITSsimulationSDD.h"
61 #include "AliITSsimulationSSD.h"
62 #include "AliITSClusterFinderSPD.h"
63 #include "AliITSClusterFinderSDD.h"
64 #include "AliITSClusterFinderSSD.h"
67 ClassImp(AliITSvSDD03)
69 //______________________________________________________________________
70 AliITSvSDD03::AliITSvSDD03() {
71 ////////////////////////////////////////////////////////////////////////
72 // Standard default constructor for the ITS SDD test beam 2002 version 1.
78 // A default created class.
79 ////////////////////////////////////////////////////////////////////////
85 fEuclidOut = kFALSE; // Don't write Euclide file
86 fGeomDetOut = kFALSE; // Don't write .det file
87 fGeomDetIn = kFALSE; // Don't Read .det file
88 fMajorVersion = IsVersion();
90 for(i=0;i<60;i++) fRead[i] = '\0';
91 for(i=0;i<60;i++) fWrite[i] = '\0';
92 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
94 //______________________________________________________________________
95 AliITSvSDD03::AliITSvSDD03(const char *title,Int_t year) : AliITS("ITS", title){
96 ////////////////////////////////////////////////////////////////////////
97 // Standard constructor for the ITS SDD testbeam 2002 version 1.
99 // const char *title title for this ITS geometry.
103 // A standard created class.
104 ////////////////////////////////////////////////////////////////////////
108 fIdName = new TString[fIdN];
111 fIdSens = new Int_t[fIdN];
112 for(i=0;i<fIdN;i++) fIdSens[i] = 0;
113 fMajorVersion = IsVersion();
115 fEuclidOut = kFALSE; // Don't write Euclide file
116 fGeomDetOut = kFALSE; // Don't write .det file
117 fGeomDetIn = kFALSE; // Don't Read .det file
124 fEuclidGeometry="$ALICE_ROOT/ITS/ITSgeometry_vSDD032.euc";
125 strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_vSDD032.det",60);
126 strncpy(fRead,fEuclidGeomDet,60);
127 strncpy(fWrite,fEuclidGeomDet,60);
129 //______________________________________________________________________
130 AliITSvSDD03::AliITSvSDD03(const AliITSvSDD03 &source) : AliITS(source){
131 ////////////////////////////////////////////////////////////////////////
132 // Copy Constructor for ITS SDD test beam 2002 version 1.
133 // This class is not to be copied. Function only dummy.
135 // const AliITSvSDD03 &source The class to be copied
139 // A warning message.
140 ////////////////////////////////////////////////////////////////////////
141 if(&source == this) return;
142 Warning("Copy Constructor","Not allowed to copy AliITSvSDD03");
145 //______________________________________________________________________
146 AliITSvSDD03& AliITSvSDD03::operator=(const AliITSvSDD03 &source){
147 ////////////////////////////////////////////////////////////////////////
148 // Assignment operator for the ITS SDD test beam 2002 version 1.
149 // This class is not to be copied. Function only dummy.
151 // const AliITSvSDD03 &source The class to be copied
156 ////////////////////////////////////////////////////////////////////////
157 if(&source == this) return *this;
158 Warning("= operator","Not allowed to copy AliITSvSDD03");
161 //______________________________________________________________________
162 AliITSvSDD03::~AliITSvSDD03() {
163 ////////////////////////////////////////////////////////////////////////
164 // Standard destructor for the ITS SDD test beam 2002 version 1.
171 ////////////////////////////////////////////////////////////////////////
173 //______________________________________________________________________
174 void AliITSvSDD03::BuildGeometry(){
175 ////////////////////////////////////////////////////////////////////////
176 // Geometry builder for the ITS SDD test beam 2002 version 1.
177 // ALIC ALICE Mother Volume
178 // |- ITSV ITS Mother Volume
179 // |- IDET Detector under Test
180 // | |- ITS0 SDD Si Chip
181 // | | |- ITST SDD Sensitivve Volume
182 // | |- IPC0 *5 Readout chip
183 // |- ITEL *4 SDD Telescope
184 // |- IMB0 SDD Si Chip
185 // | |- IMBS SDD Sensitive volume
186 // |- ICMB Chip MiniBus.
193 ////////////////////////////////////////////////////////////////////////
194 // Get the top alice volume.
195 TNode *ALIC = gAlice->GetGeometry()->GetNode("alice");
198 // Define ITS Mother Volume
200 Float_t ddettest=200.0E-4,ddettelescope=300.0E-4;
201 Float_t dchipMiniBus=750.0E-4,dchiptest=300.0E-4;
202 //Float_t yposition= 0.0;
203 TRotMatrix *r0 = new TRotMatrix("ITSidrotm0","ITSidrotm0",
204 90.0,0,0.0,0,90.0,270.0);
208 TBRIK *ITSVshape = new TBRIK("ITSVshape","ITS Logical Mother Volume","Air",
209 data[0],data[1],data[2]);
210 TNode *ITSV = new TNode("ITSV","ITS Mother Volume",ITSVshape,
212 ITSV->cd(); // set ourselve into ITSV subvolume of ALIC
214 // SDD part of telescope (MiniBuS)
216 data[1] = 0.5*ddettelescope;
218 TBRIK *IMB0shape = new TBRIK("IMB0shape","SDD wafer","Si",
219 data[0],data[1],data[2]);
220 Float_t detMiniBusX,detMiniBusY,detMiniBusZ;
221 data[0] = detMiniBusX = 0.64;
222 data[1] = detMiniBusY = 0.5*ddettelescope;
223 data[2] = detMiniBusZ = 3.48;
224 TBRIK *IMBSshape = new TBRIK("IMBSshape","SDD Sensitive volume","Si",
225 data[0],data[1],data[2]);
226 Float_t chipMiniBusX,chipMiniBusY,chipMiniBusZ;
227 data[0] = chipMiniBusX = 0.793;
228 data[1] = chipMiniBusY = 0.5*dchipMiniBus;
229 data[2] = chipMiniBusZ = 0.68;
230 TBRIK *ICMBshape = new TBRIK("ICMBshape","chip Minibus","Si",
231 data[0],data[1],data[2]);
232 data[0] = TMath::Max(detMiniBusX,chipMiniBusX);
233 data[1] = detMiniBusY+chipMiniBusY;
234 data[2] = TMath::Max(detMiniBusZ,chipMiniBusZ);
235 TBRIK *ITELshape = new TBRIK("ITELshape","ITELshape","Air",
236 data[0],data[1],data[2]);
239 Float_t spdX,spdY,spdZ,spdchipX,spdchipY,spdchipZ;
243 TBRIK *ITS0shape = new TBRIK("ITS0shape","SDD wafer","Si",
244 data[0],data[1],data[2]); // contains detector
245 data[0] = spdX = 0.64;
246 data[1] = spdY = ddettest;
247 data[2] = spdZ = 3.48;
248 TBRIK *ITSTshape = new TBRIK("ITSTshape","SDD sensitive volume","Si",
249 data[0],data[1],data[2]);
250 // ITS0 with no translation and unit rotation matrix.
251 data[0] = spdchipX = 0.793;
252 data[1] = spdchipY = dchiptest;
253 data[2] = spdchipZ = 0.68;
254 TBRIK *IPC0shape = new TBRIK("IPC0shape","Readout Chips","Si",
255 data[0],data[1],data[2]); // chip under test
256 data[0] = TMath::Max(spdchipX,spdX);
257 data[1] = spdY+spdchipY;
258 data[2] = TMath::Max(spdchipZ,spdZ);
259 TBRIK *IDETshape = new TBRIK("IDETshape","Detector Under Test","Air",
260 data[0],data[1],data[2]);
261 // Place volumes in geometry
263 char name[20],title[50];
264 Double_t px=0.0,py=0.0,pz[4]={-38.0,0.0,0.0,0.0};
266 pz[2] = pz[1]+38.0+spdY+spdchipY+34.5;
268 TNode *ITEL[4],*ICMB[4],*IMB0[4],*IMBS[4];
269 TNode *IDET = new TNode("IDET","Detector Under Test",IDETshape,
270 0.0,0.0,pz[1]+38.0,r0,0);
272 TNode *ITS0 = new TNode("ITS0","SDD Chip",ITS0shape,
273 0.0,IDETshape->GetDy()-spdY,0.0,0,0);
275 for(i=0;i<5;i++) { //place readout chips on the back of SDD chip under test
276 sprintf(name,"IPC0%d",i);
277 sprintf(title,"Readout chip #%d",i+1);
279 IPC0[i] = new TNode(name,title,IPC0shape,
280 0.0,spdchipY-IDETshape->GetDy(),
281 j*2.0*spdchipZ+j*0.25*(spdZ-5.*spdchipZ),0,0);
284 TNode *ITST = new TNode("ITST","SDD sensitive volume",ITSTshape,
286 for(Int_t i=0;i<4;i++){
288 sprintf(name,"ITEL%d",i);
289 sprintf(title,"Test beam telescope element #%d",i+1);
290 ITEL[i] = new TNode(name,title,ITELshape,px,py,pz[i],r0,0);
292 ICMB[i] = new TNode("ICMB","Chip MiniBus",ICMBshape,
293 0.0,-ITELshape->GetDy()+detMiniBusY,0.0,0,0);
294 IMB0[i] = new TNode("IMB0","Chip MiniBus",IMB0shape,
295 0.0, ITELshape->GetDy()-detMiniBusY,0.0,0,0);
297 IMBS[i] = new TNode("IMBS","IMBS",IMBSshape,0.0,0.0,0.0,0,0);
298 // place IMBS inside IMB0 with no translation and unit rotation matrix.
301 ITST->SetLineColor(kYellow);
304 IMBS[i]->SetLineColor(kGreen);
305 fNodes->Add(IMBS[i]);
308 //______________________________________________________________________
309 void AliITSvSDD03::CreateGeometry(){
310 ////////////////////////////////////////////////////////////////////////
311 // This routine defines and Creates the geometry for version 1 of the ITS.
312 // ALIC ALICE Mother Volume
313 // |- ITSV ITS Mother Volume
314 // |- IDET Detector under Test (box containing SDD)
315 // | |-IDAI Air inside box
316 // | |- ITS0 SDD Si Chip
317 // | |- ITST SDD Sensitivve Volume
318 // |- ITEL *10 SSD Telescope (plastic box containting SSD's)
319 // | |- ITAI Air inside box
320 // | |- IMB0 SDD Si Chip
321 // | |- IMBS SDD Sensitive volume
322 // |-ISNT*4 Sintilator triggers
329 ////////////////////////////////////////////////////////////////////////
331 // Define media off-set
332 Int_t *idtmed = fIdtmed->GetArray()+1; // array of media indexes
333 Int_t idrotm[4]; // Array of rotation matrix indexes
334 //Float_t ddettest=200.0E-4,ddettelescope=300.0E-4;
335 //Float_t dchipMiniBus=750.0E-4,dchiptest=300.0E-4;
336 //Float_t yposition= 0.0;
337 const Float_t kmm=0.1,kcm=1.0,kmicm=0.001;
339 // Define Rotation-reflextion Matrixes needed
340 // 0 is the unit matrix
341 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0); // SDD and SSD X
342 AliMatrix(idrotm[1], 90.0,0.0, 0.0,0.0, 90.0,270.0); // SSD Y
346 gMC->Gsvolu("ITSV","BOX ",idtmed[0],data,3);
347 gMC->Gspos("ITSV",1,"ALIC",0.0,0.0,0.0,0,"ONLY");
349 //cout << "idtmed[0]=" << idtmed[0]<<endl;
350 //cout << "idtmed[1]=" << idtmed[1]<<endl;
351 // Crossed sintilator triggers (2 in front 2 in back)
352 AliMatrix(idrotm[2],90.0,0.0,90.0,90.0,90.0,0.0);//Rotate about Z 90 degree
356 gMC->Gsvolu("ISNT","BOX ",idtmed[3],data,3);
357 gMC->Gspos("ISNT",1,"ITSV",0.0,0.0,800.0*kmm+data[2],0,"ONLY");
358 gMC->Gspos("ISNT",2,"ITSV",0.0,0.0,800.0*kmm,idrotm[2],"ONLY");
359 gMC->Gspos("ISNT",3,"ITSV",0.0,0.0,-800.0*kmm,0,"ONLY");
360 gMC->Gspos("ISNT",4,"ITSV",0.0,0.0,-800.0*kmm-data[2],idrotm[2],"ONLY");
361 Float_t detMiniBusX,detMiniBusY,detMiniBusZ;
362 // SSD part of telescope (MiniBuS)
363 data[0] = detMiniBusX = 10600.0*kmicm;
364 data[1] = detMiniBusY = 0.0150*kcm;
365 data[2] = detMiniBusZ = 1.1*kcm;
366 gMC->Gsvolu("IMB0", "BOX ", idtmed[1], data, 3); // contains detector
367 data[0] = 0.5*384*50*kmicm;
368 data[1] = 0.1499*kcm;
370 gMC->Gsvolu("IMBS","BOX ",idtmed[1],data,3); // sensitive detecor volulme
371 gMC->Gspos("IMBS",1,"IMB0",0.0,0.0,0.0,0,"ONLY"); // place IMBS inside
372 // Box containing SSD's
376 gMC->Gsvolu("ITAI","BOX ",idtmed[0],data,3);
377 // Plastic box size = insize + thickness.
378 data[0] = data[0] + 2.0*kmm;
379 data[1] = data[1] + 200.0*kmicm;
380 data[2] = data[2] + 2.0*kmm;
381 gMC->Gsvolu("ITEL","BOX ",idtmed[4],data,3);
382 gMC->Gspos("ITAI",1,"ITEL",0.0,0.0,0.0,0,"ONLY");
383 gMC->Gspos("IMB0",1,"ITAI",0.0,data[1]-detMiniBusY,0.0,0,"ONLY");
386 Float_t sddX,sddY,sddZ;
387 data[0] = sddX = 3.62500*kcm;
388 data[1] = sddY = 0.01500*kcm;
389 data[2] = sddZ = 4.37940*kcm;
390 gMC->Gsvolu("ITS0", "BOX ", idtmed[1], data, 3); // contains detector
391 data[0] = 3.50860*kcm;
392 data[1] = 0.01499*kcm;
393 data[2] = 3.76320*kcm;
394 gMC->Gsvolu("ITST","BOX ",idtmed[1],data,3);// sensitive detecor volume
395 gMC->Gspos("ITST",1,"ITS0",0.0,0.0,0.0,0,"ONLY"); // place ITST inside
396 // Box containing SDD under test
400 gMC->Gsvolu("IDAI","BOX ",idtmed[0],data,3);
401 data[0] = data[0] + 2.0*kmm;
402 data[1] = data[1] + 200.0*kmicm;
403 data[2] = data[2] = 2.0*kmm;
404 gMC->Gsvolu("IDET","BOX ",idtmed[0],data,3);
405 gMC->Gspos("IDAI",1,"IDET",0.0,0.0,0.0,0,"ONLY");
406 gMC->Gspos("ITS0",1,"IDAI",0.0,0.0,0.0,0,"ONLY");
408 // Positions detectors, Beam Axis Z, X to the right, Y up to the sky.
409 Float_t p00X,p00Y,p00Z,p01X,p01Y,p01Z,p10X,p10Y,p10Z,p11X,p11Y,p11Z;
413 gMC->Gspos("ITEL",1,"ITSV",p00X,p00Y,p00Z,idrotm[0],"ONLY");//SSD X
417 gMC->Gspos("ITEL",2,"ITSV",p01X,p01Y,p01Z,idrotm[1],"ONLY");//SSD Y
421 gMC->Gspos("ITEL",3,"ITSV",p01X,p01Y,p01Z,idrotm[0],"ONLY");//SSD X
425 Float_t pdetX,pdetY,pdetZ;
426 gMC->Gspos("ITEL",4,"ITSV",p01X,p01Y,p01Z,idrotm[1],"ONLY");//SSD Y
430 gMC->Gspos("IDET",1,"ITSV",pdetX,pdetY,pdetZ,idrotm[0],"ONLY");// Detecor
434 gMC->Gspos("ITEL",5,"ITSV",p10X,p10Y,p10Z,idrotm[0],"ONLY");//SSD X
438 gMC->Gspos("ITEL",6,"ITSV",p11X,p11Y,p11Z,idrotm[1],"ONLY");//SSD Y
442 gMC->Gspos("ITEL",7,"ITSV",p11X,p11Y,p11Z,idrotm[0],"ONLY");//SSD X
446 gMC->Gspos("ITEL",8,"ITSV",p11X,p11Y,p11Z,idrotm[1],"ONLY");//SSD Y
450 gMC->Gspos("ITEL",9,"ITSV",p11X,p11Y,p11Z,idrotm[0],"ONLY");//SSD X
454 gMC->Gspos("ITEL",10,"ITSV",p11X,p11Y,p11Z,idrotm[1],"ONLY");//SSD Y
456 //______________________________________________________________________
457 void AliITSvSDD03::CreateMaterials(){
458 ////////////////////////////////////////////////////////////////////////
460 // Create ITS SDD test beam materials
461 // This function defines the default materials used in the Geant
462 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
464 // In general it is automatically replaced by
465 // the CreatMaterials routine defined in AliITSv?. Should the function
466 // CreateMaterials not exist for the geometry version you are using this
467 // one is used. See the definition found in AliITSv5 or the other routine
468 // for a complete definition.
476 /////////////////////////////////////////////////////////////////////////
477 Float_t tmaxfdSi = 0.1; // Degree
478 Float_t stemaxSi = 0.0075; // cm
479 Float_t deemaxSi = 0.1; // Fraction of particle's energy 0<deemax<=1
480 Float_t epsilSi = 1.0E-4;//
481 Float_t stminSi = 0.0; // cm "Default value used"
483 Float_t tmaxfdAir = 0.1; // Degree
484 Float_t stemaxAir = .10000E+01; // cm
485 Float_t deemaxAir = 0.1; // Fraction of particle's energy 0<deemax<=1
486 Float_t epsilAir = 1.0E-4;//
487 Float_t stminAir = 0.0; // cm "Default value used"
488 Int_t ifield = gAlice->Field()->Integ();
489 Float_t fieldm = gAlice->Field()->Max();
491 const Float_t kgpcm3=1.0,kcm=1.0;
493 Float_t z[10],a[10],w[10];
495 z[0] = 7.0; a[0] = 14.00674; w[0] = 0.80;
496 z[1] = 8.0; a[1] = 15.99940; w[1] = 0.20;
497 AliMixture(1,"AIR$",a,z,0.12050E-02*kgpcm3,2,w);
498 AliMedium(1,"AIR$",1,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,
501 AliMaterial(2,"SI$",0.28086E+02,0.14000E+02,0.23300E+01,
502 0.93600E+01*kcm,0.99900E+03);
503 AliMedium(2,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
505 // sintilator is basicaly polystyrene
506 z[0] = 7.0; a[0] = 14.00674; w[0] = 0.80;
507 AliMixture(3,"Sintilator$",a,z,1.032*kgpcm3,0,w);
508 AliMedium(3,"Sintilator$",3,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
510 // assumed to be Lucite/Plexiglas
511 z[0] = 7.0; a[0] = 14.00674; w[0] = 0.80;
512 AliMixture(4,"PlasticBox$",a,z,1.18*kgpcm3,0,w);
513 AliMedium(4,"PlasticBox$",4,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
516 //______________________________________________________________________
517 void AliITSvSDD03::InitAliITSgeom(){
518 // Based on the geometry tree defined in Geant 3.21, this
519 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
528 if(strcmp(gMC->GetName(),"TGeant3")) {
529 Error("InitAliITSgeom",
530 "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
533 cout << "Reading Geometry transformation directly from Geant 3." << endl;
535 const Float_t pitch=50.E-4;/*cm*/
536 Float_t box[3]={0.5*pitch*(Float_t)np,150.E-4,1.0},p[np],n[np];
537 const Int_t ltypess = 2;
538 const Int_t nlayers = 6;
539 const Int_t ndeep = 6;
540 Int_t itsGeomTreeNames[ltypess][ndeep],lnam[20],lnum[20];
541 Int_t nlad[nlayers],ndet[nlayers];
543 Float_t par[20],att[20];
544 Int_t npar,natt,idshape,imat,imed;
545 AliITSGeant3Geometry *ig = new AliITSGeant3Geometry();
546 Int_t mod,typ,lay,lad,det,cpy,i,j,k;
547 Char_t names[ltypess][ndeep][4];
548 Int_t itsGeomTreeCopys[ltypess][ndeep];
549 Char_t *namesA[ltypess][ndeep] = {
550 {"ALIC","ITSV","ITEL","ITAI","IMB0","IMBS"}, // lay=5
551 {"ALIC","ITSV","IDET","IDAI","ITS0","ITST"}};// Test SDD
552 Int_t itsGeomTreeCopysA[ltypess][ndeep]= {{1,1,10,1,1,1},// lay=5
553 {1,1,1,1,1,1}};//lay=3 TestSDD
554 for(i=0;i<ltypess;i++)for(j=0;j<ndeep;j++){
555 for(k=0;k<4;k++) names[i][j][k] = namesA[i][j][k];
556 itsGeomTreeCopys[i][j] = itsGeomTreeCopysA[i][j];
558 for(i=0;i<np;i++){// Fill in anode and cathode strip locations (lower edge)
559 p[i] = 0.5*pitch*(Float_t)np + pitch*(Float_t)i;
560 n[i] = pitch*(Float_t)np - p[i];
562 // Sorry, but this is not very pritty code. It should be replaced
563 // at some point with a version that can search through the geometry
565 cout << "Reading Geometry informaton from Geant3 common blocks" << endl;
566 for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
567 for(i=0;i<ltypess;i++)for(j=0;j<ndeep;j++)
568 strncpy((char*) &itsGeomTreeNames[i][j],names[i][j],4);
569 // itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
571 if(fITSgeom!=0) delete fITSgeom;
572 nlad[0]=1;nlad[1]=1;nlad[2]=1;nlad[3]=1;nlad[4]=1;
573 ndet[0]=1;ndet[1]=1;ndet[2]=1;ndet[3]=1;ndet[4]=1;
574 fITSgeom = new AliITSgeom(0,nlayers,nlad,ndet,mod);
575 for(typ=1;typ<=ltypess;typ++){
576 for(j=0;j<ndeep;j++) lnam[j] = itsGeomTreeNames[typ-1][j];
577 for(j=0;j<ndeep;j++) lnum[j] = itsGeomTreeCopys[typ-1][j];
580 for(cpy=1;cpy<=itsGeomTreeCopys[typ-1][2];cpy++){
583 if(cpy>2 && typ==1) lay = cpy +1;
586 ig->GetGeometry(ndeep,lnam,lnum,t,r,idshape,npar,natt,par,att,
590 if(!(fITSgeom->IsShapeDefined((Int_t)kSDD))){
591 fITSgeom->CreatMatrix(mod,lay,lad,det,kSDD,t,r);
592 fITSgeom->ReSetShape(kSDD,new AliITSgeomSDD256(npar,par));
596 if(!(fITSgeom->IsShapeDefined((Int_t)kSSD))){
597 fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
598 fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD(box,0.0,0.0,
607 //______________________________________________________________________
608 void AliITSvSDD03::Init(){
609 ////////////////////////////////////////////////////////////////////////
610 // Initialise the ITS after it has been created.
617 ////////////////////////////////////////////////////////////////////////
621 for(i=0;i<26;i++) cout << "*";
622 cout << " AliITSvSDD03" << fMinorVersion << "_Init ";
623 for(i=0;i<25;i++) cout << "*";cout << endl;
625 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
626 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
627 if(fITSgeom!=0) delete fITSgeom;
628 fITSgeom = new AliITSgeom();
629 if(fGeomDetIn) fITSgeom->ReadNewFile(fRead);
630 if(!fGeomDetIn) this->InitAliITSgeom();
631 if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
634 for(i=0;i<72;i++) cout << "*";
636 fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID.
638 //______________________________________________________________________
639 void AliITSvSDD03::SetDefaults(){
640 // sets the default segmentation, response, digit and raw cluster classes
647 const Float_t kconv = 1.0e+04; // convert cm to microns
649 Info("SetDefaults","Setting up only SDD detector");
651 AliITSDetType *iDetType;
655 //Float_t bx[256],bz[280];
658 iDetType=DetType(kSDD);
659 s1 = (AliITSgeomSDD*) fITSgeom->GetShape(kSDD);// Get shape info. Do it this way for now.
660 AliITSresponseSDD *resp1=new AliITSresponseSDD("simulated");
661 SetResponseModel(kSDD,resp1);
662 AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(fITSgeom,resp1);
663 seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD
664 s1->GetDz()*2.*kconv, // for now.
665 s1->GetDy()*2.*kconv); // x,z,y full width in microns.
666 seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
667 SetSegmentationModel(kSDD,seg1);
668 const char *kData1=(iDetType->GetResponseModel())->DataType();
669 const char *kopt=iDetType->GetResponseModel()->ZeroSuppOption();
670 if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){
671 iDetType->ClassNames("AliITSdigit","AliITSRawClusterSDD");
672 } else iDetType->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD");
673 // SetSimulationModel(kSDD,new AliITSsimulationSDD(seg1,resp1));
674 // iDetType->ReconstructionModel(new AliITSClusterFinderSDD());
677 iDetType=DetType(kSSD);
678 s2 = (AliITSgeomSSD*) fITSgeom->GetShape(kSSD);// Get shape info. Do it this way for now.
679 AliITSresponse *resp2=new AliITSresponseSSD("simulated");
680 SetResponseModel(kSSD,resp2);
681 AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(fITSgeom);
682 seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD
683 s2->GetDz()*2.*kconv, // for now.
684 s2->GetDy()*2.*kconv); // x,z,y full width in microns.
685 seg2->SetPadSize(95.,0.); // strip x pitch in microns
686 seg2->SetNPads(768,0); // number of strips on each side.
687 seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side.
688 seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
689 seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
690 SetSegmentationModel(kSSD,seg2);
691 const char *kData2=(iDetType->GetResponseModel())->DataType();
692 if(strstr(kData2,"real") ) iDetType->ClassNames("AliITSdigit",
693 "AliITSRawClusterSSD");
694 else iDetType->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD");
695 // SetSimulationModel(kSSD,new AliITSsimulationSSD(seg2,resp2));
696 // iDetType->ReconstructionModel(new AliITSClusterFinderSSD());
699 Warning("SetDefaults",
700 "Only the four basic detector types are initialised!");
704 //______________________________________________________________________
705 void AliITSvSDD03::DrawModule(){
706 ////////////////////////////////////////////////////////////////////////
707 // Draw a shaded view of the ITS SDD test beam version 1.
714 ////////////////////////////////////////////////////////////////////////
715 // Set everything unseen
716 gMC->Gsatt("*", "seen", -1);
717 // Set ALIC mother visible
718 gMC->Gsatt("ALIC","SEEN",0);
719 // Set ALIC ITS visible
720 gMC->Gsatt("ITSV","SEEN",0);
721 // Set ALIC Telescopes visible
722 gMC->Gsatt("ITEL","SEEN",0);
723 // Set ALIC detetcor visible
724 gMC->Gsatt("IDET","SEEN",0);
725 // Set Detector chip mother visible and drawn
726 gMC->Gsatt("IPC0","SEEN",1);
727 // Set Detector mother visible and drawn
728 gMC->Gsatt("ITS0","SEEN",1);
729 // Set minibus chip mother visible and drawn
730 gMC->Gsatt("ICMB","SEEN",1);
731 // Set minibus mother visible and drawn
732 gMC->Gsatt("IMB0","SEEN",1);
734 //______________________________________________________________________
735 void AliITSvSDD03::StepManager(){
736 ////////////////////////////////////////////////////////////////////////
737 // Called for every step in the ITS SDD test beam, then calles the
738 // AliITShit class creator with the information to be recoreded about
740 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
741 // printing of information to a file which can be used to create a .det
742 // file read in by the routine CreateGeometry(). If set to 0 or any other
743 // value except 1, the default behavior, then no such file is created nor
744 // it the extra variables and the like used in the printing allocated.
751 ////////////////////////////////////////////////////////////////////////
753 TLorentzVector position, momentum;
754 static TLorentzVector position0;
755 static Int_t stat0=0;
756 if((id=gMC->CurrentVolID(copy) == fIDMother)&&
757 (gMC->IsTrackEntering()||gMC->IsTrackExiting())){
758 copy = fTrackReferences->GetEntriesFast();
759 TClonesArray &lTR = *fTrackReferences;
760 // Fill TrackReference structure with this new TrackReference.
761 new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
762 } // if Outer ITS mother Volume
763 if(!(this->IsActive())){
765 } // end if !Active volume.
767 TClonesArray &lhits = *fHits;
772 if(gMC->IsTrackInside()) vol[3] += 1;
773 if(gMC->IsTrackEntering()) vol[3] += 2;
774 if(gMC->IsTrackExiting()) vol[3] += 4;
775 if(gMC->IsTrackOut()) vol[3] += 8;
776 if(gMC->IsTrackDisappeared()) vol[3] += 16;
777 if(gMC->IsTrackStop()) vol[3] += 32;
778 if(gMC->IsTrackAlive()) vol[3] += 64;
780 // Fill hit structure.
781 if(!(gMC->TrackCharge())) return;
782 id = gMC->CurrentVolID(copy);
783 if(id==fIdSens[0]){ // Volume name "IMBS"
784 vol[2] = 1; // detector
785 id = gMC->CurrentVolOffID(3,copy);
786 //detector copy in the ladder = 1<->4 (ITS1 < I101 < I103 < I10A)
787 vol[1] = copy; // ladder
794 } else if(id == fIdSens[1]){ // Volume name "ITST"
796 vol[1] = 1; // ladder
797 id = gMC->CurrentVolOffID(3,copy);
798 //detector copy in the ladder = 1<->4 (ITS2 < I1D1 < I1D3 < I20A)
799 vol[2] = 1; // detector
800 } else return; // end if
802 gMC->TrackPosition(position);
803 gMC->TrackMomentum(momentum);
805 if(gMC->IsTrackEntering()){
806 position0 = position;
809 } // end if IsEntering
810 // Fill hit structure with this new hit only for non-entrerance hits.
811 else new(lhits[fNhits++]) AliITShit(fIshunt,
812 gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,
813 gMC->Edep(),gMC->TrackTime(),position,
816 position0 = position;