]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
AliVMC and AliGeant3 classes introduced
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Feb 2000 16:25:27 +0000 (16:25 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Feb 2000 16:25:27 +0000 (16:25 +0000)
ReadEuclid moved from AliRun to AliModule

23 files changed:
ITS/AliITSv5.cxx
STEER/AliLego.cxx
STEER/AliLego.h
STEER/AliMC.h
STEER/AliModule.cxx
STEER/AliModule.h
STEER/AliRun.cxx
STEER/AliRun.h
STEER/AliVMC.cxx [new file with mode: 0644]
STEER/AliVMC.h [new file with mode: 0644]
STEER/Makefile
STEER/STEERLinkDef.h
STRUCT/AliFRAMEv0.cxx
STRUCT/AliFRAMEv1.cxx
STRUCT/AliPIPEv0.cxx
TGeant3/AliGeant3.cxx [new file with mode: 0644]
TGeant3/AliGeant3.h [new file with mode: 0644]
TGeant3/Makefile
TGeant3/TGeant3.cxx
TGeant3/TGeant3.h
TGeant3/TGeant3Dummy.cxx
TGeant3/TGeant3LinkDef.h
macros/Config.C

index bae64219ab34920fa05b83f74edba76ed862db61..53043e867177b38b1173b5c3d2badac202218de5 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.14  1999/10/22 08:16:49  fca
+Correct destructors, thanks to I.Hrivnacova
+
 Revision 1.13  1999/10/06 10:15:19  fca
 Correct bug in allocation of layer name and add destructor
 
@@ -102,8 +105,8 @@ void AliITSv5::CreateMaterials(){
   FILE *file = fopen(filtmp,"r");
   if(file) {
     fclose(file);
-//    gAlice->ReadEuclidMedia(fEuclidMaterial.Data(),this);
-    gAlice->ReadEuclidMedia(filtmp,this);
+//    ReadEuclidMedia(fEuclidMaterial.Data());
+    ReadEuclidMedia(filtmp);
   } else {
     Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",
 //       fEuclidMaterial.Data());
@@ -284,7 +287,7 @@ void AliITSv5::CreateGeometry(){
   if(file) {
     fclose(file);
     printf("Ready to read Euclid geometry file\n");
-    gAlice->ReadEuclid(fEuclidGeometry.Data(),this,topvol);
+    ReadEuclid(fEuclidGeometry.Data(),topvol);
     printf("Read in euclid geometries\n");
   } else {
     Error("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",
index 003856342ca41552e78ce1db66df2383ab72b240..6fb29caab5feae8e15387646f96b16425895ce08 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.9  1999/12/03 10:54:01  fca
+Fix lego summary
+
 Revision 1.8  1999/10/01 09:54:33  fca
 Correct logics for Lego StepManager
 
@@ -57,6 +60,7 @@ Introduction of the Copyright and cvs Log
 #include "AliLego.h"
 #include "AliRun.h"
 #include "AliConst.h"
+#include "AliVMC.h"
 
 ClassImp(AliLego)
 
@@ -71,13 +75,30 @@ AliLego::AliLego()
 }
 
 //___________________________________________
-AliLego::AliLego(const char *name, const char *title) 
-        : TNamed(name,title)
+AliLego::AliLego(const char *title, Int_t ntheta, Float_t themin, Float_t themax,
+                Int_t nphi, Float_t phimin, Float_t phimax,
+                Float_t rmin, Float_t rmax, Float_t zmax)
+  : TNamed("Lego Generator",title)
 {
-   fHistRadl = 0;
-   fHistAbso = 0;
-   fHistGcm2 = 0;
-   fHistReta = 0;
+// specify the angular limits and the size of the rectangular box
+   
+   fGener = new AliLegoGenerator(ntheta, themin, themax,
+                      nphi, phimin, phimax, rmin, rmax, zmax);
+   
+   gAlice->SetGenerator(fGener);
+
+   Float_t etamin = -TMath::Log(TMath::Tan(TMath::Min((Double_t)themax*kDegrad/2,TMath::Pi()/2-1.e-10)));
+   Float_t etamax = -TMath::Log(TMath::Tan(TMath::Max((Double_t)themin*kDegrad/2,              1.e-10)));
+
+   fHistRadl = new TH2F("hradl","Radiation length map",    
+                       nphi,phimin,phimax,ntheta,themin,themax);
+   fHistAbso = new TH2F("habso","Interaction length map",  
+                       nphi,phimin,phimax,ntheta,themin,themax);
+   fHistGcm2 = new TH2F("hgcm2","g/cm2 length map",        
+                       nphi,phimin,phimax,ntheta,themin,themax);
+   fHistReta = new TH2F("hetar","Radiation length vs. eta",
+                       nphi,phimin,phimax,ntheta,etamin,etamax);
+
 }
 
 //___________________________________________
@@ -89,8 +110,108 @@ AliLego::~AliLego()
    delete fHistReta;
 }
 
+
+//___________________________________________
+void AliLego::Run()
+{
+   // loop on phi,theta bins
+   gMC->InitLego();
+   Float_t thed, phid, eta;
+   for (Int_t i=0; i<=fGener->Nphi()*fGener->Ntheta(); ++i) {
+// --- Set to 0 radiation length, absorption length and g/cm2 ---
+     fTotRadl = 0;
+     fTotAbso = 0;
+     fTotGcm2 = 0;
+     
+     gVMC->ProcessEvent();
+     
+     thed = fGener->CurTheta()*kRaddeg;
+     phid = fGener->CurPhi()*kRaddeg;
+     eta  = -TMath::Log(TMath::Tan(TMath::Max(
+            TMath::Min((Double_t)(fGener->CurTheta())/2,
+                       TMath::Pi()/2-1.e-10),1.e-10)));
+
+     fHistRadl->Fill(phid,thed,fTotRadl);
+     fHistAbso->Fill(phid,thed,fTotAbso);
+     fHistGcm2->Fill(phid,thed,fTotGcm2);
+     fHistReta->Fill(phid,eta,fTotRadl);
+     gAlice->FinishEvent();
+   }
+   // store histograms in current Root file
+   fHistRadl->Write();
+   fHistAbso->Write();
+   fHistGcm2->Write();
+   fHistReta->Write();
+}
+
+//___________________________________________
+void AliLego::StepManager()
+{
+// called from AliRun::Stepmanager from gustep.
+// Accumulate the 3 parameters step by step
+  
+   static Float_t t;
+   Float_t a,z,dens,radl,absl;
+   Int_t i;
+   
+   Float_t step  = gMC->TrackStep();
+       
+   Float_t vect[3], dir[3];
+   TLorentzVector pos, mom;
+
+   gMC->TrackPosition(pos);  
+   gMC->TrackMomentum(mom);
+   gMC->CurrentMaterial(a,z,dens,radl,absl);
+   
+   if (z < 1) return;
+   
+// --- See if we have to stop now
+   if (TMath::Abs(pos[2]) > fGener->ZMax()  || 
+       pos[0]*pos[0] +pos[1]*pos[1] > fGener->RadMax()*fGener->RadMax()) {
+     if (gMC->TrackLength()) {
+       // Not the first step, add past contribution
+       fTotAbso += t/absl;
+       fTotRadl += t/radl;
+       fTotGcm2 += t*dens;
+     }
+     gMC->StopTrack();
+     return;
+   }
+
+// --- See how long we have to go
+   for(i=0;i<3;++i) {
+     vect[i]=pos[i];
+     dir[i]=mom[i];
+   }
+
+   t  = fGener->PropagateCylinder(vect,dir,fGener->RadMax(),fGener->ZMax());
+
+   if(step) {
+     fTotAbso += step/absl;
+     fTotRadl += step/radl;
+     fTotGcm2 += step*dens;
+   }
+}
+
+ClassImp(AliLegoGenerator)
+
+//___________________________________________
+AliLegoGenerator::AliLegoGenerator(Int_t ntheta, Float_t themin,
+                                  Float_t themax, Int_t nphi, 
+                                  Float_t phimin, Float_t phimax,
+                                  Float_t rmin, Float_t rmax, Float_t zmax) :
+  AliGenerator(0), fRadMin(rmin), fRadMax(rmax), fZMax(zmax), fNtheta(ntheta),
+  fNphi(nphi), fThetaBin(ntheta), fPhiBin(-1), fCurTheta(0), fCurPhi(0)
+  
+{
+  SetPhiRange(phimin,phimax);
+  SetThetaRange(themin,themax);
+  SetName("Lego");
+}
+
+
 //___________________________________________
-void AliLego::GenerateKinematics()
+void AliLegoGenerator::Generate()
 {
 // Create a geantino with kinematics corresponding to the current
 // bins in theta and phi.
@@ -101,66 +222,47 @@ void AliLego::GenerateKinematics()
    Float_t orig[3], pmom[3];
    Float_t t, cost, sint, cosp, sinp;
    
-// --- Set to 0 radiation length, absorption length and g/cm2 ---
-   fTotRadl = 0;
-   fTotAbso = 0;
-   fTotGcm2 = 0;
+   // Prepare for next step
+   if(fThetaBin>=fNtheta-1)
+     if(fPhiBin>=fNphi-1) {
+       Warning("Generate","End of Lego Generation");
+       return;
+     } else { 
+       fPhiBin++;
+       printf("Generating rays in phi bin:%d\n",fPhiBin);
+       fThetaBin=0;
+     } else fThetaBin++;
 
-   fCurTheta = (fThetaMin+(fThetaBin-0.5)*(fThetaMax-fThetaMin)/fNtheta)*kDegrad;
-   fCurPhi   = (fPhiMin+(fPhiBin-0.5)*(fPhiMax-fPhiMin)/fNphi)*kDegrad;
+   fCurTheta = (fThetaMin+(fThetaBin+0.5)*(fThetaMax-fThetaMin)/fNtheta);
+   fCurPhi   = (fPhiMin+(fPhiBin+0.5)*(fPhiMax-fPhiMin)/fNphi);
    cost      = TMath::Cos(fCurTheta);
    sint      = TMath::Sin(fCurTheta);
    cosp      = TMath::Cos(fCurPhi);
    sinp      = TMath::Sin(fCurPhi);
-
+   
    pmom[0] = cosp*sint;
    pmom[1] = sinp*sint;
    pmom[2] = cost;
-
-// --- Where to start
+   
+   // --- Where to start
    orig[0] = orig[1] = orig[2] = 0;
    Float_t dalicz = 3000;
    if (fRadMin > 0) {
-      t = PropagateCylinder(orig,pmom,fRadMin,dalicz);
-      orig[0] = pmom[0]*t;
-      orig[1] = pmom[1]*t;
-      orig[2] = pmom[2]*t;
-      if (TMath::Abs(orig[2]) > fZMax) return;
+     t = PropagateCylinder(orig,pmom,fRadMin,dalicz);
+     orig[0] = pmom[0]*t;
+     orig[1] = pmom[1]*t;
+     orig[2] = pmom[2]*t;
+     if (TMath::Abs(orig[2]) > fZMax) return;
    }
-
-// --- We do start here
+   
    Float_t polar[3]={0.,0.,0.};
    Int_t ntr;
    gAlice->SetTrack(1, 0, mpart, pmom, orig, polar, 0, "LEGO ray", ntr);
-}
-
-//___________________________________________
-void AliLego::Init(Int_t ntheta,Float_t themin,Float_t themax,
-          Int_t nphi,Float_t phimin,Float_t phimax,Float_t rmin,Float_t rmax,
-                 Float_t zmax)
-{
-// specify the angular limits and the size of the rectangular box
-   fNtheta   = ntheta;
-   fThetaMin = themin;
-   fThetaMax = themax;
-   fNphi     = nphi;
-   fPhiMin   = phimin;
-   fPhiMax   = phimax;
-   fRadMin   = rmin;
-   fRadMax   = rmax;
-   fZMax     = zmax;
-   Float_t etamin = -TMath::Log(TMath::Tan(TMath::Min((Double_t)fThetaMax*kDegrad/2,TMath::Pi()/2-1.e-10)));
-   Float_t etamax = -TMath::Log(TMath::Tan(TMath::Max((Double_t)fThetaMin*kDegrad/2,              1.e-10)));
-
-   fHistRadl = new TH2F("hradl","Radiation length map",    nphi,phimin,phimax,ntheta,themin,themax);
-   fHistAbso = new TH2F("habso","Interaction length map",  nphi,phimin,phimax,ntheta,themin,themax);
-   fHistGcm2 = new TH2F("hgcm2","g/cm2 length map",        nphi,phimin,phimax,ntheta,themin,themax);
-   fHistReta = new TH2F("hetar","Radiation length vs. eta",nphi,phimin,phimax,ntheta,etamin,etamax);
 
 }
 
 //___________________________________________
-Float_t AliLego::PropagateCylinder(Float_t *x, Float_t *v, Float_t r, Float_t z)
+Float_t AliLegoGenerator::PropagateCylinder(Float_t *x, Float_t *v, Float_t r, Float_t z)
 {
 // Propagate to cylinder from inside
 
@@ -206,82 +308,3 @@ Float_t AliLego::PropagateCylinder(Float_t *x, Float_t *v, Float_t r, Float_t z)
    return t;
 }
 
-//___________________________________________
-void AliLego::Run()
-{
-   // loop on phi,theta bins
-   gMC->InitLego();
-   Float_t thed, phid, eta;
-   for (fPhiBin=1; fPhiBin<=fNphi; fPhiBin++) {
-      printf("AliLego Generating rays in phi bin:%d\n",fPhiBin);
-      for (fThetaBin=1; fThetaBin<=fNtheta; fThetaBin++) {
-         gMC->Gtrigi();
-         gMC->Gtrigc();
-         GenerateKinematics();
-         gMC->Gtreve_root();
-
-         thed = fCurTheta*kRaddeg;
-         phid = fCurPhi*kRaddeg;
-        eta  = -TMath::Log(TMath::Tan(TMath::Max(
-                     TMath::Min((Double_t)fCurTheta/2,TMath::Pi()/2-1.e-10),1.e-10)));
-         fHistRadl->Fill(phid,thed,fTotRadl);
-         fHistAbso->Fill(phid,thed,fTotAbso);
-         fHistGcm2->Fill(phid,thed,fTotGcm2);
-        fHistReta->Fill(phid,eta,fTotRadl);
-         gAlice->FinishEvent();
-      }
-   }
-   // store histograms in current Root file
-   fHistRadl->Write();
-   fHistAbso->Write();
-   fHistGcm2->Write();
-   fHistReta->Write();
-}
-
-//___________________________________________
-void AliLego::StepManager()
-{
-// called from AliRun::Stepmanager from gustep.
-// Accumulate the 3 parameters step by step
-  
-   static Float_t t;
-   Float_t a,z,dens,radl,absl;
-   Int_t i;
-   
-   Float_t step  = gMC->TrackStep();
-       
-   Float_t vect[3], dir[3];
-   TLorentzVector pos, mom;
-
-   gMC->TrackPosition(pos);  
-   gMC->TrackMomentum(mom);
-   gMC->CurrentMaterial(a,z,dens,radl,absl);
-   
-   if (z < 1) return;
-   
-// --- See if we have to stop now
-   if (TMath::Abs(pos[2]) > fZMax  || 
-       pos[0]*pos[0] +pos[1]*pos[1] > fRadMax*fRadMax) {
-     if (gMC->TrackLength()) {
-       // Not the first step, add past contribution
-       fTotAbso += t/absl;
-       fTotRadl += t/radl;
-       fTotGcm2 += t*dens;
-     }
-     gMC->StopTrack();
-     return;
-   }
-
-// --- See how long we have to go
-   for(i=0;i<3;++i) {
-     vect[i]=pos[i];
-     dir[i]=mom[i];
-   }
-
-   t  = PropagateCylinder(vect,dir,fRadMax,fZMax);
-
-   fTotAbso += step/absl;
-   fTotRadl += step/radl;
-   fTotGcm2 += step*dens;
-}
-
index 9bc6e6c9ae0383dfaf3187e044667960413c4c0e..b2409bd648f6375acda3b675919ec1c16300da86 100644 (file)
 
 #include <TH2.h>
 
+#include "AliGenerator.h"
+
+class AliLegoGenerator;
+
 class AliLego : public TNamed  {
 
 private:
-   Float_t    fThetaMin;        //Minimum generation theta
-   Float_t    fThetaMax;        //Maximum generation theta
-   Float_t    fPhiMin;          //Minimum generation phi
-   Float_t    fPhiMax;          //Maximum generation phi
-   Float_t    fRadMin;          //Generation radius
-   Float_t    fRadMax;          //Maximum tracking radius
-   Float_t    fZMax;            //Maximum tracking Z
-   Int_t      fNtheta;          //Number of bins in Theta
-   Int_t      fNphi;            //Number of bins in Phi
-   Int_t      fThetaBin;        //Current theta bin
-   Int_t      fPhiBin;          //Current phi bin
-   Float_t    fCurTheta;        //Current theta of track
-   Float_t    fCurPhi;          //Current phi of track
+  AliLegoGenerator *fGener;     //Lego generator
    Float_t    fTotRadl;         //Total Radiation length
    Float_t    fTotAbso;         //Total absorption length
    Float_t    fTotGcm2;         //Total G/CM2 traversed
@@ -41,12 +33,10 @@ private:
    
 public:
   AliLego();
-  AliLego(const char *name, const char *title);
+  AliLego(const char *title, Int_t ntheta,Float_t themin,
+         Float_t themax, Int_t nphi, Float_t phimin,
+         Float_t phimax,Float_t rmin,Float_t rmax,Float_t zmax);
   virtual ~AliLego();
-  virtual void  GenerateKinematics();
-  virtual void  Init(Int_t ntheta,Float_t themin,Float_t themax, Int_t nphi, Float_t phimin,
-                     Float_t phimax,Float_t rmin,Float_t rmax,Float_t zmax);
-  Float_t       PropagateCylinder(Float_t *x, Float_t *v, Float_t r, Float_t z);
   virtual void  Run();
   virtual void  StepManager();
   
@@ -54,5 +44,36 @@ public:
 
 };
 
+class AliLegoGenerator : public AliGenerator
+{
+public:
+  AliLegoGenerator() {}
+  AliLegoGenerator(Int_t ntheta, Float_t themin, Float_t themax,
+                  Int_t nphi, Float_t phimin, Float_t phimax,
+                  Float_t rmin, Float_t rmax, Float_t zmax);
+  void    Generate();
+  Float_t CurTheta() const {return fCurTheta;}
+  Int_t   ThetaBin() const {return fThetaBin;}
+  Float_t CurPhi() const {return fCurPhi;}
+  Float_t ZMax() const {return fZMax;}
+  Float_t RadMax() const {return fRadMax;}
+  Int_t   PhiBin() const {return fPhiBin;}
+  Int_t   Nphi() const {return fNphi;}
+  Int_t   Ntheta() const {return fNtheta;}
+  Float_t       PropagateCylinder(Float_t *x, Float_t *v, Float_t r, Float_t z);
+private:
+   Float_t    fRadMin;          //Generation radius
+   Float_t    fRadMax;          //Maximum tracking radius
+   Float_t    fZMax;            //Maximum tracking Z
+   Int_t      fNtheta;          //Number of bins in Theta
+   Int_t      fNphi;            //Number of bins in Phi
+   Int_t      fThetaBin;        //Current theta bin
+   Int_t      fPhiBin;          //Current phi bin
+   Float_t    fCurTheta;        //Current theta of track
+   Float_t    fCurPhi;          //Current phi of track
+
+  ClassDef(AliLegoGenerator,1) //Lego generator
+};
+
 #endif
 
index 7d16c2e418f35159df65d92e337387b44435a3d8..2a1d7f0876b884019fdb1a7576dc26009129b613 100644 (file)
@@ -29,6 +29,7 @@ public:
   //Generic access functions
   static inline AliMC* GetMC() {return fgMC;}
   //
+  virtual void    FinishGeometry() = 0;
   virtual Int_t   CurrentMaterial(Float_t &a, Float_t &z, Float_t &dens, Float_t &radl, Float_t &absl) const =0;
   virtual Int_t   CurrentVolID(Int_t&) const =0;
   virtual Int_t   CurrentVolOffID(Int_t, Int_t& ) const =0;
@@ -113,14 +114,9 @@ public:
   virtual  void  Gdhead(Int_t, const char*, Float_t=0)=0;   
   virtual  void  Gdman(Float_t, Float_t, const char*)=0;
   virtual  void  Gsord(const char *name, Int_t iax)=0;
-  virtual  void  Ggclos()=0;
   virtual  void  SetColors()=0;
-  virtual  void  Gphysi()=0;
-  virtual  void  Gtrigi()=0;
   virtual  void  Gtreve()=0;
   virtual  void  Gtreve_root()=0;
-  virtual  void  Gtrigc()=0;
-  virtual  void  Gtrig()=0;
   virtual  void  Gckmat(Int_t, char*)=0;
   virtual  void  InitLego()=0;
   virtual  void  Gfpart(Int_t, char*, Int_t&, Float_t&, Float_t&, Float_t&)=0; 
index a9531f1cb9b88b86f050542b11039b7bba3e4b35..fc02d602d22b32a0b5282fbf80528920d8cf161c 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.7  1999/09/29 09:24:29  fca
+Introduction of the Copyright and cvs Log
+
 */
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -242,7 +245,7 @@ void AliModule::AliMedium(Int_t numed, const char *name, Int_t nmat,
   //
   // Store the parameters of a tracking medium
   //
-  // numed       the medium number is stored into (*fIdtmed)[numed-1]
+  // numed       the medium number is stored into (*fIdtmed)[numed]
   // name        medium name
   // nmat        the material number is stored into (*fIdmate)[nmat]
   // isvol       sensitive volume if isvol!=0
@@ -303,6 +306,272 @@ void AliModule::SetEuclidFile(char* material, char* geometry)
   }
 }
  
+//_____________________________________________________________________________
+void AliModule::ReadEuclid(const char* filnam, char* topvol)
+{
+  //                                                                     
+  //       read in the geometry of the detector in euclid file format    
+  //                                                                     
+  //        id_det : the detector identification (2=its,...)            
+  //        topvol : return parameter describing the name of the top    
+  //        volume of geometry.                                          
+  //                                                                     
+  //            author : m. maire                                        
+  //                                                                     
+  //     28.07.98
+  //     several changes have been made by miroslav helbich
+  //     subroutine is rewrited to follow the new established way of memory
+  //     booking for tracking medias and rotation matrices.
+  //     all used tracking media have to be defined first, for this you can use
+  //     subroutine  greutmed.
+  //     top volume is searched as only volume not positioned into another 
+  //
+
+  Int_t i, nvol, iret, itmed, irot, numed, npar, ndiv, iaxe;
+  Int_t ndvmx, nr, flag;
+  char key[5], card[77], natmed[21];
+  char name[5], mother[5], shape[5], konly[5], volst[7000][5];
+  char *filtmp;
+  Float_t par[50];
+  Float_t teta1, phi1, teta2, phi2, teta3, phi3, orig, step;
+  Float_t xo, yo, zo;
+  const Int_t maxrot=5000;
+  Int_t idrot[maxrot],istop[7000];
+  FILE *lun;
+  //
+  // *** The input filnam name will be with extension '.euc'
+  filtmp=gSystem->ExpandPathName(filnam);
+  lun=fopen(filtmp,"r");
+  delete [] filtmp;
+  if(!lun) {
+    Error("ReadEuclid","Could not open file %s\n",filnam);
+    return;
+  }
+  //* --- definition of rotation matrix 0 ---  
+  TArrayI &idtmed = *fIdtmed;
+  for(i=1; i<maxrot; ++i) idrot[i]=-99;
+  idrot[0]=0;
+  nvol=0;
+ L10:
+  for(i=0;i<77;i++) card[i]=0;
+  iret=fscanf(lun,"%77[^\n]",card);
+  if(iret<=0) goto L20;
+  fscanf(lun,"%*c");
+  //*
+  strncpy(key,card,4);
+  key[4]='\0';
+  if (!strcmp(key,"TMED")) {
+    sscanf(&card[5],"%d '%[^']'",&itmed,natmed);
+    if( itmed<0 || itmed>=100 ) {
+      Error("ReadEuclid","TMED illegal medium number %d for %s\n",itmed,natmed);
+      exit(1);
+    }
+    //Pad the string with blanks
+    i=-1;
+    while(natmed[++i]);
+    while(i<20) natmed[i++]=' ';
+    natmed[i]='\0';
+    //
+    if( idtmed[itmed]<=0 ) {
+      Error("ReadEuclid","TMED undefined medium number %d for %s\n",itmed,natmed);
+      exit(1);
+    }
+    gMC->Gckmat(idtmed[itmed],natmed);
+    //*
+  } else if (!strcmp(key,"ROTM")) {
+    sscanf(&card[4],"%d %f %f %f %f %f %f",&irot,&teta1,&phi1,&teta2,&phi2,&teta3,&phi3);
+    if( irot<=0 || irot>=maxrot ) {
+      Error("ReadEuclid","ROTM rotation matrix number %d illegal\n",irot);
+      exit(1);
+    }
+    AliMatrix(idrot[irot],teta1,phi1,teta2,phi2,teta3,phi3);
+    //*
+  } else if (!strcmp(key,"VOLU")) {
+    sscanf(&card[5],"'%[^']' '%[^']' %d %d", name, shape, &numed, &npar);
+    if (npar>0) {
+      for(i=0;i<npar;i++) fscanf(lun,"%f",&par[i]);
+      fscanf(lun,"%*c");
+    }
+    gMC->Gsvolu( name, shape, idtmed[numed], par, npar);
+    //*     save the defined volumes
+    strcpy(volst[++nvol],name);
+    istop[nvol]=1;
+    //*
+  } else if (!strcmp(key,"DIVN")) {
+    sscanf(&card[5],"'%[^']' '%[^']' %d %d", name, mother, &ndiv, &iaxe);
+    gMC->Gsdvn  ( name, mother, ndiv, iaxe );
+    //*
+  } else if (!strcmp(key,"DVN2")) {
+    sscanf(&card[5],"'%[^']' '%[^']' %d %d %f %d",name, mother, &ndiv, &iaxe, &orig, &numed);
+    gMC->Gsdvn2( name, mother, ndiv, iaxe, orig,idtmed[numed]);
+    //*
+  } else if (!strcmp(key,"DIVT")) {
+    sscanf(&card[5],"'%[^']' '%[^']' %f %d %d %d", name, mother, &step, &iaxe, &numed, &ndvmx);
+    gMC->Gsdvt ( name, mother, step, iaxe, idtmed[numed], ndvmx);
+    //*
+  } else if (!strcmp(key,"DVT2")) {
+    sscanf(&card[5],"'%[^']' '%[^']' %f %d %f %d %d", name, mother, &step, &iaxe, &orig, &numed, &ndvmx);
+    gMC->Gsdvt2 ( name, mother, step, iaxe, orig, idtmed[numed], ndvmx );
+    //*
+  } else if (!strcmp(key,"POSI")) {
+    sscanf(&card[5],"'%[^']' %d '%[^']' %f %f %f %d '%[^']'", name, &nr, mother, &xo, &yo, &zo, &irot, konly);
+    if( irot<0 || irot>=maxrot ) {
+      Error("ReadEuclid","POSI %s#%d rotation matrix number %d illegal\n",name,nr,irot);
+      exit(1);
+    }
+    if( idrot[irot] == -99) {
+      Error("ReadEuclid","POSI %s#%d undefined matrix number %d\n",name,nr,irot);
+      exit(1);
+    }
+    //*** volume name cannot be the top volume
+    for(i=1;i<=nvol;i++) {
+      if (!strcmp(volst[i],name)) istop[i]=0;
+    }
+    //*
+    gMC->Gspos  ( name, nr, mother, xo, yo, zo, idrot[irot], konly );
+    //*
+  } else if (!strcmp(key,"POSP")) {
+    sscanf(&card[5],"'%[^']' %d '%[^']' %f %f %f %d '%[^']' %d", name, &nr, mother, &xo, &yo, &zo, &irot, konly, &npar);
+    if( irot<0 || irot>=maxrot ) {
+      Error("ReadEuclid","POSP %s#%d rotation matrix number %d illegal\n",name,nr,irot);
+      exit(1);
+    }
+    if( idrot[irot] == -99) {
+      Error("ReadEuclid","POSP %s#%d undefined matrix number %d\n",name,nr,irot);
+      exit(1);
+    }
+    if (npar > 0) {
+      for(i=0;i<npar;i++) fscanf(lun,"%f",&par[i]);
+      fscanf(lun,"%*c");
+    }
+    //*** volume name cannot be the top volume
+    for(i=1;i<=nvol;i++) {
+      if (!strcmp(volst[i],name)) istop[i]=0;
+    }
+    //*
+    gMC->Gsposp ( name, nr, mother, xo,yo,zo, idrot[irot], konly, par, npar);
+  }
+  //*
+  if (strcmp(key,"END")) goto L10;
+  //* find top volume in the geometry
+  flag=0;
+  for(i=1;i<=nvol;i++) {
+    if (istop[i] && flag) {
+      Warning("ReadEuclid"," %s is another possible top volume\n",volst[i]);
+    }
+    if (istop[i] && !flag) {
+      strcpy(topvol,volst[i]);
+      printf(" *** GREUCL *** volume %s taken as a top volume\n",topvol);
+      flag=1;
+    }
+  }
+  if (!flag) {
+    Warning("ReadEuclid","top volume not found\n");
+  }
+  fclose (lun);
+  //*
+  //*     commented out only for the not cernlib version
+  printf(" *** GREUCL *** file: %s is now read in\n",filnam);
+  //
+  return;
+  //*
+  L20:
+  Error("ReadEuclid","reading error or premature end of file\n");
+}
+
+//_____________________________________________________________________________
+void AliModule::ReadEuclidMedia(const char* filnam)
+{
+  //                                                                     
+  //       read in the materials and tracking media for the detector     
+  //                   in euclid file format                             
+  //                                                                     
+  //       filnam: name of the input file                                
+  //       id_det: id_det is the detector identification (2=its,...)     
+  //                                                                     
+  //            author : miroslav helbich                                
+  //
+  Float_t sxmgmx = gAlice->Field()->Max();
+  Int_t   isxfld = gAlice->Field()->Integ();
+  Int_t end, i, iret, itmed;
+  char key[5], card[130], natmed[21], namate[21];
+  Float_t ubuf[50];
+  char* filtmp;
+  FILE *lun;
+  Int_t imate;
+  Int_t nwbuf, isvol, ifield, nmat;
+  Float_t a, z, dens, radl, absl, fieldm, tmaxfd, stemax, deemax, epsil, stmin;
+  //
+  end=strlen(filnam);
+  for(i=0;i<end;i++) if(filnam[i]=='.') {
+    end=i;
+    break;
+  }
+  //
+  // *** The input filnam name will be with extension '.euc'
+  printf("The file name is %s\n",filnam); //Debug
+  filtmp=gSystem->ExpandPathName(filnam);
+  lun=fopen(filtmp,"r");
+  delete [] filtmp;
+  if(!lun) {
+    Warning("ReadEuclidMedia","Could not open file %s\n",filnam);
+    return;
+  }
+  //
+  // Retrieve Mag Field parameters
+  Int_t ISXFLD=gAlice->Field()->Integ();
+  Float_t SXMGMX=gAlice->Field()->Max();
+  //  TArrayI &idtmed = *fIdtmed;
+  //
+ L10:
+  for(i=0;i<130;i++) card[i]=0;
+  iret=fscanf(lun,"%4s %[^\n]",key,card);
+  if(iret<=0) goto L20;
+  fscanf(lun,"%*c");
+  //*
+  //* read material
+  if (!strcmp(key,"MATE")) {
+    sscanf(card,"%d '%[^']' %f %f %f %f %f %d",&imate,namate,&a,&z,&dens,&radl,&absl,&nwbuf);
+    if (nwbuf>0) for(i=0;i<nwbuf;i++) fscanf(lun,"%f",&ubuf[i]);
+    //Pad the string with blanks
+    i=-1;
+    while(namate[++i]);
+    while(i<20) namate[i++]=' ';
+    namate[i]='\0';
+    //
+    AliMaterial(imate,namate,a,z,dens,radl,absl,ubuf,nwbuf);
+    //* read tracking medium
+  } else if (!strcmp(key,"TMED")) {
+    sscanf(card,"%d '%[^']' %d %d %d %f %f %f %f %f %f %d",
+          &itmed,natmed,&nmat,&isvol,&ifield,&fieldm,&tmaxfd,
+          &stemax,&deemax,&epsil,&stmin,&nwbuf);
+    if (nwbuf>0) for(i=0;i<nwbuf;i++) fscanf(lun,"%f",&ubuf[i]);
+    if (ifield<0) ifield=isxfld;
+    if (fieldm<0) fieldm=sxmgmx;
+    //Pad the string with blanks
+    i=-1;
+    while(natmed[++i]);
+    while(i<20) natmed[i++]=' ';
+    natmed[i]='\0';
+    //
+    AliMedium(itmed,natmed,nmat,isvol,ISXFLD,SXMGMX,tmaxfd,
+                  stemax,deemax,epsil,stmin,ubuf,nwbuf);
+    //    (*fImedia)[idtmed[itmed]-1]=id_det;
+    //*
+  }
+  //*
+  if (strcmp(key,"END")) goto L10;
+  fclose (lun);
+  //*
+  //*     commented out only for the not cernlib version
+  Warning("ReadEuclidMedia","file: %s is now read in\n",filnam);
+  //*
+  return;
+  //*
+ L20:
+  Warning("ReadEuclidMedia","reading error or premature end of file\n");
+} 
 //_____________________________________________________________________________
 void AliModule::Streamer(TBuffer &R__b)
 {
index e020b9bc86a487051d858c2d94a603f5ebc35db1..a109764ca12ff7fb1af22cddd0dabc773300132a 100644 (file)
@@ -6,6 +6,7 @@
 /* $Id$ */
 
 #include <TNamed.h>
+#include <TSystem.h>
 #include <TClonesArray.h>
 #include <TBrowser.h>
 #include <TAttLine.h>
@@ -98,6 +99,8 @@ public:
   //virtual AliHit*     NextHit() {return 0;}
   virtual void        SetBufferSize(Int_t) {}  
   virtual void        SetEuclidFile(char*,char*geometry=0);
+  virtual void ReadEuclid(const char*, char*);
+  virtual void ReadEuclidMedia(const char*);
  
   ClassDef(AliModule,1)  //Base class for ALICE Modules
 };
index b93aadc83a8e4b68d2010b65d355aac1b4152d52..8f4efd34b2ca3e318a0d9b91b89dc4ba01bd361c 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.24  2000/01/19 17:17:20  fca
+Introducing a list of lists of hits -- more hits allowed for detector now
+
 Revision 1.23  1999/12/03 11:14:31  fca
 Fixing previous wrong checking
 
@@ -65,9 +68,8 @@ Introduction of the Copyright and cvs Log
 #include "TParticle.h"
 #include "AliRun.h"
 #include "AliDisplay.h"
+#include "AliVMC.h"
 
-#include "AliCallf77.h" 
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -76,20 +78,6 @@ AliRun *gAlice;
 
 static AliHeader *header;
 
-#ifndef WIN32
-
-# define rxgtrak rxgtrak_
-# define rxstrak rxstrak_
-# define rxkeep  rxkeep_ 
-# define rxouth  rxouth_
-#else
-
-# define rxgtrak RXGTRAK 
-# define rxstrak RXSTRAK 
-# define rxkeep  RXKEEP  
-# define rxouth  RXOUTH
-#endif
-
 static TArrayF sEventEnergy;
 static TArrayF sSummEnergy;
 static TArrayF sSum2Energy;
@@ -517,7 +505,6 @@ void AliRun::FinishRun()
   
   // Close output file
   File->Write();
-  File->Close();
 }
 
 //_____________________________________________________________________________
@@ -605,9 +592,9 @@ void AliRun::EnergySummary()
   }
   //
   // Reset the TArray's
-  sEventEnergy.Set(0);
-  sSummEnergy.Set(0);
-  sSum2Energy.Set(0);
+  //  sEventEnergy.Set(0);
+  //  sSummEnergy.Set(0);
+  //  sSum2Energy.Set(0);
 }
 
 //_____________________________________________________________________________
