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 **************************************************************************/
16 // Enrico Fragiacomo - 15/03/2004
17 // Geometry for the June 2003 SSD beam test
19 #include <TGeometry.h>
21 #include <TLorentzVector.h>
22 #include <TClonesArray.h>
27 #include "AliITSGeant3Geometry.h"
28 #include "AliTrackReference.h"
29 #include "AliITShit.h"
31 #include "AliITSvSSD03.h"
32 #include "AliITSgeom.h"
33 #include "AliITSgeomSSD.h"
34 #include "AliITSDetTypeSim.h"
35 #include "AliITSCalibrationSSD.h"
36 #include "AliITSsegmentationSSD.h"
37 #include "AliITSsimulationSSD.h"
41 ///////////////////////////////////////////////////////////////////////
46 // geometry of June 2003
48 ///////////////////////////////////////////////////////////////////////
49 ClassImp(AliITSvSSD03)
51 //______________________________________________________________________
52 AliITSvSSD03::AliITSvSSD03() {
53 ////////////////////////////////////////////////////////////////////////
54 // Standard default constructor for the ITS SSD test beam 2003 version 1.
60 // A default created class.
61 ////////////////////////////////////////////////////////////////////////
67 fEuclidOut = kFALSE; // Don't write Euclide file
68 fGeomDetOut = kFALSE; // Don't write .det file
69 fGeomDetIn = kFALSE; // Don't Read .det file
70 fMajorVersion = IsVersion();
72 fGeomNumber = 2003; // default value
73 for(i=0;i<60;i++) fRead[i] = '\0';
74 for(i=0;i<60;i++) fWrite[i] = '\0';
75 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
77 //______________________________________________________________________
78 AliITSvSSD03::AliITSvSSD03(const char *title,Int_t gn) : AliITS("ITS", title){
79 ////////////////////////////////////////////////////////////////////////
80 // Standard constructor for the ITS SSD testbeam 2003 version 1.
82 // const char *title title for this ITS geometry.
83 // Int_t gn Geometry version number (year) default 2003.
87 // A standard created class.
88 ////////////////////////////////////////////////////////////////////////
94 fIdName = new TString[fIdN];
96 fIdSens = new Int_t[fIdN];
97 for(i=0;i<fIdN;i++) fIdSens[i] = 0;
99 fMajorVersion = IsVersion();
101 fEuclidOut = kFALSE; // Don't write Euclide file
102 fGeomDetOut = kFALSE; // Don't write .det file
103 fGeomDetIn = kFALSE; // Don't Read .det file
110 fEuclidGeometry="$ALICE_ROOT/ITS/ITSgeometry_vSSD03.euc";
111 strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_vSSD03.det",60);
112 strncpy(fRead,fEuclidGeomDet,60);
113 strncpy(fWrite,fEuclidGeomDet,60);
115 //______________________________________________________________________
116 AliITSvSSD03::AliITSvSSD03(const AliITSvSSD03 &source) : AliITS(source){
117 ////////////////////////////////////////////////////////////////////////
118 // Copy Constructor for ITS SSD test beam 2003 version 1.
119 // This class is not to be copied. Function only dummy.
121 // const AliITSvSSD03 &source The class to be copied
125 // A warning message.
126 ////////////////////////////////////////////////////////////////////////
127 if(&source == this) return;
128 Warning("Copy Constructor","Not allowed to copy AliITSvSSD03");
131 //______________________________________________________________________
132 AliITSvSSD03& AliITSvSSD03::operator=(const AliITSvSSD03 &source){
133 ////////////////////////////////////////////////////////////////////////
134 // Assignment operator for the ITS SSD test beam 2003 version 1.
135 // This class is not to be copied. Function only dummy.
137 // const AliITSvSSD03 &source The class to be copied
142 ////////////////////////////////////////////////////////////////////////
143 if(&source == this) return *this;
144 Warning("= operator","Not allowed to copy AliITSvSSD03");
147 //______________________________________________________________________
148 AliITSvSSD03::~AliITSvSSD03() {
149 ////////////////////////////////////////////////////////////////////////
150 // Standard destructor for the ITS SSD test beam 2003 version 1.
157 ////////////////////////////////////////////////////////////////////////
159 //______________________________________________________________________
160 void AliITSvSSD03::BuildGeometry(){
161 ////////////////////////////////////////////////////////////////////////
162 // Geometry builder for the ITS SSD test beam 2003 version 1.
163 // ALIC ALICE Mother Volume
164 // |- ITSV ITS Mother Volume
165 // |- ITST Detector under Test
173 ////////////////////////////////////////////////////////////////////////
174 // Get the top alice volume.
176 switch (fGeomNumber){
185 //______________________________________________________________________
186 void AliITSvSSD03::BuildGeometry2003(){
187 ////////////////////////////////////////////////////////////////////////
188 // Geometry builder for the ITS SSD test beam 2003 version 1.
189 // ALIC ALICE Mother Volume
190 // |- ITSV ITS Mother Volume
191 // |- ITST Detector under Test
198 ////////////////////////////////////////////////////////////////////////
200 // Get the top alice volume.
201 TNode *aALIC = gAlice->GetGeometry()->GetNode("alice");
204 // Define ITS Mother Volume
206 Float_t ddettest=300.0E-4;
207 //Float_t yposition= 0.0;
208 TRotMatrix *r0 = new TRotMatrix("ITSidrotm0","ITSidrotm0",
209 90.0,0,0.0,0,90.0,270.0);
211 // Mother volume (beam along z)
212 data[0] = 10.0; // in centimeter
215 TBRIK *iITSVshape = new TBRIK("ITSVshape",
216 "ITS Logical Mother Volume","Air",
217 data[0],data[1],data[2]);
218 TNode *iITSV = new TNode("ITSV","ITS Mother Volume",iITSVshape,
220 iITSV->cd(); // set ourselve into ITSV subvolume of aALIC
222 // SSD part of telescope (Note. strips in local xz plan)
223 data[0] = 3.5; // half-length of the SSD module
224 data[1] = 0.5*ddettest; // half-width of the SSD module
225 data[2] = 2.0; // half-heigth of the SSD module
226 TBRIK *iITSTshape = new TBRIK("ITSTshape","SSD sensitive volume","Si",
227 data[0],data[1],data[2]);
228 TNode *iITST = new TNode("ITST","SSD sensitive volume",iITSTshape,
232 iITST->SetLineColor(kYellow);
235 //______________________________________________________________________
236 void AliITSvSSD03::CreateGeometry(){
237 ////////////////////////////////////////////////////////////////////////
238 // Geometry builder for the ITS SSD test beam 2003 version 1.
239 // ALIC ALICE Mother Volume
240 // |- ITSV ITS Mother Volume
241 // |- IDET Detector under Test
248 ////////////////////////////////////////////////////////////////////////
250 switch (fGeomNumber){
252 CreateGeometry2003();
255 CreateGeometry2003();
259 //______________________________________________________________________
260 void AliITSvSSD03::CreateGeometry2003(){
261 ////////////////////////////////////////////////////////////////////////
263 // ALIC ALICE Mother Volume
264 // |- ITSV Beamtest Mother Volume
266 // |- ITSA Aluminum cover for scintillator
267 // | |-ITSS first Trieste trigger plastic scintillator
268 // |- ITSA Aluminum cover for scintillator
269 // | |-ITSS second Trieste's trigger plastic scintillator
271 // |- IGAR Black box around ITST
272 // | |-IAIR Air inside the black box
273 // | |-ITST Detector under Test
275 // |- IFRA Aluminum cover for scintillator
276 // | |-IFRS French plastic scintillator
278 // |- ITSA Aluminum cover for scintillator
279 // | |-ITSS third Trieste's plastic scintillator
286 ////////////////////////////////////////////////////////////////////////
289 // Define media off-set
290 Int_t *idtmed = fIdtmed->GetArray()+1; // array of media indexes
291 Int_t idrotm[4]; // Array of rotation matrix indexes
292 //Float_t yposition= 0.0;
295 // Define Rotation-reflextion Matrixes needed
296 // 0 is the unit matrix
298 // Beamtest mother volume (air) positioned in ALIC mother volume
302 gMC->Gsvolu("ITSV","BOX",idtmed[0],data,3);
303 gMC->Gspos("ITSV",1,"ALIC",0.0,0.0,0.0,0,"ONLY");
305 // Trieste's plastic scintillators for the trigger (2 at beam enter)
306 // ...define them (aluminum cover + scintillator inside)
308 data[0] = 30.01; // size+2x50 microns Kapton
311 //gMC->Gsvolu("ITSA","BOX ",idtmed[3],data,3);//
312 gMC->Gsvolu("ITSA","BOX ",idtmed[4],data,3);//
316 // plastic scintillator
317 gMC->Gsvolu("ITSS","BOX ",idtmed[2],data,3);
318 gMC->Gspos("ITSS",1,"ITSA",0.0,0.0,0.0,0,"ONLY");
319 // ... and place them inside ITSV
320 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
321 // first scintillator
322 gMC->Gspos("ITSA",1,"ITSV",0.0,0.0,-282.0,idrotm[0],"ONLY");
323 // second scintillator
324 gMC->Gspos("ITSA",2,"ITSV",0.0,0.0,-280.0,idrotm[0],"ONLY");
326 // black kapton box with the SSD sensor inside (width 50 microns)
330 gMC->Gsvolu("IGAR","BOX ",idtmed[4],data,3); //
331 // air in the black kapton box
335 gMC->Gsvolu("IAIR","BOX ",idtmed[0],data,3); //
337 Float_t ddettest=300.0E-4;
339 data[1] = 0.5*ddettest;
341 gMC->Gsvolu("ITST","BOX ",idtmed[1],data,3);// sensitive detector volume
342 // place ITST inside IAIR (no rotation: it will be rotated with IGAR)
343 gMC->Gspos("ITST",1,"IAIR",0.0,0.0,0.0,0,"ONLY");
344 // place IAIR inside IGAR
345 gMC->Gspos("IAIR",1,"IGAR",0.0,0.0,0.0,0,"ONLY");
346 // place IGAR inside ITSV
347 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
348 gMC->Gspos("IGAR",1,"ITSV",0.0,0.0,0.0,idrotm[0],"ONLY");
349 //gMC->Gspos("IGAR",1,"ITSV",0.0,0.0,0.0,0,"ONLY");
351 // The so called French detector
352 // ...define it (Kapton cover + scintillator inside)
354 data[0] = 2.01; // size+2x50 microns Kapton width
357 gMC->Gsvolu("IFRA","BOX ",idtmed[4],data,3);//
361 // plastic scintillator
362 gMC->Gsvolu("IFRS","BOX ",idtmed[2],data,3);
363 gMC->Gspos("IFRS",1,"IFRA",0.0,0.0,0.0,0,"ONLY");
364 // ... and place it inside ITSV
365 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
366 gMC->Gspos("IFRA",1,"ITSV",0.0,0.0,16.0,idrotm[0],"ONLY");
368 // An other Trieste's plastic scintillator for the trigger
369 // ...just place an other copy inside ITSV
370 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
371 gMC->Gspos("ITSA",3,"ITSV",0.0,0.0,270.0,idrotm[0],"ONLY");
375 //______________________________________________________________________
376 void AliITSvSSD03::CreateMaterials(){
377 ////////////////////////////////////////////////////////////////////////
379 // Create ITS SSD test beam materials
380 // This function defines the default materials used in the Geant
381 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
383 // In general it is automatically replaced by
384 // the CreateMaterials routine defined in AliITSv?. Should the function
385 // CreateMaterials not exist for the geometry version you are using this
386 // one is used. See the definition found in AliITSv5 or the other routine
387 // for a complete definition.
395 /////////////////////////////////////////////////////////////////////////
397 switch (fGeomNumber){
399 CreateMaterials2003();
402 CreateMaterials2003();
406 //______________________________________________________________________
407 void AliITSvSSD03::CreateMaterials2003(){
408 ////////////////////////////////////////////////////////////////////////
410 // Create ITS SSD test beam materials
411 // This function defines the default materials used in the Geant
412 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
414 // In general it is automatically replaced by
415 // the CreateMaterials routine defined in AliITSv?. Should the function
416 // CreateMaterials not exist for the geometry version you are using this
417 // one is used. See the definition found in AliITSv5 or the other routine
418 // for a complete definition.
426 /////////////////////////////////////////////////////////////////////////
428 Int_t ifield = gAlice->Field()->Integ();
429 Float_t fieldm = gAlice->Field()->Max();
432 Float_t ascin[2]={1.01,12.01};
433 Float_t zscin[2]={1,6};
434 Float_t wscin[2]={1,1};
435 Float_t denscin=1.03;
436 AliMixture( 3, "Scintillator$",ascin,zscin,denscin,-2,wscin);
437 AliMedium(3, "Scintillator$", 3, 1, ifield, fieldm, 0.1, .01,
441 Float_t tmaxfdAl = 0.1; // Degree
442 Float_t stemaxAl = 0.01; // cm
443 Float_t deemaxAl = 0.1; // Fraction of particle's energy 0<deemax<=1
444 Float_t epsilAl = 1.0E-4;//
445 Float_t stminAl = 0.0; // cm "Default value used"
446 AliMaterial(4, "Al$", 26.98, 13., 2.7, 8.9, 37.2);
447 AliMedium(4, "Al$", 4, 0, ifield, fieldm, tmaxfdAl, stemaxAl,
448 deemaxAl, epsilAl, stminAl);
451 Float_t tmaxfdAir = 0.1; // Degree
452 Float_t stemaxAir = .10000E+01; // cm
453 Float_t deemaxAir = 0.1; // Fraction of particle's energy 0<deemax<=1
454 Float_t epsilAir = 1.0E-4;//
455 Float_t stminAir = 0.0; // cm "Default value used"
456 AliMaterial(1,"AIR$",0.14610E+03,0.73000E+01,0.12050E-03,
457 0.30423E+05,0.99900E+03);
458 AliMedium(1,"AIR$",1,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,
462 Float_t tmaxfdSi = 0.1; // Degree
463 //Float_t stemaxSi = 0.0075; // cm
464 //Float_t deemaxSi = 0.1; // Fraction of particle's energy 0<deemax<=1
465 //Float_t stminSi = 0.0; // cm "Default value used"
466 //Float_t tmaxfdSi = 10; // Degree
467 Float_t stemaxSi = 0.01; // cm
468 Float_t deemaxSi = 0.1; // Fraction of particle's energy 0<deemax<=1
469 Float_t epsilSi = 1.0E-4;//
470 //Float_t epsilSi = 0.003;//
471 Float_t stminSi = 0.003; // cm "Default value used"
472 AliMaterial(2,"SSD SI$",0.28086E+02,0.14000E+02,0.23300E+01,
473 0.93600E+01,0.99900E+03);
474 AliMedium(2,"SSD SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
478 AliMaterial(5, "Kapton$", 12.011, 6., 1.3, 31.27, 999.);
479 AliMedium(5, "Kapton$", 5, 0,ifield,fieldm, 10., .01, .1, .003, .003);
481 //______________________________________________________________________
482 void AliITSvSSD03::InitAliITSgeom(){
483 // Based on the geometry tree defined in Geant 3.21, this
484 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
493 //const Int_t kltypess = 2; // was 2 for SPD beamtest
494 const Int_t kltypess = 1;
495 //const Int_t knlayers = 5; // was 5 for the SPD telescope
496 const Int_t knlayers = 1; // for one SSD module
497 const Int_t kndeep = 5;
499 Int_t itsGeomTreeNames[kltypess][kndeep],lnam[20],lnum[20];
501 Int_t nlad[knlayers],ndet[knlayers];
503 Float_t par[20],att[20];
504 Int_t npar,natt,idshape,imat,imed;
505 AliITSGeant3Geometry *ig=0;
506 Int_t mod=0,typ=0,lay=0,lad=0,det=0,cpy=0,i=0,j=0,k=0;
508 if(gMC==0) {// No MonteCarlo to init. Default set fITSgeom by hand
509 if(GetITSgeom()!=0) SetITSgeom(0x0);
511 //nlad[0]=1;nlad[1]=1;nlad[2]=1;nlad[3]=1;nlad[4]=1;
512 //ndet[0]=1;ndet[1]=1;ndet[2]=1;ndet[3]=1;ndet[4]=1;
516 AliITSgeom* geom = new AliITSgeom(0,knlayers,nlad,ndet,mod);
519 r[0] = 1.0; r[1] = 0.0; r[2] = 0.0;
520 r[3] = 0.0; r[4] = 0.0; r[5] = 1.0;
521 r[6] = 0.0; r[7] = -1.0; r[8] = 0.0; r[9] = 1.0; // not Unit.
523 Double_t tt[1][3]={{0.0,0.0,0.0}};
525 // for(mod=0;mod<5;mod++){
526 for(mod=0;mod<1;mod++){
530 t[0] = tt[mod][0]; t[1] = tt[mod][1]; t[2] = tt[mod][2];
531 GetITSgeom()->CreateMatrix(mod,lay,lad,det,kSSD,t,r);
533 npar=3;par[0]=3.5;par[1]=0.5*300.0E-4;par[2]=2.0;
535 GetITSgeom()->ReSetShape(kSSD,new AliITSgeomSSD275and75(npar,par));
540 if(strcmp(gMC->GetName(),"TGeant3")) {
541 Error("InitAliITSgeom",
542 "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
546 cout << "Reading Geometry transformation directly from Geant 3." << endl;
547 ig = new AliITSGeant3Geometry();
548 Char_t names[kltypess][kndeep][4];
549 Int_t itsGeomTreeCopys[kltypess][kndeep];
550 const char *namesA[kltypess][kndeep] =
551 {{"ALIC","ITSV","IGAR","IAIR","ITST"}}; // Test SSD
552 Int_t itsGeomTreeCopysA[kltypess][kndeep]= {{1,1,1,1,1}};// TestSSD
553 for(i=0;i<kltypess;i++)for(j=0;j<kndeep;j++){
554 for(k=0;k<4;k++) names[i][j][k] = namesA[i][j][k];
555 itsGeomTreeCopys[i][j] = itsGeomTreeCopysA[i][j];
558 cout << "Reading Geometry informaton from Geant3 common blocks" << endl;
559 for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
560 for(i=0;i<kltypess;i++)for(j=0;j<kndeep;j++)
561 strncpy((char*) &itsGeomTreeNames[i][j],names[i][j],4);
562 // itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
564 if(GetITSgeom()!=0) SetITSgeom(0x0);
568 AliITSgeom* geom = new AliITSgeom(0,knlayers,nlad,ndet,mod);
570 for(typ=1;typ<=kltypess;typ++){
571 for(j=0;j<kndeep;j++) lnam[j] = itsGeomTreeNames[typ-1][j];
572 for(j=0;j<kndeep;j++) lnum[j] = itsGeomTreeCopys[typ-1][j];
575 for(cpy=1;cpy<=itsGeomTreeCopys[typ-1][2];cpy++){
578 if(cpy>2 && typ==1) lay = cpy +1;
581 ig->GetGeometry(kndeep,lnam,lnum,t,r,idshape,npar,natt,par,att,
583 GetITSgeom()->CreateMatrix(mod,lay,lad,det,kSSD,t,r);
584 //cout<<mod<<" "<<lay<<" "<<lad<<" "<<det<<endl;
585 //cout<<npar<<" "<<par[0]<<" "<<par[1]<<" "<<par[2]<<endl;
586 if(!(GetITSgeom()->IsShapeDefined((Int_t)kSSD)))
587 GetITSgeom()->ReSetShape(kSSD, new AliITSgeomSSD275and75(npar,par));
592 //______________________________________________________________________
593 void AliITSvSSD03::Init(){
594 ////////////////////////////////////////////////////////////////////////
595 // Initialise the ITS after it has been created.
602 ////////////////////////////////////////////////////////////////////////
606 for(i=0;i<26;i++) cout << "*";
607 cout << " ITSvSSD03" << fMinorVersion << "_Init ";
608 for(i=0;i<25;i++) cout << "*";cout << endl;
610 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
611 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
612 if(GetITSgeom()!=0) SetITSgeom(0x0);
613 AliITSgeom* geom = new AliITSgeom();
615 if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead);
616 if(!fGeomDetIn) this->InitAliITSgeom();
617 if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite);
620 for(i=0;i<72;i++) cout << "*";
622 if(gMC) fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID.
625 //______________________________________________________________________
626 void AliITSvSSD03::SetDefaults(){
627 // sets the default segmentation, rerponse, digit and raw cluster classes
634 const Float_t kconv = 1.0e+04; // convert cm to microns
636 Info("SetDefaults","Setting up only SSD detector");
638 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
639 fDetTypeSim->SetITSgeom(GetITSgeom());
641 fDetTypeSim->ResetCalibrationArray();
642 fDetTypeSim->ResetSegmentation();
646 // Get shape info. Do it this way for now.
647 s0 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);
648 AliITSCalibration *resp0=new AliITSCalibrationSSD("simulated");
649 SetCalibrationModel(GetITSgeom()->GetStartSSD(),resp0);
651 AliITSsegmentationSSD *seg0=new AliITSsegmentationSSD();
652 seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSSD
653 s0->GetDz()*2.*kconv, // for now.
654 s0->GetDy()*2.*kconv); // x,z,y full width in microns.
655 //seg0->SetNPads(256,160);// Number of Bins in x and z
657 SetSegmentationModel(kSSD,seg0);
659 // set digit and raw cluster classes to be used
660 const char *kData0=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSSD()))->DataType();
661 if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit");
662 else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
663 // SetSimulationModel(kSSD,new AliITSsimulationSSD(seg0,resp0));
664 // iDetType->ReconstructionModel(new AliITSClusterFinderSSD());
667 SetResponseModel(kSPD,new AliITSCalibrationSPD());
668 SetSegmentationModel(kSPD,new AliITSsegmentationSPD());
669 fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
671 SetResponseModel(kSDD,new AliITSCalibrationSDD());
672 SetSegmentationModel(kSDD,new AliITSsegmentationSDD());
673 fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD");
678 Warning("SetDefaults",
679 "Only the four basic detector types are initialised!");
683 //______________________________________________________________________
684 void AliITSvSSD03::SetDefaultSimulation(){
685 // sets the default simulation.
693 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
695 AliITSsimulation *sim;
696 // AliITSsegmentation *seg;
697 // AliITSCalibration *res;
701 sim = fDetTypeSim->GetSimulationModel(kSPD);
703 seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD);
704 res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(nspd);
705 sim = new AliITSsimulationSPDdubna(seg,res,1);
706 SetSimulationModel(kSPD,sim);
707 }else{ // simulation exists, make sure it is set up properly.
708 sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD));
709 sim->SetResponseModel((AliITSCalibration*)fDetTypeSim->GetResponseModel(nspd));
710 ((AliITSsimulation*)sim)->Init();
711 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
712 // (AliITSCalibration*)iDetType->GetResponseModel());
713 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
714 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
716 } // end if !fDetTypeSim
720 sim = fDetTypeSim->GetSimulationModel(kSDD);
722 seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD);
723 res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(nsdd);
724 sim = new AliITSsimulationSDD(seg,res);
725 SetSimulationModel(kSDD,sim);
726 }else{ // simulation exists, make sure it is set up properly.
727 sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD));
728 sim->SetResponseModel((AliITSCalibration*)fDetTypeSim->GetResponseModel(nsdd));
730 ((AliITSsimulation*)sim)->Init();
731 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
732 // (AliITSCalibration*)iDetType->GetResponseModel());
733 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
734 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
736 } // end if !iDetType
740 sim = fDetTypeSim->GetSimulationModel(kSSD);
742 // seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD);
743 // res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSSD());
744 sim = new AliITSsimulationSSD(fDetTypeSim);
745 SetSimulationModel(kSSD,sim);
746 }else{ // simulation exists, make sure it is set up properly.
747 sim->SetSegmentationModel(kSSD,(AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD));
748 sim->SetCalibrationModel(GetITSgeom()->GetStartSSD(),(AliITSCalibration*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSSD()));
749 ((AliITSsimulation*)sim)->Init();
750 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
751 // (AliITSCalibration*)iDetType->GetResponseModel());
752 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
753 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
755 } // end if !iDetType
758 //______________________________________________________________________
759 void AliITSvSSD03::DrawModule() const {
760 ////////////////////////////////////////////////////////////////////////
761 // Draw a shaded view of the ITS SSD test beam version 1.
768 ////////////////////////////////////////////////////////////////////////
770 gMC->Gsatt("*", "seen", -1);
771 gMC->Gsatt("ALIC","SEEN",0);
772 gMC->Gsatt("ITSV","SEEN",0);
773 gMC->Gsatt("ITSA","SEEN",1);
774 gMC->Gsatt("ITSS","SEEN",1);
775 gMC->Gsatt("IGAR","SEEN",1);
776 gMC->Gsatt("IAIR","SEEN",0);
777 gMC->Gsatt("ITST","SEEN",1);
778 gMC->Gsatt("IFRA","SEEN",1);
779 gMC->Gsatt("IFRS","SEEN",1);
781 //______________________________________________________________________
782 void AliITSvSSD03::StepManager(){
783 ////////////////////////////////////////////////////////////////////////
784 // Called for every step in the ITS SSD, then calles the
785 // AliITShit class creator with the information to be recoreded about
787 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
788 // printing of information to a file which can be used to create a .det
789 // file read in by the routine CreateGeometry(). If set to 0 or any other
790 // value except 1, the default behavior, then no such file is created nor
791 // it the extra variables and the like used in the printing allocated.
798 ////////////////////////////////////////////////////////////////////////
800 TLorentzVector position, momentum;
801 static TLorentzVector position0;
802 static Int_t stat0=0;
804 if((id=gMC->CurrentVolID(copy) == fIDMother)&&
805 (gMC->IsTrackEntering()||gMC->IsTrackExiting())){
806 copy = fTrackReferences->GetEntriesFast();
807 TClonesArray &lTR = *fTrackReferences;
808 // Fill TrackReference structure with this new TrackReference.
809 new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
810 } // if Outer ITS mother Volume
812 if(!(this->IsActive())){
814 } // end if !Active volume.
818 TClonesArray &lhits = *fHits;
823 if(gMC->IsTrackInside()) vol[3] += 1;
824 if(gMC->IsTrackEntering()) vol[3] += 2;
825 if(gMC->IsTrackExiting()) vol[3] += 4;
826 if(gMC->IsTrackOut()) vol[3] += 8;
827 if(gMC->IsTrackDisappeared()) vol[3] += 16;
828 if(gMC->IsTrackStop()) vol[3] += 32;
829 if(gMC->IsTrackAlive()) vol[3] += 64;
831 // Fill hit structure.
832 if(!(gMC->TrackCharge())) return;
833 id = gMC->CurrentVolID(copy);
834 if(id==fIdSens[0]){ // Volume name "ITST"
835 vol[2] = vol[1] = vol[0] = 1; // Det, ladder
836 } else return; // end if
838 gMC->TrackPosition(position);
839 gMC->TrackMomentum(momentum);
841 if(gMC->IsTrackEntering()){
842 position0 = position;
845 } // end if IsEntering
847 // Fill hit structure with this new hit only for non-entrerance hits.
848 else new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,
849 gMC->Edep(),gMC->TrackTime(),position,
851 //cout<<gMC->Edep()<<endl;
853 position0 = position;