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 Revision 1.2 2003/02/12 10:39:05 hristov
19 Updated AliTrackReference class (S.Radomski)
21 Revision 1.1 2002/12/05 20:07:25 nilsen
22 Adding new SPD 2002 test-beam geometry, with Config file (setup for testing,
23 50 pions in one event and not 50 events with one pion).
26 #include <Riostream.h>
30 #include <TGeometry.h>
35 #include <TFile.h> // only required for Tracking function?
37 #include <TObjArray.h>
38 #include <TLorentzVector.h>
39 #include <TObjString.h>
40 #include <TClonesArray.h>
47 #include "AliITSGeant3Geometry.h"
48 #include "AliTrackReference.h"
49 #include "AliITShit.h"
51 #include "AliITSvSPD02.h"
52 #include "AliITSgeom.h"
53 #include "AliITSgeomSPD.h"
54 #include "AliITSgeomSDD.h"
55 #include "AliITSgeomSSD.h"
56 #include "AliITSDetType.h"
57 #include "AliITSresponseSPD.h"
58 #include "AliITSresponseSDD.h"
59 #include "AliITSresponseSSD.h"
60 #include "AliITSsegmentationSPD.h"
61 #include "AliITSsegmentationSDD.h"
62 #include "AliITSsegmentationSSD.h"
63 #include "AliITSsimulationSPD.h"
64 #include "AliITSsimulationSDD.h"
65 #include "AliITSsimulationSSD.h"
66 #include "AliITSClusterFinderSPD.h"
67 #include "AliITSClusterFinderSDD.h"
68 #include "AliITSClusterFinderSSD.h"
71 ClassImp(AliITSvSPD02)
73 //______________________________________________________________________
74 AliITSvSPD02::AliITSvSPD02() {
75 ////////////////////////////////////////////////////////////////////////
76 // Standard default constructor for the ITS SPD test beam 2002 version 1.
82 // A default created class.
83 ////////////////////////////////////////////////////////////////////////
89 fEuclidOut = kFALSE; // Don't write Euclide file
90 fGeomDetOut = kFALSE; // Don't write .det file
91 fGeomDetIn = kFALSE; // Don't Read .det file
92 fMajorVersion = IsVersion();
94 for(i=0;i<60;i++) fRead[i] = '\0';
95 for(i=0;i<60;i++) fWrite[i] = '\0';
96 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
98 //______________________________________________________________________
99 AliITSvSPD02::AliITSvSPD02(const char *title) : AliITS("ITS", title){
100 ////////////////////////////////////////////////////////////////////////
101 // Standard constructor for the ITS SPD testbeam 2002 version 1.
103 // const char *title title for this ITS geometry.
107 // A standard created class.
108 ////////////////////////////////////////////////////////////////////////
112 fIdName = new TString[fIdN];
115 fIdSens = new Int_t[fIdN];
116 for(i=0;i<fIdN;i++) fIdSens[i] = 0;
117 fMajorVersion = IsVersion();
119 fEuclidOut = kFALSE; // Don't write Euclide file
120 fGeomDetOut = kFALSE; // Don't write .det file
121 fGeomDetIn = kFALSE; // Don't Read .det file
127 fEuclidGeometry="$ALICE_ROOT/ITS/ITSgeometry_vSPD022.euc";
128 strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_vSPD022.det",60);
129 strncpy(fRead,fEuclidGeomDet,60);
130 strncpy(fWrite,fEuclidGeomDet,60);
132 //______________________________________________________________________
133 AliITSvSPD02::AliITSvSPD02(const AliITSvSPD02 &source){
134 ////////////////////////////////////////////////////////////////////////
135 // Copy Constructor for ITS SPD test beam 2002 version 1.
136 // This class is not to be copied. Function only dummy.
138 // const AliITSvSPD02 &source The class to be copied
142 // A warning message.
143 ////////////////////////////////////////////////////////////////////////
144 if(&source == this) return;
145 Warning("Copy Constructor","Not allowed to copy AliITSvSPD02");
148 //______________________________________________________________________
149 AliITSvSPD02& AliITSvSPD02::operator=(const AliITSvSPD02 &source){
150 ////////////////////////////////////////////////////////////////////////
151 // Assignment operator for the ITS SPD test beam 2002 version 1.
152 // This class is not to be copied. Function only dummy.
154 // const AliITSvSPD02 &source The class to be copied
159 ////////////////////////////////////////////////////////////////////////
160 if(&source == this) return *this;
161 Warning("= operator","Not allowed to copy AliITSvSPD02");
164 //______________________________________________________________________
165 AliITSvSPD02::~AliITSvSPD02() {
166 ////////////////////////////////////////////////////////////////////////
167 // Standard destructor for the ITS SPD test beam 2002 version 1.
174 ////////////////////////////////////////////////////////////////////////
176 //______________________________________________________________________
177 void AliITSvSPD02::BuildGeometry(){
178 ////////////////////////////////////////////////////////////////////////
179 // Geometry builder for the ITS SPD test beam 2002 version 1.
180 // ALIC ALICE Mother Volume
181 // |- ITSV ITS Mother Volume
182 // |- IDET Detector under Test
183 // | |- ITS0 SPD Si Chip
184 // | | |- ITST SPD Sensitivve Volume
185 // | |- IPC0 *5 Readout chip
186 // |- ITEL *4 SPD Telescope
187 // |- IMB0 SPD Si Chip
188 // | |- IMBS SPD Sensitive volume
189 // |- ICMB Chip MiniBus.
196 ////////////////////////////////////////////////////////////////////////
197 // Get the top alice volume.
198 TNode *ALIC = gAlice->GetGeometry()->GetNode("alice");
201 // Define ITS Mother Volume
203 Float_t ddettest=200.0E-4,ddettelescope=300.0E-4;
204 Float_t dchipMiniBus=750.0E-4,dchiptest=300.0E-4;
205 //Float_t yposition= 0.0;
206 TRotMatrix *r0 = new TRotMatrix("ITSidrotm0","ITSidrotm0",
207 90.0,0,0.0,0,90.0,270.0);
211 TBRIK *ITSVshape = new TBRIK("ITSVshape","ITS Logical Mother Volume","Air",
212 data[0],data[1],data[2]);
213 TNode *ITSV = new TNode("ITSV","ITS Mother Volume",ITSVshape,
215 ITSV->cd(); // set ourselve into ITSV subvolume of ALIC
217 // SPD part of telescope (MiniBuS)
219 data[1] = 0.5*ddettelescope;
221 TBRIK *IMB0shape = new TBRIK("IMB0shape","SPD wafer","Si",
222 data[0],data[1],data[2]);
223 Float_t detMiniBusX,detMiniBusY,detMiniBusZ;
224 data[0] = detMiniBusX = 0.64;
225 data[1] = detMiniBusY = 0.5*ddettelescope;
226 data[2] = detMiniBusZ = 3.48;
227 TBRIK *IMBSshape = new TBRIK("IMBSshape","SPD Sensitive volume","Si",
228 data[0],data[1],data[2]);
229 Float_t chipMiniBusX,chipMiniBusY,chipMiniBusZ;
230 data[0] = chipMiniBusX = 0.793;
231 data[1] = chipMiniBusY = 0.5*dchipMiniBus;
232 data[2] = chipMiniBusZ = 0.68;
233 TBRIK *ICMBshape = new TBRIK("ICMBshape","chip Minibus","Si",
234 data[0],data[1],data[2]);
235 data[0] = TMath::Max(detMiniBusX,chipMiniBusX);
236 data[1] = detMiniBusY+chipMiniBusY;
237 data[2] = TMath::Max(detMiniBusZ,chipMiniBusZ);
238 TBRIK *ITELshape = new TBRIK("ITELshape","ITELshape","Air",
239 data[0],data[1],data[2]);
242 Float_t spdX,spdY,spdZ,spdchipX,spdchipY,spdchipZ;
246 TBRIK *ITS0shape = new TBRIK("ITS0shape","SPD wafer","Si",
247 data[0],data[1],data[2]); // contains detector
248 data[0] = spdX = 0.64;
249 data[1] = spdY = ddettest;
250 data[2] = spdZ = 3.48;
251 TBRIK *ITSTshape = new TBRIK("ITSTshape","SPD sensitive volume","Si",
252 data[0],data[1],data[2]);
253 // ITS0 with no translation and unit rotation matrix.
254 data[0] = spdchipX = 0.793;
255 data[1] = spdchipY = dchiptest;
256 data[2] = spdchipZ = 0.68;
257 TBRIK *IPC0shape = new TBRIK("IPC0shape","Readout Chips","Si",
258 data[0],data[1],data[2]); // chip under test
259 data[0] = TMath::Max(spdchipX,spdX);
260 data[1] = spdY+spdchipY;
261 data[2] = TMath::Max(spdchipZ,spdZ);
262 TBRIK *IDETshape = new TBRIK("IDETshape","Detector Under Test","Air",
263 data[0],data[1],data[2]);
264 // Place volumes in geometry
266 char name[20],title[50];
267 Double_t px=0.0,py=0.0,pz[4]={-38.0,0.0,0.0,0.0};
269 pz[2] = pz[1]+38.0+spdY+spdchipY+34.5;
271 TNode *ITEL[4],*ICMB[4],*IMB0[4],*IMBS[4];
272 TNode *IDET = new TNode("IDET","Detector Under Test",IDETshape,
273 0.0,0.0,pz[1]+38.0,r0,0);
275 TNode *ITS0 = new TNode("ITS0","SPD Chip",ITS0shape,
276 0.0,IDETshape->GetDy()-spdY,0.0,0,0);
278 for(i=0;i<5;i++) { //place readout chips on the back of SPD chip under test
279 sprintf(name,"IPC0%d",i);
280 sprintf(title,"Readout chip #%d",i+1);
282 IPC0[i] = new TNode(name,title,IPC0shape,
283 0.0,spdchipY-IDETshape->GetDy(),
284 j*2.0*spdchipZ+j*0.25*(spdZ-5.*spdchipZ),0,0);
287 TNode *ITST = new TNode("ITST","SPD sensitive volume",ITSTshape,
289 for(Int_t i=0;i<4;i++){
291 sprintf(name,"ITEL%d",i);
292 sprintf(title,"Test beam telescope element #%d",i+1);
293 ITEL[i] = new TNode(name,title,ITELshape,px,py,pz[i],r0,0);
295 ICMB[i] = new TNode("ICMB","Chip MiniBus",ICMBshape,
296 0.0,-ITELshape->GetDy()+detMiniBusY,0.0,0,0);
297 IMB0[i] = new TNode("IMB0","Chip MiniBus",IMB0shape,
298 0.0, ITELshape->GetDy()-detMiniBusY,0.0,0,0);
300 IMBS[i] = new TNode("IMBS","IMBS",IMBSshape,0.0,0.0,0.0,0,0);
301 // place IMBS inside IMB0 with no translation and unit rotation matrix.
304 ITST->SetLineColor(kYellow);
307 IMBS[i]->SetLineColor(kGreen);
308 fNodes->Add(IMBS[i]);
311 //______________________________________________________________________
312 void AliITSvSPD02::CreateGeometry(){
313 ////////////////////////////////////////////////////////////////////////
314 // This routine defines and Creates the geometry for version 1 of the ITS.
315 // ALIC ALICE Mother Volume
316 // |- ITSV ITS Mother Volume
317 // |- IDET Detector under Test
318 // | |- ITS0 SPD Si Chip
319 // | | |- ITST SPD Sensitivve Volume
320 // | |- IPC0 *5 Readout chip
321 // |- ITEL *4 SPD Telescope
322 // |- IMB0 SPD Si Chip
323 // | |- IMBS SPD Sensitive volume
324 // |- ICMB Chip MiniBus.
331 ////////////////////////////////////////////////////////////////////////
333 // Define media off-set
334 Int_t *idtmed = fIdtmed->GetArray()+1; // array of media indexes
335 Int_t idrotm[4]; // Array of rotation matrix indexes
336 Float_t ddettest=200.0E-4,ddettelescope=300.0E-4;
337 Float_t dchipMiniBus=750.0E-4,dchiptest=300.0E-4;
338 Float_t yposition= 0.0;
340 // Define Rotation-reflextion Matrixes needed
341 // 0 is the unit matrix
342 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
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 Float_t detMiniBusX,detMiniBusY,detMiniBusZ;
352 // SPD part of telescope (MiniBuS)
353 data[0] = detMiniBusX = 0.705;
354 data[1] = detMiniBusY = 0.5*ddettelescope;
355 data[2] = detMiniBusZ = 3.536;
356 gMC->Gsvolu("IMB0", "BOX ", idtmed[1], data, 3); // contains detector
358 data[1] = 0.5*ddettelescope;
360 gMC->Gsvolu("IMBS","BOX ",idtmed[1],data,3); // sensitive detecor volulme
361 gMC->Gspos("IMBS",1,"IMB0",0.0,0.0,0.0,0,"ONLY"); // place IMBS inside
362 // IMB0 with no translation and unit rotation matrix.
363 Float_t chipMiniBusX,chipMiniBusY,chipMiniBusZ;
364 data[0] = chipMiniBusX = 0.793;
365 data[1] = chipMiniBusY = 0.5*dchipMiniBus;
366 data[2] = chipMiniBusZ = 0.68;
367 gMC->Gsvolu("ICMB","BOX ",idtmed[1],data, 3); // chip Minibus
368 data[0] = TMath::Max(detMiniBusX,chipMiniBusX);
369 data[1] = detMiniBusY+chipMiniBusY;
370 data[2] = TMath::Max(detMiniBusZ,chipMiniBusZ);
371 gMC->Gsvolu("ITEL","BOX ",idtmed[0],data,3);
372 gMC->Gspos("IMB0",1,"ITEL",0.0,data[1]-detMiniBusY,0.0,0,"ONLY");
373 gMC->Gspos("ICMB",1,"ITEL",0.0,-data[1]+chipMiniBusY,0.0,0,"ONLY");
376 Float_t spdX,spdY,spdZ,spdchipX,spdchipY,spdchipZ;
377 data[0] = spdX = 0.705;
378 data[1] = spdY = 0.5*ddettest;
379 data[2] = spdZ = 3.536;
380 gMC->Gsvolu("ITS0", "BOX ", idtmed[1], data, 3); // contains detector
382 data[1] = 0.5*ddettest;
384 gMC->Gsvolu("ITST","BOX ",idtmed[1],data,3);// sensitive detecor volume
385 gMC->Gspos("ITST",1,"ITS0",0.0,0.0,0.0,0,"ONLY"); // place ITST inside
386 // ITS0 with no translation and unit rotation matrix.
387 data[0] = spdchipX = 0.793;
388 data[1] = spdchipY = 0.5*dchiptest;
389 data[2] = spdchipZ = 0.68;
390 gMC->Gsvolu("IPC0", "BOX ", idtmed[1],data,3); // chip under test
391 data[0] = TMath::Max(spdchipX,spdX);
392 data[1] = spdY+spdchipY;
393 data[2] = TMath::Max(spdchipZ,spdZ);
394 gMC->Gsvolu("IDET","BOX ",idtmed[0],data,3);
395 gMC->Gspos("ITS0",1,"IDET",0.0,data[1]-spdY,0.0,0,"ONLY");
396 for(Int_t i=-2;i<3;i++) gMC->Gspos("IPC0",i+3,"IDET",0.0,-data[1]+spdchipY,
397 i*2.*spdchipZ+i*0.25*(spdZ-5.*spdchipZ),0,"ONLY");
399 // Positions detectors, Beam Axis Z, X to the right, Y up to the sky.
400 Float_t p00X,p00Y,p00Z,p01X,p01Y,p01Z,p10X,p10Y,p10Z,p11X,p11Y,p11Z;
404 gMC->Gspos("ITEL",1,"ITSV",p00X,p00Y,p00Z,idrotm[0],"ONLY");
408 gMC->Gspos("ITEL",2,"ITSV",p01X,p01Y,p01Z,idrotm[0],"ONLY");
409 Float_t pdetX,pdetY,pdetZ;
411 pdetY = 0.0+yposition;
413 gMC->Gspos("IDET",1,"ITSV",pdetX,pdetY,pdetZ,idrotm[0],"ONLY");
417 gMC->Gspos("ITEL",3,"ITSV",p10X,p10Y,p10Z,idrotm[0],"ONLY");
421 gMC->Gspos("ITEL",4,"ITSV",p11X,p11Y,p11Z,idrotm[0],"ONLY");
423 //______________________________________________________________________
424 void AliITSvSPD02::CreateMaterials(){
425 ////////////////////////////////////////////////////////////////////////
427 // Create ITS SPD test beam materials
428 // This function defines the default materials used in the Geant
429 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
431 // In general it is automatically replaced by
432 // the CreatMaterials routine defined in AliITSv?. Should the function
433 // CreateMaterials not exist for the geometry version you are using this
434 // one is used. See the definition found in AliITSv5 or the other routine
435 // for a complete definition.
443 /////////////////////////////////////////////////////////////////////////
444 Float_t tmaxfdSi = 0.1; // Degree
445 Float_t stemaxSi = 0.0075; // cm
446 Float_t deemaxSi = 0.1; // Fraction of particle's energy 0<deemax<=1
447 Float_t epsilSi = 1.0E-4;//
448 Float_t stminSi = 0.0; // cm "Default value used"
450 Float_t tmaxfdAir = 0.1; // Degree
451 Float_t stemaxAir = .10000E+01; // cm
452 Float_t deemaxAir = 0.1; // Fraction of particle's energy 0<deemax<=1
453 Float_t epsilAir = 1.0E-4;//
454 Float_t stminAir = 0.0; // cm "Default value used"
455 Int_t ifield = gAlice->Field()->Integ();
456 Float_t fieldm = gAlice->Field()->Max();
458 AliMaterial(1,"AIR$",0.14610E+02,0.73000E+01,0.12050E-02,
459 0.30423E+05,0.99900E+03);
460 AliMedium(1,"AIR$",1,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,
463 AliMaterial(2,"SI$",0.28086E+02,0.14000E+02,0.23300E+01,
464 0.93600E+01,0.99900E+03);
465 AliMedium(2,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
468 //______________________________________________________________________
469 void AliITSvSPD02::InitAliITSgeom(){
470 // Based on the geometry tree defined in Geant 3.21, this
471 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
479 if(strcmp(gMC->GetName(),"TGeant3")) {
480 Error("InitAliITSgeom",
481 "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
484 cout << "Reading Geometry transformation directly from Geant 3." << endl;
485 const Int_t nlayers = 6;
486 const Int_t ndeep = 5;
487 Int_t itsGeomTreeNames[nlayers][ndeep],lnam[20],lnum[20];
488 Int_t nlad[nlayers],ndet[nlayers];
490 Float_t par[20],att[20];
491 Int_t npar,natt,idshape,imat,imed;
492 AliITSGeant3Geometry *ig = new AliITSGeant3Geometry();
493 Int_t mod,lay,lad,det,i,j,k;
494 Char_t names[nlayers][ndeep][4];
495 Int_t itsGeomTreeCopys[nlayers][ndeep];
496 Char_t *namesA[nlayers][ndeep] = {
497 {"ALIC","ITSV","ITEL","IMB0","IMBS"}, // lay=1
498 {"ALIC","ITSV","IDET","ITS0","ITST"}};// Test SPD
499 Int_t itsGeomTreeCopysA[nlayers][ndeep]= {{1,1,4,1,1},// lay=1
500 {1,1,1,1,1}};//lay=2 TestSPD
501 for(i=0;i<nlayers;i++)for(j=0;j<ndeep;j++){
502 for(k=0;k<4;k++) names[i][j][k] = namesA[i][j][k];
503 itsGeomTreeCopys[i][j] = itsGeomTreeCopysA[i][j];
505 // Sorry, but this is not very pritty code. It should be replaced
506 // at some point with a version that can search through the geometry
508 cout << "Reading Geometry informaton from Geant3 common blocks" << endl;
509 for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
510 for(i=0;i<nlayers;i++)for(j=0;j<ndeep;j++)
511 itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
513 for(i=0;i<nlayers;i++){
515 for(j=0;j<ndeep;j++) if(itsGeomTreeCopys[i][j]!=0)
516 k *= TMath::Abs(itsGeomTreeCopys[i][j]);
520 if(fITSgeom!=0) delete fITSgeom;
521 nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38;
522 ndet[0]=4;ndet[1]=4;ndet[2]=6;ndet[3]=8;ndet[4]=22;ndet[5]=25;
523 fITSgeom = new AliITSgeom(0,6,nlad,ndet,mod);
525 for(lay=1;lay<=nlayers;lay++){
526 for(j=0;j<ndeep;j++) lnam[j] = itsGeomTreeNames[lay-1][j];
527 for(j=0;j<ndeep;j++) lnum[j] = itsGeomTreeCopys[lay-1][j];
529 case 1: case 2: // layers 1 and 2 are a bit special
531 for(j=1;j<=itsGeomTreeCopys[lay-1][4];j++){
533 for(k=1;k<=itsGeomTreeCopys[lay-1][5];k++){
536 for(det=1;det<=itsGeomTreeCopys[lay-1][6];det++){
539 ig->GetGeometry(ndeep,lnam,lnum,t,r,idshape,npar,natt,
541 fITSgeom->CreatMatrix(mod,lay,lad,det,kSPD,t,r);
542 if(!(fITSgeom->IsShapeDefined((Int_t)kSPD)))
543 fITSgeom->ReSetShape(kSPD,
544 new AliITSgeomSPD425Short(npar,par));
553 //______________________________________________________________________
554 void AliITSvSPD02::Init(){
555 ////////////////////////////////////////////////////////////////////////
556 // Initialise the ITS after it has been created.
563 ////////////////////////////////////////////////////////////////////////
567 for(i=0;i<26;i++) cout << "*";
568 cout << " ITSvSPD02" << fMinorVersion << "_Init ";
569 for(i=0;i<25;i++) cout << "*";cout << endl;
571 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
572 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
573 if(fITSgeom!=0) delete fITSgeom;
574 fITSgeom = new AliITSgeom();
575 if(fGeomDetIn) fITSgeom->ReadNewFile(fRead);
576 if(!fGeomDetIn) this->InitAliITSgeom();
577 if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
580 for(i=0;i<72;i++) cout << "*";
582 fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID.
584 //______________________________________________________________________
585 void AliITSvSPD02::SetDefaults(){
586 // sets the default segmentation, response, digit and raw cluster classes
593 const Float_t kconv = 1.0e+04; // convert cm to microns
595 Info("SetDefaults","Setting up only SPD detector");
597 AliITSDetType *iDetType;
600 Float_t bx[256],bz[280];
603 iDetType=DetType(kSPD);
604 s0 = (AliITSgeomSPD*) fITSgeom->GetShape(kSPD);// Get shape info. Do it this way for now.
605 AliITSresponse *resp0=new AliITSresponseSPD();
606 SetResponseModel(kSPD,resp0);
607 AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(fITSgeom);
608 seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD
609 s0->GetDz()*2.*kconv, // for now.
610 s0->GetDy()*2.*kconv); // x,z,y full width in microns.
611 seg0->SetNPads(256,160);// Number of Bins in x and z
612 for(i=000;i<256;i++) bx[i] = 50.0; // in x all are 50 microns.
613 for(i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below
614 for(i=160;i<280;i++) bz[i] = 0.0; // Outside of detector.
615 bz[ 31] = bz[ 32] = 625.0; // first chip boundry
616 bz[ 63] = bz[ 64] = 625.0; // first chip boundry
617 bz[ 95] = bz[ 96] = 625.0; // first chip boundry
618 bz[127] = bz[128] = 625.0; // first chip boundry
619 bz[160] = 425.0; // Set so that there is no zero pixel size for fNz.
620 seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now.
621 SetSegmentationModel(kSPD,seg0);
622 // set digit and raw cluster classes to be used
623 const char *kData0=(iDetType->GetResponseModel())->DataType();
624 if (strstr(kData0,"real")) iDetType->ClassNames("AliITSdigit",
625 "AliITSRawClusterSPD");
626 else iDetType->ClassNames("AliITSdigitSPD","AliITSRawClusterSPD");
627 // SetSimulationModel(kSPD,new AliITSsimulationSPD(seg0,resp0));
628 // iDetType->ReconstructionModel(new AliITSClusterFinderSPD());
631 Warning("SetDefaults",
632 "Only the four basic detector types are initialised!");
636 //______________________________________________________________________
637 void AliITSvSPD02::DrawModule(){
638 ////////////////////////////////////////////////////////////////////////
639 // Draw a shaded view of the ITS SPD test beam version 1.
646 ////////////////////////////////////////////////////////////////////////
647 // Set everything unseen
648 gMC->Gsatt("*", "seen", -1);
649 // Set ALIC mother visible
650 gMC->Gsatt("ALIC","SEEN",0);
651 // Set ALIC ITS visible
652 gMC->Gsatt("ITSV","SEEN",0);
653 // Set ALIC Telescopes visible
654 gMC->Gsatt("ITEL","SEEN",0);
655 // Set ALIC detetcor visible
656 gMC->Gsatt("IDET","SEEN",0);
657 // Set Detector chip mother visible and drawn
658 gMC->Gsatt("IPC0","SEEN",1);
659 // Set Detector mother visible and drawn
660 gMC->Gsatt("ITS0","SEEN",1);
661 // Set minibus chip mother visible and drawn
662 gMC->Gsatt("ICMB","SEEN",1);
663 // Set minibus mother visible and drawn
664 gMC->Gsatt("IMB0","SEEN",1);
666 //______________________________________________________________________
667 void AliITSvSPD02::StepManager(){
668 ////////////////////////////////////////////////////////////////////////
669 // Called for every step in the ITS SPD test beam, then calles the
670 // AliITShit class creator with the information to be recoreded about
672 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
673 // printing of information to a file which can be used to create a .det
674 // file read in by the routine CreateGeometry(). If set to 0 or any other
675 // value except 1, the default behavior, then no such file is created nor
676 // it the extra variables and the like used in the printing allocated.
683 ////////////////////////////////////////////////////////////////////////
685 TLorentzVector position, momentum;
686 static TLorentzVector position0;
687 static Int_t stat0=0;
688 if((id=gMC->CurrentVolID(copy) == fIDMother)&&
689 (gMC->IsTrackEntering()||gMC->IsTrackExiting())){
690 copy = fTrackReferences->GetEntriesFast();
691 TClonesArray &lTR = *fTrackReferences;
692 // Fill TrackReference structure with this new TrackReference.
693 new(lTR[copy]) AliTrackReference(gAlice->CurrentTrack(),gMC);
694 } // if Outer ITS mother Volume
695 if(!(this->IsActive())){
697 } // end if !Active volume.
699 TClonesArray &lhits = *fHits;
704 if(gMC->IsTrackInside()) vol[3] += 1;
705 if(gMC->IsTrackEntering()) vol[3] += 2;
706 if(gMC->IsTrackExiting()) vol[3] += 4;
707 if(gMC->IsTrackOut()) vol[3] += 8;
708 if(gMC->IsTrackDisappeared()) vol[3] += 16;
709 if(gMC->IsTrackStop()) vol[3] += 32;
710 if(gMC->IsTrackAlive()) vol[3] += 64;
712 // Fill hit structure.
713 if(!(gMC->TrackCharge())) return;
714 id = gMC->CurrentVolID(copy);
716 vol[0] = vol[1] = 1; // Layer, ladder
717 id = gMC->CurrentVolOffID(2,copy);
718 //detector copy in the ladder = 1<->4 (ITS1 < I101 < I103 < I10A)
719 vol[2] = copy; // detector
720 } else if(id == fIdSens[1]){
722 vol[1] = 2; // ladder
723 id = gMC->CurrentVolOffID(2,copy);
724 //detector copy in the ladder = 1<->4 (ITS2 < I1D1 < I1D3 < I20A)
725 vol[2] = copy; // detector
726 } else return; // end if
728 gMC->TrackPosition(position);
729 gMC->TrackMomentum(momentum);
731 if(gMC->IsTrackEntering()){
732 position0 = position;
734 } // end if IsEntering
735 // Fill hit structure with this new hit only for non-entrerance hits.
736 else new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,
737 gMC->Edep(),gMC->TrackTime(),position,
740 position0 = position;