]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TGeant3/TGeant3.cxx
Updated version of the PPR detailed geometry with symmetric services. Of course,...
[u/mrichter/AliRoot.git] / TGeant3 / TGeant3.cxx
index ae6d0e27d4d04c35ecfba665656278f750c632c8..19d78a03f6ed9fa6b01a1b7546bc2c39b7109c61 100644 (file)
 
 /*
 $Log$
+Revision 1.45  2000/12/21 16:49:56  morsch
+Adding particles to the PDG database delegated to AliPDG.
+
+$Log$
+Revision 1.44  2000/12/20 09:46:51  alibrary
+dlsym not supported on HP, reverting to gcomad
+
+Revision 1.43  2000/12/20 08:39:39  fca
+Support for Cerenkov and process list in Virtual MC
+
+Revision 1.42  2000/12/19 08:37:48  alibrary
+Using dlsym to retrieve address of commons
+
+Revision 1.41  2000/12/18 11:33:50  alibrary
+New call frequence histograms per module and volume
+
+Revision 1.40  2000/12/06 10:06:58  morsch
+Add all D and B baryons produced by HIJING to PDG DataBase.
+
+Revision 1.39  2000/11/30 07:12:54  alibrary
+Introducing new Rndm and QA classes
+
+Revision 1.38  2000/10/30 15:19:06  morsch
+Xi(b) (pdg code 5232) added to Pdg data base.
+
+Revision 1.37  2000/10/02 21:28:16  fca
+Removal of useless dependecies via forward declarations
+
+Revision 1.36  2000/09/14 07:08:41  fca
+Introducing glvolu in the interface
+
+Revision 1.35  2000/09/12 14:27:10  morsch
+No instance of AliDecayer created to initialize fDecayer.
+
+Revision 1.34  2000/09/07 12:12:01  morsch
+Comment inside comment removed.
+
+Revision 1.33  2000/09/06 16:03:42  morsch
+Set ExternalDecayer, Decayer  and SetForceDecay methods added.
+Gspart calls for charmed and bottom hadrons added.
+Decay mode definitions for charmed and beauty hadrons have been taken out.
+They will be  handled by an external decayer.
+
+Revision 1.32  2000/08/24 16:28:53  hristov
+TGeant3::IsNewTrack corrected by F.Carminati
+
 Revision 1.31  2000/07/13 16:19:10  fca
 Mainly coding conventions + some small bug fixes
 
@@ -87,13 +133,20 @@ Introduction of the Copyright and cvs Log
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-#include "TGeant3.h" 
+#include "ctype.h" 
+
 #include "TROOT.h" 
+#include "TDatabasePDG.h"
+#include "TLorentzVector.h"
+#include "TArrayI.h"
+
 #include "THIGZ.h" 
-#include "ctype.h" 
-#include <TDatabasePDG.h>
+#include "TGeant3.h" 
+
 #include "AliCallf77.h" 
+#include "AliDecayer.h" 
+#include "AliPDG.h" 
+
 #ifndef WIN32 
 # define gzebra  gzebra_ 
 # define grfile  grfile_ 
@@ -179,6 +232,7 @@ Introduction of the Copyright and cvs Log
 # define gfpara  gfpara_
 # define gckpar  gckpar_
 # define gckmat  gckmat_
+# define glvolu  glvolu_
 # define geditv  geditv_
 # define mzdrop  mzdrop_
 
@@ -277,6 +331,7 @@ Introduction of the Copyright and cvs Log
 # define gfpara  GFPARA
 # define gckpar  GCKPAR
 # define gckmat  GCKMAT
+# define glvolu  GLVOLU
 # define geditv  GEDITV
 # define mzdrop  MZDROP 
 
@@ -362,10 +417,12 @@ extern "C"
 
   void type_of_call gtreveroot(); 
 
-  void type_of_call grndm(Float_t *, const Int_t &); 
+  void type_of_call grndm(Float_t *r, const Int_t &n)
+  {gMC->Rndm(r,n);}
 
   void type_of_call grndmq(Int_t &, Int_t &, const Int_t &,
-                          DEFCHARD DEFCHARL); 
+                          DEFCHARD DEFCHARL)
+  {/*printf("Dummy grndmq called\n");*/}
 
   void type_of_call gdtom(Float_t *, Float_t *, Int_t &); 
 
@@ -459,6 +516,8 @@ extern "C"
 
   void type_of_call gckmat(Int_t&, DEFCHARD DEFCHARL);
 
