consistent integration of pyhtia and hijing kine tree.
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 Apr 2004 08:20:32 +0000 (08:20 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 Apr 2004 08:20:32 +0000 (08:20 +0000)
JETAN/AliJetEventParticles.cxx
JETAN/AliJetParticlesReader.h
JETAN/AliJetParticlesReaderKine.cxx
JETAN/AliJetParticlesReaderKine.h

index 719dea7..5c8a924 100644 (file)
@@ -80,7 +80,7 @@ void AliJetEventParticles::AddParticle(AliJetParticle* part)
 void AliJetEventParticles::AddParticle(const AliJetParticle* part)
 {
   //Adds new particle to the event
-  fParticles->AddAt(new AliJetParticle(*part),fNParticles++); 
+  new((*fParticles)[fNParticles++]) AliJetParticle(*part);
 }
 
 /**************************************************************************/ 
index b4f846c..8aec9eb 100644 (file)
@@ -43,12 +43,12 @@ class AliJetParticlesReader: public TNamed
   AliJetEventParticles* GetEventParticles(Bool_t o) 
     {fOwner=o; return fEventParticles;} //return particles and set ownership
 
-  Int_t GetNumberOfDirs()       const {return (fDirs)?fDirs->GetEntries():0;}
-  Int_t GetCurEventNumber()     const {return fCurrentEvent;}
-  Int_t GetCurDirNumber()       const {return fCurrentDir;}
-  Int_t GetTotEventsRead()      const {return fNEventsRead;} 
-  Int_t GetFirstEvent()         const {return fFirst;}
-  Int_t GetLastEvent()          const {return fLast;}
+  Int_t GetNumberOfDirs()   const {return (fDirs)?fDirs->GetEntries():0;}
+  Int_t GetCurEventNumber() const {return fCurrentEvent;}
+  Int_t GetCurDirNumber()   const {return fCurrentDir;}
+  Int_t GetTotEventsRead()  const {return fNEventsRead;} 
+  Int_t GetFirstEvent()     const {return fFirst;}
+  Int_t GetLastEvent()      const {return fLast;}
 
   protected:
 
index 4b5af82..816d1cd 100644 (file)
@@ -89,7 +89,7 @@ Int_t AliJetParticlesReaderKine::ReadNext()
   if((!fOwner) || (fEventParticles == 0)) 
     fEventParticles = new AliJetEventParticles();
 
-  do  
+  while(fCurrentDir < GetNumberOfDirs())
     { 
       if (!OpenFile(fCurrentDir))
       { 
@@ -131,16 +131,20 @@ Int_t AliJetParticlesReaderKine::ReadNext()
        {
          TParticle *p = stack->Particle(i);
          if(!p) continue;
-         if(p->GetFirstMother() >= 0) continue; 
+         Int_t child1 = p->GetFirstDaughter();
+         //Int_t child2 = p->GetLastDaughter();        
+         //Int_t mother = p->GetFirstMother();    
+         if((child1>=0) && (child1<npart)) continue; 
+         //cout << child1 << " " << child2 << " " << mother << endl;
 
          if(IsAcceptedParticle(p)) //put particle in event
            fEventParticles->AddParticle(p,i); 
        }
-
       fCurrentEvent++;
+      fCurrentDir++;
       fNEventsRead++;
       return kTRUE;
-    } while(fCurrentDir < GetNumberOfDirs());
+    }
       //end of loop over directories specified in fDirs Obj Array
   return kFALSE;
 }
@@ -159,6 +163,7 @@ Int_t AliJetParticlesReaderKine::OpenFile(Int_t n)
     }
 
   TString filename = dirname +"/"+ fFileName;
+  if(fRunLoader) delete fRunLoader;
   fRunLoader = AliRunLoader::Open(filename.Data()); 
 
   if (fRunLoader == 0)
index f0db5b3..bd61c72 100644 (file)
@@ -51,7 +51,8 @@ class AliJetParticlesReaderKine: public AliJetParticlesReader
 
 inline Bool_t AliJetParticlesReaderKine::IsAcceptedParticle(TParticle *p) const
 {
-  //if(p->GetStatusCode()%100!=1) return kFALSE;
+  //p->Print();
+
   Int_t pcode=p->GetPdgCode();  
   if ((pcode==11)||(pcode==-11)||(pcode==22)) {
     if(!fEM) return kFALSE;