@@ -841,19 +828,17 @@ void AliRun::Init(const char *setup)
    
    MediaTable(); //Build the special IMEDIA table
    
-   //Close the geometry structure
-   gMC->Ggclos();
+   //Terminate building of geometry
+   printf("%p\n",gVMC);
+   gVMC->FinishGeometry();
    
    //Initialise geometry deposition table
    sEventEnergy.Set(gMC->NofVolumes()+1);
    sSummEnergy.Set(gMC->NofVolumes()+1);
    sSum2Energy.Set(gMC->NofVolumes()+1);
    
-   //Create the color table
-   gMC->SetColors();
-   
    //Compute cross-sections
-   gMC->Gphysi();
+   gVMC->BuildPhysics();
    
    //Write Geometry object to current file.
    fGeometry->Write();
@@ -924,7 +909,10 @@ void AliRun::SetGenerator(AliGenerator *generator)
   //
   // Load the event generator
   //
-  if(!fGenerator) fGenerator = generator;
+  if(fGenerator)
+    Warning("SetGenerator","Replacing generator %s with %s\n",
+           fGenerator->GetName(),generator->GetName());
+  fGenerator = generator;
 }
 
 //____________________________________________________________________________
@@ -1041,6 +1029,7 @@ void AliRun::MakeTree(Option_t *option)
   //  Loop on all detectors to create the Root branch (if any)
   //
 
