+void AliEMCALJetFinder::FillFromParticles()
+{
+// 26-feb-2002 PAI - for checking all chain
+// Work on particles level; accept all particle (not neutrino )
+
+ Double_t PX=0, PY=0, PZ=0, E=0; // checking conservation law
+ fNChTpc = 0;
+
+ ResetMap();
+ if (!fLego) BookLego();
+ fLego->Reset();
+//
+// Access particles information
+ Int_t npart = (gAlice->GetHeader())->GetNprimary();
+ if (fDebug >= 2 || npart<=0) {
+ printf(" AliEMCALJetFinder::FillFromParticles : npart %i\n", npart);
+ if(npart<=0) return;
+ }
+ fNt = npart;
+ fNtS = 0;
+ RearrangeParticlesMemory(npart);
+
+// Go through the particles
+ Int_t mpart, child1, child2, geantPdg;
+ Float_t pT, phi, eta, e=0, px=0, py=0, pz=0;
+ TParticle *MPart=0;
+ for (Int_t part = 0; part < npart; part++) {
+
+ fTrackList[part] = 0;
+
+ MPart = gAlice->Particle(part);
+ mpart = MPart->GetPdgCode();
+ child1 = MPart->GetFirstDaughter();
+ child2 = MPart->GetLastDaughter();
+ pT = MPart->Pt();
+ phi = MPart->Phi();
+ eta = MPart->Eta();
+
+ px = MPart->Px();
+ py = MPart->Py();
+ pz = MPart->Pz();
+ e = MPart->Energy();
+
+// see pyedit in Pythia's text
+ geantPdg = mpart;
+// Int_t kc = pycomp_(&mpart);
+// TString name = GetPythiaParticleName(mpart);
+ // printf(" mpart %6.6i;kc %6.6i -> gid %3.3i",mpart,kc,geantPdg);
+ //printf(" (%s)\n", name.Data());
+ if (IsThisPartonsOrDiQuark(mpart)) continue;
+ printf("%5i: %5i(%2i) px %5.1f py %5.1f pz %6.1f e %6.1f childs %5i,%5i \n",
+ part, mpart, geantPdg, px, py, pz, e, child1, child2);
+
+// exclude partons (21 - gluon, 92 - string)
+
+
+// exclude neutrinous also ??
+ if (fDebug >= 11 && pT>0.01)
+ printf("\n part:%5d mpart %5d eta %9.2f phi %9.2f pT %9.2f ",
+ part, mpart, eta, phi, pT);
+
+ fPtT[part] = pT;
+ fEtaT[part] = eta;
+ fPhiT[part] = phi;
+ fPdgT[part] = mpart;
+
+// final state only
+ if (child1 >= 0 && child1 < npart) continue;
+
+ // printf("%4i -> %5i(%3i) px %6.1f py %6.1f pz %7.1f e %8.2f child1 %5i %s\n",
+ // part, mpart, geantPdg, px, py, pz, e, child1, name.Data());
+ PX += px;
+ PY += py;
+ PZ += pz;
+ E += e;
+
+
+ if (TMath::Abs(eta) <= 0.9) fNChTpc++;
+// acceptance cut
+ if (TMath::Abs(eta) > 0.7) continue;
+ if (phi*180./TMath::Pi() > 120.) continue;
+//
+ if(fK0N==0 ) { // exclude neutral hadrons
+ if (mpart == kNeutron || mpart == kNeutronBar || mpart == kK0Long) continue;
+ }
+ fTrackList[part] = 1;
+ fLego->Fill(eta, phi, pT);
+
+ } // primary loop
+ printf("\n PX %8.2f PY %8.2f PZ %8.2f E %8.2f \n",
+ PX, PY, PZ, E);
+ DumpLego();
+ if(fhChPartMultInTpc) fhChPartMultInTpc->Fill(fNChTpc);
+}
+
+void AliEMCALJetFinder::FillFromPartons()
+{
+// function under construction - 13-feb-2002 PAI
+
+ if (fDebug >= 2)
+ printf("\n AliEMCALJetFinder::FillFromPartons()\n");
+ //
+
+ ResetMap();
+ if (!fLego) BookLego();
+ fLego->Reset();
+//
+// Access particle information
+ Int_t npart = (gAlice->GetHeader())->GetNprimary();
+ if (fDebug >= 2 || npart<=0)
+ printf("\n AliEMCALJetFinder::FillFromPartons : npart %i\n", npart);
+ fNt = 0; // for FindTracksInJetCone
+ fNtS = 0;
+
+// Go through the partons
+ Int_t statusCode=0;
+ for (Int_t part = 8; part < npart; part++) {
+ TParticle *MPart = gAlice->Particle(part);
+ Int_t mpart = MPart->GetPdgCode();
+ // Int_t child1 = MPart->GetFirstDaughter();
+ Float_t pT = MPart->Pt();
+ // Float_t p = MPart->P();
+ Float_t phi = MPart->Phi();
+ Float_t eta = MPart->Eta();
+ // Float_t theta = MPart->Theta();
+ statusCode = MPart->GetStatusCode();
+
+// accept partons (21 - gluon, 92 - string)
+ if (!(TMath::Abs(mpart) <= 6 || mpart == 21 ||mpart == 92)) continue;
+ if (fDebug > 1 && pT>0.01)
+ printf("\n part:%5d mpart %5d status %5d eta %8.2f phi %8.2f pT %8.2f ",
+ part, mpart, statusCode, eta, phi, pT);
+ // if (fDebug >= 3) MPart->Print();
+// accept partons before fragmentation - p.57 in Pythia manual
+// if(statusCode != 1) continue;
+// acceptance cut
+ if (TMath::Abs(eta) > 0.7) continue;
+ if (phi*180./TMath::Pi() > 120.) continue;
+// final state only
+// if (child1 >= 0 && child1 < npart) continue;
+//
+//
+ fLego->Fill(eta, phi, pT);
+
+ } // primary loop
+ DumpLego();
+}
+