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 719dea760f32be4968b4eddba326bdfc1fe4c9f2..5c8a924a637cb75ae2d2f4be959fcae501963b41 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 b4f846c4f2a3e0f561fe9828d05e7f9657b801ae..8aec9eb58bd8a22e12d4ba552825b29cd1be5813 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 4b5af827ac4e263115252dd04ae7dc2f23793803..816d1cdce23f636e27cb20dd4d6218397abc482a 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 f0db5b3c1981259ca42dfb3d5141f7d53e58c4c8..bd61c72906437f753a9cbeeffbf51450b706acfb 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;