Project
Loading...
Searching...
No Matches
cpv-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
16
25
26#include <string>
27#include <stdexcept>
28#include <unordered_map>
29
30using namespace o2::framework;
31
32void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
33{
35}
36
37void customize(std::vector<o2::framework::CompletionPolicy>& policies)
38{
39 // ordered policies for the writers
40 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:CPV|cpv).*[W,w]riter.*"));
41}
42
43// add workflow options, note that customization needs to be declared before
44// including Framework/runDataProcessing
45void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
46{
47 std::vector<o2::framework::ConfigParamSpec> options{
48 {"input-type", o2::framework::VariantType::String, "digits", {"hits, digits, raw, clusters"}},
49 {"output-type", o2::framework::VariantType::String, "clusters", {"digits, clusters"}},
50 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable sending of MC information"}},
51 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
52 {"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}},
53 {"ignore-dist-stf", o2::framework::VariantType::Bool, false, {"do not subscribe to FLP/DISTSUBTIMEFRAME/0 message (no lost TF recovery)"}},
54 {"pedestal", o2::framework::VariantType::Bool, false, {"do not use ccdb calibration (applied only when processing raw data)"}},
55 {"no-bad-channel-map", o2::framework::VariantType::Bool, false, {"do not use bad channel map from ccdb (applied only when processing raw data)"}},
56 {"no-gain-calibration", o2::framework::VariantType::Bool, false, {"do not use gain calibration from ccdb (applied only when processing raw data)"}},
57 {"configKeyValues", o2::framework::VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
59 std::swap(workflowOptions, options);
60}
61
62#include "Framework/runDataProcessing.h" // the main driver
63
77{
78 //
79 // Update the (declared) parameters if changed from the command line
80 o2::conf::ConfigurableParam::updateFromString(cfgc.options().get<std::string>("configKeyValues"));
81
82 auto wf = o2::cpv::reco_workflow::getWorkflow(cfgc.options().get<bool>("disable-root-input"),
83 cfgc.options().get<bool>("disable-root-output"),
84 !cfgc.options().get<bool>("disable-mc"),
85 !cfgc.options().get<bool>("ignore-dist-stf"),
86 cfgc.options().get<bool>("pedestal"),
87 !cfgc.options().get<bool>("no-bad-channel-map"),
88 !cfgc.options().get<bool>("no-gain-calibration"),
89 cfgc.options().get<std::string>("input-type"),
90 cfgc.options().get<std::string>("output-type"));
91
92 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
93 o2::raw::HBFUtilsInitializer hbfIni(cfgc, wf);
94
95 return wf;
96}
Helper function to tokenize sequences and ranges of integral numbers.
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const &cfgc)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)
framework::WorkflowSpec getWorkflow(bool disableRootInp, bool disableRootOut, bool propagateMC=true, bool askSTFDist=true, bool isPedestal=false, bool useBadChannelMap=true, bool useGainCalibration=true, std::string const &cfgInput="digits", std::string const &cfgOutput="clusters")
create the workflow for CPV reconstruction
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
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))