Project
Loading...
Searching...
No Matches
ft0-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
17#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(".*(?:FT0|ft0).*[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 {"disable-time-offset-calib", o2::framework::VariantType::Bool, false, {"disable timeoffset calibration"}},
43 {"disable-slewing-calib", o2::framework::VariantType::Bool, false, {"disable slewing calibration"}},
44 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}};
46 std::swap(workflowOptions, options);
47}
48
49// ------------------------------------------------------------------
50
52
54{
55 LOG(info) << "WorkflowSpec defineDataProcessing";
56 // Update the (declared) parameters if changed from the command line
57 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
58 // write the configuration used for the digitizer workflow
59 o2::conf::ConfigurableParam::writeINI("o2-ft0-recoflow_configuration.ini");
60
61 auto useMC = !configcontext.options().get<bool>("disable-mc");
62 auto ccdbpath = o2::base::NameConf::getCCDBServer();
63 auto disableRootInp = configcontext.options().get<bool>("disable-root-input");
64 auto disableRootOut = configcontext.options().get<bool>("disable-root-output");
65 const auto useTimeOffsetCalib = !configcontext.options().get<bool>("disable-time-offset-calib");
66 const auto useSlewingCalib = !configcontext.options().get<bool>("disable-slewing-calib");
67
68 LOG(info) << "WorkflowSpec getRecoWorkflow useMC " << useMC << " CCDB " << ccdbpath;
69 auto wf = o2::ft0::getRecoWorkflow(useMC, ccdbpath, useTimeOffsetCalib, useSlewingCalib, disableRootInp, disableRootOut);
70
71 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
72 o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf);
73
74 return std::move(wf);
75}
Definition of the Names Generator class.
static std::string getCCDBServer()
Definition NameConf.cxx:110
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, std::string ccdbpath, bool useTimeOffsetCalib, bool useSlewingCalib, 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"