including modifications from user saiola
authormcosenti <mcosenti@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Jun 2012 15:40:43 +0000 (15:40 +0000)
committermcosenti <mcosenti@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Jun 2012 15:40:43 +0000 (15:40 +0000)
PWGGA/EMCALJetTasks/AliAnalysisTaskEmcalJet.cxx
PWGGA/EMCALJetTasks/AliAnalysisTaskEmcalJet.h
PWGGA/EMCALJetTasks/AliAnalysisTaskSAJF.cxx
PWGGA/EMCALJetTasks/AliAnalysisTaskSAJF.h
PWGGA/EMCALJetTasks/AliEmcalJet.h
PWGGA/EMCALJetTasks/AliJetResponseMaker.cxx
PWGGA/EMCALJetTasks/AliJetResponseMaker.h
PWGGA/EMCALJetTasks/macros/AddTaskJetResponseMaker.C
PWGGA/EMCALTasks/AliEmcalParticleMaker.cxx

index 7348cee..daa05f2 100644 (file)
@@ -138,6 +138,15 @@ Bool_t AliAnalysisTaskEmcalJet::IsJetCluster(AliEmcalJet* jet, Int_t iclus, Bool
 }
 
 //________________________________________________________________________
+Bool_t AliAnalysisTaskEmcalJet::AcceptBiasJet(AliEmcalJet *jet) const
+{ 
+  if (jet->MaxTrackPt() < fPtBiasJetTrack && (fAnaType == kTPC || jet->MaxClusterPt() < fPtBiasJetClus))
+    return kFALSE;
+  else
+    return kTRUE;
+}
+
+//________________________________________________________________________
 Bool_t AliAnalysisTaskEmcalJet::AcceptJet(AliEmcalJet *jet, Bool_t bias, Bool_t upCut) const
 {   
   // Return true if jet is accepted.
@@ -146,7 +155,7 @@ Bool_t AliAnalysisTaskEmcalJet::AcceptJet(AliEmcalJet *jet, Bool_t bias, Bool_t
     return kFALSE;
   if (jet->Area() <= fJetAreaCut)
     return kFALSE;
-  if (bias && jet->MaxTrackPt() < fPtBiasJetTrack && (fAnaType == kTPC || jet->MaxClusterPt() < fPtBiasJetClus))
+  if (bias && !AcceptBiasJet(jet))
     return kFALSE;
   if (upCut && (jet->MaxTrackPt() > fMaxTrackPt || jet->MaxClusterPt() > fMaxClusterPt))
     return kFALSE;
index f72c645..75b7cc1 100644 (file)
@@ -37,9 +37,10 @@ class AliAnalysisTaskEmcalJet : public AliAnalysisTaskEmcal {
  
  protected:
 
-  Bool_t                      AcceptJet(AliEmcalJet* jet, Bool_t bias = kTRUE, Bool_t upCut = kTRUE)  const;
-  Bool_t                      IsJetTrack(AliEmcalJet* jet, Int_t itrack, Bool_t sorted = kTRUE)       const;
-  Bool_t                      IsJetCluster(AliEmcalJet* jet, Int_t iclus, Bool_t sorted = kTRUE)      const;
+  Bool_t                      AcceptJet(AliEmcalJet* jet, Bool_t bias = kTRUE, Bool_t upCut = kTRUE)   const;
+  Bool_t                      AcceptBiasJet(AliEmcalJet* jet)                                          const;
+  Bool_t                      IsJetTrack(AliEmcalJet* jet, Int_t itrack, Bool_t sorted = kTRUE)        const;
+  Bool_t                      IsJetCluster(AliEmcalJet* jet, Int_t iclus, Bool_t sorted = kTRUE)       const;
 
   virtual Bool_t              RetrieveEventObjects();
 
index 9177c5d..8f60463 100644 (file)
@@ -57,12 +57,17 @@ AliAnalysisTaskSAJF::AliAnalysisTaskSAJF() :
     fHistJetPhiEta[i] = 0;
     fHistJetsPt[i] = 0;
     fHistJetsPtArea[i] = 0;
+    fHistJetsPtNonBias[i] = 0;
+    fHistJetsPtAreaNonBias[i] = 0;
     fHistLeadingJetPt[i] = 0;
     fHist2LeadingJetPt[i] = 0;
     fHistJetsNEFvsPt[i] = 0;
     fHistJetsZvsPt[i] = 0;
     fHistRho[i] = 0;
     fHistCorrJetsPt[i] = 0;
+    fHistCorrJetsPtArea[i] = 0;
+    fHistCorrJetsPtNonBias[i] = 0;
+    fHistCorrJetsPtAreaNonBias[i] = 0;
     fHistCorrLeadingJetPt[i] = 0;
     fHistRCPt[i] = 0;
     fHistRCPtExLJ[i] = 0;
@@ -105,12 +110,17 @@ AliAnalysisTaskSAJF::AliAnalysisTaskSAJF(const char *name) :
     fHistJetPhiEta[i] = 0;
     fHistJetsPt[i] = 0;
     fHistJetsPtArea[i] = 0;
+    fHistJetsPtNonBias[i] = 0;
+    fHistJetsPtAreaNonBias[i] = 0;
     fHistLeadingJetPt[i] = 0;
     fHist2LeadingJetPt[i] = 0;
     fHistJetsNEFvsPt[i] = 0;
     fHistJetsZvsPt[i] = 0;
     fHistRho[i] = 0;
     fHistCorrJetsPt[i] = 0;
+    fHistCorrJetsPtArea[i] = 0;
+    fHistCorrJetsPtNonBias[i] = 0;
+    fHistCorrJetsPtAreaNonBias[i] = 0;
     fHistCorrLeadingJetPt[i] = 0;
     fHistRCPt[i] = 0;
     fHistRCPtExLJ[i] = 0;
@@ -216,6 +226,20 @@ void AliAnalysisTaskSAJF::UserCreateOutputObjects()
     fHistJetsPtArea[i]->GetYaxis()->SetTitle("area");
     fOutput->Add(fHistJetsPtArea[i]);
 
+    histname = "fHistJetsPtNonBias_";
+    histname += i;
+    fHistJetsPtNonBias[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt);
+    fHistJetsPtNonBias[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
+    fHistJetsPtNonBias[i]->GetYaxis()->SetTitle("counts");
+    fOutput->Add(fHistJetsPtNonBias[i]);
+
+    histname = "fHistJetsPtAreaNonBias_";
+    histname += i;
+    fHistJetsPtAreaNonBias[i] = new TH2F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt, 20, 0, fJetRadius * fJetRadius * TMath::Pi() * 1.5);
+    fHistJetsPtAreaNonBias[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
+    fHistJetsPtAreaNonBias[i]->GetYaxis()->SetTitle("area");
+    fOutput->Add(fHistJetsPtAreaNonBias[i]);
+
     histname = "fHistLeadingJetPt_";
     histname += i;
     fHistLeadingJetPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt);
@@ -260,6 +284,27 @@ void AliAnalysisTaskSAJF::UserCreateOutputObjects()
     fHistCorrJetsPt[i]->GetYaxis()->SetTitle("counts");
     fOutput->Add(fHistCorrJetsPt[i]);
 
+    histname = "fHistCorrJetsPtArea_";
+    histname += i;
+    fHistCorrJetsPtArea[i] = new TH2F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt, 20, 0, fJetRadius * fJetRadius * TMath::Pi() * 1.5);
+    fHistCorrJetsPtArea[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
+    fHistCorrJetsPtArea[i]->GetYaxis()->SetTitle("area");
+    fOutput->Add(fHistCorrJetsPtArea[i]);
+
+    histname = "fHistCorrJetsPtNonBias_";
+    histname += i;
+    fHistCorrJetsPtNonBias[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt);
+    fHistCorrJetsPtNonBias[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
+    fHistCorrJetsPtNonBias[i]->GetYaxis()->SetTitle("counts");
+    fOutput->Add(fHistCorrJetsPtNonBias[i]);
+
+    histname = "fHistCorrJetsPtAreaNonBias_";
+    histname += i;
+    fHistCorrJetsPtAreaNonBias[i] = new TH2F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt, 20, 0, fJetRadius * fJetRadius * TMath::Pi() * 1.5);
+    fHistCorrJetsPtAreaNonBias[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
+    fHistCorrJetsPtAreaNonBias[i]->GetYaxis()->SetTitle("area");
+    fOutput->Add(fHistCorrJetsPtAreaNonBias[i]);
+
     histname = "fHistCorrLeadingJetPt_";
     histname += i;
     fHistCorrLeadingJetPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt);
@@ -586,14 +631,23 @@ void AliAnalysisTaskSAJF::DoJetLoop()
       continue;
     }  
 
-    if (!AcceptJet(jet))
+    if (!AcceptJet(jet, kFALSE))
       continue;
 
     Float_t corrPt = jet->Pt() - fRho * jet->Area();
+    
+    fHistJetsPtNonBias[fCentBin]->Fill(jet->Pt());
+    fHistJetsPtAreaNonBias[fCentBin]->Fill(jet->Pt(), jet->Area());
+    fHistCorrJetsPtNonBias[fCentBin]->Fill(corrPt);
+    fHistCorrJetsPtAreaNonBias[fCentBin]->Fill(corrPt, jet->Area());
+
+    if (!AcceptBiasJet(jet))
+      continue;
 
     fHistJetsPt[fCentBin]->Fill(jet->Pt());
-    fHistJetsPtArea[fCentBin]->Fill(corrPt, jet->Area());
+    fHistJetsPtArea[fCentBin]->Fill(jet->Pt(), jet->Area());
     fHistCorrJetsPt[fCentBin]->Fill(corrPt);
+    fHistCorrJetsPtArea[fCentBin]->Fill(corrPt, jet->Area());
 
     fHistJetPhiEta[fCentBin]->Fill(jet->Eta(), jet->Phi());
 
@@ -615,7 +669,7 @@ void AliAnalysisTaskSAJF::DoJetLoop()
        if (cluster) {
          TLorentzVector nPart;
          cluster->GetMomentum(nPart, fVertex);
-       fHistJetsZvsPt[fCentBin]->Fill(nPart.Et() / jet->Pt(), jet->Pt());
+         fHistJetsZvsPt[fCentBin]->Fill(nPart.Et() / jet->Pt(), jet->Pt());
        }
       }
     }
