Skip to content
Draft
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9a39814
Added table producer example
nicola-wilson May 14, 2026
8e49699
PWGJE: add tableDiffWake task
nicola-wilson Jun 5, 2026
b6b1b56
PWGJE: add tableDiffWake task - restored myExample
nicola-wilson Jun 8, 2026
5edc2ad
Updated format tableDiffWake
nicola-wilson Jun 8, 2026
25d674a
Updated format tableDiffWake 2
nicola-wilson Jun 8, 2026
13f091f
Updated format tableDiffWake 3
nicola-wilson Jun 8, 2026
e90d684
Updated format tableDiffWake 4
nicola-wilson Jun 8, 2026
6542d38
Change data types for several SOA columns
wirthni Jun 8, 2026
431f51b
Rename source files in CMakeLists.txt for jet workflows
wirthni Jun 8, 2026
2780af4
Fix formatting of P column declaration
wirthni Jun 8, 2026
e993d81
Please consider the following formatting changes
alibuild Jun 8, 2026
e74c748
Merge pull request #2 from alibuild/alibot-cleanup-16570
wirthni Jun 8, 2026
9ece9fb
Disable OSV Scanner
wirthni Jun 9, 2026
c139b63
Adjust pT axis and add momentum overflow checks
wirthni Jun 9, 2026
ba83b1e
Refactor tableDiffWake.cxx to clean up track properties
wirthni Jun 9, 2026
fd23dc5
Clean up includes and fix comment space
wirthni Jun 9, 2026
3205395
Refactor variable types for memory optimization
wirthni Jun 9, 2026
1b2127a
Refactor variable names for clarity in tableDiffWake
wirthni Jun 9, 2026
86d80c6
rewrote comments
wirthni Jun 9, 2026
2874fa1
Refactor configurable parameters in tableDiffWake
wirthni Jun 9, 2026
691c4f3
Enhance documentation in tableDiffWake.cxx
wirthni Jun 9, 2026
20a8eb1
Rename configurable variables and type alias
wirthni Jun 9, 2026
cf17915
Rename struct tableDiffWake to TableDiffWake
wirthni Jun 9, 2026
59f4542
Refactor casts to use static_cast
wirthni Jun 9, 2026
141512f
Remove REPOSITORY_OSV_SCANNER from mega-linter
wirthni Jun 9, 2026
cd6e89e
Refactor track iteration to use 'const auto&'
wirthni Jun 9, 2026
397e95e
Remove unnecessary comment section in tableDiffWake.cxx
wirthni Jun 9, 2026
45bfab2
Clean up comments in tableDiffWake.cxx
wirthni Jun 9, 2026
df6997d
Optimize particle momentum calculations using bitmasking
wirthni Jun 9, 2026
c7ea0d7
Fixed index column and syntax in momentum packing
nicola-wilson Jun 10, 2026
138dea9
Rename tableDiffWake.cxx to diffWakeTreeProducer.cxx
nicola-wilson Jun 11, 2026
030b2a4
Changed name of task
nicola-wilson Jun 11, 2026
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
23 changes: 14 additions & 9 deletions PWGJE/TableProducer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Use kebab-case for names of workflows and match the name of the workflow file.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
Expand All @@ -14,42 +14,42 @@
if(FastJet_FOUND)

