forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft0-reco-workflow.cxx
More file actions
77 lines (65 loc) · 3.82 KB
/
ft0-reco-workflow.cxx
File metadata and controls
77 lines (65 loc) · 3.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#include "FT0Workflow/RecoWorkflow.h"
#include "CommonUtils/ConfigurableParam.h"
#include "DetectorsRaw/HBFUtilsInitializer.h"
#include "Framework/CallbacksPolicy.h"
#include "CommonUtils/NameConf.h"
#include <string>
#include "Framework/CompletionPolicyHelpers.h"
using namespace o2::framework;
// ------------------------------------------------------------------
void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
{
o2::raw::HBFUtilsInitializer::addNewTimeSliceCallback(policies);
}
void customize(std::vector<o2::framework::CompletionPolicy>& policies)
{
// ordered policies for the writers
policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:FT0|ft0).*[W,w]riter.*"));
}
// we need to add workflow options before including Framework/runDataProcessing
void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
{
// option allowing to set parameters
std::vector<o2::framework::ConfigParamSpec> options{
{"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation even if available"}},
{"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input readers"}},
{"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writers"}},
{"disable-time-offset-calib", o2::framework::VariantType::Bool, false, {"disable timeoffset calibration"}},
{"disable-slewing-calib", o2::framework::VariantType::Bool, false, {"disable slewing calibration"}},
{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}},
{"disable-dead-channel-map", VariantType::Bool, false, {"disable dead channel map"}}};
o2::raw::HBFUtilsInitializer::addConfigOption(options);
std::swap(workflowOptions, options);
}
// ------------------------------------------------------------------
#include "Framework/runDataProcessing.h"
WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
{
LOG(info) << "WorkflowSpec defineDataProcessing";
// Update the (declared) parameters if changed from the command line
o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
// write the configuration used for the digitizer workflow
o2::conf::ConfigurableParam::writeINI("o2-ft0-recoflow_configuration.ini");
auto useMC = !configcontext.options().get<bool>("disable-mc");
auto ccdbpath = o2::base::NameConf::getCCDBServer();
auto disableRootInp = configcontext.options().get<bool>("disable-root-input");
auto disableRootOut = configcontext.options().get<bool>("disable-root-output");
const auto useTimeOffsetCalib = !configcontext.options().get<bool>("disable-time-offset-calib");
const auto useSlewingCalib = !configcontext.options().get<bool>("disable-slewing-calib");
const auto useDeadChannelMap = !configcontext.options().get<bool>("disable-dead-channel-map");
LOG(info) << "WorkflowSpec getRecoWorkflow useMC " << useMC << " CCDB " << ccdbpath;
auto wf = o2::ft0::getRecoWorkflow(useMC, ccdbpath, useTimeOffsetCalib, useSlewingCalib, disableRootInp, disableRootOut, useDeadChannelMap);
// configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf);
return std::move(wf);
}