Skip to content

Commit fdf1701

Browse files
authored
Merge branch 'AliceO2Group:master' into A2-PR
2 parents 4c6b0ae + 327c3df commit fdf1701

77 files changed

Lines changed: 11870 additions & 2859 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ALICE3/DataModel/OTFStrangeness.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ DECLARE_SOA_INDEX_COLUMN_FULL(PosTrack, posTrack, int, Tracks, "_Pos");
3737
DECLARE_SOA_INDEX_COLUMN_FULL(NegTrack, negTrack, int, Tracks, "_Neg"); //!
3838
DECLARE_SOA_INDEX_COLUMN_FULL(BachTrack, bachTrack, int, Tracks, "_Bach"); //!
3939

40+
DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle);
41+
4042
// topo vars
4143
DECLARE_SOA_COLUMN(DcaV0Daughters, dcaV0Daughters, float);
4244
DECLARE_SOA_COLUMN(DcaCascadeDaughters, dcaCascadeDaughters, float);
@@ -70,6 +72,9 @@ DECLARE_SOA_TABLE(UpgradeCascades, "AOD", "UPGRADECASCADES",
7072

7173
using UpgradeCascade = UpgradeCascades::iterator;
7274

75+
DECLARE_SOA_TABLE(A3CascadeMcLabels, "AOD", "A3CASCADEMCLABELS",
76+
o2::soa::Index<>, otfcascade::McParticleId);
77+
7378
namespace otfv0
7479
{
7580
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!

ALICE3/TableProducer/alice3strangenessFinder.cxx

Lines changed: 147 additions & 96 deletions
Large diffs are not rendered by default.

ALICE3/Tasks/alice3Strangeness.cxx

Lines changed: 337 additions & 89 deletions
Large diffs are not rendered by default.

Common/Core/TrackSelection.cxx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@
2727

2828
bool TrackSelection::FulfillsITSHitRequirements(uint8_t itsClusterMap) const
2929
{
30-
constexpr uint8_t bit = 1;
31-
for (auto& itsRequirement : mRequiredITSHits) {
32-
auto hits = std::count_if(itsRequirement.second.begin(), itsRequirement.second.end(), [&](auto&& requiredLayer) { return itsClusterMap & (bit << requiredLayer); });
33-
if ((itsRequirement.first == -1) && (hits > 0)) {
30+
for (const auto& [minHits, layerMask] : mRequiredITSHits) {
31+
int hits = __builtin_popcount(itsClusterMap & layerMask);
32+
if ((minHits == -1) && (hits > 0)) {
3433
return false; // no hits were required in specified layers
35-
} else if (hits < itsRequirement.first) {
34+
} else if (hits < minHits) {
3635
return false; // not enough hits found in specified layers
3736
}
3837
}
@@ -128,12 +127,20 @@ void TrackSelection::SetMaxDcaXYPtDep(std::function<float(float)> ptDepCut)
128127
void TrackSelection::SetRequireHitsInITSLayers(int8_t minNRequiredHits, std::set<uint8_t> requiredLayers)
129128
{
130129
// layer 0 corresponds to the the innermost ITS layer
131-
mRequiredITSHits.push_back(std::make_pair(minNRequiredHits, requiredLayers));
130+
uint8_t mask = 0;
131+
for (const auto& layer : requiredLayers) {
132+
mask |= (1u << layer);
133+
}
134+
mRequiredITSHits.push_back(std::make_pair(minNRequiredHits, mask));
132135
LOG(info) << "Track selection, set require hits in ITS layers: " << static_cast<int>(minNRequiredHits);
133136
}
134137
void TrackSelection::SetRequireNoHitsInITSLayers(std::set<uint8_t> excludedLayers)
135138
{
136-
mRequiredITSHits.push_back(std::make_pair(-1, excludedLayers));
139+
uint8_t mask = 0;
140+
for (const auto& layer : excludedLayers) {
141+
mask |= (1u << layer);
142+
}
143+
mRequiredITSHits.push_back(std::make_pair(-1, mask));
137144
LOG(info) << "Track selection, set require no hits in ITS layers";
138145
}
139146

Common/Core/TrackSelection.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ class TrackSelection
268268
bool mRequireTPCRefit{false}; // require refit in TPC
269269
bool mRequireGoldenChi2{false}; // require golden chi2 cut (Run 2 only)
270270

271-
// vector of ITS requirements (minNRequiredHits in specific requiredLayers)
272-
std::vector<std::pair<int8_t, std::set<uint8_t>>> mRequiredITSHits{};
271+
// vector of ITS requirements (minNRequiredHits, bitmask of requiredLayers)
272+
std::vector<std::pair<int8_t, uint8_t>> mRequiredITSHits{};
273273

274-
ClassDefNV(TrackSelection, 1);
274+
ClassDefNV(TrackSelection, 2);
275275
};
276276

277277
#endif // COMMON_CORE_TRACKSELECTION_H_

Common/DataModel/Multiplicity.h

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ DECLARE_SOA_COLUMN(TimeToNext, timeToNext, float); //!
100100
DECLARE_SOA_COLUMN(TimeToNeNext, timeToNeNext, float); //!
101101

102102
// Extra information from FIT detectors
103-
DECLARE_SOA_COLUMN(MultFV0AOuter, multFV0AOuter, float); //! FV0 without innermost ring
104103
DECLARE_SOA_COLUMN(FT0TriggerMask, ft0TriggerMask, uint8_t); //!
104+
DECLARE_SOA_COLUMN(MultFV0AOuter, multFV0AOuter, float); //! FV0 without innermost ring
105+
DECLARE_SOA_COLUMN(MultFT0AOuter, multFT0AOuter, float); //! FT0A without innermost ring
105106

106107
} // namespace mult
107108
DECLARE_SOA_TABLE(FV0Mults, "AOD", "FV0MULT", //! Multiplicity with the FV0 detector
@@ -260,7 +261,7 @@ DECLARE_SOA_COLUMN(MultCollidingBC, multCollidingBC, bool); //! CTP tri
260261
DECLARE_SOA_COLUMN(MultFT0PosZ, multFT0PosZ, float); //! Position along Z computed with the FT0 information within the BC
261262
DECLARE_SOA_COLUMN(MultFT0PosZValid, multFT0PosZValid, bool); //! Validity of the position along Z computed with the FT0 information
262263
} // namespace mult
263-
DECLARE_SOA_TABLE(MultBCs, "AOD", "MULTBC", //!
264+
DECLARE_SOA_TABLE(MultBCs_000, "AOD", "MULTBC", //!
264265
mult::MultFT0A,
265266
mult::MultFT0C,
266267
mult::MultFT0PosZ,
@@ -283,11 +284,44 @@ DECLARE_SOA_TABLE(MultBCs, "AOD", "MULTBC", //!
283284
mult::MultCollidingBC,
284285
timestamp::Timestamp,
285286
bc::Flags);
286-
using MultBC = MultBCs::iterator;
287287

288-
DECLARE_SOA_TABLE(MultBcSel, "AOD", "MULTBCSEL", //! BC selection bits joinable with multBCs
288+
DECLARE_SOA_TABLE_VERSIONED(MultBCs_001, "AOD", "MULTBC", 1, //!
289+
mult::MultFT0A,
290+
mult::MultFT0C,
291+
mult::MultFV0A,
292+
mult::MultFDDA,
293+
mult::MultFDDC,
294+
mult::MultZNA,
295+
mult::MultZNC,
296+
mult::MultZEM1,
297+
mult::MultZEM2,
298+
mult::MultZPA,
299+
mult::MultZPC,
300+
mult::MultFV0AOuter,
301+
mult::MultFT0AOuter);
302+
303+
DECLARE_SOA_TABLE(MultBcSel_000, "AOD", "MULTBCSEL", //! BC selection bits joinable with multBCs
289304
evsel::Selection);
290305

306+
DECLARE_SOA_TABLE_VERSIONED(MultBcSel_001, "AOD", "MULTBCSEL", 1, //! BC selection bits joinable with multBCs
307+
evsel::Selection,
308+
evsel::Rct,
309+
bc::Flags,
310+
timestamp::Timestamp,
311+
mult::MultFT0PosZ,
312+
mult::MultFT0PosZValid,
313+
mult::MultV0triggerBits,
314+
mult::MultT0triggerBits,
315+
mult::MultFDDtriggerBits,
316+
mult::MultTriggerMask,
317+
mult::MultCollidingBC,
318+
mult::MultTVX,
319+
mult::MultFV0OrA);
320+
321+
using MultBCs = MultBCs_001;
322+
using MultBcSel = MultBcSel_001;
323+
using MultBC = MultBCs::iterator;
324+
291325
// crosslinks
292326
namespace mult
293327
{

Common/TableProducer/Converters/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,8 @@ o2physics_add_dpl_workflow(run2-tiny-to-full-pid
113113
SOURCES run2TinyToFullPID.cxx
114114
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
115115
COMPONENT_NAME Analysis)
116+
117+
o2physics_add_dpl_workflow(mult-bcs-converter
118+
SOURCES multBCsConverter.cxx
119+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
120+
COMPONENT_NAME Analysis)
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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 multBCsConverter.cxx
13+
/// \brief Converts MultBCs and MultBcSel table from version 000 to 001
14+
/// \author Jesper Karlsson Gumrpecht
15+
16+
#include "Common/DataModel/Multiplicity.h"
17+
18+
#include <Framework/AnalysisDataModel.h>
19+
#include <Framework/AnalysisHelpers.h>
20+
#include <Framework/AnalysisTask.h>
21+
#include <Framework/runDataProcessing.h>
22+
23+
using namespace o2;
24+
using namespace o2::framework;
25+
26+
struct MultBCsConverter {
27+
Produces<aod::MultBCs_001> multBC;
28+
Produces<aod::MultBcSel_001> multBcSel;
29+
30+
static constexpr float DummyValue = -1.f;
31+
static constexpr int DummyRct = 0;
32+
void process(soa::Join<aod::MultBCs_000, aod::MultBcSel_000> const& multBCs)
33+
{
34+
multBC.reserve(multBCs.size());
35+
multBcSel.reserve(multBCs.size());
36+
for (const auto& multbc : multBCs) {
37+
multBC(
38+
multbc.multFT0A(),
39+
multbc.multFT0C(),
40+
multbc.multFV0A(),
41+
multbc.multFDDA(),
42+
multbc.multFDDC(),
43+
multbc.multZNA(),
44+
multbc.multZNC(),
45+
multbc.multZEM1(),
46+
multbc.multZEM2(),
47+
multbc.multZPA(),
48+
multbc.multZPC(),
49+
DummyValue, // dummy amplitude for FV0A Outer
50+
DummyValue); // dummy amplitude for FT0A Outer
51+
52+
multBcSel(
53+
multbc.selection_raw(),
54+
DummyRct, // all flags to false
55+
multbc.flags(),
56+
multbc.timestamp(),
57+
multbc.multFT0PosZ(),
58+
multbc.multFT0PosZValid(),
59+
multbc.multV0triggerBits(),
60+
multbc.multT0triggerBits(),
61+
multbc.multFDDtriggerBits(),
62+
multbc.multTriggerMask(),
63+
multbc.multCollidingBC(),
64+
multbc.multTVX(),
65+
multbc.multFV0OrA());
66+
}
67+
}
68+
};
69+
70+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
71+
{
72+
return WorkflowSpec{
73+
adaptAnalysisTask<MultBCsConverter>(cfgc)};
74+
}

Common/TableProducer/multiplicityExtraTable.cxx

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ struct MultiplicityExtraTable {
155155
float multFV0A = 0.f;
156156
float multFDDA = 0.f;
157157
float multFDDC = 0.f;
158+
float multFT0AOuter = 0.f;
159+
float multFV0AOuter = 0.f;
158160

159161
// ZDC amplitudes
160162
float multZEM1 = -1.f;
@@ -195,8 +197,11 @@ struct MultiplicityExtraTable {
195197
multFT0TriggerBits = static_cast<uint8_t>(triggers.to_ulong());
196198

197199
// calculate T0 charge
198-
for (auto amplitude : ft0.amplitudeA()) {
199-
multFT0A += amplitude;
200+
for (size_t ii = 0; ii < ft0.amplitudeA().size(); ++ii) {
201+
multFT0A += ft0.amplitudeA()[ii];
202+
if (ft0.channelA()[ii] > 31) {
203+
multFT0AOuter += ft0.amplitudeA()[ii];
204+
}
200205
}
201206
for (auto amplitude : ft0.amplitudeC()) {
202207
multFT0C += amplitude;
@@ -212,8 +217,13 @@ struct MultiplicityExtraTable {
212217
std::bitset<8> fV0Triggers = fv0.triggerMask();
213218
multFV0TriggerBits = static_cast<uint8_t>(fV0Triggers.to_ulong());
214219

215-
for (auto amplitude : fv0.amplitude()) {
220+
for (size_t ii = 0; ii < fv0.amplitude().size(); ii++) {
221+
auto amplitude = fv0.amplitude()[ii];
222+
auto channel = fv0.channel()[ii];
216223
multFV0A += amplitude;
224+
if (channel > 7) {
225+
multFV0AOuter += amplitude;
226+
}
217227
}
218228
isFV0OrA = fV0Triggers[o2::fit::Triggers::bitA];
219229
} else {
@@ -254,15 +264,34 @@ struct MultiplicityExtraTable {
254264

255265
bc2mult(bc2multArray[bc.globalIndex()]);
256266
multBC(
257-
tru(multFT0A), tru(multFT0C),
258-
tru(posZFT0), posZFT0valid, tru(multFV0A),
259-
tru(multFDDA), tru(multFDDC), tru(multZNA), tru(multZNC), tru(multZEM1),
260-
tru(multZEM2), tru(multZPA), tru(multZPC), Tvx, isFV0OrA,
261-
multFV0TriggerBits, multFT0TriggerBits, multFDDTriggerBits, multBCTriggerMask, collidingBC,
267+
tru(multFT0A),
268+
tru(multFT0C),
269+
tru(multFV0A),
270+
tru(multFDDA),
271+
tru(multFDDC),
272+
tru(multZNA),
273+
tru(multZNC),
274+
tru(multZEM1),
275+
tru(multZEM2),
276+
tru(multZPA),
277+
tru(multZPC),
278+
tru(multFV0AOuter),
279+
tru(multFT0AOuter));
280+
281+
multBcSel(
282+
bc.selection_raw(),
283+
bc.rct_raw(),
284+
bc.flags(),
262285
bc.timestamp(),
263-
bc.flags());
264-
265-
multBcSel(bc.selection_raw());
286+
tru(posZFT0),
287+
posZFT0valid,
288+
multFV0TriggerBits,
289+
multFT0TriggerBits,
290+
multFDDTriggerBits,
291+
multBCTriggerMask,
292+
collidingBC,
293+
Tvx,
294+
isFV0OrA);
266295
}
267296
}
268297

0 commit comments

Comments
 (0)