Skip to content
Merged
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
54 changes: 45 additions & 9 deletions Common/Tasks/centralityStudy.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/Tasks/centralityStudy.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -8,19 +8,23 @@
// 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/Tasks/centralityStudy.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/Tasks/centralityStudy.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/Tasks/centralityStudy.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.
// This task does dedicated centrality studies for understanding the
// Run 3 Pb-Pb centrality selections in 2023 data. It is compatible with
// derived data.

#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"
#include "Common/DataModel/McCollisionExtra.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/McCollisionExtra.h"
#include "Common/DataModel/Multiplicity.h"

#include "CCDB/BasicCCDBManager.h"
#include "DataFormatsParameters/GRPECSObject.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "Framework/runDataProcessing.h"

#include "TH1F.h"
#include "TH2F.h"

Expand All @@ -29,16 +33,18 @@

using BCsWithRun3Matchings = soa::Join<aod::BCs, aod::Timestamps, aod::Run3MatchedToBCSparse>;

struct centralityStudy {

Check failure on line 36 in Common/Tasks/centralityStudy.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/struct]

Use UpperCamelCase for names of structs.
// Raw multiplicities
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
Service<o2::ccdb::BasicCCDBManager> ccdb;

// Configurables
Configurable<bool> do2DPlots{"do2DPlots", true, "0 - no, 1 - yes"};
Configurable<bool> doOccupancyStudyVsCentrality2d{"doOccupancyStudyVsCentrality2d", true, "0 - no, 1 - yes"};
Configurable<bool> doOccupancyStudyVsRawValues2d{"doOccupancyStudyVsRawValues2d", true, "0 - no, 1 - yes"};
Configurable<bool> doOccupancyStudyVsCentrality3d{"doOccupancyStudyVsCentrality3d", false, "0 - no, 1 - yes"};
Configurable<bool> doOccupancyStudyVsRawValues3d{"doOccupancyStudyVsRawValues3d", false, "0 - no, 1 - yes"};
Configurable<bool> doTimeStudies{"doTimeStudies", false, "0 - no, 1 - yes"};
Configurable<bool> doNGlobalTracksVsRawSignals{"doNGlobalTracksVsRawSignals", true, "0 - no, 1 - yes"};
Configurable<bool> applySel8{"applySel8", true, "0 - no, 1 - yes"};
Configurable<bool> applyVtxZ{"applyVtxZ", true, "0 - no, 1 - yes"};
Expand Down Expand Up @@ -113,10 +119,10 @@
ConfigurableAxis axisCentrality{"axisCentrality", {100, 0, 100}, "FT0C percentile"};
ConfigurableAxis axisPVChi2{"axisPVChi2", {300, 0, 30}, "FT0C percentile"};
ConfigurableAxis axisDeltaTime{"axisDeltaTime", {300, 0, 300}, "#Delta time"};
ConfigurableAxis axisDeltaTimestamp{"axisDeltaTimestamp", {1440, 0, 24}, "#Delta timestamp - sor (hours)"};

// For profile Z
ConfigurableAxis axisPVz{"axisPVz", {400, -20.0f, +20.0f}, "PVz (cm)"};

ConfigurableAxis axisZN{"axisZN", {1100, -50.0f, +500.0f}, "ZN"};

void init(InitContext&)
Expand Down Expand Up @@ -227,6 +233,21 @@
histos.add("hFT0COccupancyVsNGlobalTracksVsCentrality", "hFT0COccupancyVsNGlobalTracksVsCentrality", kTH3F, {axisFT0COccupancy, axisMultGlobalTracks, axisCentrality});
}
}

if (doTimeStudies) {
ccdb->setURL("http://alice-ccdb.cern.ch");
ccdb->setCaching(true);
ccdb->setLocalObjectValidityChecking();
ccdb->setFatalWhenNull(false);

histos.add("hFT0AvsTime", "hFT0AvsTime", kTH2F, {axisDeltaTimestamp, axisMultFT0A});
histos.add("hFT0CvsTime", "hFT0CvsTime", kTH2F, {{axisDeltaTimestamp, axisMultFT0C}});
histos.add("hFT0MvsTime", "hFT0MvsTime", kTH2F, {{axisDeltaTimestamp, axisMultFT0M}});
histos.add("hFV0AvsTime", "hFV0AvsTime", kTH2F, {{axisDeltaTimestamp, axisMultFV0A}});
histos.add("hMFTTracksvsTime", "hMFTTracksvsTime", kTH2F, {{axisDeltaTimestamp, axisMultMFTTracks}});
histos.add("hNGlobalVsTime", "hNGlobalVsTime", kTH2F, {{axisDeltaTimestamp, axisMultGlobalTracks}});
histos.add("hNTPVContributorsvsTime", "hNTPVContributorsvsTime", kTH2F, {{axisDeltaTimestamp, axisMultPVContributors}});
}
}

