Project
Loading...
Searching...
No Matches
GlobalTrackClusterReader.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
18
19using namespace o2::framework;
20using namespace o2::globaltracking;
21using namespace o2::dataformats;
22
23void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
24{
26}
27
28void customize(std::vector<ConfigParamSpec>& workflowOptions)
29{
30 std::vector<o2::framework::ConfigParamSpec> options{
31 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable visualization of MC data"}},
32 {"track-types", VariantType::String, std::string{GlobalTrackID::NONE}, {"comma-separated list of track sources to read"}},
33 {"cluster-types", VariantType::String, std::string{GlobalTrackID::NONE}, {"comma-separated list of cluster sources to read"}},
34 {"primary-vertices", VariantType::Bool, false, {"read primary vertices"}},
35 {"secondary-vertices", VariantType::Bool, false, {"read secondary vertices"}},
36 {"cosmic", VariantType::Bool, false, {"read cosmic tracks"}},
37 {"ir-frames-its", VariantType::Bool, false, {"read ITS IR frames"}},
38 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable reading root files, essentially making this workflow void, but needed for compatibility"}},
39 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
41 std::swap(workflowOptions, options);
42}
43
45
47{
48 WorkflowSpec specs;
49 o2::conf::ConfigurableParam::updateFromString(cfgc.options().get<std::string>("configKeyValues"));
50
51 bool useMC = !cfgc.options().get<bool>("disable-mc");
52 GlobalTrackID::mask_t srcTrk = GlobalTrackID::getSourcesMask(cfgc.options().get<std::string>("track-types"));
53 GlobalTrackID::mask_t srcCl = GlobalTrackID::getSourcesMask(cfgc.options().get<std::string>("cluster-types"));
54 bool pv = cfgc.options().get<bool>("primary-vertices");
55 bool sv = cfgc.options().get<bool>("secondary-vertices");
56 bool cosm = cfgc.options().get<bool>("cosmic");
57 bool irits = cfgc.options().get<bool>("ir-frames-its");
58
59 if (!cfgc.helpOnCommandLine() && srcTrk.none() && srcCl.none() && !(pv || sv || cosm || irits)) {
60 throw std::runtime_error("nothing requested to read");
61 }
62 auto srcMtc = srcTrk & ~GlobalTrackID::getSourceMask(GlobalTrackID::MFTMCH); // Do not request MFTMCH matches
63 InputHelper::addInputSpecs(cfgc, specs, srcCl, srcMtc, srcTrk, useMC);
64 if (pv) {
65 InputHelper::addInputSpecsPVertex(cfgc, specs, useMC);
66 }
67 if (sv) {
69 }
70 if (cosm) {
71 InputHelper::addInputSpecsCosmics(cfgc, specs, useMC);
72 }
73 if (irits) {
75 }
76
77 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
78 o2::raw::HBFUtilsInitializer hbfIni(cfgc, specs);
79
80 return std::move(specs);
81}
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)
Global index for barrel track: provides provenance (detectors combination), index in respective array...
static void updateFromString(std::string const &)
static mask_t getSourcesMask(const std::string_view srcList)
static constexpr std::string_view NONE
keywork for no sources
ConfigParamRegistry & options() const
static int addInputSpecs(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs, GID::mask_t maskClusters, GID::mask_t maskMatches, GID::mask_t maskTracks, bool useMC=true, GID::mask_t maskClustersMC=GID::getSourcesMask(GID::ALL), GID::mask_t maskTracksMC=GID::getSourcesMask(GID::ALL), bool subSpecStrict=false)
static int addInputSpecsIRFramesITS(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs)
static int addInputSpecsSVertex(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs)
static int addInputSpecsCosmics(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs, bool mc)
static int addInputSpecsPVertex(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs, bool mc)
Definition of a container to keep/associate and arbitrary number of labels associated to an index wit...
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))