]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSvSPD02.cxx
Several Changes:
[u/mrichter/AliRoot.git] / ITS / AliITSvSPD02.cxx
CommitLineData
6078cf56 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
88cb7938 16/* $Id$ */
48232831 17
012f0f4c 18#include <TGeoManager.h>
6078cf56 19#include <TLorentzVector.h>
6078cf56 20#include <TClonesArray.h>
3be5c40b 21#include <TGeoMatrix.h>
22#include <TVirtualMC.h>
6078cf56 23
24#include "AliRun.h"
25#include "AliMagF.h"
6078cf56 26#include "AliTrackReference.h"
3be5c40b 27
6078cf56 28#include "AliITShit.h"
29#include "AliITS.h"
30#include "AliITSvSPD02.h"
31#include "AliITSgeom.h"
32#include "AliITSgeomSPD.h"
7d62fb64 33#include "AliITSDetTypeSim.h"
fcf95fc7 34#include "AliITSCalibrationSPD.h"
6078cf56 35#include "AliITSsegmentationSPD.h"
5bfe44ce 36#include "AliITSsimulationSPD.h"
5d12ce38 37#include "AliMC.h"
6078cf56 38
7d62fb64 39
78b50563 40///////////////////////////////////////////////////////////////////////
41// Step manager and
42// geometry class
43// for the ITS
44// SPD test beam
45// geometry of summer 2002
46//
47///////////////////////////////////////////////////////////////////////
6078cf56 48ClassImp(AliITSvSPD02)
49
50//______________________________________________________________________
aacedc3e 51AliITSvSPD02::AliITSvSPD02():
52AliITS(),
012f0f4c 53fMajorVersion((Int_t)kvSPD02),
aacedc3e 54fMinorVersion(2),
55fGeomNumber(2002),
aacedc3e 56fDet1(300.0),
57fDet2(300.0),
58fChip1(300.0),
012f0f4c 59fChip2(300.0),
60fIDMother(0),
61fIgm(kvSPD02){
6078cf56 62 ////////////////////////////////////////////////////////////////////////
63 // Standard default constructor for the ITS SPD test beam 2002 version 1.
64 // Inputs:
65 // none.
66 // Outputs:
67 // none.
68 // Return:
69 // A default created class.
70 ////////////////////////////////////////////////////////////////////////
6078cf56 71}
72//______________________________________________________________________
aacedc3e 73AliITSvSPD02::AliITSvSPD02(const char *title,Int_t gn) : AliITS("ITS", title),
aacedc3e 74fMajorVersion(1),
75fMinorVersion(2),
76fGeomNumber(2002),
aacedc3e 77fDet1(300.0),
78fDet2(300.0),
79fChip1(300.0),
012f0f4c 80fChip2(300.0),
81fIDMother(0),
82fIgm(kvSPD02){
6078cf56 83 ////////////////////////////////////////////////////////////////////////
84 // Standard constructor for the ITS SPD testbeam 2002 version 1.
85 // Inputs:
86 // const char *title title for this ITS geometry.
a421d869 87 // Int_t gn Geometry version number (year) default 2002.
6078cf56 88 // Outputs:
89 // none.
90 // Return:
91 // A standard created class.
92 ////////////////////////////////////////////////////////////////////////
93 Int_t i;
94
a421d869 95 fGeomNumber = gn;
6078cf56 96 fIdN = 2;
97 fIdName = new TString[fIdN];
98 fIdName[0] = "IMBS";
99 fIdName[1] = "ITST";
100 fIdSens = new Int_t[fIdN];
101 for(i=0;i<fIdN;i++) fIdSens[i] = 0;
6078cf56 102 SetThicknessDet1();
103 SetThicknessDet2();
104 SetThicknessChip1();
105 SetThicknessChip2();
106
6078cf56 107}
108//______________________________________________________________________
6078cf56 109AliITSvSPD02::~AliITSvSPD02() {
110 ////////////////////////////////////////////////////////////////////////
111 // Standard destructor for the ITS SPD test beam 2002 version 1.
112 // Inputs:
113 // none.
114 // Outputs:
115 // none.
116 // Return:
117 // none.
118 ////////////////////////////////////////////////////////////////////////
119}
120//______________________________________________________________________
6078cf56 121void AliITSvSPD02::CreateGeometry(){
122 ////////////////////////////////////////////////////////////////////////
123 // This routine defines and Creates the geometry for version 1 of the ITS.
124 // ALIC ALICE Mother Volume
125 // |- ITSV ITS Mother Volume
126 // |- IDET Detector under Test
127 // | |- ITS0 SPD Si Chip
128 // | | |- ITST SPD Sensitivve Volume
129 // | |- IPC0 *5 Readout chip
130 // |- ITEL *4 SPD Telescope
131 // |- IMB0 SPD Si Chip
132 // | |- IMBS SPD Sensitive volume
133 // |- ICMB Chip MiniBus.
134 // Inputs:
135 // none.
136 // Outputs:
137 // none.
138 // Return:
139 // none.
140 ////////////////////////////////////////////////////////////////////////
a421d869 141
142 switch (fGeomNumber){
143 case 2002:
144 CreateGeometry2002();
145 break;
146 default:
147 CreateGeometry2002();
148 break;
149 } // end switch
150}
151//______________________________________________________________________
152void AliITSvSPD02::CreateGeometry2002(){
153 ////////////////////////////////////////////////////////////////////////
154 // This routine defines and Creates the geometry for version 1 of the ITS.
155 // ALIC ALICE Mother Volume
156 // |- ITSV ITS Mother Volume
157 // |- IDET Detector under Test
158 // | |- ITS0 SPD Si Chip
159 // | | |- ITST SPD Sensitivve Volume
160 // | |- IPC0 *5 Readout chip
161 // |- ITEL *4 SPD Telescope
162 // |- IMB0 SPD Si Chip
163 // | |- IMBS SPD Sensitive volume
164 // |- ICMB Chip MiniBus.
012f0f4c 165 //
166 // ITEL ITEL IDET ITEL ITEL
167 // Z-> -38 -36 02 36.5 38.5
168 // | | | | |
169 // cpn1 1 2 1 3 4
a421d869 170 // Inputs:
171 // none.
172 // Outputs:
173 // none.
174 // Return:
175 // none.
176 ////////////////////////////////////////////////////////////////////////
6078cf56 177 Float_t data[49];
178 // Define media off-set
179 Int_t *idtmed = fIdtmed->GetArray()+1; // array of media indexes
180 Int_t idrotm[4]; // Array of rotation matrix indexes
181 Float_t ddettest=200.0E-4,ddettelescope=300.0E-4;
182 Float_t dchipMiniBus=750.0E-4,dchiptest=300.0E-4;
183 Float_t yposition= 0.0;
012f0f4c 184 // These constant character strings are set by cvs during commit
185 // do not change them unless you know what you are doing!
186 const Char_t *cvsDate="$Date$";
187 const Char_t *cvsRevision="$Revision$";
6078cf56 188
462482c0 189 if(gMC==0) return;
6078cf56 190 // Define Rotation-reflextion Matrixes needed
191 // 0 is the unit matrix
192 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
012f0f4c 193 /*
6078cf56 194 data[0] = 10.0;
195 data[1] = 50.0;
196 data[2] = 100.0;
197 gMC->Gsvolu("ITSV","BOX",idtmed[0],data,3);
198 gMC->Gspos("ITSV",1,"ALIC",0.0,0.0,0.0,0,"ONLY");
012f0f4c 199 */
200 TGeoVolumeAssembly *itsV = gGeoManager->MakeVolumeAssembly("ITSV");
201 const Int_t length=100;
202 Char_t vstrng[length];
203 if(fIgm.WriteVersionString(vstrng,length,(AliITSVersion_t)IsVersion(),
204 fMinorVersion,cvsDate,cvsRevision))
205 itsV->SetTitle(vstrng);
206 else Error("CreateGeometry","Error writing/setting version string");
207 TGeoVolume *alic = gGeoManager->GetVolume("ALIC");
208 if(alic==0) {
209 Error("CreateGeometry","alic=0");
210 return;
211 } // end if
212 // See idrotm[199] for angle definitions.
213 alic->AddNode(itsV,1,0);
6078cf56 214
215 //cout << "idtmed[0]=" << idtmed[0]<<endl;
216 //cout << "idtmed[1]=" << idtmed[1]<<endl;
217 Float_t detMiniBusX,detMiniBusY,detMiniBusZ;
218 // SPD part of telescope (MiniBuS)
219 data[0] = detMiniBusX = 0.705;
220 data[1] = detMiniBusY = 0.5*ddettelescope;
221 data[2] = detMiniBusZ = 3.536;
222 gMC->Gsvolu("IMB0", "BOX ", idtmed[1], data, 3); // contains detector
223 data[0] = 0.64;
224 data[1] = 0.5*ddettelescope;
225 data[2] = 3.48;
226 gMC->Gsvolu("IMBS","BOX ",idtmed[1],data,3); // sensitive detecor volulme
227 gMC->Gspos("IMBS",1,"IMB0",0.0,0.0,0.0,0,"ONLY"); // place IMBS inside
228 // IMB0 with no translation and unit rotation matrix.
229 Float_t chipMiniBusX,chipMiniBusY,chipMiniBusZ;
230 data[0] = chipMiniBusX = 0.793;
231 data[1] = chipMiniBusY = 0.5*dchipMiniBus;
232 data[2] = chipMiniBusZ = 0.68;
233 gMC->Gsvolu("ICMB","BOX ",idtmed[1],data, 3); // chip Minibus
234 data[0] = TMath::Max(detMiniBusX,chipMiniBusX);
235 data[1] = detMiniBusY+chipMiniBusY;
236 data[2] = TMath::Max(detMiniBusZ,chipMiniBusZ);
237 gMC->Gsvolu("ITEL","BOX ",idtmed[0],data,3);
238 gMC->Gspos("IMB0",1,"ITEL",0.0,data[1]-detMiniBusY,0.0,0,"ONLY");
239 gMC->Gspos("ICMB",1,"ITEL",0.0,-data[1]+chipMiniBusY,0.0,0,"ONLY");
240
241 // SPD under test
242 Float_t spdX,spdY,spdZ,spdchipX,spdchipY,spdchipZ;
243 data[0] = spdX = 0.705;
244 data[1] = spdY = 0.5*ddettest;
245 data[2] = spdZ = 3.536;
246 gMC->Gsvolu("ITS0", "BOX ", idtmed[1], data, 3); // contains detector
247 data[0] = 0.64;
248 data[1] = 0.5*ddettest;
249 data[2] = 3.48;
250 gMC->Gsvolu("ITST","BOX ",idtmed[1],data,3);// sensitive detecor volume
251 gMC->Gspos("ITST",1,"ITS0",0.0,0.0,0.0,0,"ONLY"); // place ITST inside
252 // ITS0 with no translation and unit rotation matrix.
253 data[0] = spdchipX = 0.793;
254 data[1] = spdchipY = 0.5*dchiptest;
255 data[2] = spdchipZ = 0.68;
256 gMC->Gsvolu("IPC0", "BOX ", idtmed[1],data,3); // chip under test
257 data[0] = TMath::Max(spdchipX,spdX);
258 data[1] = spdY+spdchipY;
259 data[2] = TMath::Max(spdchipZ,spdZ);
260 gMC->Gsvolu("IDET","BOX ",idtmed[0],data,3);
261 gMC->Gspos("ITS0",1,"IDET",0.0,data[1]-spdY,0.0,0,"ONLY");
262 for(Int_t i=-2;i<3;i++) gMC->Gspos("IPC0",i+3,"IDET",0.0,-data[1]+spdchipY,
263 i*2.*spdchipZ+i*0.25*(spdZ-5.*spdchipZ),0,"ONLY");
264
265 // Positions detectors, Beam Axis Z, X to the right, Y up to the sky.
266 Float_t p00X,p00Y,p00Z,p01X,p01Y,p01Z,p10X,p10Y,p10Z,p11X,p11Y,p11Z;
267 p00X = 0.0;
268 p00Y = 0.0;
269 p00Z = -38.0;
270 gMC->Gspos("ITEL",1,"ITSV",p00X,p00Y,p00Z,idrotm[0],"ONLY");
271 p01X = 0.0;
272 p01Y = 0.0;
273 p01Z = p00Z+2.0;
274 gMC->Gspos("ITEL",2,"ITSV",p01X,p01Y,p01Z,idrotm[0],"ONLY");
275 Float_t pdetX,pdetY,pdetZ;
276 pdetX = 0.0;
277 pdetY = 0.0+yposition;
278 pdetZ = p01Z+38.0;
279 gMC->Gspos("IDET",1,"ITSV",pdetX,pdetY,pdetZ,idrotm[0],"ONLY");
280 p10X = 0.0;
281 p10Y = 0.0;
282 p10Z = pdetZ + 34.5;
283 gMC->Gspos("ITEL",3,"ITSV",p10X,p10Y,p10Z,idrotm[0],"ONLY");
284 p11X = 0.0;
285 p11Y = 0.0;
286 p11Z = p10Z+2.0;
287 gMC->Gspos("ITEL",4,"ITSV",p11X,p11Y,p11Z,idrotm[0],"ONLY");
288}
289//______________________________________________________________________
290void AliITSvSPD02::CreateMaterials(){
291 ////////////////////////////////////////////////////////////////////////
a421d869 292 //
293 // Create ITS SPD test beam materials
294 // This function defines the default materials used in the Geant
295 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
296 // AliITSvSPD02.
297 // In general it is automatically replaced by
023ae34b 298 // the CreateMaterials routine defined in AliITSv?. Should the function
a421d869 299 // CreateMaterials not exist for the geometry version you are using this
300 // one is used. See the definition found in AliITSv5 or the other routine
301 // for a complete definition.
302 //
303 // Inputs:
304 // none.
305 // Outputs:
306 // none.
307 // Return:
308 // none.
309 /////////////////////////////////////////////////////////////////////////
310
311 switch (fGeomNumber){
312 case 2002:
313 CreateMaterials2002();
314 break;
315 default:
316 CreateMaterials2002();
317 break;
318 } // end switch
319}
320//______________________________________________________________________
321void AliITSvSPD02::CreateMaterials2002(){
322 ////////////////////////////////////////////////////////////////////////
6078cf56 323 //
324 // Create ITS SPD test beam materials
325 // This function defines the default materials used in the Geant
326 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
327 // AliITSvSPD02.
328 // In general it is automatically replaced by
023ae34b 329 // the CreateMaterials routine defined in AliITSv?. Should the function
6078cf56 330 // CreateMaterials not exist for the geometry version you are using this
331 // one is used. See the definition found in AliITSv5 or the other routine
332 // for a complete definition.
333 //
334 // Inputs:
335 // none.
336 // Outputs:
337 // none.
338 // Return:
339 // none.
340 /////////////////////////////////////////////////////////////////////////
341 Float_t tmaxfdSi = 0.1; // Degree
342 Float_t stemaxSi = 0.0075; // cm
343 Float_t deemaxSi = 0.1; // Fraction of particle's energy 0<deemax<=1
344 Float_t epsilSi = 1.0E-4;//
345 Float_t stminSi = 0.0; // cm "Default value used"
346
347 Float_t tmaxfdAir = 0.1; // Degree
348 Float_t stemaxAir = .10000E+01; // cm
349 Float_t deemaxAir = 0.1; // Fraction of particle's energy 0<deemax<=1
350 Float_t epsilAir = 1.0E-4;//
351 Float_t stminAir = 0.0; // cm "Default value used"
352 Int_t ifield = gAlice->Field()->Integ();
353 Float_t fieldm = gAlice->Field()->Max();
354
355 AliMaterial(1,"AIR$",0.14610E+02,0.73000E+01,0.12050E-02,
aacedc3e 356 0.30423E+05,0.99900E+03);
6078cf56 357 AliMedium(1,"AIR$",1,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,
aacedc3e 358 epsilAir,stminAir);
6078cf56 359
360 AliMaterial(2,"SI$",0.28086E+02,0.14000E+02,0.23300E+01,
aacedc3e 361 0.93600E+01,0.99900E+03);
6078cf56 362 AliMedium(2,"SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
aacedc3e 363 epsilSi,stminSi);
6078cf56 364}
365//______________________________________________________________________
6078cf56 366void AliITSvSPD02::Init(){
6078cf56 367 // Initialise the ITS after it has been created.
368 // Inputs:
012f0f4c 369 // none.
6078cf56 370 // Outputs:
012f0f4c 371 // none.
6078cf56 372 // Return:
012f0f4c 373 // none.
6078cf56 374
012f0f4c 375 AliDebug(1,Form("Init: Major version %d Minor version %d",fMajorVersion,
376 fMinorVersion));
377 //
378 UpdateInternalGeometry();
6078cf56 379 AliITS::Init();
012f0f4c 380
381 //
382 fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID.
aacedc3e 383
6078cf56 384}
012f0f4c 385/*
6078cf56 386//______________________________________________________________________
387void AliITSvSPD02::SetDefaults(){
388 // sets the default segmentation, response, digit and raw cluster classes
389 // Inputs:
390 // none.
391 // Outputs:
392 // none.
393 // Return:
394 // none.
395 const Float_t kconv = 1.0e+04; // convert cm to microns
396
397 Info("SetDefaults","Setting up only SPD detector");
398
7d62fb64 399 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
400 fDetTypeSim->SetITSgeom(GetITSgeom());
6078cf56 401 AliITSgeomSPD *s0;
402 Int_t i;
403 Float_t bx[256],bz[280];
fcf95fc7 404 fDetTypeSim->ResetCalibrationArray();
7d62fb64 405 fDetTypeSim->ResetSegmentation();
406
6078cf56 407 //SPD
88cb7938 408 // Get shape info. Do it this way for now.
7d62fb64 409 s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);
fcf95fc7 410 AliITSCalibration *resp0=new AliITSCalibrationSPD();
3a7c3e6d 411 resp0->SetTemperature();
412 resp0->SetDistanceOverVoltage();
fcf95fc7 413 SetCalibrationModel(0,resp0);
3a7c3e6d 414
023ae34b 415 AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD();
6078cf56 416 seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD
417 s0->GetDz()*2.*kconv, // for now.
418 s0->GetDy()*2.*kconv); // x,z,y full width in microns.
419 seg0->SetNPads(256,160);// Number of Bins in x and z
420 for(i=000;i<256;i++) bx[i] = 50.0; // in x all are 50 microns.
421 for(i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below
422 for(i=160;i<280;i++) bz[i] = 0.0; // Outside of detector.
423 bz[ 31] = bz[ 32] = 625.0; // first chip boundry
424 bz[ 63] = bz[ 64] = 625.0; // first chip boundry
425 bz[ 95] = bz[ 96] = 625.0; // first chip boundry
426 bz[127] = bz[128] = 625.0; // first chip boundry
427 bz[160] = 425.0; // Set so that there is no zero pixel size for fNz.
428 seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now.
429 SetSegmentationModel(kSPD,seg0);
430 // set digit and raw cluster classes to be used
fcf95fc7 431 const char *kData0=(fDetTypeSim->GetCalibrationModel(0))->DataType();
7d62fb64 432 if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit");
433 else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
aacedc3e 434// SetSimulationModel(kSPD,new AliITSsimulationSPDdubna(seg0,resp0));
6078cf56 435// iDetType->ReconstructionModel(new AliITSClusterFinderSPD());
7d62fb64 436
48232831 437
012f0f4c 438// SetResponseModel(kSDD,new AliITSCalibrationSDD());
439// SetSegmentationModel(kSDD,new AliITSsegmentationSDD());
440// DetType(kSDD)->ClassNames("AliITSdigitSDD","AliITSRawClusterSDD");
441
442// SetResponseModel(kSSD,new AliITSCalibrationSSD());
443// SetSegmentationModel(kSSD,new AliITSsegmentationSSD());
444// DetType(kSSD)->ClassNames("AliITSdigitSSD","AliITSRawClusterSSD");
445
7d62fb64 446 if(fgkNTYPES>3){
6078cf56 447 Warning("SetDefaults",
448 "Only the four basic detector types are initialised!");
449 }// end if
450 return;
451}
452//______________________________________________________________________
12e7c97c 453void AliITSvSPD02::SetDefaultSimulation(){
454 // sets the default simulation.
455 // Inputs:
456 // none.
457 // Outputs:
458 // none.
459 // Return:
460 // none.
461
7d62fb64 462 if(GetITSgeom()==0){
463 Warning("SetDefaultSimulation","ITS geometry is null!");
464 return;
465 }
466
467 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
468 AliITSsimulation *sim;
8ba39da9 469 //AliITSsegmentation *seg;
fcf95fc7 470 //AliITSCalibration *res;
3a7c3e6d 471 if(fDetTypeSim){
472 sim = fDetTypeSim->GetSimulationModel(kSPD);
473 if (!sim) {
8ba39da9 474 //seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD);
fcf95fc7 475 //res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSPD());
5bfe44ce 476 sim = new AliITSsimulationSPD(fDetTypeSim);
3a7c3e6d 477 SetSimulationModel(kSPD,sim);
478 }else{ // simulation exists, make sure it is set up properly.
fcf95fc7 479 sim->SetCalibrationModel(GetITSgeom()->GetStartSPD(),(AliITSCalibration*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSPD()));
8ba39da9 480 sim->SetSegmentationModel(kSPD,(AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD));
3a7c3e6d 481 sim->Init();
482 } // end if
483 } // end if iDetType
012f0f4c 484
485// if(fDetTypeSim){
486// sim = fDetTypeSim->GetSimulationModel(kSDD);
487// if (!sim) {
488// seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD);
489// res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD());
490// sim = new AliITSsimulationSDD(seg,res);
491// SetSimulationModel(kSDD,sim);
492// }else{ // simulation exists, make sure it is set up properly.
493// sim->SetResponseModel((AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD()));
494// sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD));
495// sim->Init();
496// } //end if
497// } // end if iDetType
498// if(fDetTypeSim){
499// sim = fDetTypeSim->GetSimulationModel(kSSD);
500// if (!sim) {
501// seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD);
502// res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSSD());
503// sim = new AliITSsimulationSSD(seg,res);
504// SetSimulationModel(kSSD,sim);
505// }else{ // simulation exists, make sure it is set up properly.
506// sim->SetResponseModel((AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSSD()));
507// sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD));
508// sim->Init();
509// } // end if
510// } //
12e7c97c 511}
012f0f4c 512*/
12e7c97c 513//______________________________________________________________________
78b50563 514void AliITSvSPD02::DrawModule() const {
6078cf56 515 ////////////////////////////////////////////////////////////////////////
516 // Draw a shaded view of the ITS SPD test beam version 1.
517 // Inputs:
518 // none.
519 // Outputs:
520 // none.
521 // Return:
522 // none.
523 ////////////////////////////////////////////////////////////////////////
524 // Set everything unseen
525 gMC->Gsatt("*", "seen", -1);
526 // Set ALIC mother visible
527 gMC->Gsatt("ALIC","SEEN",0);
528 // Set ALIC ITS visible
529 gMC->Gsatt("ITSV","SEEN",0);
530 // Set ALIC Telescopes visible
531 gMC->Gsatt("ITEL","SEEN",0);
532 // Set ALIC detetcor visible
533 gMC->Gsatt("IDET","SEEN",0);
534 // Set Detector chip mother visible and drawn
535 gMC->Gsatt("IPC0","SEEN",1);
536 // Set Detector mother visible and drawn
537 gMC->Gsatt("ITS0","SEEN",1);
538 // Set minibus chip mother visible and drawn
539 gMC->Gsatt("ICMB","SEEN",1);
540 // Set minibus mother visible and drawn
541 gMC->Gsatt("IMB0","SEEN",1);
542}
543//______________________________________________________________________
544void AliITSvSPD02::StepManager(){
545 ////////////////////////////////////////////////////////////////////////
546 // Called for every step in the ITS SPD test beam, then calles the
547 // AliITShit class creator with the information to be recoreded about
548 // that hit.
549 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
550 // printing of information to a file which can be used to create a .det
551 // file read in by the routine CreateGeometry(). If set to 0 or any other
552 // value except 1, the default behavior, then no such file is created nor
553 // it the extra variables and the like used in the printing allocated.
554 // Inputs:
555 // none.
556 // Outputs:
557 // none.
558 // Return:
559 // none.
560 ////////////////////////////////////////////////////////////////////////
012f0f4c 561
6078cf56 562 if(!(this->IsActive())){
aacedc3e 563 return;
6078cf56 564 } // end if !Active volume.
012f0f4c 565 if(!(gMC->TrackCharge())) return;
566
567 Int_t cpy0=0,cpy1=0,id,mod,ncpys,status;
568 TLorentzVector position, momentum;
569 static AliITShit hit;// Saves on calls to construtors
570 //TClonesArray &lhits = *(GetDetTypeSim()->GetHits());
571 TClonesArray &lhits = *(Hits());
6078cf56 572 //
573 // Track status
012f0f4c 574 // Track status
575 status = 0;
576 if(gMC->IsTrackInside()) status += 1;
577 if(gMC->IsTrackEntering()) status += 2;
578 if(gMC->IsTrackExiting()) status += 4;
579 if(gMC->IsTrackOut()) status += 8;
580 if(gMC->IsTrackDisappeared()) status += 16;
581 if(gMC->IsTrackStop()) status += 32;
582 if(gMC->IsTrackAlive()) status += 64;
6078cf56 583 //
584 // Fill hit structure.
012f0f4c 585 id = gMC->CurrentVolID(cpy0);
586 if(id==fIdSens[0]){ // Volume name "IMBS". Det=1, ladder=1
587 ncpys = 4;
48232831 588 } else if(id == fIdSens[1]){ // Volume name "ITST"
012f0f4c 589 ncpys = 1;
6078cf56 590 } else return; // end if
012f0f4c 591 id = gMC->CurrentVolOffID(2,cpy1);
592 fIgm.DecodeDetector(mod,ncpys,cpy0,cpy1,0);
593 //
594 // Fill hit structure.
6078cf56 595 //
012f0f4c 596 hit.SetModule(mod);
597 hit.SetTrack(gAlice->GetMCApp()->GetCurrentTrackNumber());
6078cf56 598 gMC->TrackPosition(position);
599 gMC->TrackMomentum(momentum);
012f0f4c 600 hit.SetPosition(position);
601 hit.SetTime(gMC->TrackTime());
602 hit.SetMomentum(momentum);
603 hit.SetStatus(status);
604 hit.SetEdep(gMC->Edep());
605 hit.SetShunt(GetIshunt());
6078cf56 606 if(gMC->IsTrackEntering()){
012f0f4c 607 hit.SetStartPosition(position);
608 hit.SetStartTime(gMC->TrackTime());
609 hit.SetStartStatus(status);
610 return; // don't save entering hit.
6078cf56 611 } // end if IsEntering
012f0f4c 612 // Fill hit structure with this new hit.
613 //Info("StepManager","Calling Copy Constructor");
614 new(lhits[fNhits++]) AliITShit(hit); // Use Copy Construtor.
615 // Save old position... for next hit.
616 hit.SetStartPosition(position);
617 hit.SetStartTime(gMC->TrackTime());
618 hit.SetStartStatus(status);
6078cf56 619 return;
620}
621