1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 // Enrico Fragiacomo - 15/03/2004
17 // Geometry for the June 2003 SSD beam test
19 #include <TGeometry.h>
21 #include <TLorentzVector.h>
22 #include <TClonesArray.h>
24 #include <TVirtualMC.h>
25 #include <TGeoMatrix.h>
29 #include "AliTrackReference.h"
30 #include "AliITShit.h"
32 #include "AliITSvSSD03.h"
33 #include "AliITSgeom.h"
34 #include "AliITSgeomSSD.h"
35 #include "AliITSDetTypeSim.h"
36 #include "AliITSCalibrationSSD.h"
37 #include "AliITSsegmentationSSD.h"
38 #include "AliITSsimulationSSD.h"
42 ///////////////////////////////////////////////////////////////////////
47 // geometry of June 2003
49 ///////////////////////////////////////////////////////////////////////
50 ClassImp(AliITSvSSD03)
52 //______________________________________________________________________
53 AliITSvSSD03::AliITSvSSD03() {
54 ////////////////////////////////////////////////////////////////////////
55 // Standard default constructor for the ITS SSD test beam 2003 version 1.
61 // A default created class.
62 ////////////////////////////////////////////////////////////////////////
68 fEuclidOut = kFALSE; // Don't write Euclide file
69 fGeomDetOut = kFALSE; // Don't write .det file
70 fGeomDetIn = kFALSE; // Don't Read .det file
71 fMajorVersion = IsVersion();
73 fGeomNumber = 2003; // default value
74 for(i=0;i<60;i++) fRead[i] = '\0';
75 for(i=0;i<60;i++) fWrite[i] = '\0';
76 for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0';
78 //______________________________________________________________________
79 AliITSvSSD03::AliITSvSSD03(const char *title,Int_t gn) : AliITS("ITS", title){
80 ////////////////////////////////////////////////////////////////////////
81 // Standard constructor for the ITS SSD testbeam 2003 version 1.
83 // const char *title title for this ITS geometry.
84 // Int_t gn Geometry version number (year) default 2003.
88 // A standard created class.
89 ////////////////////////////////////////////////////////////////////////
95 fIdName = new TString[fIdN];
97 fIdSens = new Int_t[fIdN];
98 for(i=0;i<fIdN;i++) fIdSens[i] = 0;
100 fMajorVersion = IsVersion();
102 fEuclidOut = kFALSE; // Don't write Euclide file
103 fGeomDetOut = kFALSE; // Don't write .det file
104 fGeomDetIn = kFALSE; // Don't Read .det file
111 fEuclidGeometry="$ALICE_ROOT/ITS/ITSgeometry_vSSD03.euc";
112 strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_vSSD03.det",60);
113 strncpy(fRead,fEuclidGeomDet,60);
114 strncpy(fWrite,fEuclidGeomDet,60);
116 //______________________________________________________________________
117 AliITSvSSD03::~AliITSvSSD03() {
118 ////////////////////////////////////////////////////////////////////////
119 // Standard destructor for the ITS SSD test beam 2003 version 1.
126 ////////////////////////////////////////////////////////////////////////
128 //______________________________________________________________________
129 void AliITSvSSD03::BuildGeometry(){
130 ////////////////////////////////////////////////////////////////////////
131 // Geometry builder for the ITS SSD test beam 2003 version 1.
132 // ALIC ALICE Mother Volume
133 // |- ITSV ITS Mother Volume
134 // |- ITST Detector under Test
142 ////////////////////////////////////////////////////////////////////////
143 // Get the top alice volume.
145 switch (fGeomNumber){
154 //______________________________________________________________________
155 void AliITSvSSD03::BuildGeometry2003(){
156 ////////////////////////////////////////////////////////////////////////
157 // Geometry builder for the ITS SSD test beam 2003 version 1.
158 // ALIC ALICE Mother Volume
159 // |- ITSV ITS Mother Volume
160 // |- ITST Detector under Test
167 ////////////////////////////////////////////////////////////////////////
169 // Get the top alice volume.
170 TNode *aALIC = gAlice->GetGeometry()->GetNode("alice");
173 // Define ITS Mother Volume
175 Float_t ddettest=300.0E-4;
176 //Float_t yposition= 0.0;
177 TRotMatrix *r0 = new TRotMatrix("ITSidrotm0","ITSidrotm0",
178 90.0,0,0.0,0,90.0,270.0);
180 // Mother volume (beam along z)
181 data[0] = 10.0; // in centimeter
184 TBRIK *iITSVshape = new TBRIK("ITSVshape",
185 "ITS Logical Mother Volume","Air",
186 data[0],data[1],data[2]);
187 TNode *iITSV = new TNode("ITSV","ITS Mother Volume",iITSVshape,
189 iITSV->cd(); // set ourselve into ITSV subvolume of aALIC
191 // SSD part of telescope (Note. strips in local xz plan)
192 data[0] = 3.5; // half-length of the SSD module
193 data[1] = 0.5*ddettest; // half-width of the SSD module
194 data[2] = 2.0; // half-heigth of the SSD module
195 TBRIK *iITSTshape = new TBRIK("ITSTshape","SSD sensitive volume","Si",
196 data[0],data[1],data[2]);
197 TNode *iITST = new TNode("ITST","SSD sensitive volume",iITSTshape,
201 iITST->SetLineColor(kYellow);
204 //______________________________________________________________________
205 void AliITSvSSD03::CreateGeometry(){
206 ////////////////////////////////////////////////////////////////////////
207 // Geometry builder for the ITS SSD test beam 2003 version 1.
208 // ALIC ALICE Mother Volume
209 // |- ITSV ITS Mother Volume
210 // |- IDET Detector under Test
217 ////////////////////////////////////////////////////////////////////////
219 switch (fGeomNumber){
221 CreateGeometry2003();
224 CreateGeometry2003();
228 //______________________________________________________________________
229 void AliITSvSSD03::CreateGeometry2003(){
230 ////////////////////////////////////////////////////////////////////////
232 // ALIC ALICE Mother Volume
233 // |- ITSV Beamtest Mother Volume
235 // |- ITSA Aluminum cover for scintillator
236 // | |-ITSS first Trieste trigger plastic scintillator
237 // |- ITSA Aluminum cover for scintillator
238 // | |-ITSS second Trieste's trigger plastic scintillator
240 // |- IGAR Black box around ITST
241 // | |-IAIR Air inside the black box
242 // | |-ITST Detector under Test
244 // |- IFRA Aluminum cover for scintillator
245 // | |-IFRS French plastic scintillator
247 // |- ITSA Aluminum cover for scintillator
248 // | |-ITSS third Trieste's plastic scintillator
255 ////////////////////////////////////////////////////////////////////////
258 // Define media off-set
259 Int_t *idtmed = fIdtmed->GetArray()+1; // array of media indexes
260 Int_t idrotm[4]; // Array of rotation matrix indexes
261 //Float_t yposition= 0.0;
264 // Define Rotation-reflextion Matrixes needed
265 // 0 is the unit matrix
267 // Beamtest mother volume (air) positioned in ALIC mother volume
271 gMC->Gsvolu("ITSV","BOX",idtmed[0],data,3);
272 gMC->Gspos("ITSV",1,"ALIC",0.0,0.0,0.0,0,"ONLY");
274 // Trieste's plastic scintillators for the trigger (2 at beam enter)
275 // ...define them (aluminum cover + scintillator inside)
277 data[0] = 30.01; // size+2x50 microns Kapton
280 //gMC->Gsvolu("ITSA","BOX ",idtmed[3],data,3);//
281 gMC->Gsvolu("ITSA","BOX ",idtmed[4],data,3);//
285 // plastic scintillator
286 gMC->Gsvolu("ITSS","BOX ",idtmed[2],data,3);
287 gMC->Gspos("ITSS",1,"ITSA",0.0,0.0,0.0,0,"ONLY");
288 // ... and place them inside ITSV
289 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
290 // first scintillator
291 gMC->Gspos("ITSA",1,"ITSV",0.0,0.0,-282.0,idrotm[0],"ONLY");
292 // second scintillator
293 gMC->Gspos("ITSA",2,"ITSV",0.0,0.0,-280.0,idrotm[0],"ONLY");
295 // black kapton box with the SSD sensor inside (width 50 microns)
299 gMC->Gsvolu("IGAR","BOX ",idtmed[4],data,3); //
300 // air in the black kapton box
304 gMC->Gsvolu("IAIR","BOX ",idtmed[0],data,3); //
306 Float_t ddettest=300.0E-4;
308 data[1] = 0.5*ddettest;
310 gMC->Gsvolu("ITST","BOX ",idtmed[1],data,3);// sensitive detector volume
311 // place ITST inside IAIR (no rotation: it will be rotated with IGAR)
312 gMC->Gspos("ITST",1,"IAIR",0.0,0.0,0.0,0,"ONLY");
313 // place IAIR inside IGAR
314 gMC->Gspos("IAIR",1,"IGAR",0.0,0.0,0.0,0,"ONLY");
315 // place IGAR inside ITSV
316 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
317 gMC->Gspos("IGAR",1,"ITSV",0.0,0.0,0.0,idrotm[0],"ONLY");
318 //gMC->Gspos("IGAR",1,"ITSV",0.0,0.0,0.0,0,"ONLY");
320 // The so called French detector
321 // ...define it (Kapton cover + scintillator inside)
323 data[0] = 2.01; // size+2x50 microns Kapton width
326 gMC->Gsvolu("IFRA","BOX ",idtmed[4],data,3);//
330 // plastic scintillator
331 gMC->Gsvolu("IFRS","BOX ",idtmed[2],data,3);
332 gMC->Gspos("IFRS",1,"IFRA",0.0,0.0,0.0,0,"ONLY");
333 // ... and place it inside ITSV
334 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
335 gMC->Gspos("IFRA",1,"ITSV",0.0,0.0,16.0,idrotm[0],"ONLY");
337 // An other Trieste's plastic scintillator for the trigger
338 // ...just place an other copy inside ITSV
339 AliMatrix(idrotm[0], 90.0,0.0, 0.0,0.0, 90.0,270.0);
340 gMC->Gspos("ITSA",3,"ITSV",0.0,0.0,270.0,idrotm[0],"ONLY");
344 //______________________________________________________________________
345 void AliITSvSSD03::CreateMaterials(){
346 ////////////////////////////////////////////////////////////////////////
348 // Create ITS SSD test beam materials
349 // This function defines the default materials used in the Geant
350 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
352 // In general it is automatically replaced by
353 // the CreateMaterials routine defined in AliITSv?. Should the function
354 // CreateMaterials not exist for the geometry version you are using this
355 // one is used. See the definition found in AliITSv5 or the other routine
356 // for a complete definition.
364 /////////////////////////////////////////////////////////////////////////
366 switch (fGeomNumber){
368 CreateMaterials2003();
371 CreateMaterials2003();
375 //______________________________________________________________________
376 void AliITSvSSD03::CreateMaterials2003(){
377 ////////////////////////////////////////////////////////////////////////
379 // Create ITS SSD test beam materials
380 // This function defines the default materials used in the Geant
381 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
383 // In general it is automatically replaced by
384 // the CreateMaterials routine defined in AliITSv?. Should the function
385 // CreateMaterials not exist for the geometry version you are using this
386 // one is used. See the definition found in AliITSv5 or the other routine
387 // for a complete definition.
395 /////////////////////////////////////////////////////////////////////////
397 Int_t ifield = gAlice->Field()->Integ();
398 Float_t fieldm = gAlice->Field()->Max();
401 Float_t ascin[2]={1.01,12.01};
402 Float_t zscin[2]={1,6};
403 Float_t wscin[2]={1,1};
404 Float_t denscin=1.03;
405 AliMixture( 3, "Scintillator$",ascin,zscin,denscin,-2,wscin);
406 AliMedium(3, "Scintillator$", 3, 1, ifield, fieldm, 0.1, .01,
410 Float_t tmaxfdAl = 0.1; // Degree
411 Float_t stemaxAl = 0.01; // cm
412 Float_t deemaxAl = 0.1; // Fraction of particle's energy 0<deemax<=1
413 Float_t epsilAl = 1.0E-4;//
414 Float_t stminAl = 0.0; // cm "Default value used"
415 AliMaterial(4, "Al$", 26.98, 13., 2.7, 8.9, 37.2);
416 AliMedium(4, "Al$", 4, 0, ifield, fieldm, tmaxfdAl, stemaxAl,
417 deemaxAl, epsilAl, stminAl);
420 Float_t tmaxfdAir = 0.1; // Degree
421 Float_t stemaxAir = .10000E+01; // cm
422 Float_t deemaxAir = 0.1; // Fraction of particle's energy 0<deemax<=1
423 Float_t epsilAir = 1.0E-4;//
424 Float_t stminAir = 0.0; // cm "Default value used"
425 AliMaterial(1,"AIR$",0.14610E+03,0.73000E+01,0.12050E-03,
426 0.30423E+05,0.99900E+03);
427 AliMedium(1,"AIR$",1,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,
431 Float_t tmaxfdSi = 0.1; // Degree
432 //Float_t stemaxSi = 0.0075; // cm
433 //Float_t deemaxSi = 0.1; // Fraction of particle's energy 0<deemax<=1
434 //Float_t stminSi = 0.0; // cm "Default value used"
435 //Float_t tmaxfdSi = 10; // Degree
436 Float_t stemaxSi = 0.01; // cm
437 Float_t deemaxSi = 0.1; // Fraction of particle's energy 0<deemax<=1
438 Float_t epsilSi = 1.0E-4;//
439 //Float_t epsilSi = 0.003;//
440 Float_t stminSi = 0.003; // cm "Default value used"
441 AliMaterial(2,"SSD SI$",0.28086E+02,0.14000E+02,0.23300E+01,
442 0.93600E+01,0.99900E+03);
443 AliMedium(2,"SSD SI$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,
447 AliMaterial(5, "Kapton$", 12.011, 6., 1.3, 31.27, 999.);
448 AliMedium(5, "Kapton$", 5, 0,ifield,fieldm, 10., .01, .1, .003, .003);
450 //______________________________________________________________________
451 void AliITSvSSD03::InitAliITSgeom(){
459 const Int_t knlayers=1;
460 const TString kname="ALIC_1/ITSV_1/IGAR_1/IAIR_1/ITST_1";
461 const Int_t knlad[knlayers]={knlayers*1},kndet[knlayers]={knlayers*1};
464 Double_t trans[3]={3*0.0},rot[10]={10*0.0};
467 AliITSgeom* geom = new AliITSgeom(0,knlayers,knlad,kndet,1);
469 npar=3;par[0]=3.5;par[1]=0.5*300.0E-4;par[2]=2.0;
470 geom->ReSetShape(kSSD,new AliITSgeomSSD275and75(npar,par));
471 gMC->GetTransformation(kname.Data(),materix);
472 geom->CreateMatrix(0,1,1,1,kSSD,trans,rot);
473 geom->SetTrans(0,materix.GetTranslation());
474 geom->SetRotMatrix(0,materix.GetRotationMatrix());
475 geom->GetGeomMatrix(0)->SetPath(kname.Data());
478 //______________________________________________________________________
479 void AliITSvSSD03::Init(){
480 ////////////////////////////////////////////////////////////////////////
481 // Initialise the ITS after it has been created.
488 ////////////////////////////////////////////////////////////////////////
492 for(i=0;i<26;i++) cout << "*";
493 cout << " ITSvSSD03" << fMinorVersion << "_Init ";
494 for(i=0;i<25;i++) cout << "*";cout << endl;
496 if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60);
497 if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60);
498 if(GetITSgeom()!=0) SetITSgeom(0x0);
499 AliITSgeom* geom = new AliITSgeom();
501 if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead);
502 if(!fGeomDetIn) this->InitAliITSgeom();
503 if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite);
506 for(i=0;i<72;i++) cout << "*";
508 if(gMC) fIDMother = gMC->VolId("ITSV"); // ITS Mother Volume ID.
511 //______________________________________________________________________
512 void AliITSvSSD03::SetDefaults(){
513 // sets the default segmentation, rerponse, digit and raw cluster classes
520 const Float_t kconv = 1.0e+04; // convert cm to microns
522 Info("SetDefaults","Setting up only SSD detector");
524 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
525 fDetTypeSim->SetITSgeom(GetITSgeom());
527 fDetTypeSim->ResetCalibrationArray();
528 fDetTypeSim->ResetSegmentation();
532 // Get shape info. Do it this way for now.
533 s0 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);
534 AliITSCalibration *resp0=new AliITSCalibrationSSD("simulated");
535 SetCalibrationModel(GetITSgeom()->GetStartSSD(),resp0);
537 AliITSsegmentationSSD *seg0=new AliITSsegmentationSSD();
538 seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSSD
539 s0->GetDz()*2.*kconv, // for now.
540 s0->GetDy()*2.*kconv); // x,z,y full width in microns.
541 //seg0->SetNPads(256,160);// Number of Bins in x and z
543 SetSegmentationModel(kSSD,seg0);
545 // set digit and raw cluster classes to be used
546 const char *kData0=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSSD()))->DataType();
547 if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit");
548 else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
549 // SetSimulationModel(kSSD,new AliITSsimulationSSD(seg0,resp0));
550 // iDetType->ReconstructionModel(new AliITSClusterFinderSSD());
553 SetResponseModel(kSPD,new AliITSCalibrationSPD());
554 SetSegmentationModel(kSPD,new AliITSsegmentationSPD());
555 fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
557 SetResponseModel(kSDD,new AliITSCalibrationSDD());
558 SetSegmentationModel(kSDD,new AliITSsegmentationSDD());
559 fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD");
564 Warning("SetDefaults",
565 "Only the four basic detector types are initialised!");
569 //______________________________________________________________________
570 void AliITSvSSD03::SetDefaultSimulation(){
571 // sets the default simulation.
579 if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim();
581 AliITSsimulation *sim;
582 // AliITSsegmentation *seg;
583 // AliITSCalibration *res;
587 sim = fDetTypeSim->GetSimulationModel(kSPD);
589 seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD);
590 res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(nspd);
591 sim = new AliITSsimulationSPDdubna(seg,res,1);
592 SetSimulationModel(kSPD,sim);
593 }else{ // simulation exists, make sure it is set up properly.
594 sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD));
595 sim->SetResponseModel((AliITSCalibration*)fDetTypeSim->GetResponseModel(nspd));
596 ((AliITSsimulation*)sim)->Init();
597 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
598 // (AliITSCalibration*)iDetType->GetResponseModel());
599 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
600 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
602 } // end if !fDetTypeSim
606 sim = fDetTypeSim->GetSimulationModel(kSDD);
608 seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD);
609 res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(nsdd);
610 sim = new AliITSsimulationSDD(seg,res);
611 SetSimulationModel(kSDD,sim);
612 }else{ // simulation exists, make sure it is set up properly.
613 sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD));
614 sim->SetResponseModel((AliITSCalibration*)fDetTypeSim->GetResponseModel(nsdd));
616 ((AliITSsimulation*)sim)->Init();
617 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
618 // (AliITSCalibration*)iDetType->GetResponseModel());
619 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
620 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
622 } // end if !iDetType
626 sim = fDetTypeSim->GetSimulationModel(kSSD);
628 // seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD);
629 // res = (AliITSCalibration*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSSD());
630 sim = new AliITSsimulationSSD(fDetTypeSim);
631 SetSimulationModel(kSSD,sim);
632 }else{ // simulation exists, make sure it is set up properly.
633 sim->SetSegmentationModel(kSSD,(AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD));
634 sim->SetCalibrationModel(GetITSgeom()->GetStartSSD(),(AliITSCalibration*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSSD()));
635 ((AliITSsimulation*)sim)->Init();
636 // if(sim->GetResponseModel()==0) sim->SetResponseModel(
637 // (AliITSCalibration*)iDetType->GetResponseModel());
638 // if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
639 // (AliITSsegmentation*)iDetType->GetSegmentationModel());
641 } // end if !iDetType
644 //______________________________________________________________________
645 void AliITSvSSD03::DrawModule() const {
646 ////////////////////////////////////////////////////////////////////////
647 // Draw a shaded view of the ITS SSD test beam version 1.
654 ////////////////////////////////////////////////////////////////////////
656 gMC->Gsatt("*", "seen", -1);
657 gMC->Gsatt("ALIC","SEEN",0);
658 gMC->Gsatt("ITSV","SEEN",0);
659 gMC->Gsatt("ITSA","SEEN",1);
660 gMC->Gsatt("ITSS","SEEN",1);
661 gMC->Gsatt("IGAR","SEEN",1);
662 gMC->Gsatt("IAIR","SEEN",0);
663 gMC->Gsatt("ITST","SEEN",1);
664 gMC->Gsatt("IFRA","SEEN",1);
665 gMC->Gsatt("IFRS","SEEN",1);
667 //______________________________________________________________________
668 void AliITSvSSD03::StepManager(){
669 ////////////////////////////////////////////////////////////////////////
670 // Called for every step in the ITS SSD, then calles the
671 // AliITShit class creator with the information to be recoreded about
673 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
674 // printing of information to a file which can be used to create a .det
675 // file read in by the routine CreateGeometry(). If set to 0 or any other
676 // value except 1, the default behavior, then no such file is created nor
677 // it the extra variables and the like used in the printing allocated.
684 ////////////////////////////////////////////////////////////////////////
686 TLorentzVector position, momentum;
687 static TLorentzVector position0;
688 static Int_t stat0=0;
690 if((id=gMC->CurrentVolID(copy) == fIDMother)&&
691 (gMC->IsTrackEntering()||gMC->IsTrackExiting())){
692 copy = fTrackReferences->GetEntriesFast();
693 TClonesArray &lTR = *fTrackReferences;
694 // Fill TrackReference structure with this new TrackReference.
695 new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
696 } // if Outer ITS mother Volume
698 if(!(this->IsActive())){
700 } // end if !Active volume.
704 TClonesArray &lhits = *fHits;
709 if(gMC->IsTrackInside()) vol[3] += 1;
710 if(gMC->IsTrackEntering()) vol[3] += 2;
711 if(gMC->IsTrackExiting()) vol[3] += 4;
712 if(gMC->IsTrackOut()) vol[3] += 8;
713 if(gMC->IsTrackDisappeared()) vol[3] += 16;
714 if(gMC->IsTrackStop()) vol[3] += 32;
715 if(gMC->IsTrackAlive()) vol[3] += 64;
717 // Fill hit structure.
718 if(!(gMC->TrackCharge())) return;
719 id = gMC->CurrentVolID(copy);
720 if(id==fIdSens[0]){ // Volume name "ITST"
721 vol[2] = vol[1] = vol[0] = 1; // Det, ladder
722 } else return; // end if
724 gMC->TrackPosition(position);
725 gMC->TrackMomentum(momentum);
727 if(gMC->IsTrackEntering()){
728 position0 = position;
731 } // end if IsEntering
733 // Fill hit structure with this new hit only for non-entrerance hits.
734 else new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,
735 gMC->Edep(),gMC->TrackTime(),position,
737 //cout<<gMC->Edep()<<endl;
739 position0 = position;