Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion ALICE3/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 ALICE3/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 @@ -11,27 +11,27 @@

add_subdirectory(OTF)

o2physics_add_dpl_workflow(alice3-trackselection

Check failure on line 14 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-trackselection does not match its file name alice3-trackselection.cxx. (Matches alice3Trackselection.cxx.)
SOURCES alice3-trackselection.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-trackextension

Check failure on line 19 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-trackextension does not match its file name alice3-trackextension.cxx. (Matches alice3Trackextension.cxx.)
SOURCES alice3-trackextension.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::ReconstructionDataFormats
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-centrality
SOURCES alice3-centrality.cxx
SOURCES alice3Centrality.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-decaypreselector

Check failure on line 29 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-decaypreselector does not match its file name alice3-decaypreselector.cxx. (Matches alice3Decaypreselector.cxx.)
SOURCES alice3-decaypreselector.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-decayfinder

Check failure on line 34 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-decayfinder does not match its file name alice3-decayfinder.cxx. (Matches alice3Decayfinder.cxx.)
SOURCES alice3-decayfinder.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
COMPONENT_NAME Analysis)
Expand All @@ -41,7 +41,7 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-correlatorddbar

Check failure on line 44 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-correlatorddbar does not match its file name alice3-correlatorDDbar.cxx. (Matches alice3Correlatorddbar.cxx.)
SOURCES alice3-correlatorDDbar.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
COMPONENT_NAME Analysis)
Expand All @@ -66,12 +66,12 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2Physics::AnalysisCCDB O2Physics::PWGDQCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-dileptonsmearing

Check failure on line 69 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-dileptonsmearing does not match its file name alice3-dileptonsmearing.cxx. (Matches alice3Dileptonsmearing.cxx.)
SOURCES alice3-dileptonsmearing.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2Physics::AnalysisCCDB O2Physics::PWGEMDileptonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3strangenessfinder

Check failure on line 74 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3strangenessfinder does not match its file name alice3strangenessFinder.cxx. (Matches alice3strangenessfinder.cxx.)
SOURCES alice3strangenessFinder.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::ALICE3Core
COMPONENT_NAME Analysis)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
// or submit itself to any jurisdiction.
/// \author Nicolo' Jacazio <nicolo.jacazio@cern.ch>, CERN
/// \author David Dobrigkeit Chinellato <david.dobrigkeit.chinellato@cern.ch>, UNICAMP/CERN
/// \brief Centrality producer for ALICE3
/// \file alice3Centrality.cxx

#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/TrackSelectionTables.h"
Expand All @@ -20,6 +22,7 @@
#include <Framework/AnalysisHelpers.h>
#include <Framework/AnalysisTask.h>
#include <Framework/Configurable.h>
#include <Framework/Expressions.h>
#include <Framework/HistogramRegistry.h>
#include <Framework/HistogramSpec.h>
#include <Framework/InitContext.h>
Expand All @@ -30,69 +33,67 @@
#include <TString.h>

#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <string>

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

