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