]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - THerwig/AliGenHerwig.cxx
Obsolete - removed
[u/mrichter/AliRoot.git] / THerwig / AliGenHerwig.cxx
index b0f294e00e65b0843551dac84c5ce44ef8237220..53b7f73921a4badf7f849dd0fb161c3aed5922f6 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.4  2002/10/14 14:55:35  hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
-
-Revision 1.2.2.3  2002/10/11 10:40:46  hristov
-Default case added
-
-Revision 1.2.2.2  2002/07/26 18:34:02  alibrary
-Updating VirtualMC
-
-Revision 1.3  2002/07/26 15:32:24  hristov
-stream.h doesn't exest on Sun, removed from includes
-
-Revision 1.2  2002/07/19 11:43:10  morsch
-- Write full stack.
-- Use SetTrack passing energy.
-
-Revision 1.1  2002/07/16 11:33:26  morsch
-First commit.
-
-*/
-
+/* $Id$ */
 
 
 // Generator using Herwig as an external generator
@@ -49,8 +27,11 @@ First commit.
 #include "THerwig6.h"
 
 #include "Riostream.h"
+#include "AliMC.h"
+
+ClassImp(AliGenHerwig)
 
- ClassImp(AliGenHerwig)
+static TRandom * sRandom;
 
 AliGenHerwig::AliGenHerwig()
 {
@@ -79,8 +60,10 @@ AliGenHerwig::AliGenHerwig(Int_t npart)
 }
 
 AliGenHerwig::AliGenHerwig(const AliGenHerwig & Herwig)
+    :AliGenMC(Herwig)
 {
-// copy constructor
+// Copy constructor
+    Herwig.Copy(*this);
 }
 
 
@@ -95,7 +78,7 @@ void AliGenHerwig::Init()
   fTarget.Resize(8);
   fProjectile.Resize(8);
   SetMC(new THerwig6());
-  fHerwig=(THerwig6*) fgMCEvGen;
+  fHerwig=(THerwig6*) fMCEvGen;
   // initialize common blocks
   fHerwig->Initialize(fProjectile, fTarget, fMomentum1, fMomentum2, fProcess);
   // reset parameters according to user needs
@@ -222,7 +205,7 @@ void AliGenHerwig::Generate()
                Float_t tof = kconv*iparticle->T();
                Int_t   iparent = (imo > -1) ? newPos[imo] : -1;
                Int_t   trackIt = (ks == 1) && fTrackIt;
-               gAlice->SetTrack(trackIt, iparent, kf,
+               gAlice->GetMCApp()->PushTrack(trackIt, iparent, kf,
                                 p[0], p[1], p[2], p[3],
                                 origin[0], origin[1], origin[2], 
                                 tof,
@@ -257,9 +240,9 @@ void AliGenHerwig::AdjustWeights()
 {
 // Adjust the weights after generation of all events
     TParticle *part;
-    Int_t ntrack=gAlice->GetNtrack();
+    Int_t ntrack=gAlice->GetMCApp()->GetNtrack();
     for (Int_t i=0; i<ntrack; i++) {
-        part= gAlice->Particle(i);
+        part= gAlice->GetMCApp()->Particle(i);
         part->SetWeight(part->GetWeight()*fKineBias);
     }
 }
@@ -337,7 +320,8 @@ void AliGenHerwig::FinishRun()
 AliGenHerwig& AliGenHerwig::operator=(const  AliGenHerwig& rhs)
 {
 // Assignment operator
-    return *this;
+    rhs.Copy(*this);
+    return (*this);
 }