]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TGeant3/TGeant3.h
New files for folders and Stack
[u/mrichter/AliRoot.git] / TGeant3 / TGeant3.h
index ee3e362833b7a324fe7804eea5d4a2343e7d67f7..fd466ffdb1331f51c7c6b10cdf08eac2c28487f5 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef TGeant3_H 
-#define TGeant3_H 
+#ifndef TGEANT3_H 
+#define TGEANT3_H 
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
@@ -10,7 +10,7 @@
 //////////////////////////////////////////////// 
  
 #include <AliMC.h> 
-  
+
 //______________________________________________________________
 //
 //       Geant3 prototypes for commons
@@ -114,7 +114,7 @@ typedef struct  {
   Int_t    kcase; 
   Int_t    ngkine; 
   Float_t  gkin[MXGKIN][5]; 
-  Int_t    tofd[MXGKIN]; 
+  Float_t  tofd[MXGKIN]; 
   Int_t    iflgk[MXGKIN]; 
 } Gcking_t; 
 
@@ -308,9 +308,6 @@ typedef struct {
 //     +             ,ILOSS,SLOSS,SOLOSS,STLOSS,DPHYS2
 //     +             ,IMULS,SMULS,SOMULS,STMULS,DPHYS3
 //     +             ,IRAYL,SRAYL,SLRAYL,ZINTRA,STEPRA
-//      COMMON/GCPHLT/ILABS,SLABS,SLLABS,ZINTLA,STEPLA
-//     +             ,ISYNC
-//     +             ,ISTRA
 typedef struct { 
   Int_t    ipair;
   Float_t  spair;
@@ -378,6 +375,20 @@ typedef struct {
   Float_t  zintra;
   Float_t  stepra;
 } Gcphys_t; 
+
+//----------GCPHLT
+//      COMMON/GCPHLT/ILABS,SLABS,SLLABS,ZINTLA,STEPLA
+//     +             ,ISYNC
+//     +             ,ISTRA
+typedef struct { 
+  Int_t ilabs;
+  Float_t slabs;
+  Float_t sllabs;
+  Float_t zintla;
+  Float_t stepla;
+  Int_t isync;
+  Int_t istra;
+} Gcphlt_t;
  
 //----------GCOPTI 
 //      COMMON/GCOPTI/IOPTIM
@@ -510,54 +521,9 @@ typedef struct {
  *                                                                      *
  ************************************************************************/
 
+class AliDecayer;
 class TGeant3 : public AliMC { 
 
-private:
-  Int_t fNextVol;    // Iterator for GeomIter
-
-//--------------Declarations for ZEBRA--------------------- 
-  Int_t *fZiq, *fZlq; 
-  Float_t *fZq; 
-
-  Quest_t  *fQuest; 
-  Gcbank_t *fGcbank;
-  Gclink_t *fGclink; 
-  Gccuts_t *fGccuts; 
-  Gcmulo_t *fGcmulo; 
-  Gcmate_t *fGcmate; 
-  Gctpol_t *fGctpol; 
-  Gcnum_t  *fGcnum; 
-  Gcsets_t *fGcsets; 
-  Gcopti_t *fGcopti; 
-  Gctlit_t *fGctlit; 
-  Gcvdma_t *fGcvdma; 
-  Gcvolu_t *fGcvolu; 
-  Gckine_t *fGckine; 
-  Gcflag_t *fGcflag; 
-  Gctmed_t *fGctmed; 
-  Gcphys_t *fGcphys; 
-  Gcking_t *fGcking; 
-  Gckin2_t *fGckin2; 
-  Gckin3_t *fGckin3; 
-  Gctrak_t *fGctrak; 
-
-
-  // commons for GEANE
-  Ertrio_t *fErtrio;
-  Eropts_t *fEropts;
-  Eroptc_t *fEroptc;
-  Erwork_t *fErwork;
-
-  //Put here all volume names
-
-  char (*fVolNames)[5];           //! Names of geant volumes as C++ chars
-
-  enum {kMaxParticles = 100};
-
-  Int_t fNPDGCodes;
-
-  Int_t fPDGCode[kMaxParticles];
-
 public: 
   TGeant3(); 
   TGeant3(const char *title, Int_t nwgeant=0); 
@@ -565,6 +531,7 @@ public:
     delete [] fVolNames;
     fVolNames=0;}
   } 
+
   virtual void LoadAddress(); 
  
 ///////////////////////////////////////////////////////////////////////
@@ -576,7 +543,6 @@ 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);
@@ -584,21 +550,23 @@ public:
   Int_t CurrentVolOffID(Int_t off, Int_t &copy) const;
   const char* CurrentVolName() const;
   const char *CurrentVolOffName(Int_t off) const;
-  Int_t VolId(Text_t *name) const;
+  Int_t VolId(const Text_t *name) const;
   Int_t IdFromPDG(Int_t pdg) const;
   Int_t PDGFromId(Int_t pdg) const;
   void  DefineParticles();
   const char* VolName(Int_t id) const;
-  Float_t Xsec(char*, Float_t, Int_t, Int_t);
+  Float_t Xsec(char* reac, Float_t energy, Int_t part, Int_t mate);
   void  TrackPosition(TLorentzVector &xyz) const;
   void  TrackMomentum(TLorentzVector &xyz) const;  
   Int_t NofVolumes() const;
+  Int_t VolId2Mate(Int_t id) const;
   Float_t TrackTime() const;  
   Float_t TrackCharge() const;
   Float_t TrackMass() const;
   Float_t TrackStep() const;
   Float_t TrackLength() const;
   Int_t   TrackPid() const;
+  Bool_t IsNewTrack() const;
   Bool_t IsTrackInside() const;
   Bool_t IsTrackEntering() const;
   Bool_t IsTrackExiting() const;
@@ -608,26 +576,42 @@ public:
   Bool_t IsTrackAlive() const;
   Int_t  NSecondaries() const;
   Int_t  CurrentEvent() const;
-  const char*  ProdProcess() const;
-  void   GetSecondary(Int_t, Int_t&, TLorentzVector&, TLorentzVector&);
+  AliMCProcess  ProdProcess(Int_t isec) const;
+  Int_t  StepProcesses(TArrayI &proc) const;
+  void   GetSecondary(Int_t isec, Int_t& ipart, TLorentzVector &x, 
+                     TLorentzVector &p);
   void   StopTrack();
   void   StopEvent();
   Float_t MaxStep() const;
-  void   SetColors();
   void  SetMaxStep(Float_t maxstep);
   void  SetMaxNStep(Int_t maxnstp);
   Int_t GetMaxNStep() const;
+  void SetCut(const char* cutName, Float_t cutValue);
+  void SetProcess(const char* flagName, Int_t flagValue);
   //  void GetParticle(const Int_t pdg, char *name, Float_t &mass) const;
+  // Set the external decayer
+  void SetExternalDecayer(AliDecayer* decayer) {fDecayer=decayer;}
+  // Get the external decayer
+  AliDecayer* Decayer() const {return fDecayer;}
+
   virtual Int_t GetMedium() const;
   virtual Float_t Edep() const;
   virtual Float_t Etot() const;
-  virtual void    Rndm(Float_t* r, const Int_t n) const;
-  virtual void    Material(Int_t&, const char*, Float_t, Float_t, Float_t, Float_t,
-                           Float_t, Float_t* buf=0, Int_t nwbuf=0);
-  virtual void    Mixture(Int_t&, const char*, Float_t*, Float_t*, Float_t, Int_t, Float_t*);
-  virtual void    Medium(Int_t&, const char*, Int_t, Int_t, Int_t, Float_t, Float_t, 
-                  Float_t, Float_t, Float_t, Float_t, Float_t* ubuf=0, Int_t nbuf=0);
-  virtual void    Matrix(Int_t&, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t);
+
+  virtual void   Material(Int_t& kmat, const char* name, Float_t a, Float_t z,
+                          Float_t dens, Float_t radl, Float_t absl, 
+                          Float_t* buf=0, Int_t nwbuf=0);
+
+  virtual void   Mixture(Int_t& kmat, const char* name, Float_t* a,Float_t* z,
+                         Float_t dens, Int_t nlmat, Float_t* wmat);
+
+  virtual void   Medium(Int_t& kmed, const char* name, Int_t nmat, Int_t isvol,
+                       Int_t ifield, Float_t fieldm, Float_t tmaxfd,
+                       Float_t stemax, Float_t deemax, Float_t epsil,
+                       Float_t stmin, Float_t* ubuf=0, Int_t nbuf=0);
+
+  virtual void   Matrix(Int_t& krot, Float_t thex, Float_t phix, Float_t they,
+                       Float_t phiy, Float_t thez, Float_t phiz);
 
 /////////////////////////////////////////////////////////////////////////////////////////////
 //                                                                                         //
@@ -656,6 +640,7 @@ public:
   virtual Gcflag_t* Gcflag() const {return fGcflag;}
   virtual Gctmed_t* Gctmed() const {return fGctmed;}
   virtual Gcphys_t* Gcphys() const {return fGcphys;}
+  virtual Gcphlt_t* Gcphlt() const {return fGcphlt;}
   virtual Gcking_t* Gcking() const {return fGcking;}
   virtual Gckin2_t* Gckin2() const {return fGckin2;}
   virtual Gckin3_t* Gckin3() const {return fGckin3;}
@@ -704,7 +689,7 @@ public:
    virtual  void  Gmate(); 
    virtual  void  Gpart(); 
    virtual  void  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); 
    virtual  void  Gsdk(Int_t ipart, Float_t *bratio, Int_t *mode); 
    virtual  void  Gsmate(Int_t imat, const char *name, Float_t a, Float_t z,  
                          Float_t dens, Float_t radl, Float_t absl); 
