Add pt resolution histograms (ESD analysis only)
authorsaiola <salvatore.aiola@cern.ch>
Sat, 16 Aug 2014 08:20:20 +0000 (10:20 +0200)
committersaiola <salvatore.aiola@cern.ch>
Sat, 16 Aug 2014 08:22:26 +0000 (10:22 +0200)
PWG/EMCAL/AliAnalysisTaskEmcal.cxx
PWG/EMCAL/AliAnalysisTaskEmcal.h
PWG/EMCAL/AliEmcalTrackingQATask.cxx
PWG/EMCAL/AliEmcalTrackingQATask.h
PWG/EMCAL/macros/AddTaskTrackingQA.C

index a8c9fe3..e541616 100644 (file)
@@ -77,6 +77,7 @@ AliAnalysisTaskEmcal::AliAnalysisTaskEmcal() :
   fMCLabelShift(0),
   fNcentBins(4),
   fNeedEmcalGeom(kTRUE),
+  fIsEsd(kFALSE),
   fGeom(0),
   fTracks(0),
   fCaloClusters(0),
@@ -158,6 +159,7 @@ AliAnalysisTaskEmcal::AliAnalysisTaskEmcal(const char *name, Bool_t histo) :
   fMCLabelShift(0),
   fNcentBins(4),
   fNeedEmcalGeom(kTRUE),
+  fIsEsd(kFALSE),
   fGeom(0),
   fTracks(0),
   fCaloClusters(0),
