Project
Loading...
Searching...
No Matches
CorrectionMapsHelper.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 "GPUCommonLogger.h"
14
15using namespace o2::gpu;
16using namespace o2::tpc;
17
18//________________________________________________________
20{
21 mLumiCTPAvailable = false;
22 mCorrMap = nullptr;
23 mCorrMapRef = nullptr;
24 mCorrMapMShape.reset();
25 mUpdatedFlags = 0;
26 mInstLumiCTP = 0.f;
27 mInstLumi = 0.f;
28 mMeanLumi = 0.f;
29 mMeanLumiRef = 0.f;
30}
31
32void CorrectionMapsHelper::setCorrMapMShape(std::unique_ptr<TPCFastTransform>&& m)
33{
35 mCorrMapMShape = std::move(m);
36}
37
39{
40 if (!canUseCorrections()) {
41 if (mLumiScaleMode != LumiScaleMode::NoCorrection) {
42 LOGP(warning, "Negative meanLumi={} detected, switching to NoCorrection mode for backward compatibility", mMeanLumi);
43 mLumiScaleMode = LumiScaleMode::NoCorrection;
44 }
45 mLumiScale = -1.f;
46 } else if ((mLumiScaleMode == LumiScaleMode::DerivativeMap) || (mLumiScaleMode == LumiScaleMode::DerivativeMapMC)) {
48 LOGP(debug, "mInstLumi: {} mMeanLumi: {} mMeanLumiRef: {}", mInstLumi, mMeanLumi, mMeanLumiRef);
49 } else {
51 }
53 if (report) {
55 }
56}
57
58//________________________________________________________
60{
61 auto lumiTypeName = [](LumiScaleType t) {
62 switch (t) {
63 case LumiScaleType::NoScaling:
64 return "NoScaling";
65 case LumiScaleType::CTPLumi:
66 return "CTPLumi";
67 case LumiScaleType::TPCScaler:
68 return "TPCScaler";
69 default:
70 return "Unknown";
71 }
72 };
73
74 const bool mshapeValid = (mCorrMapMShape != nullptr) && !isCorrMapMShapeDummy();
75
76 if (mLumiScaleMode == LumiScaleMode::NoCorrection) {
77 LOGP(info, "Map scaling update: mode=NoCorrection (corrections disabled, dummy map in use)");
78 } else if (mLumiScaleMode == LumiScaleMode::StaticMapOnly) {
79 LOGP(info, "Map scaling update: mode=StaticMapOnly (static reference map, no lumi scaling), M-Shape correction: {}", mshapeValid ? "applied" : "not applied");
80 } else {
81 auto lumiModeName = [](LumiScaleMode m) {
82 switch (m) {
83 case LumiScaleMode::Linear:
84 return "Linear";
85 case LumiScaleMode::DerivativeMap:
86 return "DerivativeMap";
87 case LumiScaleMode::DerivativeMapMC:
88 return "DerivativeMapMC";
89 default:
90 return "Unknown";
91 }
92 };
93 LOGP(info, "Map scaling update: LumiScaleType={} instLumi(CTP)={} instLumi(scaling)={} meanLumiRef={} meanLumi={} -> LumiScale={} lumiScaleMode={}, M-Shape correction: {}",
95 lumiModeName(mLumiScaleMode), mshapeValid ? "applied" : "not applied");
96 }
97}
Helper class to access correction maps.
std::ostringstream debug
o2::gpu::TPCFastTransform * mCorrMap
std::unique_ptr< o2::gpu::TPCFastTransform > mCorrMapMShape
void updateLumiScale(bool report=false)
void setCorrMapMShape(std::unique_ptr< o2::gpu::TPCFastTransform > &&m)
o2::gpu::TPCFastTransform * mCorrMapRef
bool isCorrMapMShapeDummy() const
return returns if the correction map for the M-shape correction is a dummy spline object
const GLfloat * m
Definition glcorearb.h:4066
void report(gsl::span< o2::InteractionTimeRecord > irs, int threshold, bool verbose)
Global TPC definitions and constants.
Definition SimTraits.h:168