o2physics_add_dpl_workflow(jet-deriveddata-producer
SOURCES derivedDataProducer.cxx
SOURCES jetDeriveddataProducer.cxx

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files are not modified in this PR.

PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::EventFilteringUtils O2Physics::SGCutParHolder
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-deriveddata-trigger-producer
SOURCES derivedDataTriggerProducer.cxx
SOURCES jetDeriveddataTriggerProducer.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-deriveddata-selector
SOURCES derivedDataSelector.cxx
SOURCES jetDeriveddataSelector.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-deriveddata-writer
SOURCES derivedDataWriter.cxx
SOURCES jetDeriveddataWriter.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 jetLuminosityCalculator.cxx. (Matches jetLuminosityProducer.cxx.)
SOURCES luminosityProducer.cxx
SOURCES jetLuminosityCalculator.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
SOURCES jetEventWeightMCD.cxx
SOURCES jetEventweightMcd.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-eventweight-mcp
SOURCES jetEventWeightMCP.cxx
SOURCES jetEventweightMcp.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

Expand All @@ -64,26 +64,26 @@
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-hf-definition
SOURCES heavyFlavourDefinition.cxx
SOURCES jetHfDefinition.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-taggerhf
SOURCES jetTaggerHF.cxx
SOURCES jetTaggerhf.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2Physics::MLCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(estimator-rho

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name estimator-rho does not match its file name rhoEstimator.cxx. (Matches estimatorRho.cxx.)
SOURCES rhoEstimator.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(subtractor-eventwiseconstituent

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name subtractor-eventwiseconstituent does not match its file name eventwiseConstituentSubtractor.cxx. (Matches subtractorEventwiseconstituent.cxx.)
SOURCES eventwiseConstituentSubtractor.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-sv-reconstruction

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-sv-reconstruction does not match its file name secondaryVertexReconstruction.cxx. (Matches jetSvReconstruction.cxx.)
SOURCES secondaryVertexReconstruction.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -96,7 +96,7 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2::EMCALBase O2::EMCALReconstruction O2::EMCALCalibration O2Physics::PWGJECore O2Physics::EventFilteringUtils
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(emcal-matchedtracks-writer

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name emcal-matchedtracks-writer does not match its file name emcalMatchedTracksTask.cxx. (Matches emcalMatchedtracksWriter.cxx.)
SOURCES emcalMatchedTracksTask.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2::EMCALBase O2::EMCALReconstruction
COMPONENT_NAME Analysis)
Expand All @@ -110,3 +110,8 @@
SOURCES slimTablesProducer.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(table-diff-wake
SOURCES tableDiffWake.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
270 changes: 270 additions & 0 deletions PWGJE/TableProducer/tableDiffWake.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
// 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.
///
/// This task writes a collision and track table which are further used in
/// a diffusion wake analysis
///
/// author N. Wilson

#include <Framework/ASoA.h>
#include <Framework/AnalysisDataModel.h>
#include <Framework/AnalysisHelpers.h>
#include <Framework/AnalysisTask.h>
#include <Framework/HistogramRegistry.h>
#include <Framework/HistogramSpec.h>
#include <Framework/InitContext.h>
#include <Framework/OutputObjHeader.h>
#include <Framework/runDataProcessing.h>
// For centrality:
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
// For TPC Mult
#include "Common/DataModel/Multiplicity.h"
// For DCA and TrackSelection
#include "Common/DataModel/TrackSelectionTables.h"
// For EP
#include "Common/Core/EventPlaneHelper.h"
#include "Common/DataModel/Qvectors.h"
// For occupancy bit
#include "Common/CCDB/EventSelectionParams.h"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all comments (or move them to the ends of lines). They block the sorting and grouping.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also make sure you include exactly what you use.


// Event selection: Only events that contain track above some threshold
/*
-------------------------------------------------------------------------------------------
TRACK DATA
-------------------------------------------------------------------------------------------
BEFORE COMPRESSION AFTER COMPRESSION
Name Data Type Size(b) Name Data Type Size(b)
ColID int32_t 4 [same]
Charge short 2 [same]
Px, Py, Pz float 3x4 P unsigned long 8
DEdx float 4 DEdx unsigned short 2
DCAXY float 4 DCAXY short 2
DCAZ float 4 DCAZ short 2
Length float 4 Length unsigned short 2

OVERALL COMPRESSION 34b->22b

-------------------------------------------------------------------------------------------
EVENT DATA
-------------------------------------------------------------------------------------------
GI int64_t 8 [same]
RN int 4 [same]
Cent float 4 [same]
Mult int 4 [same]
VertexX float 4 [same]
VertexY float 4 [same]
VertexZ float 4 [same]
Psi2 float 4 Psi2 short 2
Psi3 float 4 Psi3 short 2

OVERALL COMPRESSION 40b->36b

*/

//--------------------------------------------------------
namespace o2::aod
{
namespace testcol
{
// Event properties
DECLARE_SOA_COLUMN(Gi, gi, int64_t);
DECLARE_SOA_COLUMN(Rn, rn, int32_t); // run number
DECLARE_SOA_COLUMN(Cent, cent, float); // FT0C centrality
DECLARE_SOA_COLUMN(Mult, mult, int32_t); // TPC multiplicity
DECLARE_SOA_COLUMN(Occu, occu, int32_t); // Occupancy ITS
DECLARE_SOA_COLUMN(Occuft0, occuft0, float); // Occupancy FT0C amplitudes
DECLARE_SOA_COLUMN(VertexX, vertexX, float);
DECLARE_SOA_COLUMN(VertexY, vertexY, float);
DECLARE_SOA_COLUMN(VertexZ, vertexZ, float);
DECLARE_SOA_COLUMN(Psi2, psi2, int16_t);
DECLARE_SOA_COLUMN(Psi3, psi3, int16_t);
} // namespace testcol
namespace testtrack
{

// Track properties
DECLARE_SOA_COLUMN(Colid, colid, int32_t); // Collision ID
DECLARE_SOA_COLUMN(Charge, charge, int16_t);
DECLARE_SOA_COLUMN(P, p, uint64_t);
DECLARE_SOA_COLUMN(Dedx, dedx, uint16_t);
DECLARE_SOA_COLUMN(Dcaxy, dcaxy, int16_t);
DECLARE_SOA_COLUMN(Dcaz, dcaz, int16_t);
} // namespace testtrack
DECLARE_SOA_TABLE(TableCol, "AOD", "TABLECOL",
testcol::Gi,
testcol::Rn,
testcol::Cent,
testcol::Mult,
testcol::Occu,
testcol::Occuft0,
testcol::VertexX,
testcol::VertexY,
testcol::VertexZ,
testcol::Psi2,
testcol::Psi3);
DECLARE_SOA_TABLE(TableTrack, "AOD", "TABLETRACK",
testtrack::Colid,
testtrack::Charge,
testtrack::P,
testtrack::Dedx,
testtrack::Dcaxy,
testtrack::Dcaz);
} // namespace o2::aod
//--------------------------------------------------------
using namespace o2;
using namespace o2::framework;

struct tableDiffWake {

HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
Configurable<int> nBinsPt{"nBinsPt", 100, "N bins in pT histo"};
Configurable<double> pT_thresh{"pT_thresh", 20.0, "pT threshold"};
Configurable<float> cent_max{"cent_max", 10, "centrality"};
Configurable<float> z_vert_cut{"z_vert_cut", 10.0, "z_vertex cut"};

Produces<o2::aod::TableCol> testcol;
Produces<o2::aod::TableTrack> testtrack;

EventPlaneHelper helperEP;

void init(InitContext const&)
{
const AxisSpec axisEta{30, -1.5, +1.5, "#eta"};
const AxisSpec axispT{nBinsPt, 0, 10, "p_{T}"};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure you want pt only to be 0-10? this seems too small to me, do you mean 100 GeV?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this is fixed now


histos.add("etaHistogram", "etaHistogram", kTH1F, {axisEta});
histos.add("pTHistogram", "pTHistogram", kTH1F, {axispT});
}

using bcs = aod::BCs;
void process(soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::TPCMults, aod::QvectorFT0Cs>::iterator const& col,
soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection> const& tracks,
bcs const&)
{
// Event selection corresponds to sel8FullPbPb
if (!col.sel8())
return;
if (col.centFT0C() > cent_max)
return; // Centrality 0 - 10 %
if (std::abs(col.posZ()) > z_vert_cut)
return; // z position < 10 cm
if (!col.selection_bit(o2::aod::evsel::kNoCollInRofStandard))
return;
if (!col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard))
return;

//------ Get Run number ---------------------
auto bc = col.bc_as<bcs>();
int run = bc.runNumber();
//------------ EP ---------------------------
double ep2 = 0.0;
double ep3 = 0.0;
ep2 = helperEP.GetEventPlane(col.qvecFT0CRe(), col.qvecFT0CIm(), 2);
ep3 = helperEP.GetEventPlane(col.qvecFT0CRe(), col.qvecFT0CIm(), 3);

//------- Only events with track above some thresh ----------

bool eventHighpT = false;
for (auto& track : tracks) {

Check failure on line 177 in PWGJE/TableProducer/tableDiffWake.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.

if (!track.isGlobalTrack())
continue;
if (track.pt() > pT_thresh) {
eventHighpT = true;
break;
}
}
if (!eventHighpT)
return;
//------------------------------------------------------------
// Translate values to less memory consuming values
Short_t Substitute_ep2 = (Short_t)(ep2 * 1000);
Short_t Substitute_ep3 = (Short_t)(ep3 * 1000);

testcol(col.globalIndex(),
run,
col.centFT0C(),
col.multTPC(),
col.trackOccupancyInTimeRange(),
col.ft0cOccupancyInTimeRange(),
col.posX(),
col.posY(),
col.posZ(),
Substitute_ep2,
Substitute_ep3);

for (auto& track : tracks) {

Check failure on line 205 in PWGJE/TableProducer/tableDiffWake.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.

// Track cut
if (!track.isGlobalTrack())
continue; // General track cuts

histos.fill(HIST("etaHistogram"), track.eta());
histos.fill(HIST("pTHistogram"), track.pt());

//------------ Translate values to less memory consuming values --------------------
// Px, Py, Pz
ULong64_t Substitute_p = 0;

Long64_t Particle_px = (track.px() * 6000);
if (Particle_px < 0)
Substitute_p |= (ULong64_t)1 << 20;
if (Particle_px < 0)
Particle_px = (-1) * Particle_px;
for (Int_t i_bit = 0; i_bit < 20; i_bit++) {

Check failure on line 223 in PWGJE/TableProducer/tableDiffWake.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
if ((Particle_px & ((Long64_t)1 << i_bit)))
Substitute_p |= (ULong64_t)1 << i_bit;
}

Long64_t Particle_py = (track.py() * 6000);
if (Particle_py < 0)
Substitute_p |= (ULong64_t)1 << 41;
if (Particle_py < 0)
Particle_py = (-1) * Particle_py;
for (Int_t i_bit = 21; i_bit < 41; i_bit++) {
if ((Particle_py & ((Long64_t)1 << (i_bit - 21))))
Substitute_p |= (ULong64_t)1 << i_bit;
}

Long64_t Particle_pz = (track.pz() * 6000);
if (Particle_pz < 0)
Substitute_p |= (ULong64_t)1 << 62;
if (Particle_pz < 0)
Particle_pz = (-1) * Particle_pz;
for (Int_t i_bit = 42; i_bit < 62; i_bit++) {
if ((Particle_pz & ((Long64_t)1 << (i_bit - 42))))
Substitute_p |= (ULong64_t)1 << i_bit;
}

// dEdx
UShort_t Substitute_dEdx = (UShort_t)(track.tpcSignal() * 10);

// DCA
Short_t Substitute_DCAXY = (Short_t)(track.dcaXY() * 100);
Short_t Substitute_DCAZ = (Short_t)(track.dcaZ() * 100);

//--------------- Fill track table ------------------
testtrack(track.collisionId(),
track.sign(),
Substitute_p,
Substitute_dEdx,
Substitute_DCAXY,
Substitute_DCAZ);
}
}
};

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