-
Notifications
You must be signed in to change notification settings - Fork 646
Expand file tree
/
Copy pathCFTutorialTask1.cxx
More file actions
88 lines (72 loc) · 3.27 KB
/
CFTutorialTask1.cxx
File metadata and controls
88 lines (72 loc) · 3.27 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// 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.
/// \author Anton Riedel
#include "PWGCF/DataModel/FemtoDerived.h"
#include <Framework/AnalysisTask.h>
#include <Framework/Configurable.h>
#include <Framework/HistogramRegistry.h>
#include <Framework/HistogramSpec.h>
#include <Framework/InitContext.h>
#include <Framework/OutputObjHeader.h>
#include <Framework/runDataProcessing.h>
using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
struct CFTutorialTask1 {
// Define additional analysis level cuts applied as filters
Configurable<float> ConfZvtxMin{"ConfZvtxMin", -10, "Min Z vtx cut"};
Configurable<float> ConfZvtxMax{"ConfZvtxMax", 10, "Max Z vtx cut"};
Configurable<float> ConfEtaMin{"ConfEtaMin", -0.8, "Pseudorapidity cut"};
Configurable<float> ConfEtaMax{"ConfEtaMax", 0.8, "Pseudorapidity cut"};
Configurable<float> ConfPtMin{"ConfPtMin", 0.5, "Max Pt cut"};
Configurable<float> ConfPtMax{"ConfPtMax", 4.0, "Min Pt cut"};
// TODO :
// Defining filters for analysis level selections on events and tracks
// on Femto tables defined in FemtoDerived.h
// Filter collisionFilter = ...
// Filter trackFilter = ...
// Apply filters
// FilteredFDCollisions ...
// FilteredFDParts ...
HistogramRegistry HistRegistry{"FemtoTutorial", {}, OutputObjHandlingPolicy::AnalysisObject};
// create analysis objects like histograms
void init(o2::framework::InitContext&)
{
// Add histograms to histogram registry
HistRegistry.add("Event/hZvtx", ";Z (cm)", kTH1F, {{240, -12, 12}});
HistRegistry.add("Particle1/hPt", ";#it{p_{T}} (GeV/#it{c})", kTH1F, {{100, 0, 4}});
HistRegistry.add("Particle1/hEta", ";#eta", kTH1F, {{100, -1., 1.}});
HistRegistry.add("Particle1/hPhi", ";#phi", kTH1F, {{360, 0, 6.28}});
HistRegistry.add("Particle2/hPt", ";#it{p_{T}} (GeV/#it{c})", kTH1F, {{100, 0, 4}});
HistRegistry.add("Particle2/hEta", ";#eta", kTH1F, {{100, -1., 1.}});
HistRegistry.add("Particle2/hPhi", ";#phi", kTH1F, {{360, 0, 6.28}});
HistRegistry.add("Pair/hSE", ";k^{*} (GeV/#it{c})", kTH1F, {{1000, 0., 5.}});
HistRegistry.add("Pair/hME", ";k^{*} (GeV/#it{c})", kTH1F, {{1000, 0., 5.}});
}
// TODO:
// subscribe to filtered collisions and tracks
void process(aod::FDCollision const& col, aod::FDParticles const& parts)
{
/// event QA
HistRegistry.fill(HIST("Event/hZvtx"), col.posZ());
for (auto& part : parts) {
HistRegistry.fill(HIST("Particle1/hPt"), part.pt());
HistRegistry.fill(HIST("Particle1/hEta"), part.eta());
HistRegistry.fill(HIST("Particle1/hPhi"), part.phi());
}
}
};
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
// Equivalent to the AddTask in AliPhysics
WorkflowSpec workflow{adaptAnalysisTask<CFTutorialTask1>(cfgc)};
return workflow;
}