from Salvatore
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Jul 2013 07:07:59 +0000 (07:07 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Jul 2013 07:07:59 +0000 (07:07 +0000)
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskSAJF.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskSAJF.h
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskSAQA.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskSAQA.h

index 5843f8d..c90bc46 100644 (file)
@@ -23,7 +23,6 @@ ClassImp(AliAnalysisTaskSAJF)
 //________________________________________________________________________
 AliAnalysisTaskSAJF::AliAnalysisTaskSAJF() : 
   AliAnalysisTaskEmcalJet("AliAnalysisTaskSAJF", kTRUE),
-  fHistEventObservables(0),
   fHistJetObservables(0)
 
 {
@@ -42,7 +41,6 @@ AliAnalysisTaskSAJF::AliAnalysisTaskSAJF() :
 //________________________________________________________________________
 AliAnalysisTaskSAJF::AliAnalysisTaskSAJF(const char *name) : 
   AliAnalysisTaskEmcalJet(name, kTRUE),
-  fHistEventObservables(0),
   fHistJetObservables(0)
 {
   // Standard constructor.
@@ -77,75 +75,23 @@ void AliAnalysisTaskSAJF::UserCreateOutputObjects()
     max[dim] = 101;
     dim++;
     
-    title[dim] = "#psi_{RP} (rad)";
-    nbins[dim] = 200;
-    min[dim] = -TMath::Pi();
-    max[dim] = TMath::Pi();
+    title[dim] = "#phi_{jet} - #psi_{RP}";
+    nbins[dim] = fNbins/2;
+    min[dim] = -TMath::Pi()/2;
+    max[dim] = TMath::Pi()*5/2;
     dim++;
   }
 
-  title[dim] = "No. of jets";
-  nbins[dim] = 150;
-  min[dim] = -0.5;
-  max[dim] = 149.5;
-  dim++;
-
-  title[dim] = "p_{T,lead jet} (GeV/c)";
-  nbins[dim] = fNbins;
-  min[dim] = 0;
-  max[dim] = 250;
-  dim++;
-
-  title[dim] = "A_{lead jet}";
-  nbins[dim] = 100;
-  min[dim] = 0;
+  title[dim] = "#eta";
+  nbins[dim] = fNbins/2;
+  min[dim] = -1;
   max[dim] = 1;
   dim++;
 
-  if (!fRhoName.IsNull()) {
-    title[dim] = "#rho (GeV/c)";
-    nbins[dim] = fNbins;
-    min[dim] = 0;
-    max[dim] = 500;
-    dim++;
-
-    title[dim] = "p_{T,lead jet}^{corr} (GeV/c)";
-    nbins[dim] = fNbins*2;
-    min[dim] = -250;
-    max[dim] = 250;
-    dim++;
-  }
-
-  fHistEventObservables = new THnSparseD("fHistEventObservables","fHistEventObservables",dim,nbins,min,max);
-  for (Int_t i = 0; i < dim; i++)
-    fHistEventObservables->GetAxis(i)->SetTitle(title[i]);
-
-  dim = 0;
-
-  if (fForceBeamType != kpp) {
-    title[dim] = "Centrality (%)";
-    nbins[dim] = 101;
-    min[dim] = 0;
-    max[dim] = 101;
-    dim++;
-    
-    title[dim] = "#psi_{RP} (rad)";
-    nbins[dim] = 200;
-    min[dim] = -TMath::Pi();
-    max[dim] = TMath::Pi();
-    dim++;
-  }
-
   title[dim] = "#phi_{jet} (rad)";
-  nbins[dim] = 201;
+  nbins[dim] = fNbins/2+1;
   min[dim] = 0;
-  max[dim] = TMath::Pi()*201/100;
-  dim++;
-
-  title[dim] = "#eta";
-  nbins[dim] = 200;
-  min[dim] = -1;
-  max[dim] = 1;
+  max[dim] = 2*TMath::Pi()*nbins[dim]/(nbins[dim]-1);
   dim++;
 
   title[dim] = "p_{T} (GeV/c)";
@@ -154,12 +100,6 @@ void AliAnalysisTaskSAJF::UserCreateOutputObjects()
   max[dim] = 250;
   dim++;
 
-  title[dim] = "A_{jet}";
-  nbins[dim] = 100;
-  min[dim] = 0;
-  max[dim] = 1;
-  dim++;
-
   if (fIsEmbedded) {
     title[dim] = "p_{T}^{MC} (GeV/c)";
     nbins[dim] = fNbins;
@@ -176,31 +116,38 @@ void AliAnalysisTaskSAJF::UserCreateOutputObjects()
     dim++;
   }
 
-  title[dim] = "No. of constituents";
-  nbins[dim] = 250;
-  min[dim] = -0.5;
-  max[dim] = 249.5;
+  title[dim] = "A_{jet}";
+  nbins[dim] = fNbins/2;
+  min[dim] = 0;
+  max[dim] = 1;
   dim++;
 
   title[dim] = "NEF";
-  nbins[dim] = 120;
+  nbins[dim] = fNbins/2;
   min[dim] = 0;
-  max[dim] = 1.2;
+  max[dim] = 1.25;
   dim++;
 
   title[dim] = "Z";
-  nbins[dim] = 120;
+  nbins[dim] = fNbins/2;
   min[dim] = 0;
-  max[dim] = 1.2;
+  max[dim] = 1.25;
+  dim++;
+
+  title[dim] = "No. of constituents";
+  nbins[dim] = 250;
+  min[dim] = -0.5;
+  max[dim] = 249.5;
   dim++;
 
   title[dim] = "p_{T,particle}^{leading} (GeV/c)";
-  nbins[dim] = 120;
+  nbins[dim] = fNbins/2;
   min[dim] = 0;
-  max[dim] = 120;
+  max[dim] = 125;
   dim++;
 
   fHistJetObservables = new THnSparseD("fHistJetObservables","fHistJetObservables",dim,nbins,min,max);
+  fOutput->Add(fHistJetObservables);
   for (Int_t i = 0; i < dim; i++)
     fHistJetObservables->GetAxis(i)->SetTitle(title[i]);
 
@@ -258,50 +205,24 @@ Bool_t AliAnalysisTaskSAJF::FillHistograms()
     return kFALSE;
   }
 
-  static Int_t sortedJets[9999] = {-1};
-  Int_t nacc = GetSortedArray(sortedJets, fJets, fRhoVal);
-
-  Float_t corrPt = 0;
-
-  if (nacc > 0) {
-    AliEmcalJet* jet = static_cast<AliEmcalJet*>(fJets->At(sortedJets[0]));
-    
-    if (jet) {
-      // Don't need to do AcceptJet since it was done already in GetSortedArray
-      corrPt = jet->Pt() - fRhoVal * jet->Area();
-      
-      DoJetLoop(nacc, sortedJets);
-    } 
-    else {
-      AliError(Form("Could not receive jet %d", sortedJets[0]));
-    }
-  }
-
-  // Fill THnSparse
-
-  return kTRUE;
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskSAJF::DoJetLoop(const Int_t nacc, const Int_t* sortedJets)
-{
-  // Do the jet loop.
-
-  for (Int_t ij = 0; ij < nacc; ij++) {
+  for (Int_t ij = 0; ij < fJets->GetEntriesFast(); ij++) {
 
-    AliEmcalJet* jet = static_cast<AliEmcalJet*>(fJets->At(sortedJets[ij]));
+    AliEmcalJet* jet = static_cast<AliEmcalJet*>(fJets->At(ij));
 
     if (!jet) {
       AliError(Form("Could not receive jet %d", ij));
       continue;
     }
 
-    // Don't need to do AcceptJet since it was done already in GetSortedArray
+    if (!AcceptJet(jet))
+      continue;
 
     Float_t ptLeading = GetLeadingHadronPt(jet);
     Float_t corrPt = jet->Pt() - fRhoVal * jet->Area();
 
     // Fill THnSparse
+    FillJetHisto(fCent, fEPV0, jet->Eta(), jet->Phi(), jet->Pt(), jet->MCPt(), corrPt, jet->Area(), 
+                jet->NEF(), ptLeading/jet->Pt(), jet->GetNumberOfConstituents(), ptLeading);
 
     if (fTracks) {
       for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
@@ -329,4 +250,45 @@ void AliAnalysisTaskSAJF::DoJetLoop(const Int_t nacc, const Int_t* sortedJets)
       }
     }
   } //jet loop 
+
+  return kTRUE;
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskSAJF::FillJetHisto(Double_t cent, Double_t ep, Double_t eta, Double_t phi, Double_t pt, Double_t MCpt, Double_t corrpt, Double_t area, 
+                                      Double_t NEF, Double_t z, Int_t n, Double_t leadingpt)
+{
+  Double_t contents[20]={0};
+
+  for (Int_t i = 0; i < fHistJetObservables->GetNdimensions(); i++) {
+    TString title(fHistJetObservables->GetAxis(i)->GetTitle());
+    if (title=="Centrality (%)")
+      contents[i] = cent;
+    else if (title=="#phi_{jet} - #psi_{RP}")
+      contents[i] = phi - ep;
+    else if (title=="#eta")
+      contents[i] = eta;
+    else if (title=="#phi_{jet} (rad)")
+      contents[i] = phi;
+    else if (title=="p_{T} (GeV/c)")
+      contents[i] = pt;
+    else if (title=="p_{T}^{MC} (GeV/c)")
+      contents[i] = MCpt;
+    else if (title=="p_{T}^{corr} (GeV/c)")
+      contents[i] = corrpt;
+    else if (title=="A_{jet}")
+      contents[i] = area;
+    else if (title=="NEF")
+      contents[i] = NEF;
+    else if (title=="Z")
+      contents[i] = z;
+    else if (title=="No. of constituents")
+      contents[i] = n;
+    else if (title=="p_{T,particle}^{leading} (GeV/c)")
+      contents[i] = leadingpt;
+    else 
+      AliWarning(Form("Unable to fill dimension %s!",title.Data()));
+  }
+
+  fHistJetObservables->Fill(contents);
 }
index e68609a..46a7b38 100644 (file)
@@ -21,15 +21,11 @@ class AliAnalysisTaskSAJF : public AliAnalysisTaskEmcalJet {
 
  protected:
   Bool_t                      FillHistograms()                                              ;
-  void                        DoJetLoop(const Int_t nacc, const Int_t* sortedJets)          ;
-
-  // General histograms
-  THnSparse                  *fHistEventObservables;       //!Event-wise observables (centrality, event plane, rho, number of jets, leading jet pt, leading jet corr pt, 
-                                                           // leading jet area)
+  void                        FillJetHisto(Double_t cent, Double_t ep, Double_t eta, Double_t phi, Double_t pt, Double_t MCpt, Double_t corrpt, Double_t area, 
+                                          Double_t NEF, Double_t z, Int_t n, Double_t leadingpt);
 
   // Inclusive jets histograms
-  THnSparse                  *fHistJetObservables;         //!Jet-wise observables (centrality, event plane, phi, eta, pt, MCPt, area, corr pt, NEF, Z, no. of constituents
-                                                           // leading hadron pt)
+  THnSparse                  *fHistJetObservables;         //!Jet-wise observables
   TH2                        *fHistTracksJetPt[4];         //!Track pt vs. jet pt
   TH2                        *fHistClustersJetPt[4];       //!Cluster pt vs. jet pt
   TH2                        *fHistTracksPtDist[4];        //!Track pt vs. distance form jet axis
index f599a9e..0409164 100644 (file)
@@ -42,6 +42,7 @@ AliAnalysisTaskSAQA::AliAnalysisTaskSAQA() :
   fCentMethod2(""),
   fCentMethod3(""),
   fDoV0QA(0),
+  fDoEPQA(0),
   fCent2(0),
   fCent3(0),
   fVZERO(0),
@@ -70,7 +71,7 @@ AliAnalysisTaskSAQA::AliAnalysisTaskSAQA() :
     fHistTrPtNonProp[i] = 0;
     fHistDeltaEtaPt[i] = 0;
     fHistDeltaPhiPt[i] = 0;
-    fHistDeltaPtvsPt[i] = 0;
+    fHistDeltaPtvsPtvsMass[i] = 0;
     fHistClusPhiEtaEnergy[i] = 0;
     fHistClusMCEnergyFraction[i] = 0;
     fHistJetsPhiEta[i] = 0;
@@ -89,6 +90,7 @@ AliAnalysisTaskSAQA::AliAnalysisTaskSAQA(const char *name) :
   fCentMethod2(""),
   fCentMethod3(""),
   fDoV0QA(0),
+  fDoEPQA(0),
   fCent2(0),
   fCent3(0),
   fVZERO(0),
@@ -117,7 +119,7 @@ AliAnalysisTaskSAQA::AliAnalysisTaskSAQA(const char *name) :
     fHistTrPtNonProp[i] = 0;
     fHistDeltaEtaPt[i] = 0;
     fHistDeltaPhiPt[i] = 0;
-    fHistDeltaPtvsPt[i] = 0;
+    fHistDeltaPtvsPtvsMass[i] = 0;
     fHistClusPhiEtaEnergy[i] = 0;
     fHistClusMCEnergyFraction[i] = 0;
     fHistJetsPhiEta[i] = 0;
@@ -221,11 +223,12 @@ void AliAnalysisTaskSAQA::UserCreateOutputObjects()
        fHistDeltaPhiPt[i]->GetYaxis()->SetTitle("#delta#phi");
        fOutput->Add(fHistDeltaPhiPt[i]);
        
-       histname = Form("fHistDeltaPtvsPt_%d",i);
-       fHistDeltaPtvsPt[i] = new TH2F(histname,histname, fNbins, fMinBinPt, fMaxBinPt, fNbins, -fMaxBinPt/2, fMaxBinPt/2);
-       fHistDeltaPtvsPt[i]->GetXaxis()->SetTitle("p_{T} (GeV/c)");
-       fHistDeltaPtvsPt[i]->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
-       fOutput->Add(fHistDeltaPtvsPt[i]);
+       histname = Form("fHistDeltaPtvsPtvsMass_%d",i);
+       fHistDeltaPtvsPtvsMass[i] = new TH3F(histname,histname, fNbins, fMinBinPt, fMaxBinPt, fNbins, -fMaxBinPt/2, fMaxBinPt/2, 30, 0, 3);
+       fHistDeltaPtvsPtvsMass[i]->GetXaxis()->SetTitle("p_{T} (GeV/c)");
+       fHistDeltaPtvsPtvsMass[i]->GetYaxis()->SetTitle("#deltap_{T} (GeV/c)");
+       fHistDeltaPtvsPtvsMass[i]->GetZaxis()->SetTitle("mass (GeV/c^{2})");
+       fOutput->Add(fHistDeltaPtvsPtvsMass[i]);
       }
     }
   }
