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 "AliITSresponseSPD.h"
16 #include "AliITSresponseSSD.h"
17 #include "AliITSsegmentationSDD.h"
18 #include "AliITSsegmentationSPD.h"
19 #include "AliITSsegmentationSSD.h"
21 #include "TVirtualMC.h"
24 const Int_t AliITSvBeamTestITS04::fgkNumberOfSPD = 4;
25 const Int_t AliITSvBeamTestITS04::fgkNumberOfSDD = 2;
26 const Int_t AliITSvBeamTestITS04::fgkNumberOfSSD = 4;
27 // Dimension (thickness:Y (beam direction), width:X, length:Z)
29 const char* AliITSvBeamTestITS04::fgSPDsensitiveVolName = "ITSspdSensitiv";
30 //dimensions (preliminary values from Petra (in cms))
31 const Double_t AliITSvBeamTestITS04::fgkSPDthickness = 0.02;
32 const Double_t AliITSvBeamTestITS04::fgkSPDwidth = 1.4;
33 const Double_t AliITSvBeamTestITS04::fgkSPDlength = 7.2;
34 const Double_t AliITSvBeamTestITS04::fgkSPDthickSens = 0.02;
35 const Double_t AliITSvBeamTestITS04::fgkSPDwidthSens = 1.2;
36 const Double_t AliITSvBeamTestITS04::fgkSPDlengthSens = 7.0;
38 const Double_t AliITSvBeamTestITS04::fgkSPD0y = 23.7;
39 const Double_t AliITSvBeamTestITS04::fgkSPD1y = 33.7;
42 const char* AliITSvBeamTestITS04::fgSDDsensitiveVolName = "ITSsddSensitiv";
43 //dimensions (preliminary values from Ludovic (in cms))
44 const Double_t AliITSvBeamTestITS04::fgkSDDthickness = 0.03;
45 const Double_t AliITSvBeamTestITS04::fgkSDDwidth = 7.22;
46 const Double_t AliITSvBeamTestITS04::fgkSDDlength = 8.76;
47 const Double_t AliITSvBeamTestITS04::fgkSDDthickSens = 0.02998;
48 const Double_t AliITSvBeamTestITS04::fgkSDDwidthSens = 7.017;
49 const Double_t AliITSvBeamTestITS04::fgkSDDlengthSens = 7.497;
51 const Double_t AliITSvBeamTestITS04::fgkSDD0y = 51.7;
52 const Double_t AliITSvBeamTestITS04::fgkSDD1y = 57.2;
55 const char* AliITSvBeamTestITS04::fgSSDsensitiveVolName = "ITSssdSensitiv";
56 //dimensions (final values from Javier (in cms))
57 const Double_t AliITSvBeamTestITS04::fgkSSDthickness = 0.03;
58 const Double_t AliITSvBeamTestITS04::fgkSSDwidth = 7.7;
59 const Double_t AliITSvBeamTestITS04::fgkSSDlength = 4.4;
60 const Double_t AliITSvBeamTestITS04::fgkSSDthickSens = 0.03;
61 const Double_t AliITSvBeamTestITS04::fgkSSDwidthSens = 7.5;
62 const Double_t AliITSvBeamTestITS04::fgkSSDlengthSens = 4.2;
64 const Double_t AliITSvBeamTestITS04::fgkSSD0y = 73.6;
65 const Double_t AliITSvBeamTestITS04::fgkSSD1y = 80.6;
67 //===============================================================
70 #include <TLorentzVector.h>
71 #include "AliTrackReference.h"
72 #include "AliITSDetTypeSim.h"
73 #include "AliITSgeom.h"
74 #include "AliITSgeomSDD.h"
75 #include "AliITSgeomSPD.h"
76 #include "AliITSgeomSSD.h"
77 #include "AliITShit.h"
78 #include "AliITSresponseSDD.h"
79 #include "AliITSresponseSPD.h"
80 #include "AliITSresponseSSD.h"
81 #include "AliITSsegmentationSDD.h"
82 #include "AliITSsegmentationSPD.h"
83 #include "AliITSsegmentationSSD.h"
85 #include <TGeoManager.h>
86 #include <TGeoVolume.h>
89 ClassImp(AliITSvBeamTestITS04)
91 //_____________________________________________________________
92 AliITSvBeamTestITS04::AliITSvBeamTestITS04() : AliITS()
98 SetNumberOfSPD(fgkNumberOfSPD);
99 SetNumberOfSDD(fgkNumberOfSDD);
100 SetNumberOfSSD(fgkNumberOfSSD);
103 fIdName = new TString[fIdN];
104 fIdName[0] = fgSPDsensitiveVolName;
105 fIdName[1] = fgSDDsensitiveVolName;
106 fIdName[2] = fgSSDsensitiveVolName;
107 fIdSens = new Int_t[fIdN];
108 for(Int_t i=0; i<fIdN; i++) fIdSens[i] = 0;
110 //for writing out geometry
111 fGeomDetOut = kFALSE;
113 // for reading in geometry (JC)
116 for(Int_t a=0;a<60;a++) fWrite[a] = '\0';
119 //_____________________________________________________________
120 AliITSvBeamTestITS04::AliITSvBeamTestITS04(const char* name,const char *title)
127 SetNumberOfSPD(fgkNumberOfSPD);
128 SetNumberOfSDD(fgkNumberOfSDD);
129 SetNumberOfSSD(fgkNumberOfSSD);
132 fIdName = new TString[fIdN];
133 fIdName[0] = fgSPDsensitiveVolName;
134 fIdName[1] = fgSDDsensitiveVolName;
135 fIdName[2] = fgSSDsensitiveVolName;
136 fIdSens = new Int_t[fIdN];
137 for(Int_t i=0; i<fIdN; i++) fIdSens[i] = 0;
139 //for writing out geometry
140 fGeomDetOut = kFALSE; // Don't write .det file
142 // for reading in geometry (JC)
145 for(Int_t a=0;a<60;a++) fWrite[a] = '\0';
148 //______________________________________________________________________
149 AliITSvBeamTestITS04::AliITSvBeamTestITS04(const AliITSvBeamTestITS04 &source) : AliITS(source){
150 //Copy constructor (dummy)
151 if(&source == this) return;
152 Warning("Copy Constructor","Not allowed to copy AliITSvSDD03");
155 //______________________________________________________________________
156 AliITSvBeamTestITS04& AliITSvBeamTestITS04::operator=(const AliITSvBeamTestITS04 &source){
159 // This class is not to be copied. Function only dummy.
160 if(&source == this) return *this;
161 Warning("= operator","Not allowed to copy AliITSvSDD03");
165 //__________________________________________________________________
166 AliITSvBeamTestITS04::~AliITSvBeamTestITS04()
173 //______________________________________________________________________
174 void AliITSvBeamTestITS04::CreateMaterials()
176 // Media defined here should correspond to the one defined in galice.cuts
177 // This file is read in (AliMC*) fMCApp::Init() { ReadTransPar(); }
179 // Create ITS materials
180 Int_t ifield = gAlice->Field()->Integ();
181 Float_t fieldm = gAlice->Field()->Max();
183 Float_t tmaxfdSi = 0.1;
184 Float_t stemaxSi = 0.0075;
185 Float_t deemaxSi = 0.1;
186 Float_t epsilSi = 1.0E-4;
187 Float_t stminSi = 0.0;
189 Float_t tmaxfdAir = 0.1;
190 Float_t stemaxAir = .10000E+01;
191 Float_t deemaxAir = 0.1;
192 Float_t epsilAir = 1.0E-4;
193 Float_t stminAir = 0.0;
196 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
197 Float_t zAir[4]={6.,7.,8.,18.};
198 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
199 Float_t dAir = 1.20479E-3;
201 AliMaterial(51,"ITSspdSi",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
202 AliMedium(51,"ITSspdSi",51,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
204 AliMaterial(1,"ITSsddSi",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
205 AliMedium(1,"ITSsddSi",1,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
207 //AliMaterial(?,"ITSssdSi",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
208 //AliMedium(?,"ITSssdSi",51,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
210 AliMixture(5,"ITSair",aAir,zAir,dAir,4,wAir);
211 AliMedium(5,"ITSair",5,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,epsilAir,stminAir);
213 //NEED TO ADD PLASTIC OF SCINTILLATORS!!
217 //______________________________________________________________________
218 void AliITSvBeamTestITS04::CreateGeometry()
221 TGeoManager *geoManager = gGeoManager;
222 TGeoVolume *vALIC = geoManager->GetTopVolume();
224 //================================
226 //================================
227 TGeoPcon *sITS = new TGeoPcon("ITS Top Volume",0.0,360.0,2);
228 // DefineSection(section number, Z, Rmin, Rmax).
229 sITS->DefineSection(0,-100.0,0.01,100.0); // Units in cms
230 sITS->DefineSection(1,+100.0,0.01,100.0);
232 TGeoMedium *air = gGeoManager->GetMedium("ITSair");
233 fITSmotherVolume = new TGeoVolume("vITS",sITS,air);
234 fITSmotherVolume->SetVisibility(kFALSE);
235 vALIC->AddNode(fITSmotherVolume,1,0);
238 // TGeoMedium *plasticScint = new TGeoMedium("plasticScint",1,Plastic);
239 // //First Scintillator
240 // TGeoBBox *Scint1Shape = new TGeoBBox("Scint1Shape",0.5,0.1,0.5,0); //1x1cm
241 // TGeoVolume *Scint1 = new TGeoVolume("Scint1",Scint1Shape,plasticScint);
242 // TGeoTranslation *firstScint = new TGeoTranslation(0,0.7,0);
243 // vALIC->AddNode(Scint1,2,firstScint);
244 // //Second Scintillator
245 // TGeoBBox *Scint2Shape = new TGeoBBox("Scint2Shape",1.,0.1,1.,0); //2x2cm
246 // TGeoVolume *Scint2 = new TGeoVolume("Scint2",Scint2Shape,plasticScint);
247 // TGeoTranslation *secondScint = new TGeoTranslation(0,90.,0);
248 // vALIC->AddNode(Scint2,3,secondScint);
250 AddSPDGeometry(fITSmotherVolume);
251 AddSDDGeometry(fITSmotherVolume);
252 AddSSDGeometry(fITSmotherVolume);
255 //______________________________________________________________________
256 void AliITSvBeamTestITS04::Init()
258 // Initialize the ITS after it has been created.
260 for(i=0;i<20;i++) printf("*");
261 printf( " ITSbeamtest_Init " );
262 for(i=0;i<20;i++) printf("*"); printf("\n");
264 // // Create geometry
265 // if(!fGeomDetIn) this->InitAliITSgeom();
269 for(i=0;i<40+16;i++) printf("*"); printf("\n");
273 //______________________________________________________________________
274 void AliITSvBeamTestITS04::InitAliITSgeom()
276 //initialisation of ITSgeom
277 const Int_t knlayers = 6;
278 Int_t nlad[knlayers], ndet[knlayers];
280 nlad[0] = 1; ndet[0] = 2;
281 nlad[1] = 1; ndet[1] = 2;
282 nlad[2] = 1; ndet[2] = 1;
283 nlad[3] = 1; ndet[3] = 1;
284 nlad[4] = 1; ndet[4] = 2;
285 nlad[5] = 1; ndet[5] = 2;
287 Int_t nModTot = fNspd + fNsdd + fNssd;
288 if (GetITSgeom()) SetITSgeom(0x0);
289 AliITSgeom* geom = new AliITSgeom(0,knlayers,nlad,ndet,nModTot);
291 //*** Set default shapes
292 const Float_t kDxyzSPD[] = {fgkSPDwidthSens/2, fgkSPDthickSens/2,fgkSPDlengthSens/2};
293 if(!(GetITSgeom()->IsShapeDefined(kSPD)))
294 GetITSgeom()->ReSetShape(kSPD,new AliITSgeomSPD425Short(3,(Float_t *)kDxyzSPD));
296 const Float_t kDxyzSDD[] = {fgkSDDwidthSens/2., fgkSDDthickSens/2.,fgkSDDlengthSens/2.};
297 if(!(GetITSgeom()->IsShapeDefined(kSDD)))
298 GetITSgeom()->ReSetShape(kSDD, new AliITSgeomSDD256(3,(Float_t *)kDxyzSDD));
300 const Float_t kDxyzSSD[] = {fgkSSDlengthSens/2, fgkSSDthickSens/2,fgkSSDwidthSens/2};
301 if(!(GetITSgeom()->IsShapeDefined(kSSD)))
302 GetITSgeom()->ReSetShape(kSSD,new AliITSgeomSSD75and275(3,(Float_t *)kDxyzSSD));
304 // Creating the matrices in AliITSgeom for each sensitive volume
305 // (like in AliITSv11GeometrySDD) mln
306 // Here, each layer is one detector
312 for (Int_t i=0; i<fNspd;i++) {
313 sprintf(layerName, "ITSspdWafer_%i",i+1);
314 TGeoNode *layNode = fITSmotherVolume->GetNode(layerName);
316 TGeoHMatrix layMatrix(*layNode->GetMatrix());
317 Double_t *trans = layMatrix.GetTranslation();
318 Double_t *r = layMatrix.GetRotationMatrix();
319 Double_t rot[10] = {r[0],r[1],r[2],
321 r[6],r[7],r[8], 1.0};
323 if ((i+1==2)||(i+1==4)) iDet = 2;
327 GetITSgeom()->CreatMatrix(startMod,iLay,iLad,iDet,kSPD,trans,rot);
333 for (Int_t i=0; i<fNsdd;i++) {
334 sprintf(layerName, "ITSsddWafer_%i",i+fNspd+1);
335 TGeoNode *layNode = fITSmotherVolume->GetNode(layerName);
337 TGeoHMatrix layMatrix(*layNode->GetMatrix());
338 Double_t *trans = layMatrix.GetTranslation();
339 Double_t *r = layMatrix.GetRotationMatrix();
340 Double_t rot[10] = {r[0],r[1],r[2],
342 r[6],r[7],r[8], 1.0};
345 Int_t iLay = fNspd-1+i;
346 GetITSgeom()->CreatMatrix(startMod,iLay,iLad,iDet,kSDD,trans,rot);
352 for (Int_t i=0; i<fNssd;i++) {
353 sprintf(layerName, "ITSssdWafer_%i",i+fNspd+fNsdd+1);
354 TGeoNode *layNode = fITSmotherVolume->GetNode(layerName);
356 TGeoHMatrix layMatrix(*layNode->GetMatrix());
357 Double_t *trans = layMatrix.GetTranslation();
358 Double_t *r = layMatrix.GetRotationMatrix();
359 Double_t rot[10] = {r[0],r[1],r[2],
361 r[6],r[7],r[8], 1.0};
363 if ((i+1==2)||(i+1==4)) iDet = 2;
367 GetITSgeom()->CreatMatrix(startMod,iLay,iLad,iDet,kSSD,trans,rot);
375 //______________________________________________________________________
376 void AliITSvBeamTestITS04::SetDefaults()
378 // (from AliITSv11) mln
380 const Float_t kconv = 1.0e+04; // convert cm to microns
382 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
383 fDetTypeSim->SetITSgeom(GetITSgeom());
384 fDetTypeSim->ResetResponse();
385 fDetTypeSim->ResetSegmentation();
391 Float_t bx[256],bz[280];
393 // If fGeomDetIn is set true the geometry will
394 // be initialised from file (JC)
395 if(GetITSgeom()!=0) SetITSgeom(0x0);
396 AliITSgeom* geom = new AliITSgeom();
398 if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead);
399 if(!fGeomDetIn) this->InitAliITSgeom();
400 if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite);
405 s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);// Get shape info.
407 AliITSresponse *resp0=0;
409 for(Int_t nmod=0;nmod<GetITSgeom()->GetIndexMax();nmod++){
410 if(GetITSgeom()->GetModuleType(nmod)==kSPD){
411 resp0 = new AliITSresponseSPD();
412 SetResponseModel(nmod,resp0);
417 AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(GetITSgeom());
418 seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD
419 s0->GetDz()*2.*kconv, // for now.
420 s0->GetDy()*2.*kconv);// x,z,y full width in microns.
421 seg0->SetNPads(256,160); // Number of Bins in x and z
422 for(i=000;i<256;i++) bx[i] = 50.0; // in x all are 50 microns.
423 for(i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below
424 for(i=160;i<280;i++) bz[i] = 0.0; // Outside of detector.
425 bz[ 31] = bz[ 32] = 625.0; // first chip boundry
426 bz[ 63] = bz[ 64] = 625.0; // first chip boundry
427 bz[ 95] = bz[ 96] = 625.0; // first chip boundry
428 bz[127] = bz[128] = 625.0; // first chip boundry
429 bz[160] = 425.0; // Set so that there is no zero pixel size for fNz.
430 seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now.
431 SetSegmentationModel(kSPD,seg0);
432 // set digit and raw cluster classes to be used
433 const char *kData0=(fDetTypeSim->GetResponseModel(nspd))->DataType();
434 if (strstr(kData0,"real"))
435 fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit");
436 else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
441 s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);// Get shape info.
443 AliITSresponseSDD *resp1=0;
445 for(Int_t nmod=0;nmod<GetITSgeom()->GetIndexMax();nmod++){
446 if(GetITSgeom()->GetModuleType(nmod)==kSDD){
447 resp1 = new AliITSresponseSDD("simulated");
448 SetResponseModel(nmod,resp1);
452 AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(GetITSgeom(),resp1);
453 seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD
454 s1->GetDz()*4.*kconv, // for now.
455 s1->GetDy()*4.*kconv); // x,z,y full width in microns.
456 seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
457 SetSegmentationModel(kSDD,seg1);
458 const char *kData1=(fDetTypeSim->GetResponseModel(nsdd))->DataType();
459 const char *kopt=fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD())->ZeroSuppOption();
460 if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){
461 fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit");
462 } else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD");
467 s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);// Get shape info. Do it this way for now.
469 AliITSresponse *resp2=0;
471 for(Int_t nmod=0;nmod<GetITSgeom()->GetIndexMax();nmod++){
472 if(GetITSgeom()->GetModuleType(nmod)==kSSD){
473 resp2 = new AliITSresponseSSD("simulated");
474 SetResponseModel(nmod,resp2);
479 AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(GetITSgeom());
480 seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD
481 s2->GetDz()*2.*kconv, // for now.
482 s2->GetDy()*2.*kconv); // x,z,y full width in microns.
483 seg2->SetPadSize(95.,0.); // strip x pitch in microns
484 seg2->SetNPads(768,0); // number of strips on each side.
485 seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side.
486 seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
487 seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
488 SetSegmentationModel(kSSD,seg2);
489 const char *kData2=(fDetTypeSim->GetResponseModel(nssd))->DataType();
490 if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit");
491 else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
494 if(fgkNTYPES>3){Warning("SetDefaults","Only the four basic detector types are initialised!");}
498 //______________________________________________________________________
499 void AliITSvBeamTestITS04::AddSPDGeometry(TGeoVolume *moth) const
502 TGeoMedium *siliconSPD = gGeoManager->GetMedium("ITSspdSi");
505 TGeoBBox *waferSPDshape = new TGeoBBox("ITSspdWaferShape",fgkSPDwidth/2,fgkSPDthickness/2,fgkSPDlength/2,0);
506 TGeoVolume *waferSPD = new TGeoVolume("ITSspdWafer",waferSPDshape,siliconSPD);
508 TGeoBBox *sensSPDbox = new TGeoBBox("ITSsddSensorSensBox",fgkSPDwidthSens/2,fgkSPDthickSens/2,fgkSPDlengthSens/2,0);
509 TGeoVolume *sensVolSPD = new TGeoVolume(fgSPDsensitiveVolName,sensSPDbox,siliconSPD);
510 waferSPD->AddNode(sensVolSPD, 1, 0); //added to outer volume
512 //locate them in space (with respect top volume)
513 TGeoTranslation *spd1tr = new TGeoTranslation(0,fgkSPD0y,fgkSPDlength/2);
514 TGeoTranslation *spd2tr = new TGeoTranslation(0,fgkSPD0y,-fgkSPDlength/2);
516 TGeoTranslation *spd3tr = new TGeoTranslation(0,fgkSPD1y,fgkSPDlength/2);
517 TGeoTranslation *spd4tr = new TGeoTranslation(0,fgkSPD1y,-fgkSPDlength/2);
520 moth->AddNode(waferSPD, 1, spd1tr);
521 moth->AddNode(waferSPD, 2, spd2tr);
522 moth->AddNode(waferSPD, 3, spd3tr);
523 moth->AddNode(waferSPD, 4, spd4tr);
526 waferSPD->SetLineColor(4);
527 sensVolSPD->SetLineColor(4);
531 //______________________________________________________________________
532 void AliITSvBeamTestITS04::AddSDDGeometry(TGeoVolume *moth) const
535 TGeoMedium *siliconSDD = gGeoManager->GetMedium("ITSsddSi");
538 TGeoBBox *waferSDDshape = new TGeoBBox("ITSsddWaferShape",fgkSDDwidth/2,fgkSDDthickness/2,fgkSDDlength/2,0);
539 TGeoVolume *waferSDD = new TGeoVolume("ITSsddWafer",waferSDDshape,siliconSDD);
541 TGeoBBox *sensSDDbox = new TGeoBBox("ITSsddSensorSensBox",fgkSDDwidthSens/2,fgkSDDthickSens/2,fgkSDDlengthSens/2,0);
542 TGeoVolume *sensVolSDD = new TGeoVolume(fgSDDsensitiveVolName,sensSDDbox,siliconSDD);
543 waferSDD->AddNode(sensVolSDD, 1, 0); //added to outer volume
545 //locate them in space
546 TGeoTranslation *sdd1tr = new TGeoTranslation(0,fgkSDD0y,0);
547 TGeoTranslation *sdd2tr = new TGeoTranslation(0,fgkSDD1y,0);
550 moth->AddNode(waferSDD, fNspd+1, sdd1tr);
551 moth->AddNode(waferSDD, fNspd+2, sdd2tr);
554 waferSDD->SetLineColor(3);
555 sensVolSDD->SetLineColor(3);
559 //______________________________________________________________________
560 void AliITSvBeamTestITS04::AddSSDGeometry(TGeoVolume *moth) const
563 TGeoMedium *siliconSSD = gGeoManager->GetMedium("ITSspdSi"); // SSD medium still needed!!!
566 TGeoBBox *waferSSDshape = new TGeoBBox("ITSssdWaferShape",fgkSSDwidth/2,fgkSSDthickness/2,fgkSSDlength/2,0);
567 TGeoVolume *waferSSD = new TGeoVolume("ITSssdWafer",waferSSDshape,siliconSSD);
569 TGeoBBox *sensSSDbox = new TGeoBBox("ITSssdSensorSensBox",fgkSSDwidthSens/2,fgkSSDthickSens/2,fgkSSDlengthSens/2,0);
570 TGeoVolume *sensVolSSD = new TGeoVolume(fgSSDsensitiveVolName,sensSSDbox,siliconSSD);
571 waferSSD->AddNode(sensVolSSD, 1, 0);
573 //locate them in space
574 /* In the SSD, there was an overlap of sensitive volumes of 2.9mm = 0.29cm (0.29/2=0.145)
575 in the modules in the same plane, therefore the modules where not in the same plane in
576 the Y direction, there was a "thickness" (0.03cm) difference */
577 TGeoTranslation *ssd1tr = new TGeoTranslation(0,fgkSSD0y,fgkSSDlength/2-0.145);
578 TGeoTranslation *ssd2tr = new TGeoTranslation(0,fgkSSD0y+0.03,-fgkSSDlength/2+0.145);
580 TGeoTranslation *ssd3tr = new TGeoTranslation(0,fgkSSD1y,fgkSSDlength/2-0.145);
581 TGeoTranslation *ssd4tr = new TGeoTranslation(0,fgkSSD1y+0.03,-fgkSSDlength/2+0.145);
584 moth->AddNode(waferSSD, fNspd+fNsdd+1, ssd1tr);
585 moth->AddNode(waferSSD, fNspd+fNsdd+2, ssd2tr);
586 moth->AddNode(waferSSD, fNspd+fNsdd+3, ssd3tr);
587 moth->AddNode(waferSSD, fNspd+fNsdd+4, ssd4tr);
590 waferSSD->SetLineColor(2);
591 sensVolSSD->SetLineColor(2);
594 //______________________________________________________________________
595 void AliITSvBeamTestITS04::StepManager()
597 // Called for every step in the ITS, then calles the AliITShit class
598 // creator with the information to be recoreded about that hit.
600 // "Standard" StepManager. (Similar to AliITSv11) mln
602 TLorentzVector position, momentum;
603 static TLorentzVector position0;
604 static Int_t stat0=0;
606 if(!(this->IsActive())){
608 } // end if !Active volume.
610 if(!(gMC->TrackCharge())) return;
612 id=gMC->CurrentVolID(copy);
614 Bool_t sensvol = kFALSE;
615 for(Int_t kk = 0; kk < fIdN; kk++)
616 if(id == fIdSens[kk]) sensvol = kTRUE;
618 if (sensvol && (gMC->IsTrackExiting())) {
619 copy = fTrackReferences->GetEntriesFast();
620 TClonesArray &lTR = *fTrackReferences;
621 // Fill TrackReference structure with this new TrackReference.
622 new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
623 } // if Outer ITS mother Volume
626 TClonesArray &lhits = *fHits;
631 // Fill hit structure.
632 if(gMC->IsTrackInside()) vol[3] += 1;
633 if(gMC->IsTrackEntering()) vol[3] += 2;
634 if(gMC->IsTrackExiting()) vol[3] += 4;
635 if(gMC->IsTrackOut()) vol[3] += 8;
636 if(gMC->IsTrackDisappeared()) vol[3] += 16;
637 if(gMC->IsTrackStop()) vol[3] += 32;
638 if(gMC->IsTrackAlive()) vol[3] += 64;
640 // Only entering charged tracks
641 if(!(gMC->TrackCharge())) return;
643 if( ((id = gMC->CurrentVolID(copy)) == fIdSens[0]) ||
644 ((id = gMC->CurrentVolID(copy)) == fIdSens[1]) ||
645 ((id = gMC->CurrentVolID(copy)) == fIdSens[2]) )
647 GetCurrentLayLaddDet(vol[0], vol[2], vol[1]);
648 // vol[2], vol[1]) : in this order because the ladder
649 // index and the det. index are exchanged in the constructor
652 return; // not an ITS volume?
655 gMC->TrackPosition(position);
656 gMC->TrackMomentum(momentum);
658 if(gMC->IsTrackEntering()){
659 position0 = position;
662 } // end if IsEntering
663 // Fill hit structure with this new hit.
664 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),
665 vol, gMC->Edep(),gMC->TrackTime(),position,
668 position0 = position;
673 //______________________________________________________________________
674 Int_t AliITSvBeamTestITS04::GetCurrentLayLaddDet(Int_t &lay,Int_t &ladd, Int_t &det) const
676 // Function which gives the layer, ladder and det.
677 // index of the current volume. To be used in
678 // AliITS::StepManager()
682 TGeoNode *node = gGeoManager->GetMother(1);
683 if (!node) return kFALSE;
684 Int_t nodeNum = node->GetNumber();
686 // GetNumber() return the index recorded in the node
688 if (nodeNum==5||nodeNum==6) { // SDD: one layer, one detector
690 } else if (nodeNum==3||nodeNum==4) { // SPD layer 2
692 if (nodeNum==4) det = 2;
693 } else if (nodeNum==1||nodeNum==2){ // SPD layer 1
695 if (nodeNum==2) det = 2;
696 } else if (nodeNum==9||nodeNum==10) { // SSD layer 2
698 if (nodeNum==10) det = 2;
699 } else if (nodeNum==7||nodeNum==8){ // SSD layer 1
701 if (nodeNum==8) det = 2;
707 //_____________________________________________________________
709 Int_t AliITSvBeamTestITS04::GetNumberOfSubDet(const TString& det) const{
711 //Get number of individual detectors
712 if(det.Contains("SPD")) return fNspd;
713 if(det.Contains("SDD")) return fNsdd;
714 if(det.Contains("SSD")) return fNssd;