]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Support for Cerenkov and process list in Virtual MC
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 20 Dec 2000 08:39:39 +0000 (08:39 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 20 Dec 2000 08:39:39 +0000 (08:39 +0000)
ALIROOT/aliroot.cxx
STEER/AliMC.h
TGeant3/AliGeant3.cxx
TGeant3/TGeant3.cxx
TGeant3/TGeant3.h
TGeant3/TGeant3Dummy.cxx

index 74fb05706ca44fbe92b796e1f73cd51858325396..ff1e727897f4631f682fdf34a7d7440fd0a36162 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.3  1999/09/29 09:24:07  fca
+Introduction of the Copyright and cvs Log
+
 */
 
 //////////////////////////////////////////////////////////////////////////
@@ -75,16 +78,15 @@ int main(int argc, char **argv)
   // run and event number, the number of vertices, tracks and primary tracks
   // in the event.
   //
-  new AliRun("gAlice"," The Alice Geant3-based MonteCarlo");
+  new AliRun("gAlice","The ALICE Off-line Simulation Framework");
   
   // Start interactive geant
   
   TRint *theApp = new TRint("aliroot", &argc, argv, 0, 0);
   
-  // --- Initialisation of the GALICE package ---
+  // --- Start the event loop ---
   theApp->Run();
   
-  // --- Simulation of all events ---
   return(0);
 }
 
index 2ae513bcce519900302fd052ff5b795b5b6cae07..25388a9767209372e19e3f28e88531fcb06b7145 100644 (file)
@@ -20,6 +20,7 @@
 class TLorentzVector;
 class AliMC;
 class AliDecayer;
+class TArrayI;
 
 R__EXTERN AliMC *gMC;
 
@@ -75,7 +76,11 @@ class AliMC : public TNamed, public AliRndm
                         const char *konly="ONLY") = 0; 
     virtual void  Gsposp(const char *name, Int_t nr, const char *mother,  
                          Float_t x, Float_t y, Float_t z, Int_t irot,
-                         const char *konly, Float_t *upar, Int_t np) = 0; 
+                         const char *konly, Float_t *upar, Int_t np) = 0;
+
+    virtual void  SetCerenkov(Int_t itmed, Int_t npckov, Float_t *ppckov,
+                  Float_t *absco, Float_t *effic, Float_t *rindex) = 0;
+  
     
     // functions for drawing
     virtual void  DrawOneSpec(const char* name) = 0;
@@ -165,7 +170,8 @@ class AliMC : public TNamed, public AliRndm
     virtual Int_t NSecondaries() const=0;
     virtual void  GetSecondary(Int_t isec, Int_t& particleId, 
                     TLorentzVector& position, TLorentzVector& momentum) =0;
-    virtual AliMCProcess ProdProcess() const =0; 
+    virtual AliMCProcess ProdProcess(Int_t isec) const =0; 
+    virtual Int_t StepProcesses(TArrayI &proc) const = 0;
 
     //
     // other (then geometry/step/run management) methods
index 3f02c2fcc5442fe0da866265f4c580b6e12016b9..101589bd296b380f0ee1180a4fefba318e2d182a 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.13  2000/11/30 07:12:54  alibrary
+Introducing new Rndm and QA classes
+
 Revision 1.12  2000/11/06 11:35:46  morsch
 Call BuildGeometry() after Init() to be able to share common detector parameters.
 
