Skip to content

Commit 62514c5

Browse files
authored
Add multiplicity distribution task (#5155)
1 parent 35ca9e4 commit 62514c5

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed

Analysis/Tasks/PWGCF/correlations.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ struct CorrelationTask {
153153

154154
same->fillEvent(centrality, CorrelationContainer::kCFStepAll);
155155

156+
if (!collision.alias()[kINT7]) {
157+
return;
158+
}
156159
if (!collision.sel7()) {
157160
return;
158161
}

Analysis/Tasks/PWGCF/filterCF.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ struct FilterCF {
5050
{
5151
LOGF(info, "Tracks for collision: %d | Vertex: %.1f | INT7: %d | V0M: %.1f", tracks.size(), collision.posZ(), collision.sel7(), collision.centV0M());
5252

53+
if (!collision.alias()[kINT7]) {
54+
return;
55+
}
5356
if (!collision.sel7()) {
5457
return;
5558
}

Analysis/Tutorials/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,8 @@ o2_add_dpl_workflow(compatible-bcs
172172
SOURCES src/compatibleBCs.cxx
173173
PUBLIC_LINK_LIBRARIES O2::Framework O2::AnalysisCore O2::AnalysisDataModel
174174
COMPONENT_NAME AnalysisTutorial)
175+
176+
o2_add_dpl_workflow(multiplicity-event-track-selection
177+
SOURCES src/multiplicityEventTrackSelection.cxx
178+
PUBLIC_LINK_LIBRARIES O2::Framework O2::AnalysisCore O2::AnalysisDataModel
179+
COMPONENT_NAME AnalysisTutorial)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
#include "Framework/AnalysisDataModel.h"
12+
#include "Framework/AnalysisTask.h"
13+
#include "Framework/runDataProcessing.h"
14+
#include <TH1F.h>
15+
16+
#include "AnalysisDataModel/EventSelection.h"
17+
#include "AnalysisDataModel/TrackSelectionTables.h"
18+
19+
using namespace o2;
20+
using namespace o2::framework;
21+
using namespace o2::framework::expressions;
22+
23+
// Example task generating a multiplicity distribution of
24+
// collision which pass the INT7 selection and
25+
// tracks which pass the "isGlobalTrack" selection
26+
//
27+
// Needs to run with event and track selection:
28+
// o2-analysis-timestamp | o2-analysis-event-selection | o2-analysis-trackextension | o2-analysis-trackselection | o2-analysistutorial-multiplicity-event-track-selection
29+
30+
struct MultiplicityEventTrackSelection {
31+
32+
OutputObj<TH1F> multiplicity{TH1F("multiplicity", "multiplicity", 5000, -0.5, 4999.5)};
33+
34+
Filter collisionZFilter = nabs(aod::collision::posZ) < 10.0f;
35+
Filter trackFilter = (nabs(aod::track::eta) < 0.8f) && (aod::track::pt > 0.15f) && (aod::track::isGlobalTrack == (uint8_t) true);
36+
37+
void process(soa::Filtered<soa::Join<aod::Collisions, aod::EvSels>>::iterator const& collision,
38+
soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection>> const& tracks)
39+
{
40+
if (!collision.alias()[kINT7]) {
41+
return;
42+
}
43+
if (!collision.sel7()) {
44+
return;
45+
}
46+
47+
LOGP(INFO, "Collision with {} tracks", tracks.size());
48+
multiplicity->Fill(tracks.size());
49+
}
50+
};
51+
52+
// Workflow definition
53+
WorkflowSpec defineDataProcessing(ConfigContext const&)
54+
{
55+
return WorkflowSpec{
56+
adaptAnalysisTask<MultiplicityEventTrackSelection>("multiplicity-event-track-selection")};
57+
}

0 commit comments

Comments
 (0)