From d7ab1a9366d0432a78a0c748cc14e621f9ee59f8 Mon Sep 17 00:00:00 2001 From: saiola Date: Thu, 10 Jul 2014 00:11:33 -0400 Subject: [PATCH] seletc HIJING particles optional --- PWG/EMCAL/AliEmcalTrackingQATask.cxx | 40 ++++++++++++++++------------ PWG/EMCAL/AliEmcalTrackingQATask.h | 2 ++ PWG/EMCAL/macros/AddTaskTrackingQA.C | 4 ++- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/PWG/EMCAL/AliEmcalTrackingQATask.cxx b/PWG/EMCAL/AliEmcalTrackingQATask.cxx index 42da16ee81c..db437a5c352 100644 --- a/PWG/EMCAL/AliEmcalTrackingQATask.cxx +++ b/PWG/EMCAL/AliEmcalTrackingQATask.cxx @@ -20,6 +20,7 @@ ClassImp(AliEmcalTrackingQATask) //________________________________________________________________________ AliEmcalTrackingQATask::AliEmcalTrackingQATask() : AliAnalysisTaskEmcal("AliEmcalTrackingQA", kTRUE), + fSelectHIJING(kTRUE), fGeneratorLevel(0), fDetectorLevel(0), fTracksAll(0), @@ -37,6 +38,7 @@ AliEmcalTrackingQATask::AliEmcalTrackingQATask() : //________________________________________________________________________ AliEmcalTrackingQATask::AliEmcalTrackingQATask(const char *name) : AliAnalysisTaskEmcal(name, kTRUE), + fSelectHIJING(kTRUE), fGeneratorLevel(0), fDetectorLevel(0), fTracksAll(0), @@ -85,12 +87,14 @@ void AliEmcalTrackingQATask::UserCreateOutputObjects() fTracksAll[i][j]->GetZaxis()->SetTitle("#it{p}_{T} (GeV/#it{c})"); fOutput->Add(fTracksAll[i][j]); - histname = Form("fTracksSelected_%d_%d",i,j); - fTracksSelected[i][j] = new TH3F(histname,histname, 100, -1, 1, 101, 0, TMath::Pi() * 2.02, fNbins, fMinBinPt, fMaxBinPt); - 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 (fSelectHIJING) { + histname = Form("fTracksSelected_%d_%d",i,j); + fTracksSelected[i][j] = new TH3F(histname,histname, 100, -1, 1, 101, 0, TMath::Pi() * 2.02, fNbins, fMinBinPt, fMaxBinPt); + 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]); + } } histname = Form("fParticlesAllPhysPrim_%d",i); @@ -100,12 +104,14 @@ void AliEmcalTrackingQATask::UserCreateOutputObjects() fParticlesAllPhysPrim[i]->GetZaxis()->SetTitle("#it{p}_{T} (GeV/#it{c})"); fOutput->Add(fParticlesAllPhysPrim[i]); - histname = Form("fParticlesSelected_%d",i); - fParticlesSelected[i] = new TH3F(histname,histname, 100, -1, 1, 101, 0, TMath::Pi() * 2.02, fNbins, fMinBinPt, fMaxBinPt); - 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 (fSelectHIJING) { + histname = Form("fParticlesSelected_%d",i); + fParticlesSelected[i] = new TH3F(histname,histname, 100, -1, 1, 101, 0, TMath::Pi() * 2.02, fNbins, fMinBinPt, fMaxBinPt); + fParticlesSelected[i]->GetXaxis()->SetTitle("#eta"); + fParticlesSelected[i]->GetYaxis()->SetTitle("#phi"); + fParticlesSelected[i]->GetZaxis()->SetTitle("#it{p}_{T} (GeV/#it{c})"); + fOutput->Add(fParticlesSelected[i]); + } } AllocateFindableParticlesTHnSparse(); @@ -353,14 +359,15 @@ Bool_t AliEmcalTrackingQATask::FillHistograms() Int_t label = TMath::Abs(track->GetLabel()); - if (label==0 || track->GetGeneratorIndex() == 0) { // reject particles generated from other generators in the cocktail but keep fake tracks (label == 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()); } if (label > 0) { AliAODMCParticle *part = static_cast(fGeneratorLevel->GetAcceptParticleWithLabel(label)); if (part) { - if (part->GetGeneratorIndex() == 0) { + if (!fSelectHIJING || part->GetGeneratorIndex() == 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) { @@ -380,9 +387,8 @@ Bool_t AliEmcalTrackingQATask::FillHistograms() AliAODMCParticle *part = static_cast(fGeneratorLevel->GetNextAcceptParticle(0)); while (part != 0) { fParticlesAllPhysPrim[fCentBin]->Fill(part->Eta(), part->Phi(), part->Pt()); - - if (part->GetGeneratorIndex() == 0) { - fParticlesSelected[fCentBin]->Fill(part->Eta(), part->Phi(), part->Pt()); + if (!fSelectHIJING || part->GetGeneratorIndex() == 0) { + if (fSelectHIJING) fParticlesSelected[fCentBin]->Fill(part->Eta(), part->Phi(), part->Pt()); Int_t pdg = TMath::Abs(part->PdgCode()); // select charged pions, protons, kaons , electrons, muons diff --git a/PWG/EMCAL/AliEmcalTrackingQATask.h b/PWG/EMCAL/AliEmcalTrackingQATask.h index 50e108a7e41..b8057f73dea 100644 --- a/PWG/EMCAL/AliEmcalTrackingQATask.h +++ b/PWG/EMCAL/AliEmcalTrackingQATask.h @@ -17,6 +17,7 @@ class AliEmcalTrackingQATask : public AliAnalysisTaskEmcal { void UserCreateOutputObjects(); void SetGeneratorLevelName(const char* name); void SetDetectorLevelName(const char* name); + void SetSelectHIJING(Bool_t s) {fSelectHIJING=s;} protected: Bool_t FillHistograms() ; @@ -28,6 +29,7 @@ class AliEmcalTrackingQATask : public AliAnalysisTaskEmcal { Double_t trackEta, Double_t trackPhi, Double_t trackPt, Byte_t trackType); // Task configuration + Bool_t fSelectHIJING ; // select HIJING particles // Service fields (non-streamed) AliParticleContainer* fGeneratorLevel ; //! generator level container diff --git a/PWG/EMCAL/macros/AddTaskTrackingQA.C b/PWG/EMCAL/macros/AddTaskTrackingQA.C index 07b38789340..cf392be0c00 100644 --- a/PWG/EMCAL/macros/AddTaskTrackingQA.C +++ b/PWG/EMCAL/macros/AddTaskTrackingQA.C @@ -1,5 +1,6 @@ AliEmcalTrackingQATask* AddTaskTrackingQA(const char *nGenLev = "mcparticles", - const char *nDetLev = "PicoTracks") + const char *nDetLev = "PicoTracks", + Bool_t selHIJING = kTRUE) { // Get the pointer to the existing analysis manager via the static access method. //============================================================================== @@ -26,6 +27,7 @@ AliEmcalTrackingQATask* AddTaskTrackingQA(const char *nGenLev = "mcparticle AliEmcalTrackingQATask *qaTask = new AliEmcalTrackingQATask(name); qaTask->SetGeneratorLevelName(nGenLev); qaTask->SetDetectorLevelName(nDetLev); + qaTask->SetSelectHIJING(selHIJING); qaTask->SetVzRange(-10,10); //------------------------------------------------------- -- 2.43.0