@@ -364,6 +367,14 @@ void AliAnalysisTaskSAQA::UserCreateOutputObjects()
       max[dim] = 400;
       dim++;
     }
+
+    if (fDoEPQA) {
+      title[dim] = "#psi_{RP}";
+      nbins[dim] = 200;
+      min[dim] = -TMath::Pi();
+      max[dim] = TMath::Pi();
+      dim++;
+    }
   }
 
   if (!fTracksName.IsNull()) {
@@ -488,13 +499,13 @@ Bool_t AliAnalysisTaskSAQA::FillHistograms()
     AliDebug(2,Form("%d jets found in the event", njets));
   }
 
-  FillEventQAHisto(fCent, fCent2, fCent3, fV0ATotMult, fV0CTotMult, fRhoVal, ntracks, nclusters, ncells, njets);
+  FillEventQAHisto(fCent, fCent2, fCent3, fV0ATotMult, fV0CTotMult, fEPV0, fRhoVal, ntracks, nclusters, ncells, njets);
 
   return kTRUE;
 }
 
 //________________________________________________________________________
-void AliAnalysisTaskSAQA::FillEventQAHisto(Float_t cent, Float_t cent2, Float_t cent3, Float_t v0a, Float_t v0c, Float_t rho, Int_t ntracks, Int_t nclusters, Int_t ncells, Int_t njets)
+void AliAnalysisTaskSAQA::FillEventQAHisto(Float_t cent, Float_t cent2, Float_t cent3, Float_t v0a, Float_t v0c, Float_t ep, Float_t rho, Int_t ntracks, Int_t nclusters, Int_t ncells, Int_t njets)
 {
   Double_t contents[10]={0};
 
@@ -510,6 +521,8 @@ void AliAnalysisTaskSAQA::FillEventQAHisto(Float_t cent, Float_t cent2, Float_t
       contents[i] = v0a;
     else if (title=="V0C total multiplicity")
       contents[i] = v0c;
+    else if (title=="#psi_{RP}")
+      contents[i] = ep;
     else if (title=="#rho (GeV/c)")
       contents[i] = rho;
     else if (title=="No. of tracks")
@@ -738,8 +751,8 @@ Int_t AliAnalysisTaskSAQA::DoTrackLoop(Float_t &sum)
       fHistDeltaEtaPt[fCentBin]->Fill(vtrack->Pt(), vtrack->Eta() - vtrack->GetTrackEtaOnEMCal());
     if (fHistDeltaPhiPt[fCentBin])
       fHistDeltaPhiPt[fCentBin]->Fill(vtrack->Pt(), vtrack->Phi() - vtrack->GetTrackPhiOnEMCal());
-    if (fHistDeltaPtvsPt[fCentBin])
-      fHistDeltaPtvsPt[fCentBin]->Fill(vtrack->Pt(), vtrack->Pt() - vtrack->GetTrackPtOnEMCal());
+    if (fHistDeltaPtvsPtvsMass[fCentBin])
+      fHistDeltaPtvsPtvsMass[fCentBin]->Fill(vtrack->Pt(), vtrack->Pt() - vtrack->GetTrackPtOnEMCal(), vtrack->M());
   }
 
   if (fHistTrNegativeLabels)
index 7cf92ee..6df86e9 100644 (file)
@@ -24,12 +24,13 @@ class AliAnalysisTaskSAQA : public AliAnalysisTaskEmcalJet {
   void                        SetMC(Bool_t m)                                      { fIsMC               = m          ; }
   void                        SetAdditionalCentEst(const char* meth2, const char* meth3="") { fCentMethod2 = meth2; fCentMethod3 = meth3; }
   void                        SetDoV0QA(Int_t b)                                   { fDoV0QA             = b          ; }
+  void                        SetDoEPQA(Int_t b)                                   { fDoEPQA             = b          ; }
 
  protected:
 
   void                        ExecOnce()                                                    ;
   Bool_t                      FillHistograms()                                              ;
-  void                        FillEventQAHisto(Float_t cent, Float_t cent2, Float_t cent3, Float_t v0a, Float_t v0c, Float_t rho, Int_t ntracks, Int_t nclusters, Int_t ncells, Int_t njets);
+  void                        FillEventQAHisto(Float_t cent, Float_t cent2, Float_t cent3, Float_t v0a, Float_t v0c, Float_t ep, Float_t rho, Int_t ntracks, Int_t nclusters, Int_t ncells, Int_t njets);
   Bool_t                      RetrieveEventObjects()                                        ;
   Int_t                       DoCellLoop(Float_t &sum, Float_t &sum_cut)                    ;
   Int_t                       DoTrackLoop(Float_t &sum)                                     ;
@@ -43,6 +44,7 @@ class AliAnalysisTaskSAQA : public AliAnalysisTaskEmcalJet {
   TString                     fCentMethod2;              // Centrality method 2
   TString                     fCentMethod3;              // Centrality method 3
   Int_t                       fDoV0QA;                   // Add V0 QA histograms
+  Int_t                       fDoEPQA;                   // Add event plane QA histograms
   Double_t                    fCent2;                    //!Event centrality with method 2
   Double_t                    fCent3;                    //!Event centrality with method 3
   AliVVZERO                  *fVZERO;                    //!Event V0 object
@@ -50,7 +52,7 @@ class AliAnalysisTaskSAQA : public AliAnalysisTaskEmcalJet {
   Double_t                    fV0CTotMult;               //!Event V0C total multiplicity
  
   // General histograms
-  THnSparse                  *fHistEventQA;              //!Event-wise QA observables (cent[M], cent[A], cent[C], rho, # tracks, # clusters, # cells, # jets)
+  THnSparse                  *fHistEventQA;              //!Event-wise QA observables
 
   // Tracks
   TH1                        *fHistTrNegativeLabels;     //!Percentage of negative label tracks
@@ -64,7 +66,7 @@ class AliAnalysisTaskSAQA : public AliAnalysisTaskEmcalJet {
   TH1                        *fHistTrPtNonProp[4];       //!Pt distribution of non emcal propagated tracks
   TH2                        *fHistDeltaEtaPt[4];        //!Eta-EtaProp vs. Pt
   TH2                        *fHistDeltaPhiPt[4];        //!Phi-PhiProp vs. Pt
-  TH2                        *fHistDeltaPtvsPt[4];       //!Pt-PtProp vs. Pt
+  TH3                        *fHistDeltaPtvsPtvsMass[4]; //!Pt-PtProp vs. Pt vs. mass
 
   // Clusters
   TH3                        *fHistClusPhiEtaEnergy[4];  //!Phi-Eta-Energy distribution of clusters
@@ -89,6 +91,6 @@ class AliAnalysisTaskSAQA : public AliAnalysisTaskEmcalJet {
   AliAnalysisTaskSAQA(const AliAnalysisTaskSAQA&);            // not implemented
   AliAnalysisTaskSAQA &operator=(const AliAnalysisTaskSAQA&); // not implemented
 
-  ClassDef(AliAnalysisTaskSAQA, 19) // Quality task for Emcal analysis
+  ClassDef(AliAnalysisTaskSAQA, 20) // Quality task for Emcal analysis
 };
 #endif