@@ -744,7 +747,7 @@ void gustep()
 
   // --- Add new created particles 
   if (gMC->NSecondaries() > 0) {
-    pProc=gMC->ProdProcess();
+    pProc=gMC->ProdProcess(0);
     for (jk = 0; jk < geant3->Gcking()->ngkine; ++jk) {
       ipp = Int_t (geant3->Gcking()->gkin[jk][4]+0.5);
       // --- Skip neutrinos! 
index c3e725a5660c099aa714523e94298a630d5b0481..8d3dc43f194049e61967f70322b0f586fed4f201 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+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
 
@@ -126,6 +129,7 @@ Introduction of the Copyright and cvs Log
 #include "TROOT.h" 
 #include "TDatabasePDG.h"
 #include "TLorentzVector.h"
+#include "TArrayI.h"
 
 #include "THIGZ.h" 
 #include "TGeant3.h" 
@@ -1754,14 +1758,13 @@ Int_t   TGeant3::CurrentEvent() const
 }
 
 //_____________________________________________________________________________
-AliMCProcess TGeant3::ProdProcess() const
+AliMCProcess TGeant3::ProdProcess(Int_t ) const
 {
   //
   // Name of the process that has produced the secondary particles
   // in the current step
   //
-  const Int_t kIpMec[13] = { 5,6,7,8,9,10,11,12,21,23,25,105,108 };
-  const Int_t kIpProc[13] = { kPDecay, kPPair, kPCompton, 
+  const AliMCProcess kIpProc[13] = { kPDecay, kPPair, kPCompton, 
                              kPPhotoelectric, kPBrem, kPDeltaRay,
                              kPAnnihilation, kPHadronic, 
                              kPMuonNuclear, kPPhotoFission,
@@ -1771,12 +1774,56 @@ AliMCProcess TGeant3::ProdProcess() const
   if(fGcking->ngkine>0) 
     for (km = 0; km < fGctrak->nmec; ++km) 
       for (im = 0; im < 13; ++im) 
-       if (fGctrak->lmec[km] == kIpMec[im]) 
-           return (AliMCProcess) kIpProc[im];
+       if (G3toVMC(fGctrak->lmec[km]) == kIpProc[im]) 
+           return kIpProc[im];
   //  
-  return (AliMCProcess) kPNoProcess;
+  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)
@@ -2408,7 +2455,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 
index 88eddc9fa47108b3cedcc89a179efdc092e0570e..c62133e4c123ee7cee26b73f537eb1ea284d307a 100644 (file)
@@ -577,7 +577,8 @@ public:
   Bool_t IsTrackAlive() const;
   Int_t  NSecondaries() const;
   Int_t  CurrentEvent() const;
-  AliMCProcess  ProdProcess() const;
+  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();
@@ -689,7 +690,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); 
@@ -703,7 +704,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); 
@@ -832,7 +835,7 @@ public:
   virtual void FinishGeometry();
   virtual void BuildPhysics();
 
- protected:
+protected:
   Int_t fNextVol;    // Iterator for GeomIter
 
 //--------------Declarations for ZEBRA--------------------- 
@@ -880,10 +883,10 @@ public:
 
   Int_t fPDGCode[kMaxParticles];  // Translation table of PDG codes
 
+  AliDecayer* fDecayer;      // Pointer to decayer
 
+  AliMCProcess G3toVMC(Int_t iproc) const;
 
-protected:
-    AliDecayer* fDecayer;      // Pointer to decayer
 private:
   TGeant3(const TGeant3 &) {}
   TGeant3 & operator=(const TGeant3&) {return *this;}
index 9b7607fae9433cfb54d3c2c509082e965dcc96db..027ca4aad6ad003e381b3812804aa34b293509a1 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.26  2000/12/18 11:33:50  alibrary
+New call frequence histograms per module and volume
+
 Revision 1.25  2000/11/30 07:12:54  alibrary
 Introducing new Rndm and QA classes
 
@@ -120,7 +123,9 @@ Bool_t  TGeant3::IsTrackOut() const {return 0;}
 Bool_t  TGeant3::IsTrackDisappeared() const {return 0;}
 Bool_t  TGeant3::IsTrackStop() const {return 0;}
 Int_t   TGeant3::NSecondaries() const {return 0;}
-AliMCProcess TGeant3::ProdProcess() const {return kPNoProcess;}
+AliMCProcess TGeant3::ProdProcess(Int_t) const {return kPNoProcess;}
+AliMCProcess TGeant3::G3toVMC(Int_t) const {return kPNoProcess;}
+Int_t  TGeant3::StepProcesses(TArrayI &) const {return 0;}
 void    TGeant3::GetSecondary(Int_t, Int_t&, 
                              TLorentzVector&, TLorentzVector&){}
 Float_t TGeant3::MaxStep() const {return 0;}
@@ -185,8 +190,8 @@ void  TGeant3::Gsmixt(Int_t, const char*, Float_t*, Float_t*, Float_t, Int_t, Fl
 void  TGeant3::Gspart(Int_t, const char*, Int_t,   Float_t, Float_t, Float_t) {}
 void  TGeant3::Gstmed(Int_t, const char*, Int_t, Int_t, 
                    Int_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t) {}
-void  TGeant3::Gstpar(Int_t, const char*, Float_t) {}
 void  TGeant3::Gsckov(Int_t, Int_t, Float_t *, Float_t *, Float_t *, Float_t *) {}
+void  TGeant3::Gstpar(Int_t, const char*, Float_t) {}
 
 
 //=======================functions from GKINE
@@ -201,6 +206,8 @@ Int_t TGeant3::Gsvert(Float_t*, Int_t, Int_t, Float_t*, Int_t){return 0;}
 //=======================functions from GPHYS
 //___________________________________________
 void  TGeant3::Gphysi() {}
+void  TGeant3::SetCerenkov(Int_t, Int_t, Float_t *, Float_t *, 
+                          Float_t *, Float_t *) {}
 
 
 //=======================functions from GTRAK