Skip to content

Commit

Permalink
Merge branch 'AliceO2Group:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Archita-Dash authored Dec 23, 2024
2 parents e582fa6 + 916dd1d commit 4c24236
Show file tree
Hide file tree
Showing 58 changed files with 3,489 additions and 937 deletions.
1 change: 1 addition & 0 deletions Common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ add_subdirectory(CCDB)
add_subdirectory(Tasks)
add_subdirectory(TableProducer)
add_subdirectory(Tools)
add_subdirectory(LegacyDataQA)
66 changes: 42 additions & 24 deletions Common/DataModel/Centrality.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,61 @@ namespace o2::aod
{
namespace cent
{
DECLARE_SOA_COLUMN(CentRun2V0M, centRun2V0M, float); //! Run2 Centrality percentile estimated from V0C+V0A multiplicities
DECLARE_SOA_COLUMN(CentRun2V0A, centRun2V0A, float); //! Run2 Centrality percentile estimated from V0A multiplicities
DECLARE_SOA_COLUMN(CentRun2SPDTracklets, centRun2SPDTracklets, float); //! Run2 centrality percentile estimated from SPD tracklets multiplicity
DECLARE_SOA_COLUMN(CentRun2SPDClusters, centRun2SPDClusters, float); //! Run2 centrality percentile estimated from SPD clusters multiplicity
DECLARE_SOA_COLUMN(CentRun2CL0, centRun2CL0, float); //! Run2 centrality percentile estimated from CL0 multiplicity
DECLARE_SOA_COLUMN(CentRun2CL1, centRun2CL1, float); //! Run2 centrality percentile estimated from CL1 multiplicity
DECLARE_SOA_COLUMN(CentFV0A, centFV0A, float); //! Run3 Centrality percentile estimated from FV0A multiplicities
DECLARE_SOA_COLUMN(CentFT0M, centFT0M, float); //! Run3 centrality percentile estimated from FT0A+FT0C multiplicities
DECLARE_SOA_COLUMN(CentFT0A, centFT0A, float); //! Run3 centrality percentile estimated from FT0A multiplicity
DECLARE_SOA_COLUMN(CentFT0C, centFT0C, float); //! Run3 centrality percentile estimated from FT0C multiplicity
DECLARE_SOA_COLUMN(CentFDDM, centFDDM, float); //! Run3 centrality percentile estimated from FDDA+FDDC multiplicity
DECLARE_SOA_COLUMN(CentNTPV, centNTPV, float); //! Run3 centrality percentile estimated from the number of tracks contributing to the PV
DECLARE_SOA_COLUMN(CentRun2V0M, centRun2V0M, float); //! Run 2 cent. from V0C+V0A multiplicities
DECLARE_SOA_COLUMN(CentRun2V0A, centRun2V0A, float); //! Run 2 cent. from V0A multiplicities
DECLARE_SOA_COLUMN(CentRun2SPDTracklets, centRun2SPDTracklets, float); //! Run 2 cent. from SPD tracklets multiplicity
DECLARE_SOA_COLUMN(CentRun2SPDClusters, centRun2SPDClusters, float); //! Run 2 cent. from SPD clusters multiplicity
DECLARE_SOA_COLUMN(CentRun2CL0, centRun2CL0, float); //! Run 2 cent. from CL0 multiplicity
DECLARE_SOA_COLUMN(CentRun2CL1, centRun2CL1, float); //! Run 2 cent. from CL1 multiplicity
DECLARE_SOA_COLUMN(CentRun2RefMult5, centRun2RefMult5, float); //! Run 2 cent. from ref. mult. estimator, eta 0.5
DECLARE_SOA_COLUMN(CentRun2RefMult8, centRun2RefMult8, float); //! Run 2 cent. from ref. mult. estimator, eta 0.8

DECLARE_SOA_COLUMN(CentFV0A, centFV0A, float); //! Run 3 cent. from FV0A multiplicities
DECLARE_SOA_COLUMN(CentFT0M, centFT0M, float); //! Run 3 cent. from FT0A+FT0C multiplicities
DECLARE_SOA_COLUMN(CentFT0A, centFT0A, float); //! Run 3 cent. from FT0A multiplicity
DECLARE_SOA_COLUMN(CentFT0C, centFT0C, float); //! Run 3 cent. from FT0C multiplicity
DECLARE_SOA_COLUMN(CentFDDM, centFDDM, float); //! Run 3 cent. from FDDA+FDDC multiplicity
DECLARE_SOA_COLUMN(CentNTPV, centNTPV, float); //! Run 3 cent. from the number of tracks contributing to the
DECLARE_SOA_COLUMN(CentNGlobal, centNGlobal, float); //! Run 3 cent. from the number of tracks contributing to the PV
DECLARE_SOA_COLUMN(CentMFT, centMFT, float); //! Run 3 cent. from the number of tracks in the MFT
} // namespace cent
DECLARE_SOA_TABLE(CentRun2V0Ms, "AOD", "CENTRUN2V0M", cent::CentRun2V0M); //! Run2 V0M estimated centrality table
DECLARE_SOA_TABLE(CentRun2V0As, "AOD", "CENTRUN2V0A", cent::CentRun2V0A); //! Run2 V0A estimated centrality table
DECLARE_SOA_TABLE(CentRun2SPDTrks, "AOD", "CENTRUN2SPDTRK", cent::CentRun2SPDTracklets); //! Run2 SPD tracklets estimated centrality table
DECLARE_SOA_TABLE(CentRun2SPDClss, "AOD", "CENTRUN2SPDCLS", cent::CentRun2SPDClusters); //! Run2 SPD clusters estimated centrality table
DECLARE_SOA_TABLE(CentRun2CL0s, "AOD", "CENTRUN2CL0", cent::CentRun2CL0); //! Run2 CL0 estimated centrality table
DECLARE_SOA_TABLE(CentRun2CL1s, "AOD", "CENTRUN2CL1", cent::CentRun2CL1); //! Run2 CL1 estimated centrality table
DECLARE_SOA_TABLE(CentFV0As, "AOD", "CENTFV0A", cent::CentFV0A); //! Run3 FV0A estimated centrality table
DECLARE_SOA_TABLE(CentFT0Ms, "AOD", "CENTFT0M", cent::CentFT0M); //! Run3 FT0M estimated centrality table
DECLARE_SOA_TABLE(CentFT0As, "AOD", "CENTFT0A", cent::CentFT0A); //! Run3 FT0A estimated centrality table
DECLARE_SOA_TABLE(CentFT0Cs, "AOD", "CENTFT0C", cent::CentFT0C); //! Run3 FT0C estimated centrality table
DECLARE_SOA_TABLE(CentFDDMs, "AOD", "CENTFDDM", cent::CentFDDM); //! Run3 FDDM estimated centrality table
DECLARE_SOA_TABLE(CentNTPVs, "AOD", "CENTNTPV", cent::CentNTPV); //! Run3 NTPV estimated centrality table

// Run 2 tables
DECLARE_SOA_TABLE(CentRun2V0Ms, "AOD", "CENTRUN2V0M", cent::CentRun2V0M); //! Run 2 V0M centrality table
DECLARE_SOA_TABLE(CentRun2V0As, "AOD", "CENTRUN2V0A", cent::CentRun2V0A); //! Run 2 V0A centrality table
DECLARE_SOA_TABLE(CentRun2SPDTrks, "AOD", "CENTRUN2SPDTRK", cent::CentRun2SPDTracklets); //! Run 2 SPD tracklets centrality table
DECLARE_SOA_TABLE(CentRun2SPDClss, "AOD", "CENTRUN2SPDCLS", cent::CentRun2SPDClusters); //! Run 2 SPD clusters centrality table
DECLARE_SOA_TABLE(CentRun2CL0s, "AOD", "CENTRUN2CL0", cent::CentRun2CL0); //! Run 2 CL0 centrality table
DECLARE_SOA_TABLE(CentRun2CL1s, "AOD", "CENTRUN2CL1", cent::CentRun2CL1); //! Run 2 CL1 centrality table
DECLARE_SOA_TABLE(CentRun2RefMult5s, "AOD", "CENTRUN2REFMULT5", cent::CentRun2RefMult5); //! Run 2, ref mult |eta| < 0.5
DECLARE_SOA_TABLE(CentRun2RefMult8s, "AOD", "CENTRUN2REFMULT8", cent::CentRun2RefMult8); //! Run 2, ref mult |eta| < 0.8

// Run 3 tables
DECLARE_SOA_TABLE(CentFV0As, "AOD", "CENTFV0A", cent::CentFV0A); //! Run 3 FV0A centrality table
DECLARE_SOA_TABLE(CentFT0Ms, "AOD", "CENTFT0M", cent::CentFT0M); //! Run 3 FT0M centrality table
DECLARE_SOA_TABLE(CentFT0As, "AOD", "CENTFT0A", cent::CentFT0A); //! Run 3 FT0A centrality table
DECLARE_SOA_TABLE(CentFT0Cs, "AOD", "CENTFT0C", cent::CentFT0C); //! Run 3 FT0C centrality table
DECLARE_SOA_TABLE(CentFDDMs, "AOD", "CENTFDDM", cent::CentFDDM); //! Run 3 FDDM centrality table
DECLARE_SOA_TABLE(CentNTPVs, "AOD", "CENTNTPV", cent::CentNTPV); //! Run 3 NTPV centrality table
DECLARE_SOA_TABLE(CentNGlobals, "AOD", "CENTNGLOBAL", cent::CentNGlobal); //! Run 3 NGlobal centrality table
DECLARE_SOA_TABLE(CentMFTs, "AOD", "CENTMFT", cent::CentMFT); //! Run 3 MFT tracks centrality table

using CentRun2V0M = CentRun2V0Ms::iterator;
using CentRun2V0A = CentRun2V0As::iterator;
using CentRun2SPDTrk = CentRun2SPDTrks::iterator;
using CentRun2SPDCls = CentRun2SPDClss::iterator;
using CentRun2CL0 = CentRun2CL0s::iterator;
using CentRun2CL1 = CentRun2CL1s::iterator;
using CentRun2RefMult5 = CentRun2RefMult5s::iterator;
using CentRun2RefMult8 = CentRun2RefMult8s::iterator;
using CentFV0A = CentFV0As::iterator;
using CentFT0M = CentFT0Ms::iterator;
using CentFT0A = CentFT0As::iterator;
using CentFT0C = CentFT0Cs::iterator;
using CentFDDM = CentFDDMs::iterator;
using CentNTPV = CentNTPVs::iterator;
using CentNGlobal = CentNGlobals::iterator;
using CentMFT = CentMFTs::iterator;

template <typename T>
concept HasRun2Centrality = requires(T&& t) {
Expand Down
46 changes: 28 additions & 18 deletions Common/DataModel/PIDResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ template <class T>
using hasTPCAl = decltype(std::declval<T&>().tpcNSigmaAl());

// PID index as template argument
#define perSpeciesWrapper(functionName) \
#define PER_SPECIES_WRAPPER(functionName) \
template <o2::track::PID::ID index, typename TrackType> \
auto functionName(const TrackType& track) \
{ \
Expand All @@ -119,8 +119,8 @@ using hasTPCAl = decltype(std::declval<T&>().tpcNSigmaAl());
} \
}

perSpeciesWrapper(tofNSigma);
perSpeciesWrapper(tofExpSigma);
PER_SPECIES_WRAPPER(tofNSigma);
PER_SPECIES_WRAPPER(tofExpSigma);
template <o2::track::PID::ID index, typename TrackType>
auto tofExpSignal(const TrackType& track)
{
Expand All @@ -144,10 +144,10 @@ auto tofExpSignal(const TrackType& track)
return track.tofExpSignalAl(track.tofSignal());
}
}
perSpeciesWrapper(tofExpSignalDiff);
PER_SPECIES_WRAPPER(tofExpSignalDiff);

