Skip to content
Closed
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
61 changes: 41 additions & 20 deletions PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2025 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)

Check failure on line 1 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-process]

Use constant references for table subscriptions in process functions.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -30,7 +30,7 @@
#include "fairlogger/Logger.h"

#include <cstdint>
#include <iostream>

Check failure on line 33 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <vector>

using namespace o2;
Expand All @@ -42,14 +42,15 @@
struct femtoDreamDebugV0 {
SliceCache cache;

Configurable<int> ConfV01_PDGCode{"ConfV01_PDGCode", 3122, "V0 - PDG code"};

Check failure on line 45 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<int> ConfV01_ChildPos_PDGCode{"ConfV01_PosChild_PDGCode", 2212, "Positive Child - PDG code"};

Check failure on line 46 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<int> ConfV01_ChildNeg_PDGCode{"ConfV01_NegChild_PDGCode", 211, "Negative Child- PDG code"};

Check failure on line 47 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<aod::femtodreamparticle::cutContainerType> ConfV01_CutBit{"ConfV01_CutBit", 338, "V0 - Selection bit from cutCulator"};

Check failure on line 48 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
ConfigurableAxis ConfV0TempFitVarBins{"ConfV0TempFitVarBins", {300, 0.95, 1.}, "V0: binning of the TempFitVar in the pT vs. TempFitVar plot"};

Check failure on line 49 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
ConfigurableAxis ConfV0TempFitVarMomentumBins{"ConfV0TempFitVarMomentumBins", {20, 0.5, 4.05}, "V0: pT binning of the pT vs. TempFitVar plot"};
ConfigurableAxis ConfBinmult{"ConfBinmult", {1, 0, 1}, "multiplicity Binning"};
ConfigurableAxis ConfDummy{"ConfDummy", {1, 0, 1}, "Dummy axis for inv mass"};
Configurable<bool> isMC{"isMC", false, "flag to enable or disable MC"};

Configurable<int> ConfV0TempFitVarMomentum{"ConfV0TempFitVarMomentum", 0, "Momentum used for binning: 0 -> pt; 1 -> preco; 2 -> ptpc"};

Expand All @@ -69,37 +70,44 @@
ConfigurableAxis ConfChildTempFitVarpTBins{"ConfChildTempFitVarpTBins", {20, 0.5, 4.05}, "V0 child: pT binning of the pT vs. TempFitVar plot"};

using FemtoFullParticles = soa::Join<aod::FDParticles, aod::FDExtParticles>;
Partition<FemtoFullParticles> partsV0 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && (ncheckbit(aod::femtodreamparticle::cut, ConfV01_CutBit));

using FilteredMCCollisions = soa::Filtered<soa::Join<aod::FDCollisions, aod::FDMCCollLabels>>;
using FilteredMCCollision = FilteredMCCollisions::iterator;

using FDMCParts = soa::Join<aod::FDParticles, aod::FDExtParticles, aod::FDExtMCParticles, aod::FDMCLabels, aod::FDExtMCLabels>; // aod::FdMCParticles,
using FDMCPart = FDMCParts::iterator;

Partition<FemtoFullParticles> partsOne = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && (ncheckbit(aod::femtodreamparticle::cut, ConfV01_CutBit));
Preslice<FemtoFullParticles> perCol = aod::femtodreamparticle::fdCollisionId;

Partition<FemtoFullParticles> partsK0Short = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0K0Short)) && (ncheckbit(aod::femtodreamparticle::cut, ConfV01_CutBit));
Partition<FDMCParts> partsOneMC = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && (ncheckbit(aod::femtodreamparticle::cut, ConfV01_CutBit));

/// Histogramming
FemtoDreamEventHisto eventHisto;
FemtoDreamParticleHisto<aod::femtodreamparticle::ParticleType::kV0Child, 3> posChildHistos;
FemtoDreamParticleHisto<aod::femtodreamparticle::ParticleType::kV0Child, 4> negChildHistos;
FemtoDreamParticleHisto<aod::femtodreamparticle::ParticleType::kV0> motherHistos;
FemtoDreamParticleHisto<aod::femtodreamparticle::ParticleType::kV0> V0Histos;

/// Histogram output
HistogramRegistry EventRegistry{"Event", {}, OutputObjHandlingPolicy::AnalysisObject};
HistogramRegistry V0Registry{"FullV0QA", {}, OutputObjHandlingPolicy::AnalysisObject};

