doxy: install THtml converter
[u/mrichter/AliRoot.git] / EVGEN / AliGenReaderCwn.cxx
index 8cf8dfe..0844449 100644 (file)
 
 #include <TFile.h>
 #include <TParticle.h>
+#include <TDatabasePDG.h>
 #include <TTree.h>
 #include <TVirtualMC.h>
 
 #include "AliGenReaderCwn.h"
 
-ClassImp(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
+    Int_t i;
+    for (i = 0; i <  6; i++) fRhead[i] = 0.;
+    for (i = 0; i < 12; i++) fIhead[i] = 0;
+}
 
 
-AliGenReaderCwn::AliGenReaderCwn() 
+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.)
 {
-// Default constructor
-    fNcurrent   = 0;
-    fTreeNtuple = 0;
+    // Copy constructor
+    Int_t i;
+    for (i = 0; i <  6; i++) fRhead[i] = 0.;
+    for (i = 0; i < 12; i++) fIhead[i] = 0;
+    reader.Copy(*this);
 }
 
+
 AliGenReaderCwn::~AliGenReaderCwn()
 {
     delete fTreeNtuple;
@@ -102,12 +137,12 @@ Int_t AliGenReaderCwn::NextEvent()
 
 TParticle* AliGenReaderCwn::NextParticle() 
 {
-//
+// Read next particle
 //  
     Float_t prwn;
     Float_t p[4];
 // Read the next particle
-    if (fCode == kGEANT3) fIdpart=gMC->PDGFromId(fIdpart);
+    if (fCode == kGEANT3) fIdpart=TVirtualMC::GetMC()->PDGFromId(fIdpart);
     Double_t amass = TDatabasePDG::Instance()->GetParticle(fIdpart)->Mass();
     if(fE<=amass) {
        Warning("Generate","Particle %d  E = %f mass = %f %f %f \n",