Project
Loading...
Searching...
No Matches
tpc-fouriertransform-aggregator.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>
18
19using namespace o2::framework;
20
21// we need to add workflow options before including Framework/runDataProcessing
22void customize(std::vector<ConfigParamSpec>& workflowOptions)
23{
24 const std::string cruDefault = "0-" + std::to_string(o2::tpc::CRU::MaxCRU - 1);
25
26 std::vector<ConfigParamSpec> options{
27 {"rangeIDC", VariantType::Int, 200, {"Number of 1D-IDCs which will be used for the calculation of the fourier coefficients. TODO ALREADY SET IN ABERAGEGROUP"}},
28 {"nFourierCoeff", VariantType::Int, 60, {"Number of fourier coefficients (real+imag) which will be stored in the CCDB. The maximum can be 'rangeIDC + 2'."}},
29 {"nthreads", VariantType::Int, 1, {"Number of threads which will be used during the calculation of the fourier coefficients."}},
30 {"inputLanes", VariantType::Int, 2, {"Number of expected input lanes."}},
31 {"sendOutput", VariantType::Bool, false, {"send fourier coefficients"}},
32 {"use-naive-fft", VariantType::Bool, false, {"using naive fourier transform (true) or FFTW (false)"}},
33 {"process-SACs", VariantType::Bool, false, {"Process SACs instead if IDCs"}},
34 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}};
35
36 std::swap(workflowOptions, options);
37}
38
40
42{
43 using namespace o2::tpc;
44
45 // set up configuration
46 o2::conf::ConfigurableParam::updateFromString(config.options().get<std::string>("configKeyValues"));
47 o2::conf::ConfigurableParam::writeINI("o2tpcaggregate1didc_configuration.ini");
48
49 const auto sendOutput = config.options().get<bool>("sendOutput");
50 const bool fft = config.options().get<bool>("use-naive-fft");
51 const bool processSACs = config.options().get<bool>("process-SACs");
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);
54 const auto nthreadsFourier = static_cast<unsigned long>(config.options().get<int>("nthreads"));
57 const auto inputLanes = config.options().get<int>("inputLanes");
58 WorkflowSpec workflow{getTPCFourierTransformAggregatorSpec(rangeIDC, nFourierCoeff, sendOutput, processSACs, inputLanes)};
59 return workflow;
60}
TPC aggregation of 1D-IDCs and fourier transform.
static void writeINI(std::string const &filename, std::string const &keyOnly="")
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
@ MaxCRU
Definition CRU.h:31
static void setFFT(const bool fft)
static void setNThreads(const int nThreads)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
Global TPC definitions and constants.
Definition SimTraits.h:167
DataProcessorSpec getTPCFourierTransformAggregatorSpec(const unsigned int rangeIDC, const unsigned int nFourierCoefficientsStore, const bool senddebug, const bool processSACs, const int inputLanes)
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)