From d17d2ec08f890226e05a80b20f3dc23dd218bef0 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Wed, 11 Oct 2023 23:02:34 +0200 Subject: [PATCH] Pb-Pb 2023 studies: adjusting (#3598) * Pb-Pb 2023 studies: adjusting * Please consider the following formatting changes (#177) --------- Co-authored-by: David Dobrigkeit Chinellato Co-authored-by: ALICE Builder --- Common/DataModel/Multiplicity.h | 20 +++-- Common/TableProducer/CMakeLists.txt | 5 ++ .../TableProducer/multiplicityExtraTable.cxx | 76 +++++++++++++++++++ Common/TableProducer/multiplicityTable.cxx | 20 ----- Common/Tasks/multiplicityQa.cxx | 8 +- 5 files changed, 98 insertions(+), 31 deletions(-) create mode 100644 Common/TableProducer/multiplicityExtraTable.cxx diff --git a/Common/DataModel/Multiplicity.h b/Common/DataModel/Multiplicity.h index ae337853a4d..a81913c08f1 100644 --- a/Common/DataModel/Multiplicity.h +++ b/Common/DataModel/Multiplicity.h @@ -107,15 +107,21 @@ DECLARE_SOA_TABLE(MultZeqs, "AOD", "MULTZEQ", //! multZeq::MultZeqNTracksPV); using MultZeq = MultZeqs::iterator; -namespace multDebug +namespace multBC { -DECLARE_SOA_COLUMN(MultDebugFT0A, multDebugFT0A, float); //! -DECLARE_SOA_COLUMN(MultDebugFT0C, multDebugFT0C, float); //! +DECLARE_SOA_COLUMN(MultBCFT0A, multBCFT0A, float); //! +DECLARE_SOA_COLUMN(MultBCFT0C, multBCFT0C, float); //! +DECLARE_SOA_COLUMN(MultBCFV0A, multBCFV0A, float); //! +DECLARE_SOA_COLUMN(MultBCTVX, multBCTVX, bool); //! +DECLARE_SOA_COLUMN(MultBCFV0OrA, multBCFV0OrA, bool); //! } // namespace multDebug -DECLARE_SOA_TABLE(MultsDebug, "AOD", "MULTDEBUG", //! - multDebug::MultDebugFT0A, - multDebug::MultDebugFT0C); -using MultDebug = MultsDebug::iterator; +DECLARE_SOA_TABLE(MultsBC, "AOD", "MULTBC", //! + multBC::MultBCFT0A, + multBC::MultBCFT0C, + multBC::MultBCFV0A, + multBC::MultBCTVX, + multBC::MultBCFV0OrA); +using MultBC = MultsBC::iterator; } // namespace o2::aod diff --git a/Common/TableProducer/CMakeLists.txt b/Common/TableProducer/CMakeLists.txt index d4917f90eab..88a09839340 100644 --- a/Common/TableProducer/CMakeLists.txt +++ b/Common/TableProducer/CMakeLists.txt @@ -31,6 +31,11 @@ o2physics_add_dpl_workflow(multiplicity-table PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(multiplicity-extra-table + SOURCES multiplicityExtraTable.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(centrality-table SOURCES centralityTable.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/Common/TableProducer/multiplicityExtraTable.cxx b/Common/TableProducer/multiplicityExtraTable.cxx new file mode 100644 index 00000000000..3bd28ebeb9f --- /dev/null +++ b/Common/TableProducer/multiplicityExtraTable.cxx @@ -0,0 +1,76 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#include "Framework/ConfigParamSpec.h" + +using namespace o2; +using namespace o2::framework; + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "DataFormatsFIT/Triggers.h" +#include "TableHelper.h" +#include "iostream" + +struct MultiplicityExtraTable { + Produces multBC; + + unsigned int randomSeed = 0; + void init(InitContext& context) + { + // empty for now + } + + using BCsWithRun3Matchings = soa::Join; + + void process(BCsWithRun3Matchings::iterator const& bc, aod::FV0As const&, aod::FT0s const& ft0s, aod::FDDs const&) + { + bool Tvx = false; + bool isFV0OrA = false; + float multFT0C = 0.f; + float multFT0A = 0.f; + float multFV0A = 0.f; + + if (bc.has_ft0()) { + auto ft0 = bc.ft0(); + std::bitset<8> triggers = ft0.triggerMask(); + Tvx = triggers[o2::fit::Triggers::bitVertex]; + + // calculate T0 charge + for (auto amplitude : ft0.amplitudeA()) { + multFT0A += amplitude; + } + for (auto amplitude : ft0.amplitudeC()) { + multFT0C += amplitude; + } + + if (bc.has_fv0a()) { + auto fv0 = bc.fv0a(); + std::bitset<8> fV0Triggers = fv0.triggerMask(); + + for (auto amplitude : fv0.amplitude()) { + multFV0A += amplitude; + } + isFV0OrA = fV0Triggers[o2::fit::Triggers::bitA]; + } // fv0 + } + + multBC(multFT0A, multFT0C, multFV0A, Tvx, isFV0OrA); + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"multiplicity-extra-table"})}; +} diff --git a/Common/TableProducer/multiplicityTable.cxx b/Common/TableProducer/multiplicityTable.cxx index 67928c88f41..3a217b046b8 100644 --- a/Common/TableProducer/multiplicityTable.cxx +++ b/Common/TableProducer/multiplicityTable.cxx @@ -33,7 +33,6 @@ struct MultiplicityTableTaskIndexed { Produces multBarrel; Produces multExtra; Produces multzeq; - Produces multDebug; // For vertex-Z corrections in calibration Service ccdb; @@ -320,25 +319,6 @@ struct MultiplicityTableTaskIndexed { } } PROCESS_SWITCH(MultiplicityTableTaskIndexed, processRun3, "Produce Run 3 multiplicity tables", true); - - void processFT0(aod::FT0s const& ft0s) - { - // process function to acquire FT0A/C derived table for posterior study - for (auto const& ft0 : ft0s) { - if (bitcheck(ft0.triggerMask(), 4)) { - float multFT0A = 0, multFT0C = 0; - for (auto amplitude : ft0.amplitudeA()) { - multFT0A += amplitude; - } - for (auto amplitude : ft0.amplitudeC()) { - multFT0C += amplitude; - } - - multDebug(multFT0A, multFT0C); - } - } - } - PROCESS_SWITCH(MultiplicityTableTaskIndexed, processFT0, "Produce Run 3 MultsDebug table", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/Common/Tasks/multiplicityQa.cxx b/Common/Tasks/multiplicityQa.cxx index 1fd616d96a5..3efd57063fd 100644 --- a/Common/Tasks/multiplicityQa.cxx +++ b/Common/Tasks/multiplicityQa.cxx @@ -402,12 +402,12 @@ struct MultiplicityQa { histos.fill(HIST("multiplicityQa/h2dFT0MVsNchT0M"), nchFT0, biggestFT0); } - void processFIT(aod::MultsDebug const& multsdebug) + void processFIT(aod::MultsBC const& multsdebug) { for (auto& mult : multsdebug) { - histos.fill(HIST("multiplicityQa/hIsolatedFT0A"), mult.multDebugFT0A()); - histos.fill(HIST("multiplicityQa/hIsolatedFT0C"), mult.multDebugFT0C()); - histos.fill(HIST("multiplicityQa/hIsolatedFT0M"), mult.multDebugFT0A() + mult.multDebugFT0C()); + histos.fill(HIST("multiplicityQa/hIsolatedFT0A"), mult.multBCFT0A()); + histos.fill(HIST("multiplicityQa/hIsolatedFT0C"), mult.multBCFT0C()); + histos.fill(HIST("multiplicityQa/hIsolatedFT0M"), mult.multBCFT0A() + mult.multBCFT0C()); } }