+  void type_of_call glvolu(Int_t&, Int_t*, Int_t*, Int_t&);
+
   void type_of_call gprint(DEFCHARD,const int& DEFCHARL); 
 
   void type_of_call gdinit(); 
@@ -501,7 +560,7 @@ extern "C"
   void type_of_call setbomb(Float_t &);
   void type_of_call setclip(DEFCHARD, Float_t &,Float_t &,Float_t &,Float_t &,
                            Float_t &, Float_t & DEFCHARL); 
-  void type_of_call gcomad(DEFCHARD, Int_t*& DEFCHARL); 
+  void type_of_call gcomad(DEFCHARD, Int_t*& DEFCHARL);
 
   void type_of_call ertrak(const Float_t *const x1, const Float_t *const p1,
                           const Float_t *x2, const Float_t *p2,
@@ -549,6 +608,7 @@ TGeant3::TGeant3(const char *title, Int_t nwgeant)
   //
   // Zero number of particles
   fNPDGCodes=0;
+  fDecayer=0;
 } 
 
 //____________________________________________________________________________ 
@@ -598,42 +658,42 @@ void TGeant3::LoadAddress()
   // Assigns the address of the GEANT common blocks to the structures
   // that allow their access from C++
   //
-  Int_t *addr;
-  gcomad(PASSCHARD("QUEST"), (int*&) fQuest PASSCHARL("QUEST"));
-  gcomad(PASSCHARD("GCBANK"),(int*&) fGcbank  PASSCHARL("GCBANK"));
-  gcomad(PASSCHARD("GCLINK"),(int*&) fGclink  PASSCHARL("GCLINK"));
-  gcomad(PASSCHARD("GCCUTS"),(int*&) fGccuts  PASSCHARL("GCCUTS"));
-  gcomad(PASSCHARD("GCMULO"),(int*&) fGcmulo  PASSCHARL("GCMULO"));
-  gcomad(PASSCHARD("GCFLAG"),(int*&) fGcflag  PASSCHARL("GCFLAG"));
-  gcomad(PASSCHARD("GCKINE"),(int*&) fGckine  PASSCHARL("GCKINE"));
-  gcomad(PASSCHARD("GCKING"),(int*&) fGcking  PASSCHARL("GCKING"));
-  gcomad(PASSCHARD("GCKIN2"),(int*&) fGckin2  PASSCHARL("GCKIN2"));
-  gcomad(PASSCHARD("GCKIN3"),(int*&) fGckin3  PASSCHARL("GCKIN3"));
-  gcomad(PASSCHARD("GCMATE"),(int*&) fGcmate  PASSCHARL("GCMATE"));
-  gcomad(PASSCHARD("GCTMED"),(int*&) fGctmed  PASSCHARL("GCTMED"));
-  gcomad(PASSCHARD("GCTRAK"),(int*&) fGctrak  PASSCHARL("GCTRAK"));
-  gcomad(PASSCHARD("GCTPOL"),(int*&) fGctpol  PASSCHARL("GCTPOL"));
-  gcomad(PASSCHARD("GCVOLU"),(int*&) fGcvolu  PASSCHARL("GCVOLU"));
-  gcomad(PASSCHARD("GCNUM"), (int*&) fGcnum   PASSCHARL("GCNUM"));
-  gcomad(PASSCHARD("GCSETS"),(int*&) fGcsets  PASSCHARL("GCSETS"));
-  gcomad(PASSCHARD("GCPHYS"),(int*&) fGcphys  PASSCHARL("GCPHYS"));
-  gcomad(PASSCHARD("GCPHLT"),(int*&) fGcphlt  PASSCHARL("GCPHLT"));
-  gcomad(PASSCHARD("GCOPTI"),(int*&) fGcopti  PASSCHARL("GCOPTI"));
-  gcomad(PASSCHARD("GCTLIT"),(int*&) fGctlit  PASSCHARL("GCTLIT"));
-  gcomad(PASSCHARD("GCVDMA"),(int*&) fGcvdma  PASSCHARL("GCVDMA"));
-
-  // Commons for GEANE
-  gcomad(PASSCHARD("ERTRIO"),(int*&) fErtrio  PASSCHARL("ERTRIO"));
-  gcomad(PASSCHARD("EROPTS"),(int*&) fEropts  PASSCHARL("EROPTS"));
-  gcomad(PASSCHARD("EROPTC"),(int*&) fEroptc  PASSCHARL("EROPTC"));
-  gcomad(PASSCHARD("ERWORK"),(int*&) fErwork  PASSCHARL("ERWORK"));
-
-  // Variables for ZEBRA store
-  gcomad(PASSCHARD("IQ"), addr  PASSCHARL("IQ"));
-  fZiq = addr;
-  gcomad(PASSCHARD("LQ"), addr  PASSCHARL("LQ"));
-  fZlq = addr;
-  fZq       = (float*)fZiq; 
+   Int_t *addr;
+   gcomad(PASSCHARD("QUEST"), (int*&) fQuest PASSCHARL("QUEST"));
+   gcomad(PASSCHARD("GCBANK"),(int*&) fGcbank  PASSCHARL("GCBANK"));
+   gcomad(PASSCHARD("GCLINK"),(int*&) fGclink  PASSCHARL("GCLINK"));
+   gcomad(PASSCHARD("GCCUTS"),(int*&) fGccuts  PASSCHARL("GCCUTS"));
+   gcomad(PASSCHARD("GCMULO"),(int*&) fGcmulo  PASSCHARL("GCMULO"));
+   gcomad(PASSCHARD("GCFLAG"),(int*&) fGcflag  PASSCHARL("GCFLAG"));
+   gcomad(PASSCHARD("GCKINE"),(int*&) fGckine  PASSCHARL("GCKINE"));
+   gcomad(PASSCHARD("GCKING"),(int*&) fGcking  PASSCHARL("GCKING"));
+   gcomad(PASSCHARD("GCKIN2"),(int*&) fGckin2  PASSCHARL("GCKIN2"));
+   gcomad(PASSCHARD("GCKIN3"),(int*&) fGckin3  PASSCHARL("GCKIN3"));
+   gcomad(PASSCHARD("GCMATE"),(int*&) fGcmate  PASSCHARL("GCMATE"));
+   gcomad(PASSCHARD("GCTMED"),(int*&) fGctmed  PASSCHARL("GCTMED"));
+   gcomad(PASSCHARD("GCTRAK"),(int*&) fGctrak  PASSCHARL("GCTRAK"));
+   gcomad(PASSCHARD("GCTPOL"),(int*&) fGctpol  PASSCHARL("GCTPOL"));
+   gcomad(PASSCHARD("GCVOLU"),(int*&) fGcvolu  PASSCHARL("GCVOLU"));
+   gcomad(PASSCHARD("GCNUM"), (int*&) fGcnum   PASSCHARL("GCNUM"));
+   gcomad(PASSCHARD("GCSETS"),(int*&) fGcsets  PASSCHARL("GCSETS"));
+   gcomad(PASSCHARD("GCPHYS"),(int*&) fGcphys  PASSCHARL("GCPHYS"));
+   gcomad(PASSCHARD("GCPHLT"),(int*&) fGcphlt  PASSCHARL("GCPHLT"));
+   gcomad(PASSCHARD("GCOPTI"),(int*&) fGcopti  PASSCHARL("GCOPTI"));
+   gcomad(PASSCHARD("GCTLIT"),(int*&) fGctlit  PASSCHARL("GCTLIT"));
+   gcomad(PASSCHARD("GCVDMA"),(int*&) fGcvdma  PASSCHARL("GCVDMA"));
+   
+   // Commons for GEANE
+   gcomad(PASSCHARD("ERTRIO"),(int*&) fErtrio  PASSCHARL("ERTRIO"));
+   gcomad(PASSCHARD("EROPTS"),(int*&) fEropts  PASSCHARL("EROPTS"));
+   gcomad(PASSCHARD("EROPTC"),(int*&) fEroptc  PASSCHARL("EROPTC"));
+   gcomad(PASSCHARD("ERWORK"),(int*&) fErwork  PASSCHARL("ERWORK"));
+
+   // Variables for ZEBRA store
+   gcomad(PASSCHARD("IQ"), addr  PASSCHARL("IQ"));
+   fZiq = addr;
+   gcomad(PASSCHARD("LQ"), addr  PASSCHARL("LQ"));
+   fZlq = addr;
+   fZq       = (float*)fZiq; 
 } 
 
 //_____________________________________________________________________________
