Coding Rule violations corrected.
[u/mrichter/AliRoot.git] / EVGEN / AliGenCocktailAfterBurner.cxx
index f340258..8127ab0 100644 (file)
@@ -13,6 +13,8 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+/* $Id$ */
+
 // 
 // Container class for AliGenerator and AfterBurners 
 // (which are AliGenerators as well) through recursion.
 //             debug -> gDebug,
 //             fNEvents replaced with gAlice->GetEventsPerRun()
 //
-#include "AliGenCocktailAfterBurner.h"
-#include "AliGenCocktailEntry.h"
 
-#include "AliStack.h"
-#include <TObjArray.h>
+
+#include <Riostream.h>
+
 #include <TList.h>
+#include <TObjArray.h>
 #include <TParticle.h>
-#include <iostream.h>
+
+#include "AliGenCocktailAfterBurner.h"
+#include "AliGenCocktailEntry.h"
+#include "AliStack.h"
+#include "AliMC.h"
 
 
 ClassImp(AliGenCocktailAfterBurner)
@@ -45,7 +51,7 @@ AliGenCocktailAfterBurner::AliGenCocktailAfterBurner()
 {
 // Constructor
     if (gDebug > 0) 
-       cout<<"AliGenCocktailAfterBurner::AliGenCocktailAfterBurner()"<<endl;
+       cout<<"AliGenCocktailAfterBurner::AliGenCocktailAfterBurner()"<<endl;
     SetName("AliGenCocktailAfterBurner");
     SetTitle("AliGenCocktailAfterBurner");
     fInternalStacks =0;
@@ -60,6 +66,14 @@ AliGenCocktailAfterBurner::AliGenCocktailAfterBurner()
     fNBgEvents = 0;
 }
 /*********************************************************************/ 
+AliGenCocktailAfterBurner::AliGenCocktailAfterBurner(const AliGenCocktailAfterBurner& cocktail):
+    AliGenCocktail(cocktail)
+
+{
+ //Copy constructor
+    cocktail.Copy(*this);
+}
+
 /*********************************************************************/ 
 
 AliGenCocktailAfterBurner::~AliGenCocktailAfterBurner()
@@ -257,12 +271,13 @@ void AliGenCocktailAfterBurner::Generate()
 AliGenCocktailAfterBurner& AliGenCocktailAfterBurner::operator=(const  AliGenCocktailAfterBurner& rhs)
 {
 // Assignment operator
-    return *this;
+    rhs.Copy(*this);
+    return (*this);
 }
 /*********************************************************************/
 /*********************************************************************/ 
 
-AliStack* AliGenCocktailAfterBurner::GetStack(Int_t n)
+AliStack* AliGenCocktailAfterBurner::GetStack(Int_t n) const
 {
 //Returns the pointer to the N'th stack (event)
   if( ( n<0 ) || ( n>=GetNumberOfEvents() ) )
@@ -296,19 +311,19 @@ void AliGenCocktailAfterBurner::SetTracks(Int_t stackno)
     Int_t parent; 
     Int_t pdg;
     Double_t px, py, pz, e, vx, vy, vz, tof, polx, poly, polz;
-    AliMCProcess mech;
+    TMCProcess mech;
     Int_t ntr;
     Float_t weight;
     TVector3 pol;
     
     TParticle * p;
-    Int_t N = instack->GetNtrack();
+    Int_t n = instack->GetNtrack();
     if (gDebug) 
     {
-      cout<<"AliGenCocktailAfterBurner::SetTracks("<<stackno<<"). Number of particles is: "<<N<<"\n";
+      cout<<"AliGenCocktailAfterBurner::SetTracks("<<stackno<<"). Number of particles is: "<<n<<"\n";
     }
     
-    for(Int_t i = 0; i < N; i++)
+    for(Int_t i = 0; i < n; i++)
     {
        
       p = instack->Particle(i);
@@ -330,17 +345,17 @@ void AliGenCocktailAfterBurner::SetTracks(Int_t stackno)
       mech = AliGenCocktailAfterBurner::IntToMCProcess(p->GetUniqueID());
       weight = p->GetWeight();
 
-      gAlice->SetTrack(done, parent, pdg, px, py, pz, e, vx, vy, vz, tof,
+      gAlice->GetMCApp()->PushTrack(done, parent, pdg, px, py, pz, e, vx, vy, vz, tof,
                        polx, poly, polz, mech, ntr, weight);
     }
 }
 /*********************************************************************/ 
 /*********************************************************************/ 
 
-AliMCProcess AliGenCocktailAfterBurner::IntToMCProcess(Int_t no)
+TMCProcess AliGenCocktailAfterBurner::IntToMCProcess(Int_t no)
 {
- //Mothod used to convert uniqueID (integer) to AliMCProcess type
-    const AliMCProcess MCprocesses[kMaxMCProcess] = 
+ //Mothod used to convert uniqueID (integer) to TMCProcess type
+    const TMCProcess kMCprocesses[kMaxMCProcess] = 
     {
      kPNoProcess, kPMultipleScattering, kPEnergyLoss, kPMagneticFieldL, 
      kPDecay, kPPair, kPCompton, kPPhotoelectric, kPBrem, kPDeltaRay,
@@ -352,11 +367,15 @@ AliMCProcess AliGenCocktailAfterBurner::IntToMCProcess(Int_t no)
     
     for (Int_t i = 0;i<kMaxMCProcess;i++)
     {
-      if (MCprocesses[i] == no)
+      if (kMCprocesses[i] == no)
         {
-          //if (debug) cout<<"IntToMCProcess("<<no<<") returned AliMCProcess Named \""<<AliMCProcessName[MCprocesses[i]]<<"\""<<endl;
-          return MCprocesses[i];
+          return kMCprocesses[i];
         }
     } 
     return kPNoProcess;
 }
+
+void AliGenCocktailAfterBurner::Copy(AliGenCocktailAfterBurner &) const
+{
+    Fatal("Copy","Not implemented!\n");
+}