Moved old AliMagFCheb to AliMagF, small fixes/optimizations in field classes
[u/mrichter/AliRoot.git] / ITS / AliITSvSSD03.cxx
CommitLineData
2ef7007f 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// Enrico Fragiacomo - 15/03/2004
17// Geometry for the June 2003 SSD beam test
18
2ef7007f 19#include <TLorentzVector.h>
20#include <TClonesArray.h>
3be5c40b 21#include <TVirtualMC.h>
22#include <TGeoMatrix.h>
012f0f4c 23#include <TGeoManager.h>
2ef7007f 24
25#include "AliRun.h"
26#include "AliMagF.h"
2ef7007f 27#include "AliTrackReference.h"
28#include "AliITShit.h"
29#include "AliITS.h"
30#include "AliITSvSSD03.h"
31#include "AliITSgeom.h"
32#include "AliITSgeomSSD.h"
7d62fb64 33#include "AliITSDetTypeSim.h"
fcf95fc7 34#include "AliITSCalibrationSSD.h"
2ef7007f 35#include "AliITSsegmentationSSD.h"
2ef7007f 36#include "AliITSsimulationSSD.h"
37#include "AliMC.h"
38
7d62fb64 39
2ef7007f 40///////////////////////////////////////////////////////////////////////
41// Step manager and
42// geometry class
43// for the ITS
44// SSD test beam
45// geometry of June 2003
46//
47///////////////////////////////////////////////////////////////////////
48ClassImp(AliITSvSSD03)
49
50//______________________________________________________________________
012f0f4c 51AliITSvSSD03::AliITSvSSD03():
52AliITS(), // Base Class
012f0f4c 53fMajorVersion(IsVersion()),// Major version number == IsVersion
54fMinorVersion(-1), // Minor version number
55fGeomNumber(2003), // Geometry version number (year)
012f0f4c 56fIDMother(0), //! ITS Mother Volume id.
57fIgm(kvSSD03){ //! AliITSInitGeometry object {
2ef7007f 58 ////////////////////////////////////////////////////////////////////////
59 // Standard default constructor for the ITS SSD test beam 2003 version 1.
60 // Inputs:
61 // none.
62 // Outputs:
63 // none.
64 // Return:
65 // A default created class.
66 ////////////////////////////////////////////////////////////////////////
2ef7007f 67
68 fIdN = 0;
69 fIdName = 0;
70 fIdSens = 0;
2ef7007f 71}
72//______________________________________________________________________
012f0f4c 73AliITSvSSD03::AliITSvSSD03(const char *title,Int_t gn) :
74AliITS("ITS",title), // Base Class
012f0f4c 75fMajorVersion(IsVersion()),// Major version number == IsVersion
76fMinorVersion(2), // Minor version number
77fGeomNumber(gn), // Geometry version number (year)
012f0f4c 78fIDMother(0), //! ITS Mother Volume id.
79fIgm(kvSSD03){ //! AliITSInitGeometry object {
2ef7007f 80 ////////////////////////////////////////////////////////////////////////
81 // Standard constructor for the ITS SSD testbeam 2003 version 1.
82 // Inputs:
83 // const char *title title for this ITS geometry.
84 // Int_t gn Geometry version number (year) default 2003.
85 // Outputs:
86 // none.
87 // Return:
88 // A standard created class.
89 ////////////////////////////////////////////////////////////////////////
90 Int_t i;
91
2ef7007f 92
93 fIdN = 1;
94 fIdName = new TString[fIdN];
95 fIdName[0] = "ITST";
96 fIdSens = new Int_t[fIdN];
012f0f4c 97 for(i=0;i<fIdN;i++) fIdSens[i] = 0;
2ef7007f 98
2ef7007f 99}
100//______________________________________________________________________
2ef7007f 101AliITSvSSD03::~AliITSvSSD03() {
102 ////////////////////////////////////////////////////////////////////////
103 // Standard destructor for the ITS SSD test beam 2003 version 1.
104 // Inputs:
105 // none.
106 // Outputs:
107 // none.
108 // Return:
109 // none.
110 ////////////////////////////////////////////////////////////////////////
111}
2ef7007f 112
2ef7007f 113//______________________________________________________________________
114void AliITSvSSD03::CreateGeometry(){
115 ////////////////////////////////////////////////////////////////////////
116 // Geometry builder for the ITS SSD test beam 2003 version 1.
117 // ALIC ALICE Mother Volume
118 // |- ITSV ITS Mother Volume
119 // |- IDET Detector under Test
120 // Inputs:
121 // none.
122 // Outputs:
123 // none.
124 // Return:
125 // none.
126 ////////////////////////////////////////////////////////////////////////
127
128 switch (fGeomNumber){
129 case 2003:
130 CreateGeometry2003();
131 break;
132 default:
133 CreateGeometry2003();
134 break;
135 } // end switch
136}
137//______________________________________________________________________
138void AliITSvSSD03::CreateGeometry2003(){
012f0f4c 139 ////////////////////////////////////////////////////////////////////////
140 //
141 // ALIC ALICE Mother Volume
142 // |- ITSV Beamtest Mother Volume
143 // |
144 // |- ITSA Aluminum cover for scintillator
145 // | |-ITSS first Trieste trigger plastic scintillator
146 // |- ITSA Aluminum cover for scintillator
147 // | |-ITSS second Trieste's trigger plastic scintillator
148 // |
149 // |- IGAR Black box around ITST
150 // | |-IAIR Air inside the black box
151 // | |-ITST Detector under Test
152 // |
153 // |- IFRA Aluminum cover for scintillator
154 // | |-IFRS French plastic scintillator
155 // |
156 // |- ITSA Aluminum cover for scintillator
157 // | |-ITSS third Trieste's plastic scintillator
158 //
159 // ITSA ITSA IGAR IFRA ITSA
160 // Z-> -282 -280 0 16 270
161 // | | | | |
162 // cpn0 1 2 1 1 3
163 //
164 // Inputs:
165 // none.
166 // Outputs:
167 // none.
168 // Return:
169 // none.
170 ////////////////////////////////////////////////////////////////////////
171 Float_t data[49];
172 // Define media off-set
173 Int_t *idtmed = fIdtmed->GetArray()+1; // array of media indexes
174 Int_t idrotm[4]; // Array of rotation matrix indexes
175 // These constant character strings are set by cvs during commit
176 // do not change them unless you know what you are doing!
177 const Char_t *cvsDate="$Date$";
178 const Char_t *cvsRevision="$Revision$";
179 //Float_t yposition= 0.0;
2ef7007f 180
181 if(gMC==0) return;
182 // Define Rotation-reflextion Matrixes needed
183 // 0 is the unit matrix
184
012f0f4c 185 /*
2ef7007f 186 // Beamtest mother volume (air) positioned in ALIC mother volume
187 data[0] = 500.0;
188 data[1] = 500.0;
189 data[2] = 1000.0;
190 gMC->Gsvolu("ITSV","BOX",idtmed[0],data,3);
191 gMC->Gspos("ITSV",1,"ALIC",0.0,0.0,0.0,0,"ONLY");
012f0f4c 192 */
193 TGeoVolumeAssembly *itsV = gGeoManager->MakeVolumeAssembly("ITSV");
194 const Int_t length=100;
195 Char_t vstrng[length];
196 if(fIgm.WriteVersionString(vstrng,length,(AliITSVersion_t)IsVersion(),
197 fMinorVersion,cvsDate,cvsRevision))
198 itsV->SetTitle(vstrng);
199 else Error("CreateGeometry","Error writing/setting version string");
200 //printf("Title set to %s\n",vstrng);
201 TGeoVolume *alic = gGeoManager->GetVolume("ALIC");
202 if(alic==0) {
203 Error("CreateGeometry","alic=0");
204 return;
205 } // end if
206 // See idrotm[199] for angle definitions.
207 alic->AddNode(itsV,1,0);
2ef7007f 208
209 // Trieste's plastic scintillators for the trigger (2 at beam enter)
210 // ...define them (aluminum cover + scintillator inside)
211 // aluminum cover
212 data[0] = 30.01; // size+2x50 microns Kapton
213 data[1] = 1.01;
214 data[2] = 20.01;
215 //gMC->Gsvolu("ITSA","BOX ",idtmed[3],data,3);//
216 gMC->Gsvolu("ITSA","BOX ",idtmed[4],data,3);//
217 data[0] = 30.0;
218 data[1] = 1.0;
219 data[2] = 20.0;
220 // plastic scintillator
221 gMC->Gsvolu("ITSS","BOX ",idtmed[2],data,3);
222 gMC->Gspos("ITSS",1,"ITSA",0.0,0.0,0.0,0,"ONLY");
223 // ... and place them inside ITSV
224 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
225 // first scintillator
226 gMC->Gspos("ITSA",1,"ITSV",0.0,0.0,-282.0,idrotm[0],"ONLY");
227 // second scintillator
228 gMC->Gspos("ITSA",2,"ITSV",0.0,0.0,-280.0,idrotm[0],"ONLY");
229
230 // black kapton box with the SSD sensor inside (width 50 microns)
231 data[0] = 20.0;
232 data[1] = 20.0;
233 data[2] = 20.0;
234 gMC->Gsvolu("IGAR","BOX ",idtmed[4],data,3); //
235 // air in the black kapton box
236 data[0] = 19.99;
237 data[1] = 19.99;
238 data[2] = 19.99;
239 gMC->Gsvolu("IAIR","BOX ",idtmed[0],data,3); //
240 // SSD sensor
241 Float_t ddettest=300.0E-4;
242 data[0] = 3.5;
243 data[1] = 0.5*ddettest;
244 data[2] = 2.0;
245 gMC->Gsvolu("ITST","BOX ",idtmed[1],data,3);// sensitive detector volume
246 // place ITST inside IAIR (no rotation: it will be rotated with IGAR)
247 gMC->Gspos("ITST",1,"IAIR",0.0,0.0,0.0,0,"ONLY");
248 // place IAIR inside IGAR
249 gMC->Gspos("IAIR",1,"IGAR",0.0,0.0,0.0,0,"ONLY");
250 // place IGAR inside ITSV
251 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
252 gMC->Gspos("IGAR",1,"ITSV",0.0,0.0,0.0,idrotm[0],"ONLY");
253 //gMC->Gspos("IGAR",1,"ITSV",0.0,0.0,0.0,0,"ONLY");
254
255 // The so called French detector
256 // ...define it (Kapton cover + scintillator inside)
257 // Kapton cover
258 data[0] = 2.01; // size+2x50 microns Kapton width
259 data[1] = 1.01;
260 data[2] = 1.01;
261 gMC->Gsvolu("IFRA","BOX ",idtmed[4],data,3);//
262 data[0] = 2.0;
263 data[1] = 1.0;
264 data[2] = 1.0;
265 // plastic scintillator
266 gMC->Gsvolu("IFRS","BOX ",idtmed[2],data,3);
267 gMC->Gspos("IFRS",1,"IFRA",0.0,0.0,0.0,0,"ONLY");
268 // ... and place it inside ITSV
269 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
270 gMC->Gspos("IFRA",1,"ITSV",0.0,0.0,16.0,idrotm[0],"ONLY");
271
272 // An other Trieste's plastic scintillator for the trigger
273 // ...just place an other copy inside ITSV
274 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
275 gMC->Gspos("ITSA",3,"ITSV",0.0,0.0,270.0,idrotm[0],"ONLY");
276
277}
278
279//______________________________________________________________________
280void AliITSvSSD03::CreateMaterials(){
281 ////////////////////////////////////////////////////////////////////////
282 //
283 // Create ITS SSD test beam materials
284 // This function defines the default materials used in the Geant
285 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
286 // AliITSvSSD03.
287 // In general it is automatically replaced by
023ae34b 288 // the CreateMaterials routine defined in AliITSv?. Should the function
2ef7007f 289 // CreateMaterials not exist for the geometry version you are using this
290 // one is used. See the definition found in AliITSv5 or the other routine
291 // for a complete definition.
292 //
293 // Inputs:
294 // none.
295 // Outputs:
296 // none.
297 // Return:
298 // none.
299 /////////////////////////////////////////////////////////////////////////
300
301 switch (fGeomNumber){
302 case 2003:
303 CreateMaterials2003();
304 break;
305 default:
306 CreateMaterials2003();
307 break;
308 } // end switch
309}
310//______________________________________________________________________
311void AliITSvSSD03::CreateMaterials2003(){
312 ////////////////////////////////////////////////////////////////////////
313 //
314 // Create ITS SSD test beam materials
315 // This function defines the default materials used in the Geant
316 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
317 // AliITSvSSD03.
318 // In general it is automatically replaced by
023ae34b 319 // the CreateMaterials routine defined in AliITSv?. Should the function
2ef7007f 320 // CreateMaterials not exist for the geometry version you are using this
321 // one is used. See the definition found in AliITSv5 or the other routine
322 // for a complete definition.
323 //
324 // Inputs:
325 // none.
326 // Outputs:
327 // none.
328 // Return:
329 // none.
330 /////////////////////////////////////////////////////////////////////////
331
332 Int_t ifield = gAlice->Field()->Integ();
333 Float_t fieldm = gAlice->Field()->Max();
334
335 // Scintillator CH
336 Float_t ascin[2]={1.01,12.01};
337 Float_t zscin[2]={1,6};
338 Float_t wscin[2]={1,1};
339 Float_t denscin=1.03;
340 AliMixture( 3, "Scintillator$",ascin,zscin,denscin,-2,wscin);
341 AliMedium(3, "Scintillator$", 3, 1, ifield, fieldm, 0.1, .01,
342 0.1, .0001, 0.0);
343
344 // Aluminum
345 Float_t tmaxfdAl = 0.1; // Degree
346 Float_t stemaxAl = 0.01; // cm
347 Float_t deemaxAl = 0.1; // Fraction of particle's energy 0<deemax<=1
348 Float_t epsilAl = 1.0E-4;//
349 Float_t stminAl = 0.0; // cm "Default value used"
350 AliMaterial(4, "Al$", 26.98, 13., 2.7, 8.9, 37.2);
351 AliMedium(4, "Al$", 4, 0, ifield, fieldm, tmaxfdAl, stemaxAl,
352 deemaxAl, epsilAl, stminAl);
353
354 // Air
355 Float_t tmaxfdAir = 0.1; // Degree
356 Float_t stemaxAir = .10000E+01; // cm
357 Float_t deemaxAir = 0.1; // Fraction of particle's energy 0<deemax<=1
358 Float_t epsilAir = 1.0E-4;//
359 Float_t stminAir = 0.0; // cm "Default value used"
360 AliMaterial(1,"AIR$",0.14610E+03,0.73000E+01,0.12050E-03,
361 0.30423E+05,0.99900E+03);
362 AliMedium(1,"AIR$",1,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,
363 epsilAir,stminAir);
364
365 // Silicon
366 Float_t tmaxfdSi = 0.1; // Degree
367 //Float_t stemaxSi = 0.0075; // cm
368 //Float_t deemaxSi = 0.1; // Fraction of particle's energy 0<deemax<=1
369 //Float_t stminSi = 0.0; // cm "Default value used"
370 //Float_t tmaxfdSi = 10; // Degree
371 Float_t stemaxSi = 0.01; // cm
372 Float_t deemaxSi = 0.1; // Fraction of particle's energy 0<deemax<=1
373 Float_t epsilSi = 1.0E-4;//
374 //Float_t epsilSi = 0.003;//
375 Float_t stminSi = 0.003; // cm "Default value used"
376 AliMaterial(2,"SSD SI$",0.28086E+02,0.14000E+02,0.23300E+01,
377 0.93600E+01,0.99900E+03);
378 AliMedium(2,"SSD SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
379 epsilSi,stminSi);
380
381 // Kapton
382 AliMaterial(5, "Kapton$", 12.011, 6., 1.3, 31.27, 999.);
383 AliMedium(5, "Kapton$", 5, 0,ifield,fieldm, 10., .01, .1, .003, .003);
012f0f4c 384}/*
2ef7007f 385//______________________________________________________________________
386void AliITSvSSD03::InitAliITSgeom(){
2ef7007f 387 // sturture.
388 // Inputs:
389 // none.
390 // Outputs:
391 // none.
392 // Return:
393 // none.
3be5c40b 394 const Int_t knlayers=1;
395 const TString kname="ALIC_1/ITSV_1/IGAR_1/IAIR_1/ITST_1";
396 const Int_t knlad[knlayers]={knlayers*1},kndet[knlayers]={knlayers*1};
397 Int_t npar;
398 Float_t par[20];
399 Double_t trans[3]={3*0.0},rot[10]={10*0.0};
400 TGeoHMatrix materix;
401
402 AliITSgeom* geom = new AliITSgeom(0,knlayers,knlad,kndet,1);
7d62fb64 403 SetITSgeom(geom);
3be5c40b 404 npar=3;par[0]=3.5;par[1]=0.5*300.0E-4;par[2]=2.0;
405 geom->ReSetShape(kSSD,new AliITSgeomSSD275and75(npar,par));
406 gMC->GetTransformation(kname.Data(),materix);
407 geom->CreateMatrix(0,1,1,1,kSSD,trans,rot);
408 geom->SetTrans(0,materix.GetTranslation());
409 geom->SetRotMatrix(0,materix.GetRotationMatrix());
410 geom->GetGeomMatrix(0)->SetPath(kname.Data());
2ef7007f 411 return;
012f0f4c 412}*/
2ef7007f 413//______________________________________________________________________
414void AliITSvSSD03::Init(){
415 ////////////////////////////////////////////////////////////////////////
416 // Initialise the ITS after it has been created.
417 // Inputs:
418 // none.
419 // Outputs:
420 // none.
421 // Return:
422 // none.
423 ////////////////////////////////////////////////////////////////////////
2ef7007f 424
012f0f4c 425
426 Info("Init","**********AliITSvSSD03 %d _Init *************",fMinorVersion);
427
428 AliDebug(1,Form("Init: Major version %d Minor version %d",fMajorVersion,
429 fMinorVersion));
430 //
431 UpdateInternalGeometry();
2ef7007f 432 AliITS::Init();
012f0f4c 433
012f0f4c 434 fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID.
435
436}/*
2ef7007f 437//______________________________________________________________________
438void AliITSvSSD03::SetDefaults(){
8ba39da9 439 // sets the default segmentation, rerponse, digit and raw cluster classes
2ef7007f 440 // Inputs:
441 // none.
442 // Outputs:
443 // none.
444 // Return:
445 // none.
446 const Float_t kconv = 1.0e+04; // convert cm to microns
447
448 Info("SetDefaults","Setting up only SSD detector");
449
7d62fb64 450 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
451 fDetTypeSim->SetITSgeom(GetITSgeom());
2ef7007f 452 AliITSgeomSSD *s0;
fcf95fc7 453 fDetTypeSim->ResetCalibrationArray();
7d62fb64 454 fDetTypeSim->ResetSegmentation();
455
2ef7007f 456 //SSD
2ef7007f 457
458 // Get shape info. Do it this way for now.
7d62fb64 459 s0 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);
fcf95fc7 460 AliITSCalibration *resp0=new AliITSCalibrationSSD("simulated");
461 SetCalibrationModel(GetITSgeom()->GetStartSSD(),resp0);
7d62fb64 462
023ae34b 463 AliITSsegmentationSSD *seg0=new AliITSsegmentationSSD();
2ef7007f 464 seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSSD
465 s0->GetDz()*2.*kconv, // for now.
466 s0->GetDy()*2.*kconv); // x,z,y full width in microns.
467 //seg0->SetNPads(256,160);// Number of Bins in x and z
468
469 SetSegmentationModel(kSSD,seg0);
470
471 // set digit and raw cluster classes to be used
fcf95fc7 472 const char *kData0=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSSD()))->DataType();
7d62fb64 473 if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit");
474 else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
2ef7007f 475// SetSimulationModel(kSSD,new AliITSsimulationSSD(seg0,resp0));
476// iDetType->ReconstructionModel(new AliITSClusterFinderSSD());
477
2ef7007f 478
012f0f4c 479 //SetResponseModel(kSPD,new AliITSCalibrationSPD());
480 //SetSegmentationModel(kSPD,new AliITSsegmentationSPD());
481 //fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
482
483 //SetResponseModel(kSDD,new AliITSCalibrationSDD());
484 //SetSegmentationModel(kSDD,new AliITSsegmentationSDD());
485 //fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD");
486
2ef7007f 487
488
7d62fb64 489 if(fgkNTYPES>3){
2ef7007f 490 Warning("SetDefaults",
491 "Only the four basic detector types are initialised!");
492 }// end if
493 return;
494}
495//______________________________________________________________________
496void AliITSvSSD03::SetDefaultSimulation(){
497 // sets the default simulation.
498 // Inputs:
499 // none.
500 // Outputs:
501 // none.
502 // Return:
503 // none.
504
7d62fb64 505 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
506
507 AliITSsimulation *sim;
8ba39da9 508 // AliITSsegmentation *seg;
fcf95fc7 509 // AliITSCalibration *res;
012f0f4c 510
7d62fb64 511 //SPD
012f0f4c 512 //if(fDetTypeSim){
513 //sim = fDetTypeSim->GetSimulationModel(kSPD);
514 //if (!sim) {
515 //seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD);
516 //res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(nspd);
517 //sim = new AliITSsimulationSPDdubna(seg,res,1);
518 //SetSimulationModel(kSPD,sim);
519 //}else{ // simulation exists, make sure it is set up properly.
520 //sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD));
521 //sim->SetResponseModel((AliITSCalibration*)fDetTypeSim->GetResponseModel(nspd));
522 //((AliITSsimulation*)sim)->Init();
7d62fb64 523 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
fcf95fc7 524 // (AliITSCalibration*)iDetType->GetResponseModel());
7d62fb64 525 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
526 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
012f0f4c 527 //} // end if
528 //} // end if !fDetTypeSim
7d62fb64 529
530 //SDD
012f0f4c 531 //if(fDetTypeSim){
532 //sim = fDetTypeSim->GetSimulationModel(kSDD);
533 //if (!sim) {
534 //seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD);
535 //res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(nsdd);
536 //sim = new AliITSsimulationSDD(seg,res);
537 //SetSimulationModel(kSDD,sim);
538 //}else{ // simulation exists, make sure it is set up properly.
539 //sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD));
540 //sim->SetResponseModel((AliITSCalibration*)fDetTypeSim->GetResponseModel(nsdd));
541
542 //((AliITSsimulation*)sim)->Init();
7d62fb64 543 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
fcf95fc7 544 // (AliITSCalibration*)iDetType->GetResponseModel());
7d62fb64 545 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
546 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
012f0f4c 547 //} //end if
548 //} // end if !iDetType
7d62fb64 549 //SSD
550 if(fDetTypeSim){
551 sim = fDetTypeSim->GetSimulationModel(kSSD);
552 if (!sim) {
8ba39da9 553 // seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD);
fcf95fc7 554 // res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSSD());
8ba39da9 555 sim = new AliITSsimulationSSD(fDetTypeSim);
7d62fb64 556 SetSimulationModel(kSSD,sim);
557 }else{ // simulation exists, make sure it is set up properly.
8ba39da9 558 sim->SetSegmentationModel(kSSD,(AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD));
fcf95fc7 559 sim->SetCalibrationModel(GetITSgeom()->GetStartSSD(),(AliITSCalibration*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSSD()));
7d62fb64 560 ((AliITSsimulation*)sim)->Init();
561 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
fcf95fc7 562 // (AliITSCalibration*)iDetType->GetResponseModel());
7d62fb64 563 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
564 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
565 } // end if
566 } // end if !iDetType
2ef7007f 567}
012f0f4c 568*/
2ef7007f 569//______________________________________________________________________
570void AliITSvSSD03::DrawModule() const {
571 ////////////////////////////////////////////////////////////////////////
572 // Draw a shaded view of the ITS SSD test beam version 1.
573 // Inputs:
574 // none.
575 // Outputs:
576 // none.
577 // Return:
578 // none.
579 ////////////////////////////////////////////////////////////////////////
580
581 gMC->Gsatt("*", "seen", -1);
582 gMC->Gsatt("ALIC","SEEN",0);
583 gMC->Gsatt("ITSV","SEEN",0);
584 gMC->Gsatt("ITSA","SEEN",1);
585 gMC->Gsatt("ITSS","SEEN",1);
586 gMC->Gsatt("IGAR","SEEN",1);
587 gMC->Gsatt("IAIR","SEEN",0);
588 gMC->Gsatt("ITST","SEEN",1);
589 gMC->Gsatt("IFRA","SEEN",1);
590 gMC->Gsatt("IFRS","SEEN",1);
591}
592//______________________________________________________________________
593void AliITSvSSD03::StepManager(){
594 ////////////////////////////////////////////////////////////////////////
595 // Called for every step in the ITS SSD, then calles the
596 // AliITShit class creator with the information to be recoreded about
597 // that hit.
598 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
599 // printing of information to a file which can be used to create a .det
600 // file read in by the routine CreateGeometry(). If set to 0 or any other
601 // value except 1, the default behavior, then no such file is created nor
602 // it the extra variables and the like used in the printing allocated.
603 // Inputs:
604 // none.
605 // Outputs:
606 // none.
607 // Return:
608 // none.
609 ////////////////////////////////////////////////////////////////////////
2ef7007f 610 if(!(this->IsActive())){
012f0f4c 611 return;
2ef7007f 612 } // end if !Active volume.
012f0f4c 613 if(!(gMC->TrackCharge())) return;
2ef7007f 614
012f0f4c 615 Int_t cpy0,mod,id,status;
616 TLorentzVector position, momentum;
617 static AliITShit hit;// Saves on calls to construtors
618 //TClonesArray &lhits = *(GetDetTypeSim()->GetHits());
619 TClonesArray &lhits = *(Hits());
2ef7007f 620 //
621 // Track status
012f0f4c 622 // Track status
623 status = 0;
624 if(gMC->IsTrackInside()) status += 1;
625 if(gMC->IsTrackEntering()) status += 2;
626 if(gMC->IsTrackExiting()) status += 4;
627 if(gMC->IsTrackOut()) status += 8;
628 if(gMC->IsTrackDisappeared()) status += 16;
629 if(gMC->IsTrackStop()) status += 32;
630 if(gMC->IsTrackAlive()) status += 64;
2ef7007f 631 //
632 // Fill hit structure.
012f0f4c 633 id = gMC->CurrentVolID(cpy0);
2ef7007f 634 if(id==fIdSens[0]){ // Volume name "ITST"
012f0f4c 635 mod=2; // Det, ladder
2ef7007f 636 } else return; // end if
637 //
012f0f4c 638 //
639 // Fill hit structure.
640 //
641 hit.SetModule(mod);
642 hit.SetTrack(gAlice->GetMCApp()->GetCurrentTrackNumber());
2ef7007f 643 gMC->TrackPosition(position);
644 gMC->TrackMomentum(momentum);
012f0f4c 645 hit.SetPosition(position);
646 hit.SetTime(gMC->TrackTime());
647 hit.SetMomentum(momentum);
648 hit.SetStatus(status);
649 hit.SetEdep(gMC->Edep());
650 hit.SetShunt(GetIshunt());
2ef7007f 651 if(gMC->IsTrackEntering()){
012f0f4c 652 hit.SetStartPosition(position);
653 hit.SetStartTime(gMC->TrackTime());
654 hit.SetStartStatus(status);
655 return; // don't save entering hit.
2ef7007f 656 } // end if IsEntering
012f0f4c 657 // Fill hit structure with this new hit.
658 //Info("StepManager","Calling Copy Constructor");
659 new(lhits[fNhits++]) AliITShit(hit); // Use Copy Construtor.
660 // Save old position... for next hit.
661 hit.SetStartPosition(position);
662 hit.SetStartTime(gMC->TrackTime());
663 hit.SetStartStatus(status);
2ef7007f 664 return;
665}
666