@@ -855,10 +915,10 @@ void TGeant3::DefineParticles()
   fPDGCode[fNPDGCodes++]=213;   // 42 = RHO+
 
   Gspart(43, "RHO -", 4, 0.768, -1., 4.353e-24);
-  fPDGCode[fNPDGCodes++]=-213;   // 40 = RHO-
+  fPDGCode[fNPDGCodes++]=-213;   // 43 = RHO-
 
   Gspart(44, "RHO 0", 3, 0.768, 0., 4.353e-24);
-  fPDGCode[fNPDGCodes++]=113;   // 37 = D0
+  fPDGCode[fNPDGCodes++]=113;   //  44 = RHO0
 
   //
   // Use ENDF-6 mapping for ions = 10000*z+10*a+iso
@@ -870,106 +930,80 @@ void TGeant3::DefineParticles()
 
   const Int_t kspe=50000000;
 
-  TDatabasePDG *pdgDB = TDatabasePDG::Instance();
-
-  const Double_t kAu2Gev=0.9314943228;
-  const Double_t khSlash = 1.0545726663e-27;
-  const Double_t kErg2Gev = 1/1.6021773349e-3;
-  const Double_t khShGev = khSlash*kErg2Gev;
-  const Double_t kYear2Sec = 3600*24*365.25;
 //
