update from salvatore
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 28 May 2012 19:36:22 +0000 (19:36 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 28 May 2012 19:36:22 +0000 (19:36 +0000)
PWGGA/CMakelibPWGGAEMCALJetTasks.pkg
PWGGA/EMCALJetTasks/AliAnalysisTaskSAJF.cxx
PWGGA/EMCALJetTasks/AliAnalysisTaskSAJF.h
PWGGA/EMCALJetTasks/macros/AddTaskSAJF.C
PWGGA/PWGGAEMCALJetTasksLinkDef.h

index 7b5294e..e6e56d4 100644 (file)
@@ -25,7 +25,9 @@
 #--------------------------------------------------------------------------------#
 
 set ( SRCS 
+ EMCALJetTasks/AliAnalysisTaskEmcal.cxx
  EMCALJetTasks/AliAnalysisTaskSAJF.cxx
+ EMCALJetTasks/AliAnalysisTaskSAQA.cxx
  EMCALJetTasks/AliAnalysisTaskScale.cxx
  EMCALJetTasks/AliEmcalJet.cxx
  EMCALJetTasks/AliEmcalJetTask.cxx
@@ -33,6 +35,7 @@ set ( SRCS
  EMCALJetTasks/AliJetModelBaseTask.cxx
  EMCALJetTasks/AliJetEmbeddingTask.cxx
  EMCALJetTasks/AliJetRandomizerTask.cxx
+ EMCALJetTasks/AliJetResponseMaker.cxx
  EMCALJetTasks/AliAnalysisTaskEmcalJetSpectra.cxx
  EMCALJetTasks/AliAnalysisTaskRhoBase.cxx
  EMCALJetTasks/AliAnalysisTaskRho.cxx
index c7ba98b..6a7a586 100644 (file)
@@ -17,7 +17,7 @@
 #include "AliAnalysisManager.h"
 #include "AliCentrality.h"
 #include "AliVCluster.h"
-#include "AliVTrack.h"
+#include "AliVParticle.h"
 #include "AliEmcalJet.h"
 #include "AliVEventHandler.h"
 #include "AliLog.h"
@@ -28,40 +28,17 @@ ClassImp(AliAnalysisTaskSAJF)
 
 //________________________________________________________________________
 AliAnalysisTaskSAJF::AliAnalysisTaskSAJF() : 
-  AliAnalysisTaskSE("AliAnalysisTaskSAJF"),
-  fAnaType(kTPC),
-  fInitialized(kFALSE),
-  fMinEta(-0.9),
-  fMaxEta(0.9),
-  fMinPhi(-10),
-  fMaxPhi(10),
-  fJetRadius(0.4),
+  AliAnalysisTaskEmcal("AliAnalysisTaskSAJF"),
   fMinRC2LJ(1.0),
-  fTracksName("Tracks"),
-  fCaloName("CaloClusters"),
-  fJetsName("Jets"),
   fEmbJetsName("EmbJets"),
   fRandTracksName("TracksRandomized"),
   fRandCaloName("CaloClustersRandomized"),
   fRhoName("Rho"),
-  fNbins(500),
-  fMinPt(0),
-  fMaxPt(250),
-  fPtCut(0.15),
-  fPtBiasJetTrack(10),
-  fPtBiasJetClus(10),
-  fTracks(0),
-  fCaloClusters(0),
-  fJets(0),
   fEmbJets(0),
   fRandTracks(0),
   fRandCaloClusters(0),
-  fCent(0),
-  fCentBin(-1),
   fRho(0),
-  fOutput(0),
   fHistCentrality(0),
-  fHistJetPhiEta(0),
   fHistRhoVSleadJetPt(0),
   fHistRCPhiEta(0),
   fHistRCPtExLJVSDPhiLJ(0),
@@ -74,7 +51,9 @@ AliAnalysisTaskSAJF::AliAnalysisTaskSAJF() :
   // Default constructor.
 
   for (Int_t i = 0; i < 4; i++) {
+    fHistJetPhiEta[i] = 0;
     fHistJetsPt[i] = 0;
+    fHistJetsPtArea[i] = 0;
     fHistJetsPtTrack[i] = 0;
     fHistJetsPtClus[i] = 0;
     fHistJetsPtNonBias[i] = 0;
@@ -103,50 +82,21 @@ AliAnalysisTaskSAJF::AliAnalysisTaskSAJF() :
     fHistDeltaPtEmb[i] = 0;
   }
 
-  fVertex[0] = 0;
-  fVertex[1] = 0;
-  fVertex[2] = 0;
-
-  // Output slot #1 writes into a TH1 container
-  DefineOutput(1, TList::Class()); 
 }
 
 //________________________________________________________________________
 AliAnalysisTaskSAJF::AliAnalysisTaskSAJF(const char *name) : 
-  AliAnalysisTaskSE(name),
-  fAnaType(kTPC),
-  fInitialized(kFALSE),
-  fMinEta(-0.9),
-  fMaxEta(0.9),
-  fMinPhi(-10),
-  fMaxPhi(10),
-  fJetRadius(0.4),
+  AliAnalysisTaskEmcal(name),
   fMinRC2LJ(1.0),
-  fTracksName("Tracks"),
-  fCaloName("CaloClusters"),
-  fJetsName("Jets"),
   fEmbJetsName("EmbJets"),
   fRandTracksName("TracksRandomized"),
   fRandCaloName("CaloClustersRandomized"),
   fRhoName("Rho"),
-  fNbins(500),
-  fMinPt(0),
-  fMaxPt(250),
-  fPtCut(0.15),
-  fPtBiasJetTrack(10),
-  fPtBiasJetClus(10),
-  fTracks(0),
-  fCaloClusters(0),
-  fJets(0),
   fEmbJets(0),
   fRandTracks(0),
   fRandCaloClusters(0),
-  fCent(0),
-  fCentBin(-1),
   fRho(0),
-  fOutput(0),
   fHistCentrality(0),
-  fHistJetPhiEta(0),
   fHistRhoVSleadJetPt(0),
   fHistRCPhiEta(0),
   fHistRCPtExLJVSDPhiLJ(0),
@@ -158,7 +108,9 @@ AliAnalysisTaskSAJF::AliAnalysisTaskSAJF(const char *name) :
   // Standard constructor.
 
   for (Int_t i = 0; i < 4; i++) {
+    fHistJetPhiEta[i] = 0;
     fHistJetsPt[i] = 0;
+    fHistJetsPtArea[i] = 0;
     fHistJetsPtTrack[i] = 0;
     fHistJetsPtClus[i] = 0;
     fHistJetsPtNonBias[i] = 0;
@@ -187,12 +139,6 @@ AliAnalysisTaskSAJF::AliAnalysisTaskSAJF(const char *name) :
     fHistDeltaPtEmb[i] = 0;
   }
 
-  fVertex[0] = 0;
-  fVertex[1] = 0;
-  fVertex[2] = 0;
-
-  // Output slot #1 writes into a TH1 container
-  DefineOutput(1, TList::Class()); 
 }
 
 //________________________________________________________________________
@@ -204,6 +150,8 @@ AliAnalysisTaskSAJF::~AliAnalysisTaskSAJF()
 //________________________________________________________________________
 void AliAnalysisTaskSAJF::UserCreateOutputObjects()
 {
+  AliAnalysisTaskEmcal::UserCreateOutputObjects();
+
   // Create histograms
 
   const Float_t binWidth = (fMaxPt - fMinPt) / fNbins;
@@ -217,11 +165,6 @@ void AliAnalysisTaskSAJF::UserCreateOutputObjects()
   fHistCentrality->GetYaxis()->SetTitle("counts");
   fOutput->Add(fHistCentrality);
 
-  fHistJetPhiEta = new TH2F("fHistJetPhiEta","Phi-Eta distribution of jets", 20, -2, 2, 32, 0, 6.4);
-  fHistJetPhiEta->GetXaxis()->SetTitle("#eta");
-  fHistJetPhiEta->GetYaxis()->SetTitle("#phi");
-  fOutput->Add(fHistJetPhiEta);
-
   fHistRhoVSleadJetPt = new TH2F("fHistRhoVSleadJetPt","fHistRhoVSleadJetPt", fNbins, fMinPt, fMaxPt, fNbins, fMinPt, fMaxPt);
   fHistRhoVSleadJetPt->GetXaxis()->SetTitle("#rho * area [GeV/c]");
   fHistRhoVSleadJetPt->GetYaxis()->SetTitle("Leading jet p_{T} [GeV/c]");
@@ -260,6 +203,13 @@ void AliAnalysisTaskSAJF::UserCreateOutputObjects()
   TString histname;
 
   for (Int_t i = 0; i < 4; i++) {
+    histname = "fHistJetPhiEta_";
+    histname += i;
+    fHistJetPhiEta[i] = new TH2F(histname.Data(), histname.Data(), 20, -2, 2, 32, 0, 6.4);
+    fHistJetPhiEta[i]->GetXaxis()->SetTitle("#eta");
+    fHistJetPhiEta[i]->GetYaxis()->SetTitle("#phi");
+    fOutput->Add(fHistJetPhiEta[i]);
+
     histname = "fHistJetsPt_";
     histname += i;
     fHistJetsPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt);
@@ -267,6 +217,13 @@ void AliAnalysisTaskSAJF::UserCreateOutputObjects()
     fHistJetsPt[i]->GetYaxis()->SetTitle("counts");
     fOutput->Add(fHistJetsPt[i]);
 
+    histname = "fHistJetsPtArea_";
+    histname += i;
+    fHistJetsPtArea[i] = new TH2F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt, fNbins, 0, fJetRadius * fJetRadius * TMath::Pi() * 1.5);
+    fHistJetsPtArea[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
+    fHistJetsPtArea[i]->GetYaxis()->SetTitle("area");
+    fOutput->Add(fHistJetsPtArea[i]);
+
     if (fAnaType == kEMCAL) {
       histname = "fHistJetsPtClus_";
       histname += i;
@@ -462,27 +419,8 @@ void AliAnalysisTaskSAJF::UserCreateOutputObjects()
 //________________________________________________________________________
 void AliAnalysisTaskSAJF::RetrieveEventObjects()
 {
-  if (strcmp(fCaloName,"") && fAnaType == kEMCAL) {
-    fCaloClusters =  dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fCaloName));
-    if (!fCaloClusters) {
-      AliWarning(Form("Could not retrieve clusters %s!", fCaloName.Data())); 
-    }
-  }
-
-  if (strcmp(fTracksName,"")) {
-    fTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTracksName));
-    if (!fTracks) {
-      AliWarning(Form("Could not retrieve tracks %s!", fTracksName.Data())); 
-    }
-  }
-
-  if (strcmp(fJetsName,"")) {
-    fJets = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fJetsName));
-    if (!fJets) {
-      AliWarning(Form("Could not retrieve jets %s!", fJetsName.Data())); 
-    }
-  }
-
+  AliAnalysisTaskEmcal::RetrieveEventObjects();
+  
   if (strcmp(fEmbJetsName,"")) {
     fEmbJets = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fEmbJetsName));
     if (!fEmbJets) {
@@ -504,22 +442,6 @@ void AliAnalysisTaskSAJF::RetrieveEventObjects()
     }
   }
 
