]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenReaderEMD.cxx
Updates(C. Oppedisano)
[u/mrichter/AliRoot.git] / EVGEN / AliGenReaderEMD.cxx
index ff6f218d4a8f4e244ff9ab7ceadba69640cc0268..32879c1acaa46f5012070e8317cb5bf05e3886a3 100644 (file)
 
 ClassImp(AliGenReaderEMD)
 
-
-  // -----------------------------------------------------------------------------------
-AliGenReaderEMD::AliGenReaderEMD() 
+AliGenReaderEMD::AliGenReaderEMD():
+    fStartEvent(0),
+    fNcurrent(0),  
+    fNparticle(0), 
+    fTreeNtuple(0),
+    fIPSide(0),
+    fPcToTrack(0),
+    fNnLeft(0),
+    fEnLeft(0),
+    fNnRight(0),
+    fEnRight(0),
+    fNpLeft(0),
+    fEtapLeft(0),
+    fNpRight(0),
+    fEtapRight(0)
 {
 // Default constructor
-    fStartEvent  = 0;
-    fTreeNtuple  = 0;
-    fIPSide      = 0;
-    fPcToTrack = 0;
 }
 
+AliGenReaderEMD::AliGenReaderEMD(const AliGenReaderEMD &reader):
+    AliGenReader(reader),
+    fStartEvent(0),
+    fNcurrent(0),  
+    fNparticle(0), 
+    fTreeNtuple(0),
+    fIPSide(0),
+    fPcToTrack(0),
+    fNnLeft(0),
+    fEnLeft(0),
+    fNnRight(0),
+    fEnRight(0),
+    fNpLeft(0),
+    fEtapLeft(0),
+    fNpRight(0),
+    fEtapRight(0)
+{
+    // Copy Constructor
+    reader.Copy(*this);
+}
   // -----------------------------------------------------------------------------------
 AliGenReaderEMD::~AliGenReaderEMD()
 {
@@ -127,21 +155,21 @@ Int_t AliGenReaderEMD::NextEvent()
        // #### fPcToTrack      =0->neutrons, =1->protons
        if(fIPSide==0){
          if(fPcToTrack==0){
-           printf("\n \t \t Tracking %d neutrons emitted on RIGHT side\n\n", fNnRight);
+           printf("\n \t \t Tracking %d neutrons emitted on C side\n\n", fNnRight);
            nTracks    = fNnRight;
          }
          else if(fPcToTrack==1){
-           printf("\n \t \t Tracking %d protons emitted on RIGHT side\n\n", fNpRight);
+           printf("\n \t \t Tracking %d protons emitted on C side\n\n", fNpRight);
            nTracks    = fNpRight;
          }
        }
        else if(fIPSide==1){
          if(fPcToTrack==0){
-           printf("\n \t \t Tracking %d neutrons emitted on LEFT side\n", fNnLeft);
+           printf("\n \t \t Tracking %d neutrons emitted on A side\n", fNnLeft);
            nTracks    = fNnLeft;
          }
          else if(fPcToTrack==1){
-           printf("\n \t \t Tracking %d protons emitted on LEFT side\n", fNpLeft);
+           printf("\n \t \t Tracking %d protons emitted on A side\n", fNpLeft);
            nTracks    = fNpLeft;
          }
        }
@@ -157,8 +185,12 @@ TParticle* AliGenReaderEMD::NextParticle()
 {
     // Read the next particle
     Float_t p[4];
-    Int_t ipart = kNeutron;
-    Double_t amass = TDatabasePDG::Instance()->GetParticle(kNeutron)->Mass();
+
+    Int_t ipart=0;
+    if(fPcToTrack==0) ipart = kNeutron;
+    else  if(fPcToTrack==1) ipart = kProton;
+    Double_t amass = TDatabasePDG::Instance()->GetParticle(ipart)->Mass();
+
     p[0] = fPxnRight[fNparticle];
     p[1] = fPynRight[fNparticle];
     p[2] = fPznRight[fNparticle];