Coding conventions
authoralibrary <alibrary@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 May 2006 05:08:50 +0000 (05:08 +0000)
committeralibrary <alibrary@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 May 2006 05:08:50 +0000 (05:08 +0000)
TMEVSIM/AliGenMevSim.cxx
TMEVSIM/AliGenMevSim.h

index 99a9375..2090369 100644 (file)
 // Sylwester Radomski <radomski@if.pw.edu.pl>
 //
 
-#include <Riostream.h>
-
-//#include "TSystem.h"
-//#include "TUnixSystem.h"
 #include "TParticle.h"
-#include "TMevSim.h"
+#include <Riostream.h>
 
 #include "AliGenMevSim.h"
-#include "AliRun.h"
+#include "AliMevSimConfig.h"
+#include "AliMevSimParticle.h"
+//#include "AliRun.h"
+#include "TMevSim.h"
 
-static TRandom * sRandom;
+static TRandom * gAliRandom;
 
 ClassImp(AliGenMevSim)
 
@@ -41,20 +40,22 @@ ClassImp(AliGenMevSim)
 AliGenMevSim::AliGenMevSim() : AliGenerator(-1) 
 {
   //
-  // Standard creator
+  // Default ctor
   //
-  
   fConfig = new AliMevSimConfig();
   fMevSim = new TMevSim();
-  sRandom = fRandom;
+  gAliRandom = fRandom;
   
 }
 //____________________________________________________________________________
-AliGenMevSim::AliGenMevSim(AliMevSimConfig *config): AliGenerator(-1) {
-
+AliGenMevSim::AliGenMevSim(AliMevSimConfig *config): AliGenerator(-1) 
+{
+  //
+  // Standard ctor
+  //
   fConfig = config;
   fMevSim = new TMevSim(); 
-  sRandom = fRandom;
+  gAliRandom = fRandom;
 }
 
 //____________________________________________________________________________
@@ -66,15 +67,23 @@ AliGenMevSim::~AliGenMevSim()
   if (fMevSim) delete fMevSim;
 }
 //____________________________________________________________________________
-void AliGenMevSim::SetConfig(AliMevSimConfig *config) {
-  
+void AliGenMevSim::SetConfig(AliMevSimConfig *config) 
+{
+  //
+  // Sets the MevSim configuration
+  //
   fConfig = config;
 }
-//____________________________________________________________________________
-void AliGenMevSim::AddParticleType(AliMevSimParticle *type) {
 
+//____________________________________________________________________________
+void AliGenMevSim::AddParticleType(AliMevSimParticle *type) 
+{
+  //
+  // Add one particle type to MevSim
+  //
   fMevSim->AddPartTypeParams((TMevSimPartTypeParams*)type);
 }
+
 //____________________________________________________________________________
 void AliGenMevSim::Init() 
 {
@@ -129,7 +138,7 @@ void AliGenMevSim::Generate()
   Float_t p[3] = {1,1,1};
   Float_t time = 0;
   
-  const Int_t parent = -1;
+  const Int_t kParent = -1;
   Int_t id;
 
   // vertexing 
@@ -165,17 +174,15 @@ void AliGenMevSim::Generate()
     p[1] = particle->Py();
     p[2] = particle->Pz();
     
-    PushTrack(fTrackIt, parent, pdg, p, orgin, polar, time, kPPrimary, id);
+    PushTrack(fTrackIt, kParent, pdg, p, orgin, polar, time, kPPrimary, id);
 
   }  
  
   particles->Clear();
   if (particles) delete particles;
 }
-//____________________________________________________________________________
-//____________________________________________________________________________
-
 
+//____________________________________________________________________________
 #ifndef WIN32
 # define ran ran_
 # define type_of_call
@@ -186,7 +193,9 @@ void AliGenMevSim::Generate()
 
 extern "C" Float_t type_of_call ran(Int_t &)
 {
-  return sRandom->Rndm(); 
+  //
+  //  Replacement for package random number generator
+  //
+  return gAliRandom->Rndm(); 
 }
 
-//____________________________________________________________________________
index e5fdfc5..e102f18 100644 (file)
@@ -9,19 +9,16 @@
 // Author: Sylwester Radomski <radomski@if.pw.edu.pl>
 
 
-#include "TString.h" 
-
 #include "AliGenerator.h"
 
-#include "AliMevSimConfig.h"
-#include "AliMevSimParticle.h"
+class AliMevSimConfig;
+class AliMevSimParticle;
 
 class TMevSim;
 
 class AliGenMevSim : public AliGenerator { 
 
 public:
-
   AliGenMevSim();
   AliGenMevSim(AliMevSimConfig *config);
 
@@ -33,10 +30,10 @@ public:
 
   virtual void Init();
   virtual void Generate();
+
 protected:
-  TMevSim * fMevSim;
-  AliMevSimConfig *fConfig;
-public:
+  TMevSim * fMevSim;           // Pointer to the MevSim generator
+  AliMevSimConfig *fConfig;    // Pointer to the Configuration class
       
   ClassDef(AliGenMevSim,1) // Interface class for AliMevsim