Project
Loading...
Searching...
No Matches
fv0-reco-workflow.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
18#include <string>
19
20using namespace o2::framework;
21
22// ------------------------------------------------------------------
23void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
24{
26}
27
28void customize(std::vector<o2::framework::CompletionPolicy>& policies)
29{
30 // ordered policies for the writers
31 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:FV0|fv0).*[W,w]riter.*"));
32}
33
34// we need to add workflow options before including Framework/runDataProcessing
35void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
36{
37 // option allowing to set parameters
38 std::vector<o2::framework::ConfigParamSpec> options{
39 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation even if available"}},
40 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input readers"}},
41 {"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writers"}},
42 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}};
44 std::swap(workflowOptions, options);
45}
46
47// ------------------------------------------------------------------
48
50
52{
53 LOG(info) << "WorkflowSpec defineDataProcessing";
54 // Update the (declared) parameters if changed from the command line
55 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
56 // write the configuration used for the digitizer workflow
57 o2::conf::ConfigurableParam::writeINI("o2-fv0-recoflow_configuration.ini");
58
59 auto useMC = !configcontext.options().get<bool>("disable-mc");
60 auto disableRootInp = configcontext.options().get<bool>("disable-root-input");
61 auto disableRootOut = configcontext.options().get<bool>("disable-root-output");
62
63 LOG(info) << "WorkflowSpec getRecoWorkflow useMC " << useMC;
64 auto wf = o2::fv0::getRecoWorkflow(useMC, disableRootInp, disableRootOut);
65
66 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
67 o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf);
68
69 return std::move(wf);
70}
Definition of the Names Generator class.
static void writeINI(std::string const &filename, std::string const &keyOnly="")
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
framework::WorkflowSpec getRecoWorkflow(bool useMC, bool disableRootInp, bool disableRootOut)
static CompletionPolicy consumeWhenAllOrdered(const char *name, CompletionPolicy::Matcher matcher)
as consumeWhenAll, but ensures that records are processed with incremental timeSlice (DataHeader::sta...
static void addNewTimeSliceCallback(std::vector< o2::framework::CallbacksPolicy > &policies)
static void addConfigOption(std::vector< o2::framework::ConfigParamSpec > &opts, const std::string &defOpt=std::string(o2::base::NameConf::DIGITIZATIONCONFIGFILE))
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"