- fJets->AddJet(px, py, pz, en);
+
+ AliAODJet jet(px, py, pz, en);
+
+ if (fromAod){
+ for(Int_t jpart = 0; jpart < nIn; jpart++) // loop for all particles in array
+ if (injet[jpart] == kj && fReader->GetCutFlag(jpart) == 1)
+ jet.AddTrack(refs->At(jpart)); // check if the particle belongs to the jet and add the ref
+ }
+
+ //jet.Print("");
+
+ // calculate the area of the jet
+ Float_t detamax = etaJet[kj] + rc;
+ Float_t detamin = etaJet[kj] - rc;
+ Float_t accmax = 0.0; Float_t accmin = 0.0;
+ if(detamax > header->GetLegoEtaMax()){ // sector outside etamax
+ Float_t h = header->GetLegoEtaMax() - etaJet[kj];
+ accmax = rc*rc*TMath::ACos(h/rc) - h*TMath::Sqrt(rc*rc - h*h);
+ }
+ if(detamin < header->GetLegoEtaMin()){ // sector outside etamin
+ Float_t h = header->GetLegoEtaMax() + etaJet[kj];
+ accmin = rc*rc*TMath::ACos(h/rc) - h*TMath::Sqrt(rc*rc - h*h);
+ }
+ Float_t areaJet = rc*rc*TMath::Pi() - accmax - accmin;
+ // set both areas
+ jet.SetEffArea(areaJet,areaJet);
+
+ AddJet(jet);
+