@@ -718,7 +703,9 @@ public:
                          Float_t stmin); 
    virtual  void  Gstpar(Int_t itmed, const char *param, Float_t parval); 
  
-      // functions from GKINE 
+   virtual void  SetCerenkov(Int_t itmed, Int_t npckov, Float_t *ppckov,
+                            Float_t *absco, Float_t *effic, Float_t *rindex);
+  // functions from GKINE 
    virtual  void  Gfkine(Int_t itra, Float_t *vert, Float_t *pvert, 
                          Int_t &ipart, Int_t &nvert); 
    virtual  void  Gfvert(Int_t nvtx, Float_t *v, Int_t &ntbeam, Int_t &nttarg, Float_t &tofg); 
@@ -738,12 +725,12 @@ public:
    virtual  void  Gsxyz(); 
    virtual  void  Gtrack(); 
    virtual  void  Gtreve(); 
-   virtual  void  Gtreve_root(); 
+   virtual  void  GtreveRoot(); 
    virtual  void  Grndm(Float_t *rvec, const Int_t len) const; 
    virtual  void  Grndmq(Int_t &is1, Int_t &is2, const Int_t iseq, const Text_t *chopt); 
  
       // functions from GGEOM 
-   virtual  void  Gdxyz(Int_t ); 
+   virtual  void  Gdxyz(Int_t it); 
    virtual  void  Gdcxyz(); 
 
       // functions from GGEOM 
