+ fRho->SetVal(-1);
+ if (fRhoScaled)
+ fRhoScaled->SetVal(-1);
+
+ DetermineCent();
+
+ const Int_t Njets = fJets->GetEntries();
+
+ Int_t maxJetIds[] = {-1, -1};
+ Float_t maxJetPts[] = { 0, 0};
+
+ if (fNExclLeadJets > 0) {
+ for (Int_t ij = 0; ij < Njets; ++ij) {
+ AliEmcalJet *jet = static_cast<AliEmcalJet*>(fJets->At(ij));
+ if (!jet) {
+ AliError(Form("%s: Could not receive jet %d", GetName(), ij));
+ continue;
+ }
+
+ if (jet->Area() < fAreaCut)
+ continue;
+ if (jet->AreaEmc()<fAreaEmcCut)
+ continue;
+ if ((jet->Phi() < fPhiMin) || (jet->Phi() > fPhiMax))
+ continue;
+ if ((jet->Eta() < fEtaMin) || (jet->Eta() > fEtaMax))
+ continue;
+
+ if (jet->Pt() > maxJetPts[0]) {
+ maxJetPts[1] = maxJetPts[0];
+ maxJetIds[1] = maxJetIds[0];
+ maxJetPts[0] = jet->Pt();
+ maxJetIds[0] = ij;
+ } else if (jet->Pt() > maxJetPts[1]) {
+ maxJetPts[1] = jet->Pt();
+ maxJetIds[1] = ij;
+ }
+ }
+ if (fNExclLeadJets < 2) {
+ maxJetIds[1] = -1;
+ maxJetPts[1] = -1;
+ }
+ }