-// Bottom mesons
-// mass and life-time from PDG
-  pdgDB->AddParticle("B(s)*0","B(s)*0",
-                    5.4163, kTRUE, 0.047, +0.,"Meson",  533);
-
-  pdgDB->AddParticle("B(s)*0 bar","B(s)*0 bar",
-                    5.4163, kTRUE, 0.047, -0.,"Meson", -533);
-
-// Charmed baryons
-// 
-// value for mass used by Hijing
-  pdgDB->AddParticle("Sigma(c)*+","Sigma(c)*+",
-                    2.4536, kTRUE, -1., +1.,"Baryon",  4214);
-
-  pdgDB->AddParticle("Sigma(c)*-","Sigma(c)*-",
-                    2.4536, kTRUE, -1., -1.,"Baryon", -4214);
-// equivalent to 4312 ? Hijing uses m=2.55
-  pdgDB->AddParticle("Xsi(c)0","Xsi(c)0",
-                    2.4703, kTRUE, -1., +0.,"Baryon",  4132);
-
-  pdgDB->AddParticle("Xsi(c)0 bar","Xsi(c)0 bar",
-                    2.4703, kTRUE, -1., -0.,"Baryon", -4132);
-// equivalent to 4322 ? Hijing uses m=2.55
-  pdgDB->AddParticle("Xi(c)+","Xi(c)+",
-                    2.4656, kFALSE, -1., +1.,"Baryon",  4232);
-  
-  pdgDB->AddParticle("Xi(c)-","Xi(c)-",
-                    2.4656, kFALSE, -1., -1.,"Baryon", -4232);
-// mass values from Hijing
+// Ions 
 
-  pdgDB->AddParticle("Xsi(c)*0","Xsi(c)*0",
-                    2.63, kTRUE, -1., +0.,"Baryon",  4314);
+  fPDGCode[fNPDGCodes++]=kion+10020;   // 45 = Deuteron
 
-  pdgDB->AddParticle("Xsi(c)*0 bar","Xsi(c)*0 bar",
-                    2.63, kTRUE, -1., -0.,"Baryon", -4314);
+  fPDGCode[fNPDGCodes++]=kion+10030;   // 46 = Triton
 
-  pdgDB->AddParticle("Xsi(c)*+","Xsi(c)*+",
-                    2.63, kTRUE, -1., +1.,"Baryon",  4324);
+  fPDGCode[fNPDGCodes++]=kion+20040;   // 47 = Alpha
 
-  pdgDB->AddParticle("Xsi(c)*-","Xsi(c)*-",
-                    2.63, kTRUE, -1., -1.,"Baryon", -4324);
+  fPDGCode[fNPDGCodes++]=0;            // 48 = geantino mapped to rootino
 
-// pdg mass value, Hijing uses m=2.73.
-  pdgDB->AddParticle("Omega(c)0","Omega(c)0",
-                    2.7040, kFALSE, khShGev/0.064e-12, +0.,"Baryon",  4332);
-  
-  pdgDB->AddParticle("Omega(c)0 bar","Omega(c)0 bar",
-                    2.7040, kFALSE, khShGev/0.064e-12, -0.,"Baryon", -4332);
-// mass value from Hijing
-  pdgDB->AddParticle("Omega(c)*0","Omega(c)*0",
-                    2.8000, kFALSE, -1., +0.,"Baryon",  4334);
-  
-  pdgDB->AddParticle("Omega(c)*0 bar","Omega(c)*0",
-                    2.8000, kFALSE, -1., -0.,"Baryon", -4334);
+  fPDGCode[fNPDGCodes++]=kion+20030;   // 49 = HE3
 
