Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions PWGJE/DataModel/SlimTables.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
// 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.

///
/// \file SlimTables.h
/// \author Millot Louise <louise.millot@cern.ch>
/// \since 2024-11-27
/// \brief Header for the SlimTables task for the analysis of the reduced tables.
///

#ifndef PWGJE_DATAMODEL_SLIMTABLES_H_
#define PWGJE_DATAMODEL_SLIMTABLES_H_

#include "PWGJE/Core/JetDerivedDataUtilities.h"

#include <Framework/ASoA.h>
#include <Framework/AnalysisDataModel.h>

#include <Rtypes.h>

#include <cstdint>

namespace o2::aod
{

namespace slimcollision
{
DECLARE_SOA_INDEX_COLUMN(Collision, collision);
DECLARE_SOA_COLUMN(PosZ, posZ, float);
DECLARE_SOA_COLUMN(CentFT0C, centFT0C, float);
DECLARE_SOA_COLUMN(CentFT0M, centFT0M, float);
DECLARE_SOA_COLUMN(Weight, weight, float);
DECLARE_SOA_COLUMN(EventSel, eventSel, uint16_t);
DECLARE_SOA_COLUMN(TrackOccupancyInTimeRange, trackOccupancyInTimeRange, int);
} // namespace slimcollision

DECLARE_SOA_TABLE(SlimCollisions, "AOD", "SlimCollisions",
o2::soa::Index<>,
slimcollision::PosZ,
slimcollision::CentFT0C,
slimcollision::CentFT0M,
slimcollision::Weight,
slimcollision::EventSel,
slimcollision::TrackOccupancyInTimeRange);

namespace slimmccollision
{
DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision);
DECLARE_SOA_COLUMN(PosZ, posZ, float);
DECLARE_SOA_COLUMN(CentFT0M, centFT0M, float);
DECLARE_SOA_COLUMN(Weight, weight, float);
DECLARE_SOA_COLUMN(Accepted, accepted, uint64_t);
DECLARE_SOA_COLUMN(PtHard, ptHard, float);
} // namespace slimmccollision

DECLARE_SOA_TABLE(SlimMcCollisions, "AOD", "SlimMcCollisions",
o2::soa::Index<>,
slimmccollision::PosZ,
slimmccollision::CentFT0M,
slimmccollision::Weight,
slimmccollision::Accepted,
slimmccollision::PtHard);

namespace slimtracks
{
DECLARE_SOA_INDEX_COLUMN(Collision, collision);
DECLARE_SOA_INDEX_COLUMN(Track, track);
DECLARE_SOA_COLUMN(Pt, pt, float);
DECLARE_SOA_COLUMN(Eta, eta, float);
DECLARE_SOA_COLUMN(Phi, phi, float);
DECLARE_SOA_COLUMN(DcaXY, dcaXY, float);
DECLARE_SOA_DYNAMIC_COLUMN(Px, px,
[](float pt, float phi) -> float { return pt * std::cos(phi); });
DECLARE_SOA_DYNAMIC_COLUMN(Py, py,
[](float pt, float phi) -> float { return pt * std::sin(phi); });
DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz,
[](float pt, float eta) -> float { return pt * std::sinh(eta); });
DECLARE_SOA_DYNAMIC_COLUMN(Energy, energy,
[](float pt, float eta) -> float { return std::sqrt((pt * std::cosh(eta) * pt * std::cosh(eta)) + (jetderiveddatautilities::mPion * jetderiveddatautilities::mPion)); });
} // namespace slimtracks
DECLARE_SOA_TABLE(SlimTracks, "AOD", "SlimTracks",
o2::soa::Index<>,
slimtracks::CollisionId,
slimtracks::Pt,
slimtracks::Eta,
slimtracks::Phi,
slimtracks::DcaXY,
slimtracks::Px<slimtracks::Pt, slimtracks::Phi>,
slimtracks::Py<slimtracks::Pt, slimtracks::Phi>,
slimtracks::Pz<slimtracks::Pt, slimtracks::Eta>,
slimtracks::Energy<slimtracks::Pt, slimtracks::Eta>);

namespace slimparticles
{
DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision);
DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle);
DECLARE_SOA_COLUMN(Pt, pt, float);
DECLARE_SOA_COLUMN(Eta, eta, float);
DECLARE_SOA_COLUMN(Phi, phi, float);
DECLARE_SOA_DYNAMIC_COLUMN(Px, px,
[](float pt, float phi) -> float { return pt * std::cos(phi); });
DECLARE_SOA_DYNAMIC_COLUMN(Py, py,
[](float pt, float phi) -> float { return pt * std::sin(phi); });
DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz,
[](float pt, float eta) -> float { return pt * std::sinh(eta); });
DECLARE_SOA_DYNAMIC_COLUMN(Energy, energy,
[](float e) -> float { return e; });
} // namespace slimparticles

DECLARE_SOA_TABLE(SlimParticles, "AOD", "SlimParticles",
o2::soa::Index<>,
slimparticles::McCollisionId,
slimparticles::Pt,
slimparticles::Eta,
slimparticles::Phi,
slimparticles::Px<slimparticles::Pt, slimparticles::Phi>,
slimparticles::Py<slimparticles::Pt, slimparticles::Phi>,
slimparticles::Pz<slimparticles::Pt, slimparticles::Eta>,
slimparticles::Energy<slimparticles::Pt, slimparticles::Eta>);

} // namespace o2::aod