perSpeciesWrapper(tpcNSigma);
perSpeciesWrapper(tpcExpSigma);
PER_SPECIES_WRAPPER(tpcNSigma);
PER_SPECIES_WRAPPER(tpcExpSigma);
template <o2::track::PID::ID index, typename TrackType>
auto tpcExpSignal(const TrackType& track)
{
Expand All @@ -171,12 +171,12 @@ auto tpcExpSignal(const TrackType& track)
return track.tpcExpSignalAl(track.tpcSignal());
}
}
perSpeciesWrapper(tpcExpSignalDiff);
PER_SPECIES_WRAPPER(tpcExpSignalDiff);

#undef perSpeciesWrapper
#undef PER_SPECIES_WRAPPER

// PID index as function argument for TOF
#define perSpeciesWrapper(functionName) \
#define PER_SPECIES_WRAPPER(functionName) \
template <typename TrackType> \
auto functionName(const o2::track::PID::ID index, const TrackType& track) \
{ \
Expand Down Expand Up @@ -223,8 +223,8 @@ perSpeciesWrapper(tpcExpSignalDiff);
} \
}

perSpeciesWrapper(tofNSigma);
perSpeciesWrapper(tofExpSigma);
PER_SPECIES_WRAPPER(tofNSigma);
PER_SPECIES_WRAPPER(tofExpSigma);
template <typename TrackType>
auto tofExpSignal(const o2::track::PID::ID index, const TrackType& track)
{
Expand Down Expand Up @@ -270,12 +270,12 @@ auto tofExpSignal(const o2::track::PID::ID index, const TrackType& track)
return 0.f;
}
}
perSpeciesWrapper(tofExpSignalDiff);
PER_SPECIES_WRAPPER(tofExpSignalDiff);