index f384058..9a61813 100644 (file)
@@ -58,16 +58,21 @@ class AliAnalysisTaskSAJF : public AliAnalysisTaskEmcalJet {
   TH2F                       *fHistJetPhiEta[4];           //!Phi-Eta distribution of jets
   TH1F                       *fHistJetsPt[4];              //!Inclusive jet pt spectrum
   TH2F                       *fHistJetsPtArea[4];          //!Jet pt vs. area
+  TH1F                       *fHistJetsPtNonBias[4];       //!Non-biased inclusive jet pt spectrum
+  TH2F                       *fHistJetsPtAreaNonBias[4];   //!Non-biased jet pt vs. area
   TH1F                       *fHistLeadingJetPt[4];        //!Leading jet pt spectrum
   TH1F                       *fHist2LeadingJetPt[4];       //!Second leading jet pt spectrum
   TH2F                       *fHistJetsNEFvsPt[4];         //!Jet neutral energy fraction vs. jet pt
   TH2F                       *fHistJetsZvsPt[4];           //!Constituent Pt over Jet Pt ratio vs. jet pt
 
   // Rho
-  TH1F                       *fHistRho[4];                 //!Rho distribution
-  TH2F                       *fHistRhoVSleadJetPt;         //!Area(leadjetarea) * rho vs. leading jet pt
-  TH1F                       *fHistCorrJetsPt[4];          //!Corrected inclusive jet pt spectrum
-  TH1F                       *fHistCorrLeadingJetPt[4];    //!Corrected leading jet pt spectrum
+  TH1F                       *fHistRho[4];                    //!Rho distribution
+  TH2F                       *fHistRhoVSleadJetPt;            //!Area(leadjetarea) * rho vs. leading jet pt
+  TH1F                       *fHistCorrJetsPt[4];             //!Corrected inclusive jet pt spectrum
+  TH2F                       *fHistCorrJetsPtArea[4];         //!Jet pt vs. area
+  TH1F                       *fHistCorrJetsPtNonBias[4];      //!Corrected non-biased inclusive jet pt spectrum
+  TH2F                       *fHistCorrJetsPtAreaNonBias[4];  //!Non-biased jet pt vs. area
+  TH1F                       *fHistCorrLeadingJetPt[4];       //!Corrected leading jet pt spectrum
 
   // Random cones
   TH2F                       *fHistRCPhiEta;               //!Phi-Eta distribution of random cones
index 58b4544..aa311fb 100644 (file)
@@ -49,10 +49,10 @@ class AliEmcalJet : public AliVParticle
   Bool_t            AxisInEmcal()                const { return fAxisInEmcal;              }
   UShort_t          GetNumberOfClusters()        const { return fClusterIDs.GetSize();     }
   Short_t           ClusterAt(Int_t idx)         const { return fClusterIDs.At(idx);       }
-  AliVCluster      *ClusterAt(Int_t idx, TClonesArray *clusarray)  const { return dynamic_cast<AliVCluster*>(clusarray->At(ClusterAt(idx))); }
+  AliVCluster      *ClusterAt(Int_t idx, TClonesArray *clusarray)  const { if (!clusarray) return 0; return dynamic_cast<AliVCluster*>(clusarray->At(ClusterAt(idx))); }
   UShort_t          GetNumberOfTracks()          const { return fTrackIDs.GetSize();       }
   Short_t           TrackAt(Int_t idx)           const { return fTrackIDs.At(idx);         }
-  AliVParticle     *TrackAt(Int_t idx, TClonesArray *trackarray)   const { return dynamic_cast<AliVParticle*>(trackarray->At(TrackAt(idx))); } 
+  AliVParticle     *TrackAt(Int_t idx, TClonesArray *trackarray)   const { if (!trackarray) return 0; return dynamic_cast<AliVParticle*>(trackarray->At(TrackAt(idx))); } 
   Double_t          FracEmcalArea()              const { return fAreaEmc/fArea;            }
   Bool_t            IsInsideEmcal()              const { return (fAreaEmc/fArea>0.999);    }
   Bool_t            IsInEmcal()                  const { return (fAreaEmc>0);              }
index b978683..bb36226 100644 (file)
@@ -45,7 +45,8 @@ AliJetResponseMaker::AliJetResponseMaker() :
   fHistClosestDeltaPt(0),
   fHistNonMatchedMCJetPt(0),
   fHistNonMatchedJetPt(0),
-  fHistPartvsDetecPt(0)
+  fHistPartvsDetecPt(0),
+  fHistMissedMCJets(0)
 {
   // Default constructor.
 }
@@ -72,7 +73,8 @@ AliJetResponseMaker::AliJetResponseMaker(const char *name) :
   fHistClosestDeltaPt(0),
   fHistNonMatchedMCJetPt(0),
   fHistNonMatchedJetPt(0),
-  fHistPartvsDetecPt(0)
+  fHistPartvsDetecPt(0),
+  fHistMissedMCJets(0)
 {
   // Standard constructor.
 }
@@ -171,6 +173,11 @@ void AliJetResponseMaker::UserCreateOutputObjects()
   fHistPartvsDetecPt->GetYaxis()->SetTitle("p_{T}^{gen}");
   fOutput->Add(fHistPartvsDetecPt);
 
+  fHistMissedMCJets = new TH1F("fHistMissedMCJets", "fHistMissedMCJets", fNbins, fMinBinPt, fMaxBinPt);
+  fHistMissedMCJets->GetXaxis()->SetTitle("p_{T} [GeV/c]");
+  fHistMissedMCJets->GetYaxis()->SetTitle("counts");
+  fOutput->Add(fHistMissedMCJets);
+
   PostData(1, fOutput); // Post data for ALL output slots > 0 here, to get at least an empty histogram
 }
 
