Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Analysis/DataModel/include/AnalysisDataModel/PID/PIDResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ DECLARE_SOA_TABLE(pidRespTOFbeta, "AOD", "pidRespTOFbeta",
ExpBetaEl, ExpBetaElError,
SeparationBetaEl,
DiffBetaEl<Beta, ExpBetaEl>);

using namespace pidtof;
DECLARE_SOA_TABLE(pidRespTOF, "AOD", "pidRespTOF",
// Expected signals
Expand All @@ -101,6 +102,17 @@ DECLARE_SOA_TABLE(pidRespTOF, "AOD", "pidRespTOF",
TOFNSigmaKa, TOFNSigmaPr, TOFNSigmaDe,
TOFNSigmaTr, TOFNSigmaHe, TOFNSigmaAl);

// Per particle tables
DECLARE_SOA_TABLE(pidRespTOFEl, "AOD", "pidRespTOFEl", TOFExpSignalDiffEl<TOFNSigmaEl, TOFExpSigmaEl>, TOFExpSigmaEl, TOFNSigmaEl);
DECLARE_SOA_TABLE(pidRespTOFMu, "AOD", "pidRespTOFMu", TOFExpSignalDiffMu<TOFNSigmaMu, TOFExpSigmaMu>, TOFExpSigmaMu, TOFNSigmaMu);
DECLARE_SOA_TABLE(pidRespTOFPi, "AOD", "pidRespTOFPi", TOFExpSignalDiffPi<TOFNSigmaPi, TOFExpSigmaPi>, TOFExpSigmaPi, TOFNSigmaPi);
DECLARE_SOA_TABLE(pidRespTOFKa, "AOD", "pidRespTOFKa", TOFExpSignalDiffKa<TOFNSigmaKa, TOFExpSigmaKa>, TOFExpSigmaKa, TOFNSigmaKa);
DECLARE_SOA_TABLE(pidRespTOFPr, "AOD", "pidRespTOFPr", TOFExpSignalDiffPr<TOFNSigmaPr, TOFExpSigmaPr>, TOFExpSigmaPr, TOFNSigmaPr);
DECLARE_SOA_TABLE(pidRespTOFDe, "AOD", "pidRespTOFDe", TOFExpSignalDiffDe<TOFNSigmaDe, TOFExpSigmaDe>, TOFExpSigmaDe, TOFNSigmaDe);
DECLARE_SOA_TABLE(pidRespTOFTr, "AOD", "pidRespTOFTr", TOFExpSignalDiffTr<TOFNSigmaTr, TOFExpSigmaTr>, TOFExpSigmaTr, TOFNSigmaTr);
DECLARE_SOA_TABLE(pidRespTOFHe, "AOD", "pidRespTOFHe", TOFExpSignalDiffHe<TOFNSigmaHe, TOFExpSigmaHe>, TOFExpSigmaHe, TOFNSigmaHe);
DECLARE_SOA_TABLE(pidRespTOFAl, "AOD", "pidRespTOFAl", TOFExpSignalDiffAl<TOFNSigmaAl, TOFExpSigmaAl>, TOFExpSigmaAl, TOFNSigmaAl);

namespace pidtpc
{
// Expected signals
Expand Down Expand Up @@ -156,6 +168,17 @@ DECLARE_SOA_TABLE(pidRespTPC, "AOD", "pidRespTPC",
TPCNSigmaKa, TPCNSigmaPr, TPCNSigmaDe,
TPCNSigmaTr, TPCNSigmaHe, TPCNSigmaAl);

// Per particle tables
DECLARE_SOA_TABLE(pidRespTPCEl, "AOD", "pidRespTPCEl", TPCExpSignalDiffEl<TPCNSigmaEl, TPCExpSigmaEl>, TPCExpSigmaEl, TPCNSigmaEl);
DECLARE_SOA_TABLE(pidRespTPCMu, "AOD", "pidRespTPCMu", TPCExpSignalDiffMu<TPCNSigmaMu, TPCExpSigmaMu>, TPCExpSigmaMu, TPCNSigmaMu);
DECLARE_SOA_TABLE(pidRespTPCPi, "AOD", "pidRespTPCPi", TPCExpSignalDiffPi<TPCNSigmaPi, TPCExpSigmaPi>, TPCExpSigmaPi, TPCNSigmaPi);
DECLARE_SOA_TABLE(pidRespTPCKa, "AOD", "pidRespTPCKa", TPCExpSignalDiffKa<TPCNSigmaKa, TPCExpSigmaKa>, TPCExpSigmaKa, TPCNSigmaKa);
DECLARE_SOA_TABLE(pidRespTPCPr, "AOD", "pidRespTPCPr", TPCExpSignalDiffPr<TPCNSigmaPr, TPCExpSigmaPr>, TPCExpSigmaPr, TPCNSigmaPr);
DECLARE_SOA_TABLE(pidRespTPCDe, "AOD", "pidRespTPCDe", TPCExpSignalDiffDe<TPCNSigmaDe, TPCExpSigmaDe>, TPCExpSigmaDe, TPCNSigmaDe);
DECLARE_SOA_TABLE(pidRespTPCTr, "AOD", "pidRespTPCTr", TPCExpSignalDiffTr<TPCNSigmaTr, TPCExpSigmaTr>, TPCExpSigmaTr, TPCNSigmaTr);
DECLARE_SOA_TABLE(pidRespTPCHe, "AOD", "pidRespTPCHe", TPCExpSignalDiffHe<TPCNSigmaHe, TPCExpSigmaHe>, TPCExpSigmaHe, TPCNSigmaHe);
DECLARE_SOA_TABLE(pidRespTPCAl, "AOD", "pidRespTPCAl", TPCExpSignalDiffAl<TPCNSigmaAl, TPCExpSigmaAl>, TPCExpSigmaAl, TPCNSigmaAl);

} // namespace o2::aod

#endif // O2_FRAMEWORK_PIDRESPONSE_H_
10 changes: 10 additions & 0 deletions Analysis/Tasks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,21 @@ o2_add_dpl_workflow(pid-tof
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel O2::AnalysisCore
COMPONENT_NAME Analysis)

o2_add_dpl_workflow(pid-tof-split
SOURCES pidTOF_split.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel O2::AnalysisCore
COMPONENT_NAME Analysis)

o2_add_dpl_workflow(pid-tpc
SOURCES pidTPC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel O2::AnalysisCore
COMPONENT_NAME Analysis)

o2_add_dpl_workflow(pid-tpc-split
SOURCES pidTPC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel O2::AnalysisCore
COMPONENT_NAME Analysis)

o2_add_dpl_workflow(validation
SOURCES validation.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase
Expand Down
10 changes: 10 additions & 0 deletions Analysis/Tasks/PWGLF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,21 @@ o2_add_dpl_workflow(spectra-tof
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel
COMPONENT_NAME Analysis)

o2_add_dpl_workflow(spectra-tof-split
SOURCES spectraTOF_split.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel
COMPONENT_NAME Analysis)

o2_add_dpl_workflow(spectra-tpc
SOURCES spectraTPC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel
COMPONENT_NAME Analysis)

o2_add_dpl_workflow(spectra-tpc-split
SOURCES spectraTPC_split.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel
COMPONENT_NAME Analysis)

o2_add_dpl_workflow(nuclei-spectra
SOURCES NucleiSpectraTask.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel
Expand Down
25 changes: 11 additions & 14 deletions Analysis/Tasks/PWGLF/spectraTOF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ struct TOFSpectraTask {
}

template <std::size_t i, typename T>
void fillParticleHistos(const T& track, const float nsigma[])
void fillParticleHistos(const T& track, const float& nsigma)
{
if (abs(nsigma[i]) > nsigmacut.value) {
if (abs(nsigma) > nsigmacut.value) {
return;
}
histos.fill(HIST(hp[i]), track.p());
Expand All @@ -63,21 +63,18 @@ struct TOFSpectraTask {
using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::pidRespTOF, aod::pidRespTOFbeta, aod::TrackSelection>>;
void process(TrackCandidates::iterator const& track)
{
const float nsigma[Np] = {track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(),
track.tofNSigmaKa(), track.tofNSigmaPr(), track.tofNSigmaDe(),
track.tofNSigmaTr(), track.tofNSigmaHe(), track.tofNSigmaAl()};
histos.fill(HIST("p/Unselected"), track.p());
histos.fill(HIST("pt/Unselected"), track.pt());

fillParticleHistos<0>(track, nsigma);
fillParticleHistos<1>(track, nsigma);
fillParticleHistos<2>(track, nsigma);
fillParticleHistos<3>(track, nsigma);
fillParticleHistos<4>(track, nsigma);
fillParticleHistos<5>(track, nsigma);
fillParticleHistos<6>(track, nsigma);
fillParticleHistos<7>(track, nsigma);
fillParticleHistos<8>(track, nsigma);
fillParticleHistos<0>(track, track.tofNSigmaEl());
fillParticleHistos<1>(track, track.tofNSigmaMu());
fillParticleHistos<2>(track, track.tofNSigmaPi());
fillParticleHistos<3>(track, track.tofNSigmaKa());
fillParticleHistos<4>(track, track.tofNSigmaPr());
fillParticleHistos<5>(track, track.tofNSigmaDe());
fillParticleHistos<6>(track, track.tofNSigmaTr());
fillParticleHistos<7>(track, track.tofNSigmaHe());
fillParticleHistos<8>(track, track.tofNSigmaAl());

//
if (TMath::Abs(track.separationbetael() < 1.f)) {
Expand Down
99 changes: 99 additions & 0 deletions Analysis/Tasks/PWGLF/spectraTOF_split.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

// O2 includes
#include "ReconstructionDataFormats/Track.h"
#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/ASoAHelpers.h"
#include "AnalysisDataModel/PID/PIDResponse.h"
#include "AnalysisDataModel/TrackSelectionTables.h"

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;

struct TOFSpectraTaskSplit {
static constexpr int Np = 9;
static constexpr const char* pT[Np] = {"e", "#mu", "#pi", "K", "p", "d", "t", "^{3}He", "#alpha"};
static constexpr std::string_view hp[Np] = {"p/El", "p/Mu", "p/Pi", "p/Ka", "p/Pr", "p/De", "p/Tr", "p/He", "p/Al"};
static constexpr std::string_view hpt[Np] = {"pt/El", "pt/Mu", "pt/Pi", "pt/Ka", "pt/Pr", "pt/De", "pt/Tr", "pt/He", "pt/Al"};
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};

void init(o2::framework::InitContext&)
{
histos.add("p/Unselected", "Unselected;#it{p} (GeV/#it{c})", kTH1F, {{100, 0, 20}});
histos.add("pt/Unselected", "Unselected;#it{p}_{T} (GeV/#it{c})", kTH1F, {{100, 0, 20}});
for (int i = 0; i < Np; i++) {
histos.add(hp[i].data(), Form("%s;#it{p} (GeV/#it{c})", pT[i]), kTH1F, {{100, 0, 20}});
histos.add(hpt[i].data(), Form("%s;#it{p}_{T} (GeV/#it{c})", pT[i]), kTH1F, {{100, 0, 20}});
}
histos.add("electronbeta/hp_El", ";#it{p} (GeV/#it{c})", kTH1F, {{100, 0, 20}});
histos.add("electronbeta/hpt_El", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {{100, 0, 20}});
histos.add("electronbeta/hlength_El", ";Track Length (cm);Tracks", kTH1D, {{100, 0, 1000}});
histos.add("electronbeta/htime_El", ";TOF Time (ns);Tracks", kTH1D, {{1000, 0, 600}});
histos.add("electronbeta/hp_beta_El", ";#it{p} (GeV/#it{c});#beta - #beta_{e};Tracks", kTH2D, {{100, 0, 20}, {100, -0.01, 0.01}});
histos.add("electronbeta/hp_betasigma_El", ";#it{p} (GeV/#it{c});(#beta - #beta_{e})/#sigma;Tracks", kTH2D, {{100, 0, 20}, {100, -5, 5}});
}

template <std::size_t i, typename T>
void fillParticleHistos(const T& track, const float& nsigma)
{
if (abs(nsigma) > nsigmacut.value) {
return;
}
histos.fill(HIST(hp[i]), track.p());
histos.fill(HIST(hpt[i]), track.pt());
}

Configurable<float> cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"};
Configurable<float> cfgCutEta{"cfgCutEta", 0.8f, "Eta range for tracks"};
Configurable<float> nsigmacut{"nsigmacut", 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) && (aod::track::tofSignal > 0.f);
using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra,
aod::pidRespTOFEl, aod::pidRespTOFMu, aod::pidRespTOFPi,
aod::pidRespTOFKa, aod::pidRespTOFPr, aod::pidRespTOFDe,
aod::pidRespTOFTr, aod::pidRespTOFHe, aod::pidRespTOFAl,
aod::pidRespTOFbeta, aod::TrackSelection>>;
void process(TrackCandidates::iterator const& track)
{
histos.fill(HIST("p/Unselected"), track.p());
histos.fill(HIST("pt/Unselected"), track.pt());

fillParticleHistos<0>(track, track.tofNSigmaEl());
fillParticleHistos<1>(track, track.tofNSigmaMu());
fillParticleHistos<2>(track, track.tofNSigmaPi());
fillParticleHistos<3>(track, track.tofNSigmaKa());
fillParticleHistos<4>(track, track.tofNSigmaPr());
fillParticleHistos<5>(track, track.tofNSigmaDe());
fillParticleHistos<6>(track, track.tofNSigmaTr());
fillParticleHistos<7>(track, track.tofNSigmaHe());
fillParticleHistos<8>(track, track.tofNSigmaAl());

//
if (TMath::Abs(track.separationbetael() < 1.f)) {
histos.fill(HIST("electronbeta/hp_El"), track.p());
histos.fill(HIST("electronbeta/hpt_El"), track.pt());
histos.fill(HIST("electronbeta/hlength_El"), track.length());
histos.fill(HIST("electronbeta/htime_El"), track.tofSignal() / 1000);
histos.fill(HIST("electronbeta/hp_beta_El"), track.p(), track.diffbetael());
histos.fill(HIST("electronbeta/hp_betasigma_El"), track.p(), track.separationbetael());
}
}
};

WorkflowSpec defineDataProcessing(ConfigContext const&)
{
WorkflowSpec workflow{adaptAnalysisTask<TOFSpectraTaskSplit>("tofspectra-split-task")};
return workflow;
}
45 changes: 21 additions & 24 deletions Analysis/Tasks/PWGLF/spectraTPC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ struct TPCSpectraTask {
Configurable<float> nsigmacut{"nsigmacut", 3, "Value of the Nsigma cut"};

template <std::size_t i, typename T>
void fillParticleHistos(const T& track, const float nsigma[])
void fillParticleHistos(const T& track, const float& nsigma)
{
if (abs(nsigma[i]) > nsigmacut.value) {
if (abs(nsigma) > nsigmacut.value) {
return;
}
histos.fill(HIST(hp[i]), track.p());
Expand All @@ -90,21 +90,18 @@ struct TPCSpectraTask {
using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::pidRespTPC, aod::TrackSelection>>;
void process(TrackCandidates::iterator const& track)
{
const float nsigma[Np] = {track.tpcNSigmaEl(), track.tpcNSigmaMu(), track.tpcNSigmaPi(),
track.tpcNSigmaKa(), track.tpcNSigmaPr(), track.tpcNSigmaDe(),
track.tpcNSigmaTr(), track.tpcNSigmaHe(), track.tpcNSigmaAl()};
histos.fill(HIST("p/Unselected"), track.p());
histos.fill(HIST("pt/Unselected"), track.pt());

fillParticleHistos<0>(track, nsigma);
fillParticleHistos<1>(track, nsigma);
fillParticleHistos<2>(track, nsigma);
fillParticleHistos<3>(track, nsigma);
fillParticleHistos<4>(track, nsigma);
fillParticleHistos<5>(track, nsigma);
fillParticleHistos<6>(track, nsigma);
fillParticleHistos<7>(track, nsigma);
fillParticleHistos<8>(track, nsigma);
fillParticleHistos<0>(track, track.tpcNSigmaEl());
fillParticleHistos<1>(track, track.tpcNSigmaMu());
fillParticleHistos<2>(track, track.tpcNSigmaPi());
fillParticleHistos<3>(track, track.tpcNSigmaKa());
fillParticleHistos<4>(track, track.tpcNSigmaPr());
fillParticleHistos<5>(track, track.tpcNSigmaDe());
fillParticleHistos<6>(track, track.tpcNSigmaTr());
fillParticleHistos<7>(track, track.tpcNSigmaHe());
fillParticleHistos<8>(track, track.tpcNSigmaAl());
}
};

Expand Down Expand Up @@ -143,16 +140,16 @@ struct TPCPIDQASignalwTOFTask {
void process(TrackCandidates::iterator const& track)
{
// const float mom = track.p();
const float mom = track.tpcInnerParam();
histos.fill(HIST(htpcsignal[0]), mom, track.tpcSignal(), track.tofNSigmaEl());
histos.fill(HIST(htpcsignal[1]), mom, track.tpcSignal(), track.tofNSigmaMu());
histos.fill(HIST(htpcsignal[2]), mom, track.tpcSignal(), track.tofNSigmaPi());
histos.fill(HIST(htpcsignal[3]), mom, track.tpcSignal(), track.tofNSigmaKa());
histos.fill(HIST(htpcsignal[4]), mom, track.tpcSignal(), track.tofNSigmaPr());
histos.fill(HIST(htpcsignal[5]), mom, track.tpcSignal(), track.tofNSigmaDe());
histos.fill(HIST(htpcsignal[6]), mom, track.tpcSignal(), track.tofNSigmaTr());
histos.fill(HIST(htpcsignal[7]), mom, track.tpcSignal(), track.tofNSigmaHe());
histos.fill(HIST(htpcsignal[8]), mom, track.tpcSignal(), track.tofNSigmaAl());
// const float mom = track.tpcInnerParam();
histos.fill(HIST(htpcsignal[0]), track.tpcInnerParam(), track.tpcSignal(), track.tofNSigmaEl());
histos.fill(HIST(htpcsignal[1]), track.tpcInnerParam(), track.tpcSignal(), track.tofNSigmaMu());
histos.fill(HIST(htpcsignal[2]), track.tpcInnerParam(), track.tpcSignal(), track.tofNSigmaPi());
histos.fill(HIST(htpcsignal[3]), track.tpcInnerParam(), track.tpcSignal(), track.tofNSigmaKa());
histos.fill(HIST(htpcsignal[4]), track.tpcInnerParam(), track.tpcSignal(), track.tofNSigmaPr());
histos.fill(HIST(htpcsignal[5]), track.tpcInnerParam(), track.tpcSignal(), track.tofNSigmaDe());
histos.fill(HIST(htpcsignal[6]), track.tpcInnerParam(), track.tpcSignal(), track.tofNSigmaTr());
histos.fill(HIST(htpcsignal[7]), track.tpcInnerParam(), track.tpcSignal(), track.tofNSigmaHe());
histos.fill(HIST(htpcsignal[8]), track.tpcInnerParam(), track.tpcSignal(), track.tofNSigmaAl());
}
};

Expand Down
Loading