Project
Loading...
Searching...
No Matches
MCTruthTestWorkflow.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
12#include <boost/program_options.hpp>
13
19#include "MCTruthSourceSpec.h"
20#include "MCTruthWriterSpec.h"
21#include "MCTruthReaderSpec.h"
22
23using namespace o2::framework;
24
25void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
26{
27 // option to disable MC truth
28 workflowOptions.push_back(ConfigParamSpec{"newmctruth", o2::framework::VariantType::Bool, false, {"enable new container"}});
29 workflowOptions.push_back(ConfigParamSpec{"consumers", o2::framework::VariantType::Int, 1, {"number of mc consumers"}});
30}
31
33
37{
38 WorkflowSpec specs;
39
40 bool newmctruth = configcontext.options().get<bool>("newmctruth");
41
42 // connect the source
43 specs.emplace_back(o2::getMCTruthSourceSpec(newmctruth));
44 // connect some consumers
45 for (int i = 0; i < configcontext.options().get<int>("consumers"); ++i) {
46 specs.emplace_back(o2::getMCTruthWriterSpec(i, i == 0, newmctruth));
47 }
48 // connect a device reading back the labels
49 specs.emplace_back(o2::getMCTruthReaderSpec(newmctruth));
50 // connect a device reading back the labels
51 specs.emplace_back(o2::getMCTruthWriterSpec(-1, false, newmctruth));
52
53 return specs;
54}
int32_t i
void customize(std::vector< o2::framework::ConfigParamSpec > &workflowOptions)
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
This function hooks up the the workflow specifications into the DPL driver.
ConfigParamRegistry & options() const
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
o2::framework::DataProcessorSpec getMCTruthSourceSpec(bool newmctruth)
o2::framework::DataProcessorSpec getMCTruthReaderSpec(bool newmctruth)
o2::framework::DataProcessorSpec getMCTruthWriterSpec(int id, bool doio, bool newmctruth)