@@ -183,89 +190,98 @@ Bool_t AliJetResponseMaker::FillHistograms()
   DoJetLoop(fJets, fMCJets, kFALSE);
   DoJetLoop(fMCJets, fJets, kTRUE);
 
-  const Int_t nJets = fJets->GetEntriesFast();
+  const Int_t nMCJets = fMCJets->GetEntriesFast();
 
-  for (Int_t i = 0; i < nJets; i++) {
+  for (Int_t i = 0; i < nMCJets; i++) {
 
-    AliEmcalJet* jet = dynamic_cast<AliEmcalJet*>(fJets->At(i));
+    AliEmcalJet* jet = dynamic_cast<AliEmcalJet*>(fMCJets->At(i));
 
     if (!jet) {
       AliError(Form("Could not receive jet %d", i));
       continue;
     }  
 
-    if (!AcceptJet(jet))
+    if (!AcceptJet(jet, kTRUE, kFALSE))
+      continue;
+
+    if (jet->Pt() > fMaxBinPt)
       continue;
 
     if (jet->ClosestJet() && jet->ClosestJet()->ClosestJet() == jet && 
         jet->ClosestJetDistance() < fMaxDistance) {    // Matched jet found
       jet->SetMatchedToClosest();
       jet->ClosestJet()->SetMatchedToClosest();
-      fHistClosestDistance->Fill(jet->ClosestJetDistance());
-      Double_t deta = jet->Eta() - jet->MatchedJet()->Eta();
-      fHistClosestDeltaEta->Fill(deta);
-      Double_t dphi = jet->Phi() - jet->MatchedJet()->Phi();
-      fHistClosestDeltaPhi->Fill(dphi);
-      Double_t dpt = jet->Pt() - jet->MatchedJet()->Pt();
-      fHistClosestDeltaPt->Fill(dpt);
-      fHistPartvsDetecPt->Fill(jet->Pt(), jet->MatchedJet()->Pt());
+      if (jet->MatchedJet()->Pt() > fMaxBinPt) {
+       fHistMissedMCJets->Fill(jet->Pt());
+      }
+      else {
+       fHistClosestDistance->Fill(jet->ClosestJetDistance());
+       Double_t deta = jet->MatchedJet()->Eta() - jet->Eta();
+       fHistClosestDeltaEta->Fill(deta);
+       Double_t dphi = jet->MatchedJet()->Phi() - jet->Phi();
+       fHistClosestDeltaPhi->Fill(dphi);
+       Double_t dpt = jet->MatchedJet()->Pt() - jet->Pt();
+       fHistClosestDeltaPt->Fill(dpt);
+       fHistPartvsDetecPt->Fill(jet->MatchedJet()->Pt(), jet->Pt());
+      }
     }
     else {
-      fHistNonMatchedJetPt->Fill(jet->Pt());
+      fHistNonMatchedMCJetPt->Fill(jet->Pt());
+      fHistMissedMCJets->Fill(jet->Pt());
     }
 
-    fHistJetsPt->Fill(jet->Pt());
+    fHistMCJetsPt->Fill(jet->Pt());
 
-    fHistJetPhiEta->Fill(jet->Eta(), jet->Phi());
+    fHistMCJetPhiEta->Fill(jet->Eta(), jet->Phi());
 
     if (fAnaType == kEMCAL)
-      fHistJetsNEFvsPt->Fill(jet->NEF(), jet->Pt());
+      fHistMCJetsNEFvsPt->Fill(jet->NEF(), jet->Pt());
 
     for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
-      AliVParticle *track = jet->TrackAt(it, fTracks);
+      AliVParticle *track = jet->TrackAt(it, fMCTracks);
       if (track)
-       fHistJetsZvsPt->Fill(track->Pt() / jet->Pt(), jet->Pt());
-    }
-
-    for (Int_t ic = 0; ic < jet->GetNumberOfClusters(); ic++) {
-      AliVCluster *cluster = jet->ClusterAt(ic, fCaloClusters);
-      if (cluster) {
-       TLorentzVector nP;
-       cluster->GetMomentum(nP, fVertex);
-       fHistJetsZvsPt->Fill(nP.Pt() / jet->Pt(), jet->Pt());
-      }
+       fHistMCJetsZvsPt->Fill(track->Pt() / jet->Pt(), jet->Pt());
     }
   }
 
