]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenReaderEcalHijing.cxx
No effective C++ option for compilation of C files
[u/mrichter/AliRoot.git] / EVGEN / AliGenReaderEcalHijing.cxx
index a614b37749010427fed75c91d8b83ef1cee938ed..81348f6b910602a364e35631938127b20cb98fe4 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-*/
-
+/* $Id$ */
+//
+// Realisation of AliGenReader to be used with AliGenExtFile
+// It reads Hijing events from a ntuple like event structure.
+// The event format is defined in Init()
+// NextEvent() is used to loop over events and NextParticle() to loop over particles.  
+// Author: andreas.morsch@cern.ch
+//
 #include <TFile.h>
-#include <TTree.h>
 #include <TParticle.h>
+#include <TTree.h>
 
 #include "AliGenReaderEcalHijing.h"
-#include "AliMC.h"
-ClassImp(AliGenReaderEcalHijing)
 
+ClassImp(AliGenReaderEcalHijing)
 
-AliGenReaderEcalHijing::AliGenReaderEcalHijing() 
+AliGenReaderEcalHijing::AliGenReaderEcalHijing():
+    fNcurrent(0),
+    fNparticle(0),
+    fTreeNtuple(0),
+    fNjatt(0),
+    fNahij(0),
+    fNphij(0)
 {
 // Default constructor
-    fNcurrent   = 0;
-    fTreeNtuple = 0;
+}
+
+AliGenReaderEcalHijing::AliGenReaderEcalHijing(const AliGenReaderEcalHijing &reader):
+    AliGenReader(reader),
+    fNcurrent(0),
+    fNparticle(0),
+    fTreeNtuple(0),
+    fNjatt(0),
+    fNahij(0),
+    fNphij(0)
+{
+    // Copy constructor
+    reader.Copy(*this);
 }
 
 void AliGenReaderEcalHijing::Init() 
@@ -63,7 +83,7 @@ void AliGenReaderEcalHijing::Init()
 Int_t AliGenReaderEcalHijing::NextEvent() 
 {
 // Read the next event  
-    Int_t nTracks, nread;
+    Int_t nTracks=0, nread=0;
     
     TFile* pFile = fTreeNtuple->GetCurrentFile();
     pFile->cd();
@@ -83,8 +103,9 @@ Int_t AliGenReaderEcalHijing::NextEvent()
 
 TParticle* AliGenReaderEcalHijing::NextParticle() 
 {
-    Float_t p[4];
 // Read the next particle
+
+    Float_t p[4];
     Int_t ipart = fKhij[fNparticle];
     p[0] = fPxhij[fNparticle];
     p[1] = fPyhij[fNparticle];      
@@ -109,7 +130,16 @@ TParticle* AliGenReaderEcalHijing::NextParticle()
 AliGenReaderEcalHijing& AliGenReaderEcalHijing::operator=(const  AliGenReaderEcalHijing& rhs)
 {
 // Assignment operator
-    return *this;
+    rhs.Copy(*this);
+    return (*this);
+}
+
+void AliGenReaderEcalHijing::Copy(TObject&) const
+{
+    //
+    // Copy 
+    //
+    Fatal("Copy","Not implemented!\n");
 }