-// Bottom baryons
+  fPDGCode[fNPDGCodes++]=kspe+50;      // 50 = Cherenkov
+// special 
+  Gspart(51, "FeedbackPhoton", 7, 0., 0.,1.e20 );
+  fPDGCode[fNPDGCodes++]=kspe+51;      // 51 = FeedbackPhoton
 //
-// mass value from Hijing
-  pdgDB->AddParticle("Sigma(b)*+","Sigma(b)*+",
-                    5.8100, kFALSE, -1., +1.,"Baryon", 5224);
+  Gspart(52, "Lambda_c+", 4, 2.2849, +1., 2.06e-13);
+  fPDGCode[fNPDGCodes++]=4122;         //52 = Lambda_c+
 
-  pdgDB->AddParticle("Sigma(b)*-","Sigma(b)*-",
-                    5.8100, kFALSE, -1., -1.,"Baryon", -5224);
-//
-//
-  pdgDB->AddParticle("Deuteron","Deuteron",2*kAu2Gev+8.071e-3,kTRUE,
-                    0,1,"Ion",kion+10020);
-  fPDGCode[fNPDGCodes++]=kion+10020;   // 45 = Deuteron
+  Gspart(53, "Lambda_c-", 4, 2.2849, -1., 2.06e-13);
+  fPDGCode[fNPDGCodes++]=-4122;        //53 = Lambda_c-  
 
-  pdgDB->AddParticle("Triton","Triton",3*kAu2Gev+14.931e-3,kFALSE,
-                    khShGev/(12.33*kYear2Sec),1,"Ion",kion+10030);
-  fPDGCode[fNPDGCodes++]=kion+10030;   // 46 = Triton
+  Gspart(54, "D_s+", 4, 1.9685, +1., 4.67e-13);
+  fPDGCode[fNPDGCodes++]=431;          //54 = D_s+
 
-  pdgDB->AddParticle("Alpha","Alpha",4*kAu2Gev+2.424e-3,kTRUE,
-                    khShGev/(12.33*kYear2Sec),2,"Ion",kion+20040);
-  fPDGCode[fNPDGCodes++]=kion+20040;   // 47 = Alpha
+  Gspart(55, "D_s-", 4, 1.9685, -1., 4.67e-13);
+  fPDGCode[fNPDGCodes++]=-431;         //55 = D_s-
 
-  fPDGCode[fNPDGCodes++]=0;   // 48 = geantino mapped to rootino
+  Gspart(56, "Tau+", 5, 1.77705, +1., 2.9e-13);
+  fPDGCode[fNPDGCodes++]=15;           //56 = Tau+
 
-  pdgDB->AddParticle("HE3","HE3",3*kAu2Gev+14.931e-3,kFALSE,
-                    0,2,"Ion",kion+20030);
-  fPDGCode[fNPDGCodes++]=kion+20030;   // 49 = HE3
+  Gspart(57, "Tau-", 5, 1.77705, -1., 2.9e-13);
+  fPDGCode[fNPDGCodes++]=-15;          //57 = Tau-  
 
-  pdgDB->AddParticle("Cherenkov","Cherenkov",0,kFALSE,
-                    0,0,"Special",kspe+50);
-  fPDGCode[fNPDGCodes++]=kspe+50;   // 50 = Cherenkov
+  Gspart(58, "B0",     3, 5.2792, +0., 1.56e-12);
+  fPDGCode[fNPDGCodes++]=511;          //58 = B0
 