void init(InitContext&)
{
eventHisto.init(&EventRegistry, false);
posChildHistos.init(&V0Registry, ConfBinmult, ConfDummy, ConfV0ChildTempFitVarMomentumBins, ConfDummy, ConfDummy, ConfChildTempFitVarBins, ConfV0ChildNsigmaTPCBins, ConfV0ChildNsigmaTOFBins, ConfV0ChildNsigmaTPCTOFBins, ConfV0ChildNsigmaITSBins, ConfV0InvMassBins, ConfDummy, false, ConfV01_ChildPos_PDGCode.value, true);
negChildHistos.init(&V0Registry, ConfBinmult, ConfDummy, ConfV0ChildTempFitVarMomentumBins, ConfDummy, ConfDummy, ConfChildTempFitVarBins, ConfV0ChildNsigmaTPCBins, ConfV0ChildNsigmaTOFBins, ConfV0ChildNsigmaTPCTOFBins, ConfV0ChildNsigmaITSBins, ConfV0InvMassBins, ConfDummy, false, ConfV01_ChildNeg_PDGCode, true);
motherHistos.init(&V0Registry, ConfBinmult, ConfDummy, ConfV0TempFitVarMomentumBins, ConfDummy, ConfDummy, ConfV0TempFitVarBins, ConfV0ChildNsigmaTPCBins, ConfV0ChildNsigmaTOFBins, ConfV0ChildNsigmaTPCTOFBins, ConfV0ChildNsigmaITSBins, ConfV0InvMassBins, ConfDummy, false, ConfV01_PDGCode.value, true);
eventHisto.init(&EventRegistry, isMC);
posChildHistos.init(&V0Registry, ConfBinmult, ConfDummy, ConfV0ChildTempFitVarMomentumBins, ConfDummy, ConfDummy, ConfChildTempFitVarBins, ConfV0ChildNsigmaTPCBins, ConfV0ChildNsigmaTOFBins, ConfV0ChildNsigmaTPCTOFBins, ConfV0ChildNsigmaITSBins, ConfV0InvMassBins, ConfDummy, isMC, ConfV01_ChildPos_PDGCode.value, true);
negChildHistos.init(&V0Registry, ConfBinmult, ConfDummy, ConfV0ChildTempFitVarMomentumBins, ConfDummy, ConfDummy, ConfChildTempFitVarBins, ConfV0ChildNsigmaTPCBins, ConfV0ChildNsigmaTOFBins, ConfV0ChildNsigmaTPCTOFBins, ConfV0ChildNsigmaITSBins, ConfV0InvMassBins, ConfDummy, isMC, ConfV01_ChildNeg_PDGCode, true);
V0Histos.init(&V0Registry, ConfBinmult, ConfDummy, ConfV0TempFitVarMomentumBins, ConfDummy, ConfDummy, ConfV0TempFitVarBins, ConfV0ChildNsigmaTPCBins, ConfV0ChildNsigmaTOFBins, ConfV0ChildNsigmaTPCTOFBins, ConfV0ChildNsigmaITSBins, ConfV0InvMassBins, ConfDummy, isMC, ConfV01_PDGCode.value, true);
V0Registry.add("hArmenterosPodolanski/hArmenterosPodolanskiPlot", "; #alpha; p_{T} (MeV/#it{c})", kTH2F, {{100, -1, 1}, {500, -0.3, 2}});
}

/// Porduce QA plots for V0 selection in FemtoDream framework
template <typename CollisionType, typename PartType, typename PartitionType>
void processDebug(CollisionType const& col, PartType const& parts, PartitionType const& Partition)
template <bool isMC, typename Collision, typename TableTracks, typename PartitionType>
void process(Collision const& col, TableTracks const& parts, PartitionType& Partition)

Check failure on line 106 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-process]

Argument PartitionType& Partition is not const&.
{
auto groupPartsOne = Partition.sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache);
eventHisto.fillQA<false>(col);
auto groupPartsOne = Partition->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache);

for (auto& part : groupPartsOne) {

Check failure on line 110 in PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!part.has_children()) {
continue;
}
Expand Down Expand Up @@ -134,26 +142,39 @@

V0Registry.fill(HIST("hArmenterosPodolanski/hArmenterosPodolanskiPlot"), alpha, qtarm);

motherHistos.fillQA<false, true>(part, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
posChildHistos.fillQA<false, true>(posChild, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
negChildHistos.fillQA<false, true>(negChild, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
if constexpr (isMC) {

V0Histos.fillQA<true, true>(part, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
posChildHistos.fillQA<true, true>(posChild, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
negChildHistos.fillQA<true, true>(negChild, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());

} else {

V0Histos.fillQA<false, true>(part, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
posChildHistos.fillQA<false, true>(posChild, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
negChildHistos.fillQA<false, true>(negChild, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
}
}
}
}

void processV0(o2::aod::FDCollision const& col, FemtoFullParticles const& parts)
void processDebug(o2::aod::FDCollision const& col, FemtoFullParticles const& parts)
{
processDebug(col, parts, partsV0);

eventHisto.fillQA<false>(col);
process<false>(col, parts, partsOne);
}

PROCESS_SWITCH(femtoDreamDebugV0, processV0, "Enable processing Lambda", true);
PROCESS_SWITCH(femtoDreamDebugV0, processDebug, "Enable processing Debug v0", true);

void processK0Short(o2::aod::FDCollision const& col, FemtoFullParticles const& parts)
void processDebugMC(FilteredMCCollision const& col, o2::aod::FDMCCollisions const&, FDMCParts const& parts, o2::aod::FDMCParticles const&)
{
processDebug(col, parts, partsK0Short);

eventHisto.fillQA<true>(col);
process<true>(col, parts, partsOneMC);
}

PROCESS_SWITCH(femtoDreamDebugV0, processK0Short, "Enable processing K0Short", false);
PROCESS_SWITCH(femtoDreamDebugV0, processDebugMC, "Enable processing Debug v0 - MC", false);
};

WorkflowSpec
Expand Down
Loading