struct ALICE3Centrality {
struct Alice3Centrality {
Produces<aod::CentRun2V0Ms> cent;
Service<o2::ccdb::BasicCCDBManager> ccdb;

HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
Configurable<float> MinEta{"MinEta", -4.0f, "Minimum eta in range"};
Configurable<float> MaxEta{"MaxEta", 4.0f, "Maximum eta in range"};
Configurable<float> MaxMult{"MaxMult", 10000.f, "Maximum multiplicity in range"};
Configurable<float> MaxDCA{"MaxDCA", 0.0025f, "Max DCAxy and DCAz for counted tracks"};
Configurable<std::string> url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
Configurable<int64_t> ccdbNoLaterThan{"ccdbNoLaterThan", 1, "latest acceptable timestamp of creation for the object"};
Configurable<float> minEta{"minEta", -4.0f, "Minimum eta in range"};
Configurable<float> maxEta{"maxEta", 4.0f, "Maximum eta in range"};
Configurable<float> maxDCA{"maxDCA", 0.0025f, "Max DCAxy and DCAz for counted tracks"};
Configurable<float> vtxZ{"vtxZ", 10.0f, "Max event vertex z position allowed"};
Configurable<int> minNumContrib{"minNumContrib", 1, "Minimum required number of primary vertex contributors"};
Configurable<std::string> ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
Configurable<std::string> ccdbPath{"ccdbPath", "Analysis/ALICE3/Centrality", "path to the ccdb object"};

ConfigurableAxis axisMult{"axisMult", {10000, 0, 10000}, "Reconstructed tracks"};
ConfigurableAxis axisCent{"axisCent", {150, 0, 150}, "Percentile"};

Filter trackFilter = (aod::track::eta >= minEta) && (aod::track::eta <= maxEta) && (nabs(aod::track::dcaXY) <= maxDCA) && (nabs(aod::track::dcaZ) <= maxDCA);

bool centralityLoaded = false;
TH1D* hCumMultALICE3 = nullptr;

void init(InitContext&)
{
const AxisSpec axisMult{MaxMult.value > 10000.f ? 10000 : (int)MaxMult, 0, MaxMult, "Reconstructed tracks"};
const AxisSpec axisCent{150, 0, 150, "Percentile"};
TString tit = Form("%.3f < #it{#eta} < %.3f", MinEta.value, MaxEta.value);
TString tit = Form("%.3f < #it{#eta} < %.3f", minEta.value, maxEta.value);
histos.add("centrality/numberOfTracks", tit, kTH1D, {axisMult});
histos.add("centrality/centralityDistribution", "Centrality test", kTH1D, {axisCent});

ccdb->setURL(url.value);
ccdb->setURL(ccdbUrl.value);
ccdb->setCaching(true);
ccdb->setLocalObjectValidityChecking();
}

int nevs = 0;
void process(const o2::aod::Collision& collision, const soa::Join<aod::Tracks, aod::TracksDCA>& tracks)
void process(const o2::aod::Collision& collision, const soa::Filtered<soa::Join<aod::Tracks, aod::TracksDCA>>& tracks)
{
if (!centralityLoaded) {
hCumMultALICE3 = ccdb->getForTimeStamp<TH1D>("Analysis/ALICE3/Centrality", 1);
hCumMultALICE3 = ccdb->getForTimeStamp<TH1D>(ccdbPath.value, ccdbNoLaterThan.value);
centralityLoaded = true;
LOGF(info, "ALICE 3 centrality calibration loaded!");
}

int nTracks = 0;
if (collision.numContrib() < 1) {
if (collision.numContrib() < minNumContrib.value) {
histos.fill(HIST("centrality/centralityDistribution"), 101);
cent(101);
return;
}
if (fabs(collision.posZ()) > 10) {
if (std::fabs(collision.posZ()) > vtxZ.value) {
histos.fill(HIST("centrality/centralityDistribution"), 102);
cent(102);
return;
}
for (const auto& track : tracks) {
if (track.eta() < MinEta || track.eta() > MaxEta) {
continue;
}
if (abs(track.dcaXY()) > MaxDCA || abs(track.dcaZ()) > MaxDCA) {
continue;
}
nTracks++;
}
LOG(info) << nevs++ << ") Event " << collision.globalIndex() << " has " << nTracks << " tracks";

const auto nTracks = tracks.size();
histos.fill(HIST("centrality/numberOfTracks"), nTracks);

float centALICE3 = hCumMultALICE3->GetBinContent(hCumMultALICE3->FindBin(nTracks));
Expand All @@ -103,5 +104,5 @@ struct ALICE3Centrality {

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{adaptAnalysisTask<ALICE3Centrality>(cfgc, TaskName{"alice3-centrality"})};
return WorkflowSpec{adaptAnalysisTask<Alice3Centrality>(cfgc)};
}
Loading