Skip to content

Commit e39b3af

Browse files
ddobrigkalibuild
andauthored
[Common] Add files for derived data analysis of sel. bias study (#11713)
Co-authored-by: ALICE Builder <alibuild@users.noreply.github.com>
1 parent 74ff42c commit e39b3af

File tree

3 files changed

+194
-0
lines changed

3 files changed

+194
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
/// \file SelectionStudyTables
13+
/// \brief tables meant to do event selection studies for O-O / light systems
14+
///
15+
/// \author ALICE
16+
17+
#include "Framework/ASoA.h"
18+
#include "Framework/AnalysisDataModel.h"
19+
20+
#include <vector>
21+
22+
#ifndef COMMON_DATAMODEL_SELECTIONSTUDYTABLES_H_
23+
#define COMMON_DATAMODEL_SELECTIONSTUDYTABLES_H_
24+
25+
namespace o2::aod
26+
{
27+
namespace selectionstudy
28+
{
29+
DECLARE_SOA_COLUMN(PtPions, ptPions, std::vector<float>);
30+
DECLARE_SOA_COLUMN(PtKaons, ptKaons, std::vector<float>);
31+
DECLARE_SOA_COLUMN(PtProtons, ptProtons, std::vector<float>);
32+
DECLARE_SOA_COLUMN(PtK0s, ptPK0s, std::vector<float>);
33+
DECLARE_SOA_COLUMN(PtLambdas, ptLambdas, std::vector<float>);
34+
DECLARE_SOA_COLUMN(PtXis, ptXis, std::vector<float>);
35+
DECLARE_SOA_COLUMN(PtOmegas, ptOmegas, std::vector<float>);
36+
DECLARE_SOA_COLUMN(PtPhis, ptPhis, std::vector<float>);
37+
DECLARE_SOA_COLUMN(PtKStars, ptKStars, std::vector<float>);
38+
DECLARE_SOA_COLUMN(PtDs, ptDs, std::vector<float>);
39+
DECLARE_SOA_COLUMN(PtLambdaCs, ptLambdaCs, std::vector<float>);
40+
DECLARE_SOA_COLUMN(PtJPsis, ptJPsis, std::vector<float>);
41+
} // namespace selectionstudy
42+
43+
DECLARE_SOA_TABLE(PIDPts, "AOD", "PIDPTS", o2::soa::Index<>,
44+
o2::aod::selectionstudy::PtPions,
45+
o2::aod::selectionstudy::PtKaons,
46+
o2::aod::selectionstudy::PtProtons,
47+
o2::aod::selectionstudy::PtK0s,
48+
o2::aod::selectionstudy::PtLambdas,
49+
o2::aod::selectionstudy::PtXis,
50+
o2::aod::selectionstudy::PtOmegas,
51+
o2::aod::selectionstudy::PtPhis,
52+
o2::aod::selectionstudy::PtKStars,
53+
o2::aod::selectionstudy::PtDs,
54+
o2::aod::selectionstudy::PtLambdaCs,
55+
o2::aod::selectionstudy::PtJPsis);
56+
} // namespace o2::aod
57+
#endif // COMMON_DATAMODEL_SELECTIONSTUDYTABLES_H_

Common/TableProducer/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,7 @@ o2physics_add_dpl_workflow(muon-realignment
160160
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
161161
COMPONENT_NAME Analysis)
162162

163+
o2physics_add_dpl_workflow(selectionstudytable
164+
SOURCES selectionStudyTable.cxx
165+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
166+
COMPONENT_NAME Analysis)
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
//
12+
/// \file selectionStudyTable.cxx
13+
/// \brief Produces tables for centrality selection bias studies
14+
///
15+
/// \author ALICE
16+
///
17+
18+
#include "Common/DataModel/SelectionStudyTables.h"
19+
20+
#include "Framework/ASoAHelpers.h"
21+
#include "Framework/AnalysisDataModel.h"
22+
#include "Framework/AnalysisTask.h"
23+
#include "Framework/ConfigParamSpec.h"
24+
#include "Framework/HistogramRegistry.h"
25+
#include "Framework/O2DatabasePDGPlugin.h"
26+
#include "Framework/runDataProcessing.h"
27+
28+
#include <algorithm>
29+
#include <map>
30+
#include <string>
31+
#include <vector>
32+
33+
using namespace o2;
34+
using namespace o2::framework;
35+
using namespace o2::framework::expressions;
36+
37+
struct SelectionStudyTable {
38+
Produces<aod::PIDPts> pidpts;
39+
40+
// could be done in a vector of vectors
41+
// left for future iteration
42+
std::vector<float> ptpi;
43+
std::vector<float> ptka;
44+
std::vector<float> ptpr;
45+
std::vector<float> ptk0;
46+
std::vector<float> ptla;
47+
std::vector<float> ptxi;
48+
std::vector<float> ptom;
49+
std::vector<float> ptph;
50+
std::vector<float> ptks;
51+
std::vector<float> ptd;
52+
std::vector<float> ptlc;
53+
std::vector<float> ptjp;
54+
55+
void init(InitContext&)
56+
{
57+
}
58+
59+
void process(aod::McCollision const&, aod::McParticles const& mcParticles)
60+
{
61+
ptpi.clear();
62+
ptka.clear();
63+
ptpr.clear();
64+
ptk0.clear();
65+
ptla.clear();
66+
ptxi.clear();
67+
ptom.clear();
68+
ptph.clear();
69+
ptks.clear();
70+
ptd.clear();
71+
ptlc.clear();
72+
ptjp.clear();
73+
for (auto const& mcPart : mcParticles) {
74+
if (std::fabs(mcPart.y()) > 0.5) {
75+
continue; // only do midrapidity particles
76+
}
77+
78+
// handle resonances first to make sure phys prim crit does not reject them
79+
if (mcPart.pdgCode() == 333) {
80+
ptph.push_back(mcPart.pt());
81+
}
82+
if (std::abs(mcPart.pdgCode()) == 313) {
83+
ptks.push_back(mcPart.pt());
84+
}
85+
86+
// resonances handled, move to primaries
87+
if (!mcPart.isPhysicalPrimary()) {
88+
continue;
89+
}
90+
if (std::abs(mcPart.pdgCode()) == 211) {
91+
ptpi.push_back(mcPart.pt());
92+
}
93+
if (std::abs(mcPart.pdgCode()) == 321) {
94+
ptka.push_back(mcPart.pt());
95+
}
96+
if (std::abs(mcPart.pdgCode()) == 2212) {
97+
ptpr.push_back(mcPart.pt());
98+
}
99+
if (std::abs(mcPart.pdgCode()) == 310) {
100+
ptk0.push_back(mcPart.pt());
101+
}
102+
if (std::abs(mcPart.pdgCode()) == 3122) {
103+
ptla.push_back(mcPart.pt());
104+
}
105+
if (std::abs(mcPart.pdgCode()) == 3312) {
106+
ptxi.push_back(mcPart.pt());
107+
}
108+
if (std::abs(mcPart.pdgCode()) == 3334) {
109+
ptom.push_back(mcPart.pt());
110+
}
111+
if (std::abs(mcPart.pdgCode()) == 3334) {
112+
ptom.push_back(mcPart.pt());
113+
}
114+
// inclusive HF for now
115+
if (std::abs(mcPart.pdgCode()) == 421) {
116+
ptd.push_back(mcPart.pt());
117+
}
118+
if (std::abs(mcPart.pdgCode()) == 4122) {
119+
ptd.push_back(mcPart.pt());
120+
}
121+
if (std::abs(mcPart.pdgCode()) == 443) {
122+
ptjp.push_back(mcPart.pt());
123+
}
124+
}
125+
126+
pidpts(ptpi, ptka, ptpr, ptk0, ptla, ptxi, ptom, ptph, ptks, ptd, ptlc, ptjp);
127+
}
128+
};
129+
130+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
131+
{
132+
return WorkflowSpec{adaptAnalysisTask<SelectionStudyTable>(cfgc)};
133+
}

0 commit comments

Comments
 (0)