-
Notifications
You must be signed in to change notification settings - Fork 652
Expand file tree
/
Copy pathweakDecayIndices.cxx
More file actions
57 lines (50 loc) · 2.35 KB
/
weakDecayIndices.cxx
File metadata and controls
57 lines (50 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// 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.
#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"
using namespace o2;
using namespace o2::framework;
// Converts V0 and cascade version 000 to 001
// Build indices to group V0s and cascades to collisions
struct WeakDecayIndicesV0 {
Produces<aod::V0s_001> v0s_001;
void process(aod::V0s_000 const& v0s, aod::Tracks const&)
{
for (auto& v0 : v0s) {
if (v0.posTrack().collisionId() != v0.negTrack().collisionId()) {
LOGF(fatal, "V0 %d has inconsistent collision information (%d, %d)", v0.globalIndex(), v0.posTrack().collisionId(), v0.negTrack().collisionId());
}
v0s_001(v0.posTrack().collisionId(), v0.posTrackId(), v0.negTrackId());
}
}
};
// NOTE These tasks have to be split because for the cascades, V0s and not V0s_000 are needed
struct WeakDecayIndicesCascades {
Produces<aod::Cascades_001> cascades_001;
void process(aod::V0s const&, aod::Cascades_000 const& cascades, aod::Tracks const&)
{
for (auto& cascade : cascades) {
if (cascade.bachelor().collisionId() != cascade.v0().posTrack().collisionId() || cascade.v0().posTrack().collisionId() != cascade.v0().negTrack().collisionId()) {
LOGF(fatal, "Cascade %d has inconsistent collision information (%d, %d, %d) track ids %d %d %d", cascade.globalIndex(), cascade.bachelor().collisionId(),
cascade.v0().posTrack().collisionId(), cascade.v0().negTrack().collisionId(), cascade.bachelorId(), cascade.v0().posTrackId(), cascade.v0().negTrackId());
}
cascades_001(cascade.bachelor().collisionId(), cascade.v0Id(), cascade.bachelorId());
}
}
};
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<WeakDecayIndicesV0>(cfgc),
adaptAnalysisTask<WeakDecayIndicesCascades>(cfgc),
};
}