@@ -772,8 +759,9 @@ public:
    virtual  void  Gsatt(const char *name, const char *att, Int_t val);
    virtual  void  Gfpara(const char *name, Int_t number, Int_t intext, Int_t& npar,
                         Int_t& natt, Float_t* par, Float_t* att);
-   virtual  void  Gckpar(Int_t, Int_t, Float_t*);
-   virtual  void  Gckmat(Int_t, char*);
+   virtual  void  Gckpar(Int_t ish, Int_t npar, Float_t *par);
+   virtual  void  Gckmat(Int_t itmed, char *natmed);
+   virtual  Int_t Glvolu(Int_t nlev, Int_t *lnam,Int_t *lnum);
     
       // functions from GDRAW 
    virtual  void  DefaultRange();
@@ -794,7 +782,8 @@ public:
    virtual  void  Gdtree(const char *name,Int_t levmax=15,Int_t ispec=0);
    virtual  void  GdtreeParent(const char *name,Int_t levmax=15,Int_t ispec=0);
 
-   virtual  void  WriteEuclid(const char*, const char*, Int_t, Int_t);
+   virtual  void  WriteEuclid(const char* filnam, const char* topvol, 
+                             Int_t number, Int_t nlevel);
 
    virtual  void  SetABAN(Int_t par=1);
    virtual  void  SetANNI(Int_t par=1);
