Project
Loading...
Searching...
No Matches
phos-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(".*(?:PHO?S|pho?s).*[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, "cells", {"digits, raw, clusters, cells"}},
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 {"fullclu-output", o2::framework::VariantType::Bool, false, {"compact of full (with contr. digits) clusters output"}},
54 {"flpId", o2::framework::VariantType::Int, 0, {"FLP identification: 0,1,..."}},
55 {"defbadmap", o2::framework::VariantType::Bool, false, {"Use default bad map and calib instead of CCDB"}},
56 {"disable-l1phase-corr", o2::framework::VariantType::Bool, false, {"do not apply L1 phase correction (e.g. to MC)"}},
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 auto wf = o2::phos::reco_workflow::getWorkflow(cfgc.options().get<bool>("disable-root-input"),
82 cfgc.options().get<bool>("disable-root-output"),
83 !cfgc.options().get<bool>("disable-mc"),
84 cfgc.options().get<std::string>("input-type"),
85 cfgc.options().get<std::string>("output-type"),
86 cfgc.options().get<bool>("fullclu-output"),
87 cfgc.options().get<int>("flpId"),
88 cfgc.options().get<bool>("defbadmap"),
89 cfgc.options().get<bool>("disable-l1phase-corr"));
90 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
91 o2::raw::HBFUtilsInitializer hbfIni(cfgc, wf);
92
93 return wf;
94}
Helper function to tokenize sequences and ranges of integral numbers.
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
framework::WorkflowSpec getWorkflow(bool disableRootInp, bool disableRootOut, bool propagateMC=true, std::string const &cfgInput="hits", std::string const &cfgOutput="clusters", bool fullCluOut=false, int flpId=0, bool defBadMap=false, bool skipL1phase=true)
create the workflow for PHOS reconstruction
o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const &cfgc)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)
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))