Project
Loading...
Searching...
No Matches
tpc-fouriertransform-epn.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
12#include <vector>
13#include <string>
19
20using namespace o2::framework;
21
22// we need to add workflow options before including Framework/runDataProcessing
23void customize(std::vector<ConfigParamSpec>& workflowOptions)
24{
25 const std::string cruDefault = "0-" + std::to_string(o2::tpc::CRU::MaxCRU - 1);
26
27 std::vector<ConfigParamSpec> options{
28 {"configFile", VariantType::String, "", {"configuration file for configurable parameters"}},
29 {"rangeIDC", VariantType::Int, 200, {"Number of 1D-IDCs which will be used for the calculation of the fourier coefficients."}},
30 {"nFourierCoeff", VariantType::Int, 60, {"Number of fourier coefficients (real+imag) which will be stored in the CCDB. The maximum can be 'rangeIDC + 2'."}},
31 {"use-naive-fft", VariantType::Bool, false, {"using naive fourier transform (true) or FFTW (false)"}},
32 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}},
33 {"crus", VariantType::String, cruDefault.c_str(), {"List of CRUs, comma separated ranges, e.g. 0-3,7,9-15"}}};
34
35 std::swap(workflowOptions, options);
36}
37
39
41{
42 using namespace o2::tpc;
43
44 // set up configuration
45 o2::conf::ConfigurableParam::updateFromFile(config.options().get<std::string>("configFile"));
46 o2::conf::ConfigurableParam::updateFromString(config.options().get<std::string>("configKeyValues"));
47 o2::conf::ConfigurableParam::writeINI("o2tpcftidcsync_configuration.ini");
48
49 const auto tpcCRUs = o2::RangeTokenizer::tokenize<int>(config.options().get<std::string>("crus"));
50 const auto nCRUs = tpcCRUs.size();
51 const bool fft = config.options().get<bool>("use-naive-fft");
52 const auto rangeIDC = static_cast<unsigned int>(config.options().get<int>("rangeIDC"));
53 const auto nFourierCoeff = std::clamp(static_cast<unsigned int>(config.options().get<int>("nFourierCoeff")), static_cast<unsigned int>(0), rangeIDC + 2);
55
56 WorkflowSpec workflow;
57 const auto first = tpcCRUs.begin();
58 const auto last = std::min(tpcCRUs.end(), first + nCRUs);
59 const std::vector<uint32_t> rangeCRUs(first, last);
60 workflow.emplace_back(getTPCFourierTransformEPNSpec(rangeCRUs, rangeIDC, nFourierCoeff));
61
62 return workflow;
63}
Helper function to tokenize sequences and ranges of integral numbers.
fourier transform of 1D-IDCs used during synchronous reconstruction
static void writeINI(std::string const &filename, std::string const &keyOnly="")
static void updateFromFile(std::string const &, std::string const &paramsList="", bool unchangedOnly=false)
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
@ MaxCRU
Definition CRU.h:31
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
Global TPC definitions and constants.
Definition SimTraits.h:167
DataProcessorSpec getTPCFourierTransformEPNSpec(const std::vector< uint32_t > &crus, const unsigned int rangeIDC, const unsigned int nFourierCoefficientsSend)
std::string to_string(gsl::span< T, Size > span)
Definition common.h:52
WorkflowSpec defineDataProcessing(ConfigContext const &config)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< ConfigParamSpec > &workflowOptions)