Skip to content
Closed
Changes from all commits
Commits
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
24 changes: 20 additions & 4 deletions Common/TableProducer/Converters/tracksExtraV002Converter.cxx
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 Common/TableProducer/Converters/tracksExtraV002Converter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.

Check failure on line 1 in Common/TableProducer/Converters/tracksExtraV002Converter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[o2-workflow-options]

Do not use workflow options to customise workflow topology composition in defineDataProcessing. Use process function switches or metadata instead.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -8,7 +8,7 @@
// 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.

Check failure on line 11 in Common/TableProducer/Converters/tracksExtraV002Converter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

Check failure on line 11 in Common/TableProducer/Converters/tracksExtraV002Converter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check failure on line 11 in Common/TableProducer/Converters/tracksExtraV002Converter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.
#include <Framework/AnalysisDataModel.h>
#include <Framework/AnalysisHelpers.h>
#include <Framework/AnalysisTask.h>
Expand All @@ -22,7 +22,7 @@
using namespace o2::framework;

struct TracksExtraV002Converter {
Produces<aod::StoredTracksExtra_002> tracksExtra_002;

Check failure on line 25 in Common/TableProducer/Converters/tracksExtraV002Converter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.

void init(InitContext const&)
{
Expand All @@ -40,13 +40,13 @@
for (const auto& track0 : tracksExtra_000) {

uint32_t itsClusterSizes = 0;
for (int layer = 0; layer < 7; layer++) {

Check failure on line 43 in Common/TableProducer/Converters/tracksExtraV002Converter.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 (track0.itsClusterMap() & (1 << layer)) {
itsClusterSizes |= (0xf << (layer * 4));
}
}

int8_t TPCNClsFindableMinusPID = 0;

Check failure on line 49 in Common/TableProducer/Converters/tracksExtraV002Converter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.

tracksExtra_002(track0.tpcInnerParam(),
track0.flags(),
Expand Down Expand Up @@ -78,7 +78,7 @@

for (const auto& track1 : tracksExtra_001) {

int8_t TPCNClsFindableMinusPID = 0;

Check failure on line 81 in Common/TableProducer/Converters/tracksExtraV002Converter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.

tracksExtra_002(track1.tpcInnerParam(),
track1.flags(),
Expand Down Expand Up @@ -108,13 +108,29 @@

/// Spawn the extended table for TracksExtra002 to avoid the call to the internal spawner and a consequent circular dependency
struct TracksExtraSpawner {
Spawns<aod::TracksExtra_002> tracksExtra_002;

Check failure on line 111 in Common/TableProducer/Converters/tracksExtraV002Converter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<TracksExtraV002Converter>(cfgc),
adaptAnalysisTask<TracksExtraSpawner>(cfgc),
};
auto workflow = WorkflowSpec{};
// Check if 'aod-metadata-tables' option is available in the config context
if (cfgc.options().hasOption("aod-metadata-tables")) {
LOG(debug) << "'aod-metadata-tables' option found in the config context, checking for existing tables";
// Get the list of tables from the config context
const std::vector<std::string> tables = cfgc.options().get<std::vector<std::string>>("aod-metadata-tables");
// If the table is already found, do not add the converter and spawner
if (std::find(tables.begin(), tables.end(), "O2trackextra_002") == tables.end()) {
LOG(debug) << "Adding TracksExtraV002Converter and TracksExtraSpawner to the workflow";
workflow.push_back(adaptAnalysisTask<TracksExtraV002Converter>(cfgc));
workflow.push_back(adaptAnalysisTask<TracksExtraSpawner>(cfgc));
} else {
LOG(debug) << "Table O2trackextra_002 already found, not adding converter and spawner";
}
} else {
LOG(debug) << "'aod-metadata-tables' option not found in the config context, adding converter and spawner by default";
workflow.push_back(adaptAnalysisTask<TracksExtraV002Converter>(cfgc));
workflow.push_back(adaptAnalysisTask<TracksExtraSpawner>(cfgc));
}
return workflow;
}
Loading