-  AliCentrality *aliCent = InputEvent()->GetCentrality();
-  if (aliCent) {
-    fCent = aliCent->GetCentralityPercentile("V0M");
-    if      (fCent >=  0 && fCent <   10) fCentBin = 0;
-    else if (fCent >= 10 && fCent <   30) fCentBin = 1;
-    else if (fCent >= 30 && fCent <   50) fCentBin = 2;
-    else if (fCent >= 50 && fCent <= 100) fCentBin = 3; 
-    else {
-      AliWarning(Form("Negative centrality: %f. Assuming 99", fCent));
-      fCentBin = 3;
-    }
-  }
-  else {
-    AliWarning(Form("Could not retrieve centrality information! Assuming 99"));
-    fCentBin = 3;
-  }
 
   fRho = -1;
   
@@ -533,88 +455,16 @@ void AliAnalysisTaskSAJF::RetrieveEventObjects()
       AliWarning(Form("Could not retrieve rho %s!", fRhoName.Data()));
     }
   }
-
-  fVertex[0] = 0;
-  fVertex[1] = 0;
-  fVertex[2] = 0;
-  InputEvent()->GetPrimaryVertex()->GetXYZ(fVertex);
-}
-
-//________________________________________________________________________
-AliVTrack* AliAnalysisTaskSAJF::GetTrack(const Int_t i) const
-{
-  if (fTracks)
-    return dynamic_cast<AliVTrack*>(fTracks->At(i));
-  else
-    return 0;
-}
-
-//________________________________________________________________________
-Int_t AliAnalysisTaskSAJF::GetNumberOfTracks() const
-{
-  if (fTracks)
-    return fTracks->GetEntriesFast();
-  else
-    return 0;
-}
-
-//________________________________________________________________________
-AliVCluster* AliAnalysisTaskSAJF::GetCaloCluster(const Int_t i) const
-{ 
-  if (fCaloClusters)
-    return dynamic_cast<AliVCluster*>(fCaloClusters->At(i));
-  else
-    return 0;
-}
-
-//________________________________________________________________________
-Int_t AliAnalysisTaskSAJF::GetNumberOfCaloClusters() const
-{ 
-  if (fCaloClusters)
-    return fCaloClusters->GetEntriesFast();
-  else
-    return 0;
-}
-
-//________________________________________________________________________
-AliEmcalJet* AliAnalysisTaskSAJF::GetJet(const Int_t i) const
-{
-  if (fJets)
-    return dynamic_cast<AliEmcalJet*>(fJets->At(i));
-  else
-    return 0;
-}
-
-//________________________________________________________________________
-Int_t AliAnalysisTaskSAJF::GetNumberOfJets() const
-{
-  if (fJets)
-    return fJets->GetEntriesFast();
-  else
-    return 0;
-}
-
-//________________________________________________________________________
-AliEmcalJet* AliAnalysisTaskSAJF::GetEmbJet(const Int_t i) const
-{
-  if (fEmbJets)
-    return dynamic_cast<AliEmcalJet*>(fEmbJets->At(i));
-  else
-    return 0;
-}
-
-//________________________________________________________________________
-Int_t AliAnalysisTaskSAJF::GetNumberOfEmbJets() const
-{
-  if (fEmbJets)
-    return fEmbJets->GetEntriesFast();
-  else
-    return 0;
 }
 
 //________________________________________________________________________
 void AliAnalysisTaskSAJF::FillHistograms()
 {
+  if (fRho < 0) {
+    AliWarning(Form("Could not retrieve rho information! Event skipped!"));
+    return;
+  }
+
   Int_t maxJetIndex  = -1;
   Int_t max2JetIndex = -1;
 
@@ -627,7 +477,7 @@ void AliAnalysisTaskSAJF::FillHistograms()
   if (maxJetIndex < 0) 
     return;
 
-  AliEmcalJet* jet = GetJet(maxJetIndex);
+  AliEmcalJet* jet = dynamic_cast<AliEmcalJet*>(fJets->At(maxJetIndex));
   if (!jet) 
     return;
 
@@ -640,7 +490,7 @@ void AliAnalysisTaskSAJF::FillHistograms()
   
   AliEmcalJet* jet2 = 0;
   if (max2JetIndex >= 0)
-    jet2 = GetJet(max2JetIndex);
+    jet2 = dynamic_cast<AliEmcalJet*>(fJets->At(max2JetIndex));
 
   if (jet2) {
     fHist2LeadingJetPt[fCentBin]->Fill(jet2->Pt());
@@ -706,6 +556,9 @@ void AliAnalysisTaskSAJF::FillHistograms()
   // Embedding
   // _________________________________
 
+  if (!fEmbJets)
+    return;
+
   AliEmcalJet *embJet  = 0;
   TObject     *maxPart = 0;
 
@@ -729,14 +582,14 @@ void AliAnalysisTaskSAJF::FillHistograms()
       maxEmbPartPhi = clusVec.Phi();
     }
     else {
-      AliVTrack *track = dynamic_cast<AliVTrack*>(maxPart);
+      AliVParticle *track = dynamic_cast<AliVParticle*>(maxPart);
       if (track) {
        maxEmbPartPt = track->Pt();
        maxEmbPartEta = track->Eta();
        maxEmbPartPhi = track->Phi();
       }
       else {
-       AliWarning(Form("%s - Embedded particle type not recognized (neither AliVCluster nor AliVTrack)!", GetName()));
+       AliWarning(Form("%s - Embedded particle type not recognized (neither AliVCluster nor AliVParticle)!", GetName()));
        return;
       }
     }
@@ -756,21 +609,21 @@ void AliAnalysisTaskSAJF::FillHistograms()
 //________________________________________________________________________
 void AliAnalysisTaskSAJF::DoJetLoop(Int_t &maxJetIndex, Int_t &max2JetIndex)
 {
-  Int_t njets = GetNumberOfJets();
+  if (!fJets)
+    return;
+
+  Int_t njets = fJets->GetEntriesFast();
 
   Float_t maxJetPt = 0;
   Float_t max2JetPt = 0;
   for (Int_t ij = 0; ij < njets; ij++) {
 
-    AliEmcalJet* jet = GetJet(ij);
+    AliEmcalJet* jet = dynamic_cast<AliEmcalJet*>(fJets->At(ij));
 
     if (!jet) {
       AliError(Form("Could not receive jet %d", ij));
       continue;
     }  
-    
-    if (jet->Pt() <= 0)
-      continue;
 
     if (!AcceptJet(jet))
       continue;
@@ -794,15 +647,16 @@ void AliAnalysisTaskSAJF::DoJetLoop(Int_t &maxJetIndex, Int_t &max2JetIndex)
        continue;
 
     fHistJetsPt[fCentBin]->Fill(jet->Pt());
+    fHistJetsPtArea[fCentBin]->Fill(corrPt, jet->Area());
     fHistCorrJetsPt[fCentBin]->Fill(corrPt);
 
-    fHistJetPhiEta->Fill(jet->Eta(), jet->Phi());
+    fHistJetPhiEta[fCentBin]->Fill(jet->Eta(), jet->Phi());
 
     if (fAnaType == kEMCAL)
       fHistJetsNEFvsPt[fCentBin]->Fill(jet->NEF(), jet->Pt());
 
     for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
-      AliVTrack *track = jet->TrackAt(it, fTracks);
+      AliVParticle *track = jet->TrackAt(it, fTracks);
       if (track)
        fHistJetsZvsPt[fCentBin]->Fill(track->Pt() / jet->Pt(), jet->Pt());
     }
@@ -813,7 +667,7 @@ void AliAnalysisTaskSAJF::DoJetLoop(Int_t &maxJetIndex, Int_t &max2JetIndex)
       if (cluster) {
        TLorentzVector nPart;
        cluster->GetMomentum(nPart, fVertex);
-       fHistJetsZvsPt[fCentBin]->Fill(nPart.Et() / jet->Pt(), corrPt);
+       fHistJetsZvsPt[fCentBin]->Fill(nPart.Et() / jet->Pt(), jet->Pt());
       }
     }
 
@@ -833,29 +687,29 @@ void AliAnalysisTaskSAJF::DoJetLoop(Int_t &maxJetIndex, Int_t &max2JetIndex)
 //________________________________________________________________________
 void AliAnalysisTaskSAJF::DoEmbJetLoop(AliEmcalJet* &embJet, TObject* &maxPart)
 {
+  if (!fEmbJets)
+    return;
+
   TLorentzVector *maxClusVect = new TLorentzVector();
 
-  Int_t nembjets = GetNumberOfEmbJets();
+  Int_t nembjets = fEmbJets->GetEntriesFast();
 
   for (Int_t ij = 0; ij < nembjets; ij++) {
       
-    AliEmcalJet* jet = GetEmbJet(ij);
+    AliEmcalJet* jet = dynamic_cast<AliEmcalJet*>(fEmbJets->At(ij));
       
     if (!jet) {
       AliError(Form("Could not receive jet %d", ij));
       continue;
     } 
       
-    if (jet->Pt() <= 0)
-       continue;
-    //if (!AcceptJet(jet))
-    //continue;
+    if (!AcceptJet(jet))
+      continue;
 
-    AliVTrack *maxTrack = 0;
+    AliVParticle *maxTrack = 0;
 
     for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
-      AliVTrack *track = jet->TrackAt(it, fTracks);
+      AliVParticle *track = jet->TrackAt(it, fTracks);
       
       if (!track) continue;
       
@@ -903,14 +757,17 @@ void AliAnalysisTaskSAJF::DoEmbJetLoop(AliEmcalJet* &embJet, TObject* &maxPart)
 //________________________________________________________________________
 void AliAnalysisTaskSAJF::DoTrackLoop(Int_t maxJetIndex)
 { 
+  if (!fTracks)
+    return;
+
   AliEmcalJet* jet = 0;
-  if (maxJetIndex >= 0)
-    jet = GetJet(maxJetIndex);
+  if (maxJetIndex >= 0 && fJets)
+    jet = dynamic_cast<AliEmcalJet*>(fJets->At(maxJetIndex));
 
-  Int_t ntracks = GetNumberOfTracks();
+  Int_t ntracks = fTracks->GetEntriesFast();
 
   for(Int_t iTracks = 0; iTracks < ntracks; iTracks++) {
-    AliVTrack* track = GetTrack(iTracks);         
+    AliVParticle* track = dynamic_cast<AliVParticle*>(fTracks->At(iTracks));         
     if(!track) {
       AliError(Form("Could not retrieve track %d",iTracks)); 
       continue; 
@@ -930,13 +787,16 @@ void AliAnalysisTaskSAJF::DoTrackLoop(Int_t maxJetIndex)
 //________________________________________________________________________
 void AliAnalysisTaskSAJF::DoClusterLoop(Int_t maxJetIndex)
 {
+  if (!fCaloClusters)
+    return;
+
   AliEmcalJet* jet = 0;
-  if (maxJetIndex >= 0)
-    jet = GetJet(maxJetIndex);
+  if (maxJetIndex >= 0 && fJets)
+    jet = dynamic_cast<AliEmcalJet*>(fJets->At(maxJetIndex));
 
-  Int_t nclusters =  GetNumberOfCaloClusters();
+  Int_t nclusters =  fCaloClusters->GetEntriesFast();
   for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) {
-    AliVCluster* cluster = GetCaloCluster(iClusters);
+    AliVCluster* cluster = dynamic_cast<AliVCluster*>(fCaloClusters->At(iClusters));
     if (!cluster) {
       AliError(Form("Could not receive cluster %d", iClusters));
       continue;
@@ -959,32 +819,6 @@ void AliAnalysisTaskSAJF::DoClusterLoop(Int_t maxJetIndex)
 }
 
 //________________________________________________________________________
-void AliAnalysisTaskSAJF::Init()
-{
-  if (fAnaType == kTPC) {
-    SetEtaLimits(-0.9, 0.9);
-    SetPhiLimits(-10, 10);
-  }
-  else if (fAnaType == kEMCAL) {
-    SetEtaLimits(-0.7, 0.7);
-    SetPhiLimits(80 * TMath::DegToRad(), 180 * TMath::DegToRad());
-  }
-  else {
-    AliWarning("Analysis type not recognized! Assuming kTPC...");
-    SetAnaType(kTPC);
-    Init();
-  }
-
-  const Float_t semiDiag = TMath::Sqrt((fMaxPhi - fMinPhi) * (fMaxPhi - fMinPhi) + (fMaxEta - fMinEta) * (fMaxEta - fMinEta)) / 2;
-  if (fMinRC2LJ > semiDiag * 0.5) {
-    AliWarning(Form("The parameter fMinRC2LJ = %f is too large for the considered acceptance. Will use fMinRC2LJ = %f", fMinRC2LJ, semiDiag * 0.5));
-    SetJetMinRC2LJ(semiDiag * 0.5);
-  }
-
-  SetInitialized();
-}
-
-//________________________________________________________________________
 void AliAnalysisTaskSAJF::GetRigidCone(Float_t &pt, Float_t &eta, Float_t &phi, Bool_t acceptMC,
                                       AliEmcalJet *jet, TClonesArray* tracks, TClonesArray* clusters) const
 {
@@ -994,6 +828,9 @@ void AliAnalysisTaskSAJF::GetRigidCone(Float_t &pt, Float_t &eta, Float_t &phi,
   if (!clusters)
     clusters = fCaloClusters;
 
+  if (!tracks && !clusters)
+    return;
+
   eta = 0;
   phi = 0;
   pt = 0;
@@ -1026,7 +863,7 @@ void AliAnalysisTaskSAJF::GetRigidCone(Float_t &pt, Float_t &eta, Float_t &phi,
   if (repeats == 999)
     return;
 
-  if (fAnaType == kEMCAL) {
+  if (fAnaType == kEMCAL && clusters) {
     Int_t nclusters =  clusters->GetEntriesFast();
     for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) {
       AliVCluster* cluster = dynamic_cast<AliVCluster*>(clusters->At(iClusters));
@@ -1053,113 +890,42 @@ void AliAnalysisTaskSAJF::GetRigidCone(Float_t &pt, Float_t &eta, Float_t &phi,
     }
   }
 
-  Int_t ntracks = tracks->GetEntriesFast();
-  for(Int_t iTracks = 0; iTracks < ntracks; iTracks++) {
-    AliVTrack* track = dynamic_cast<AliVTrack*>(tracks->At(iTracks));         
-    if(!track) {
-      AliError(Form("Could not retrieve track %d",iTracks)); 
-      continue; 
-    }
-    
-    if (!AcceptTrack(track, acceptMC)) continue;
-
-    Float_t tracketa = track->Eta();
-    Float_t trackphi = track->Phi();
+  if (tracks) {
+    Int_t ntracks = tracks->GetEntriesFast();
+    for(Int_t iTracks = 0; iTracks < ntracks; iTracks++) {
+      AliVParticle* track = dynamic_cast<AliVParticle*>(tracks->At(iTracks));         
+      if(!track) {
+       AliError(Form("Could not retrieve track %d",iTracks)); 
+       continue; 
+      }
+      
+      if (!AcceptTrack(track, acceptMC)) continue;
+      
+      Float_t tracketa = track->Eta();
+      Float_t trackphi = track->Phi();
+      
+      if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi + 2 * TMath::Pi()))
+       trackphi += 2 * TMath::Pi();
+      if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi - 2 * TMath::Pi()))
+       trackphi -= 2 * TMath::Pi();
+      
+      Float_t d = TMath::Sqrt((tracketa - eta) * (tracketa - eta) + (trackphi - phi) * (trackphi - phi));
     
-    if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi + 2 * TMath::Pi()))
-      trackphi += 2 * TMath::Pi();
-    if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi - 2 * TMath::Pi()))
-      trackphi -= 2 * TMath::Pi();
-
-    Float_t d = TMath::Sqrt((tracketa - eta) * (tracketa - eta) + (trackphi - phi) * (trackphi - phi));
-
-    if (d <= fJetRadius)
-      pt += track->Pt();
-  }
-}
-
-//________________________________________________________________________
-Bool_t AliAnalysisTaskSAJF::IsJetTrack(AliEmcalJet* jet, Int_t itrack, Bool_t sorted) const
-{
-  for (Int_t i = 0; i < jet->GetNumberOfTracks(); i++) {
-    Int_t ijettrack = jet->TrackAt(i);
-    if (sorted && ijettrack > itrack)
-      return kFALSE;
-    if (ijettrack == itrack)
-      return kTRUE;
-  }
-  return kFALSE;
-}
-
-//________________________________________________________________________
-Bool_t AliAnalysisTaskSAJF::IsJetCluster(AliEmcalJet* jet, Int_t iclus, Bool_t sorted) const
-{
-  for (Int_t i = 0; i < jet->GetNumberOfClusters(); i++) {
-    Int_t ijetclus = jet->ClusterAt(i);
-    if (sorted && ijetclus > iclus)
-      return kFALSE;
-    if (ijetclus == iclus)
-      return kTRUE;
+      if (d <= fJetRadius)
+       pt += track->Pt();
+    }
   }
-  return kFALSE;
 }
-
-//________________________________________________________________________
-Bool_t AliAnalysisTaskSAJF::AcceptJet(Float_t eta, Float_t phi) const
-{
-  return (Bool_t)(eta > fMinEta + fJetRadius && eta < fMaxEta - fJetRadius && phi > fMinPhi + fJetRadius && phi < fMaxPhi - fJetRadius);
-}
-
 //________________________________________________________________________
-Bool_t AliAnalysisTaskSAJF::AcceptJet(AliEmcalJet *jet) const
-{
-  return AcceptJet(jet->Eta(), jet->Phi());
-}
-
-//________________________________________________________________________
-Bool_t AliAnalysisTaskSAJF::AcceptCluster(AliVCluster* clus, Bool_t acceptMC) const
-{
-  if (!acceptMC && clus->Chi2() == 100)
-    return kFALSE;
-
-  TLorentzVector nPart;
-  clus->GetMomentum(nPart, const_cast<Double_t*>(fVertex));
-
-  if (nPart.Et() < fPtCut)
-    return kFALSE;
-
-  return kTRUE;
-}
-
-//________________________________________________________________________
-Bool_t AliAnalysisTaskSAJF::AcceptTrack(AliVTrack* track, Bool_t acceptMC) const
-{
-  if (!acceptMC && track->GetLabel() == 100)
-    return kFALSE;
-
-  if (track->Pt() < fPtCut)
-    return kFALSE;
-  
-  return (Bool_t)(track->Eta() > fMinEta && track->Eta() < fMaxEta && track->Phi() > fMinPhi && track->Phi() < fMaxPhi);
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskSAJF::UserExec(Option_t *) 
+void AliAnalysisTaskSAJF::Init()
 {
-  if (!fInitialized) 
-    Init();
+  AliAnalysisTaskEmcal::Init();
 
-  RetrieveEventObjects();
-
-  if (fRho < 0) {
-    AliWarning(Form("Could not retrieve rho information! Event skipped!"));
-    return;
+  const Float_t semiDiag = TMath::Sqrt((fMaxPhi - fMinPhi) * (fMaxPhi - fMinPhi) + (fMaxEta - fMinEta) * (fMaxEta - fMinEta)) / 2;
+  if (fMinRC2LJ > semiDiag * 0.5) {
+    AliWarning(Form("The parameter fMinRC2LJ = %f is too large for the considered acceptance. Will use fMinRC2LJ = %f", fMinRC2LJ, semiDiag * 0.5));
+    fMinRC2LJ = semiDiag * 0.5;
   }
-
-  FillHistograms();
-    
-  // information for this iteration of the UserExec in the container
-  PostData(1, fOutput);
 }
 
 //________________________________________________________________________
index a2b913c..6220713 100644 (file)
@@ -5,67 +5,30 @@
 
 class TClonesArray;
 class TString;
-class AliVTrack;
-class AliVCluster;
-class AliEmcalJet;
-class TList;
 class TH1F;
 class TH2F;
 
-#include "AliAnalysisTaskSE.h"
+#include "AliAnalysisTaskEmcal.h"
 
-class AliAnalysisTaskSAJF : public AliAnalysisTaskSE {
+class AliAnalysisTaskSAJF : public AliAnalysisTaskEmcal {
  public:
-  
-  enum SAJFAnaType {
-    kTPC       = 0,     // TPC only analysis
-    kEMCAL     = 1,     // EMCal + TPC analysis
-  };
 
   AliAnalysisTaskSAJF();
   AliAnalysisTaskSAJF(const char *name);
   virtual ~AliAnalysisTaskSAJF();
 
   void                        UserCreateOutputObjects();
-  void                        UserExec(Option_t *option);
   void                        Terminate(Option_t *option);
   void                        Init();
 
-  void                        SetTracksName(const char *n)                         { fTracksName     = n          ; }
-  void                        SetClusName(const char *n)                           { fCaloName       = n          ; }
-  void                        SetJetsName(const char *n)                           { fJetsName       = n          ; }
+  void                        SetJetMinRC2LJ(Float_t d)                            { fMinRC2LJ       = d          ; } 
   void                        SetEmbJetsName(const char *n)                        { fEmbJetsName    = n          ; }
   void                        SetRandTracksName(const char *n)                     { fRandTracksName = n          ; }
   void                        SetRandClusName(const char *n)                       { fRandCaloName   = n          ; }
   void                        SetRhoName(const char *n)                            { fRhoName        = n          ; }
-  void                        SetAnaType(SAJFAnaType type)                         { fAnaType        = type       ; }
-  void                        SetJetRadius(Float_t r)                              { fJetRadius      = r          ; } 
-  void                        SetJetMinRC2LJ(Float_t d)                            { fMinRC2LJ       = d          ; } 
-  void                        SetPtCut(Float_t cut)                                { fPtCut          = cut        ; }
-  void                        SetPtBiasJetTrack(Float_t b)                         { fPtBiasJetTrack = b          ; }
-  void                        SetPtBiasJetClus(Float_t b)                          { fPtBiasJetClus  = b          ; }
-  void                        SetHistoBins(Int_t nbins, Float_t min, Float_t max)  { fNbins = nbins; fMinPt = min; fMaxPt = max; }
-  void                        SetEtaLimits(Float_t min, Float_t max)               { fMinEta = min, fMaxEta = max ; }
-  void                        SetPhiLimits(Float_t min, Float_t max)               { fMinPhi = min, fMaxPhi = max ; }
-  void                        SetInitialized(Bool_t ini = kTRUE)                   { fInitialized = ini           ; }
 
  protected:
 
-  AliVTrack                  *GetTrack(const Int_t i)                                              const;
-  Int_t                       GetNumberOfTracks()                                                  const;
-  AliVCluster                *GetCaloCluster(const Int_t i)                                        const;
-  Int_t                       GetNumberOfCaloClusters()                                            const;
-  AliEmcalJet                *GetJet(const Int_t i)                                                const;
-  Int_t                       GetNumberOfJets()                                                    const;
-  AliEmcalJet                *GetEmbJet(const Int_t i)                                             const;
-  Int_t                       GetNumberOfEmbJets()                                                 const;
-  Bool_t                      AcceptTrack(AliVTrack* track, Bool_t acceptMC = kFALSE)              const;
-  Bool_t                      AcceptCluster(AliVCluster* clus, Bool_t acceptMC = kFALSE)           const;
-  Bool_t                      AcceptJet(AliEmcalJet* jet)                                          const;
-  Bool_t                      AcceptJet(Float_t eta, Float_t phi)                                  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;
-
   void                        RetrieveEventObjects()                                                                        ;
   void                        FillHistograms()                                                                              ;
   void                        DoJetLoop(Int_t &maxJetIndex, Int_t &max2JetIndex)                                            ;
@@ -75,45 +38,22 @@ class AliAnalysisTaskSAJF : public AliAnalysisTaskSE {
   void                        GetRigidCone(Float_t &pt, Float_t &eta, Float_t &phi, Bool_t acceptMC = kFALSE, 
                                           AliEmcalJet *jet = 0, TClonesArray* tracks = 0, TClonesArray* clusters = 0) const;
 
-  SAJFAnaType                 fAnaType;                    // Analysis type
-  Bool_t                      fInitialized;                // Whether or not the task has been already initialized
-  Float_t                     fMinEta;                     // Minimum eta accepatance
-  Float_t                     fMaxEta;                     // Maximum eta accepatance
-  Float_t                     fMinPhi;                     // Minimum phi accepatance
-  Float_t                     fMaxPhi;                     // Maximum phi accepatance  
-  Float_t                     fJetRadius;                  // Jet radius
   Float_t                     fMinRC2LJ;                   // Minimum distance random cone to leading jet
-  TString                     fTracksName;                 // Name of track collection
-  TString                     fCaloName;                   // Name of calo cluster collection
-  TString                     fJetsName;                   // Name of jet collection
   TString                     fEmbJetsName;                // Name of embedded jets collection
   TString                     fRandTracksName;             // Name of randomized track collection
   TString                     fRandCaloName;               // Name of randomized calo cluster collection
   TString                     fRhoName;                    // Name of rho object
-  Int_t                       fNbins;                      // No. of pt bins
-  Float_t                     fMinPt;                      // Min pt in histograms
-  Float_t                     fMaxPt;                      // Max pt in histograms
-  Float_t                     fPtCut;                      // Cut on particle pt
-  Float_t                     fPtBiasJetTrack;             // Select jets with a minimum pt track
-  Float_t                     fPtBiasJetClus;              // Select jets with a minimum pt cluster
-
-  TClonesArray               *fTracks;                     //!Tracks
-  TClonesArray               *fCaloClusters;               //!Clusters
-  TClonesArray               *fJets;                       //!Jets
+
   TClonesArray               *fEmbJets;                    //!Embedded Jets
   TClonesArray               *fRandTracks;                 //!Randomized tracks
   TClonesArray               *fRandCaloClusters;           //!Randomized clusters
-  Float_t                     fCent;                       //!Event centrality
-  Int_t                       fCentBin;                    //!Event centrality bin
   Float_t                     fRho;                        //!Event rho
-  Double_t                    fVertex[3];                  //!Event vertex
-
-  TList                      *fOutput;                     //!Output list
 
   // General histograms
   TH1F                       *fHistCentrality;             //!Event centrality distribution
-  TH2F                       *fHistJetPhiEta;              //!Phi-Eta distribution of jets
+  TH2F                       *fHistJetPhiEta[4];           //!Phi-Eta distribution of jets
   TH1F                       *fHistJetsPt[4];              //!Inclusive jet pt spectrum
+  TH2F                       *fHistJetsPtArea[4];          //!Jet pt vs. area
   TH1F                       *fHistJetsPtClus[4];          //!Inclusive jet pt spectrum cluster biased
   TH1F                       *fHistJetsPtTrack[4];         //!Inclusive jet pt spectrum track biased
   TH1F                       *fHistJetsPtNonBias[4];       //!Non biased inclusive jet pt spectrum
@@ -158,6 +98,6 @@ class AliAnalysisTaskSAJF : public AliAnalysisTaskSE {
   AliAnalysisTaskSAJF(const AliAnalysisTaskSAJF&);            // not implemented
   AliAnalysisTaskSAJF &operator=(const AliAnalysisTaskSAJF&); // not implemented
 
-  ClassDef(AliAnalysisTaskSAJF, 4) // jet analysis task
+  ClassDef(AliAnalysisTaskSAJF, 5) // jet analysis task
 };
 #endif
index d6e2552..d4d0399 100644 (file)
@@ -10,10 +10,12 @@ AliAnalysisTaskSAJF* AddTaskSAJF(
   const char *nrandclusters      = "CaloClustersRandomized",
   const char *nrho               = "Rho",
   Double_t    jetradius          = 0.4,
+  Double_t    jetptcut           = 1,
+  Double_t    jetareacut         = 0.2,
   Double_t    ptcut              = 0.15,
   Double_t    jetBiasTrack       = 10,
   Double_t    jetBiasClus        = 10,
-  UInt_t      type               = AliAnalysisTaskSAJF::kTPC
+  UInt_t      type               = AliAnalysisTaskEmcal::kTPC
 )
 {  
   // Get the pointer to the existing analysis manager via the static access method.
@@ -48,13 +50,15 @@ AliAnalysisTaskSAJF* AddTaskSAJF(
   jetTask->SetRhoName(nrho);
   jetTask->SetPtCut(ptcut);
   jetTask->SetJetRadius(jetradius);
+  jetTask->SetJetPtCut(jetptcut);
+  jetTask->SetJetAreaCut(jetareacut);
   jetTask->SetPtBiasJetTrack(jetBiasTrack);
   jetTask->SetPtBiasJetClus(jetBiasClus);
-
+  
   //-------------------------------------------------------
   // Final settings, pass to manager and set the containers
   //-------------------------------------------------------
-
+  
   mgr->AddTask(jetTask);
   
   // Create containers for input/output
@@ -66,6 +70,6 @@ AliAnalysisTaskSAJF* AddTaskSAJF(
                                                            Form("%s", AliAnalysisManager::GetCommonFileName()));
   mgr->ConnectInput  (jetTask, 0,  cinput1 );
   mgr->ConnectOutput (jetTask, 1, coutput1 );
-
+  
   return jetTask;
 }
index dfd0260..86ff854 100644 (file)
@@ -4,13 +4,16 @@
 #pragma link off all classes;
 #pragma link off all functions;
 
+#pragma link C++ class AliAnalysisTaskEmcal+;
 #pragma link C++ class AliAnalysisTaskSAJF+;
+#pragma link C++ class AliAnalysisTaskSAQA+;
 #pragma link C++ class AliAnalysisTaskScale+;
 #pragma link C++ class AliEmcalJet+;
 #pragma link C++ class AliEmcalJetTask+;
 #pragma link C++ class AliHadCorrTask+;
 #pragma link C++ class AliJetModelBaseTask+;
 #pragma link C++ class AliJetRandomizerTask+;
+#pragma link C++ class AliJetResponseMaker+;
 #pragma link C++ class AliJetEmbeddingTask+;
 #pragma link C++ class AliAnalysisTaskEmcalJetSpectra+;
 #pragma link C++ class AliAnalysisTaskRhoBase+;