From 614b131d03e3777b4ba542c5c7e9e5e0e0718e3c Mon Sep 17 00:00:00 2001 From: mcoquet642 <74600025+mcoquet642@users.noreply.github.com> Date: Thu, 19 Dec 2024 23:13:28 +0100 Subject: [PATCH] [PWGDQ] Adding event selection flags to dimuonAll table (#9052) --- PWGDQ/Core/VarManager.h | 48 +++++++++++++------------- PWGDQ/DataModel/ReducedInfoTables.h | 2 ++ PWGDQ/Tasks/dqEfficiency.cxx | 1 + PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 2 ++ PWGDQ/Tasks/tableReader.cxx | 1 + PWGDQ/Tasks/tableReader_withAssoc.cxx | 2 ++ 6 files changed, 32 insertions(+), 24 deletions(-) diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 4b0e1a7b52c..02a7ffa4929 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -1510,30 +1510,6 @@ void VarManager::FillEvent(T const& event, float* values) values[kVtxY] = event.posY(); values[kVtxZ] = event.posZ(); values[kVtxNcontrib] = event.numContrib(); - if (fgUsedVars[kIsNoITSROFBorder]) { - values[kIsNoITSROFBorder] = (event.selection_bit(o2::aod::evsel::kNoITSROFrameBorder) > 0); - } - if (fgUsedVars[kIsNoTFBorder]) { - values[kIsNoTFBorder] = (event.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) > 0); - } - if (fgUsedVars[kNoCollInTimeRangeStandard]) { - values[kNoCollInTimeRangeStandard] = (event.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard) > 0); - } - if (fgUsedVars[kIsNoSameBunch]) { - values[kIsNoSameBunch] = (event.selection_bit(o2::aod::evsel::kNoSameBunchPileup) > 0); - } - if (fgUsedVars[kIsGoodZvtxFT0vsPV]) { - values[kIsGoodZvtxFT0vsPV] = (event.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV) > 0); - } - if (fgUsedVars[kIsVertexITSTPC]) { - values[kIsVertexITSTPC] = (event.selection_bit(o2::aod::evsel::kIsVertexITSTPC) > 0); - } - if (fgUsedVars[kIsVertexTOFmatched]) { - values[kIsVertexTOFmatched] = (event.selection_bit(o2::aod::evsel::kIsVertexTOFmatched) > 0); - } - if (fgUsedVars[kIsSel8]) { - values[kIsSel8] = event.selection_bit(o2::aod::evsel::kIsTriggerTVX) && event.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) && event.selection_bit(o2::aod::evsel::kNoITSROFrameBorder); - } if (fgUsedVars[kIsDoubleGap]) { values[kIsDoubleGap] = (event.tag_bit(56 + kDoubleGap) > 0); } @@ -1560,6 +1536,30 @@ void VarManager::FillEvent(T const& event, float* values) uint16_t bcInITSROF = (event.globalBC() + 3564 - fgITSROFbias) % fgITSROFlength; values[kIsNoITSROFBorderRecomputed] = bcInITSROF > fgITSROFBorderMarginLow && bcInITSROF < fgITSROFlength - fgITSROFBorderMarginHigh ? 1.0 : 0.0; } + if (fgUsedVars[kIsNoITSROFBorder]) { + values[kIsNoITSROFBorder] = (event.selection_bit(o2::aod::evsel::kNoITSROFrameBorder) > 0); + } + if (fgUsedVars[kIsNoTFBorder]) { + values[kIsNoTFBorder] = (event.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) > 0); + } + if (fgUsedVars[kNoCollInTimeRangeStandard]) { + values[kNoCollInTimeRangeStandard] = (event.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard) > 0); + } + if (fgUsedVars[kIsNoSameBunch]) { + values[kIsNoSameBunch] = (event.selection_bit(o2::aod::evsel::kNoSameBunchPileup) > 0); + } + if (fgUsedVars[kIsGoodZvtxFT0vsPV]) { + values[kIsGoodZvtxFT0vsPV] = (event.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV) > 0); + } + if (fgUsedVars[kIsVertexITSTPC]) { + values[kIsVertexITSTPC] = (event.selection_bit(o2::aod::evsel::kIsVertexITSTPC) > 0); + } + if (fgUsedVars[kIsVertexTOFmatched]) { + values[kIsVertexTOFmatched] = (event.selection_bit(o2::aod::evsel::kIsVertexTOFmatched) > 0); + } + if (fgUsedVars[kIsSel8]) { + values[kIsSel8] = event.selection_bit(o2::aod::evsel::kIsTriggerTVX) && event.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) && event.selection_bit(o2::aod::evsel::kNoITSROFrameBorder); + } if (fgUsedVars[kIsINT7]) { values[kIsINT7] = (event.alias_bit(kINT7) > 0); } diff --git a/PWGDQ/DataModel/ReducedInfoTables.h b/PWGDQ/DataModel/ReducedInfoTables.h index f8f7b4e3161..86e38033136 100644 --- a/PWGDQ/DataModel/ReducedInfoTables.h +++ b/PWGDQ/DataModel/ReducedInfoTables.h @@ -641,6 +641,7 @@ DECLARE_SOA_INDEX_COLUMN_FULL(Index0, index0, int, ReducedTracks, "_0"); //! Ind DECLARE_SOA_INDEX_COLUMN_FULL(Index1, index1, int, ReducedTracks, "_1"); //! Index to second prong DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, Tracks, "_0"); //! Index of first prong in Tracks table DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, Tracks, "_1"); //! Index of second prong in Tracks table +DECLARE_SOA_BITMAP_COLUMN(EventSelection, evSelection, 8); //! Event selection bits (ambiguity, splitting candidate) DECLARE_SOA_COLUMN(Mass, mass, float); //! DECLARE_SOA_COLUMN(Pt, pt, float); //! DECLARE_SOA_COLUMN(Eta, eta, float); //! @@ -783,6 +784,7 @@ DECLARE_SOA_TABLE(DielectronsAll, "AOD", "RTDIELECTRONALL", //! DECLARE_SOA_TABLE(DimuonsAll, "AOD", "RTDIMUONALL", //! collision::PosX, collision::PosY, collision::PosZ, collision::NumContrib, + evsel::Selection, reducedpair::EventSelection, reducedevent::MCPosX, reducedevent::MCPosY, reducedevent::MCPosZ, reducedpair::Mass, reducedpair::McDecision, diff --git a/PWGDQ/Tasks/dqEfficiency.cxx b/PWGDQ/Tasks/dqEfficiency.cxx index f8f2a992d61..8532525b834 100644 --- a/PWGDQ/Tasks/dqEfficiency.cxx +++ b/PWGDQ/Tasks/dqEfficiency.cxx @@ -840,6 +840,7 @@ struct AnalysisSameEventPairing { if constexpr ((TPairType == VarManager::kDecayToMuMu) && muonHasCov) { if (fConfigFlatTables.value) { dimuonAllList(event.posX(), event.posY(), event.posZ(), event.numContrib(), + event.selection_raw(), 0, event.reducedMCevent().mcPosX(), event.reducedMCevent().mcPosY(), event.reducedMCevent().mcPosZ(), VarManager::fgValues[VarManager::kMass], dileptonMcDecision, diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index 7cdb426d55e..6829f0f4d83 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -1504,6 +1504,7 @@ struct AnalysisSameEventPairing { if (!event.isEventSelected_bit(0)) { continue; } + uint8_t evSel = event.isEventSelected_raw(); // Reset the fValues array VarManager::ResetValues(0, VarManager::kNVars); VarManager::FillEvent(event, VarManager::fgValues); @@ -1646,6 +1647,7 @@ struct AnalysisSameEventPairing { dimuonsExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauz], VarManager::fgValues[VarManager::kVertexingLz], VarManager::fgValues[VarManager::kVertexingLxy]); if (fConfigOptions.flatTables.value) { dimuonAllList(event.posX(), event.posY(), event.posZ(), event.numContrib(), + event.selection_raw(), evSel, -999., -999., -999., VarManager::fgValues[VarManager::kMass], mcDecision, diff --git a/PWGDQ/Tasks/tableReader.cxx b/PWGDQ/Tasks/tableReader.cxx index 8ed3cd6eeef..22fd38cb4ea 100644 --- a/PWGDQ/Tasks/tableReader.cxx +++ b/PWGDQ/Tasks/tableReader.cxx @@ -1308,6 +1308,7 @@ struct AnalysisSameEventPairing { dimuonExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauz], VarManager::fgValues[VarManager::kVertexingLz], VarManager::fgValues[VarManager::kVertexingLxy]); if (fConfigFlatTables.value) { dimuonAllList(event.posX(), event.posY(), event.posZ(), event.numContrib(), + event.selection_raw(), 0, -999., -999., -999., VarManager::fgValues[VarManager::kMass], false, diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index 7d4c90fcefc..4f9980dd8e6 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -1423,6 +1423,7 @@ struct AnalysisSameEventPairing { if (!event.isEventSelected_bit(0)) { continue; } + uint8_t evSel = event.isEventSelected_raw(); // Reset the fValues array VarManager::ResetValues(0, VarManager::kNVars); VarManager::FillEvent(event, VarManager::fgValues); @@ -1548,6 +1549,7 @@ struct AnalysisSameEventPairing { dimuonsExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauz], VarManager::fgValues[VarManager::kVertexingLz], VarManager::fgValues[VarManager::kVertexingLxy]); if (fConfigOptions.flatTables.value) { dimuonAllList(event.posX(), event.posY(), event.posZ(), event.numContrib(), + event.selection_raw(), evSel, -999., -999., -999., VarManager::fgValues[VarManager::kMass], false,