Skip to content

Commit 65d512c

Browse files
author
Christopher Klumm
committed
Updated Debugv0 includes now MC switch
1 parent 21c8b98 commit 65d512c

File tree

1 file changed

+41
-20
lines changed

1 file changed

+41
-20
lines changed

PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ struct femtoDreamDebugV0 {
5050
ConfigurableAxis ConfV0TempFitVarMomentumBins{"ConfV0TempFitVarMomentumBins", {20, 0.5, 4.05}, "V0: pT binning of the pT vs. TempFitVar plot"};
5151
ConfigurableAxis ConfBinmult{"ConfBinmult", {1, 0, 1}, "multiplicity Binning"};
5252
ConfigurableAxis ConfDummy{"ConfDummy", {1, 0, 1}, "Dummy axis for inv mass"};
53+
Configurable<bool> isMC{"isMC", false, "flag to enable or disable MC"};
5354

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

@@ -69,36 +70,43 @@ struct femtoDreamDebugV0 {
6970
ConfigurableAxis ConfChildTempFitVarpTBins{"ConfChildTempFitVarpTBins", {20, 0.5, 4.05}, "V0 child: pT binning of the pT vs. TempFitVar plot"};
7071

7172
using FemtoFullParticles = soa::Join<aod::FDParticles, aod::FDExtParticles>;
72-
Partition<FemtoFullParticles> partsV0 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && (ncheckbit(aod::femtodreamparticle::cut, ConfV01_CutBit));
73+
74+
using FilteredMCCollisions = soa::Filtered<soa::Join<aod::FDCollisions, aod::FDMCCollLabels>>;
75+
using FilteredMCCollision = FilteredMCCollisions::iterator;
76+
77+
using FDMCParts = soa::Join<aod::FDParticles, aod::FDExtParticles, aod::FDExtMCParticles, aod::FDMCLabels, aod::FDExtMCLabels>; // aod::FdMCParticles,
78+
using FDMCPart = FDMCParts::iterator;
79+
80+
Partition<FemtoFullParticles> partsOne = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && (ncheckbit(aod::femtodreamparticle::cut, ConfV01_CutBit));
7381
Preslice<FemtoFullParticles> perCol = aod::femtodreamparticle::fdCollisionId;
7482

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

7785
/// Histogramming
7886
FemtoDreamEventHisto eventHisto;
7987
FemtoDreamParticleHisto<aod::femtodreamparticle::ParticleType::kV0Child, 3> posChildHistos;
8088
FemtoDreamParticleHisto<aod::femtodreamparticle::ParticleType::kV0Child, 4> negChildHistos;
81-
FemtoDreamParticleHisto<aod::femtodreamparticle::ParticleType::kV0> motherHistos;
89+
FemtoDreamParticleHisto<aod::femtodreamparticle::ParticleType::kV0> V0Histos;
8290

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

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

96104
/// Porduce QA plots for V0 selection in FemtoDream framework
97-
template <typename CollisionType, typename PartType, typename PartitionType>
98-
void processDebug(CollisionType const& col, PartType const& parts, PartitionType const& Partition)
105+
template <bool isMC, typename Collision, typename TableTracks, typename PartitionType>
106+
void process(Collision const& col, TableTracks const& parts, PartitionType& Partition)
99107
{
100-
auto groupPartsOne = Partition.sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache);
101-
eventHisto.fillQA<false>(col);
108+
auto groupPartsOne = Partition->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache);
109+
102110
for (auto& part : groupPartsOne) {
103111
if (!part.has_children()) {
104112
continue;
@@ -134,26 +142,39 @@ struct femtoDreamDebugV0 {
134142

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

137-
motherHistos.fillQA<false, true>(part, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
138-
posChildHistos.fillQA<false, true>(posChild, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
139-
negChildHistos.fillQA<false, true>(negChild, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
145+
if constexpr (isMC) {
146+
147+
V0Histos.fillQA<true, true>(part, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
148+
posChildHistos.fillQA<true, true>(posChild, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
149+
negChildHistos.fillQA<true, true>(negChild, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
150+
151+
} else {
152+
153+
V0Histos.fillQA<false, true>(part, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
154+
posChildHistos.fillQA<false, true>(posChild, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
155+
negChildHistos.fillQA<false, true>(negChild, static_cast<aod::femtodreamparticle::MomentumType>(ConfV0TempFitVarMomentum.value), col.multNtr(), col.multV0M());
156+
}
140157
}
141158
}
142159
}
143160

144-
void processV0(o2::aod::FDCollision const& col, FemtoFullParticles const& parts)
161+
void processDebug(o2::aod::FDCollision const& col, FemtoFullParticles const& parts)
145162
{
146-
processDebug(col, parts, partsV0);
163+
164+
eventHisto.fillQA<false>(col);
165+
process<false>(col, parts, partsOne);
147166
}
148167

149-
PROCESS_SWITCH(femtoDreamDebugV0, processV0, "Enable processing Lambda", true);
168+
PROCESS_SWITCH(femtoDreamDebugV0, processDebug, "Enable processing Debug v0", true);
150169

151-
void processK0Short(o2::aod::FDCollision const& col, FemtoFullParticles const& parts)
170+
void processDebugMC(FilteredMCCollision const& col, o2::aod::FDMCCollisions const&, FDMCParts const& parts, o2::aod::FDMCParticles const&)
152171
{
153-
processDebug(col, parts, partsK0Short);
172+
173+
eventHisto.fillQA<true>(col);
174+
process<true>(col, parts, partsOneMC);
154175
}
155176

156-
PROCESS_SWITCH(femtoDreamDebugV0, processK0Short, "Enable processing K0Short", false);
177+
PROCESS_SWITCH(femtoDreamDebugV0, processDebugMC, "Enable processing Debug v0 - MC", false);
157178
};
158179

159180
WorkflowSpec

0 commit comments

Comments
 (0)