]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - ITS/AliITSvSPD02.cxx
- AliITSInitGeometry.cxx (updated): fgkOldSSDcone changed from kTRUE to
[u/mrichter/AliRoot.git] / ITS / AliITSvSPD02.cxx
... / ...
CommitLineData
1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/* $Id$ */
17
18#include <TGeometry.h>
19#include <TGeoManager.h>
20#include <TNode.h>
21#include <TLorentzVector.h>
22#include <TClonesArray.h>
23#include <TBRIK.h>
24#include <TGeoMatrix.h>
25#include <TVirtualMC.h>
26
27#include "AliRun.h"
28#include "AliMagF.h"
29#include "AliTrackReference.h"
30
31#include "AliITShit.h"
32#include "AliITS.h"
33#include "AliITSvSPD02.h"
34#include "AliITSgeom.h"
35#include "AliITSgeomSPD.h"
36#include "AliITSDetTypeSim.h"
37#include "AliITSCalibrationSPD.h"
38#include "AliITSsegmentationSPD.h"
39#include "AliITSsimulationSPD.h"
40#include "AliMC.h"
41
42
43///////////////////////////////////////////////////////////////////////
44// Step manager and
45// geometry class
46// for the ITS
47// SPD test beam
48// geometry of summer 2002
49//
50///////////////////////////////////////////////////////////////////////
51ClassImp(AliITSvSPD02)
52
53//______________________________________________________________________
54AliITSvSPD02::AliITSvSPD02():
55AliITS(),
56fGeomDetOut(kFALSE),
57fGeomDetIn(kFALSE),
58fMajorVersion((Int_t)kvSPD02),
59fMinorVersion(2),
60fGeomNumber(2002),
61fEuclidGeomDet(),
62fRead(),
63fWrite(),
64fDet1(300.0),
65fDet2(300.0),
66fChip1(300.0),
67fChip2(300.0),
68fIDMother(0),
69fIgm(kvSPD02){
70 ////////////////////////////////////////////////////////////////////////
71 // Standard default constructor for the ITS SPD test beam 2002 version 1.
72 // Inputs:
73 // none.
74 // Outputs:
75 // none.
76 // Return:
77 // A default created class.
78 ////////////////////////////////////////////////////////////////////////
79 Int_t i;
80
81 for(i=0;i<60;i++) fRead[i] = '\0';
82 for(i=0;i<60;i++) fWrite[i] = '\0';
83 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
84}
85//______________________________________________________________________
86AliITSvSPD02::AliITSvSPD02(const char *title,Int_t gn) : AliITS("ITS", title),
87fGeomDetOut(kFALSE),
88fGeomDetIn(kFALSE),
89fMajorVersion(1),
90fMinorVersion(2),
91fGeomNumber(2002),
92fEuclidGeomDet(),
93fRead(),
94fWrite(),
95fDet1(300.0),
96fDet2(300.0),
97fChip1(300.0),
98fChip2(300.0),
99fIDMother(0),
100fIgm(kvSPD02){
101 ////////////////////////////////////////////////////////////////////////
102 // Standard constructor for the ITS SPD testbeam 2002 version 1.
103 // Inputs:
104 // const char *title title for this ITS geometry.
105 // Int_t gn Geometry version number (year) default 2002.
106 // Outputs:
107 // none.
108 // Return:
109 // A standard created class.
110 ////////////////////////////////////////////////////////////////////////
111 Int_t i;
112
113 fGeomNumber = gn;
114 fIdN = 2;
115 fIdName = new TString[fIdN];
116 fIdName[0] = "IMBS";
117 fIdName[1] = "ITST";
118 fIdSens = new Int_t[fIdN];
119 for(i=0;i<fIdN;i++) fIdSens[i] = 0;
120 SetThicknessDet1();
121 SetThicknessDet2();
122 SetThicknessChip1();
123 SetThicknessChip2();
124
125 fEuclidGeometry="$ALICE_ROOT/ITS/ITSgeometry_vSPD022.euc";
126 strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_vSPD022.det",60);
127 strncpy(fRead,fEuclidGeomDet,60);
128 strncpy(fWrite,fEuclidGeomDet,60);
129}
130//______________________________________________________________________
131AliITSvSPD02::~AliITSvSPD02() {
132 ////////////////////////////////////////////////////////////////////////
133 // Standard destructor for the ITS SPD test beam 2002 version 1.
134 // Inputs:
135 // none.
136 // Outputs:
137 // none.
138 // Return:
139 // none.
140 ////////////////////////////////////////////////////////////////////////
141}
142//______________________________________________________________________
143void AliITSvSPD02::BuildGeometry(){
144 ////////////////////////////////////////////////////////////////////////
145 // Geometry builder for the ITS SPD test beam 2002 version 1.
146 // ALIC ALICE Mother Volume
147 // |- ITSV ITS Mother Volume
148 // |- IDET Detector under Test
149 // | |- ITS0 SPD Si Chip
150 // | | |- ITST SPD Sensitivve Volume
151 // | |- IPC0 *5 Readout chip
152 // |- ITEL *4 SPD Telescope
153 // |- IMB0 SPD Si Chip
154 // | |- IMBS SPD Sensitive volume
155 // |- ICMB Chip MiniBus.
156 // Inputs:
157 // none.
158 // Outputs:
159 // none.
160 // Return:
161 // none.
162 ////////////////////////////////////////////////////////////////////////
163 // Get the top alice volume.
164
165 switch (fGeomNumber){
166 case 2002:
167 BuildGeometry2002();
168 break;
169 default:
170 BuildGeometry2002();
171 break;
172 } // end switch
173}
174//______________________________________________________________________
175void AliITSvSPD02::BuildGeometry2002(){
176 ////////////////////////////////////////////////////////////////////////
177 // Geometry builder for the ITS SPD test beam 2002 version 1.
178 // ALIC ALICE Mother Volume
179 // |- ITSV ITS Mother Volume
180 // |- IDET Detector under Test
181 // | |- ITS0 SPD Si Chip
182 // | | |- ITST SPD Sensitivve Volume
183 // | |- IPC0 *5 Readout chip
184 // |- ITEL *4 SPD Telescope
185 // |- IMB0 SPD Si Chip
186 // | |- IMBS SPD Sensitive volume
187 // |- ICMB Chip MiniBus.
188 // Inputs:
189 // none.
190 // Outputs:
191 // none.
192 // Return:
193 // none.
194 ////////////////////////////////////////////////////////////////////////
195 // Get the top alice volume.
196 TNode *aALIC = gAlice->GetGeometry()->GetNode("alice");
197 aALIC->cd();
198
199 // Define ITS Mother Volume
200 Float_t data[3];
201 Float_t ddettest=200.0E-4,ddettelescope=300.0E-4;
202 Float_t dchipMiniBus=750.0E-4,dchiptest=300.0E-4;
203 //Float_t yposition= 0.0;
204 TRotMatrix *r0 = new TRotMatrix("ITSidrotm0","ITSidrotm0",
205 90.0,0,0.0,0,90.0,270.0);
206 data[0] = 10.0;
207 data[1] = 50.0;
208 data[2] = 100.0;
209 TBRIK *iITSVshape = new TBRIK("ITSVshape",
210 "ITS Logical Mother Volume","Air",
211 data[0],data[1],data[2]);
212 TNode *iITSV = new TNode("ITSV","ITS Mother Volume",iITSVshape,
213 0.0,0.0,0.0,0,0);
214 iITSV->cd(); // set ourselve into ITSV subvolume of aALIC
215
216 // SPD part of telescope (MiniBuS)
217 data[0] = 0.705;
218 data[1] = 0.5*ddettelescope;
219 data[2] = 3.536;
220 TBRIK *iIMB0shape = new TBRIK("IMB0shape","SPD wafer","Si",
221 data[0],data[1],data[2]);
222 Float_t detMiniBusX,detMiniBusY,detMiniBusZ;
223 data[0] = detMiniBusX = 0.64;
224 data[1] = detMiniBusY = 0.5*ddettelescope;
225 data[2] = detMiniBusZ = 3.48;
226 TBRIK *iIMBSshape = new TBRIK("IMBSshape","SPD Sensitive volume","Si",
227 data[0],data[1],data[2]);
228 Float_t chipMiniBusX,chipMiniBusY,chipMiniBusZ;
229 data[0] = chipMiniBusX = 0.793;
230 data[1] = chipMiniBusY = 0.5*dchipMiniBus;
231 data[2] = chipMiniBusZ = 0.68;
232 TBRIK *iICMBshape = new TBRIK("ICMBshape","chip Minibus","Si",
233 data[0],data[1],data[2]);
234 data[0] = TMath::Max(detMiniBusX,chipMiniBusX);
235 data[1] = detMiniBusY+chipMiniBusY;
236 data[2] = TMath::Max(detMiniBusZ,chipMiniBusZ);
237 TBRIK *iITELshape = new TBRIK("ITELshape","ITELshape","Air",
238 data[0],data[1],data[2]);
239
240 // SPD under test
241 Float_t spdX,spdY,spdZ,spdchipX,spdchipY,spdchipZ;
242 data[0] = 0.705;
243 data[1] = ddettest;
244 data[2] = 3.536;
245 TBRIK *iITS0shape = new TBRIK("ITS0shape","SPD wafer","Si",
246 data[0],data[1],data[2]); // contains detector
247 data[0] = spdX = 0.64;
248 data[1] = spdY = ddettest;
249 data[2] = spdZ = 3.48;
250 TBRIK *iITSTshape = new TBRIK("ITSTshape","SPD sensitive volume","Si",
251 data[0],data[1],data[2]);
252 // ITS0 with no translation and unit rotation matrix.
253 data[0] = spdchipX = 0.793;
254 data[1] = spdchipY = dchiptest;
255 data[2] = spdchipZ = 0.68;
256 TBRIK *iIPC0shape = new TBRIK("IPC0shape","Readout Chips","Si",
257 data[0],data[1],data[2]); // chip under test
258 data[0] = TMath::Max(spdchipX,spdX);
259 data[1] = spdY+spdchipY;
260 data[2] = TMath::Max(spdchipZ,spdZ);
261 TBRIK *iIDETshape = new TBRIK("IDETshape","Detector Under Test","Air",
262 data[0],data[1],data[2]);
263 // Place volumes in geometry
264 Int_t i,j;
265 char name[20],title[50];
266 Double_t px=0.0,py=0.0,pz[4]={-38.0,0.0,0.0,0.0};
267 pz[1] = pz[0]+2.0;
268 pz[2] = pz[1]+38.0+spdY+spdchipY+34.5;
269 pz[3] = pz[2]+2.0;
270 TNode *iITEL[4],*iICMB[4],*iIMB0[4],*iIMBS[4];
271 TNode *iIDET = new TNode("IDET","Detector Under Test",iIDETshape,
272 0.0,0.0,pz[1]+38.0,r0,0);
273 iIDET->cd();
274 TNode *iITS0 = new TNode("ITS0","SPD Chip",iITS0shape,
275 0.0,iIDETshape->GetDy()-spdY,0.0,0,0);
276 TNode *iIPC0[5];
277 for(i=0;i<5;i++) { //place readout chips on the back of SPD chip under test
278 sprintf(name,"IPC0%d",i);
279 sprintf(title,"Readout chip #%d",i+1);
280 j = i-2;
281 iIPC0[i] = new TNode(name,title,iIPC0shape,
282 0.0,spdchipY-iIDETshape->GetDy(),
283 j*2.0*spdchipZ+j*0.25*(spdZ-5.*spdchipZ),0,0);
284 } // end for i
285 iITS0->cd();
286 TNode *iITST = new TNode("ITST","SPD sensitive volume",iITSTshape,
287 0.0,0.0,0.0,0,0);
288 for(Int_t i=0;i<4;i++){
289 iITSV->cd();
290 sprintf(name,"ITEL%d",i);
291 sprintf(title,"Test beam telescope element #%d",i+1);
292 iITEL[i] = new TNode(name,title,iITELshape,px,py,pz[i],r0,0);
293 iITEL[i]->cd();
294 iICMB[i] = new TNode("ICMB","Chip MiniBus",iICMBshape,
295 0.0,-iITELshape->GetDy()+detMiniBusY,0.0,0,0);
296 iIMB0[i] = new TNode("IMB0","Chip MiniBus",iIMB0shape,
297 0.0, iITELshape->GetDy()-detMiniBusY,0.0,0,0);
298 iIMB0[i]->cd();
299 iIMBS[i] = new TNode("IMBS","IMBS",iIMBSshape,0.0,0.0,0.0,0,0);
300 // place IMBS inside IMB0 with no translation and unit rotation matrix.
301 } // end for i
302 aALIC->cd();
303 iITST->SetLineColor(kYellow);
304 fNodes->Add(iITST);
305 for(i=0;i<4;i++){
306 iIMBS[i]->SetLineColor(kGreen);
307 fNodes->Add(iIMBS[i]);
308 } // end for i
309}
310//______________________________________________________________________
311void AliITSvSPD02::CreateGeometry(){
312 ////////////////////////////////////////////////////////////////////////
313 // This routine defines and Creates the geometry for version 1 of the ITS.
314 // ALIC ALICE Mother Volume
315 // |- ITSV ITS Mother Volume
316 // |- IDET Detector under Test
317 // | |- ITS0 SPD Si Chip
318 // | | |- ITST SPD Sensitivve Volume
319 // | |- IPC0 *5 Readout chip
320 // |- ITEL *4 SPD Telescope
321 // |- IMB0 SPD Si Chip
322 // | |- IMBS SPD Sensitive volume
323 // |- ICMB Chip MiniBus.
324 // Inputs:
325 // none.
326 // Outputs:
327 // none.
328 // Return:
329 // none.
330 ////////////////////////////////////////////////////////////////////////
331
332 switch (fGeomNumber){
333 case 2002:
334 CreateGeometry2002();
335 break;
336 default:
337 CreateGeometry2002();
338 break;
339 } // end switch
340}
341//______________________________________________________________________
342void AliITSvSPD02::CreateGeometry2002(){
343 ////////////////////////////////////////////////////////////////////////
344 // This routine defines and Creates the geometry for version 1 of the ITS.
345 // ALIC ALICE Mother Volume
346 // |- ITSV ITS Mother Volume
347 // |- IDET Detector under Test
348 // | |- ITS0 SPD Si Chip
349 // | | |- ITST SPD Sensitivve Volume
350 // | |- IPC0 *5 Readout chip
351 // |- ITEL *4 SPD Telescope
352 // |- IMB0 SPD Si Chip
353 // | |- IMBS SPD Sensitive volume
354 // |- ICMB Chip MiniBus.
355 //
356 // ITEL ITEL IDET ITEL ITEL
357 // Z-> -38 -36 02 36.5 38.5
358 // | | | | |
359 // cpn1 1 2 1 3 4
360 // Inputs:
361 // none.
362 // Outputs:
363 // none.
364 // Return:
365 // none.
366 ////////////////////////////////////////////////////////////////////////
367 Float_t data[49];
368 // Define media off-set
369 Int_t *idtmed = fIdtmed->GetArray()+1; // array of media indexes
370 Int_t idrotm[4]; // Array of rotation matrix indexes
371 Float_t ddettest=200.0E-4,ddettelescope=300.0E-4;
372 Float_t dchipMiniBus=750.0E-4,dchiptest=300.0E-4;
373 Float_t yposition= 0.0;
374 // These constant character strings are set by cvs during commit
375 // do not change them unless you know what you are doing!
376 const Char_t *cvsDate="$Date$";
377 const Char_t *cvsRevision="$Revision$";
378
379 if(gMC==0) return;
380 // Define Rotation-reflextion Matrixes needed
381 // 0 is the unit matrix
382 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
383 /*
384 data[0] = 10.0;
385 data[1] = 50.0;
386 data[2] = 100.0;
387 gMC->Gsvolu("ITSV","BOX",idtmed[0],data,3);
388 gMC->Gspos("ITSV",1,"ALIC",0.0,0.0,0.0,0,"ONLY");
389 */
390 TGeoVolumeAssembly *itsV = gGeoManager->MakeVolumeAssembly("ITSV");
391 const Int_t length=100;
392 Char_t vstrng[length];
393 if(fIgm.WriteVersionString(vstrng,length,(AliITSVersion_t)IsVersion(),
394 fMinorVersion,cvsDate,cvsRevision))
395 itsV->SetTitle(vstrng);
396 else Error("CreateGeometry","Error writing/setting version string");
397 TGeoVolume *alic = gGeoManager->GetVolume("ALIC");
398 if(alic==0) {
399 Error("CreateGeometry","alic=0");
400 return;
401 } // end if
402 // See idrotm[199] for angle definitions.
403 alic->AddNode(itsV,1,0);
404
405 //cout << "idtmed[0]=" << idtmed[0]<<endl;
406 //cout << "idtmed[1]=" << idtmed[1]<<endl;
407 Float_t detMiniBusX,detMiniBusY,detMiniBusZ;
408 // SPD part of telescope (MiniBuS)
409 data[0] = detMiniBusX = 0.705;
410 data[1] = detMiniBusY = 0.5*ddettelescope;
411 data[2] = detMiniBusZ = 3.536;
412 gMC->Gsvolu("IMB0", "BOX ", idtmed[1], data, 3); // contains detector
413 data[0] = 0.64;
414 data[1] = 0.5*ddettelescope;
415 data[2] = 3.48;
416 gMC->Gsvolu("IMBS","BOX ",idtmed[1],data,3); // sensitive detecor volulme
417 gMC->Gspos("IMBS",1,"IMB0",0.0,0.0,0.0,0,"ONLY"); // place IMBS inside
418 // IMB0 with no translation and unit rotation matrix.
419 Float_t chipMiniBusX,chipMiniBusY,chipMiniBusZ;
420 data[0] = chipMiniBusX = 0.793;
421 data[1] = chipMiniBusY = 0.5*dchipMiniBus;
422 data[2] = chipMiniBusZ = 0.68;
423 gMC->Gsvolu("ICMB","BOX ",idtmed[1],data, 3); // chip Minibus
424 data[0] = TMath::Max(detMiniBusX,chipMiniBusX);
425 data[1] = detMiniBusY+chipMiniBusY;
426 data[2] = TMath::Max(detMiniBusZ,chipMiniBusZ);
427 gMC->Gsvolu("ITEL","BOX ",idtmed[0],data,3);
428 gMC->Gspos("IMB0",1,"ITEL",0.0,data[1]-detMiniBusY,0.0,0,"ONLY");
429 gMC->Gspos("ICMB",1,"ITEL",0.0,-data[1]+chipMiniBusY,0.0,0,"ONLY");
430
431 // SPD under test
432 Float_t spdX,spdY,spdZ,spdchipX,spdchipY,spdchipZ;
433 data[0] = spdX = 0.705;
434 data[1] = spdY = 0.5*ddettest;
435 data[2] = spdZ = 3.536;
436 gMC->Gsvolu("ITS0", "BOX ", idtmed[1], data, 3); // contains detector
437 data[0] = 0.64;
438 data[1] = 0.5*ddettest;
439 data[2] = 3.48;
440 gMC->Gsvolu("ITST","BOX ",idtmed[1],data,3);// sensitive detecor volume
441 gMC->Gspos("ITST",1,"ITS0",0.0,0.0,0.0,0,"ONLY"); // place ITST inside
442 // ITS0 with no translation and unit rotation matrix.
443 data[0] = spdchipX = 0.793;
444 data[1] = spdchipY = 0.5*dchiptest;
445 data[2] = spdchipZ = 0.68;
446 gMC->Gsvolu("IPC0", "BOX ", idtmed[1],data,3); // chip under test
447 data[0] = TMath::Max(spdchipX,spdX);
448 data[1] = spdY+spdchipY;
449 data[2] = TMath::Max(spdchipZ,spdZ);
450 gMC->Gsvolu("IDET","BOX ",idtmed[0],data,3);
451 gMC->Gspos("ITS0",1,"IDET",0.0,data[1]-spdY,0.0,0,"ONLY");
452 for(Int_t i=-2;i<3;i++) gMC->Gspos("IPC0",i+3,"IDET",0.0,-data[1]+spdchipY,
453 i*2.*spdchipZ+i*0.25*(spdZ-5.*spdchipZ),0,"ONLY");
454
455 // Positions detectors, Beam Axis Z, X to the right, Y up to the sky.
456 Float_t p00X,p00Y,p00Z,p01X,p01Y,p01Z,p10X,p10Y,p10Z,p11X,p11Y,p11Z;
457 p00X = 0.0;
458 p00Y = 0.0;
459 p00Z = -38.0;
460 gMC->Gspos("ITEL",1,"ITSV",p00X,p00Y,p00Z,idrotm[0],"ONLY");
461 p01X = 0.0;
462 p01Y = 0.0;
463 p01Z = p00Z+2.0;
464 gMC->Gspos("ITEL",2,"ITSV",p01X,p01Y,p01Z,idrotm[0],"ONLY");
465 Float_t pdetX,pdetY,pdetZ;
466 pdetX = 0.0;
467 pdetY = 0.0+yposition;
468 pdetZ = p01Z+38.0;
469 gMC->Gspos("IDET",1,"ITSV",pdetX,pdetY,pdetZ,idrotm[0],"ONLY");
470 p10X = 0.0;
471 p10Y = 0.0;
472 p10Z = pdetZ + 34.5;
473 gMC->Gspos("ITEL",3,"ITSV",p10X,p10Y,p10Z,idrotm[0],"ONLY");
474 p11X = 0.0;
475 p11Y = 0.0;
476 p11Z = p10Z+2.0;
477 gMC->Gspos("ITEL",4,"ITSV",p11X,p11Y,p11Z,idrotm[0],"ONLY");
478}
479//______________________________________________________________________
480void AliITSvSPD02::CreateMaterials(){
481 ////////////////////////////////////////////////////////////////////////
482 //
483 // Create ITS SPD test beam materials
484 // This function defines the default materials used in the Geant
485 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
486 // AliITSvSPD02.
487 // In general it is automatically replaced by
488 // the CreateMaterials routine defined in AliITSv?. Should the function
489 // CreateMaterials not exist for the geometry version you are using this
490 // one is used. See the definition found in AliITSv5 or the other routine
491 // for a complete definition.
492 //
493 // Inputs:
494 // none.
495 // Outputs:
496 // none.
497 // Return:
498 // none.
499 /////////////////////////////////////////////////////////////////////////
500
501 switch (fGeomNumber){
502 case 2002:
503 CreateMaterials2002();
504 break;
505 default:
506 CreateMaterials2002();
507 break;
508 } // end switch
509}
510//______________________________________________________________________
511void AliITSvSPD02::CreateMaterials2002(){
512 ////////////////////////////////////////////////////////////////////////
513 //
514 // Create ITS SPD test beam materials
515 // This function defines the default materials used in the Geant
516 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
517 // AliITSvSPD02.
518 // In general it is automatically replaced by
519 // the CreateMaterials routine defined in AliITSv?. Should the function
520 // CreateMaterials not exist for the geometry version you are using this
521 // one is used. See the definition found in AliITSv5 or the other routine
522 // for a complete definition.
523 //
524 // Inputs:
525 // none.
526 // Outputs:
527 // none.
528 // Return:
529 // none.
530 /////////////////////////////////////////////////////////////////////////
531 Float_t tmaxfdSi = 0.1; // Degree
532 Float_t stemaxSi = 0.0075; // cm
533 Float_t deemaxSi = 0.1; // Fraction of particle's energy 0<deemax<=1
534 Float_t epsilSi = 1.0E-4;//
535 Float_t stminSi = 0.0; // cm "Default value used"
536
537 Float_t tmaxfdAir = 0.1; // Degree
538 Float_t stemaxAir = .10000E+01; // cm
539 Float_t deemaxAir = 0.1; // Fraction of particle's energy 0<deemax<=1
540 Float_t epsilAir = 1.0E-4;//
541 Float_t stminAir = 0.0; // cm "Default value used"
542 Int_t ifield = gAlice->Field()->Integ();
543 Float_t fieldm = gAlice->Field()->Max();
544
545 AliMaterial(1,"AIR$",0.14610E+02,0.73000E+01,0.12050E-02,
546 0.30423E+05,0.99900E+03);
547 AliMedium(1,"AIR$",1,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,
548 epsilAir,stminAir);
549
550 AliMaterial(2,"SI$",0.28086E+02,0.14000E+02,0.23300E+01,
551 0.93600E+01,0.99900E+03);
552 AliMedium(2,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
553 epsilSi,stminSi);
554}
555//______________________________________________________________________
556void AliITSvSPD02::Init(){
557 // Initialise the ITS after it has been created.
558 // Inputs:
559 // none.
560 // Outputs:
561 // none.
562 // Return:
563 // none.
564
565 AliDebug(1,Form("Init: Major version %d Minor version %d",fMajorVersion,
566 fMinorVersion));
567 //
568 UpdateInternalGeometry();
569 AliITS::Init();
570 if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite);
571
572 //
573 fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID.
574
575}
576/*
577//______________________________________________________________________
578void AliITSvSPD02::SetDefaults(){
579 // sets the default segmentation, response, digit and raw cluster classes
580 // Inputs:
581 // none.
582 // Outputs:
583 // none.
584 // Return:
585 // none.
586 const Float_t kconv = 1.0e+04; // convert cm to microns
587
588 Info("SetDefaults","Setting up only SPD detector");
589
590 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
591 fDetTypeSim->SetITSgeom(GetITSgeom());
592 AliITSgeomSPD *s0;
593 Int_t i;
594 Float_t bx[256],bz[280];
595 fDetTypeSim->ResetCalibrationArray();
596 fDetTypeSim->ResetSegmentation();
597
598 //SPD
599 // Get shape info. Do it this way for now.
600 s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);
601 AliITSCalibration *resp0=new AliITSCalibrationSPD();
602 resp0->SetTemperature();
603 resp0->SetDistanceOverVoltage();
604 SetCalibrationModel(0,resp0);
605
606 AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD();
607 seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD
608 s0->GetDz()*2.*kconv, // for now.
609 s0->GetDy()*2.*kconv); // x,z,y full width in microns.
610 seg0->SetNPads(256,160);// Number of Bins in x and z
611 for(i=000;i<256;i++) bx[i] = 50.0; // in x all are 50 microns.
612 for(i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below
613 for(i=160;i<280;i++) bz[i] = 0.0; // Outside of detector.
614 bz[ 31] = bz[ 32] = 625.0; // first chip boundry
615 bz[ 63] = bz[ 64] = 625.0; // first chip boundry
616 bz[ 95] = bz[ 96] = 625.0; // first chip boundry
617 bz[127] = bz[128] = 625.0; // first chip boundry
618 bz[160] = 425.0; // Set so that there is no zero pixel size for fNz.
619 seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now.
620 SetSegmentationModel(kSPD,seg0);
621 // set digit and raw cluster classes to be used
622 const char *kData0=(fDetTypeSim->GetCalibrationModel(0))->DataType();
623 if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit");
624 else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
625// SetSimulationModel(kSPD,new AliITSsimulationSPDdubna(seg0,resp0));
626// iDetType->ReconstructionModel(new AliITSClusterFinderSPD());
627
628
629// SetResponseModel(kSDD,new AliITSCalibrationSDD());
630// SetSegmentationModel(kSDD,new AliITSsegmentationSDD());
631// DetType(kSDD)->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD");
632
633// SetResponseModel(kSSD,new AliITSCalibrationSSD());
634// SetSegmentationModel(kSSD,new AliITSsegmentationSSD());
635// DetType(kSSD)->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD");
636
637 if(fgkNTYPES>3){
638 Warning("SetDefaults",
639 "Only the four basic detector types are initialised!");
640 }// end if
641 return;
642}
643//______________________________________________________________________
644void AliITSvSPD02::SetDefaultSimulation(){
645 // sets the default simulation.
646 // Inputs:
647 // none.
648 // Outputs:
649 // none.
650 // Return:
651 // none.
652
653 if(GetITSgeom()==0){
654 Warning("SetDefaultSimulation","ITS geometry is null!");
655 return;
656 }
657
658 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
659 AliITSsimulation *sim;
660 //AliITSsegmentation *seg;
661 //AliITSCalibration *res;
662 if(fDetTypeSim){
663 sim = fDetTypeSim->GetSimulationModel(kSPD);
664 if (!sim) {
665 //seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD);
666 //res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSPD());
667 sim = new AliITSsimulationSPD(fDetTypeSim);
668 SetSimulationModel(kSPD,sim);
669 }else{ // simulation exists, make sure it is set up properly.
670 sim->SetCalibrationModel(GetITSgeom()->GetStartSPD(),(AliITSCalibration*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSPD()));
671 sim->SetSegmentationModel(kSPD,(AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD));
672 sim->Init();
673 } // end if
674 } // end if iDetType
675
676// if(fDetTypeSim){
677// sim = fDetTypeSim->GetSimulationModel(kSDD);
678// if (!sim) {
679// seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD);
680// res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD());
681// sim = new AliITSsimulationSDD(seg,res);
682// SetSimulationModel(kSDD,sim);
683// }else{ // simulation exists, make sure it is set up properly.
684// sim->SetResponseModel((AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD()));
685// sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD));
686// sim->Init();
687// } //end if
688// } // end if iDetType
689// if(fDetTypeSim){
690// sim = fDetTypeSim->GetSimulationModel(kSSD);
691// if (!sim) {
692// seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD);
693// res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSSD());
694// sim = new AliITSsimulationSSD(seg,res);
695// SetSimulationModel(kSSD,sim);
696// }else{ // simulation exists, make sure it is set up properly.
697// sim->SetResponseModel((AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSSD()));
698// sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD));
699// sim->Init();
700// } // end if
701// } //
702}
703*/
704//______________________________________________________________________
705void AliITSvSPD02::DrawModule() const {
706 ////////////////////////////////////////////////////////////////////////
707 // Draw a shaded view of the ITS SPD test beam version 1.
708 // Inputs:
709 // none.
710 // Outputs:
711 // none.
712 // Return:
713 // none.
714 ////////////////////////////////////////////////////////////////////////
715 // Set everything unseen
716 gMC->Gsatt("*", "seen", -1);
717 // Set ALIC mother visible
718 gMC->Gsatt("ALIC","SEEN",0);
719 // Set ALIC ITS visible
720 gMC->Gsatt("ITSV","SEEN",0);
721 // Set ALIC Telescopes visible
722 gMC->Gsatt("ITEL","SEEN",0);
723 // Set ALIC detetcor visible
724 gMC->Gsatt("IDET","SEEN",0);
725 // Set Detector chip mother visible and drawn
726 gMC->Gsatt("IPC0","SEEN",1);
727 // Set Detector mother visible and drawn
728 gMC->Gsatt("ITS0","SEEN",1);
729 // Set minibus chip mother visible and drawn
730 gMC->Gsatt("ICMB","SEEN",1);
731 // Set minibus mother visible and drawn
732 gMC->Gsatt("IMB0","SEEN",1);
733}
734//______________________________________________________________________
735void AliITSvSPD02::StepManager(){
736 ////////////////////////////////////////////////////////////////////////
737 // Called for every step in the ITS SPD test beam, then calles the
738 // AliITShit class creator with the information to be recoreded about
739 // that hit.
740 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
741 // printing of information to a file which can be used to create a .det
742 // file read in by the routine CreateGeometry(). If set to 0 or any other
743 // value except 1, the default behavior, then no such file is created nor
744 // it the extra variables and the like used in the printing allocated.
745 // Inputs:
746 // none.
747 // Outputs:
748 // none.
749 // Return:
750 // none.
751 ////////////////////////////////////////////////////////////////////////
752
753 if(!(this->IsActive())){
754 return;
755 } // end if !Active volume.
756 if(!(gMC->TrackCharge())) return;
757
758 Int_t cpy0=0,cpy1=0,id,mod,ncpys,status;
759 TLorentzVector position, momentum;
760 static AliITShit hit;// Saves on calls to construtors
761 //TClonesArray &lhits = *(GetDetTypeSim()->GetHits());
762 TClonesArray &lhits = *(Hits());
763 //
764 // Track status
765 // Track status
766 status = 0;
767 if(gMC->IsTrackInside()) status += 1;
768 if(gMC->IsTrackEntering()) status += 2;
769 if(gMC->IsTrackExiting()) status += 4;
770 if(gMC->IsTrackOut()) status += 8;
771 if(gMC->IsTrackDisappeared()) status += 16;
772 if(gMC->IsTrackStop()) status += 32;
773 if(gMC->IsTrackAlive()) status += 64;
774 //
775 // Fill hit structure.
776 id = gMC->CurrentVolID(cpy0);
777 if(id==fIdSens[0]){ // Volume name "IMBS". Det=1, ladder=1
778 ncpys = 4;
779 } else if(id == fIdSens[1]){ // Volume name "ITST"
780 ncpys = 1;
781 } else return; // end if
782 id = gMC->CurrentVolOffID(2,cpy1);
783 fIgm.DecodeDetector(mod,ncpys,cpy0,cpy1,0);
784 //
785 // Fill hit structure.
786 //
787 hit.SetModule(mod);
788 hit.SetTrack(gAlice->GetMCApp()->GetCurrentTrackNumber());
789 gMC->TrackPosition(position);
790 gMC->TrackMomentum(momentum);
791 hit.SetPosition(position);
792 hit.SetTime(gMC->TrackTime());
793 hit.SetMomentum(momentum);
794 hit.SetStatus(status);
795 hit.SetEdep(gMC->Edep());
796 hit.SetShunt(GetIshunt());
797 if(gMC->IsTrackEntering()){
798 hit.SetStartPosition(position);
799 hit.SetStartTime(gMC->TrackTime());
800 hit.SetStartStatus(status);
801 return; // don't save entering hit.
802 } // end if IsEntering
803 // Fill hit structure with this new hit.
804 //Info("StepManager","Calling Copy Constructor");
805 new(lhits[fNhits++]) AliITShit(hit); // Use Copy Construtor.
806 // Save old position... for next hit.
807 hit.SetStartPosition(position);
808 hit.SetStartTime(gMC->TrackTime());
809 hit.SetStartStatus(status);
810 return;
811}
812