-  Gspart(51, "FeedbackPhoton", 7, 0., 0.,1.e20 );
-  pdgDB->AddParticle("FeedbackPhoton","FeedbackPhoton",0,kFALSE,
-                    0,0,"Special",kspe+51);
-  fPDGCode[fNPDGCodes++]=kspe+51;   // 51 = FeedbackPhoton
+  Gspart(59, "B0 bar", 3, 5.2792, -0., 1.56e-12);
+  fPDGCode[fNPDGCodes++]=-511;         //58 = B0bar
+
+  Gspart(60, "B+",     4, 5.2789, +1., 1.65e-12);
+  fPDGCode[fNPDGCodes++]=521;          //60 = B+
+
+  Gspart(61, "B-",     4, 5.2789, -1., 1.65e-12);
+  fPDGCode[fNPDGCodes++]=-521;         //61 = B-
+
+  Gspart(62, "Bs",     3, 5.3693, +0., 1.54e-12);
+  fPDGCode[fNPDGCodes++]=521;          //62 = B_s
+
+  Gspart(63, "Bs bar", 3, 5.3693, -0., 1.54e-12);
+  fPDGCode[fNPDGCodes++]=-521;         //63 = B_s bar
+
+  Gspart(64, "Lambda_b",     3, 5.624, +0., 1.24e-12);
+  fPDGCode[fNPDGCodes++]=5122;         //64 = Lambda_b
+
+  Gspart(65, "Lambda_b bar", 3, 5.624, -0., 1.24e-12);
+  fPDGCode[fNPDGCodes++]=-5122;        //65 = Lambda_b bar
+
+  Gspart(66, "J/Psi", 3.09688, 3, 0., 0.);
+  fPDGCode[fNPDGCodes++]=443;          // 66 = J/Psi
+
+  Gspart(67, "Psi Prime", 3, 3.686, 0., 0.);
+  fPDGCode[fNPDGCodes++]=20443;        // 67 = Psi prime
+
+  Gspart(68, "Upsilon(1S)", 9.46037, 3, 0., 0.);
+  fPDGCode[fNPDGCodes++]=553;          // 68 = Upsilon(1S)
+
+  Gspart(69, "Upsilon(2S)", 10.0233, 3, 0., 0.);
+  fPDGCode[fNPDGCodes++]=20553;        // 69 = Upsilon(2S)
+
+  Gspart(70, "Upsilon(3S)", 10.3553, 3, 0., 0.);
+  fPDGCode[fNPDGCodes++]=30553;        // 70 = Upsilon(3S)
 
 /* --- Define additional decay modes --- */
 /* --- omega(783) --- */
@@ -1003,6 +1037,7 @@ void TGeant3::DefineParticles()
     mode[4] = 1701;
     Gsdk(ipa, bratio, mode);
 /* --- D+ --- */
+    /*
     for (kz = 0; kz < 6; ++kz) {
        bratio[kz] = 0.;
        mode[kz] = 0;
@@ -1017,7 +1052,9 @@ void TGeant3::DefineParticles()
     mode[2] = 111208;
     mode[3] = 110809;
     Gsdk(ipa, bratio, mode);
+    */
 /* --- D- --- */
+    /*
     for (kz = 0; kz < 6; ++kz) {
        bratio[kz] = 0.;
        mode[kz] = 0;
@@ -1032,7 +1069,9 @@ void TGeant3::DefineParticles()
     mode[2] = 121109;
     mode[3] = 120908;
     Gsdk(ipa, bratio, mode);
+    */
 /* --- D0 --- */
+    /*
     for (kz = 0; kz < 6; ++kz) {
        bratio[kz] = 0.;
        mode[kz] = 0;
@@ -1045,7 +1084,9 @@ void TGeant3::DefineParticles()
     mode[1] = 1208;
     mode[2] = 1112;
     Gsdk(ipa, bratio, mode);
+    */
 /* --- Anti D0 --- */
+    /*
     for (kz = 0; kz < 6; ++kz) {
        bratio[kz] = 0.;
        mode[kz] = 0;
@@ -1058,6 +1099,7 @@ void TGeant3::DefineParticles()
     mode[1] = 1109;
     mode[2] = 1112;
     Gsdk(ipa, bratio, mode);
+    */
 /* --- rho+ --- */
     for (kz = 0; kz < 6; ++kz) {
        bratio[kz] = 0.;
@@ -1104,7 +1146,8 @@ void TGeant3::DefineParticles()
     ipa = 115;
     Gsdk(ipa, bratio, mode);
     */
-
+//
+    AliPDG::AddParticlesToPdgDataBase();
 }
 
 //_____________________________________________________________________________
@@ -1130,6 +1173,20 @@ Int_t TGeant3::NofVolumes() const
   return fGcnum->nvolum;
 }
 
+//_____________________________________________________________________________
+Int_t TGeant3::VolId2Mate(Int_t id) const 
+{
+  //
+  // Return material number for a given volume id
+  //
+  if(id<1 || id > fGcnum->nvolum || fGclink->jvolum<=0) 
+    return 0;
+  else {
+    Int_t jvo = fZlq[fGclink->jvolum-id];
+    return Int_t(fZq[jvo+4]);
+  }
+}
+
 //_____________________________________________________________________________
 const char* TGeant3::VolName(Int_t id) const
 {
@@ -1382,36 +1439,72 @@ Int_t   TGeant3::CurrentEvent() const
 }
 
 //_____________________________________________________________________________
