Project
Loading...
Searching...
No Matches
digits-writer-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
20#include "Framework/Lifetime.h"
21#include "Framework/Output.h"
22#include "Framework/Task.h"
25#include <fstream>
26#include <iostream>
27#include <random>
28#include <set>
29#include <sstream>
30#include <stdexcept>
31#include <string>
33
34using namespace o2::framework;
35
36void customize(std::vector<CompletionPolicy>& policies)
37{
38 // ordered policies for the writers
39 policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:MCH|mch).*[W,w]riter.*"));
40}
41
46void customize(std::vector<ConfigParamSpec>& workflowOptions)
47{
48 workflowOptions.emplace_back(ConfigParamSpec{"input-digits-data-description", VariantType::String, "DIGITS", {"description string for the input digits data"}});
49 workflowOptions.emplace_back(ConfigParamSpec{"input-digitrofs-data-description", VariantType::String, "DIGITROFS", {"description string for the input digit rofs data"}});
50 workflowOptions.emplace_back(ConfigParamSpec{"input-digitlabels-data-description", VariantType::String, "DIGITLABELS", {"description string for the input digit labels data"}});
51 workflowOptions.emplace_back(ConfigParamSpec{"enable-mc", VariantType::Bool, false, {" output MC labels if available "}});
52 workflowOptions.emplace_back(ConfigParamSpec{"mch-digit-outfile", VariantType::String, "mchdigits.root", {"name of digit root file"}});
53}
54
56
58{
59 bool useMC = cc.options().get<bool>("enable-mc");
60 auto name = fmt::format("mch-digit-writer-{}-{}",
61 cc.options().get<std::string>("input-digits-data-description"),
62 cc.options().get<std::string>("input-digitrofs-data-description"));
63
65 useMC,
66 name,
67 cc.options().get<std::string>("mch-digit-outfile"),
68 cc.options().get<std::string>("input-digits-data-description"),
69 cc.options().get<std::string>("input-digitrofs-data-description"),
70 cc.options().get<std::string>("input-digitlabels-data-description"))};
71}
WorkflowSpec defineDataProcessing(const ConfigContext &cc)
void customize(std::vector< CompletionPolicy > &policies)
GLuint const GLchar * name
Definition glcorearb.h:781
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
o2::framework::DataProcessorSpec getDigitWriterSpec(bool useMC, std::string_view specName="mch-digit-writer", std::string_view outfile="mchdigits.root", std::string_view inputDigitDataDescription="DIGITS", std::string_view inputDigitRofDataDescription="DIGITROFS", std::string_view inputDigitLabelDataDescription="DIGITLABELS")
static CompletionPolicy consumeWhenAllOrdered(const char *name, CompletionPolicy::Matcher matcher)
as consumeWhenAll, but ensures that records are processed with incremental timeSlice (DataHeader::sta...
std::vector< o2::mch::ChannelCode > cc