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
57 changes: 57 additions & 0 deletions Common/DataModel/SelectionStudyTables.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in Common/DataModel/SelectionStudyTables.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.
//
// 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.

/// \file SelectionStudyTables
/// \brief tables meant to do event selection studies for O-O / light systems
///
/// \author ALICE

Check failure on line 15 in Common/DataModel/SelectionStudyTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

#include "Framework/ASoA.h"
#include "Framework/AnalysisDataModel.h"

#include <vector>

#ifndef COMMON_DATAMODEL_SELECTIONSTUDYTABLES_H_
#define COMMON_DATAMODEL_SELECTIONSTUDYTABLES_H_

namespace o2::aod
{
namespace selectionstudy
{
DECLARE_SOA_COLUMN(PtPions, ptPions, std::vector<float>);
DECLARE_SOA_COLUMN(PtKaons, ptKaons, std::vector<float>);
DECLARE_SOA_COLUMN(PtProtons, ptProtons, std::vector<float>);
DECLARE_SOA_COLUMN(PtK0s, ptPK0s, std::vector<float>);

Check failure on line 32 in Common/DataModel/SelectionStudyTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(PtLambdas, ptLambdas, std::vector<float>);
DECLARE_SOA_COLUMN(PtXis, ptXis, std::vector<float>);
DECLARE_SOA_COLUMN(PtOmegas, ptOmegas, std::vector<float>);
DECLARE_SOA_COLUMN(PtPhis, ptPhis, std::vector<float>);
DECLARE_SOA_COLUMN(PtKStars, ptKStars, std::vector<float>);
DECLARE_SOA_COLUMN(PtDs, ptDs, std::vector<float>);
DECLARE_SOA_COLUMN(PtLambdaCs, ptLambdaCs, std::vector<float>);
DECLARE_SOA_COLUMN(PtJPsis, ptJPsis, std::vector<float>);
} // namespace selectionstudy

DECLARE_SOA_TABLE(PIDPts, "AOD", "PIDPTS", o2::soa::Index<>,
o2::aod::selectionstudy::PtPions,
o2::aod::selectionstudy::PtKaons,
o2::aod::selectionstudy::PtProtons,
o2::aod::selectionstudy::PtK0s,
o2::aod::selectionstudy::PtLambdas,
o2::aod::selectionstudy::PtXis,
o2::aod::selectionstudy::PtOmegas,
o2::aod::selectionstudy::PtPhis,
o2::aod::selectionstudy::PtKStars,
o2::aod::selectionstudy::PtDs,
o2::aod::selectionstudy::PtLambdaCs,
o2::aod::selectionstudy::PtJPsis);
} // namespace o2::aod
#endif // COMMON_DATAMODEL_SELECTIONSTUDYTABLES_H_
4 changes: 4 additions & 0 deletions Common/TableProducer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(multcenttable

Check failure on line 35 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name multcenttable does not match its file name multCentTable.cxx. (Matches multcenttable.cxx.)
SOURCES multCentTable.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand Down Expand Up @@ -77,7 +77,7 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::trackSelectionRequest
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(calo-clusters

Check failure on line 80 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name calo-clusters does not match its file name caloClusterProducer.cxx. (Matches caloClusters.cxx.)
SOURCES caloClusterProducer.cxx
PUBLIC_LINK_LIBRARIES O2::DataFormatsPHOS O2::PHOSBase O2::PHOSReconstruction O2Physics::DataModel
COMPONENT_NAME Analysis)
Expand All @@ -100,12 +100,12 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(mccollisionextra

Check failure on line 103 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name mccollisionextra does not match its file name mcCollsExtra.cxx. (Matches mccollisionextra.cxx.)
SOURCES mcCollsExtra.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(qvector-table

Check failure on line 108 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name qvector-table does not match its file name qVectorsTable.cxx. (Matches qvectorTable.cxx.)
SOURCES qVectorsTable.cxx
PUBLIC_LINK_LIBRARIES O2::Framework
O2Physics::AnalysisCore
Expand All @@ -114,7 +114,7 @@
O2::CCDB
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(mftmchmatchingml

Check failure on line 117 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name mftmchmatchingml does not match its file name mftmchMatchingML.cxx. (Matches mftmchmatchingml.cxx.)
SOURCES mftmchMatchingML.cxx
PUBLIC_LINK_LIBRARIES O2::Framework
O2Physics::AnalysisCore
Expand All @@ -123,7 +123,7 @@
O2::ReconstructionDataFormats
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(match-mft-ft0

Check failure on line 126 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name match-mft-ft0 does not match its file name match-mft-ft0.cxx. (Matches matchMftFt0.cxx.)
SOURCES match-mft-ft0.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
O2::ReconstructionDataFormats
Expand All @@ -140,7 +140,7 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(mftmch-matching-data

Check failure on line 143 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name mftmch-matching-data does not match its file name match-mft-mch-data.cxx. (Matches mftmchMatchingData.cxx.)
SOURCES match-mft-mch-data.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::GlobalTracking
COMPONENT_NAME Analysis)
Expand All @@ -160,3 +160,7 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2::DetectorsCommonDataFormats O2::MathUtils O2::MCHTracking O2::DataFormatsMCH O2::GlobalTracking O2::MCHBase O2::MCHGeometryTransformer O2::CommonUtils
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(selectionstudytable
SOURCES selectionStudyTable.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
133 changes: 133 additions & 0 deletions Common/TableProducer/selectionStudyTable.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
// 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.
//
/// \file selectionStudyTable.cxx
/// \brief Produces tables for centrality selection bias studies
///
/// \author ALICE
///

#include "Common/DataModel/SelectionStudyTables.h"

#include "Framework/ASoAHelpers.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/ConfigParamSpec.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "Framework/runDataProcessing.h"

#include <algorithm>
#include <map>
#include <string>
#include <vector>

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

struct SelectionStudyTable {
Produces<aod::PIDPts> pidpts;

// could be done in a vector of vectors
// left for future iteration
std::vector<float> ptpi;
std::vector<float> ptka;
std::vector<float> ptpr;
std::vector<float> ptk0;
std::vector<float> ptla;
std::vector<float> ptxi;
std::vector<float> ptom;
std::vector<float> ptph;
std::vector<float> ptks;
std::vector<float> ptd;
std::vector<float> ptlc;
std::vector<float> ptjp;

void init(InitContext&)
{
}

void process(aod::McCollision const&, aod::McParticles const& mcParticles)
{
ptpi.clear();
ptka.clear();
ptpr.clear();
ptk0.clear();
ptla.clear();
ptxi.clear();
ptom.clear();
ptph.clear();
ptks.clear();
ptd.clear();
ptlc.clear();
ptjp.clear();
for (auto const& mcPart : mcParticles) {
if (std::fabs(mcPart.y()) > 0.5) {
continue; // only do midrapidity particles
}

// handle resonances first to make sure phys prim crit does not reject them
if (mcPart.pdgCode() == 333) {
ptph.push_back(mcPart.pt());
}
if (std::abs(mcPart.pdgCode()) == 313) {
ptks.push_back(mcPart.pt());
}

// resonances handled, move to primaries
if (!mcPart.isPhysicalPrimary()) {
continue;
}
if (std::abs(mcPart.pdgCode()) == 211) {
ptpi.push_back(mcPart.pt());
}
if (std::abs(mcPart.pdgCode()) == 321) {
ptka.push_back(mcPart.pt());
}
if (std::abs(mcPart.pdgCode()) == 2212) {
ptpr.push_back(mcPart.pt());
}
if (std::abs(mcPart.pdgCode()) == 310) {
ptk0.push_back(mcPart.pt());
}
if (std::abs(mcPart.pdgCode()) == 3122) {
ptla.push_back(mcPart.pt());
}
if (std::abs(mcPart.pdgCode()) == 3312) {
ptxi.push_back(mcPart.pt());
}
if (std::abs(mcPart.pdgCode()) == 3334) {
ptom.push_back(mcPart.pt());
}
if (std::abs(mcPart.pdgCode()) == 3334) {
ptom.push_back(mcPart.pt());
}
// inclusive HF for now
if (std::abs(mcPart.pdgCode()) == 421) {
ptd.push_back(mcPart.pt());
}
if (std::abs(mcPart.pdgCode()) == 4122) {
ptd.push_back(mcPart.pt());
}
if (std::abs(mcPart.pdgCode()) == 443) {
ptjp.push_back(mcPart.pt());
}
}

pidpts(ptpi, ptka, ptpr, ptk0, ptla, ptxi, ptom, ptph, ptks, ptd, ptlc, ptjp);
}
};

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