diff --git a/Tasks/PWGLF/CMakeLists.txt b/Tasks/PWGLF/CMakeLists.txt index cc679097f5f70..9f7253dafba86 100644 --- a/Tasks/PWGLF/CMakeLists.txt +++ b/Tasks/PWGLF/CMakeLists.txt @@ -45,7 +45,7 @@ o2_add_dpl_workflow(spectra-tpc-tiny o2_add_dpl_workflow(nuclei-spectra SOURCES NucleiSpectraTask.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel + PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel O2::AnalysisCore COMPONENT_NAME Analysis) o2_add_dpl_workflow(lambdakzerobuilder diff --git a/Tasks/PWGLF/NucleiSpectraTask.cxx b/Tasks/PWGLF/NucleiSpectraTask.cxx index 85d6964c07a87..af12e0d9b654b 100644 --- a/Tasks/PWGLF/NucleiSpectraTask.cxx +++ b/Tasks/PWGLF/NucleiSpectraTask.cxx @@ -17,9 +17,9 @@ #include "AnalysisDataModel/PID/PIDResponse.h" #include "AnalysisDataModel/TrackSelectionTables.h" -// #include "AnalysisDataModel/EventSelection.h" -// #include "AnalysisDataModel/TrackSelectionTables.h" -// #include "AnalysisDataModel/Centrality.h" +#include "AnalysisDataModel/EventSelection.h" +#include "AnalysisDataModel/TrackSelectionTables.h" +#include "AnalysisDataModel/Centrality.h" #include "Framework/HistogramRegistry.h" @@ -43,45 +43,65 @@ struct NucleiSpecraTask { AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec centAxis = {centBinning, "V0M (%)"}; + spectra.add("fCollZpos", "collision z position", HistType::kTH1F, {{600, -20., +20., "z position (cm)"}}); + spectra.add("fKeepEvent", "skimming histogram", HistType::kTH1F, {{2, -0.5, +1.5, "true: keep event, false: reject event"}}); spectra.add("fTPCsignal", "Specific energy loss", HistType::kTH2F, {{600, 0., 3, "#it{p} (GeV/#it{c})"}, {1400, 0, 1400, "d#it{E} / d#it{X} (a. u.)"}}); - - spectra.add("fTPCcounts", "n-sigma TPC", HistType::kTH2F, {ptAxis, {200, -5, 5, "n#sigma_{d} (a. u.)"}}); + spectra.add("fTPCcounts", "n-sigma TPC", HistType::kTH2F, {ptAxis, {200, -100., +100., "n#sigma_{He} (a. u.)"}}); } - Configurable yMin{"yMin", -0.5, "Maximum rapidity"}; - Configurable yMax{"yMax", 0.5, "Minimum rapidity"}; + Configurable yMin{"yMin", -0.8, "Maximum rapidity"}; + Configurable yMax{"yMax", 0.8, "Minimum rapidity"}; Configurable yBeam{"yBeam", 0., "Beam rapidity"}; Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; Configurable cfgCutEta{"cfgCutEta", 0.8f, "Eta range for tracks"}; - Configurable nsigmacut{"nsigmacut", 3, "Value of the Nsigma cut"}; + Configurable nsigmacutLow{"nsigmacutLow", -30.0, "Value of the Nsigma cut"}; + Configurable nsigmacutHigh{"nsigmacutHigh", +3., "Value of the Nsigma cut"}; Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::isGlobalTrack == (uint8_t) true); using TrackCandidates = soa::Filtered>; - void process(/*soa::Join aod::Collisions::iterator const& col, */ TrackCandidates const& tracks) + void process(soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, TrackCandidates const& tracks) { - /* - if (!col.alias()[kINT7]) + // + // collision process loop + // + bool keepEvent = kFALSE; + if (!collision.alias()[kINT7]) { return; - if (!col.sel7()) + } + if (!collision.sel7()) { return; - - fMultiplicity->Fill(col.centV0M()); - */ - for (auto track : tracks) { + } + // + spectra.fill(HIST("fCollZpos"), collision.posZ()); + // + for (auto track : tracks) { // start loop over tracks TLorentzVector cutVector{}; - cutVector.SetPtEtaPhiM(track.pt(), track.eta(), track.phi(), constants::physics::MassDeuteron); + cutVector.SetPtEtaPhiM(track.pt() * 2.0, track.eta(), track.phi(), constants::physics::MassHelium3); if (cutVector.Rapidity() < yMin + yBeam || cutVector.Rapidity() > yMax + yBeam) { continue; } - + // + // fill QA histograms + // spectra.fill(HIST("fTPCsignal"), track.tpcInnerParam(), track.tpcSignal()); - spectra.fill(HIST("fTPCcounts"), fabs(track.pt()), track.tpcNSigmaDe()); - } + spectra.fill(HIST("fTPCcounts"), track.tpcInnerParam(), track.tpcNSigmaHe()); + // + // check offline-trigger (skimming) condidition + // + if (track.tpcNSigmaHe() > nsigmacutLow && track.tpcNSigmaHe() < nsigmacutHigh) { + keepEvent = kTRUE; + } + + } // end loop over tracks + // + // fill trigger (skimming) results + // + spectra.fill(HIST("fKeepEvent"), keepEvent); } };