- const Int_t nMCJets = fMCJets->GetEntriesFast();
+  const Int_t nJets = fJets->GetEntriesFast();
 
-  for (Int_t i = 0; i < nMCJets; i++) {
+  for (Int_t i = 0; i < nJets; i++) {
 
-    AliEmcalJet* jet = dynamic_cast<AliEmcalJet*>(fMCJets->At(i));
+    AliEmcalJet* jet = dynamic_cast<AliEmcalJet*>(fJets->At(i));
 
     if (!jet) {
       AliError(Form("Could not receive mc jet %d", i));
       continue;
     }  
     
-    if (!AcceptJet(jet, kTRUE, kFALSE))
+    if (!AcceptJet(jet))
       continue;
 
     if (!jet->MatchedJet()) {
-      fHistNonMatchedMCJetPt->Fill(jet->Pt());
+      fHistNonMatchedJetPt->Fill(jet->Pt());
     }
 
-    fHistMCJetsPt->Fill(jet->Pt());
+    fHistJetsPt->Fill(jet->Pt());
 
-    fHistMCJetPhiEta->Fill(jet->Eta(), jet->Phi());
+    fHistJetPhiEta->Fill(jet->Eta(), jet->Phi());
 
     if (fAnaType == kEMCAL)
-      fHistMCJetsNEFvsPt->Fill(jet->NEF(), jet->Pt());
+      fHistJetsNEFvsPt->Fill(jet->NEF(), jet->Pt());
 
     for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
-      AliVParticle *track = jet->TrackAt(it, fMCTracks);
+      AliVParticle *track = jet->TrackAt(it, fTracks);
       if (track)
-       fHistMCJetsZvsPt->Fill(track->Pt() / jet->Pt(), jet->Pt());
+       fHistJetsZvsPt->Fill(track->Pt() / jet->Pt(), jet->Pt());
+    }
+
+    for (Int_t ic = 0; ic < jet->GetNumberOfClusters(); ic++) {
+      AliVCluster *cluster = jet->ClusterAt(ic, fCaloClusters);
+      if (cluster) {
+       TLorentzVector nP;
+       cluster->GetMomentum(nP, fVertex);
+       fHistJetsZvsPt->Fill(nP.Pt() / jet->Pt(), jet->Pt());
+      }
     }
   }
 
