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
24
28#include <vector>
29
30using namespace o2::framework;
31using namespace o2::strangeness_tracking;
34
35void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
36{
38}
39
40void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
41{
42 // option allowing to set parameters
43 std::vector<o2::framework::ConfigParamSpec> options{
44 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
45 {"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}},
46 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC"}},
47 {"use-full-geometry", o2::framework::VariantType::Bool, false, {"use full geometry instead of the light-weight ITS part"}},
48 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}};
50 std::swap(workflowOptions, options);
51}
52
53// ------------------------------------------------------------------
54
56#include "Framework/Logger.h"
57
59{
60 // Update the (declared) parameters if changed from the command line
61 auto useMC = !configcontext.options().get<bool>("disable-mc");
62 auto useRootInput = !configcontext.options().get<bool>("disable-root-input");
63 auto disableRootOut = configcontext.options().get<bool>("disable-root-output");
64 auto useGeom = configcontext.options().get<bool>("use-full-geometry");
65
66 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
67 o2::conf::ConfigurableParam::writeINI("o2strangeness_tracking_workflow_configuration.ini");
68 GID::mask_t itsSource = GID::getSourceMask(GID::ITS); // ITS tracks and clusters
69
70 WorkflowSpec specs;
71 specs.emplace_back(o2::strangeness_tracking::getStrangenessTrackerSpec(itsSource, useMC, useGeom));
72 o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, itsSource, itsSource, itsSource, useMC, itsSource);
73 o2::globaltracking::InputHelper::addInputSpecsPVertex(configcontext, specs, useMC); // P-vertex is always needed
74 o2::globaltracking::InputHelper::addInputSpecsSVertex(configcontext, specs); // S-vertex is always needed
75
76 if (!disableRootOut) {
77 specs.emplace_back(getStrangenessTrackingWriterSpec(useMC));
78 }
79
80 // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit
81 o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
82
83 // write the configuration used for the reco workflow
84
85 return std::move(specs);
86}
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 PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
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 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))