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 **************************************************************************/
20 #include <TParticle.h>
22 #include "AliGeant3.h"
25 #include "AliCallf77.h"
29 # define rxgtrak rxgtrak_
30 # define rxstrak rxstrak_
31 # define rxkeep rxkeep_
32 # define rxouth rxouth_
35 # define rxgtrak RXGTRAK
36 # define rxstrak RXSTRAK
37 # define rxkeep RXKEEP
38 # define rxouth RXOUTH
43 AliGeant3::AliGeant3()
48 AliGeant3::AliGeant3(const char *title) :
49 AliVMC("ALICE Virtual MC for Geant3",title)
54 void AliGeant3::FinishGeometry()
56 gMC->FinishGeometry();
57 //Create the color table
61 void AliGeant3::BuildPhysics()
63 ((TGeant3*)gMC)->Gphysi();
66 void AliGeant3::ProcessEvent()
68 ((TGeant3*)gMC)->Gtrigi();
69 ((TGeant3*)gMC)->Gtrigc();
70 ((TGeant3*)gMC)->Gtrig();
73 //_____________________________________________________________________________
75 // Interfaces to Fortran
77 //_____________________________________________________________________________
79 extern "C" void type_of_call rxgtrak (Int_t &mtrack, Int_t &ipart, Float_t *pmom,
80 Float_t &e, Float_t *vpos, Float_t *polar,
84 // Fetches next track from the ROOT stack for transport. Called by the
85 // modified version of GTREVE.
87 // Track number in the ROOT stack. If MTRACK=0 no
88 // mtrack more tracks are left in the stack to be
90 // ipart Particle code in the GEANT conventions.
91 // pmom[3] Particle momentum in GeV/c
92 // e Particle energy in GeV
93 // vpos[3] Particle position
94 // tof Particle time of flight in seconds
97 gAlice->GetNextTrack(mtrack, pdg, pmom, e, vpos, polar, tof);
98 ipart = gMC->IdFromPDG(pdg);
102 //_____________________________________________________________________________
103 extern "C" void type_of_call
105 rxstrak (Int_t &keep, Int_t &parent, Int_t &ipart, Float_t *pmom,
106 Float_t *vpos, Float_t &tof, const char* cmech, Int_t &ntr, const int cmlen)
108 rxstrak (Int_t &keep, Int_t &parent, Int_t &ipart, Float_t *pmom,
109 Float_t *vpos, Float_t &tof, const char* cmech, const int cmlen,
114 // Fetches next track from the ROOT stack for transport. Called by GUKINE
117 // Status of the track. If keep=0 the track is put
118 // keep on the ROOT stack but it is not fetched for
120 // parent Parent track. If parent=0 the track is a primary.
121 // In GUSTEP the routine is normally called to store
122 // secondaries generated by the current track whose
123 // ROOT stack number is MTRACK (common SCKINE.
124 // ipart Particle code in the GEANT conventions.
125 // pmom[3] Particle momentum in GeV/c
126 // vpos[3] Particle position
127 // tof Particle time of flight in seconds
129 // cmech (CHARACTER*10) Particle origin. This field is user
130 // defined and it is not used inside the GALICE code.
131 // ntr Number assigned to the particle in the ROOT stack.
134 Float_t polar[3]={0.,0.,0.};
135 for(int i=0; i<10 && i<cmlen; i++) mecha[i]=cmech[i];
137 Int_t pdg=gMC->PDGFromId(ipart);
138 gAlice->SetTrack(keep, parent-1, pdg, pmom, vpos, polar, tof, mecha, ntr);
142 //_____________________________________________________________________________
143 extern "C" void type_of_call rxkeep(const Int_t &n)
145 if( NULL==gAlice ) exit(1);
147 if( n<=0 || n>gAlice->Particles()->GetEntries() )
149 printf(" Bad index n=%d must be 0<n<=%d\n",
150 n,gAlice->Particles()->GetEntries());
154 ((TParticle*)(gAlice->Particles()->UncheckedAt(n-1)))->SetBit(Keep_Bit);
157 //_____________________________________________________________________________
158 extern "C" void type_of_call rxouth ()
161 // Called by Gtreve at the end of each primary track
163 gAlice->FinishPrimary();