#undef perSpeciesWrapper
#undef PER_SPECIES_WRAPPER

// PID index as function argument for TPC
#define perSpeciesWrapper(functionName) \
#define PER_SPECIES_WRAPPER(functionName) \
template <typename TrackType> \
auto functionName(const o2::track::PID::ID index, const TrackType& track) \
{ \
Expand Down Expand Up @@ -322,8 +322,8 @@ perSpeciesWrapper(tofExpSignalDiff);
} \
}

perSpeciesWrapper(tpcNSigma);
perSpeciesWrapper(tpcExpSigma);
PER_SPECIES_WRAPPER(tpcNSigma);
PER_SPECIES_WRAPPER(tpcExpSigma);
template <typename TrackType>
auto tpcExpSignal(const o2::track::PID::ID index, const TrackType& track)
{
Expand Down Expand Up @@ -369,9 +369,9 @@ auto tpcExpSignal(const o2::track::PID::ID index, const TrackType& track)
return 0.f;
}
}
perSpeciesWrapper(tpcExpSignalDiff);
PER_SPECIES_WRAPPER(tpcExpSignalDiff);

#undef perSpeciesWrapper
#undef PER_SPECIES_WRAPPER

} // namespace pidutils

Expand Down Expand Up @@ -409,6 +409,12 @@ DECLARE_SOA_DYNAMIC_COLUMN(EventCollisionTime, eventCollisionTime, //! Event col

} // namespace pidtofsignal

