Project
Loading...
Searching...
No Matches
emc-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(".*(?:EMC|emc).*[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", {"digits, cells, raw, clusters"}},
49 {"output-type", o2::framework::VariantType::String, "cells", {"digits, cells, raw, clusters, analysisclusters"}},
50 {"enable-digits-printer", o2::framework::VariantType::Bool, false, {"enable digits printer component"}},
51 {"disable-root-input", o2::framework::VariantType::Bool, false, {"do not initialize root files readers"}},
52 {"disable-root-output", o2::framework::VariantType::Bool, false, {"do not initialize root file writers"}},
53 {"configKeyValues", o2::framework::VariantType::String, "", {"Semicolon separated key=value strings"}},
54 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable sending of MC information"}},
55 {"disable-decoding-errors", o2::framework::VariantType::Bool, false, {"disable propagating decoding errors"}},
56 {"disable-trigger-reconstruction", o2::framework::VariantType::Bool, false, {"disable reconstruction of trigger data"}},
57 {"ignore-dist-stf", o2::framework::VariantType::Bool, false, {"do not subscribe to FLP/DISTSUBTIMEFRAME/0 message (no lost TF recovery)"}},
58 {"subspecificationIn", o2::framework::VariantType::Int, 0, {"Subspecification for input in case the workflow runs in parallel on multiple nodes (i.e. different FLPs)"}},
59 {"subspecificationOut", o2::framework::VariantType::Int, 0, {"Subspecification for output in case the workflow runs in parallel on multiple nodes (i.e. different FLPs)"}}};
61 std::swap(workflowOptions, options);
62}
63
64#include "Framework/runDataProcessing.h" // the main driver
65
79{
80 o2::conf::ConfigurableParam::updateFromString(cfgc.options().get<std::string>("configKeyValues"));
81 auto wf = o2::emcal::reco_workflow::getWorkflow(!cfgc.options().get<bool>("disable-mc"),
82 !cfgc.options().get<bool>("ignore-dist-stf"),
83 cfgc.options().get<bool>("enable-digits-printer"),
84 cfgc.options().get<int>("subspecificationIn"),
85 cfgc.options().get<int>("subspecificationOut"),
86 cfgc.options().get<std::string>("input-type"),
87 cfgc.options().get<std::string>("output-type"),
88 cfgc.options().get<bool>("disable-root-input"),
89 cfgc.options().get<bool>("disable-root-output"),
90 cfgc.options().get<bool>("disable-decoding-errors"),
91 cfgc.options().get<bool>("disable-trigger-reconstruction"));
92
93 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
94 o2::raw::HBFUtilsInitializer hbfIni(cfgc, wf);
95
96 return std::move(wf);
97}
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 propagateMC=true, bool askDISTSTF=true, bool enableDigitsPrinter=false, int subspecificationIn=0, int subspecificationOut=0, std::string const &cfgInput="digits", std::string const &cfgOutput="clusters", bool disableRootInput=false, bool disableRootOutput=false, bool disableDecodingErrors=false, bool disableTriggerReconstruction=false)
create the workflow for EMCAL 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))