]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenReaderCwn.cxx
Fixed coding conventions violations
[u/mrichter/AliRoot.git] / EVGEN / AliGenReaderCwn.cxx
index 48223bee7da52cbd2db5d040583ea77b849d1ae7..fb8fee7753b9f013e77f0d3f10595b2c83432074 100644 (file)
@@ -14,9 +14,7 @@
  **************************************************************************/
 
 
-/*
-$Log$
-*/
+/* $Id$ */
 
 // Read the old ALICE event format based on CW-ntuples
 // http://consult.cern.ch/alice/Internal_Notes/1995/32/abstract
@@ -25,19 +23,53 @@ $Log$
 // Author: andreas.morsch@cern.ch
 
 #include <TFile.h>
-#include <TTree.h>
 #include <TParticle.h>
+#include <TDatabasePDG.h>
+#include <TTree.h>
+#include <TVirtualMC.h>
 
 #include "AliGenReaderCwn.h"
-#include "AliMC.h"
-ClassImp(AliGenReaderCwn);
-
 
-AliGenReaderCwn::AliGenReaderCwn() 
+ClassImp(AliGenReaderCwn)
+
+AliGenReaderCwn::AliGenReaderCwn():
+    fNcurrent(0),
+    fNparticle(0),
+    fNparticleMax(0),
+    fTreeNtuple(0),
+    fNihead(0),
+    fNrhead(0),
+    fIdpart(0),
+    fTheta(0.),
+    fPhi(0.),
+    fP(0.),
+    fE(0.)
 {
 // Default constructor
-    fNcurrent   = 0;
-    fTreeNtuple = 0;
+}
+
+AliGenReaderCwn::AliGenReaderCwn(const AliGenReaderCwn &reader):
+    AliGenReader(reader),
+    fNcurrent(0),
+    fNparticle(0),
+    fNparticleMax(0),
+    fTreeNtuple(0),
+    fNihead(0),
+    fNrhead(0),
+    fIdpart(0),
+    fTheta(0.),
+    fPhi(0.),
+    fP(0.),
+    fE(0.)
+{
+    // Copy constructor
+    reader.Copy(*this);
+}
+
+
+AliGenReaderCwn::~AliGenReaderCwn()
+{
+    delete fTreeNtuple;
 }
 
 void AliGenReaderCwn::Init() 
@@ -78,7 +110,6 @@ Int_t AliGenReaderCwn::NextEvent()
 
     Int_t nentries = (Int_t) fTreeNtuple->GetEntries();
     if (fNcurrent < nentries) {
-       Int_t nb = (Int_t)fTreeNtuple->GetEvent(fNcurrent);
        fNcurrent++;
        
        Int_t i5=fIhead[4];
@@ -92,15 +123,14 @@ Int_t AliGenReaderCwn::NextEvent()
        }    
        fNparticleMax = nTracks;
        return nTracks;
-    } else {
-       return 0;
     }
+
     return 0;
 }
 
 TParticle* AliGenReaderCwn::NextParticle() 
 {
-//
+// Read next particle
 //  
     Float_t prwn;
     Float_t p[4];
@@ -121,9 +151,7 @@ TParticle* AliGenReaderCwn::NextParticle()
     p[1] = prwn*TMath::Sin(fTheta)*TMath::Sin(fPhi);      
     p[2] = prwn*TMath::Cos(fTheta);
     p[3] = fE;
-    TParticle* particle = new TParticle(fIdpart, 0, -1, -1, -1, -1, p[0], p[1], p[2], p[3], 
-                                       0., 0., 0., 0.);
-    Int_t nb = (Int_t)fTreeNtuple->GetEvent(fNcurrent);
+    TParticle* particle = new TParticle(fIdpart, 0, -1, -1, -1, -1, p[0], p[1], p[2], p[3], 0., 0., 0., 0.);
     fNcurrent++;
     fNparticle++;
     return particle;
@@ -131,6 +159,21 @@ TParticle* AliGenReaderCwn::NextParticle()
 
 
 
+AliGenReaderCwn& AliGenReaderCwn::operator=(const  AliGenReaderCwn& rhs)
+{
+// Assignment operator
+    rhs.Copy(*this);
+    return *this;
+}
+
+void AliGenReaderCwn::Copy(TObject&) const
+{
+    //
+    // Copy 
+    //
+    Fatal("Copy","Not implemented!\n");
+}
+