From dc4c7d49ed331387c4b31f294b9ff3e8b026e913 Mon Sep 17 00:00:00 2001 From: Marvin Hemmer Date: Wed, 16 Jul 2025 11:43:00 +0200 Subject: [PATCH] [PWGEM,PWGEM-36] skimmerGammaCalo: Add `needEMCTrigger` configurable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add `needEMCTrigger` configurable option. If one uses this one for the EM Event Selection, one also needs to enable this here to ensure the table sizes of `EMCEMEventId` and `SkimEMCClusters` have the same size. - Header cleanup with clang´-tidy --- .../TableProducer/skimmerGammaCalo.cxx | 55 ++++++++++++------- 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx index da85ef3c8b4..f5dbdad1c28 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx @@ -9,35 +9,44 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file skimmerGammaCalo.cxx /// \brief skim cluster information to write photon cluster table in AO2D.root /// dependencies: emcal-correction-task /// \author marvin.hemmer@cern.ch -#include -#include +#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include "PWGEM/PhotonMeson/Utils/emcalHistoDefinitions.h" +#include "PWGJE/DataModel/EMCALClusters.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/EventSelection.h" -#include "Common/Core/TableHelper.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include -// includes for the R recalculation -#include "DetectorsBase/GeometryManager.h" -#include "DataFormatsParameters/GRPObject.h" -#include "CCDB/BasicCCDBManager.h" +#include -#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/emcalHistoDefinitions.h" +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -struct skimmerGammaCalo { +struct SkimmerGammaCalo { - Preslice CellperCluster = o2::aod::emcalclustercell::emcalclusterId; - Preslice MTperCluster = o2::aod::emcalclustercell::emcalclusterId; + Preslice psCellperCluster = o2::aod::emcalclustercell::emcalclusterId; + Preslice psMTperCluster = o2::aod::emcalclustercell::emcalclusterId; Produces tableGammaEMCReco; Produces tableEMCClusterMCLabels; @@ -53,6 +62,7 @@ struct skimmerGammaCalo { Configurable> clusterDefinitions{"clusterDefinitions", {0, 1, 2, 10, 11, 12, 13, 20, 21, 22, 30, 40, 41, 42, 43, 44, 45}, "Cluster definitions to be accepted (e.g. 13 for kV3MostSplitLowSeed)"}; Configurable maxdEta{"maxdEta", 0.1, "Set a maximum difference in eta for tracks and cluster to still count as matched"}; Configurable maxdPhi{"maxdPhi", 0.1, "Set a maximum difference in phi for tracks and cluster to still count as matched"}; + Configurable needEMCTrigger{"needEMCTrigger", false, "flag to only save events which have kTVXinEMC trigger bit. To reduce PbPb derived data size"}; HistogramRegistry historeg{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; @@ -86,6 +96,9 @@ struct skimmerGammaCalo { if (!collision.isSelected()) { return; } + if (needEMCTrigger.value && !collision.alias_bit(kTVXinEMC)) { + return; + } for (const auto& emccluster : emcclusters) { historeg.fill(HIST("hCaloClusterFilter"), 0); @@ -124,7 +137,7 @@ struct skimmerGammaCalo { historeg.fill(HIST("TimeOut"), emccluster.time()); // Skimmed cell table - auto groupedCells = emcclustercells.sliceBy(CellperCluster, emccluster.globalIndex()); + auto groupedCells = emcclustercells.sliceBy(psCellperCluster, emccluster.globalIndex()); for (const auto& emcclustercell : groupedCells) { tableCellEMCReco(emcclustercell.emcalclusterId(), emcclustercell.caloId()); } @@ -135,7 +148,7 @@ struct skimmerGammaCalo { std::vector vPhi; std::vector vP; std::vector vPt; - auto groupedMTs = emcmatchedtracks.sliceBy(MTperCluster, emccluster.globalIndex()); + auto groupedMTs = emcmatchedtracks.sliceBy(psMTperCluster, emccluster.globalIndex()); vTrackIds.reserve(groupedMTs.size()); vEta.reserve(groupedMTs.size()); vPhi.reserve(groupedMTs.size()); @@ -195,18 +208,18 @@ struct skimmerGammaCalo { mcLabels.clear(); } } - PROCESS_SWITCH(skimmerGammaCalo, processRec, "process only reconstructed info", true); - PROCESS_SWITCH(skimmerGammaCalo, processMC, "process MC info", false); // Run this in addition to processRec for MCs to copy the cluster mc labels from the EMCALMCClusters to the skimmed EMCClusterMCLabels table + PROCESS_SWITCH(SkimmerGammaCalo, processRec, "process only reconstructed info", true); + PROCESS_SWITCH(SkimmerGammaCalo, processMC, "process MC info", false); // Run this in addition to processRec for MCs to copy the cluster mc labels from the EMCALMCClusters to the skimmed EMCClusterMCLabels table void processDummy(aod::Collision const&) { // do nothing } - PROCESS_SWITCH(skimmerGammaCalo, processDummy, "Dummy function", false); + PROCESS_SWITCH(SkimmerGammaCalo, processDummy, "Dummy function", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - WorkflowSpec workflow{adaptAnalysisTask(cfgc, TaskName{"skimmer-gamma-calo"})}; + WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; return workflow; }