Skip to content

Commit

Permalink
[PWGDQ] Adding first version of mini tree (AliceO2Group#7562)
Browse files Browse the repository at this point in the history
* Adding first version of mini tree

* Fixing clang

---------

Co-authored-by: Lucamicheletti93 <[email protected]>
  • Loading branch information
lucamicheletti93 and lucamicheletti authored Sep 4, 2024
1 parent f1e7509 commit 4ed329e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions PWGDQ/DataModel/ReducedInfoTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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", //!
Expand Down
21 changes: 21 additions & 0 deletions PWGDQ/Tasks/tableReader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,7 @@ struct AnalysisSameEventPairing {
Produces<aod::DimuonsAll> dimuonAllList;
Produces<aod::DileptonFlow> dileptonFlowList;
Produces<aod::DileptonsInfo> dileptonInfoList;
Produces<aod::DileptonsMiniTree> dileptonMiniTree;
float mMagField = 0.0;
o2::parameters::GRPMagField* grpmag = nullptr;
o2::base::MatLayerCylSet* lut = nullptr;
Expand Down Expand Up @@ -948,6 +949,13 @@ struct AnalysisSameEventPairing {
Configurable<std::string> fCollisionSystem{"syst", "pp", "Collision system, pp or PbPb"};
Configurable<float> fCenterMassEnergy{"energy", 13600, "Center of mass energy in GeV"};

// Configurables to create output tree (flat tables or minitree)
struct : ConfigurableGroup {
Configurable<bool> fConfigMiniTree{"useMiniTree.cfgMiniTree", false, "Produce a single flat table with minimal information for analysis"};
Configurable<float> fConfigMiniTreeMinMass{"useMiniTree.cfgMiniTreeMinMass", 2, "Min. mass cut for minitree"};
Configurable<float> fConfigMiniTreeMaxMass{"useMiniTree.cfgMiniTreeMaxMass", 5, "Max. mass cut for minitree"};
} useMiniTree;

Service<o2::ccdb::BasicCCDBManager> ccdb;
Filter filterEventSelected = aod::dqanalysisflags::isEventSelected == 1;
// NOTE: the barrel filter map contains decisions for both electrons and hadrons used in the correlation task
Expand Down Expand Up @@ -1180,6 +1188,9 @@ struct AnalysisSameEventPairing {
dielectronAllList.reserve(1);
dimuonAllList.reserve(1);
}
if (useMiniTree.fConfigMiniTree) {
dileptonMiniTree.reserve(1);
}

if (fConfigMultDimuons.value) {

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 4ed329e

Please sign in to comment.