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()
99 SetNumberOfSPD(fgkNumberOfSPD);
100 SetNumberOfSDD(fgkNumberOfSDD);
101 SetNumberOfSSD(fgkNumberOfSSD);
104 fIdName = new TString[fIdN];
105 fIdName[0] = fgSPDsensitiveVolName;
106 fIdName[1] = fgSDDsensitiveVolName;
107 fIdName[2] = fgSSDsensitiveVolName;
108 fIdSens = new Int_t[fIdN];
109 for(Int_t i=0; i<fIdN; i++) fIdSens[i] = 0;
111 //for writing out geometry
112 fGeomDetOut = kFALSE;
114 // for reading in geometry (JC)
117 for(Int_t a=0;a<60;a++) fWrite[a] = '\0';
120 //_____________________________________________________________
121 AliITSvBeamTestITS04::AliITSvBeamTestITS04(const char* name,const char *title)
128 SetNumberOfSPD(fgkNumberOfSPD);
129 SetNumberOfSDD(fgkNumberOfSDD);
130 SetNumberOfSSD(fgkNumberOfSSD);
133 fIdName = new TString[fIdN];
134 fIdName[0] = fgSPDsensitiveVolName;
135 fIdName[1] = fgSDDsensitiveVolName;
136 fIdName[2] = fgSSDsensitiveVolName;
137 fIdSens = new Int_t[fIdN];
138 for(Int_t i=0; i<fIdN; i++) fIdSens[i] = 0;
140 //for writing out geometry
141 fGeomDetOut = kFALSE; // Don't write .det file
143 // for reading in geometry (JC)
146 for(Int_t a=0;a<60;a++) fWrite[a] = '\0';
149 //______________________________________________________________________
150 AliITSvBeamTestITS04::AliITSvBeamTestITS04(const AliITSvBeamTestITS04 &source) : AliITS(source){
151 //Copy constructor (dummy)
152 if(&source == this) return;
153 Warning("Copy Constructor","Not allowed to copy AliITSvSDD03");
156 //______________________________________________________________________
157 AliITSvBeamTestITS04& AliITSvBeamTestITS04::operator=(const AliITSvBeamTestITS04 &source){
160 // This class is not to be copied. Function only dummy.
161 if(&source == this) return *this;
162 Warning("= operator","Not allowed to copy AliITSvSDD03");
166 //__________________________________________________________________
167 AliITSvBeamTestITS04::~AliITSvBeamTestITS04()
174 //______________________________________________________________________
175 void AliITSvBeamTestITS04::CreateMaterials()
177 // Media defined here should correspond to the one defined in galice.cuts
178 // This file is read in (AliMC*) fMCApp::Init() { ReadTransPar(); }
180 // Create ITS materials
181 Int_t ifield = gAlice->Field()->Integ();
182 Float_t fieldm = gAlice->Field()->Max();
184 Float_t tmaxfdSi = 0.1;
185 Float_t stemaxSi = 0.0075;
186 Float_t deemaxSi = 0.1;
187 Float_t epsilSi = 1.0E-4;
188 Float_t stminSi = 0.0;
190 Float_t tmaxfdAir = 0.1;
191 Float_t stemaxAir = .10000E+01;
192 Float_t deemaxAir = 0.1;
193 Float_t epsilAir = 1.0E-4;
194 Float_t stminAir = 0.0;
197 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
198 Float_t zAir[4]={6.,7.,8.,18.};
199 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
200 Float_t dAir = 1.20479E-3;
202 AliMaterial(51,"ITSspdSi",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
203 AliMedium(51,"ITSspdSi",51,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
205 AliMaterial(1,"ITSsddSi",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
206 AliMedium(1,"ITSsddSi",1,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
208 //AliMaterial(?,"ITSssdSi",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
209 //AliMedium(?,"ITSssdSi",51,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
211 AliMixture(5,"ITSair",aAir,zAir,dAir,4,wAir);
212 AliMedium(5,"ITSair",5,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,epsilAir,stminAir);
214 //NEED TO ADD PLASTIC OF SCINTILLATORS!!
218 //______________________________________________________________________
219 void AliITSvBeamTestITS04::CreateGeometry()
222 TGeoManager *geoManager = gGeoManager;
223 TGeoVolume *vALIC = geoManager->GetTopVolume();
225 //================================
227 //================================
228 TGeoPcon *sITS = new TGeoPcon("ITS Top Volume",0.0,360.0,2);
229 // DefineSection(section number, Z, Rmin, Rmax).
230 sITS->DefineSection(0,-100.0,0.01,100.0); // Units in cms
231 sITS->DefineSection(1,+100.0,0.01,100.0);
233 TGeoMedium *air = gGeoManager->GetMedium("ITSair");
234 fITSmotherVolume = new TGeoVolume("vITS",sITS,air);
235 fITSmotherVolume->SetVisibility(kFALSE);
236 vALIC->AddNode(fITSmotherVolume,1,0);
239 // TGeoMedium *plasticScint = new TGeoMedium("plasticScint",1,Plastic);
240 // //First Scintillator
241 // TGeoBBox *Scint1Shape = new TGeoBBox("Scint1Shape",0.5,0.1,0.5,0); //1x1cm
242 // TGeoVolume *Scint1 = new TGeoVolume("Scint1",Scint1Shape,plasticScint);
243 // TGeoTranslation *firstScint = new TGeoTranslation(0,0.7,0);
244 // vALIC->AddNode(Scint1,2,firstScint);
245 // //Second Scintillator
246 // TGeoBBox *Scint2Shape = new TGeoBBox("Scint2Shape",1.,0.1,1.,0); //2x2cm
247 // TGeoVolume *Scint2 = new TGeoVolume("Scint2",Scint2Shape,plasticScint);
248 // TGeoTranslation *secondScint = new TGeoTranslation(0,90.,0);
249 // vALIC->AddNode(Scint2,3,secondScint);
251 AddSPDGeometry(fITSmotherVolume);
252 AddSDDGeometry(fITSmotherVolume);
253 AddSSDGeometry(fITSmotherVolume);
256 //______________________________________________________________________
257 void AliITSvBeamTestITS04::Init()
259 // Initialize the ITS after it has been created.
261 for(i=0;i<20;i++) printf("*");
262 printf( " ITSbeamtest_Init " );
263 for(i=0;i<20;i++) printf("*"); printf("\n");
265 // // Create geometry
266 // if(!fGeomDetIn) this->InitAliITSgeom();
270 for(i=0;i<40+16;i++) printf("*"); printf("\n");
274 //______________________________________________________________________
275 void AliITSvBeamTestITS04::InitAliITSgeom()
277 //initialisation of ITSgeom
278 const Int_t knlayers = 6;
279 Int_t nlad[knlayers], ndet[knlayers];
281 nlad[0] = 1; ndet[0] = 2;
282 nlad[1] = 1; ndet[1] = 2;
283 nlad[2] = 1; ndet[2] = 1;
284 nlad[3] = 1; ndet[3] = 1;
285 nlad[4] = 1; ndet[4] = 2;
286 nlad[5] = 1; ndet[5] = 2;
288 Int_t nModTot = fNspd + fNsdd + fNssd;
289 if (GetITSgeom()) SetITSgeom(0x0);
290 AliITSgeom* geom = new AliITSgeom(0,knlayers,nlad,ndet,nModTot);
292 //*** Set default shapes
293 const Float_t kDxyzSPD[] = {fgkSPDwidthSens/2, fgkSPDthickSens/2,fgkSPDlengthSens/2};
294 if(!(GetITSgeom()->IsShapeDefined(kSPD)))
295 GetITSgeom()->ReSetShape(kSPD,new AliITSgeomSPD425Short(3,(Float_t *)kDxyzSPD));
297 const Float_t kDxyzSDD[] = {fgkSDDwidthSens/2., fgkSDDthickSens/2.,fgkSDDlengthSens/2.};
298 if(!(GetITSgeom()->IsShapeDefined(kSDD)))
299 GetITSgeom()->ReSetShape(kSDD, new AliITSgeomSDD256(3,(Float_t *)kDxyzSDD));
301 const Float_t kDxyzSSD[] = {fgkSSDlengthSens/2, fgkSSDthickSens/2,fgkSSDwidthSens/2};
302 if(!(GetITSgeom()->IsShapeDefined(kSSD)))
303 GetITSgeom()->ReSetShape(kSSD,new AliITSgeomSSD75and275(3,(Float_t *)kDxyzSSD));
305 // Creating the matrices in AliITSgeom for each sensitive volume
306 // (like in AliITSv11GeometrySDD) mln
307 // Here, each layer is one detector
313 for (Int_t i=0; i<fNspd;i++) {
314 sprintf(layerName, "ITSspdWafer_%i",i+1);
315 TGeoNode *layNode = fITSmotherVolume->GetNode(layerName);
317 TGeoHMatrix layMatrix(*layNode->GetMatrix());
318 Double_t *trans = layMatrix.GetTranslation();
319 Double_t *r = layMatrix.GetRotationMatrix();
320 Double_t rot[10] = {r[0],r[1],r[2],
322 r[6],r[7],r[8], 1.0};
324 if ((i+1==2)||(i+1==4)) iDet = 2;
328 GetITSgeom()->CreateMatrix(startMod,iLay,iLad,iDet,kSPD,trans,rot);
334 for (Int_t i=0; i<fNsdd;i++) {
335 sprintf(layerName, "ITSsddWafer_%i",i+fNspd+1);
336 TGeoNode *layNode = fITSmotherVolume->GetNode(layerName);
338 TGeoHMatrix layMatrix(*layNode->GetMatrix());
339 Double_t *trans = layMatrix.GetTranslation();
340 Double_t *r = layMatrix.GetRotationMatrix();
341 Double_t rot[10] = {r[0],r[1],r[2],
343 r[6],r[7],r[8], 1.0};
346 Int_t iLay = fNspd-1+i;
347 GetITSgeom()->CreateMatrix(startMod,iLay,iLad,iDet,kSDD,trans,rot);
353 for (Int_t i=0; i<fNssd;i++) {
354 sprintf(layerName, "ITSssdWafer_%i",i+fNspd+fNsdd+1);
355 TGeoNode *layNode = fITSmotherVolume->GetNode(layerName);
357 TGeoHMatrix layMatrix(*layNode->GetMatrix());
358 Double_t *trans = layMatrix.GetTranslation();
359 Double_t *r = layMatrix.GetRotationMatrix();
360 Double_t rot[10] = {r[0],r[1],r[2],
362 r[6],r[7],r[8], 1.0};
364 if ((i+1==2)||(i+1==4)) iDet = 2;
368 GetITSgeom()->CreateMatrix(startMod,iLay,iLad,iDet,kSSD,trans,rot);
376 //______________________________________________________________________
377 void AliITSvBeamTestITS04::SetDefaults()
379 // (from AliITSv11) mln
381 const Float_t kconv = 1.0e+04; // convert cm to microns
383 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
384 fDetTypeSim->SetITSgeom(GetITSgeom());
385 fDetTypeSim->ResetCalibrationArray();
386 fDetTypeSim->ResetSegmentation();
392 Float_t bx[256],bz[280];
394 // If fGeomDetIn is set true the geometry will
395 // be initialised from file (JC)
396 if(GetITSgeom()!=0) SetITSgeom(0x0);
397 AliITSgeom* geom = new AliITSgeom();
399 if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead);
400 if(!fGeomDetIn) this->InitAliITSgeom();
401 if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite);
406 s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);// Get shape info.
408 AliITSCalibration *resp0=new AliITSCalibrationSPD();
409 SetCalibrationModel(kSPD,resp0);
411 AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD();
412 seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD
413 s0->GetDz()*2.*kconv, // for now.
414 s0->GetDy()*2.*kconv);// x,z,y full width in microns.
415 seg0->SetNPads(256,160); // Number of Bins in x and z
416 for(i=000;i<256;i++) bx[i] = 50.0; // in x all are 50 microns.
417 for(i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below
418 for(i=160;i<280;i++) bz[i] = 0.0; // Outside of detector.
419 bz[ 31] = bz[ 32] = 625.0; // first chip boundry
420 bz[ 63] = bz[ 64] = 625.0; // first chip boundry
421 bz[ 95] = bz[ 96] = 625.0; // first chip boundry
422 bz[127] = bz[128] = 625.0; // first chip boundry
423 bz[160] = 425.0; // Set so that there is no zero pixel size for fNz.
424 seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now.
425 SetSegmentationModel(kSPD,seg0);
426 // set digit and raw cluster classes to be used
427 const char *kData0=(fDetTypeSim->GetCalibrationModel(kSPD))->DataType();
428 if (strstr(kData0,"real"))
429 fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit");
430 else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
435 s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);// Get shape info.
437 AliITSCalibrationSDD *resp1=new AliITSCalibrationSDD("simulated");
438 SetCalibrationModel(kSDD,resp1);
439 AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD();
440 seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD
441 s1->GetDz()*4.*kconv, // for now.
442 s1->GetDy()*4.*kconv); // x,z,y full width in microns.
443 seg1->SetDriftSpeed(resp1->GetDriftSpeed());
444 seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
445 SetSegmentationModel(kSDD,seg1);
446 const char *kData1=(fDetTypeSim->GetCalibrationModel(kSDD))->DataType();
447 const char *kopt=resp1->GetZeroSuppOption();
448 if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){
449 fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit");
450 } else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD");
455 s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);// Get shape info. Do it this way for now.
457 AliITSCalibration *resp2=new AliITSCalibrationSSD("simulated");
458 SetCalibrationModel(kSSD,resp2);
460 AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD();
461 seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD
462 s2->GetDz()*2.*kconv, // for now.
463 s2->GetDy()*2.*kconv); // x,z,y full width in microns.
464 seg2->SetPadSize(95.,0.); // strip x pitch in microns
465 seg2->SetNPads(768,0); // number of strips on each side.
466 seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side.
467 seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
468 seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
469 SetSegmentationModel(kSSD,seg2);
470 const char *kData2=(fDetTypeSim->GetCalibrationModel(kSSD))->DataType();
471 if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit");
472 else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
475 if(fgkNTYPES>3){Warning("SetDefaults","Only the four basic detector types are initialised!");}
479 //______________________________________________________________________
480 void AliITSvBeamTestITS04::AddSPDGeometry(TGeoVolume *moth) const
483 TGeoMedium *siliconSPD = gGeoManager->GetMedium("ITSspdSi");
486 TGeoBBox *waferSPDshape = new TGeoBBox("ITSspdWaferShape",fgkSPDwidth/2,fgkSPDthickness/2,fgkSPDlength/2,0);
487 TGeoVolume *waferSPD = new TGeoVolume("ITSspdWafer",waferSPDshape,siliconSPD);
489 TGeoBBox *sensSPDbox = new TGeoBBox("ITSsddSensorSensBox",fgkSPDwidthSens/2,fgkSPDthickSens/2,fgkSPDlengthSens/2,0);
490 TGeoVolume *sensVolSPD = new TGeoVolume(fgSPDsensitiveVolName,sensSPDbox,siliconSPD);
491 waferSPD->AddNode(sensVolSPD, 1, 0); //added to outer volume
493 //locate them in space (with respect top volume)
494 TGeoTranslation *spd1tr = new TGeoTranslation(0,fgkSPD0y,fgkSPDlength/2);
495 TGeoTranslation *spd2tr = new TGeoTranslation(0,fgkSPD0y,-fgkSPDlength/2);
497 TGeoTranslation *spd3tr = new TGeoTranslation(0,fgkSPD1y,fgkSPDlength/2);
498 TGeoTranslation *spd4tr = new TGeoTranslation(0,fgkSPD1y,-fgkSPDlength/2);
501 moth->AddNode(waferSPD, 1, spd1tr);
502 moth->AddNode(waferSPD, 2, spd2tr);
503 moth->AddNode(waferSPD, 3, spd3tr);
504 moth->AddNode(waferSPD, 4, spd4tr);
507 waferSPD->SetLineColor(4);
508 sensVolSPD->SetLineColor(4);
512 //______________________________________________________________________
513 void AliITSvBeamTestITS04::AddSDDGeometry(TGeoVolume *moth) const
516 TGeoMedium *siliconSDD = gGeoManager->GetMedium("ITSsddSi");
519 TGeoBBox *waferSDDshape = new TGeoBBox("ITSsddWaferShape",fgkSDDwidth/2,fgkSDDthickness/2,fgkSDDlength/2,0);
520 TGeoVolume *waferSDD = new TGeoVolume("ITSsddWafer",waferSDDshape,siliconSDD);
522 TGeoBBox *sensSDDbox = new TGeoBBox("ITSsddSensorSensBox",fgkSDDwidthSens/2,fgkSDDthickSens/2,fgkSDDlengthSens/2,0);
523 TGeoVolume *sensVolSDD = new TGeoVolume(fgSDDsensitiveVolName,sensSDDbox,siliconSDD);
524 waferSDD->AddNode(sensVolSDD, 1, 0); //added to outer volume
526 //locate them in space
527 TGeoTranslation *sdd1tr = new TGeoTranslation(0,fgkSDD0y,0);
528 TGeoTranslation *sdd2tr = new TGeoTranslation(0,fgkSDD1y,0);
531 moth->AddNode(waferSDD, fNspd+1, sdd1tr);
532 moth->AddNode(waferSDD, fNspd+2, sdd2tr);
535 waferSDD->SetLineColor(3);
536 sensVolSDD->SetLineColor(3);
540 //______________________________________________________________________
541 void AliITSvBeamTestITS04::AddSSDGeometry(TGeoVolume *moth) const
544 TGeoMedium *siliconSSD = gGeoManager->GetMedium("ITSspdSi"); // SSD medium still needed!!!
547 TGeoBBox *waferSSDshape = new TGeoBBox("ITSssdWaferShape",fgkSSDwidth/2,fgkSSDthickness/2,fgkSSDlength/2,0);
548 TGeoVolume *waferSSD = new TGeoVolume("ITSssdWafer",waferSSDshape,siliconSSD);
550 TGeoBBox *sensSSDbox = new TGeoBBox("ITSssdSensorSensBox",fgkSSDwidthSens/2,fgkSSDthickSens/2,fgkSSDlengthSens/2,0);
551 TGeoVolume *sensVolSSD = new TGeoVolume(fgSSDsensitiveVolName,sensSSDbox,siliconSSD);
552 waferSSD->AddNode(sensVolSSD, 1, 0);
554 //locate them in space
555 /* In the SSD, there was an overlap of sensitive volumes of 2.9mm = 0.29cm (0.29/2=0.145)
556 in the modules in the same plane, therefore the modules where not in the same plane in
557 the Y direction, there was a "thickness" (0.03cm) difference */
558 TGeoTranslation *ssd1tr = new TGeoTranslation(0,fgkSSD0y,fgkSSDlength/2-0.145);
559 TGeoTranslation *ssd2tr = new TGeoTranslation(0,fgkSSD0y+0.03,-fgkSSDlength/2+0.145);
561 TGeoTranslation *ssd3tr = new TGeoTranslation(0,fgkSSD1y,fgkSSDlength/2-0.145);
562 TGeoTranslation *ssd4tr = new TGeoTranslation(0,fgkSSD1y+0.03,-fgkSSDlength/2+0.145);
565 moth->AddNode(waferSSD, fNspd+fNsdd+1, ssd1tr);
566 moth->AddNode(waferSSD, fNspd+fNsdd+2, ssd2tr);
567 moth->AddNode(waferSSD, fNspd+fNsdd+3, ssd3tr);
568 moth->AddNode(waferSSD, fNspd+fNsdd+4, ssd4tr);
571 waferSSD->SetLineColor(2);
572 sensVolSSD->SetLineColor(2);
575 //______________________________________________________________________
576 void AliITSvBeamTestITS04::StepManager()
578 // Called for every step in the ITS, then calles the AliITShit class
579 // creator with the information to be recoreded about that hit.
581 // "Standard" StepManager. (Similar to AliITSv11) mln
583 TLorentzVector position, momentum;
584 static TLorentzVector position0;
585 static Int_t stat0=0;
587 if(!(this->IsActive())){
589 } // end if !Active volume.
591 if(!(gMC->TrackCharge())) return;
593 id=gMC->CurrentVolID(copy);
595 Bool_t sensvol = kFALSE;
596 for(Int_t kk = 0; kk < fIdN; kk++)
597 if(id == fIdSens[kk]) sensvol = kTRUE;
599 if (sensvol && (gMC->IsTrackExiting())) {
600 copy = fTrackReferences->GetEntriesFast();
601 TClonesArray &lTR = *fTrackReferences;
602 // Fill TrackReference structure with this new TrackReference.
603 new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
604 } // if Outer ITS mother Volume
607 TClonesArray &lhits = *fHits;
612 // Fill hit structure.
613 if(gMC->IsTrackInside()) vol[3] += 1;
614 if(gMC->IsTrackEntering()) vol[3] += 2;
615 if(gMC->IsTrackExiting()) vol[3] += 4;
616 if(gMC->IsTrackOut()) vol[3] += 8;
617 if(gMC->IsTrackDisappeared()) vol[3] += 16;
618 if(gMC->IsTrackStop()) vol[3] += 32;
619 if(gMC->IsTrackAlive()) vol[3] += 64;
621 // Only entering charged tracks
622 if(!(gMC->TrackCharge())) return;
624 if( ((id = gMC->CurrentVolID(copy)) == fIdSens[0]) ||
625 ((id = gMC->CurrentVolID(copy)) == fIdSens[1]) ||
626 ((id = gMC->CurrentVolID(copy)) == fIdSens[2]) )
628 GetCurrentLayLaddDet(vol[0], vol[2], vol[1]);
629 // vol[2], vol[1]) : in this order because the ladder
630 // index and the det. index are exchanged in the constructor
633 return; // not an ITS volume?
636 gMC->TrackPosition(position);
637 gMC->TrackMomentum(momentum);
639 if(gMC->IsTrackEntering()){
640 position0 = position;
643 } // end if IsEntering
644 // Fill hit structure with this new hit.
645 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),
646 vol, gMC->Edep(),gMC->TrackTime(),position,
649 position0 = position;
654 //______________________________________________________________________
655 Int_t AliITSvBeamTestITS04::GetCurrentLayLaddDet(Int_t &lay,Int_t &ladd, Int_t &det) const
657 // Function which gives the layer, ladder and det.
658 // index of the current volume. To be used in
659 // AliITS::StepManager()
663 TGeoNode *node = gGeoManager->GetMother(1);
664 if (!node) return kFALSE;
665 Int_t nodeNum = node->GetNumber();
667 // GetNumber() return the index recorded in the node
669 if (nodeNum==5||nodeNum==6) { // SDD: one layer, one detector
671 } else if (nodeNum==3||nodeNum==4) { // SPD layer 2
673 if (nodeNum==4) det = 2;
674 } else if (nodeNum==1||nodeNum==2){ // SPD layer 1
676 if (nodeNum==2) det = 2;
677 } else if (nodeNum==9||nodeNum==10) { // SSD layer 2
679 if (nodeNum==10) det = 2;
680 } else if (nodeNum==7||nodeNum==8){ // SSD layer 1
682 if (nodeNum==8) det = 2;
688 //_____________________________________________________________
690 Int_t AliITSvBeamTestITS04::GetNumberOfSubDet(const TString& det) const{
692 //Get number of individual detectors
693 if(det.Contains("SPD")) return fNspd;
694 if(det.Contains("SDD")) return fNsdd;
695 if(det.Contains("SSD")) return fNssd;