Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Common] QA developments, cent work for more estimators #8999

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
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
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check warning on line 1 in Common/DataModel/Centrality.h

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,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.
#ifndef COMMON_DATAMODEL_CENTRALITY_H_

Check warning on line 11 in Common/DataModel/Centrality.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

Check warning on line 11 in Common/DataModel/Centrality.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check warning on line 11 in Common/DataModel/Centrality.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.
#define COMMON_DATAMODEL_CENTRALITY_H_

#include "Framework/AnalysisDataModel.h"
Expand All @@ -17,53 +17,71 @@
{
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) {

Check warning on line 77 in Common/DataModel/Centrality.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
{ t.centRun2V0M() };
{ t.centRun2CL0() };
{ t.centRun2CL1() };
};

template <typename T>
concept HasCentrality = requires(T&& t) {

Check warning on line 84 in Common/DataModel/Centrality.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
{ t.centFV0A() };
{ t.centFT0M() };
{ t.centFT0A() };
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.

Check warning on line 1 in Common/LegacyDataQA/centqa.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.
//
// 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.
//

Check warning on line 11 in Common/LegacyDataQA/centqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

Check warning on line 11 in Common/LegacyDataQA/centqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check warning on line 11 in Common/LegacyDataQA/centqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.
// 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:
// - victor.gonzalez@cern.ch
// - david.dobrigkeit.chinellato@cern.ch
//

#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:
// - victor.gonzalez@cern.ch
// - david.dobrigkeit.chinellato@cern.ch
//

#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& col, 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