+  char hname[30];
   //
   // Analyse options
   char *K = strstr(option,"K");
@@ -1049,12 +1038,30 @@ void AliRun::MakeTree(Option_t *option)
   char *D = strstr(option,"D");
   char *R = strstr(option,"R");
   //
-  if (K && !fTreeK) fTreeK = new TTree("TreeK0","Kinematics");
-  if (H && !fTreeH) fTreeH = new TTree("TreeH0","Hits");
-  if (D && !fTreeD) fTreeD = new TTree("TreeD0","Digits");
-  if (E && !fTreeE) fTreeE = new TTree("TE","Header");
-  if (R && !fTreeR) fTreeR = new TTree("TreeR0","Reconstruction");
-  if (fTreeH) fTreeH->SetAutoSave(1000000000); //no autosave
+  if (K && !fTreeK) {
+    sprintf(hname,"TreeK%d",fEvent);
+    fTreeK = new TTree(hname,"Kinematics");
+    //  Create a branch for particles
+    fTreeK->Branch("Particles",&fParticles,4000);
+  }
+  if (H && !fTreeH) {
+    sprintf(hname,"TreeH%d",fEvent);
+    fTreeH = new TTree(hname,"Hits");
+    fTreeH->SetAutoSave(1000000000); //no autosave
+  }
+  if (D && !fTreeD) {
+    sprintf(hname,"TreeD%d",fEvent);
+    fTreeD = new TTree(hname,"Digits");
+  }
+  if (R && !fTreeR) {
+    sprintf(hname,"TreeR%d",fEvent);
+    fTreeR = new TTree(hname,"Reconstruction");
+  }
+  if (E && !fTreeE) {
+    fTreeE = new TTree("TE","Header");
+    //  Create a branch for Header
+    fTreeE->Branch("Header","AliHeader",&header,4000);
+  }
   //
   // Create a branch for hits/digits for each detector
   // Each branch is a TClonesArray. Each data member of the Hits classes
