Project
Loading...
Searching...
No Matches
tof-eventtime-checker-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
29#include "TOFBase/Utils.h"
31
32using namespace o2::framework;
35// ------------------------------------------------------------------
36void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
37{
39}
40
41// we need to add workflow options before including Framework/runDataProcessing
42void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
43{
44 // option allowing to set parameters
45 std::vector<o2::framework::ConfigParamSpec> options{
46 {"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation even if available"}},
47 {"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
48 {"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}},
49 {"track-sources", VariantType::String, std::string{GID::ALL}, {"comma-separated list of sources to use: allowed TPC-TOF,ITS-TPC-TOF,TPC-TRD-TOF,ITS-TPC-TRD-TOF (all)"}},
50 {"event-time-spread", o2::framework::VariantType::Float, 200.0f, {"Event time spread"}},
51 {"lhc-phase", o2::framework::VariantType::Float, 0.0f, {"LHCp phase"}},
52 {"eta-min", o2::framework::VariantType::Float, -0.8f, {"min tof eta"}},
53 {"eta-max", o2::framework::VariantType::Float, 0.8f, {"max tof eta"}},
54 {"fill-mask", o2::framework::VariantType::String, "", {"fill scheme, collision bunches"}},
55 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
57 std::swap(workflowOptions, options);
58}
59
60// ------------------------------------------------------------------
61
63
65{
66 WorkflowSpec specs;
67
68 // Update the (declared) parameters if changed from the command line
69 o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
70 // write the configuration used for the workflow
71 o2::conf::ConfigurableParam::writeINI("o2eventtime-check-tof-workflow_configuration.ini");
72
73 auto useMC = !configcontext.options().get<bool>("disable-mc");
74
75 auto spread = configcontext.options().get<float>("event-time-spread");
76 auto phase = configcontext.options().get<float>("lhc-phase");
77 auto minEta = configcontext.options().get<float>("eta-min");
78 auto maxEta = configcontext.options().get<float>("eta-max");
79 auto fillscheme = configcontext.options().get<std::string>("fill-mask");
80
85
86 while (fillscheme.size()) {
87 int bc;
88 int res = sscanf(fillscheme.c_str(), "%d", &bc);
89 if (res) {
91 } else {
92 fillscheme.clear();
93 }
94 int next = fillscheme.find(",");
95 if (next < fillscheme.size()) {
96 fillscheme.erase(0, next + 1);
97 } else {
98 fillscheme.clear();
99 }
100 }
101
102 LOG(debug) << "TOF EVENTTIME CHECKER WORKFLOW configuration";
103 LOG(debug) << "TOF track inputs = " << configcontext.options().get<std::string>("track-sources");
104
105 GID::mask_t alowedSources = GID::getSourcesMask("ITS-TPC-TOF,TPC-TOF,ITS-TPC-TRD-TOF,TPC-TRD-TOF,ITS-TPC,TPC,ITS-TPC-TRD,TPC-TRD");
106
107 GID::mask_t src = alowedSources & GID::getSourcesMask(configcontext.options().get<std::string>("track-sources"));
108 GID::mask_t mcmaskcl;
110 GID::mask_t clustermask = GID::getSourcesMask("TOF");
111
112 if (useMC) {
113 mcmaskcl |= GID::getSourceMask(GID::TOF);
114 }
115 // pass strict flag to fetch eventual TPC-TRD input with correct subspec
116 o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, clustermask, src, src, useMC, mcmaskcl, GID::getSourcesMask(GID::ALL), false);
117
118 specs.emplace_back(o2::globaltracking::getTOFEventTimeCheckerSpec(src, useMC)); // doTPCrefit not yet supported (need to load TPC clusters?)
119
120 o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
121
122 return std::move(specs);
123}
uint64_t phase
Definition RawEventData.h:7
uint64_t bc
Definition RawEventData.h:5
Global index for barrel track: provides provenance (detectors combination), index in respective array...
Helper function to tokenize sequences and ranges of integral numbers.
uint32_t res
Definition RawData.h:0
DPL completion policy helper for TPC scetor data.
std::ostringstream debug
static void writeINI(std::string const &filename, std::string const &keyOnly="")
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
static constexpr std::string_view ALL
keywork for all sources
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 float mEtaMin
Definition Utils.h:60
static void addInteractionBC(int bc, bool fromCollisonCotext=false)
Definition Utils.cxx:52
static float mLHCPhase
Definition Utils.h:62
static float mEventTimeSpread
Definition Utils.h:59
static float mEtaMax
Definition Utils.h:61
GLenum src
Definition glcorearb.h:1767
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
framework::DataProcessorSpec getTOFEventTimeCheckerSpec(o2::dataformats::GlobalTrackID::mask_t src, bool useMC)
create a processor spec
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))
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
WorkflowSpec defineDataProcessing(ConfigContext const &configcontext)
void customize(std::vector< o2::framework::CallbacksPolicy > &policies)