From 4ed329ebfa4ebf6e1ca5ec50e5470103d1505803 Mon Sep 17 00:00:00 2001 From: lucamicheletti93 <38209984+lucamicheletti93@users.noreply.github.com> Date: Wed, 4 Sep 2024 21:32:44 +0200 Subject: [PATCH] [PWGDQ] Adding first version of mini tree (#7562) * Adding first version of mini tree * Fixing clang --------- Co-authored-by: Lucamicheletti93 --- PWGDQ/DataModel/ReducedInfoTables.h | 4 ++++ PWGDQ/Tasks/tableReader.cxx | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/PWGDQ/DataModel/ReducedInfoTables.h b/PWGDQ/DataModel/ReducedInfoTables.h index 47209e426a1..ba3add306c7 100644 --- a/PWGDQ/DataModel/ReducedInfoTables.h +++ b/PWGDQ/DataModel/ReducedInfoTables.h @@ -809,6 +809,9 @@ DECLARE_SOA_TABLE(DimuonsAll, "AOD", "RTDIMUONALL", //! reducedpair::VertexPz, reducedpair::SVertex); +DECLARE_SOA_TABLE(DileptonsMiniTree, "AOD", "RTDILEPTMTREE", //! + reducedpair::Mass, reducedpair::Pt, reducedpair::Eta, reducedpair::CentFT0C, reducedpair::Cos2DeltaPhi); + using Dielectron = Dielectrons::iterator; using StoredDielectron = StoredDielectrons::iterator; using Dimuon = Dimuons::iterator; @@ -819,6 +822,7 @@ using DileptonFlow = DileptonsFlow::iterator; using DileptonInfo = DileptonsInfo::iterator; using DielectronAll = DielectronsAll::iterator; using DimuonAll = DimuonsAll::iterator; +using DileptonMiniTree = DileptonsMiniTree::iterator; // Tables for using analysis-dilepton-track with analysis-asymmetric-pairing DECLARE_SOA_TABLE(Ditracks, "AOD", "RTDITRACK", //! diff --git a/PWGDQ/Tasks/tableReader.cxx b/PWGDQ/Tasks/tableReader.cxx index 572eb46f38f..34435873ff6 100644 --- a/PWGDQ/Tasks/tableReader.cxx +++ b/PWGDQ/Tasks/tableReader.cxx @@ -918,6 +918,7 @@ struct AnalysisSameEventPairing { Produces dimuonAllList; Produces dileptonFlowList; Produces dileptonInfoList; + Produces dileptonMiniTree; float mMagField = 0.0; o2::parameters::GRPMagField* grpmag = nullptr; o2::base::MatLayerCylSet* lut = nullptr; @@ -948,6 +949,13 @@ struct AnalysisSameEventPairing { Configurable fCollisionSystem{"syst", "pp", "Collision system, pp or PbPb"}; Configurable fCenterMassEnergy{"energy", 13600, "Center of mass energy in GeV"}; + // Configurables to create output tree (flat tables or minitree) + struct : ConfigurableGroup { + Configurable fConfigMiniTree{"useMiniTree.cfgMiniTree", false, "Produce a single flat table with minimal information for analysis"}; + Configurable fConfigMiniTreeMinMass{"useMiniTree.cfgMiniTreeMinMass", 2, "Min. mass cut for minitree"}; + Configurable fConfigMiniTreeMaxMass{"useMiniTree.cfgMiniTreeMaxMass", 5, "Max. mass cut for minitree"}; + } useMiniTree; + Service ccdb; Filter filterEventSelected = aod::dqanalysisflags::isEventSelected == 1; // NOTE: the barrel filter map contains decisions for both electrons and hadrons used in the correlation task @@ -1180,6 +1188,9 @@ struct AnalysisSameEventPairing { dielectronAllList.reserve(1); dimuonAllList.reserve(1); } + if (useMiniTree.fConfigMiniTree) { + dileptonMiniTree.reserve(1); + } if (fConfigMultDimuons.value) { @@ -1318,6 +1329,16 @@ struct AnalysisSameEventPairing { if (fConfigAmbiguousHist && !(t1.isAmbiguous() || t2.isAmbiguous())) { fHistMan->FillHistClass(Form("%s_unambiguous", histNames[iCut][0].Data()), VarManager::fgValues); } + if (useMiniTree.fConfigMiniTree) { + float dileptonMass = VarManager::fgValues[VarManager::kMass]; + if (dileptonMass > useMiniTree.fConfigMiniTreeMinMass && dileptonMass < useMiniTree.fConfigMiniTreeMaxMass) { + dileptonMiniTree(VarManager::fgValues[VarManager::kMass], + VarManager::fgValues[VarManager::kPt], + VarManager::fgValues[VarManager::kRap], + VarManager::fgValues[VarManager::kCentFT0C], + VarManager::fgValues[VarManager::kCos2DeltaPhi]); + } + } } else { if (t1.sign() > 0) { fHistMan->FillHistClass(histNames[iCut][1].Data(), VarManager::fgValues);