namespace pidtofevtime
{
DECLARE_SOA_COLUMN(TOFEvTime, tofEvTime, float); //! event time for TOF signal. Can be obtained via a combination of detectors e.g. TOF, FT0A, FT0C
DECLARE_SOA_COLUMN(TOFEvTimeErr, tofEvTimeErr, float); //! event time error for TOF. Can be obtained via a combination of detectors e.g. TOF, FT0A, FT0C
} // namespace pidtofevtime

namespace pidtofbeta
{
DECLARE_SOA_COLUMN(Beta, beta, float); //! TOF beta
Expand Down Expand Up @@ -534,6 +540,10 @@ DECLARE_SOA_TABLE(TOFSignal, "AOD", "TOFSignal", //! Table of the TOF signal
pidtofsignal::TOFSignal,
pidtofsignal::EventCollisionTime<pidtofsignal::TOFSignal>);

DECLARE_SOA_TABLE(TOFEvTime, "AOD", "TOFEvTime", //! Table of the TOF event time. One entry per track.
pidtofevtime::TOFEvTime,
pidtofevtime::TOFEvTimeErr);

DECLARE_SOA_TABLE(pidTOFFlags, "AOD", "pidTOFFlags", //! Table of the flags for TOF signal quality on the track level
pidflags::GoodTOFMatch);

Expand Down
20 changes: 20 additions & 0 deletions Common/LegacyDataQA/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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.

o2physics_add_dpl_workflow(otfv0qa
SOURCES otfv0qa.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(centqa
SOURCES centqa.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
92 changes: 92 additions & 0 deletions Common/LegacyDataQA/centqa.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// 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 code calculates output histograms for centrality calibration
// as well as vertex-Z dependencies of raw variables (either for calibration
// of vtx-Z dependencies or for the calibration of those).
//
// This task is not strictly necessary in a typical analysis workflow,
// except for centrality calibration! The necessary task is the multiplicity
// tables.
//
// Comments, suggestions, questions? Please write to:
// - [email protected]
// - [email protected]
//

#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"
#include "Common/DataModel/McCollisionExtra.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "TH1F.h"
#include "TH2F.h"

using namespace o2;
using namespace o2::framework;

struct CentQA {
// Raw multiplicities
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};

void init(InitContext&)
{
const AxisSpec axisCentrality{205, 0, 205, "centrality"};

// Base histograms
histos.add("hV0M", "V0M centrality", kTH1F, {axisCentrality});
histos.add("hV0A", "V0A centrality", kTH1F, {axisCentrality});
histos.add("hCL0", "CL0 centrality", kTH1F, {axisCentrality});
histos.add("hCL1", "CL1 centrality", kTH1F, {axisCentrality});
histos.add("hRefMult5", "RefMult .5 centrality", kTH1F, {axisCentrality});
histos.add("hRefMult8", "RefMult .8 centrality", kTH1F, {axisCentrality});
}

void processV0M(soa::Join<aod::Collisions, aod::CentRun2V0Ms>::iterator const& col)
{
histos.fill(HIST("hV0M"), col.centRun2V0M());
}
void processV0A(soa::Join<aod::Collisions, aod::CentRun2V0As>::iterator const& col)
{
histos.fill(HIST("hV0A"), col.centRun2V0A());
}
void processCL0(soa::Join<aod::Collisions, aod::CentRun2CL0s>::iterator const& col)
{
histos.fill(HIST("hCL0"), col.centRun2CL0());
}
void processCL1(soa::Join<aod::Collisions, aod::CentRun2CL1s>::iterator const& col)
{
histos.fill(HIST("hCL1"), col.centRun2CL1());
}
void processRefMult5(soa::Join<aod::Collisions, aod::CentRun2RefMult5s>::iterator const& col)
{
histos.fill(HIST("hRefMult5"), col.centRun2RefMult5());
}
void processRefMult8(soa::Join<aod::Collisions, aod::CentRun2RefMult8s>::iterator const& col)
{
histos.fill(HIST("hRefMult8"), col.centRun2RefMult8());
}

PROCESS_SWITCH(CentQA, processV0M, "QA V0M centrality", true);
PROCESS_SWITCH(CentQA, processV0A, "QA V0A centrality", false);
PROCESS_SWITCH(CentQA, processCL0, "QA CL0 centrality", false);
PROCESS_SWITCH(CentQA, processCL1, "QA CL1 centrality", false);
PROCESS_SWITCH(CentQA, processRefMult5, "QA RefMult5 centrality", false);
PROCESS_SWITCH(CentQA, processRefMult8, "QA RefMult8 centrality", false);
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<CentQA>(cfgc)};
}
63 changes: 63 additions & 0 deletions Common/LegacyDataQA/otfv0qa.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// 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 code calculates output histograms for centrality calibration
// as well as vertex-Z dependencies of raw variables (either for calibration
// of vtx-Z dependencies or for the calibration of those).
//
// This task is not strictly necessary in a typical analysis workflow,
// except for centrality calibration! The necessary task is the multiplicity
// tables.
//
// Comments, suggestions, questions? Please write to:
// - [email protected]
// - [email protected]
//

#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/EventSelection.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "TH1F.h"
#include "TH2F.h"

using namespace o2;
using namespace o2::framework;

struct OTFV0Qa {
// Raw multiplicities
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};

void init(InitContext&)
{
const AxisSpec axisEvent{10, 0, 10, "Event counter"};
const AxisSpec axisNCandidates{500, 0, 500, "Number of OTF v0s"};

// Base histograms
histos.add("hEventCounter", "Event counter", kTH1F, {axisEvent});
histos.add("hCandidates", "Number of OTF V0s", kTH1F, {axisNCandidates});
}

void process(aod::Collision const&, aod::Run2OTFV0s const& v0s)
{
histos.fill(HIST("hEventCounter"), 0.5);
histos.fill(HIST("hCandidates"), v0s.size());
}
};

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

0 comments on commit 4c24236

Please sign in to comment.