]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenMevSim.cxx
Threshold for digits in RecPoint introduced
[u/mrichter/AliRoot.git] / EVGEN / AliGenMevSim.cxx
index d9dd96a49173e5770ab385723ec505ca72e01f29..51bb9a821055b14d0b2340f08ffa96f26465e872 100644 (file)
 
 /*
 $Log$
+Revision 1.2  2001/03/28 07:31:48  hristov
+Loop variables declared only once (HP,Sun)
+
+Revision 1.1  2001/03/24 10:04:44  morsch
+MevSim interfaced through AliGenerator, first commit (Sylwester Radomski et al.)
+//Piotr Skowronski Line 104: fThetaMin-->fThetaMax
 */
 
 //
@@ -44,7 +50,7 @@ AliGenMevSim::AliGenMevSim() : AliGenerator(-1)
   //
   
   fConfig = new AliMevSimConfig();
-  fgMCEvGen = new TMevSim();
+  fMevSim = new TMevSim();
   sRandom = fRandom;
   
 }
@@ -52,7 +58,7 @@ AliGenMevSim::AliGenMevSim() : AliGenerator(-1)
 AliGenMevSim::AliGenMevSim(AliMevSimConfig *config): AliGenerator(-1) {
 
   fConfig = config;
-  fgMCEvGen = new TMevSim(); 
+  fMevSim = new TMevSim(); 
   sRandom = fRandom;
 }
 
@@ -62,7 +68,7 @@ AliGenMevSim::~AliGenMevSim()
   //
   // Standard destructor
   //
-  if (fgMCEvGen) delete fgMCEvGen;
+  if (fMevSim) delete fMevSim;
 }
 //____________________________________________________________________________
 void AliGenMevSim::SetConfig(AliMevSimConfig *config) {
@@ -72,7 +78,7 @@ void AliGenMevSim::SetConfig(AliMevSimConfig *config) {
 //____________________________________________________________________________
 void AliGenMevSim::AddParticleType(AliMevSimParticle *type) {
 
-  ((TMevSim*)fgMCEvGen)->AddPartTypeParams((TMevSimPartTypeParams*)type);
+  fMevSim->AddPartTypeParams((TMevSimPartTypeParams*)type);
 }
 //____________________________________________________________________________
 void AliGenMevSim::Init() 
@@ -83,7 +89,7 @@ void AliGenMevSim::Init()
 
   // fill data from AliMevSimConfig;
 
-  TMevSim *mevsim = (TMevSim*)fgMCEvGen;
+  TMevSim *mevsim = fMevSim;
 
   // geometry & momentum cut
 
@@ -93,8 +99,9 @@ void AliGenMevSim::Init()
     mevsim->SetPhiCutRange( fPhiMin * 180 / TMath::Pi() , fPhiMax * 180 / TMath::Pi() );
   
   if (TestBit(kThetaRange)) // from theta to eta
-    mevsim->SetEtaCutRange( -TMath::Log( TMath::Tan(fThetaMin/2)) , - TMath::Log( TMath::Tan(fThetaMin/2)) );
-
+  {
+    mevsim->SetEtaCutRange( -TMath::Log( TMath::Tan(fThetaMax/2)) , -TMath::Log( TMath::Tan(fThetaMin/2)) );
+  }  
 
   // mevsim specyfic parameters
   
@@ -116,6 +123,8 @@ void AliGenMevSim::Generate()
   // Temporary solution
   //
 
+  Int_t i;
+
   PDG_t pdg;
   Float_t orgin[3] = {0,0,0};
   Float_t polar[3] = {0,0,0};
@@ -134,7 +143,7 @@ void AliGenMevSim::Generate()
   orgin[2] = fVertex[2];
 
   cout << "Vertex ";
-  for (Int_t i =0; i<3; i++)
+  for (i =0; i<3; i++)
     cout << orgin[i] << "\t";
   cout << endl;
 
@@ -143,13 +152,13 @@ void AliGenMevSim::Generate()
   TClonesArray *particles = new TClonesArray("TParticle");
   TParticle *particle;
 
-  ((TMevSim*)fgMCEvGen)->GenerateEvent();
-  nParticles = ((TMevSim*)fgMCEvGen)->ImportParticles(particles,"");
-
-  cout << "Found " << nParticles << " particles ..." << endl;
+  fMevSim->GenerateEvent();
+  fNpart= fMevSim->ImportParticles(particles,"");
 
+  cout << "Found " << fNpart << " particles ..." << endl;
+  nParticles = fNpart;
 
-  for (Int_t i=0; i<nParticles; i++) {
+  for (i=0; i<nParticles; i++) {
     
     particle = (TParticle*) (*particles)[i];
 
@@ -158,7 +167,7 @@ void AliGenMevSim::Generate()
     p[1] = particle->Py();
     p[2] = particle->Pz();
     
-    gAlice->SetTrack(fTrackIt, parent, pdg, p, orgin, polar, time, kPPrimary, id);
+    SetTrack(fTrackIt, parent, pdg, p, orgin, polar, time, kPPrimary, id);
 
   }