1 ////////////////////////////////////////////////////////
2 // ITS geometry class and step manager for the //
3 // integrated ITS test beam of Nov. 04 //
4 // Author: mercedes.lopez.noriega@cern.ch //
5 ////////////////////////////////////////////////////////
7 #include "AliITSvBeamTestITS04.h"
8 #include <TClonesArray.h>
11 #include "AliITSDetTypeSim.h"
12 #include "AliITSgeom.h"
13 #include "AliITShit.h"
14 #include "AliITSresponseSDD.h"
15 #include "AliITSCalibrationSDD.h"
16 #include "AliITSCalibrationSPD.h"
17 #include "AliITSCalibrationSSD.h"
18 #include "AliITSsegmentationSDD.h"
19 #include "AliITSsegmentationSPD.h"
20 #include "AliITSsegmentationSSD.h"
22 #include "TVirtualMC.h"
25 const Int_t AliITSvBeamTestITS04::fgkNumberOfSPD = 4;
26 const Int_t AliITSvBeamTestITS04::fgkNumberOfSDD = 2;
27 const Int_t AliITSvBeamTestITS04::fgkNumberOfSSD = 4;
28 // Dimension (thickness:Y (beam direction), width:X, length:Z)
30 const char* AliITSvBeamTestITS04::fgSPDsensitiveVolName = "ITSspdSensitiv";
31 //dimensions (preliminary values from Petra (in cms))
32 const Double_t AliITSvBeamTestITS04::fgkSPDthickness = 0.02;
33 const Double_t AliITSvBeamTestITS04::fgkSPDwidth = 1.4;
34 const Double_t AliITSvBeamTestITS04::fgkSPDlength = 7.2;
35 const Double_t AliITSvBeamTestITS04::fgkSPDthickSens = 0.02;
36 const Double_t AliITSvBeamTestITS04::fgkSPDwidthSens = 1.2;
37 const Double_t AliITSvBeamTestITS04::fgkSPDlengthSens = 7.0;
39 const Double_t AliITSvBeamTestITS04::fgkSPD0y = 23.7;
40 const Double_t AliITSvBeamTestITS04::fgkSPD1y = 33.7;
43 const char* AliITSvBeamTestITS04::fgSDDsensitiveVolName = "ITSsddSensitiv";
44 //dimensions (preliminary values from Ludovic (in cms))
45 const Double_t AliITSvBeamTestITS04::fgkSDDthickness = 0.03;
46 const Double_t AliITSvBeamTestITS04::fgkSDDwidth = 7.22;
47 const Double_t AliITSvBeamTestITS04::fgkSDDlength = 8.76;
48 const Double_t AliITSvBeamTestITS04::fgkSDDthickSens = 0.02998;
49 const Double_t AliITSvBeamTestITS04::fgkSDDwidthSens = 7.017;
50 const Double_t AliITSvBeamTestITS04::fgkSDDlengthSens = 7.497;
52 const Double_t AliITSvBeamTestITS04::fgkSDD0y = 51.7;
53 const Double_t AliITSvBeamTestITS04::fgkSDD1y = 57.2;
56 const char* AliITSvBeamTestITS04::fgSSDsensitiveVolName = "ITSssdSensitiv";
57 //dimensions (final values from Javier (in cms))
58 const Double_t AliITSvBeamTestITS04::fgkSSDthickness = 0.03;
59 const Double_t AliITSvBeamTestITS04::fgkSSDwidth = 7.7;
60 const Double_t AliITSvBeamTestITS04::fgkSSDlength = 4.4;
61 const Double_t AliITSvBeamTestITS04::fgkSSDthickSens = 0.03;
62 const Double_t AliITSvBeamTestITS04::fgkSSDwidthSens = 7.5;
63 const Double_t AliITSvBeamTestITS04::fgkSSDlengthSens = 4.2;
65 const Double_t AliITSvBeamTestITS04::fgkSSD0y = 73.6;
66 const Double_t AliITSvBeamTestITS04::fgkSSD1y = 80.6;
68 //===============================================================
71 #include <TLorentzVector.h>
72 #include "AliTrackReference.h"
73 #include "AliITSDetTypeSim.h"
74 #include "AliITSgeom.h"
75 #include "AliITSgeomSDD.h"
76 #include "AliITSgeomSPD.h"
77 #include "AliITSgeomSSD.h"
78 #include "AliITShit.h"
79 #include "AliITSCalibrationSDD.h"
80 #include "AliITSCalibrationSPD.h"
81 #include "AliITSCalibrationSSD.h"
82 #include "AliITSsegmentationSDD.h"
83 #include "AliITSsegmentationSPD.h"
84 #include "AliITSsegmentationSSD.h"
86 #include <TGeoManager.h>
87 #include <TGeoVolume.h>
90 ClassImp(AliITSvBeamTestITS04)
92 //_____________________________________________________________
93 AliITSvBeamTestITS04::AliITSvBeamTestITS04() : AliITS(),
95 fNspd(fgkNumberOfSPD),
96 fNsdd(fgkNumberOfSDD),
97 fNssd(fgkNumberOfSSD),
104 // SetNumberOfSPD(fgkNumberOfSPD);
105 // SetNumberOfSDD(fgkNumberOfSDD);
106 // SetNumberOfSSD(fgkNumberOfSSD);
109 fIdName = new TString[fIdN];
110 fIdName[0] = fgSPDsensitiveVolName;
111 fIdName[1] = fgSDDsensitiveVolName;
112 fIdName[2] = fgSSDsensitiveVolName;
113 fIdSens = new Int_t[fIdN];
114 for(Int_t i=0; i<fIdN; i++) fIdSens[i] = 0;
116 //for writing out geometry
117 //fGeomDetOut = kFALSE;
119 // for reading in geometry (JC)
120 //fGeomDetIn = kFALSE;
122 for(Int_t a=0;a<60;a++) fWrite[a] = '\0';
125 //_____________________________________________________________
126 AliITSvBeamTestITS04::AliITSvBeamTestITS04(const char* name,const char *title)
127 : AliITS(name,title),
129 fNspd(fgkNumberOfSPD),
130 fNsdd(fgkNumberOfSDD),
131 fNssd(fgkNumberOfSSD),
139 //SetNumberOfSPD(fgkNumberOfSPD);
140 //SetNumberOfSDD(fgkNumberOfSDD);
141 //SetNumberOfSSD(fgkNumberOfSSD);
144 fIdName = new TString[fIdN];
145 fIdName[0] = fgSPDsensitiveVolName;
146 fIdName[1] = fgSDDsensitiveVolName;
147 fIdName[2] = fgSSDsensitiveVolName;
148 fIdSens = new Int_t[fIdN];
149 for(Int_t i=0; i<fIdN; i++) fIdSens[i] = 0;
151 //for writing out geometry
152 //fGeomDetOut = kFALSE; // Don't write .det file
154 // for reading in geometry (JC)
155 //fGeomDetIn = kFALSE;
157 for(Int_t a=0;a<60;a++) fWrite[a] = '\0';
160 //__________________________________________________________________
161 AliITSvBeamTestITS04::~AliITSvBeamTestITS04()
168 //______________________________________________________________________
169 void AliITSvBeamTestITS04::CreateMaterials()
171 // Media defined here should correspond to the one defined in galice.cuts
172 // This file is read in (AliMC*) fMCApp::Init() { ReadTransPar(); }
174 // Create ITS materials
175 Int_t ifield = gAlice->Field()->Integ();
176 Float_t fieldm = gAlice->Field()->Max();
178 Float_t tmaxfdSi = 0.1;
179 Float_t stemaxSi = 0.0075;
180 Float_t deemaxSi = 0.1;
181 Float_t epsilSi = 1.0E-4;
182 Float_t stminSi = 0.0;
184 Float_t tmaxfdAir = 0.1;
185 Float_t stemaxAir = .10000E+01;
186 Float_t deemaxAir = 0.1;
187 Float_t epsilAir = 1.0E-4;
188 Float_t stminAir = 0.0;
191 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
192 Float_t zAir[4]={6.,7.,8.,18.};
193 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
194 Float_t dAir = 1.20479E-3;
196 AliMaterial(51,"ITSspdSi",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
197 AliMedium(51,"ITSspdSi",51,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
199 AliMaterial(1,"ITSsddSi",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
200 AliMedium(1,"ITSsddSi",1,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
202 //AliMaterial(?,"ITSssdSi",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
203 //AliMedium(?,"ITSssdSi",51,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
205 AliMixture(5,"ITSair",aAir,zAir,dAir,4,wAir);
206 AliMedium(5,"ITSair",5,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,epsilAir,stminAir);
208 //NEED TO ADD PLASTIC OF SCINTILLATORS!!
212 //______________________________________________________________________
213 void AliITSvBeamTestITS04::CreateGeometry()
216 TGeoManager *geoManager = gGeoManager;
217 TGeoVolume *vALIC = geoManager->GetTopVolume();
219 //================================
221 //================================
222 TGeoPcon *sITS = new TGeoPcon("ITS Top Volume",0.0,360.0,2);
223 // DefineSection(section number, Z, Rmin, Rmax).
224 sITS->DefineSection(0,-100.0,0.01,100.0); // Units in cms
225 sITS->DefineSection(1,+100.0,0.01,100.0);
227 TGeoMedium *air = gGeoManager->GetMedium("ITSair");
228 fITSmotherVolume = new TGeoVolume("vITS",sITS,air);
229 fITSmotherVolume->SetVisibility(kFALSE);
230 vALIC->AddNode(fITSmotherVolume,1,0);
233 // TGeoMedium *plasticScint = new TGeoMedium("plasticScint",1,Plastic);
234 // //First Scintillator
235 // TGeoBBox *Scint1Shape = new TGeoBBox("Scint1Shape",0.5,0.1,0.5,0); //1x1cm
236 // TGeoVolume *Scint1 = new TGeoVolume("Scint1",Scint1Shape,plasticScint);
237 // TGeoTranslation *firstScint = new TGeoTranslation(0,0.7,0);
238 // vALIC->AddNode(Scint1,2,firstScint);
239 // //Second Scintillator
240 // TGeoBBox *Scint2Shape = new TGeoBBox("Scint2Shape",1.,0.1,1.,0); //2x2cm
241 // TGeoVolume *Scint2 = new TGeoVolume("Scint2",Scint2Shape,plasticScint);
242 // TGeoTranslation *secondScint = new TGeoTranslation(0,90.,0);
243 // vALIC->AddNode(Scint2,3,secondScint);
245 AddSPDGeometry(fITSmotherVolume);
246 AddSDDGeometry(fITSmotherVolume);
247 AddSSDGeometry(fITSmotherVolume);
250 //______________________________________________________________________
251 void AliITSvBeamTestITS04::Init()
253 // Initialize the ITS after it has been created.
255 for(i=0;i<20;i++) printf("*");
256 printf( " ITSbeamtest_Init " );
257 for(i=0;i<20;i++) printf("*"); printf("\n");
259 // // Create geometry
260 // if(!fGeomDetIn) this->InitAliITSgeom();
264 for(i=0;i<40+16;i++) printf("*"); printf("\n");
268 //______________________________________________________________________
269 void AliITSvBeamTestITS04::InitAliITSgeom()
271 //initialisation of ITSgeom
272 const Int_t knlayers = 6;
273 Int_t nlad[knlayers], ndet[knlayers];
275 nlad[0] = 1; ndet[0] = 2;
276 nlad[1] = 1; ndet[1] = 2;
277 nlad[2] = 1; ndet[2] = 1;
278 nlad[3] = 1; ndet[3] = 1;
279 nlad[4] = 1; ndet[4] = 2;
280 nlad[5] = 1; ndet[5] = 2;
282 Int_t nModTot = fNspd + fNsdd + fNssd;
283 if (GetITSgeom()) SetITSgeom(0x0);
284 AliITSgeom* geom = new AliITSgeom(0,knlayers,nlad,ndet,nModTot);
286 //*** Set default shapes
287 const Float_t kDxyzSPD[] = {fgkSPDwidthSens/2, fgkSPDthickSens/2,fgkSPDlengthSens/2};
288 if(!(GetITSgeom()->IsShapeDefined(kSPD)))
289 GetITSgeom()->ReSetShape(kSPD,new AliITSgeomSPD425Short(3,(Float_t *)kDxyzSPD));
291 const Float_t kDxyzSDD[] = {fgkSDDwidthSens/2., fgkSDDthickSens/2.,fgkSDDlengthSens/2.};
292 if(!(GetITSgeom()->IsShapeDefined(kSDD)))
293 GetITSgeom()->ReSetShape(kSDD, new AliITSgeomSDD256(3,(Float_t *)kDxyzSDD));
295 const Float_t kDxyzSSD[] = {fgkSSDlengthSens/2, fgkSSDthickSens/2,fgkSSDwidthSens/2};
296 if(!(GetITSgeom()->IsShapeDefined(kSSD)))
297 GetITSgeom()->ReSetShape(kSSD,new AliITSgeomSSD75and275(3,(Float_t *)kDxyzSSD));
299 // Creating the matrices in AliITSgeom for each sensitive volume
300 // (like in AliITSv11GeometrySDD) mln
301 // Here, each layer is one detector
307 for (Int_t i=0; i<fNspd;i++) {
308 sprintf(layerName, "ITSspdWafer_%i",i+1);
309 TGeoNode *layNode = fITSmotherVolume->GetNode(layerName);
311 TGeoHMatrix layMatrix(*layNode->GetMatrix());
312 Double_t *trans = layMatrix.GetTranslation();
313 Double_t *r = layMatrix.GetRotationMatrix();
314 Double_t rot[10] = {r[0],r[1],r[2],
316 r[6],r[7],r[8], 1.0};
318 if ((i+1==2)||(i+1==4)) iDet = 2;
322 GetITSgeom()->CreateMatrix(startMod,iLay,iLad,iDet,kSPD,trans,rot);
328 for (Int_t i=0; i<fNsdd;i++) {
329 sprintf(layerName, "ITSsddWafer_%i",i+fNspd+1);
330 TGeoNode *layNode = fITSmotherVolume->GetNode(layerName);
332 TGeoHMatrix layMatrix(*layNode->GetMatrix());
333 Double_t *trans = layMatrix.GetTranslation();
334 Double_t *r = layMatrix.GetRotationMatrix();
335 Double_t rot[10] = {r[0],r[1],r[2],
337 r[6],r[7],r[8], 1.0};
340 Int_t iLay = fNspd-1+i;
341 GetITSgeom()->CreateMatrix(startMod,iLay,iLad,iDet,kSDD,trans,rot);
347 for (Int_t i=0; i<fNssd;i++) {
348 sprintf(layerName, "ITSssdWafer_%i",i+fNspd+fNsdd+1);
349 TGeoNode *layNode = fITSmotherVolume->GetNode(layerName);
351 TGeoHMatrix layMatrix(*layNode->GetMatrix());
352 Double_t *trans = layMatrix.GetTranslation();
353 Double_t *r = layMatrix.GetRotationMatrix();
354 Double_t rot[10] = {r[0],r[1],r[2],
356 r[6],r[7],r[8], 1.0};
358 if ((i+1==2)||(i+1==4)) iDet = 2;
362 GetITSgeom()->CreateMatrix(startMod,iLay,iLad,iDet,kSSD,trans,rot);
370 //______________________________________________________________________
371 void AliITSvBeamTestITS04::SetDefaults()
373 // (from AliITSv11) mln
375 const Float_t kconv = 1.0e+04; // convert cm to microns
377 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
378 fDetTypeSim->SetITSgeom(GetITSgeom());
379 fDetTypeSim->ResetCalibrationArray();
380 fDetTypeSim->ResetSegmentation();
386 Float_t bx[256],bz[280];
388 // If fGeomDetIn is set true the geometry will
389 // be initialised from file (JC)
390 if(GetITSgeom()!=0) SetITSgeom(0x0);
391 AliITSgeom* geom = new AliITSgeom();
393 if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead);
394 if(!fGeomDetIn) this->InitAliITSgeom();
395 if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite);
400 s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);// Get shape info.
402 AliITSCalibration *resp0=new AliITSCalibrationSPD();
403 SetCalibrationModel(kSPD,resp0);
405 AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD();
406 seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD
407 s0->GetDz()*2.*kconv, // for now.
408 s0->GetDy()*2.*kconv);// x,z,y full width in microns.
409 seg0->SetNPads(256,160); // Number of Bins in x and z
410 for(i=000;i<256;i++) bx[i] = 50.0; // in x all are 50 microns.
411 for(i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below
412 for(i=160;i<280;i++) bz[i] = 0.0; // Outside of detector.
413 bz[ 31] = bz[ 32] = 625.0; // first chip boundry
414 bz[ 63] = bz[ 64] = 625.0; // first chip boundry
415 bz[ 95] = bz[ 96] = 625.0; // first chip boundry
416 bz[127] = bz[128] = 625.0; // first chip boundry
417 bz[160] = 425.0; // Set so that there is no zero pixel size for fNz.
418 seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now.
419 SetSegmentationModel(kSPD,seg0);
420 // set digit and raw cluster classes to be used
421 const char *kData0=(fDetTypeSim->GetCalibrationModel(kSPD))->DataType();
422 if (strstr(kData0,"real"))
423 fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit");
424 else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
429 s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);// Get shape info.
431 AliITSCalibrationSDD *resp1=new AliITSCalibrationSDD("simulated");
432 SetCalibrationModel(kSDD,resp1);
433 AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD();
434 seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD
435 s1->GetDz()*4.*kconv, // for now.
436 s1->GetDy()*4.*kconv); // x,z,y full width in microns.
437 seg1->SetDriftSpeed(resp1->GetDriftSpeed());
438 seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
439 SetSegmentationModel(kSDD,seg1);
440 const char *kData1=(fDetTypeSim->GetCalibrationModel(kSDD))->DataType();
441 const char *kopt=resp1->GetZeroSuppOption();
442 if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){
443 fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit");
444 } else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD");
449 s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);// Get shape info. Do it this way for now.
451 AliITSCalibration *resp2=new AliITSCalibrationSSD("simulated");
452 SetCalibrationModel(kSSD,resp2);
454 AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD();
455 seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD
456 s2->GetDz()*2.*kconv, // for now.
457 s2->GetDy()*2.*kconv); // x,z,y full width in microns.
458 seg2->SetPadSize(95.,0.); // strip x pitch in microns
459 seg2->SetNPads(768,0); // number of strips on each side.
460 seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side.
461 seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
462 seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
463 SetSegmentationModel(kSSD,seg2);
464 const char *kData2=(fDetTypeSim->GetCalibrationModel(kSSD))->DataType();
465 if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit");
466 else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
469 if(fgkNTYPES>3){Warning("SetDefaults","Only the four basic detector types are initialised!");}
473 //______________________________________________________________________
474 void AliITSvBeamTestITS04::AddSPDGeometry(TGeoVolume *moth) const
477 TGeoMedium *siliconSPD = gGeoManager->GetMedium("ITSspdSi");
480 TGeoBBox *waferSPDshape = new TGeoBBox("ITSspdWaferShape",fgkSPDwidth/2,fgkSPDthickness/2,fgkSPDlength/2,0);
481 TGeoVolume *waferSPD = new TGeoVolume("ITSspdWafer",waferSPDshape,siliconSPD);
483 TGeoBBox *sensSPDbox = new TGeoBBox("ITSsddSensorSensBox",fgkSPDwidthSens/2,fgkSPDthickSens/2,fgkSPDlengthSens/2,0);
484 TGeoVolume *sensVolSPD = new TGeoVolume(fgSPDsensitiveVolName,sensSPDbox,siliconSPD);
485 waferSPD->AddNode(sensVolSPD, 1, 0); //added to outer volume
487 //locate them in space (with respect top volume)
488 TGeoTranslation *spd1tr = new TGeoTranslation(0,fgkSPD0y,fgkSPDlength/2);
489 TGeoTranslation *spd2tr = new TGeoTranslation(0,fgkSPD0y,-fgkSPDlength/2);
491 TGeoTranslation *spd3tr = new TGeoTranslation(0,fgkSPD1y,fgkSPDlength/2);
492 TGeoTranslation *spd4tr = new TGeoTranslation(0,fgkSPD1y,-fgkSPDlength/2);
495 moth->AddNode(waferSPD, 1, spd1tr);
496 moth->AddNode(waferSPD, 2, spd2tr);
497 moth->AddNode(waferSPD, 3, spd3tr);
498 moth->AddNode(waferSPD, 4, spd4tr);
501 waferSPD->SetLineColor(4);
502 sensVolSPD->SetLineColor(4);
506 //______________________________________________________________________
507 void AliITSvBeamTestITS04::AddSDDGeometry(TGeoVolume *moth) const
510 TGeoMedium *siliconSDD = gGeoManager->GetMedium("ITSsddSi");
513 TGeoBBox *waferSDDshape = new TGeoBBox("ITSsddWaferShape",fgkSDDwidth/2,fgkSDDthickness/2,fgkSDDlength/2,0);
514 TGeoVolume *waferSDD = new TGeoVolume("ITSsddWafer",waferSDDshape,siliconSDD);
516 TGeoBBox *sensSDDbox = new TGeoBBox("ITSsddSensorSensBox",fgkSDDwidthSens/2,fgkSDDthickSens/2,fgkSDDlengthSens/2,0);
517 TGeoVolume *sensVolSDD = new TGeoVolume(fgSDDsensitiveVolName,sensSDDbox,siliconSDD);
518 waferSDD->AddNode(sensVolSDD, 1, 0); //added to outer volume
520 //locate them in space
521 TGeoTranslation *sdd1tr = new TGeoTranslation(0,fgkSDD0y,0);
522 TGeoTranslation *sdd2tr = new TGeoTranslation(0,fgkSDD1y,0);
525 moth->AddNode(waferSDD, fNspd+1, sdd1tr);
526 moth->AddNode(waferSDD, fNspd+2, sdd2tr);
529 waferSDD->SetLineColor(3);
530 sensVolSDD->SetLineColor(3);
534 //______________________________________________________________________
535 void AliITSvBeamTestITS04::AddSSDGeometry(TGeoVolume *moth) const
538 TGeoMedium *siliconSSD = gGeoManager->GetMedium("ITSspdSi"); // SSD medium still needed!!!
541 TGeoBBox *waferSSDshape = new TGeoBBox("ITSssdWaferShape",fgkSSDwidth/2,fgkSSDthickness/2,fgkSSDlength/2,0);
542 TGeoVolume *waferSSD = new TGeoVolume("ITSssdWafer",waferSSDshape,siliconSSD);
544 TGeoBBox *sensSSDbox = new TGeoBBox("ITSssdSensorSensBox",fgkSSDwidthSens/2,fgkSSDthickSens/2,fgkSSDlengthSens/2,0);
545 TGeoVolume *sensVolSSD = new TGeoVolume(fgSSDsensitiveVolName,sensSSDbox,siliconSSD);
546 waferSSD->AddNode(sensVolSSD, 1, 0);
548 //locate them in space
549 /* In the SSD, there was an overlap of sensitive volumes of 2.9mm = 0.29cm (0.29/2=0.145)
550 in the modules in the same plane, therefore the modules where not in the same plane in
551 the Y direction, there was a "thickness" (0.03cm) difference */
552 TGeoTranslation *ssd1tr = new TGeoTranslation(0,fgkSSD0y,fgkSSDlength/2-0.145);
553 TGeoTranslation *ssd2tr = new TGeoTranslation(0,fgkSSD0y+0.03,-fgkSSDlength/2+0.145);
555 TGeoTranslation *ssd3tr = new TGeoTranslation(0,fgkSSD1y,fgkSSDlength/2-0.145);
556 TGeoTranslation *ssd4tr = new TGeoTranslation(0,fgkSSD1y+0.03,-fgkSSDlength/2+0.145);
559 moth->AddNode(waferSSD, fNspd+fNsdd+1, ssd1tr);
560 moth->AddNode(waferSSD, fNspd+fNsdd+2, ssd2tr);
561 moth->AddNode(waferSSD, fNspd+fNsdd+3, ssd3tr);
562 moth->AddNode(waferSSD, fNspd+fNsdd+4, ssd4tr);
565 waferSSD->SetLineColor(2);
566 sensVolSSD->SetLineColor(2);
569 //______________________________________________________________________
570 void AliITSvBeamTestITS04::StepManager()
572 // Called for every step in the ITS, then calles the AliITShit class
573 // creator with the information to be recoreded about that hit.
575 // "Standard" StepManager. (Similar to AliITSv11) mln
577 TLorentzVector position, momentum;
578 static TLorentzVector position0;
579 static Int_t stat0=0;
581 if(!(this->IsActive())){
583 } // end if !Active volume.
585 if(!(gMC->TrackCharge())) return;
587 id=gMC->CurrentVolID(copy);
589 Bool_t sensvol = kFALSE;
590 for(Int_t kk = 0; kk < fIdN; kk++)
591 if(id == fIdSens[kk]) sensvol = kTRUE;
593 if (sensvol && (gMC->IsTrackExiting())) {
594 copy = fTrackReferences->GetEntriesFast();
595 TClonesArray &lTR = *fTrackReferences;
596 // Fill TrackReference structure with this new TrackReference.
597 new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
598 } // if Outer ITS mother Volume
601 TClonesArray &lhits = *fHits;
606 // Fill hit structure.
607 if(gMC->IsTrackInside()) vol[3] += 1;
608 if(gMC->IsTrackEntering()) vol[3] += 2;
609 if(gMC->IsTrackExiting()) vol[3] += 4;
610 if(gMC->IsTrackOut()) vol[3] += 8;
611 if(gMC->IsTrackDisappeared()) vol[3] += 16;
612 if(gMC->IsTrackStop()) vol[3] += 32;
613 if(gMC->IsTrackAlive()) vol[3] += 64;
615 // Only entering charged tracks
616 if(!(gMC->TrackCharge())) return;
618 if( ((id = gMC->CurrentVolID(copy)) == fIdSens[0]) ||
619 ((id = gMC->CurrentVolID(copy)) == fIdSens[1]) ||
620 ((id = gMC->CurrentVolID(copy)) == fIdSens[2]) )
622 GetCurrentLayLaddDet(vol[0], vol[2], vol[1]);
623 // vol[2], vol[1]) : in this order because the ladder
624 // index and the det. index are exchanged in the constructor
627 return; // not an ITS volume?
630 gMC->TrackPosition(position);
631 gMC->TrackMomentum(momentum);
633 if(gMC->IsTrackEntering()){
634 position0 = position;
637 } // end if IsEntering
638 // Fill hit structure with this new hit.
639 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),
640 vol, gMC->Edep(),gMC->TrackTime(),position,
643 position0 = position;
648 //______________________________________________________________________
649 Int_t AliITSvBeamTestITS04::GetCurrentLayLaddDet(Int_t &lay,Int_t &ladd, Int_t &det) const
651 // Function which gives the layer, ladder and det.
652 // index of the current volume. To be used in
653 // AliITS::StepManager()
657 TGeoNode *node = gGeoManager->GetMother(1);
658 if (!node) return kFALSE;
659 Int_t nodeNum = node->GetNumber();
661 // GetNumber() return the index recorded in the node
663 if (nodeNum==5||nodeNum==6) { // SDD: one layer, one detector
665 } else if (nodeNum==3||nodeNum==4) { // SPD layer 2
667 if (nodeNum==4) det = 2;
668 } else if (nodeNum==1||nodeNum==2){ // SPD layer 1
670 if (nodeNum==2) det = 2;
671 } else if (nodeNum==9||nodeNum==10) { // SSD layer 2
673 if (nodeNum==10) det = 2;
674 } else if (nodeNum==7||nodeNum==8){ // SSD layer 1
676 if (nodeNum==8) det = 2;
682 //_____________________________________________________________
684 Int_t AliITSvBeamTestITS04::GetNumberOfSubDet(const TString& det) const{
686 //Get number of individual detectors
687 if(det.Contains("SPD")) return fNspd;
688 if(det.Contains("SDD")) return fNsdd;
689 if(det.Contains("SSD")) return fNssd;