Project
Loading...
Searching...
No Matches
strangeness-tracking-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
14
25
29#include <vector>
30
31using namespace o2::framework;
32using namespace o2::strangeness_tracking;
35
36void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
37{
39}
40
41void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
42{
43 // option allowing to set parameters
44 std::vector<o2::framework::ConfigParamSpec> options{
45 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
46 {"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}},
47 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC"}},
48 {"use-full-geometry", o2::framework::VariantType::Bool, false, {"use full geometry instead of the light-weight ITS part"}},
49 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}};
52 std::swap(workflowOptions, options);
53}
54
55// ------------------------------------------------------------------
56
58#include "Framework/Logger.h"
59
61{
62 // Update the (declared) parameters if changed from the command line
63 auto useMC = !configcontext.options().get<bool>("disable-mc");
64 auto useRootInput = !configcontext.options().get<bool>("disable-root-input");
65 auto disableRootOut = configcontext.options().get<bool>("disable-root-output");
66 auto useGeom = configcontext.options().get<bool>("use-full-geometry");
67
68 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
69 o2::conf::ConfigurableParam::writeINI("o2strangeness_tracking_workflow_configuration.ini");
70 GID::mask_t itsSource = GID::getSourceMask(GID::ITS); // ITS tracks and clusters
71
72 WorkflowSpec specs;
73 specs.emplace_back(o2::strangeness_tracking::getStrangenessTrackerSpec(itsSource, useMC, useGeom));
74 o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, itsSource, itsSource, itsSource, useMC, itsSource);
75 o2::globaltracking::InputHelper::addInputSpecsPVertex(configcontext, specs, useMC); // P-vertex is always needed
76 o2::globaltracking::InputHelper::addInputSpecsSVertex(configcontext, specs); // S-vertex is always needed
77
78 if (!disableRootOut) {
79 specs.emplace_back(getStrangenessTrackingWriterSpec(useMC));
80 }
81
82 // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit
83 o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
84
85 // write the configuration used for the reco workflow
86
87 return std::move(specs);
88}
Global index for barrel track: provides provenance (detectors combination), index in respective array...
static void writeINI(std::string const &filename, std::string const &keyOnly="")
static void updateFromString(std::string const &)
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:58
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 addInputSpecsSVertex(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs)
static int addInputSpecsPVertex(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs, bool mc)
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::vector< DataProcessorSpec > WorkflowSpec
o2::framework::DataProcessorSpec getStrangenessTrackerSpec(o2::dataformats::GlobalTrackID::mask_t src, bool useMC, bool useGeom)
o2::framework::DataProcessorSpec getStrangenessTrackingWriterSpec(bool useMC)
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)
static void addITSConfigOption(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))