Skip to content

Commit

Permalink
Add MC info + THnSparse (AliceO2Group#4579)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmazzasc authored and Barbara Chytla committed Feb 23, 2024
1 parent bce97c7 commit 0485675
Showing 1 changed file with 92 additions and 102 deletions.
194 changes: 92 additions & 102 deletions PWGLF/Tasks/QC/lfITSTPCMatchingQA.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "DataFormatsTPC/BetheBlochAleph.h"
#include "Common/Core/PID/PIDTOF.h"
#include "Common/TableProducer/PID/pidTOFBase.h"

#include "Framework/HistogramRegistry.h"
#include "Common/Core/PID/TPCPIDResponse.h"
#include "Common/DataModel/PIDResponse.h"

Expand All @@ -34,7 +34,7 @@ using namespace o2::framework;
using namespace o2::framework::expressions;

using TracksFull = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::pidTPCPr, aod::pidTPCKa, aod::pidTPCPi>;

using TracksFullMC = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::pidTPCPr, aod::pidTPCKa, aod::pidTPCPi, aod::McTrackLabels>;
namespace
{
// PID custom parametrisation for d and He3
Expand All @@ -43,7 +43,8 @@ constexpr double betheBlochDefault[2][6]{
{-321.34, 0.6539, 1.591, 0.8225, 2.363, 0.09}};
static const std::vector<std::string> betheBlochParNames{"p0", "p1", "p2", "p3", "p4", "resolution"};
static const std::vector<std::string> particleNamesBB{"d", "He3"};
static const std::vector<std::string> pidHypotheses{"Electron", "Muon", "Pion", "Kaon", "Proton", "Deuteron", "Triton", "He3", "Alpha", "Pion0", "Photon", "K0", "Lambda", "HyperTriton", "Hyperhydrog4", "XiMinus", "OmegaMinus"};
static const std::vector<std::string> pidHypotheses{"Electron", "Muon", "Pion", "Kaon", "Proton", "Deuteron", "Triton", "He3", "Alpha", "Photon", "K0", "Lambda", "HyperTriton", "Hyperhydrog4", "XiMinus", "OmegaMinus"};
static const std::vector<int> pdgCodes{11, 13, 211, 321, 2212, 1000010020, 1000010030, 1000020030, 1000020040, 22, 311, 3122, 1010010030, 1010010040, 3312, 3334};
} // namespace

struct lfmatchingqa {
Expand All @@ -57,7 +58,7 @@ struct lfmatchingqa {
ConfigurableAxis momResAxis{"momResAxis", {2.e2, -2.f, 2.f}, "momentum resolution binning"};
ConfigurableAxis tpcAxis{"tpcAxis", {4e3, 0.f, 4.e3f}, "tpc signal axis binning"};
ConfigurableAxis dcaAxis{"dcaAxis", {100, -0.1f, 0.1f}, "dca axis binning"};
ConfigurableAxis itsClusSizeAxis{"itsClusSizeAxis", {90, 1, 15}, "its cluster size axis binning"};
ConfigurableAxis itsClusSizeAxis{"itsClusSizeAxis", {120, 1, 15}, "its cluster size axis binning"};
ConfigurableAxis trackingPidAxis{"trackingPidAxis", {static_cast<double>(pidHypotheses.size()), 0, static_cast<double>(pidHypotheses.size())}, "tracking pid hypothesis binning"};

// Cut values
Expand Down Expand Up @@ -97,51 +98,64 @@ struct lfmatchingqa {
return sum / track.itsNCls();
}

template <class T>
void fillHistograms(T const& track, int pidMC, float genPMC)
{

auto sign = track.sign();
auto signTPCMom = sign * track.tpcInnerParam();
auto signGloMom = sign * track.p();
// calculating cos(L) of the track
float cosL = 1 / std::sqrt(1.f + track.tgl() * track.tgl());

// compute custom tpcNsigmaDeu and tpcNsigmaHe3
double expBetheDeu{tpc::BetheBlochAleph(static_cast<double>(track.tpcInnerParam() / constants::physics::MassDeuteron), cfgBetheBlochParams->get("d", "p0"), cfgBetheBlochParams->get("d", "p1"), cfgBetheBlochParams->get("d", "p2"), cfgBetheBlochParams->get("d", "p3"), cfgBetheBlochParams->get("d", "p4"))};
double expSigmaDeu{expBetheDeu * cfgBetheBlochParams->get("d", "resolution")};
double expBetheHe3{tpc::BetheBlochAleph(static_cast<double>(track.tpcInnerParam() / constants::physics::MassHelium3), cfgBetheBlochParams->get("He3", "p0"), cfgBetheBlochParams->get("He3", "p1"), cfgBetheBlochParams->get("He3", "p2"), cfgBetheBlochParams->get("He3", "p3"), cfgBetheBlochParams->get("He3", "p4"))};
double expSigmaHe3{expBetheHe3 * cfgBetheBlochParams->get("He3", "resolution")};
auto tpcNSigmaDeu = static_cast<float>((track.tpcSignal() - expBetheDeu) / expSigmaDeu);
auto tpcNSigmaHe3 = static_cast<float>((track.tpcSignal() - expBetheHe3) / expSigmaHe3);

// filling the nsigma histograms
histos.fill(HIST("tpcSignal"), signTPCMom, track.tpcSignal());

if (abs(track.tpcNSigmaPi()) < 4) {
histos.fill(HIST("thnPi"), signTPCMom, signGloMom, track.tpcInnerParam() - track.p(), track.dcaXY(), getITSClSize(track) * cosL, track.tpcSignal(), track.tpcNSigmaPi(), track.pidForTracking(), pidMC, genPMC);
}
if (abs(track.tpcNSigmaKa()) < 4) {
histos.fill(HIST("thnKa"), signTPCMom, signGloMom, track.tpcInnerParam() - track.p(), track.dcaXY(), getITSClSize(track) * cosL, track.tpcSignal(), track.tpcNSigmaKa(), track.pidForTracking(), pidMC, genPMC);
}
if (abs(track.tpcNSigmaPr()) < 4) {
histos.fill(HIST("thnPr"), signTPCMom, signGloMom, track.tpcInnerParam() - track.p(), track.dcaXY(), getITSClSize(track) * cosL, track.tpcSignal(), track.tpcNSigmaPr(), track.pidForTracking(), pidMC, genPMC);
}
if (abs(tpcNSigmaDeu) < 4) {
histos.fill(HIST("thnDe"), signTPCMom, signGloMom, track.tpcInnerParam() - track.p(), track.dcaXY(), getITSClSize(track) * cosL, track.tpcSignal(), tpcNSigmaDeu, track.pidForTracking(), pidMC, genPMC);
}
if (abs(tpcNSigmaHe3) < 4) {
histos.fill(HIST("tpcNsigmaHe"), signTPCMom, signGloMom, tpcNSigmaHe3);
histos.fill(HIST("pidHypoHe"), signTPCMom, tpcNSigmaHe3, track.pidForTracking());
}
}

void init(o2::framework::InitContext&)
{
histos.add<TH1>("zVtx", ";#it{z}_{vtx} (cm);Entries", HistType::kTH1F, {zVtxAxis});

histos.add<TH2>("tpcSignal", ";#it{p}_{TPC} (GeV/#it{c});TPC signal (a.u.)", {HistType::kTH2F}, {momAxisFine, tpcAxis});
histos.add<TH3>("tpcSignalPIDHypo", ";#it{p}_{TPC} (GeV/#it{c});TPC signal (a.u.); PID hypothesis", {HistType::kTH3F}, {momAxisFine, tpcAxis, trackingPidAxis});
histos.add<TH3>("tpcNsigmaPi", ";#it{p}_{TPC}; #it{p}_{GLO}; n#sigma_{TPC} (#pi)", {HistType::kTH3F, {momAxis, momAxis, tpcNsigmaAxis}});
histos.add<TH3>("tpcNsigmaKa", ";#it{p}_{TPC}; #it{p}_{GLO}; n#sigma_{TPC} (K)", {HistType::kTH3F, {momAxis, momAxis, tpcNsigmaAxis}});
histos.add<TH3>("tpcNsigmaPr", ";#it{p}_{TPC}; #it{p}_{GLO}; n#sigma_{TPC} (p)", {HistType::kTH3F, {momAxis, momAxis, tpcNsigmaAxis}});
histos.add<TH3>("tpcNsigmaDe", ";#it{p}_{TPC}; #it{p}_{GLO}; n#sigma_{TPC} (d)", {HistType::kTH3F, {momAxis, momAxis, tpcNsigmaAxis}});
histos.add<TH3>("tpcNsigmaHe", ";#it{p}_{TPC}; #it{p}_{GLO}; n#sigma_{TPC} (He3)", {HistType::kTH3F, {momAxis, momAxis, tpcNsigmaAxis}});

auto pidHypoPi = histos.add<TH3>("pidHypoPi", ";#it{p}_{TPC} (GeV/#it{c}); n#sigma_{TPC} (#pi);", {HistType::kTH3F}, {momAxisFine, tpcNsigmaAxis, trackingPidAxis});
auto pidHypoKa = histos.add<TH3>("pidHypoKa", ";#it{p}_{TPC} (GeV/#it{c}); n#sigma_{TPC} (K);", {HistType::kTH3F}, {momAxisFine, tpcNsigmaAxis, trackingPidAxis});
auto pidHypoPr = histos.add<TH3>("pidHypoPr", ";#it{p}_{TPC} (GeV/#it{c}); n#sigma_{TPC} (p);", {HistType::kTH3F}, {momAxisFine, tpcNsigmaAxis, trackingPidAxis});
auto pidHypoDe = histos.add<TH3>("pidHypoDe", ";#it{p}_{TPC} (GeV/#it{c}); n#sigma_{TPC} (d);", {HistType::kTH3F}, {momAxisFine, tpcNsigmaAxis, trackingPidAxis});
auto pidHypoHe = histos.add<TH3>("pidHypoHe", ";#it{p}_{TPC} (GeV/#it{c}); n#sigma_{TPC} (He3);", {HistType::kTH3F}, {momAxisFine, tpcNsigmaAxis, trackingPidAxis});
for (int i{1}; i < pidHypoPi->GetNbinsZ() + 1; ++i) {
pidHypoPi->GetZaxis()->SetBinLabel(i, pidHypotheses[i - 1].data());
pidHypoKa->GetZaxis()->SetBinLabel(i, pidHypotheses[i - 1].data());
pidHypoPr->GetZaxis()->SetBinLabel(i, pidHypotheses[i - 1].data());
pidHypoDe->GetZaxis()->SetBinLabel(i, pidHypotheses[i - 1].data());
pidHypoHe->GetZaxis()->SetBinLabel(i, pidHypotheses[i - 1].data());
}

histos.add<TH3>("momCorrPi", ";#it{p}_{TPC} (GeV/#it{c}); #it{p}_{GLO} (GeV/#it{c});#it{p}_{TPC} - #it{p}_{glo} (GeV/#it{c})", {HistType::kTH3F, {momAxis, momAxis, momResAxis}});
histos.add<TH3>("momCorrKa", ";#it{p}_{TPC} (GeV/#it{c}); #it{p}_{GLO} (GeV/#it{c});#it{p}_{TPC} - #it{p}_{glo} (GeV/#it{c})", {HistType::kTH3F, {momAxis, momAxis, momResAxis}});
histos.add<TH3>("momCorrPr", ";#it{p}_{TPC} (GeV/#it{c}); #it{p}_{GLO} (GeV/#it{c});#it{p}_{TPC} - #it{p}_{glo} (GeV/#it{c})", {HistType::kTH3F, {momAxis, momAxis, momResAxis}});
histos.add<TH3>("momCorrDe", ";#it{p}_{TPC} (GeV/#it{c}); #it{p}_{GLO} (GeV/#it{c});#it{p}_{TPC} - #it{p}_{glo} (GeV/#it{c})", {HistType::kTH3F, {momAxis, momAxis, momResAxis}});
histos.add<TH3>("momCorrHe", ";#it{p}_{TPC} (GeV/#it{c}); #it{p}_{GLO} (GeV/#it{c});#it{p}_{TPC} - #it{p}_{glo} (GeV/#it{c})", {HistType::kTH3F, {momAxis, momAxis, momResAxis}});

histos.add<TH3>("dcaPi", "; #it{p}_{GLO} (GeV/#it{c});#it{p}_{TPC} - #it{p}_{glo} (GeV/#it{c}); DCA_{xy} (cm)", {HistType::kTH3F, {momAxis, momResAxis, dcaAxis}});
histos.add<TH3>("dcaKa", "; #it{p}_{GLO} (GeV/#it{c});#it{p}_{TPC} - #it{p}_{glo} (GeV/#it{c}); DCA_{xy} (cm)", {HistType::kTH3F, {momAxis, momResAxis, dcaAxis}});
histos.add<TH3>("dcaPr", "; #it{p}_{GLO} (GeV/#it{c});#it{p}_{TPC} - #it{p}_{glo} (GeV/#it{c}); DCA_{xy} (cm)", {HistType::kTH3F, {momAxis, momResAxis, dcaAxis}});
histos.add<TH3>("dcaDe", "; #it{p}_{GLO} (GeV/#it{c});#it{p}_{TPC} - #it{p}_{glo} (GeV/#it{c}); DCA_{xy} (cm)", {HistType::kTH3F, {momAxis, momResAxis, dcaAxis}});
histos.add<TH3>("dcaHe", "; #it{p}_{GLO} (GeV/#it{c});#it{p}_{TPC} - #it{p}_{glo} (GeV/#it{c}); DCA_{xy} (cm)", {HistType::kTH3F, {momAxis, momResAxis, dcaAxis}});

histos.add<TH3>("itsClusSizePi", ";#it{p}_{TPC} (GeV/#it{c}); #it{p}_{GLO} (GeV/#it{c}); <ITS Cluster size> x cos(#lambda) (#pi)", {HistType::kTH3F, {momAxis, momAxis, itsClusSizeAxis}});
histos.add<TH3>("itsClusSizeKa", ";#it{p}_{TPC} (GeV/#it{c}); #it{p}_{GLO} (GeV/#it{c}); <ITS Cluster size> x cos(#lambda) (K)", {HistType::kTH3F, {momAxis, momAxis, itsClusSizeAxis}});
histos.add<TH3>("itsClusSizePr", ";#it{p}_{TPC} (GeV/#it{c}); #it{p}_{GLO} (GeV/#it{c}); <ITS Cluster size> x cos(#lambda) (p)", {HistType::kTH3F, {momAxis, momAxis, itsClusSizeAxis}});
histos.add<TH3>("itsClusSizeDe", ";#it{p}_{TPC} (GeV/#it{c}); #it{p}_{GLO} (GeV/#it{c}); <ITS Cluster size> x cos(#lambda) (d)", {HistType::kTH3F, {momAxis, momAxis, itsClusSizeAxis}});
histos.add<TH3>("itsClusSizeHe", ";#it{p}_{TPC} (GeV/#it{c}); #it{p}_{GLO} (GeV/#it{c}); <ITS Cluster size> x cos(#lambda) (He3)", {HistType::kTH3F, {momAxis, momAxis, itsClusSizeAxis}});
// use a THnSparse for all the information
auto thnPi = histos.add("thnPi", ";#it{p}_{TPC} (GeV/#it{c}); #it{p}_{GLO} (GeV/#it{c}); #it{p}_{TPC} - #it{p}_{glo} (GeV/#it{c}); DCA_{xy} (cm); <ITS Cluster size> x cos(#lambda); TPC signal (a.u.); n#sigma_{TPC} (pi); PID hypothesis; MC PDG code; MC Gen P (GeV/c)",
{HistType::kTHnSparseF, {momAxis, momAxis, momResAxis, dcaAxis, itsClusSizeAxis, tpcAxis, tpcNsigmaAxis, trackingPidAxis, trackingPidAxis, momAxis}});
auto thnKa = histos.add("thnKa", ";#it{p}_{TPC} (GeV/#it{c}); #it{p}_{GLO} (GeV/#it{c}); #it{p}_{TPC} - #it{p}_{glo} (GeV/#it{c}); DCA_{xy} (cm); <ITS Cluster size> x cos(#lambda); TPC signal (a.u.); n#sigma_{TPC} (Ka); PID hypothesis; MC PDG code; MC Gen P (GeV/c)",
{HistType::kTHnSparseF, {momAxis, momAxis, momResAxis, dcaAxis, itsClusSizeAxis, tpcAxis, tpcNsigmaAxis, trackingPidAxis, trackingPidAxis, momAxis}});
auto thnPr = histos.add("thnPr", ";#it{p}_{TPC} (GeV/#it{c}); #it{p}_{GLO} (GeV/#it{c}); #it{p}_{TPC} - #it{p}_{glo} (GeV/#it{c}); DCA_{xy} (cm); <ITS Cluster size> x cos(#lambda); TPC signal (a.u.); n#sigma_{TPC} (Pr); PID hypothesis; MC PDG code; MC Gen P (GeV/c)",
{HistType::kTHnSparseF, {momAxis, momAxis, momResAxis, dcaAxis, itsClusSizeAxis, tpcAxis, tpcNsigmaAxis, trackingPidAxis, trackingPidAxis, momAxis}});
auto thnDe = histos.add("thnDe", ";#it{p}_{TPC} (GeV/#it{c}); #it{p}_{GLO} (GeV/#it{c}); #it{p}_{TPC} - #it{p}_{glo} (GeV/#it{c}); DCA_{xy} (cm); <ITS Cluster size> x cos(#lambda); TPC signal (a.u.); n#sigma_{TPC} (De); PID hypothesis; MC PDG code; MC Gen P (GeV/c)",
{HistType::kTHnSparseF, {momAxis, momAxis, momResAxis, dcaAxis, itsClusSizeAxis, tpcAxis, tpcNsigmaAxis, trackingPidAxis, trackingPidAxis, momAxis}});
auto thnHe = histos.add("thnHe", ";#it{p}_{TPC} (GeV/#it{c}); #it{p}_{GLO} (GeV/#it{c}); #it{p}_{TPC} - #it{p}_{glo} (GeV/#it{c}); DCA_{xy} (cm); <ITS Cluster size> x cos(#lambda); TPC signal (a.u.); n#sigma_{TPC} (He); PID hypothesis; MC PDG code; MC Gen P (GeV/c)",
{HistType::kTHnSparseF, {momAxis, momAxis, momResAxis, dcaAxis, itsClusSizeAxis, tpcAxis, tpcNsigmaAxis, trackingPidAxis, trackingPidAxis, momAxis}});
}

void process(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, TracksFull const& tracks, aod::BCs const&)
void processData(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, TracksFull const& tracks, aod::BCs const&)
{

if (!collision.sel8())
Expand All @@ -155,75 +169,51 @@ struct lfmatchingqa {
for (const auto& track : tracks) {
if (!selectTrack(track)) {
continue;
}

auto sign = track.sign();
auto signTPCMom = sign * track.tpcInnerParam();
auto signGloMom = sign * track.p();

// compute custom tpcNsigmaDeu and tpcNsigmaHe3
double expBetheDeu{tpc::BetheBlochAleph(static_cast<double>(track.tpcInnerParam() / constants::physics::MassDeuteron), cfgBetheBlochParams->get("d", "p0"), cfgBetheBlochParams->get("d", "p1"), cfgBetheBlochParams->get("d", "p2"), cfgBetheBlochParams->get("d", "p3"), cfgBetheBlochParams->get("d", "p4"))};
double expSigmaDeu{expBetheDeu * cfgBetheBlochParams->get("d", "resolution")};
double expBetheHe3{tpc::BetheBlochAleph(static_cast<double>(track.tpcInnerParam() / constants::physics::MassHelium3), cfgBetheBlochParams->get("He3", "p0"), cfgBetheBlochParams->get("He3", "p1"), cfgBetheBlochParams->get("He3", "p2"), cfgBetheBlochParams->get("He3", "p3"), cfgBetheBlochParams->get("He3", "p4"))};
double expSigmaHe3{expBetheHe3 * cfgBetheBlochParams->get("He3", "resolution")};
auto tpcNSigmaDeu = static_cast<float>((track.tpcSignal() - expBetheDeu) / expSigmaDeu);
auto tpcNSigmaHe3 = static_cast<float>((track.tpcSignal() - expBetheHe3) / expSigmaHe3);

// filling the nsigma histograms
histos.fill(HIST("tpcSignal"), signTPCMom, track.tpcSignal());
histos.fill(HIST("tpcSignalPIDHypo"), signTPCMom, track.tpcSignal(), track.pidForTracking());
if (abs(track.tpcNSigmaPi()) < 4) {
histos.fill(HIST("tpcNsigmaPi"), signTPCMom, signGloMom, track.tpcNSigmaPi());
histos.fill(HIST("pidHypoPi"), signTPCMom, track.tpcNSigmaPi(), track.pidForTracking());
}
if (abs(track.tpcNSigmaKa()) < 4) {
histos.fill(HIST("tpcNsigmaKa"), signTPCMom, signGloMom, track.tpcNSigmaKa());
histos.fill(HIST("pidHypoKa"), signTPCMom, track.tpcNSigmaKa(), track.pidForTracking());
}
if (abs(track.tpcNSigmaPr()) < 4) {
histos.fill(HIST("tpcNsigmaPr"), signTPCMom, signGloMom, track.tpcNSigmaPr());
histos.fill(HIST("pidHypoPr"), signTPCMom, track.tpcNSigmaPr(), track.pidForTracking());
}
if (abs(tpcNSigmaDeu) < 4) {
histos.fill(HIST("tpcNsigmaDe"), signTPCMom, signGloMom, tpcNSigmaDeu);
histos.fill(HIST("pidHypoDe"), signTPCMom, tpcNSigmaDeu, track.pidForTracking());
}
if (abs(tpcNSigmaHe3) < 4) {
histos.fill(HIST("tpcNsigmaHe"), signTPCMom, signGloMom, tpcNSigmaHe3);
histos.fill(HIST("pidHypoHe"), signTPCMom, tpcNSigmaHe3, track.pidForTracking());
fillHistograms(track, -1, -999);
}
}
}
PROCESS_SWITCH(lfmatchingqa, processData, "Data analysis", true);

// Filling the mom corr and cl sizes histograms (nSigma < 2 required)
// calculating cos(L) of the track
float cosL = 1 / std::sqrt(1.f + track.tgl() * track.tgl());
void processMC(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, TracksFullMC const& tracks, aod::McParticles const& particlesMC, aod::BCs const&)
{

if (abs(track.tpcNSigmaPi()) < 2) {
histos.fill(HIST("momCorrPi"), signTPCMom, signGloMom, track.tpcInnerParam() - track.p());
histos.fill(HIST("dcaPi"), signGloMom, track.tpcInnerParam() - track.p(), track.dcaXY());
histos.fill(HIST("itsClusSizePi"), signTPCMom, signGloMom, getITSClSize(track) * cosL);
}
if (abs(track.tpcNSigmaKa()) < 2) {
histos.fill(HIST("momCorrKa"), signTPCMom, signGloMom, track.tpcInnerParam() - track.p());
histos.fill(HIST("dcaKa"), signGloMom, track.tpcInnerParam() - track.p(), track.dcaXY());
histos.fill(HIST("itsClusSizeKa"), signTPCMom, signGloMom, getITSClSize(track) * cosL);
}
if (abs(track.tpcNSigmaPr()) < 2) {
histos.fill(HIST("momCorrPr"), signTPCMom, signGloMom, track.tpcInnerParam() - track.p());
histos.fill(HIST("dcaPr"), signGloMom, track.tpcInnerParam() - track.p(), track.dcaXY());
histos.fill(HIST("itsClusSizePr"), signTPCMom, signGloMom, getITSClSize(track) * cosL);
if (!collision.sel8())
return;

if (std::abs(collision.posZ()) > zVtxMax)
return;

for (const auto& track : tracks) {
if (!selectTrack(track)) {
continue;
}
if (abs(tpcNSigmaDeu) < 2) {
histos.fill(HIST("momCorrDe"), signTPCMom, signGloMom, track.tpcInnerParam() - track.p());
histos.fill(HIST("dcaDe"), signGloMom, track.tpcInnerParam() - track.p(), track.dcaXY());
histos.fill(HIST("itsClusSizeDe"), signTPCMom, signGloMom, getITSClSize(track) * cosL);

int pidMC = -1;
float genPMC = -999;

if (!track.has_mcParticle()) {
fillHistograms(track, pidMC, genPMC);
continue;
}
if (abs(tpcNSigmaHe3) < 2) {
histos.fill(HIST("momCorrHe"), signTPCMom, signGloMom, track.tpcInnerParam() - track.p());
histos.fill(HIST("dcaHe"), signGloMom, track.tpcInnerParam() - track.p(), track.dcaXY());
histos.fill(HIST("itsClusSizeHe"), signTPCMom, signGloMom, getITSClSize(track) * cosL);

auto mcParticle = track.mcParticle();
auto pdg = mcParticle.pdgCode();
bool isPdgFound = false;
for (size_t iPid = 0; iPid < pdgCodes.size(); ++iPid) {
if (abs(pdg) == pdgCodes[iPid]) {
pidMC = iPid;
int sign = pdg > 0 ? 1 : -1;
genPMC = mcParticle.p() * sign;
isPdgFound = true;
break;
}
}
isPdgFound ? fillHistograms(track, pidMC, genPMC) : fillHistograms(track, -1, -999);
}
}
PROCESS_SWITCH(lfmatchingqa, processMC, "MC analysis", false);
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
Expand Down

0 comments on commit 0485675

Please sign in to comment.