Project
Loading...
Searching...
No Matches
mctracks_to_aod_simple_task.cxx
Go to the documentation of this file.
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
16
17using namespace o2;
18using namespace o2::framework;
19using namespace o2::constants::math;
20
22
23 HistogramRegistry registry{"registry", {}};
24
26 {
27 registry.add<TH1>("NEvents", "NEvents", HistType::kTH1F, {{1, 0, 1}}, false);
28 registry.add<TH1>("phi", "phi", HistType::kTH1F, {{100, 0, 2 * PI}}, false);
29 registry.add<TH1>("eta", "eta", HistType::kTH1F, {{100, -5, 5}}, false);
30 registry.add<TH1>("pt", "pt", HistType::kTH1F, {{100, 0, 5}}, false);
31 }
32
33 void process(aod::McCollision const&, aod::McParticles const& mcParticles)
34 {
35 registry.fill(HIST("NEvents"), 0.5);
36 for (auto& mcparticle : mcParticles) {
37 registry.fill(HIST("pt"), mcparticle.pt());
38 registry.fill(HIST("eta"), mcparticle.eta());
39 registry.fill(HIST("phi"), mcparticle.phi());
40 }
41 }
42};
43
45{
46 return {adaptAnalysisTask<AodConsumerTestTask>(cfgc)};
47}
#define HIST(name)
void fill(const HistName &histName, Ts... positionAndWeight)
HistPtr add(const HistogramSpec &histSpec)
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
This function hooks up the the workflow specifications into the DPL driver.
McParticles_001 McParticles
McCollisions::iterator McCollision
constexpr float PI
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
void init(o2::framework::InitContext &)
void process(aod::McCollision const &, aod::McParticles const &mcParticles)