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
19
20using namespace o2::framework;
21using namespace o2::globaltracking;
22using namespace o2::dataformats;
23
24void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
25{
27}
28
29void customize(std::vector<ConfigParamSpec>& workflowOptions)
30{
31 std::vector<o2::framework::ConfigParamSpec> options{
32 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable visualization of MC data"}},
33 {"track-types", VariantType::String, std::string{GlobalTrackID::NONE}, {"comma-separated list of track sources to read"}},
34 {"cluster-types", VariantType::String, std::string{GlobalTrackID::NONE}, {"comma-separated list of cluster sources to read"}},
35 {"primary-vertices", VariantType::Bool, false, {"read primary vertices"}},
36 {"secondary-vertices", VariantType::Bool, false, {"read secondary vertices"}},
37 {"cosmic", VariantType::Bool, false, {"read cosmic tracks"}},
38 {"ir-frames-its", VariantType::Bool, false, {"read ITS IR frames"}},
39 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable reading root files, essentially making this workflow void, but needed for compatibility"}},
40 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
43 std::swap(workflowOptions, options);
44}
45
47
49{
50 WorkflowSpec specs;
51 o2::conf::ConfigurableParam::updateFromString(cfgc.options().get<std::string>("configKeyValues"));
52
53 bool useMC = !cfgc.options().get<bool>("disable-mc");
54 GlobalTrackID::mask_t srcTrk = GlobalTrackID::getSourcesMask(cfgc.options().get<std::string>("track-types"));
55 GlobalTrackID::mask_t srcCl = GlobalTrackID::getSourcesMask(cfgc.options().get<std::string>("cluster-types"));
56 bool pv = cfgc.options().get<bool>("primary-vertices");
57 bool sv = cfgc.options().get<bool>("secondary-vertices");
58 bool cosm = cfgc.options().get<bool>("cosmic");
59 bool irits = cfgc.options().get<bool>("ir-frames-its");
60
61 if (!cfgc.helpOnCommandLine() && srcTrk.none() && srcCl.none() && !(pv || sv || cosm || irits)) {
62 throw std::runtime_error("nothing requested to read");
63 }
64 auto srcMtc = srcTrk & ~GlobalTrackID::getSourceMask(GlobalTrackID::MFTMCH); // Do not request MFTMCH matches
65 InputHelper::addInputSpecs(cfgc, specs, srcCl, srcMtc, srcTrk, useMC);
66 if (pv) {
67 InputHelper::addInputSpecsPVertex(cfgc, specs, useMC);
68 }
69 if (sv) {
71 }
72 if (cosm) {
73 InputHelper::addInputSpecsCosmics(cfgc, specs, useMC);
74 }
75 if (irits) {
77 }
78
79 // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
80 o2::raw::HBFUtilsInitializer hbfIni(cfgc, specs);
81
82 return std::move(specs);
83}
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 ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::vector< DataProcessorSpec > WorkflowSpec
static void addConfigOption(std::vector< o2::framework::ConfigParamSpec > &opts)
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))