]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenReaderEcalJets.cxx
Converting PWG/TRD to native cmake
[u/mrichter/AliRoot.git] / EVGEN / AliGenReaderEcalJets.cxx
index cf1be513f6beb93940f7931f9d55e7750ea2a703..a6875ed2beb852cbf71618857f5fee2d05d33e56 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.2  2002/10/30 13:39:06  hristov
-Missing initialization added (Alpha)
-
-Revision 1.1  2002/01/08 09:59:34  morsch
-Readers for EMCAL primary particle input.
-
-*/
-
+/* $Id$ */
+//
+// Realisation of AliGenReader to be used with AliGenExtFile
+// It reads Pythia Jet 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 <TDatabasePDG.h>
+#include <TTree.h>
 
 #include "AliGenReaderEcalJets.h"
+
 ClassImp(AliGenReaderEcalJets)
 
 
-AliGenReaderEcalJets::AliGenReaderEcalJets() 
+AliGenReaderEcalJets::AliGenReaderEcalJets():
+    fNcurrent(0),
+    fNparticle(0),
+    fNev(0),
+    fNpart(0),
+    fNjet(0),     
+    fNsjet(0),
+    fNpjet(0),
+    fTreeNtuple(0) 
 {
 // Default constructor
-    fNcurrent   = 0;
-    fTreeNtuple = 0;
+    for (Int_t i = 0; i < 200; i++) {
+       if (i < 2) {
+           fX[i]     = 0.;    
+           fXtyp[i]  = 0; 
+       } else if (i < 10) {
+           fJet[i]   = 0.;  
+           fJeta[i]  = 0.; 
+           fJphi[i]  = 0.; 
+           fJset[i]  = 0.; 
+           fJseta[i] = 0.;
+           fJsphi[i] = 0.;
+           fJpet[i]  = 0.; 
+           fJpeta[i] = 0.;
+           fJpphi[i] = 0.;
+       } else {
+           fXpt[i]  = 0.;
+           fXeta[i] = 0.;
+           fXphi[i] = 0.;
+           fXid[i]  = 0; 
+       }
+    }
+}
+
+ AliGenReaderEcalJets::AliGenReaderEcalJets(const AliGenReaderEcalJets &reader)
+     :AliGenReader(reader),
+      fNcurrent(0),
+      fNparticle(0),
+      fNev(0),
+      fNpart(0),
+      fNjet(0),     
+      fNsjet(0),
+      fNpjet(0),
+      fTreeNtuple(0) 
+{
+    for (Int_t i = 0; i < 200; i++) {
+       if (i < 2) {
+           fX[i]     = 0.;    
+           fXtyp[i]  = 0; 
+       } else if (i < 10) {
+           fJet[i]   = 0.;  
+           fJeta[i]  = 0.; 
+           fJphi[i]  = 0.; 
+           fJset[i]  = 0.; 
+           fJseta[i] = 0.;
+           fJsphi[i] = 0.;
+           fJpet[i]  = 0.; 
+           fJpeta[i] = 0.;
+           fJpphi[i] = 0.;
+       } else {
+           fXpt[i]  = 0.;
+           fXeta[i] = 0.;
+           fXphi[i] = 0.;
+           fXid[i]  = 0; 
+       }
+    }
+
+    // Copy Constructor
+    reader.Copy(*this);
 }
 
 void AliGenReaderEcalJets::Init() 
@@ -100,8 +164,9 @@ Int_t AliGenReaderEcalJets::NextEvent()
 
 TParticle* AliGenReaderEcalJets::NextParticle() 
 {
-    Float_t p[4];
 // Read the next particle
+
+    Float_t p[4];
     Int_t    ipart  = fXid[fNparticle];
     Float_t  pt     = fXpt[fNparticle];
     Float_t  eta    = fXeta[fNparticle];
@@ -127,9 +192,19 @@ TParticle* AliGenReaderEcalJets::NextParticle()
 AliGenReaderEcalJets& AliGenReaderEcalJets::operator=(const  AliGenReaderEcalJets& rhs)
 {
 // Assignment operator
-    return *this;
+    rhs.Copy(*this);
+    return (*this);
 }
 
+void AliGenReaderEcalJets::Copy(TObject&) const
+{
+    //
+    // Copy 
+    //
+    Fatal("Copy","Not implemented!\n");
+}
+
+