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 <Riostream.h>
21 #include <TGeometry.h>
23 #include <TLorentzVector.h>
24 #include <TClonesArray.h>
29 #include "AliITSGeant3Geometry.h"
30 #include "AliTrackReference.h"
31 #include "AliITShit.h"
33 #include "AliITSvSSD03.h"
34 #include "AliITSgeom.h"
35 #include "AliITSgeomSSD.h"
36 #include "AliITSDetType.h"
37 #include "AliITSresponseSPD.h"
38 #include "AliITSresponseSDD.h"
39 #include "AliITSresponseSSD.h"
40 #include "AliITSsegmentationSPD.h"
41 #include "AliITSsegmentationSDD.h"
42 #include "AliITSsegmentationSSD.h"
43 #include "AliITSsimulationSPDdubna.h"
44 #include "AliITSsimulationSDD.h"
45 #include "AliITSsimulationSSD.h"
48 ///////////////////////////////////////////////////////////////////////
53 // geometry of June 2003
55 ///////////////////////////////////////////////////////////////////////
56 ClassImp(AliITSvSSD03)
58 //______________________________________________________________________
59 AliITSvSSD03::AliITSvSSD03() {
60 ////////////////////////////////////////////////////////////////////////
61 // Standard default constructor for the ITS SSD test beam 2003 version 1.
67 // A default created class.
68 ////////////////////////////////////////////////////////////////////////
74 fEuclidOut = kFALSE; // Don't write Euclide file
75 fGeomDetOut = kFALSE; // Don't write .det file
76 fGeomDetIn = kFALSE; // Don't Read .det file
77 fMajorVersion = IsVersion();
79 fGeomNumber = 2003; // default value
80 for(i=0;i<60;i++) fRead[i] = '\0';
81 for(i=0;i<60;i++) fWrite[i] = '\0';
82 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
84 //______________________________________________________________________
85 AliITSvSSD03::AliITSvSSD03(const char *title,Int_t gn) : AliITS("ITS", title){
86 ////////////////////////////////////////////////////////////////////////
87 // Standard constructor for the ITS SSD testbeam 2003 version 1.
89 // const char *title title for this ITS geometry.
90 // Int_t gn Geometry version number (year) default 2003.
94 // A standard created class.
95 ////////////////////////////////////////////////////////////////////////
101 fIdName = new TString[fIdN];
103 fIdSens = new Int_t[fIdN];
104 for(i=0;i<fIdN;i++) fIdSens[i] = 0;
106 fMajorVersion = IsVersion();
108 fEuclidOut = kFALSE; // Don't write Euclide file
109 fGeomDetOut = kFALSE; // Don't write .det file
110 fGeomDetIn = kFALSE; // Don't Read .det file
117 fEuclidGeometry="$ALICE_ROOT/ITS/ITSgeometry_vSSD03.euc";
118 strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_vSSD03.det",60);
119 strncpy(fRead,fEuclidGeomDet,60);
120 strncpy(fWrite,fEuclidGeomDet,60);
122 //______________________________________________________________________
123 AliITSvSSD03::AliITSvSSD03(const AliITSvSSD03 &source) : AliITS(source){
124 ////////////////////////////////////////////////////////////////////////
125 // Copy Constructor for ITS SSD test beam 2003 version 1.
126 // This class is not to be copied. Function only dummy.
128 // const AliITSvSSD03 &source The class to be copied
132 // A warning message.
133 ////////////////////////////////////////////////////////////////////////
134 if(&source == this) return;
135 Warning("Copy Constructor","Not allowed to copy AliITSvSSD03");
138 //______________________________________________________________________
139 AliITSvSSD03& AliITSvSSD03::operator=(const AliITSvSSD03 &source){
140 ////////////////////////////////////////////////////////////////////////
141 // Assignment operator for the ITS SSD test beam 2003 version 1.
142 // This class is not to be copied. Function only dummy.
144 // const AliITSvSSD03 &source The class to be copied
149 ////////////////////////////////////////////////////////////////////////
150 if(&source == this) return *this;
151 Warning("= operator","Not allowed to copy AliITSvSSD03");
154 //______________________________________________________________________
155 AliITSvSSD03::~AliITSvSSD03() {
156 ////////////////////////////////////////////////////////////////////////
157 // Standard destructor for the ITS SSD test beam 2003 version 1.
164 ////////////////////////////////////////////////////////////////////////
166 //______________________________________________________________________
167 void AliITSvSSD03::BuildGeometry(){
168 ////////////////////////////////////////////////////////////////////////
169 // Geometry builder for the ITS SSD test beam 2003 version 1.
170 // ALIC ALICE Mother Volume
171 // |- ITSV ITS Mother Volume
172 // |- ITST Detector under Test
180 ////////////////////////////////////////////////////////////////////////
181 // Get the top alice volume.
183 switch (fGeomNumber){
192 //______________________________________________________________________
193 void AliITSvSSD03::BuildGeometry2003(){
194 ////////////////////////////////////////////////////////////////////////
195 // Geometry builder for the ITS SSD test beam 2003 version 1.
196 // ALIC ALICE Mother Volume
197 // |- ITSV ITS Mother Volume
198 // |- ITST Detector under Test
205 ////////////////////////////////////////////////////////////////////////
207 // Get the top alice volume.
208 TNode *aALIC = gAlice->GetGeometry()->GetNode("alice");
211 // Define ITS Mother Volume
213 Float_t ddettest=300.0E-4;
214 //Float_t yposition= 0.0;
215 TRotMatrix *r0 = new TRotMatrix("ITSidrotm0","ITSidrotm0",
216 90.0,0,0.0,0,90.0,270.0);
218 // Mother volume (beam along z)
219 data[0] = 10.0; // in centimeter
222 TBRIK *iITSVshape = new TBRIK("ITSVshape",
223 "ITS Logical Mother Volume","Air",
224 data[0],data[1],data[2]);
225 TNode *iITSV = new TNode("ITSV","ITS Mother Volume",iITSVshape,
227 iITSV->cd(); // set ourselve into ITSV subvolume of aALIC
229 // SSD part of telescope (Note. strips in local xz plan)
230 data[0] = 3.5; // half-length of the SSD module
231 data[1] = 0.5*ddettest; // half-width of the SSD module
232 data[2] = 2.0; // half-heigth of the SSD module
233 TBRIK *iITSTshape = new TBRIK("ITSTshape","SSD sensitive volume","Si",
234 data[0],data[1],data[2]);
235 TNode *iITST = new TNode("ITST","SSD sensitive volume",iITSTshape,
239 iITST->SetLineColor(kYellow);
242 //______________________________________________________________________
243 void AliITSvSSD03::CreateGeometry(){
244 ////////////////////////////////////////////////////////////////////////
245 // Geometry builder for the ITS SSD test beam 2003 version 1.
246 // ALIC ALICE Mother Volume
247 // |- ITSV ITS Mother Volume
248 // |- IDET Detector under Test
255 ////////////////////////////////////////////////////////////////////////
257 switch (fGeomNumber){
259 CreateGeometry2003();
262 CreateGeometry2003();
266 //______________________________________________________________________
267 void AliITSvSSD03::CreateGeometry2003(){
268 ////////////////////////////////////////////////////////////////////////
270 // ALIC ALICE Mother Volume
271 // |- ITSV Beamtest Mother Volume
273 // |- ITSA Aluminum cover for scintillator
274 // | |-ITSS first Trieste trigger plastic scintillator
275 // |- ITSA Aluminum cover for scintillator
276 // | |-ITSS second Trieste's trigger plastic scintillator
278 // |- IGAR Black box around ITST
279 // | |-IAIR Air inside the black box
280 // | |-ITST Detector under Test
282 // |- IFRA Aluminum cover for scintillator
283 // | |-IFRS French plastic scintillator
285 // |- ITSA Aluminum cover for scintillator
286 // | |-ITSS third Trieste's plastic scintillator
293 ////////////////////////////////////////////////////////////////////////
296 // Define media off-set
297 Int_t *idtmed = fIdtmed->GetArray()+1; // array of media indexes
298 Int_t idrotm[4]; // Array of rotation matrix indexes
299 //Float_t yposition= 0.0;
302 // Define Rotation-reflextion Matrixes needed
303 // 0 is the unit matrix
305 // Beamtest mother volume (air) positioned in ALIC mother volume
309 gMC->Gsvolu("ITSV","BOX",idtmed[0],data,3);
310 gMC->Gspos("ITSV",1,"ALIC",0.0,0.0,0.0,0,"ONLY");
312 // Trieste's plastic scintillators for the trigger (2 at beam enter)
313 // ...define them (aluminum cover + scintillator inside)
315 data[0] = 30.01; // size+2x50 microns Kapton
318 //gMC->Gsvolu("ITSA","BOX ",idtmed[3],data,3);//
319 gMC->Gsvolu("ITSA","BOX ",idtmed[4],data,3);//
323 // plastic scintillator
324 gMC->Gsvolu("ITSS","BOX ",idtmed[2],data,3);
325 gMC->Gspos("ITSS",1,"ITSA",0.0,0.0,0.0,0,"ONLY");
326 // ... and place them inside ITSV
327 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
328 // first scintillator
329 gMC->Gspos("ITSA",1,"ITSV",0.0,0.0,-282.0,idrotm[0],"ONLY");
330 // second scintillator
331 gMC->Gspos("ITSA",2,"ITSV",0.0,0.0,-280.0,idrotm[0],"ONLY");
333 // black kapton box with the SSD sensor inside (width 50 microns)
337 gMC->Gsvolu("IGAR","BOX ",idtmed[4],data,3); //
338 // air in the black kapton box
342 gMC->Gsvolu("IAIR","BOX ",idtmed[0],data,3); //
344 Float_t ddettest=300.0E-4;
346 data[1] = 0.5*ddettest;
348 gMC->Gsvolu("ITST","BOX ",idtmed[1],data,3);// sensitive detector volume
349 // place ITST inside IAIR (no rotation: it will be rotated with IGAR)
350 gMC->Gspos("ITST",1,"IAIR",0.0,0.0,0.0,0,"ONLY");
351 // place IAIR inside IGAR
352 gMC->Gspos("IAIR",1,"IGAR",0.0,0.0,0.0,0,"ONLY");
353 // place IGAR inside ITSV
354 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
355 gMC->Gspos("IGAR",1,"ITSV",0.0,0.0,0.0,idrotm[0],"ONLY");
356 //gMC->Gspos("IGAR",1,"ITSV",0.0,0.0,0.0,0,"ONLY");
358 // The so called French detector
359 // ...define it (Kapton cover + scintillator inside)
361 data[0] = 2.01; // size+2x50 microns Kapton width
364 gMC->Gsvolu("IFRA","BOX ",idtmed[4],data,3);//
368 // plastic scintillator
369 gMC->Gsvolu("IFRS","BOX ",idtmed[2],data,3);
370 gMC->Gspos("IFRS",1,"IFRA",0.0,0.0,0.0,0,"ONLY");
371 // ... and place it inside ITSV
372 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
373 gMC->Gspos("IFRA",1,"ITSV",0.0,0.0,16.0,idrotm[0],"ONLY");
375 // An other Trieste's plastic scintillator for the trigger
376 // ...just place an other copy inside ITSV
377 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
378 gMC->Gspos("ITSA",3,"ITSV",0.0,0.0,270.0,idrotm[0],"ONLY");
382 //______________________________________________________________________
383 void AliITSvSSD03::CreateMaterials(){
384 ////////////////////////////////////////////////////////////////////////
386 // Create ITS SSD test beam materials
387 // This function defines the default materials used in the Geant
388 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
390 // In general it is automatically replaced by
391 // the CreatMaterials routine defined in AliITSv?. Should the function
392 // CreateMaterials not exist for the geometry version you are using this
393 // one is used. See the definition found in AliITSv5 or the other routine
394 // for a complete definition.
402 /////////////////////////////////////////////////////////////////////////
404 switch (fGeomNumber){
406 CreateMaterials2003();
409 CreateMaterials2003();
413 //______________________________________________________________________
414 void AliITSvSSD03::CreateMaterials2003(){
415 ////////////////////////////////////////////////////////////////////////
417 // Create ITS SSD test beam materials
418 // This function defines the default materials used in the Geant
419 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
421 // In general it is automatically replaced by
422 // the CreatMaterials routine defined in AliITSv?. Should the function
423 // CreateMaterials not exist for the geometry version you are using this
424 // one is used. See the definition found in AliITSv5 or the other routine
425 // for a complete definition.
433 /////////////////////////////////////////////////////////////////////////
435 Int_t ifield = gAlice->Field()->Integ();
436 Float_t fieldm = gAlice->Field()->Max();
439 Float_t ascin[2]={1.01,12.01};
440 Float_t zscin[2]={1,6};
441 Float_t wscin[2]={1,1};
442 Float_t denscin=1.03;
443 AliMixture( 3, "Scintillator$",ascin,zscin,denscin,-2,wscin);
444 AliMedium(3, "Scintillator$", 3, 1, ifield, fieldm, 0.1, .01,
448 Float_t tmaxfdAl = 0.1; // Degree
449 Float_t stemaxAl = 0.01; // cm
450 Float_t deemaxAl = 0.1; // Fraction of particle's energy 0<deemax<=1
451 Float_t epsilAl = 1.0E-4;//
452 Float_t stminAl = 0.0; // cm "Default value used"
453 AliMaterial(4, "Al$", 26.98, 13., 2.7, 8.9, 37.2);
454 AliMedium(4, "Al$", 4, 0, ifield, fieldm, tmaxfdAl, stemaxAl,
455 deemaxAl, epsilAl, stminAl);
458 Float_t tmaxfdAir = 0.1; // Degree
459 Float_t stemaxAir = .10000E+01; // cm
460 Float_t deemaxAir = 0.1; // Fraction of particle's energy 0<deemax<=1
461 Float_t epsilAir = 1.0E-4;//
462 Float_t stminAir = 0.0; // cm "Default value used"
463 AliMaterial(1,"AIR$",0.14610E+03,0.73000E+01,0.12050E-03,
464 0.30423E+05,0.99900E+03);
465 AliMedium(1,"AIR$",1,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,
469 Float_t tmaxfdSi = 0.1; // Degree
470 //Float_t stemaxSi = 0.0075; // cm
471 //Float_t deemaxSi = 0.1; // Fraction of particle's energy 0<deemax<=1
472 //Float_t stminSi = 0.0; // cm "Default value used"
473 //Float_t tmaxfdSi = 10; // Degree
474 Float_t stemaxSi = 0.01; // cm
475 Float_t deemaxSi = 0.1; // Fraction of particle's energy 0<deemax<=1
476 Float_t epsilSi = 1.0E-4;//
477 //Float_t epsilSi = 0.003;//
478 Float_t stminSi = 0.003; // cm "Default value used"
479 AliMaterial(2,"SSD SI$",0.28086E+02,0.14000E+02,0.23300E+01,
480 0.93600E+01,0.99900E+03);
481 AliMedium(2,"SSD SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
485 AliMaterial(5, "Kapton$", 12.011, 6., 1.3, 31.27, 999.);
486 AliMedium(5, "Kapton$", 5, 0,ifield,fieldm, 10., .01, .1, .003, .003);
488 //______________________________________________________________________
489 void AliITSvSSD03::InitAliITSgeom(){
490 // Based on the geometry tree defined in Geant 3.21, this
491 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
500 //const Int_t kltypess = 2; // was 2 for SPD beamtest
501 const Int_t kltypess = 1;
502 //const Int_t knlayers = 5; // was 5 for the SPD telescope
503 const Int_t knlayers = 1; // for one SSD module
504 const Int_t kndeep = 5;
506 Int_t itsGeomTreeNames[kltypess][kndeep],lnam[20],lnum[20];
508 Int_t nlad[knlayers],ndet[knlayers];
510 Float_t par[20],att[20];
511 Int_t npar,natt,idshape,imat,imed;
512 AliITSGeant3Geometry *ig=0;
513 Int_t mod=0,typ=0,lay=0,lad=0,det=0,cpy=0,i=0,j=0,k=0;
515 if(gMC==0) {// No MonteCarlo to init. Default set fITSgeom by hand
516 if(fITSgeom!=0) delete fITSgeom;
518 //nlad[0]=1;nlad[1]=1;nlad[2]=1;nlad[3]=1;nlad[4]=1;
519 //ndet[0]=1;ndet[1]=1;ndet[2]=1;ndet[3]=1;ndet[4]=1;
523 fITSgeom = new AliITSgeom(0,knlayers,nlad,ndet,mod);
525 r[0] = 1.0; r[1] = 0.0; r[2] = 0.0;
526 r[3] = 0.0; r[4] = 0.0; r[5] = 1.0;
527 r[6] = 0.0; r[7] = -1.0; r[8] = 0.0; r[9] = 1.0; // not Unit.
529 Double_t tt[1][3]={{0.0,0.0,0.0}};
531 // for(mod=0;mod<5;mod++){
532 for(mod=0;mod<1;mod++){
536 t[0] = tt[mod][0]; t[1] = tt[mod][1]; t[2] = tt[mod][2];
537 fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
539 npar=3;par[0]=3.5;par[1]=0.5*300.0E-4;par[2]=2.0;
541 fITSgeom->ReSetShape(kSSD,new AliITSgeomSSD275and75(npar,par));
546 if(strcmp(gMC->GetName(),"TGeant3")) {
547 Error("InitAliITSgeom",
548 "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls");
552 cout << "Reading Geometry transformation directly from Geant 3." << endl;
553 ig = new AliITSGeant3Geometry();
554 Char_t names[kltypess][kndeep][4];
555 Int_t itsGeomTreeCopys[kltypess][kndeep];
556 const char *namesA[kltypess][kndeep] =
557 {{"ALIC","ITSV","IGAR","IAIR","ITST"}}; // Test SSD
558 Int_t itsGeomTreeCopysA[kltypess][kndeep]= {{1,1,1,1,1}};// TestSSD
559 for(i=0;i<kltypess;i++)for(j=0;j<kndeep;j++){
560 for(k=0;k<4;k++) names[i][j][k] = namesA[i][j][k];
561 itsGeomTreeCopys[i][j] = itsGeomTreeCopysA[i][j];
564 cout << "Reading Geometry informaton from Geant3 common blocks" << endl;
565 for(i=0;i<20;i++) lnam[i] = lnum[i] = 0;
566 for(i=0;i<kltypess;i++)for(j=0;j<kndeep;j++)
567 strncpy((char*) &itsGeomTreeNames[i][j],names[i][j],4);
568 // itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
570 if(fITSgeom!=0) delete fITSgeom;
574 fITSgeom = new AliITSgeom(0,knlayers,nlad,ndet,mod);
575 for(typ=1;typ<=kltypess;typ++){
576 for(j=0;j<kndeep;j++) lnam[j] = itsGeomTreeNames[typ-1][j];
577 for(j=0;j<kndeep;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(kndeep,lnam,lnum,t,r,idshape,npar,natt,par,att,
588 fITSgeom->CreatMatrix(mod,lay,lad,det,kSSD,t,r);
589 //cout<<mod<<" "<<lay<<" "<<lad<<" "<<det<<endl;
590 //cout<<npar<<" "<<par[0]<<" "<<par[1]<<" "<<par[2]<<endl;
591 if(!(fITSgeom->IsShapeDefined((Int_t)kSSD)))
592 fITSgeom->ReSetShape(kSSD, new AliITSgeomSSD275and75(npar,par));
597 //______________________________________________________________________
598 void AliITSvSSD03::Init(){
599 ////////////////////////////////////////////////////////////////////////
600 // Initialise the ITS after it has been created.
607 ////////////////////////////////////////////////////////////////////////
611 for(i=0;i<26;i++) cout << "*";
612 cout << " ITSvSSD03" << fMinorVersion << "_Init ";
613 for(i=0;i<25;i++) cout << "*";cout << endl;
615 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
616 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
617 if(fITSgeom!=0) delete fITSgeom;
618 fITSgeom = new AliITSgeom();
619 if(fGeomDetIn) fITSgeom->ReadNewFile(fRead);
620 if(!fGeomDetIn) this->InitAliITSgeom();
621 if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite);
624 for(i=0;i<72;i++) cout << "*";
626 if(gMC) fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID.
629 //______________________________________________________________________
630 void AliITSvSSD03::SetDefaults(){
631 // sets the default segmentation, response, digit and raw cluster classes
638 const Float_t kconv = 1.0e+04; // convert cm to microns
640 Info("SetDefaults","Setting up only SSD detector");
642 AliITSDetType *iDetType;
646 iDetType=DetType(kSSD);
648 // Get shape info. Do it this way for now.
649 s0 = (AliITSgeomSSD*) fITSgeom->GetShape(kSSD);
650 AliITSresponse *resp0=new AliITSresponseSSD("simulated");
652 SetResponseModel(kSSD,resp0);
653 AliITSsegmentationSSD *seg0=new AliITSsegmentationSSD(fITSgeom);
654 seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSSD
655 s0->GetDz()*2.*kconv, // for now.
656 s0->GetDy()*2.*kconv); // x,z,y full width in microns.
657 //seg0->SetNPads(256,160);// Number of Bins in x and z
659 SetSegmentationModel(kSSD,seg0);
661 // set digit and raw cluster classes to be used
662 const char *kData0=(iDetType->GetResponseModel())->DataType();
663 if (strstr(kData0,"real")) iDetType->ClassNames("AliITSdigit",
664 "AliITSRawClusterSSD");
665 else iDetType->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD");
666 // SetSimulationModel(kSSD,new AliITSsimulationSSD(seg0,resp0));
667 // iDetType->ReconstructionModel(new AliITSClusterFinderSSD());
670 SetResponseModel(kSPD,new AliITSresponseSPD());
671 SetSegmentationModel(kSPD,new AliITSsegmentationSPD());
672 DetType(kSPD)->ClassNames("AliITSdigitSPD","AliITSRawClusterSPD");
674 SetResponseModel(kSDD,new AliITSresponseSDD());
675 SetSegmentationModel(kSDD,new AliITSsegmentationSDD());
676 DetType(kSDD)->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD");
681 Warning("SetDefaults",
682 "Only the four basic detector types are initialised!");
686 //______________________________________________________________________
687 void AliITSvSSD03::SetDefaultSimulation(){
688 // sets the default simulation.
696 AliITSDetType *iDetType;
697 AliITSsimulation *sim;
698 AliITSsegmentation *seg;
701 iDetType=DetType(kSPD);
703 sim = iDetType->GetSimulationModel();
705 seg = (AliITSsegmentation*)iDetType->GetSegmentationModel();
706 res = (AliITSresponse*)iDetType->GetResponseModel();
707 sim = new AliITSsimulationSPDdubna(seg,res,1);
708 SetSimulationModel(kSPD,sim);
709 }else{ // simulation exists, make sure it is set up properly.
710 ((AliITSsimulation*)sim)->Init();
711 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
712 // (AliITSresponse*)iDetType->GetResponseModel());
713 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
714 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
716 } // end if !iDetType
718 iDetType=DetType(kSDD);
720 sim = iDetType->GetSimulationModel();
722 seg = (AliITSsegmentation*)iDetType->GetSegmentationModel();
723 res = (AliITSresponse*)iDetType->GetResponseModel();
724 sim = new AliITSsimulationSDD(seg,res);
725 SetSimulationModel(kSDD,sim);
726 }else{ // simulation exists, make sure it is set up properly.
727 ((AliITSsimulation*)sim)->Init();
728 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
729 // (AliITSresponse*)iDetType->GetResponseModel());
730 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
731 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
733 } // end if !iDetType
735 iDetType=DetType(kSSD);
737 sim = iDetType->GetSimulationModel();
739 seg = (AliITSsegmentation*)iDetType->GetSegmentationModel();
740 res = (AliITSresponse*)iDetType->GetResponseModel();
741 sim = new AliITSsimulationSSD(seg,res);
742 SetSimulationModel(kSSD,sim);
743 }else{ // simulation exists, make sure it is set up properly.
744 ((AliITSsimulation*)sim)->Init();
745 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
746 // (AliITSresponse*)iDetType->GetResponseModel());
747 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
748 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
750 } // end if !iDetType
753 //______________________________________________________________________
754 void AliITSvSSD03::DrawModule() const {
755 ////////////////////////////////////////////////////////////////////////
756 // Draw a shaded view of the ITS SSD test beam version 1.
763 ////////////////////////////////////////////////////////////////////////
765 gMC->Gsatt("*", "seen", -1);
766 gMC->Gsatt("ALIC","SEEN",0);
767 gMC->Gsatt("ITSV","SEEN",0);
768 gMC->Gsatt("ITSA","SEEN",1);
769 gMC->Gsatt("ITSS","SEEN",1);
770 gMC->Gsatt("IGAR","SEEN",1);
771 gMC->Gsatt("IAIR","SEEN",0);
772 gMC->Gsatt("ITST","SEEN",1);
773 gMC->Gsatt("IFRA","SEEN",1);
774 gMC->Gsatt("IFRS","SEEN",1);
776 //______________________________________________________________________
777 void AliITSvSSD03::StepManager(){
778 ////////////////////////////////////////////////////////////////////////
779 // Called for every step in the ITS SSD, then calles the
780 // AliITShit class creator with the information to be recoreded about
782 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
783 // printing of information to a file which can be used to create a .det
784 // file read in by the routine CreateGeometry(). If set to 0 or any other
785 // value except 1, the default behavior, then no such file is created nor
786 // it the extra variables and the like used in the printing allocated.
793 ////////////////////////////////////////////////////////////////////////
795 TLorentzVector position, momentum;
796 static TLorentzVector position0;
797 static Int_t stat0=0;
799 if((id=gMC->CurrentVolID(copy) == fIDMother)&&
800 (gMC->IsTrackEntering()||gMC->IsTrackExiting())){
801 copy = fTrackReferences->GetEntriesFast();
802 TClonesArray &lTR = *fTrackReferences;
803 // Fill TrackReference structure with this new TrackReference.
804 new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
805 } // if Outer ITS mother Volume
807 if(!(this->IsActive())){
809 } // end if !Active volume.
813 TClonesArray &lhits = *fHits;
818 if(gMC->IsTrackInside()) vol[3] += 1;
819 if(gMC->IsTrackEntering()) vol[3] += 2;
820 if(gMC->IsTrackExiting()) vol[3] += 4;
821 if(gMC->IsTrackOut()) vol[3] += 8;
822 if(gMC->IsTrackDisappeared()) vol[3] += 16;
823 if(gMC->IsTrackStop()) vol[3] += 32;
824 if(gMC->IsTrackAlive()) vol[3] += 64;
826 // Fill hit structure.
827 if(!(gMC->TrackCharge())) return;
828 id = gMC->CurrentVolID(copy);
829 if(id==fIdSens[0]){ // Volume name "ITST"
830 vol[2] = vol[1] = vol[0] = 1; // Det, ladder
831 } else return; // end if
833 gMC->TrackPosition(position);
834 gMC->TrackMomentum(momentum);
836 if(gMC->IsTrackEntering()){
837 position0 = position;
840 } // end if IsEntering
842 // Fill hit structure with this new hit only for non-entrerance hits.
843 else new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,
844 gMC->Edep(),gMC->TrackTime(),position,
846 //cout<<gMC->Edep()<<endl;
848 position0 = position;