Project
Loading...
Searching...
No Matches
CorrectionMapsOptions.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
13#include "Framework/Logger.h"
16using namespace o2::tpc;
17using namespace o2::framework;
18
19//________________________________________________________
21{
23 auto lumiTypeVal = opts.get<int>("lumi-type");
24 if (lumiTypeVal < -1 || lumiTypeVal > 2) {
25 LOGP(fatal, "Invalid lumi-type value: {}", lumiTypeVal);
26 }
27 tpcopt.lumiType = static_cast<LumiScaleType>(lumiTypeVal);
28
29 auto lumiModeVal = opts.get<int>("corrmap-lumi-mode");
30 if (lumiModeVal < -1 || lumiModeVal > 2) {
31 LOGP(fatal, "Invalid corrmap-lumi-mode value: {}", lumiModeVal);
32 }
33 tpcopt.lumiMode = static_cast<LumiScaleMode>(lumiModeVal);
34
35 tpcopt.enableMShapeCorrection = opts.get<bool>("enable-M-shape-correction");
36 tpcopt.requestCTPLumi = !opts.get<bool>("disable-ctp-lumi-request");
37 tpcopt.checkCTPIDCconsistency = !opts.get<bool>("disable-lumi-type-consistency-check");
38 if (!tpcopt.requestCTPLumi && tpcopt.lumiType == LumiScaleType::CTPLumi) {
39 LOGP(fatal, "Scaling with CTP Lumi is requested but this input is disabled");
40 }
41 return tpcopt;
42}
43
44void CorrectionMapsOptions::addGlobalOptions(std::vector<ConfigParamSpec>& options)
45{
46 // these are options which should be added at the workflow level, since they modify the inputs of the devices
47 addOption(options, ConfigParamSpec{"lumi-type", o2::framework::VariantType::Int, 0, {"1 = use CTP lumi for TPC correction scaling, 2 = use TPC scalers for TPC correction scaling"}});
48 addOption(options, ConfigParamSpec{"corrmap-lumi-mode", o2::framework::VariantType::Int, 0, {"scaling mode: (default) 0 = static + scale * full; 1 = full + scale * derivative; 2 = full + scale * derivative (for MC)"}});
49 addOption(options, ConfigParamSpec{"enable-M-shape-correction", o2::framework::VariantType::Bool, false, {"Enable M-shape distortion correction"}});
50 addOption(options, ConfigParamSpec{"disable-ctp-lumi-request", o2::framework::VariantType::Bool, false, {"do not request CTP lumi (regardless what is used for corrections)"}});
51 addOption(options, ConfigParamSpec{"disable-lumi-type-consistency-check", o2::framework::VariantType::Bool, false, {"disable check of selected CTP or IDC scaling source being consistent with the map"}});
52}
53
54void CorrectionMapsOptions::addOption(std::vector<ConfigParamSpec>& options, ConfigParamSpec&& osp)
55{
56 if (std::find(options.begin(), options.end(), osp) == options.end()) {
57 options.emplace_back(osp);
58 }
59}
Helper class to parse options for correction maps.
static void addGlobalOptions(std::vector< o2::framework::ConfigParamSpec > &options)
static CorrectionMapsGloOpts parseGlobalOptions(const o2::framework::ConfigParamRegistry &opts)
static void addOption(std::vector< o2::framework::ConfigParamSpec > &options, o2::framework::ConfigParamSpec &&osp)
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
Global TPC definitions and constants.
Definition SimTraits.h:168
@ CTPLumi
use CTP luminosity for scaling
LumiScaleType lumiType
what estimator to used for corrections scaling: 0: no scaling, 1: CTP, 2: IDC
bool checkCTPIDCconsistency
check the selected CTP or IDC scaling source being consistent with mean scaler of the map
bool requestCTPLumi
request CTP Lumi regardless of what is used for corrections scaling
LumiScaleMode lumiMode
what corrections method to use: 0: classical scaling, 1: Using of the derivative map,...