@@ -259,6 +261,26 @@ void AliAnalysisTaskEmcal::SetTrackPhiLimits(Double_t min, Double_t max, Int_t c
 void AliAnalysisTaskEmcal::UserCreateOutputObjects()
 {
   // Create user output.
+
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (mgr) {
+    AliVEventHandler *evhand = mgr->GetInputEventHandler();
+    if (evhand) {
+      if (evhand->InheritsFrom("AliESDInputHandler")) {
+        fIsEsd = kTRUE;
+      }
+      else {
+        fIsEsd = kFALSE;        
+      }
+    }
+    else {
+      AliError("Event handler not found!");
+    }
+  }
+  else {
+    AliError("Analysis manager not found!");
+  }  
+
   if (!fCreateHisto)
     return;
 
index e24fdb9..43df3bd 100644 (file)
@@ -146,6 +146,7 @@ class AliAnalysisTaskEmcal : public AliAnalysisTaskSE {
   Int_t                       fMCLabelShift;               // if MC label > fMCLabelShift, MC label -= fMCLabelShift
   Int_t                       fNcentBins;                  // how many centrality bins
   Bool_t                      fNeedEmcalGeom;              // whether or not the task need the emcal geometry
+  Bool_t                      fIsEsd;                      //!whether it's an ESD analysis
   AliEMCALGeometry           *fGeom;                       //!emcal geometry
   TClonesArray               *fTracks;                     //!tracks
   TClonesArray               *fCaloClusters;               //!clusters
index 33b01fe..41be85c 100644 (file)
@@ -9,6 +9,7 @@
 #include <Riostream.h>
 
 #include "AliPicoTrack.h"
+#include "AliESDtrack.h"
 #include "AliAODMCParticle.h"
 #include "AliParticleContainer.h"
 #include "AliLog.h"
@@ -33,13 +34,12 @@ AliEmcalTrackingQATask::AliEmcalTrackingQATask() :
   fCentHistBins(0),
   fNPtResHistBins(0),
   fPtResHistBins(0),
+  f1OverPtResHistBins(0),
+  fN1OverPtResHistBins(0),
   fNIntegerHistBins(0),
   fIntegerHistBins(0),
-  fTracksAll(0),
-  fTracksSelected(0),
-  fParticlesAllPhysPrim(0),
-  fParticlesSelected(0),
-  fParticlesFindable(0),
+  fTracks(0),
+  fParticlesPhysPrim(0),
   fParticlesMatched(0)
 {
   // Default constructor.
@@ -65,13 +65,12 @@ AliEmcalTrackingQATask::AliEmcalTrackingQATask(const char *name) :
   fCentHistBins(0),
   fNPtResHistBins(0),
   fPtResHistBins(0),
+  f1OverPtResHistBins(0),
+  fN1OverPtResHistBins(0),
   fNIntegerHistBins(0),
   fIntegerHistBins(0),
-  fTracksAll(0),
-  fTracksSelected(0),
-  fParticlesAllPhysPrim(0),
-  fParticlesSelected(0),
-  fParticlesFindable(0),
+  fTracks(0),
+  fParticlesPhysPrim(0),
   fParticlesMatched(0)
 {
   // Standard constructor.
@@ -120,6 +119,10 @@ void AliEmcalTrackingQATask::GenerateHistoBins()
   fPtResHistBins = new Double_t[fNPtResHistBins+1];
   GenerateFixedBinArray(fNPtResHistBins, -2, 2, fPtResHistBins);
 
+  fN1OverPtResHistBins = 100;
+  f1OverPtResHistBins = new Double_t[fN1OverPtResHistBins+1];
+  GenerateFixedBinArray(fN1OverPtResHistBins, 0, 1, f1OverPtResHistBins);
+
   fNIntegerHistBins = 10;
   fIntegerHistBins = new Double_t[fNIntegerHistBins+1];
   GenerateFixedBinArray(fNIntegerHistBins, -0.5, 9.5, fIntegerHistBins);
@@ -132,62 +135,30 @@ void AliEmcalTrackingQATask::UserCreateOutputObjects()
 
   AliAnalysisTaskEmcal::UserCreateOutputObjects();
 
-  if (!fCreateHisto) return;
-
-  fTracksAll = new TH3**[fNcentBins];
-  fTracksSelected = new TH3**[fNcentBins];
-  fParticlesAllPhysPrim = new TH3*[fNcentBins];
-  fParticlesSelected = new TH3*[fNcentBins];  
-
-  TString histname;
-
-  for (Int_t i = 0; i < fNcentBins; i++) {
-
-    fTracksAll[i] = new TH3*[3];
-    fTracksSelected[i] = new TH3*[3];
-    for (Int_t j = 0; j < 3; j++) {
-      histname = Form("fTracksAll_%d_%d",i,j);
-      fTracksAll[i][j] = new TH3F(histname, histname, fNEtaHistBins, fEtaHistBins, fNPhiHistBins, fPhiHistBins, fNPtHistBins, fPtHistBins);
-      fTracksAll[i][j]->GetXaxis()->SetTitle("#eta");
-      fTracksAll[i][j]->GetYaxis()->SetTitle("#phi");
-      fTracksAll[i][j]->GetZaxis()->SetTitle("#it{p}_{T} (GeV/#it{c})");
-      fOutput->Add(fTracksAll[i][j]);
-
-      if (fSelectHIJING) {
-       histname = Form("fTracksSelected_%d_%d",i,j);
-       fTracksSelected[i][j] = new TH3F(histname, histname, fNEtaHistBins, fEtaHistBins, fNPhiHistBins, fPhiHistBins, fNPtHistBins, fPtHistBins);
-       fTracksSelected[i][j]->GetXaxis()->SetTitle("#eta");
-       fTracksSelected[i][j]->GetYaxis()->SetTitle("#phi");
-       fTracksSelected[i][j]->GetZaxis()->SetTitle("#it{p}_{T} (GeV/#it{c})");
-       fOutput->Add(fTracksSelected[i][j]);
-      }
-    }
+  if (fParticleCollArray.GetEntriesFast() < 1) {
+    AliFatal("This task needs at least one particle container!");
+  }
 
-    histname = Form("fParticlesAllPhysPrim_%d",i);
-    fParticlesAllPhysPrim[i] = new TH3F(histname, histname, fNEtaHistBins, fEtaHistBins, fNPhiHistBins, fPhiHistBins, fNPtHistBins, fPtHistBins);
-    fParticlesAllPhysPrim[i]->GetXaxis()->SetTitle("#eta");
-    fParticlesAllPhysPrim[i]->GetYaxis()->SetTitle("#phi");
-    fParticlesAllPhysPrim[i]->GetZaxis()->SetTitle("#it{p}_{T} (GeV/#it{c})");
-    fOutput->Add(fParticlesAllPhysPrim[i]);
-
-    if (fSelectHIJING) {
-      histname = Form("fParticlesSelected_%d",i);
-      fParticlesSelected[i] = new TH3F(histname, histname, fNEtaHistBins, fEtaHistBins, fNPhiHistBins, fPhiHistBins, fNPtHistBins, fPtHistBins);
-      fParticlesSelected[i]->GetXaxis()->SetTitle("#eta");
-      fParticlesSelected[i]->GetYaxis()->SetTitle("#phi");
-      fParticlesSelected[i]->GetZaxis()->SetTitle("#it{p}_{T} (GeV/#it{c})");
-      fOutput->Add(fParticlesSelected[i]);
-    }
+  if (!fDetectorLevel) {
+    fDetectorLevel = static_cast<AliParticleContainer*>(fParticleCollArray.At(0));
+    fDetectorLevel->SetClassName("AliPicoTrack");
+  }
+
+  if (!fGeneratorLevel && fParticleCollArray.GetEntriesFast() > 1) {
+    fGeneratorLevel = static_cast<AliParticleContainer*>(fParticleCollArray.At(1));
+    fGeneratorLevel->SetClassName("AliAODMCParticle");
   }
 
-  AllocateFindableParticlesTHnSparse();
-  AllocateMatchedParticlesTHnSparse();
+  AllocateDetectorLevelTHnSparse();
 
-  PostData(1, fOutput);
+  if (fGeneratorLevel) {
+    AllocateGeneratorLevelTHnSparse();
+    AllocateMatchedParticlesTHnSparse();
+  }
 }
 
 //________________________________________________________________________
-void AliEmcalTrackingQATask::AllocateFindableParticlesTHnSparse()
+void AliEmcalTrackingQATask::AllocateDetectorLevelTHnSparse()
 {
   Int_t dim = 0;
   TString title[20];
@@ -215,14 +186,84 @@ void AliEmcalTrackingQATask::AllocateFindableParticlesTHnSparse()
   nbins[dim] = fNPhiHistBins;
   binEdges[dim] = fPhiHistBins;
   dim++;
+
+  if (fSelectHIJING) {
+    title[dim] = "MC Generator";
+    nbins[dim] = 2;
+    binEdges[dim] = fIntegerHistBins;
+    dim++;
+  }
+
+  title[dim] = "track type";
+  nbins[dim] = 3;
+  binEdges[dim] = fIntegerHistBins;
+  dim++;
+
+  if (fIsEsd) {
+    title[dim] = "#sigma(1/#it{p}_{T}) (GeV/#it{c})^{-1}";
+    nbins[dim] = fN1OverPtResHistBins;
+    binEdges[dim] = f1OverPtResHistBins;
+    dim++;
+  }
  
-  fParticlesFindable = new THnSparseF("fParticlesFindable","fParticlesFindable",dim,nbins);
+  fTracks = new THnSparseF("fTracks","fTracks",dim,nbins);
   for (Int_t i = 0; i < dim; i++) {
-    fParticlesFindable->GetAxis(i)->SetTitle(title[i]);
-    fParticlesFindable->SetBinEdges(i, binEdges[i]);
+    fTracks->GetAxis(i)->SetTitle(title[i]);
+    fTracks->SetBinEdges(i, binEdges[i]);
   }
 
-  fOutput->Add(fParticlesFindable);
+  fOutput->Add(fTracks);
+}
+
+//________________________________________________________________________
+void AliEmcalTrackingQATask::AllocateGeneratorLevelTHnSparse()
+{
+  Int_t dim = 0;
+  TString title[20];
+  Int_t nbins[20] = {0};
+  Double_t *binEdges[20] = {0};
+  
+  if (fForceBeamType != AliAnalysisTaskEmcal::kpp) {
+    title[dim] = "Centrality %";
+    nbins[dim] = fNCentHistBins;
+    binEdges[dim] = fCentHistBins;
+    dim++;
+  }
+
+  title[dim] = "#it{p}_{T} (GeV/#it{c})";
+  nbins[dim] = fNPtHistBins;
+  binEdges[dim] = fPtHistBins;
+  dim++;
+
+  title[dim] = "#eta";
+  nbins[dim] = fNEtaHistBins;
+  binEdges[dim] = fEtaHistBins;
+  dim++;
+
+  title[dim] = "#phi";
+  nbins[dim] = fNPhiHistBins;
+  binEdges[dim] = fPhiHistBins;
+  dim++;
+
+  if (fSelectHIJING) {
+    title[dim] = "MC Generator";
+    nbins[dim] = 2;
+    binEdges[dim] = fIntegerHistBins;
+    dim++;
+  }
+
+  title[dim] = "Findable";
+  nbins[dim] = 2;
+  binEdges[dim] = fIntegerHistBins;
+  dim++;
+  fParticlesPhysPrim = new THnSparseF("fParticlesPhysPrim","fParticlesPhysPrim",dim,nbins);
+  for (Int_t i = 0; i < dim; i++) {
+    fParticlesPhysPrim->GetAxis(i)->SetTitle(title[i]);
+    fParticlesPhysPrim->SetBinEdges(i, binEdges[i]);
+  }
+
+  fOutput->Add(fParticlesPhysPrim);
 }
 
 //________________________________________________________________________
@@ -292,8 +333,12 @@ void AliEmcalTrackingQATask::AllocateMatchedParticlesTHnSparse()
 //________________________________________________________________________
 void AliEmcalTrackingQATask::SetGeneratorLevelName(const char* name)
 {
+  if (!fDetectorLevel) {
+    AliError("Please, first set the detector level array!");
+    return;
+  }
   if (!fGeneratorLevel) {  // first check if the generator level array is set
-    fGeneratorLevel = static_cast<AliParticleContainer*>(fParticleCollArray.At(0));
+    fGeneratorLevel = static_cast<AliParticleContainer*>(fParticleCollArray.At(1));
     if (fGeneratorLevel) {  // now check if the first collection array has been added already
       fGeneratorLevel->SetArrayName(name);
     }
@@ -310,12 +355,8 @@ void AliEmcalTrackingQATask::SetGeneratorLevelName(const char* name)
 //________________________________________________________________________
 void AliEmcalTrackingQATask::SetDetectorLevelName(const char* name)
 {
-  if (!fGeneratorLevel) {
-    AliError("Please, first set the generatol level array!");
-    return;
-  }
   if (!fDetectorLevel) {  // first check if the detector level array is set
-    fDetectorLevel = static_cast<AliParticleContainer*>(fParticleCollArray.At(1));
+    fDetectorLevel = static_cast<AliParticleContainer*>(fParticleCollArray.At(0));
     if (fDetectorLevel) {  // now check if the second collection array has been added already
       fDetectorLevel->SetArrayName(name);
     }
@@ -332,30 +373,45 @@ void AliEmcalTrackingQATask::ExecOnce()
 {
   // Init the analysis.
 
-  if (fParticleCollArray.GetEntriesFast() < 2) {
-    AliFatal("This task needs at least two particle containers!");
-  }
+  AliAnalysisTaskEmcal::ExecOnce();
+}
 
-  if (!fGeneratorLevel) {
-    fGeneratorLevel = static_cast<AliParticleContainer*>(fParticleCollArray.At(0));
-    fGeneratorLevel->SetClassName("AliAODMCParticle");
-  }
+//________________________________________________________________________
+void AliEmcalTrackingQATask::FillDetectorLevelTHnSparse(Double_t cent, Double_t trackEta, Double_t trackPhi, Double_t trackPt, 
+                                                        Double_t sigma1OverPt, Int_t mcGen, Byte_t trackType)
+{
+  Double_t contents[20]={0};
 
-  if (!fDetectorLevel) {
-    fDetectorLevel = static_cast<AliParticleContainer*>(fParticleCollArray.At(1));
-    fDetectorLevel->SetClassName("AliPicoTrack");
+  for (Int_t i = 0; i < fTracks->GetNdimensions(); i++) {
+    TString title(fTracks->GetAxis(i)->GetTitle());
+    if (title=="Centrality %")
+      contents[i] = cent;
+    else if (title=="#it{p}_{T} (GeV/#it{c})")
+      contents[i] = trackPt;
+    else if (title=="#eta")
+      contents[i] = trackEta;
+    else if (title=="#phi")
+      contents[i] = trackPhi;
+    else if (title=="#sigma(1/#it{p}_{T}) (GeV/#it{c})^{-1}")
+      contents[i] = sigma1OverPt;
+    else if (title=="MC Generator")
+      contents[i] = mcGen;
+    else if (title=="track type")
+      contents[i] = trackType;
+    else 
+      AliWarning(Form("Unable to fill dimension %s of histogram %s!", title.Data(), fTracks->GetName()));
   }
 
-  AliAnalysisTaskEmcal::ExecOnce();
+  fTracks->Fill(contents);
 }
 
 //________________________________________________________________________
-void AliEmcalTrackingQATask::FillFindableParticlesTHnSparse(Double_t cent, Double_t partEta, Double_t partPhi, Double_t partPt)
+void AliEmcalTrackingQATask::FillGeneratorLevelTHnSparse(Double_t cent, Double_t partEta, Double_t partPhi, Double_t partPt, Int_t mcGen, Byte_t findable)
 {
   Double_t contents[20]={0};
 
-  for (Int_t i = 0; i < fParticlesFindable->GetNdimensions(); i++) {
-    TString title(fParticlesFindable->GetAxis(i)->GetTitle());
+  for (Int_t i = 0; i < fParticlesPhysPrim->GetNdimensions(); i++) {
+    TString title(fParticlesPhysPrim->GetAxis(i)->GetTitle());
     if (title=="Centrality %")
       contents[i] = cent;
     else if (title=="#it{p}_{T} (GeV/#it{c})")
@@ -364,11 +420,15 @@ void AliEmcalTrackingQATask::FillFindableParticlesTHnSparse(Double_t cent, Doubl
       contents[i] = partEta;
     else if (title=="#phi")
       contents[i] = partPhi;
+    else if (title=="MC Generator")
+      contents[i] = mcGen;
+    else if (title=="Findable")
+      contents[i] = findable;
     else 
-      AliWarning(Form("Unable to fill dimension %s of histogram %s!", title.Data(), fParticlesFindable->GetName()));
+      AliWarning(Form("Unable to fill dimension %s of histogram %s!", title.Data(), fParticlesPhysPrim->GetName()));
   }
 
-  fParticlesFindable->Fill(contents);
+  fParticlesPhysPrim->Fill(contents);
 }
 
 //________________________________________________________________________
@@ -413,16 +473,20 @@ Bool_t AliEmcalTrackingQATask::FillHistograms()
   while (track != 0) {
     Byte_t type = track->GetTrackType();
     if (type <= 2) {
-      fTracksAll[fCentBin][type]->Fill(track->Eta(), track->Phi(), track->Pt());
+      Double_t sigma = 0;
+      if (fIsEsd) {
+        AliESDtrack *esdTrack = dynamic_cast<AliESDtrack*>(track->GetTrack());
+        if (esdTrack) sigma = TMath::Sqrt(esdTrack->GetSigma1Pt2());
+      }
 
       Int_t label = TMath::Abs(track->GetLabel());
+      Int_t mcGen = 1;
+      // reject particles generated from other generators in the cocktail but keep fake tracks (label == 0)
+      if (fSelectHIJING && (label==0 || track->GetGeneratorIndex() == 0)) mcGen = 0;
 
-      if (fSelectHIJING && (label==0 || track->GetGeneratorIndex() == 0)) {  
-       // reject particles generated from other generators in the cocktail but keep fake tracks (label == 0)
-       fTracksSelected[fCentBin][type]->Fill(track->Eta(), track->Phi(), track->Pt());
-      }
+      FillDetectorLevelTHnSparse(fCent, track->Eta(), track->Phi(), track->Pt(), sigma, mcGen, type);
       
-      if (label > 0) {
+      if (fGeneratorLevel && label > 0) {
        AliAODMCParticle *part =  static_cast<AliAODMCParticle*>(fGeneratorLevel->GetAcceptParticleWithLabel(label));
        if (part) {
          if (!fSelectHIJING || part->GetGeneratorIndex() == 0) {
@@ -442,20 +506,21 @@ Bool_t AliEmcalTrackingQATask::FillHistograms()
     track = static_cast<AliPicoTrack*>(fDetectorLevel->GetNextAcceptParticle());
   }
 
-  AliAODMCParticle *part = static_cast<AliAODMCParticle*>(fGeneratorLevel->GetNextAcceptParticle(0));
-  while (part != 0) {
-    fParticlesAllPhysPrim[fCentBin]->Fill(part->Eta(), part->Phi(), part->Pt());
-    if (!fSelectHIJING || part->GetGeneratorIndex() == 0) {
-      if (fSelectHIJING) fParticlesSelected[fCentBin]->Fill(part->Eta(), part->Phi(), part->Pt());
+  if (fGeneratorLevel) {
+    AliAODMCParticle *part = static_cast<AliAODMCParticle*>(fGeneratorLevel->GetNextAcceptParticle(0));
+    while (part != 0) {
+      Int_t mcGen = 1;
+      Byte_t findable = 0;
+      
+      if (fSelectHIJING && part->GetGeneratorIndex() == 0) mcGen = 0;
 
       Int_t pdg = TMath::Abs(part->PdgCode());
       // select charged pions, protons, kaons , electrons, muons
-      if (pdg == 211 || pdg == 2212 || pdg == 321 || pdg == 11 || pdg == 13) {
-       FillFindableParticlesTHnSparse(fCent, part->Eta(), part->Phi(), part->Pt());
-      }
+      if (pdg == 211 || pdg == 2212 || pdg == 321 || pdg == 11 || pdg == 13) findable = 1;
+
+      FillGeneratorLevelTHnSparse(fCent, part->Eta(), part->Phi(), part->Pt(), mcGen, findable);    
+      part = static_cast<AliAODMCParticle*>(fGeneratorLevel->GetNextAcceptParticle());
     }
-    
-    part = static_cast<AliAODMCParticle*>(fGeneratorLevel->GetNextAcceptParticle());
   }
 
   return kTRUE;
index 1909915..bca1020 100644 (file)
@@ -23,9 +23,13 @@ class AliEmcalTrackingQATask : public AliAnalysisTaskEmcal {
   Bool_t                 FillHistograms()                               ;
   void                   ExecOnce()                                     ;
   void                   GenerateHistoBins()                            ;
+  void                   AllocateDetectorLevelTHnSparse()                    ;
+  void                   AllocateGeneratorLevelTHnSparse()                              ;
   void                   AllocateFindableParticlesTHnSparse()           ;
   void                   AllocateMatchedParticlesTHnSparse()            ;
-  void                   FillFindableParticlesTHnSparse(Double_t cent, Double_t partEta, Double_t partPhi, Double_t partPt);
+  void                   FillDetectorLevelTHnSparse(Double_t cent, Double_t trackEta, Double_t trackPhi, Double_t trackPt, 
+                                                    Double_t sigma1OverPt, Int_t mcGen, Byte_t trackType);
+  void                   FillGeneratorLevelTHnSparse(Double_t cent, Double_t partEta, Double_t partPhi, Double_t partPt, Int_t mcGen, Byte_t findable);
   void                   FillMatchedParticlesTHnSparse(Double_t cent, Double_t partEta, Double_t partPhi, Double_t partPt,
                                                       Double_t trackEta, Double_t trackPhi, Double_t trackPt, Byte_t trackType);
 
@@ -44,17 +48,16 @@ class AliEmcalTrackingQATask : public AliAnalysisTaskEmcal {
   Int_t                 fNCentHistBins         ; //! number of cent bins
   Double_t*             fCentHistBins          ; //! cent bins
   Int_t                 fNPtResHistBins        ; //! number of pt res bins
-  Double_t*             fPtResHistBins         ; //! pt res bins
+  Double_t*             fPtResHistBins         ; //! 1/pt res bins
+  Double_t*             f1OverPtResHistBins    ; //! pt res bins
+  Int_t                 fN1OverPtResHistBins   ; //! number of 1/pt res bins
   Int_t                 fNIntegerHistBins      ; //! number of integer bins
   Double_t*             fIntegerHistBins       ; //! integer bins
 
 
   // Histograms
-  TH3***                fTracksAll             ; //! all tracks
-  TH3***                fTracksSelected        ; //! selected tracks (e.g. remove injected signal in HIJING productions)
-  TH3**                 fParticlesAllPhysPrim  ; //! all physical primary particles
-  TH3**                 fParticlesSelected     ; //! selected physical primary particles (e.g. remove injected signal in HIJING productions)
-  THnSparse*            fParticlesFindable     ; //! findable physical primary particles (use PDG and charge selection)
+  THnSparse*            fTracks                ; //! all tracks
+  THnSparse*            fParticlesPhysPrim     ; //! all physical primary particles
   THnSparse*            fParticlesMatched      ; //! primary particles matched to detector level tracks
   
  private:
index cf392be..21d60c6 100644 (file)
@@ -1,5 +1,5 @@
-AliEmcalTrackingQATask* AddTaskTrackingQA(const char *nGenLev      = "mcparticles",
-                                         const char *nDetLev      = "PicoTracks",
+AliEmcalTrackingQATask* AddTaskTrackingQA(const char *nDetLev      = "PicoTracks",
+                                          const char *nGenLev      = "mcparticles",
                                          Bool_t      selHIJING    = kTRUE)
 {  
   // Get the pointer to the existing analysis manager via the static access method.
@@ -25,8 +25,8 @@ AliEmcalTrackingQATask* AddTaskTrackingQA(const char *nGenLev      = "mcparticle
 
   TString name(Form("AliEmcalTrackingQATask_%s_%s", nGenLev, nDetLev));
   AliEmcalTrackingQATask *qaTask = new AliEmcalTrackingQATask(name);
-  qaTask->SetGeneratorLevelName(nGenLev);
   qaTask->SetDetectorLevelName(nDetLev);
+  if (nGenLev && strcmp(nGenLev,"")!=0) qaTask->SetGeneratorLevelName(nGenLev);
   qaTask->SetSelectHIJING(selHIJING);
   qaTask->SetVzRange(-10,10);