-const char* TGeant3::ProdProcess() const
+AliMCProcess TGeant3::ProdProcess(Int_t ) const
 {
   //
   // Name of the process that has produced the secondary particles
   // in the current step
   //
-  static char proc[5];
-  const Int_t kIpMec[13] = { 5,6,7,8,9,10,11,12,21,23,25,105,108 };
-  Int_t mec, km, im;
-  //
-  if(fGcking->ngkine>0) {
-    for (km = 0; km < fGctrak->nmec; ++km) {
-      for (im = 0; im < 13; ++im) {
-       if (fGctrak->lmec[km] == kIpMec[im]) {
-         mec = fGctrak->lmec[km];
-         if (0 < mec && mec < 31) {
-           strncpy(proc,(char *)&fGctrak->namec[mec - 1],4);
-         } else if (mec - 100 <= 30 && mec - 100 > 0) {
-           strncpy(proc,(char *)&fGctpol->namec1[mec - 101],4);
-         }
-         proc[4]='\0';
-         return proc;
-       }
-      }
-    }
-    strcpy(proc,"UNKN");
-  } else strcpy(proc,"NONE");
+  const AliMCProcess kIpProc[13] = { kPDecay, kPPair, kPCompton, 
+                             kPPhotoelectric, kPBrem, kPDeltaRay,
+                             kPAnnihilation, kPHadronic, 
+                             kPMuonNuclear, kPPhotoFission,
+                             kPRayleigh, kPCerenkov, kPSynchrotron};
+  Int_t km, im;
+  //
+  if(fGcking->ngkine>0) 
+    for (km = 0; km < fGctrak->nmec; ++km) 
+      for (im = 0; im < 13; ++im) 
+       if (G3toVMC(fGctrak->lmec[km]) == kIpProc[im]) 
+           return kIpProc[im];
+  //  
+  return kPNoProcess;
+}
+
+//_____________________________________________________________________________
+Int_t TGeant3::StepProcesses(TArrayI &proc) const
+{
+  //
+  // Return processes active in the current step
+  //
+  Int_t i;
+  Int_t nproc=Gctrak()->nmec;
+  //
+  proc.Set(nproc);
+  Int_t nvproc=0;
+  //
+  for (i=0; i<nproc; ++i) 
+    if((proc[nvproc]=G3toVMC(Gctrak()->lmec[i]))!=kPNoProcess) nvproc++;
+  //
+  proc.Set(nvproc);
+  //
+  return nvproc;
+}
+
+//_____________________________________________________________________________
+AliMCProcess TGeant3::G3toVMC(Int_t iproc) const
+{
+  //
+  // Conversion between GEANT and AliMC processes
+  //
+  
+  const AliMCProcess kPG2MC1[30] = {kPNoProcess, kPMultipleScattering, kPEnergyLoss, kPMagneticFieldL, kPDecay, 
+                            kPPair, kPCompton, kPPhotoelectric, kPBrem, kPDeltaRay,
+                            kPAnnihilation, kPHadronic, kPNoProcess, kPEvaporation, kPNuclearFission, 
+                            kPNuclearAbsorption, kPPbarAnnihilation, kPNCapture, kPHElastic, kPHInhelastic,
+                            kPMuonNuclear, kPTOFlimit, kPPhotoFission, kPNoProcess, kPRayleigh,
+                            kPNoProcess, kPNoProcess, kPNoProcess, kPNull, kPStop};
+  
+  const AliMCProcess kPG2MC2[9] = {kPLightAbsorption, kPLightScattering, kStepMax, kPNoProcess, kPCerenkov,
+                           kPLightReflection, kPLightRefraction, kPSynchrotron, kPNoProcess};
+
+  AliMCProcess proc=kPNoProcess;
+  if(1<iproc && iproc<=30) proc= kPG2MC1[iproc-1];
+  else if(101<=iproc && iproc<=109) proc= kPG2MC2[iproc-100-1];
   return proc;
 }
 
+
 //_____________________________________________________________________________
 void    TGeant3::GetSecondary(Int_t isec, Int_t& ipart, 
                              TLorentzVector &x, TLorentzVector &p)
@@ -1690,16 +1783,6 @@ Float_t TGeant3::Etot() const
   return fGctrak->getot;
 }
 
-//_____________________________________________________________________________
-void TGeant3::Rndm(Float_t* r, const Int_t n) const
-{
-  //
-  // Return an array of n random numbers uniformly distributed 
-  // between 0 and 1 not included
-  //
-  Grndm(r,n);
-}
-
 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
 //
 //                        Functions from GBASE
