5 #include <TCollection.h>
9 #include "AliJFMCJet.h"
10 #include "AliJFMCJetFinder.h"
12 ClassImp(AliJFMCJetFinder)
14 AliJFMCJetFinder::AliJFMCJetFinder(Int_t n) : AliJFJetFinder(n), fParticles(NULL), fJet(NULL)
18 AliJFMCJetFinder::~AliJFMCJetFinder()
23 Int_t AliJFMCJetFinder::Init(TClonesArray *particles)
25 if(particles==NULL) return 0;
28 return fParticles->GetEntries();
31 Int_t AliJFMCJetFinder::Run()
33 if(fParticles==NULL) return 0;
35 TIterator *iter=fParticles->MakeIterator();
38 while((p=(TParticle*)iter->Next()) != NULL){
39 if(p->GetPdgCode()==92){
40 fJets.AddAt(new AliJFMCJet(),fNJets);
41 fJet=(AliJFMCJet*)fJets.At(fNJets);
42 fJet->SetNJet(++fNJets);
43 FollowDaughters(p->GetFirstDaughter(),p->GetLastDaughter());
44 //cout << "Add new Jet " << fNJets << "with " << fJet->GetE() << " " << fJet->GetE_() << " " << fJet->GetNPart() << endl;
55 void AliJFMCJetFinder::Debug()
57 TIterator *iter=fJets.MakeIterator();
60 while((j=(AliJFMCJet*)iter->Next()) != NULL){
62 //cout << j << ": " << j->GetNPart() << " " << j->GetNJet() << " " << j->GetPtMax() << endl;
67 for(Int_t i=0;i<fNJets;i++){
68 JFJet *j=(JFMCJet*)fJets->At(i);
69 cout << i << ": " << j->GetNPart()<< " " << j->GetNJet() << endl;
74 void AliJFMCJetFinder::FollowDaughters(Int_t first, Int_t last)
76 if(last<first) return;
78 for(Int_t i=first-1;i<=last-1;i++){
79 //Fortran (Pythia/Hijing) has different numbering than TParticle
81 TParticle *p = (TParticle *)fParticles->At(i);
82 if(p->GetStatusCode()!=1){
83 FollowDaughters(p->GetFirstDaughter(),p->GetLastDaughter());
86 if(!IsAcceptedParticle(p)) continue;
95 void AliJFMCJetFinder::Clean()