template <typename TCollision>
Expand All @@ -238,7 +259,7 @@
if (applySel8 && !collision.multSel8())
return;
histos.fill(HIST("hCollisionSelection"), 1);
if (applyVtxZ && TMath::Abs(collision.multPVz()) > 10)

Check failure on line 262 in Common/Tasks/centralityStudy.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.

Check failure on line 262 in Common/Tasks/centralityStudy.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return;
histos.fill(HIST("hCollisionSelection"), 2);

Expand Down Expand Up @@ -281,7 +302,7 @@

// do this only if information is available
if constexpr (requires { collision.timeToNext(); }) {
float timeToNeighbour = TMath::Min(

Check failure on line 305 in Common/Tasks/centralityStudy.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
std::abs(collision.timeToNext()),
std::abs(collision.timeToPrevious()));
histos.fill(HIST("hDeltaTimeVsCentrality"), collision.centFT0C(), timeToNeighbour);
Expand Down Expand Up @@ -403,19 +424,34 @@
histos.fill(HIST("hFT0COccupancyVsNGlobalTracksVsCentrality"), collision.ft0cOccupancyInTimeRange(), collision.multNTracksGlobal(), collision.centFT0C());
}
}

if (doTimeStudies && collision.has_multBC()) {
auto multbc = collision.template multBC_as<aod::MultBCs>();
uint64_t bcTimestamp = multbc.timestamp();
o2::parameters::GRPECSObject* grpo = ccdb->getForTimeStamp<o2::parameters::GRPECSObject>("GLO/Config/GRPECS", bcTimestamp);
uint64_t startOfRunTimestamp = grpo->getTimeStart();
float hoursAfterStartOfRun = static_cast<float>(bcTimestamp - startOfRunTimestamp) / 3600000.0;
histos.fill(HIST("hFT0AvsTime"), hoursAfterStartOfRun, collision.multFT0A());
histos.fill(HIST("hFT0CvsTime"), hoursAfterStartOfRun, collision.multFT0C());
histos.fill(HIST("hFT0MvsTime"), hoursAfterStartOfRun, collision.multFT0M());
histos.fill(HIST("hFV0AvsTime"), hoursAfterStartOfRun, collision.multFV0A());
histos.fill(HIST("hMFTTracksvsTime"), hoursAfterStartOfRun, collision.mftNtracks());
histos.fill(HIST("hNGlobalVsTime"), hoursAfterStartOfRun, collision.multNTracksGlobal());
histos.fill(HIST("hNTPVContributorsvsTime"), hoursAfterStartOfRun, collision.multPVTotalContributors());
}
}

void processCollisions(soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultsGlobal, aod::MultSelections>::iterator const& collision)
void processCollisions(soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultsGlobal, aod::MultSelections, aod::Mults2BC>::iterator const& collision, aod::MultBCs const&)
{
genericProcessCollision(collision);
}

void processCollisionsWithCentrality(soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultSelections, aod::CentFT0Cs, aod::MultsGlobal>::iterator const& collision)
void processCollisionsWithCentrality(soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultSelections, aod::CentFT0Cs, aod::MultsGlobal, aod::Mults2BC>::iterator const& collision, aod::MultBCs const&)
{
genericProcessCollision(collision);
}

void processCollisionsWithCentralityWithNeighbours(soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultSelections, aod::CentFT0Cs, aod::MultsGlobal, aod::MultNeighs>::iterator const& collision)
void processCollisionsWithCentralityWithNeighbours(soa::Join<aod::Mults, aod::MFTMults, aod::MultsExtra, aod::MultSelections, aod::CentFT0Cs, aod::MultsGlobal, aod::MultNeighs, aod::Mults2BC>::iterator const& collision, aod::MultBCs const&)
{
genericProcessCollision(collision);
}
Expand All @@ -434,10 +470,10 @@
if (selectFV0OrA && !multbc.multFV0OrA())
return;
histos.fill(HIST("hBCSelection"), 3); // FV0OrA
if (vertexZwithT0 < 100.0f) {

Check failure on line 473 in Common/Tasks/centralityStudy.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 (!multbc.multFT0PosZValid())
return;
if (TMath::Abs(multbc.multFT0PosZ()) > vertexZwithT0)

Check failure on line 476 in Common/Tasks/centralityStudy.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return;
}
histos.fill(HIST("hBCSelection"), 4); // FV0OrA
Expand Down
Loading