@@ -824,6 +813,7 @@ public:
    virtual  void  SetPFIS(Int_t par=1);
    virtual  void  SetPHOT(Int_t par=1);
    virtual  void  SetRAYL(Int_t par=1);
+   virtual  void  SetSTRA(Int_t par=0);
    virtual  void  SetSWIT(Int_t sw, Int_t val=1);
    virtual  void  SetTRIG(Int_t nevents=1);
    virtual  void  SetUserDecay(Int_t ipart);
@@ -839,6 +829,67 @@ public:
                        const Float_t *x2, const Float_t *p2,
                        Int_t ipa,  Option_t *chopt);
         
+  // Control Methods
+
+  virtual void FinishGeometry();
+  virtual void BuildPhysics();
+
+protected:
+  Int_t fNextVol;    // Iterator for GeomIter
+
+//--------------Declarations for ZEBRA--------------------- 
+  Int_t *fZiq;                //! Good Old IQ of Zebra
+  Int_t *fZlq;                //! Good Old LQ of Zebra
+  Float_t *fZq;               //! Good Old Q of Zebra
+
+  Quest_t  *fQuest;           //! QUEST common structure
+  Gcbank_t *fGcbank;          //! GCBANK common structure
+  Gclink_t *fGclink;          //! GCLINK common structure
+  Gccuts_t *fGccuts;          //! GCCUTS common structure
+  Gcmulo_t *fGcmulo;          //! GCMULO common structure
+  Gcmate_t *fGcmate;          //! GCMATE common structure
+  Gctpol_t *fGctpol;          //! GCTPOL common structure
+  Gcnum_t  *fGcnum;           //! GCNUM common structure
+  Gcsets_t *fGcsets;          //! GCSETS common structure
+  Gcopti_t *fGcopti;          //! GCOPTI common structure
+  Gctlit_t *fGctlit;          //! GCTLIT common structure
+  Gcvdma_t *fGcvdma;          //! GCVDMA common structure
+  Gcvolu_t *fGcvolu;          //! GCVOLU common structure
+  Gckine_t *fGckine;          //! GCKINE common structure
+  Gcflag_t *fGcflag;          //! GCFLAG common structure
+  Gctmed_t *fGctmed;          //! GCTMED common structure
+  Gcphys_t *fGcphys;          //! GCPHYS common structure
+  Gcphlt_t *fGcphlt;          //! GCPHLT common structure
+  Gcking_t *fGcking;          //! GCKING common structure
+  Gckin2_t *fGckin2;          //! GCKIN2 common structure
+  Gckin3_t *fGckin3;          //! GCKIN3 common structure
+  Gctrak_t *fGctrak;          //! GCTRAK common structure
+
+  // commons for GEANE
+  Ertrio_t *fErtrio;          //! ERTRIO common structure
+  Eropts_t *fEropts;          //! EROPTS common structure
+  Eroptc_t *fEroptc;          //! EROPTC common structure
+  Erwork_t *fErwork;          //! ERWORK common structure
+
+  //Put here all volume names
+
+  char (*fVolNames)[5];           //! Names of geant volumes as C++ chars
+
+  enum {kMaxParticles = 100};
+
+  Int_t fNPDGCodes;               // Number of PDG codes known by G3
+
+  Int_t fPDGCode[kMaxParticles];  // Translation table of PDG codes
+
+  AliDecayer* fDecayer;      // Pointer to decayer
+
+  AliMCProcess G3toVMC(Int_t iproc) const;
+
+private:
+  TGeant3(const TGeant3 &) {}
+  TGeant3 & operator=(const TGeant3&) {return *this;}
+
+
    ClassDef(TGeant3,1)  //C++ interface to Geant basic routines 
 };