@@ -1064,11 +1071,6 @@ void AliRun::MakeTree(Option_t *option)
   while((detector = (AliModule*)next())) {
      if (H || D || R) detector->MakeBranch(option);
   }
-  //  Create a branch for particles
-  if (fTreeK && K) fTreeK->Branch("Particles",&fParticles,4000);
-  
-  //  Create a branch for Header
-  if (fTreeE && E) fTreeE->Branch("Header","AliHeader",&header,4000);
 }
 
 //_____________________________________________________________________________
@@ -1093,7 +1095,6 @@ void AliRun::PurifyKine()
   TClonesArray &particles = *fParticles;
   int nkeep=fHgwmk+1, parent, i;
   TParticle *part, *partnew, *father;
-  AliHit *OneHit;
   int *map = new int[particles.GetEntries()];
 
   // Save in Header total number of tracks before compression
@@ -1148,6 +1149,7 @@ void AliRun::PurifyKine()
   
 #ifdef old
   // Now loop on all detectors and reset the hits
+  AliHit *OneHit;
   TIter next(fModules);
   AliModule *detector;
   while((detector = (AliModule*)next())) {
@@ -1272,17 +1274,13 @@ void AliRun::Run(Int_t nevent, const char *setup)
   if (!fInitDone) Init(setup);
   
   // Create the Root Tree with one branch per detector
-  if(!fEvent) {
-    gAlice->MakeTree("KHDER");
-  }
+  gAlice->MakeTree("KHDER");
 
   todo = TMath::Abs(nevent);
   for (i=0; i<todo; i++) {
   // Process one run (one run = one event)
      gAlice->Reset(fRun, fEvent);
-     gMC->Gtrigi();
-     gMC->Gtrigc();
-     gMC->Gtrig();
+     gVMC->ProcessEvent();
      gAlice->FinishEvent();
      fEvent++;
   }
@@ -1336,9 +1334,11 @@ void AliRun::RunLego(const char *setup,Int_t ntheta,Float_t themin,
 
   // check if initialisation has been done
   if (!fInitDone) Init(setup);
-  
-  fLego = new AliLego("lego","lego");
-  fLego->Init(ntheta,themin,themax,nphi,phimin,phimax,rmin,rmax,zmax);
+
+  //Create Lego object  
+  fLego = new AliLego("lego",ntheta,themin,themax,nphi,phimin,phimax,rmin,rmax,zmax);
+
+  //Run Lego Object
   fLego->Run();
   
   // Create only the Root event Tree
@@ -1440,287 +1440,21 @@ void AliRun::StepManager(Int_t id) const
   // Called at every step during transport
   //
 
-  Int_t copy;
   //
   // --- If lego option, do it and leave 
-  if (fLego) {
+  if (fLego)
     fLego->StepManager();
-    return;
-  }
-  //Update energy deposition tables
-  sEventEnergy[gMC->CurrentVolID(copy)]+=gMC->Edep();
+  else {
+    Int_t copy;
+    //Update energy deposition tables
+    sEventEnergy[gMC->CurrentVolID(copy)]+=gMC->Edep();
   
-  //Call the appropriate stepping routine;
-  AliModule *det = (AliModule*)fModules->At(id);
-  if(det) det->StepManager();
-}
-
-//_____________________________________________________________________________
-void AliRun::ReadEuclid(const char* filnam, const AliModule *det, char* topvol)
-{
-  //                                                                     
-  //       read in the geometry of the detector in euclid file format    
-  //                                                                     
-  //        id_det : the detector identification (2=its,...)            
-  //        topvol : return parameter describing the name of the top    
-  //        volume of geometry.                                          
-  //                                                                     
-  //            author : m. maire                                        
-  //                                                                     
-  //     28.07.98
-  //     several changes have been made by miroslav helbich
-  //     subroutine is rewrited to follow the new established way of memory
-  //     booking for tracking medias and rotation matrices.
-  //     all used tracking media have to be defined first, for this you can use
-  //     subroutine  greutmed.
-  //     top volume is searched as only volume not positioned into another 
-  //
-
-  Int_t i, nvol, iret, itmed, irot, numed, npar, ndiv, iaxe;
-  Int_t ndvmx, nr, flag;
-  char key[5], card[77], natmed[21];
-  char name[5], mother[5], shape[5], konly[5], volst[7000][5];
-  char *filtmp;
-  Float_t par[50];
-  Float_t teta1, phi1, teta2, phi2, teta3, phi3, orig, step;
-  Float_t xo, yo, zo;
-  const Int_t maxrot=5000;
-  Int_t idrot[maxrot],istop[7000];
-  FILE *lun;
-  //
-  // *** The input filnam name will be with extension '.euc'
-  filtmp=gSystem->ExpandPathName(filnam);
-  lun=fopen(filtmp,"r");
-  delete [] filtmp;
-  if(!lun) {
-    Error("ReadEuclid","Could not open file %s\n",filnam);
-    return;
-  }
-  //* --- definition of rotation matrix 0 ---  
-  TArrayI &idtmed = *(det->GetIdtmed());
-  for(i=1; i<maxrot; ++i) idrot[i]=-99;
-  idrot[0]=0;
-  nvol=0;
- L10:
-  for(i=0;i<77;i++) card[i]=0;
-  iret=fscanf(lun,"%77[^\n]",card);
-  if(iret<=0) goto L20;
-  fscanf(lun,"%*c");
-  //*
-  strncpy(key,card,4);
-  key[4]='\0';
-  if (!strcmp(key,"TMED")) {
-    sscanf(&card[5],"%d '%[^']'",&itmed,natmed);
-    if( itmed<0 || itmed>=100 ) {
-      Error("ReadEuclid","TMED illegal medium number %d for %s\n",itmed,natmed);
-      exit(1);
-    }
-    //Pad the string with blanks
-    i=-1;
-    while(natmed[++i]);
-    while(i<20) natmed[i++]=' ';
-    natmed[i]='\0';
-    //
-    if( idtmed[itmed]<=0 ) {
-      Error("ReadEuclid","TMED undefined medium number %d for %s\n",itmed,natmed);
-      exit(1);
-    }
-    gMC->Gckmat(idtmed[itmed],natmed);
-    //*
-  } else if (!strcmp(key,"ROTM")) {
-    sscanf(&card[4],"%d %f %f %f %f %f %f",&irot,&teta1,&phi1,&teta2,&phi2,&teta3,&phi3);
-    if( irot<=0 || irot>=maxrot ) {
-      Error("ReadEuclid","ROTM rotation matrix number %d illegal\n",irot);
-      exit(1);
-    }
-    det->AliMatrix(idrot[irot],teta1,phi1,teta2,phi2,teta3,phi3);
-    //*
-  } else if (!strcmp(key,"VOLU")) {
-    sscanf(&card[5],"'%[^']' '%[^']' %d %d", name, shape, &numed, &npar);
-    if (npar>0) {
-      for(i=0;i<npar;i++) fscanf(lun,"%f",&par[i]);
-      fscanf(lun,"%*c");
-    }
-    gMC->Gsvolu( name, shape, idtmed[numed], par, npar);
-    //*     save the defined volumes
-    strcpy(volst[++nvol],name);
-    istop[nvol]=1;
-    //*
-  } else if (!strcmp(key,"DIVN")) {
-    sscanf(&card[5],"'%[^']' '%[^']' %d %d", name, mother, &ndiv, &iaxe);
-    gMC->Gsdvn  ( name, mother, ndiv, iaxe );
-    //*
-  } else if (!strcmp(key,"DVN2")) {
-    sscanf(&card[5],"'%[^']' '%[^']' %d %d %f %d",name, mother, &ndiv, &iaxe, &orig, &numed);
-    gMC->Gsdvn2( name, mother, ndiv, iaxe, orig,idtmed[numed]);
-    //*
-  } else if (!strcmp(key,"DIVT")) {
-    sscanf(&card[5],"'%[^']' '%[^']' %f %d %d %d", name, mother, &step, &iaxe, &numed, &ndvmx);
-    gMC->Gsdvt ( name, mother, step, iaxe, idtmed[numed], ndvmx);
-    //*
-  } else if (!strcmp(key,"DVT2")) {
-    sscanf(&card[5],"'%[^']' '%[^']' %f %d %f %d %d", name, mother, &step, &iaxe, &orig, &numed, &ndvmx);
-    gMC->Gsdvt2 ( name, mother, step, iaxe, orig, idtmed[numed], ndvmx );
-    //*
-  } else if (!strcmp(key,"POSI")) {
-    sscanf(&card[5],"'%[^']' %d '%[^']' %f %f %f %d '%[^']'", name, &nr, mother, &xo, &yo, &zo, &irot, konly);
-    if( irot<0 || irot>=maxrot ) {
-      Error("ReadEuclid","POSI %s#%d rotation matrix number %d illegal\n",name,nr,irot);
-      exit(1);
-    }
-    if( idrot[irot] == -99) {
-      Error("ReadEuclid","POSI %s#%d undefined matrix number %d\n",name,nr,irot);
-      exit(1);
-    }
-    //*** volume name cannot be the top volume
-    for(i=1;i<=nvol;i++) {
-      if (!strcmp(volst[i],name)) istop[i]=0;
-    }
-    //*
-    gMC->Gspos  ( name, nr, mother, xo, yo, zo, idrot[irot], konly );
-    //*
-  } else if (!strcmp(key,"POSP")) {
-    sscanf(&card[5],"'%[^']' %d '%[^']' %f %f %f %d '%[^']' %d", name, &nr, mother, &xo, &yo, &zo, &irot, konly, &npar);
-    if( irot<0 || irot>=maxrot ) {
-      Error("ReadEuclid","POSP %s#%d rotation matrix number %d illegal\n",name,nr,irot);
-      exit(1);
-    }
-    if( idrot[irot] == -99) {
-      Error("ReadEuclid","POSP %s#%d undefined matrix number %d\n",name,nr,irot);
-      exit(1);
-    }
-    if (npar > 0) {
-      for(i=0;i<npar;i++) fscanf(lun,"%f",&par[i]);
-      fscanf(lun,"%*c");
-    }
-    //*** volume name cannot be the top volume
-    for(i=1;i<=nvol;i++) {
-      if (!strcmp(volst[i],name)) istop[i]=0;
-    }
-    //*
-    gMC->Gsposp ( name, nr, mother, xo,yo,zo, idrot[irot], konly, par, npar);
-  }
-  //*
-  if (strcmp(key,"END")) goto L10;
-  //* find top volume in the geometry
-  flag=0;
-  for(i=1;i<=nvol;i++) {
-    if (istop[i] && flag) {
-      Warning("ReadEuclid"," %s is another possible top volume\n",volst[i]);
-    }
-    if (istop[i] && !flag) {
-      strcpy(topvol,volst[i]);
-      printf(" *** GREUCL *** volume %s taken as a top volume\n",topvol);
-      flag=1;
-    }
+    //Call the appropriate stepping routine;
+    AliModule *det = (AliModule*)fModules->At(id);
+    if(det) det->StepManager();
   }
-  if (!flag) {
-    Warning("ReadEuclid","top volume not found\n");
-  }
-  fclose (lun);
-  //*
-  //*     commented out only for the not cernlib version
-  printf(" *** GREUCL *** file: %s is now read in\n",filnam);
-  //
-  return;
-  //*
-  L20:
-  Error("ReadEuclid","reading error or premature end of file\n");
 }
 
-//_____________________________________________________________________________
-void AliRun::ReadEuclidMedia(const char* filnam, const AliModule *det)
-{
-  //                                                                     
-  //       read in the materials and tracking media for the detector     
-  //                   in euclid file format                             
-  //                                                                     
-  //       filnam: name of the input file                                
-  //       id_det: id_det is the detector identification (2=its,...)     
-  //                                                                     
-  //            author : miroslav helbich                                
-  //
-  Float_t sxmgmx = gAlice->Field()->Max();
-  Int_t   isxfld = gAlice->Field()->Integ();
-  Int_t end, i, iret, itmed;
-  char key[5], card[130], natmed[21], namate[21];
-  Float_t ubuf[50];
-  char* filtmp;
-  FILE *lun;
-  Int_t imate;
-  Int_t nwbuf, isvol, ifield, nmat;
-  Float_t a, z, dens, radl, absl, fieldm, tmaxfd, stemax, deemax, epsil, stmin;
-  //
-  end=strlen(filnam);
-  for(i=0;i<end;i++) if(filnam[i]=='.') {
-    end=i;
-    break;
-  }
-  //
-  // *** The input filnam name will be with extension '.euc'
-  printf("The file name is %s\n",filnam); //Debug
-  filtmp=gSystem->ExpandPathName(filnam);
-  lun=fopen(filtmp,"r");
-  delete [] filtmp;
-  if(!lun) {
-    Warning("ReadEuclidMedia","Could not open file %s\n",filnam);
-    return;
-  }
-  //
-  // Retrieve Mag Field parameters
-  Int_t ISXFLD=gAlice->Field()->Integ();
-  Float_t SXMGMX=gAlice->Field()->Max();
-  //  TArrayI &idtmed = *(det->GetIdtmed());
-  //
- L10:
-  for(i=0;i<130;i++) card[i]=0;
-  iret=fscanf(lun,"%4s %[^\n]",key,card);
-  if(iret<=0) goto L20;
-  fscanf(lun,"%*c");
-  //*
-  //* read material
-  if (!strcmp(key,"MATE")) {
-    sscanf(card,"%d '%[^']' %f %f %f %f %f %d",&imate,namate,&a,&z,&dens,&radl,&absl,&nwbuf);
-    if (nwbuf>0) for(i=0;i<nwbuf;i++) fscanf(lun,"%f",&ubuf[i]);
-    //Pad the string with blanks
-    i=-1;
-    while(namate[++i]);
-    while(i<20) namate[i++]=' ';
-    namate[i]='\0';
-    //
-    det->AliMaterial(imate,namate,a,z,dens,radl,absl,ubuf,nwbuf);
-    //* read tracking medium
-  } else if (!strcmp(key,"TMED")) {
-    sscanf(card,"%d '%[^']' %d %d %d %f %f %f %f %f %f %d",
-          &itmed,natmed,&nmat,&isvol,&ifield,&fieldm,&tmaxfd,
-          &stemax,&deemax,&epsil,&stmin,&nwbuf);
-    if (nwbuf>0) for(i=0;i<nwbuf;i++) fscanf(lun,"%f",&ubuf[i]);
-    if (ifield<0) ifield=isxfld;
-    if (fieldm<0) fieldm=sxmgmx;
-    //Pad the string with blanks
-    i=-1;
-    while(natmed[++i]);
-    while(i<20) natmed[i++]=' ';
-    natmed[i]='\0';
-    //
-    det->AliMedium(itmed,natmed,nmat,isvol,ISXFLD,SXMGMX,tmaxfd,
-                  stemax,deemax,epsil,stmin,ubuf,nwbuf);
-    //    (*fImedia)[idtmed[itmed]-1]=id_det;
-    //*
-  }
-  //*
-  if (strcmp(key,"END")) goto L10;
-  fclose (lun);
-  //*
-  //*     commented out only for the not cernlib version
-  Warning("ReadEuclidMedia","file: %s is now read in\n",filnam);
-  //*
-  return;
-  //*
- L20:
-  Warning("ReadEuclidMedia","reading error or premature end of file\n");
-} 
 //_____________________________________________________________________________
 void AliRun::Streamer(TBuffer &R__b)
 {
@@ -1772,98 +1506,3 @@ void AliRun::Streamer(TBuffer &R__b)
     R__b << fPDGDB;        //Particle factory object!
   }
 } 
-
-
-//_____________________________________________________________________________
-//
-//                 Interfaces to Fortran
-//
-//_____________________________________________________________________________
-
-extern "C" void type_of_call  rxgtrak (Int_t &mtrack, Int_t &ipart, Float_t *pmom, 
-                                      Float_t &e, Float_t *vpos, Float_t *polar,
-                                      Float_t &tof)
-{
-  //
-  //     Fetches next track from the ROOT stack for transport. Called by the
-  //     modified version of GTREVE.
-  //
-  //              Track number in the ROOT stack. If MTRACK=0 no
-  //      mtrack  more tracks are left in the stack to be
-  //              transported.
-  //      ipart   Particle code in the GEANT conventions.
-  //      pmom[3] Particle momentum in GeV/c
-  //      e       Particle energy in GeV
-  //      vpos[3] Particle position
-  //      tof     Particle time of flight in seconds
-  //
-  Int_t pdg;
-  gAlice->GetNextTrack(mtrack, pdg, pmom, e, vpos, polar, tof);
-  ipart = gMC->IdFromPDG(pdg);
-  mtrack++;
-}
-
-//_____________________________________________________________________________
-extern "C" void type_of_call 
-#ifndef WIN32
-rxstrak (Int_t &keep, Int_t &parent, Int_t &ipart, Float_t *pmom, 
-              Float_t *vpos, Float_t &tof, const char* cmech, Int_t &ntr, const int cmlen)
-#else
-rxstrak (Int_t &keep, Int_t &parent, Int_t &ipart, Float_t *pmom,
-        Float_t *vpos, Float_t &tof, const char* cmech, const int cmlen,
-        Int_t &ntr)
-#endif
-{
-  //
-  //     Fetches next track from the ROOT stack for transport. Called by GUKINE
-  //     and GUSTEP.
-  //
-  //              Status of the track. If keep=0 the track is put
-  //      keep    on the ROOT stack but it is not fetched for
-  //              transport.
-  //      parent  Parent track. If parent=0 the track is a primary.
-  //              In GUSTEP the routine is normally called to store
-  //              secondaries generated by the current track whose
-  //              ROOT stack number is MTRACK (common SCKINE.
-  //      ipart   Particle code in the GEANT conventions.
-  //      pmom[3] Particle momentum in GeV/c
-  //      vpos[3] Particle position
-  //      tof     Particle time of flight in seconds
-  //
-  //      cmech   (CHARACTER*10) Particle origin. This field is user
-  //              defined and it is not used inside the GALICE code.
-  //      ntr     Number assigned to the particle in the ROOT stack.
-  //
-  char mecha[11];
-  Float_t polar[3]={0.,0.,0.};
-  for(int i=0; i<10 && i<cmlen; i++) mecha[i]=cmech[i];
-  mecha[10]=0;
-  Int_t pdg=gMC->PDGFromId(ipart);
-  gAlice->SetTrack(keep, parent-1, pdg, pmom, vpos, polar, tof, mecha, ntr);
-  ntr++;
-}
-
-//_____________________________________________________________________________
-extern "C" void type_of_call  rxkeep(const Int_t &n)
-{
-  if( NULL==gAlice ) exit(1);
-  
-  if( n<=0 || n>gAlice->Particles()->GetEntries() )
-    {
-      printf("  Bad index n=%d must be 0<n<=%d\n",
-            n,gAlice->Particles()->GetEntries());
-      exit(1);
-    }
-  
-  ((TParticle*)(gAlice->Particles()->UncheckedAt(n-1)))->SetBit(Keep_Bit);
-}
-
-//_____________________________________________________________________________
-extern "C" void type_of_call  rxouth ()
-{
-  //
-  // Called by Gtreve at the end of each primary track
-  //
-  gAlice->FinishPrimary();
-}
-
index a6b4cd984536a65e1ef7c11ef9a007ae7e6c5a9d..a678e9c0c03c4bfb98fe085628ce34c2d8cf028a 100644 (file)
@@ -132,12 +132,6 @@ public:
    virtual  void EnergySummary();
    virtual  const TDatabasePDG* PDGDB() const {return fPDGDB;}
 
-  // Functions from GEOCAD
-  //_______________________________________________________________________
-  
-   virtual void ReadEuclid(const char*, const AliModule*, char*);
-   virtual void ReadEuclidMedia(const char*, const AliModule*);
-
    TTree         *TreeD() {return fTreeD;}
    TTree         *TreeE() {return fTreeE;}
    TTree         *TreeH() {return fTreeH;}
diff --git a/STEER/AliVMC.cxx b/STEER/AliVMC.cxx
new file mode 100644 (file)
index 0000000..8e91cce
--- /dev/null
@@ -0,0 +1,41 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+#include "AliVMC.h"
+
+ClassImp(AliVMC)
+
+AliVMC* AliVMC::fgVMC=0;
+
+AliVMC* gVMC;
+
+AliVMC::AliVMC()
+{
+}
+
+AliVMC::AliVMC(const char *name, const char *title) : TNamed(name,title)
+{
+  if(fgVMC) {
+    printf("Cannot initialise twice Alice MonteCarlo class\n");
+  } else {
+    fgVMC=this;
+    gVMC=this;
+  }
+}
+
diff --git a/STEER/AliVMC.h b/STEER/AliVMC.h
new file mode 100644 (file)
index 0000000..c861cc8
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef ALIVMC_H
+#define ALIVMC_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//                                                                           //
+//    Generic interface to MC for AliRoot                                    //
+//                                                                           //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include <TNamed.h>
+
+class AliVMC : public TNamed 
+{
+
+private:
+  static AliVMC* fgVMC;
+
+public:
+  AliVMC(const char *name, const char *title);
+  AliVMC();
+  virtual ~AliVMC() {}
+  //Generic access functions
+  static inline AliVMC* GetVMC() {return fgVMC;}
+  //Generic Alice MonteCarlo Functions
+  virtual void FinishGeometry() = 0;
+  virtual void BuildPhysics() = 0;
+  virtual void ProcessEvent() = 0;
+
+  //
+  ClassDef(AliVMC,1) //Generic MonteCarlo Class
+
+};
+
+R__EXTERN AliVMC *gVMC;
+
+#endif
+
index 95818752065fec2a0f311c59c066e5878ad9833e..1d529a58efb6e8f55d86b3b2362d5be3b58f88b7 100644 (file)
@@ -13,7 +13,7 @@ SRCS          = AliDetector.cxx       AliHeader.cxx   AliMagF.cxx \
                 AliDigit.cxx   AliHit.cxx      AliPoints.cxx \
                 AliDisplay.cxx AliMC.cxx       AliRun.cxx AliGenerator.cxx \
                AliLego.cxx     AliModule.cxx   AliDigitNew.cxx \
-               AliGeometry.cxx AliRecPoint.cxx
+               AliGeometry.cxx AliRecPoint.cxx AliVMC.cxx
 
 # C++ Headers
 
index 2270407fd21230d922090341dc4844b8f10479b7..2b9488f6358b99f7dd93ce04105e6ab5a271025e 100644 (file)
@@ -27,7 +27,9 @@
 #pragma link C++ class  AliMagFC;
 #pragma link C++ class  AliMagFCM;
 #pragma link C++ class  AliMC;
+#pragma link C++ class  AliVMC;
 #pragma link C++ class  AliLego;
+#pragma link C++ class  AliLegoGenerator;
 #pragma link C++ class  AliDigitNew;
 #pragma link C++ class  AliGeometry;
 #pragma link C++ class  AliRecPoint-;
index 880670abd4bf76bf3df067e5d5a2d66368cafc27..f7a91a6a05eba8399da27668780a90ee1fb31f6f 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.11  1999/11/01 20:42:42  fca
+FRAME version 1 is now the symmetric one.
+
 Revision 1.10  1999/10/06 20:56:55  fca
 Introducing new frame 1099
 
@@ -75,7 +78,7 @@ void AliFRAMEv0::CreateGeometry()
   if(file) {
     fclose(file);
     printf(" Reading FRAME geometry\n");
-    gAlice->ReadEuclid(fEuclidGeometry.Data(),this,topvol);
+    ReadEuclid(fEuclidGeometry.Data(),topvol);
   } else {
     Warning("CreateGeometry","The Euclid file %s does not exist!\n",
            fEuclidGeometry.Data());
@@ -103,7 +106,7 @@ void AliFRAMEv0::CreateMaterials()
   delete [] filetmp;
   if(file) {
     fclose(file);
-    gAlice->ReadEuclidMedia(fEuclidMaterial.Data(),this);
+    ReadEuclidMedia(fEuclidMaterial.Data());
   } else {
     Warning("CreateMaterials","The material file %s does not exist!\n",
            fEuclidMaterial.Data());
index f5982b93865d1d8749ea19f4401091695b9f9062..305793c70008b3f3d525bac86352548d96b302e6 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.7  1999/11/01 20:42:42  fca
+FRAME version 1 is now the symmetric one.
+
 Revision 1.6  1999/09/29 09:24:30  fca
 Introduction of the Copyright and cvs Log
 
@@ -72,7 +75,7 @@ void AliFRAMEv1::CreateGeometry()
   if(file) {
     fclose(file);
     printf(" Reading FRAME geometry\n");
-    gAlice->ReadEuclid(fEuclidGeometry.Data(),this,topvol);
+    ReadEuclid(fEuclidGeometry.Data(),topvol);
   } else {
     Warning("CreateGeometry","The Euclid file %s does not exist!\n",
            fEuclidGeometry.Data());
@@ -100,7 +103,7 @@ void AliFRAMEv1::CreateMaterials()
   delete [] filetmp;
   if(file) {
     fclose(file);
-    gAlice->ReadEuclidMedia(fEuclidMaterial.Data(),this);
+    ReadEuclidMedia(fEuclidMaterial.Data());
   } else {
     Warning("CreateMaterials","The material file %s does not exist!\n",
            fEuclidMaterial.Data());
index a067cb6d4b4e1c289110a1623c871f6b5cec7063..b99098254c7f1ec85444c4b3103310d5f043691d 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.6  1999/09/29 09:24:30  fca
+Introduction of the Copyright and cvs Log
+
 */
 
 ////////////////////////////////////////////////
@@ -72,7 +75,7 @@ void AliPIPEv0::CreateGeometry()
   if(file) {
     fclose(file);
     printf(" Reading PIPE \n");
-    gAlice->ReadEuclid(pipename,this,topvol);
+    ReadEuclid(pipename,topvol);
   } else {
     printf(" THE GEOM FILE %s DOES NOT EXIST !\n",pipename);
     exit(1);
@@ -85,7 +88,7 @@ void AliPIPEv0::CreateGeometry()
   if(file) {
     fclose(file);
     printf(" Reading PUMP \n");
-    gAlice->ReadEuclid(pumpname,this,topvol);
+    ReadEuclid(pumpname,topvol);
   } else {
     printf(" THE GEOM FILE %s DOES NOT EXIST !\n",pumpname);
     exit(1);
@@ -124,7 +127,7 @@ void AliPIPEv0::CreateMaterials()
   delete [] filtmp;
   if(file) {
     fclose(file);
-    gAlice->ReadEuclidMedia(name,this);
+    ReadEuclidMedia(name);
   } else {
     printf(" THE MEDIA FILE %s DOES NOT EXIST !\n",name);
     exit(1);
diff --git a/TGeant3/AliGeant3.cxx b/TGeant3/AliGeant3.cxx
new file mode 100644 (file)
index 0000000..63374d6
--- /dev/null
@@ -0,0 +1,165 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+#include <TParticle.h>
+
+#include "AliGeant3.h"
+#include "AliRun.h"
+#include "TGeant3.h"
+#include "AliCallf77.h" 
+
+#ifndef WIN32
+
+# define rxgtrak rxgtrak_
+# define rxstrak rxstrak_
+# define rxkeep  rxkeep_ 
+# define rxouth  rxouth_
+#else
+
+# define rxgtrak RXGTRAK 
+# define rxstrak RXSTRAK 
+# define rxkeep  RXKEEP  
+# define rxouth  RXOUTH
+#endif
+
+ClassImp(AliGeant3)
+
+AliGeant3::AliGeant3()
+{
+  new TGeant3();
+}
+
+AliGeant3::AliGeant3(const char *title) : 
+  AliVMC("ALICE Virtual MC for Geant3",title)
+{
+  new TGeant3(title);
+}
+
+void AliGeant3::FinishGeometry()
+{
+  gMC->FinishGeometry();
+  //Create the color table
+  gMC->SetColors();
+}
+
+void AliGeant3::BuildPhysics()
+{
+  ((TGeant3*)gMC)->Gphysi();
+}
+
+void AliGeant3::ProcessEvent()
+{
+  ((TGeant3*)gMC)->Gtrigi();
+  ((TGeant3*)gMC)->Gtrigc();
+  ((TGeant3*)gMC)->Gtrig();
+}
+
+//_____________________________________________________________________________
+//
+//                 Interfaces to Fortran
+//
+//_____________________________________________________________________________
+
+extern "C" void type_of_call  rxgtrak (Int_t &mtrack, Int_t &ipart, Float_t *pmom, 
+                                      Float_t &e, Float_t *vpos, Float_t *polar,
+                                      Float_t &tof)
+{
+  //
+  //     Fetches next track from the ROOT stack for transport. Called by the
+  //     modified version of GTREVE.
+  //
+  //              Track number in the ROOT stack. If MTRACK=0 no
+  //      mtrack  more tracks are left in the stack to be
+  //              transported.
+  //      ipart   Particle code in the GEANT conventions.
+  //      pmom[3] Particle momentum in GeV/c
+  //      e       Particle energy in GeV
+  //      vpos[3] Particle position
+  //      tof     Particle time of flight in seconds
+  //
+  Int_t pdg;
+  gAlice->GetNextTrack(mtrack, pdg, pmom, e, vpos, polar, tof);
+  ipart = gMC->IdFromPDG(pdg);
+  mtrack++;
+}
+
+//_____________________________________________________________________________
+extern "C" void type_of_call 
+#ifndef WIN32
+rxstrak (Int_t &keep, Int_t &parent, Int_t &ipart, Float_t *pmom, 
+              Float_t *vpos, Float_t &tof, const char* cmech, Int_t &ntr, const int cmlen)
+#else
+rxstrak (Int_t &keep, Int_t &parent, Int_t &ipart, Float_t *pmom,
+        Float_t *vpos, Float_t &tof, const char* cmech, const int cmlen,
+        Int_t &ntr)
+#endif
+{
+  //
+  //     Fetches next track from the ROOT stack for transport. Called by GUKINE
+  //     and GUSTEP.
+  //
+  //              Status of the track. If keep=0 the track is put
+  //      keep    on the ROOT stack but it is not fetched for
+  //              transport.
+  //      parent  Parent track. If parent=0 the track is a primary.
+  //              In GUSTEP the routine is normally called to store
+  //              secondaries generated by the current track whose
+  //              ROOT stack number is MTRACK (common SCKINE.
+  //      ipart   Particle code in the GEANT conventions.
+  //      pmom[3] Particle momentum in GeV/c
+  //      vpos[3] Particle position
+  //      tof     Particle time of flight in seconds
+  //
+  //      cmech   (CHARACTER*10) Particle origin. This field is user
+  //              defined and it is not used inside the GALICE code.
+  //      ntr     Number assigned to the particle in the ROOT stack.
+  //
+  char mecha[11];
+  Float_t polar[3]={0.,0.,0.};
+  for(int i=0; i<10 && i<cmlen; i++) mecha[i]=cmech[i];
+  mecha[10]=0;
+  Int_t pdg=gMC->PDGFromId(ipart);
+  gAlice->SetTrack(keep, parent-1, pdg, pmom, vpos, polar, tof, mecha, ntr);
+  ntr++;
+}
+
+//_____________________________________________________________________________
+extern "C" void type_of_call  rxkeep(const Int_t &n)
+{
+  if( NULL==gAlice ) exit(1);
+  
+  if( n<=0 || n>gAlice->Particles()->GetEntries() )
+    {
+      printf("  Bad index n=%d must be 0<n<=%d\n",
+            n,gAlice->Particles()->GetEntries());
+      exit(1);
+    }
+  
+  ((TParticle*)(gAlice->Particles()->UncheckedAt(n-1)))->SetBit(Keep_Bit);
+}
+
+//_____________________________________________________________________________
+extern "C" void type_of_call  rxouth ()
+{
+  //
+  // Called by Gtreve at the end of each primary track
+  //
+  gAlice->FinishPrimary();
+}
+
diff --git a/TGeant3/AliGeant3.h b/TGeant3/AliGeant3.h
new file mode 100644 (file)
index 0000000..0bf2e27
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef ALIGEANT3_H
+#define ALIGEANT3_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//                                                                           //
+//    Generic interface to MC for AliRoot                                    //
+//                                                                           //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include <AliVMC.h>
+
+class AliGeant3 : public AliVMC
+{
+
+private:
+
+public:
+  AliGeant3(const char *title);
+  AliGeant3();
+  virtual ~AliGeant3() {}
+  //
+  //
+  void FinishGeometry();
+  void BuildPhysics();
+  void ProcessEvent();
+  ClassDef(AliGeant3,1) //Generic MonteCarlo Class
+
+};
+
+#endif
+
index 1734dcd003a3fe6cdb611420aaa4ce332c3e9142..9b3a38250b9674edf11a47784c4eee6a4eb3bcea 100644 (file)
@@ -14,7 +14,7 @@ FSRCS      = galicef.F
 # C++ sources
 
 GSRCS          = TGeant3.cxx TPaveTree.cxx THIGZ.cxx gucode.cxx \
-                 TGeant3GUI.cxx
+                 TGeant3GUI.cxx AliGeant3.cxx
 
 # C++ Headers
 
index 412c9f96172082ce467267d77e7712ac1aabe235..4c0675f5cb0f3333481b3682063eb625eb74c545 100644 (file)
 
 /*
 $Log$
+Revision 1.22  2000/01/18 15:40:13  morsch
+Interface to GEANT3 routines GFTMAT, GBRELM and GPRELM added
+Define geant particle type 51: Feedback Photon with Cherenkov photon properties.
+
 Revision 1.21  2000/01/17 19:41:17  fca
 Add SetERAN function
 
@@ -612,6 +616,13 @@ void TGeant3::GeomIter()
   fNextVol=fGcvolu->nlevel;
 }
 
+//____________________________________________________________________________ 
+void TGeant3::FinishGeometry()
+{
+  //Close the geometry structure
+  Ggclos();
+}
+  
 //____________________________________________________________________________ 
 Int_t TGeant3::NextVolUp(Text_t *name, Int_t &copy)
 {
index 42d07bd59bcfba33acacd6eeed940862d73e9347..ee3e362833b7a324fe7804eea5d4a2343e7d67f7 100644 (file)
@@ -576,6 +576,7 @@ public:
 //                                                                   //
 ///////////////////////////////////////////////////////////////////////
 
+  void FinishGeometry();
   void  GeomIter();
   Int_t CurrentMaterial(Float_t &a, Float_t &z, Float_t &dens, Float_t &radl, Float_t &absl) const;
   Int_t NextVolUp(Text_t *name, Int_t &copy);
index 044b51b10fd9417888e3e69daa067022018975b8..51ee12d2b1eb455df1b07e69a39a18a07bfb8416 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.16  2000/01/18 16:27:18  morsch
+Dummy definition of Gftmat, Gbrelm and Gprelm added.
+
 Revision 1.15  2000/01/17 19:41:17  fca
 Add SetERAN function
 
@@ -58,6 +61,7 @@ void TGeant3::LoadAddress() {}
 //=======================functions from GBASE
 
 //___________________________________________
+void    TGeant3::FinishGeometry() {}
 void    TGeant3::Gfile(const char*, const char*) {}
 void    TGeant3::GeomIter() {}
 Int_t   TGeant3::CurrentMaterial(Float_t &, Float_t &, Float_t &, Float_t &, Float_t &) const {return 0;}
index 8b132f7ee93c96cf5f6e54b1c2ee60dbb4b3cac8..16077374b7d6000b08a9c1d801c8906df86a7cc7 100644 (file)
@@ -8,6 +8,7 @@
 #pragma link off all classes;
 #pragma link off all functions;
  
+#pragma link C++ class  AliGeant3;
 #pragma link C++ class  TGeant3-;
 #pragma link C++ class  THIGZ;
 #pragma link C++ class  TPaveTree;
index c774a742f3cc64167d87f597bb5572e40bc25ce4..ce72c0d0401ab82123bc7593b8fef2f1862d5c3b 100644 (file)
@@ -1,7 +1,7 @@
 void Config()
 {
 
-new TGeant3("C++ Interface to Geant3");
+new AliGeant3("C++ Interface to Geant3");
 
 //=======================================================================
 //  Create the output file
@@ -584,7 +584,9 @@ AliMUON *MUON  = new AliMUONv0("MUON","normal MUON");
 //=================== PHOS parameters ===========================
 
 if(iPHOS) {
-AliPHOS *PHOS  = new AliPHOSv0("PHOS","normal PHOS");
+  AliPHOS *PHOS  = new AliPHOSv0("PHOS","normal PHOS");
+  AliPHOSGeometry *geom = new AliPHOSGeometry("default");
+  geom->Init();
 }