Project
Loading...
Searching...
No Matches
tpc-calib-gainmap-tracks.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
15#include <vector>
16#include <string>
25
26using namespace o2::framework;
27
28// customize the completion policy
29void customize(std::vector<o2::framework::CompletionPolicy>& policies)
30{
31 policies.push_back(o2::tpc::TPCSectorCompletionPolicy("calib-tpc-gainmap-tracks",
33 InputSpec{"cluster", ConcreteDataTypeMatcher{"TPC", "CLUSTERNATIVE"}})());
34}
35
36// we need to add workflow options before including Framework/runDataProcessing
37void customize(std::vector<ConfigParamSpec>& workflowOptions)
38{
39 std::vector<ConfigParamSpec> options{
40 {"debug", VariantType::Bool, false, {"create debug tree"}},
41 {"configFile", VariantType::String, "", {"configuration file for configurable parameters"}},
42 {"publish-after-tfs", VariantType::Int, 0, {"number of time frames after which to force publishing the objects"}},
43 {"useLastExtractedMapAsReference", VariantType::Bool, false, {"enabling iterative extraction of the gain map: Using the extracted gain map from the previous iteration to correct the cluster charge"}},
44 {"polynomialsFile", VariantType::String, "", {"file containing the polynomials for the track topology correction"}},
45 {"disablePolynomialsCCDB", VariantType::Bool, false, {"Do not load the polynomials from the CCDB"}},
46 {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}};
48 std::swap(workflowOptions, options);
49}
50
52
54{
55 using namespace o2::tpc;
56
57 // set up configuration
58 o2::conf::ConfigurableParam::updateFromFile(config.options().get<std::string>("configFile"));
59 o2::conf::ConfigurableParam::updateFromString(config.options().get<std::string>("configKeyValues"));
60 o2::conf::ConfigurableParam::writeINI("o2tpcpadgaintrackscalibrator_configuration.ini");
61 const auto debug = config.options().get<bool>("debug");
62 const auto publishAfterTFs = (uint32_t)config.options().get<int>("publish-after-tfs");
63 const bool useLastExtractedMapAsReference = config.options().get<bool>("useLastExtractedMapAsReference");
64 const std::string polynomialsFile = config.options().get<std::string>("polynomialsFile");
65 const auto disablePolynomialsCCDB = config.options().get<bool>("disablePolynomialsCCDB");
67 WorkflowSpec workflow;
68 if (sclOpt.needTPCScalersWorkflow()) {
69 workflow.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt.lumiType == 2, sclOpt.enableMShapeCorrection));
70 }
71 workflow.emplace_back(o2::tpc::getTPCCalibPadGainTracksSpec(publishAfterTFs, debug, useLastExtractedMapAsReference, polynomialsFile, disablePolynomialsCCDB, sclOpt));
72 return workflow;
73}
Helper class to access load maps from CCDB.
DPL completion policy helper for TPC scetor data.
std::ostringstream debug
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
static void addGlobalOptions(std::vector< o2::framework::ConfigParamSpec > &options)
static CorrectionMapsLoaderGloOpts parseGlobalOptions(const o2::framework::ConfigParamRegistry &opts)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
Global TPC definitions and constants.
Definition SimTraits.h:167
o2::framework::DataProcessorSpec getTPCCalibPadGainTracksSpec(const bool useLastExtractedMapAsReference)
create a processor spec
o2::framework::DataProcessorSpec getTPCScalerSpec(bool enableIDCs, bool enableMShape)
WorkflowSpec defineDataProcessing(ConfigContext const &config)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< o2::framework::CompletionPolicy > &policies)