#endif // PWGJE_DATAMODEL_SLIMTABLES_H_
5 changes: 5 additions & 0 deletions PWGJE/TableProducer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,42 @@

if(FastJet_FOUND)

o2physics_add_dpl_workflow(jet-deriveddata-producer

Check failure on line 16 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-deriveddata-producer does not match its file name derivedDataProducer.cxx. (Matches jetDeriveddataProducer.cxx.)
SOURCES derivedDataProducer.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::EventFilteringUtils
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-deriveddata-trigger-producer

Check failure on line 21 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-deriveddata-trigger-producer does not match its file name derivedDataTriggerProducer.cxx. (Matches jetDeriveddataTriggerProducer.cxx.)
SOURCES derivedDataTriggerProducer.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-deriveddata-selector

Check failure on line 26 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-deriveddata-selector does not match its file name derivedDataSelector.cxx. (Matches jetDeriveddataSelector.cxx.)
SOURCES derivedDataSelector.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-deriveddata-writer

Check failure on line 31 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-deriveddata-writer does not match its file name derivedDataWriter.cxx. (Matches jetDeriveddataWriter.cxx.)
SOURCES derivedDataWriter.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-luminosity-producer

Check failure on line 36 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-luminosity-producer does not match its file name luminosityProducer.cxx. (Matches jetLuminosityProducer.cxx.)
SOURCES luminosityProducer.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-luminosity-calculator

Check failure on line 41 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-luminosity-calculator does not match its file name luminosityCalculator.cxx. (Matches jetLuminosityCalculator.cxx.)
SOURCES luminosityCalculator.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-eventweight-mcd

Check failure on line 46 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-eventweight-mcd does not match its file name jetEventWeightMCD.cxx. (Matches jetEventweightMcd.cxx.)
SOURCES jetEventWeightMCD.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-eventweight-mcp

Check failure on line 51 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-eventweight-mcp does not match its file name jetEventWeightMCP.cxx. (Matches jetEventweightMcp.cxx.)
SOURCES jetEventWeightMCP.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -63,12 +63,12 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-hf-definition

Check failure on line 66 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-hf-definition does not match its file name heavyFlavourDefinition.cxx. (Matches jetHfDefinition.cxx.)
SOURCES heavyFlavourDefinition.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-taggerhf

Check failure on line 71 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-taggerhf does not match its file name jetTaggerHF.cxx. (Matches jetTaggerhf.cxx.)
SOURCES jetTaggerHF.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2Physics::MLCore
COMPONENT_NAME Analysis)
Expand Down Expand Up @@ -105,3 +105,8 @@
SOURCES emcalClusterHadronicCorrectionTask.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2::EMCALBase O2::EMCALReconstruction
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(slim-tables-producer
SOURCES slimTablesProducer.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
78 changes: 78 additions & 0 deletions PWGJE/TableProducer/slimTablesProducer.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// 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.

/// \file slimTablesProducer.cxx
/// \brief Task to produce a reduced version of Tables for tracks, collisions, mcparticles and mccollisions.
/// \author Millot Louise <louise.millot@cern.ch>

#include "PWGJE/DataModel/SlimTables.h"

#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisHelpers.h"
#include "Framework/AnalysisTask.h"
#include <Framework/Configurable.h>
#include <Framework/InitContext.h>
#include <Framework/Logger.h>
#include <Framework/runDataProcessing.h>

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;

struct SlimTablesProducer {

void init(InitContext&)
{
}

Produces<o2::aod::SlimCollisions> slimCollisions;
Produces<o2::aod::SlimMcCollisions> slimMcCollisions;
Produces<o2::aod::SlimTracks> slimTracks;
Produces<o2::aod::SlimParticles> slimParticles;

void processCollision(aod::SlimCollisions const& collisions)
{
for (const auto& coll : collisions) {
slimCollisions(coll.posZ(), coll.centFT0C(), coll.centFT0M(), coll.weight(), coll.eventSel(), coll.trackOccupancyInTimeRange());
}
}
PROCESS_SWITCH(SlimTablesProducer, processCollision, "Produce slim collision table", true);

void processMcCollision(aod::SlimMcCollisions const& mccollisions)
{
for (const auto& mccoll : mccollisions) {
slimMcCollisions(mccoll.posZ(), mccoll.centFT0M(), mccoll.weight(), mccoll.accepted(), mccoll.ptHard());
}
}
PROCESS_SWITCH(SlimTablesProducer, processMcCollision, "Produce slim mc collision table", true);

void processTracks(aod::SlimTracks const& tracks)
{
for (const auto& trk : tracks) {
slimTracks(trk.collision(), trk.pt(), trk.eta(), trk.phi(), trk.dcaXY());
}
}
PROCESS_SWITCH(SlimTablesProducer, processTracks, "Produce slim track table", true);

void processParticles(aod::McParticles const& parts)
{
for (const auto& p : parts) {
slimParticles(p.mcCollision(), p.pt(), p.eta(), p.phi());
}
}
PROCESS_SWITCH(SlimTablesProducer, processParticles, "Produce slim particles", true);
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<SlimTablesProducer>(cfgc)};
}
Loading