Project
Loading...
Searching...
No Matches
digit-reader-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
12#include <string>
13#include <vector>
14#include "Framework/Variant.h"
22
23using namespace o2::framework;
24using namespace o2::emcal;
25
26// ------------------------------------------------------------------
27void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
28{
30}
31
32// we need to add workflow options before including Framework/runDataProcessing
33void customize(std::vector<ConfigParamSpec>& workflowOptions)
34{
35 std::vector<ConfigParamSpec> options{{"disable-mc", VariantType::Bool, false, {"Do not propagate MC labels"}},
36 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}};
38 workflowOptions.insert(workflowOptions.end(), options.begin(), options.end());
39}
40
42
44{
45 bool disableMC = cfgc.options().get<bool>("disable-mc");
46 o2::conf::ConfigurableParam::updateFromString(cfgc.options().get<std::string>("configKeyValues"));
47
48 WorkflowSpec specs;
49 specs.emplace_back(o2::emcal::getPublisherSpec<std::vector<o2::emcal::Digit>>(PublisherConf{
50 "emcal-digit-reader",
51 "o2sim",
52 "emcdigits.root",
53 {"digitbranch", "EMCALDigit", "Digit branch"},
54 {"digittriggerbranch", "EMCALDigitTRGR", "Trigger record branch"},
55 {"mcbranch", "EMCALDigitMCTruth", "MC label branch"},
56 o2::framework::OutputSpec{"EMC", "DIGITS"},
57 o2::framework::OutputSpec{"EMC", "DIGITSTRGR"},
58 o2::framework::OutputSpec{"EMC", "DIGITSMCTR"}},
59 !disableMC));
60
61 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
62 o2::raw::HBFUtilsInitializer hbfIni(cfgc, specs);
63
64 return specs;
65}
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
framework::DataProcessorSpec getPublisherSpec(PublisherConf const &config, uint32_t subspec=0, bool propagateMC=true)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
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))