@@ -1813,7 +1896,7 @@ void  TGeant3::Gtrig()
 { 
   //
   // Steering function to process one event
-  //
+  //  
   gtrig(); 
 } 
  
@@ -2053,7 +2136,29 @@ void  TGeant3::Gstmed(Int_t numed, const char *name, Int_t nmat, Int_t isvol,
  
 //_____________________________________________________________________________
 void  TGeant3::Gsckov(Int_t itmed, Int_t npckov, Float_t *ppckov,
-                     Float_t *absco, Float_t *effic, Float_t *rindex)
+                          Float_t *absco, Float_t *effic, Float_t *rindex)
+{ 
+  //
+  //    Stores the tables for UV photon tracking in medium ITMED 
+  //    Please note that it is the user's responsability to 
+  //    provide all the coefficients:
+  //
+  //
+  //       ITMED       Tracking medium number
+  //       NPCKOV      Number of bins of each table
+  //       PPCKOV      Value of photon momentum (in GeV)
+  //       ABSCO       Absorbtion coefficients 
+  //                   dielectric: absorbtion length in cm
+  //                   metals    : absorbtion fraction (0<=x<=1)
+  //       EFFIC       Detection efficiency for UV photons 
+  //       RINDEX      Refraction index (if=0 metal)
+  //
+  gsckov(itmed,npckov,ppckov,absco,effic,rindex);
+}
+
+//_____________________________________________________________________________
+void  TGeant3::SetCerenkov(Int_t itmed, Int_t npckov, Float_t *ppckov,
+                          Float_t *absco, Float_t *effic, Float_t *rindex)
 { 
   //
   //    Stores the tables for UV photon tracking in medium ITMED 
@@ -2318,17 +2423,17 @@ void  TGeant3::Grndm(Float_t *rvec, const Int_t len) const
   //
   //   To generate a vector RVECV of LEN random numbers 
   //   Copy of the CERN Library routine RANECU 
-  grndm(rvec,len);
+  Rndm(rvec,len);
 }
 
 //_____________________________________________________________________________
-void  TGeant3::Grndmq(Int_t &is1, Int_t &is2, const Int_t iseq,
-                     const Text_t *chopt)
+void  TGeant3::Grndmq(Int_t &/*is1*/, Int_t &/*is2*/, const Int_t /*iseq*/,
+                     const Text_t */*chopt*/)
 {
   //
   //  To set/retrieve the seed of the random number generator
   //
-  grndmq(is1,is2,iseq,PASSCHARD(chopt) PASSCHARL(chopt));
+  /*printf("Dummy grndmq called\n");*/
 }
 
 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
@@ -2582,6 +2687,7 @@ void  TGeant3::Gspos(const char *name, Int_t nr, const char *mother, Float_t x,
   //
   //  It positions a previously defined volume in the mother.
   //  
+    
   char vname[5];
   Vname(name,vname);
   char vmother[5];
@@ -2835,6 +2941,31 @@ void TGeant3::Gckmat(Int_t itmed, char* natmed)
   gckmat(itmed, PASSCHARD(natmed) PASSCHARL(natmed));
 }
 
+//_____________________________________________________________________________
+Int_t TGeant3::Glvolu(Int_t nlev, Int_t *lnam,Int_t *lnum) 
+{ 
+  //
+  //  nlev   number of leveles deap into the volume tree
+  //         size of the arrays lnam and lnum
+  //  lnam   an integer array whos 4 bytes contain the askii code for the
+  //         volume names
+  //  lnum   an integer array containing the copy numbers for that specific
+  //         volume
+  //
+  //  This routine fills the volulme paramters in common /gcvolu/ for a
+  //  physical tree, specified by the list lnam and lnum of volume names
+  //  and numbers, and for all its ascendants up to level 1. This routine
+  //  is optimsed and does not re-compute the part of the history already
+  //  available in GCVOLU. This means that if it is used in user programs
+  //  outside the usual framwork of the tracking, the user has to initilise
+  //  to zero NLEVEL in the common GCVOLU. It return 0 if there were no
+  //  problems in make the call.
+  //
+  Int_t ier;
+  glvolu(nlev, lnam, lnum, ier); 
+  return ier;
+}
+
 //_____________________________________________________________________________
 void TGeant3::Gdelete(Int_t iview)
 { 
@@ -4163,4 +4294,3 @@ void TGeant3::Streamer(TBuffer &R__b)
   }
 }
 
-