index 583bf5a..6b374db 100644 (file)
@@ -50,11 +50,12 @@ class AliJetResponseMaker : public AliAnalysisTaskEmcalJet {
   TH1F                       *fHistNonMatchedMCJetPt;     //!non-matched mc jet pt distribution
   TH1F                       *fHistNonMatchedJetPt;       //!non-matched jet pt distribution
   TH2F                       *fHistPartvsDetecPt;         //!particle vs detector level jet pt
+  TH1F                       *fHistMissedMCJets;          //!mc jets not measured
 
  private:
   AliJetResponseMaker(const AliJetResponseMaker&);            // not implemented
   AliJetResponseMaker &operator=(const AliJetResponseMaker&); // not implemented
 
-  ClassDef(AliJetResponseMaker, 2) // Jet response matrix producing task
+  ClassDef(AliJetResponseMaker, 4) // Jet response matrix producing task
 };
 #endif
index e04ec9f..b5e14ba 100644 (file)
@@ -13,6 +13,7 @@ AliJetResponseMaker* AddTaskJetResponseMaker(
   Double_t    ptcut              = 0.15,
   Double_t    jetBiasTrack       = 10,
   Double_t    jetBiasClus        = 10,
+  Double_t    maxDistance        = 0.25,
   UInt_t      type               = AliAnalysisTaskEmcal::kTPC
 )
 {  
@@ -50,6 +51,7 @@ AliJetResponseMaker* AddTaskJetResponseMaker(
   jetTask->SetJetAreaCut(jetareacut);
   jetTask->SetPtBiasJetTrack(jetBiasTrack);
   jetTask->SetPtBiasJetClus(jetBiasClus);
+  jetTask->SetMaxDistance(maxDistance);
   
   //-------------------------------------------------------
   // Final settings, pass to manager and set the containers
index 16ff278..54f55b9 100644 (file)
@@ -73,21 +73,24 @@ Bool_t AliEmcalParticleMaker::Run()
   fTracksOut->Delete();
   fCaloClustersOut->Delete();
 
-  // loop over tracks
-  const Int_t Ntracks = fTracks->GetEntries();
-  for (Int_t iTracks = 0; iTracks < Ntracks; ++iTracks) {
-
-    AliVTrack *track = dynamic_cast<AliVTrack*>(fTracks->At(iTracks));
-    new ((*fTracksOut)[iTracks]) AliEmcalParticle(track, iTracks);
+  if (fTracks) {
+    // loop over tracks
+    const Int_t Ntracks = fTracks->GetEntries();
+    for (Int_t iTracks = 0; iTracks < Ntracks; ++iTracks) {
+      
+      AliVTrack *track = dynamic_cast<AliVTrack*>(fTracks->At(iTracks));
+      new ((*fTracksOut)[iTracks]) AliEmcalParticle(track, iTracks);
+    }
   }
 
-  // loop over clusters
-  const Int_t Nclusters = fCaloClusters->GetEntries();
-  for (Int_t iClusters = 0; iClusters < Nclusters; ++iClusters) {
-
-    AliVCluster *cluster = dynamic_cast<AliVCluster*>(fCaloClusters->At(iClusters));
-    new ((*fCaloClustersOut)[iClusters]) AliEmcalParticle(cluster, iClusters, fVertex[0], fVertex[1], fVertex[2]);
+  if (fCaloClusters) {
+    // loop over clusters
+    const Int_t Nclusters = fCaloClusters->GetEntries();
+    for (Int_t iClusters = 0; iClusters < Nclusters; ++iClusters) {
+      
+      AliVCluster *cluster = dynamic_cast<AliVCluster*>(fCaloClusters->At(iClusters));
+      new ((*fCaloClustersOut)[iClusters]) AliEmcalParticle(cluster, iClusters, fVertex[0], fVertex[1], fVertex[2]);
+    }
   }
-
   return kTRUE;
 }