Project
Loading...
Searching...
No Matches
zdc-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
18using namespace o2::framework;
19
20// ------------------------------------------------------------------
21void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
22{
24}
25
26void customize(std::vector<o2::framework::CompletionPolicy>& policies)
27{
28 // ordered policies for the writers
29 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:ZDC|zdc).*[W,w]riter.*"));
30}
31
32// we need to add workflow options before including Framework/runDataProcessing
33void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
34{
35 // option allowing to set parameters
36 workflowOptions.push_back(ConfigParamSpec{"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation even if available"}});
37 workflowOptions.push_back(ConfigParamSpec{"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input readers"}});
38 workflowOptions.push_back(ConfigParamSpec{"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writers"}});
39 workflowOptions.push_back(ConfigParamSpec{"reco-verbosity", VariantType::Int, 0, {"reco verbosity level"}});
40 workflowOptions.push_back(ConfigParamSpec{"enable-debug-output", VariantType::Bool, false, {"enable debug tree output"}});
41 workflowOptions.push_back(ConfigParamSpec{"disable-tdc-corr", o2::framework::VariantType::Bool, false, {"Do not load ZDCTDCCorr calibration object"}});
42 workflowOptions.push_back(ConfigParamSpec{"disable-energy-calib", o2::framework::VariantType::Bool, false, {"Do not load ZDCEnergyParam calibration object"}});
43 workflowOptions.push_back(ConfigParamSpec{"disable-tower-calib", o2::framework::VariantType::Bool, false, {"Do not load ZDCTowerParam calibration object"}});
44 workflowOptions.push_back(ConfigParamSpec{"disable-baseline-calib", o2::framework::VariantType::Bool, false, {"Do not load BaselineParam calibration object"}});
45 std::string keyvaluehelp("Semicolon separated key=value strings ...");
46 workflowOptions.push_back(ConfigParamSpec{"configKeyValues", VariantType::String, "", {keyvaluehelp}});
48}
49
50// ------------------------------------------------------------------
51
53
55{
56 LOG(info) << "WorkflowSpec defineDataProcessing";
57 // Update the (declared) parameters if changed from the command line
58 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
59 // write the configuration used for the digitizer workflow
60 // o2::conf::ConfigurableParam::writeINI("o2tpcits-match-recoflow_configuration.ini");
61
62 auto useMC = !configcontext.options().get<bool>("disable-mc");
63 auto disableRootInp = configcontext.options().get<bool>("disable-root-input");
64 auto disableRootOut = configcontext.options().get<bool>("disable-root-output");
65 auto verbosity = configcontext.options().get<int>("reco-verbosity");
66 auto enableDebugOut = configcontext.options().get<bool>("enable-debug-output");
67 auto enableZDCTDCCorr = !configcontext.options().get<bool>("disable-tdc-corr");
68 auto enableZDCEnergyParam = !configcontext.options().get<bool>("disable-energy-calib");
69 auto enableZDCTowerParam = !configcontext.options().get<bool>("disable-tower-calib");
70 auto enableBaselineParam = !configcontext.options().get<bool>("disable-baseline-calib");
71
72 LOG(info) << "WorkflowSpec getRecoWorkflow useMC " << useMC;
73 auto wf = o2::zdc::getRecoWorkflow(useMC, disableRootInp, disableRootOut, verbosity, enableDebugOut, enableZDCTDCCorr, enableZDCEnergyParam, enableZDCTowerParam, enableBaselineParam);
74
75 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
76 o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf);
77
78 return std::move(wf);
79}
#define verbosity
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
framework::WorkflowSpec getRecoWorkflow(const bool useMC, const bool disableRootInp, const bool disableRootOut, const int verbosity, const bool enableDebugOut, const bool enableZDCTDCCorr, const bool enableZDCEnergyParam, const bool enableZDCTowerParam, const bool enableBaselineParam)
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"
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)