Project
Loading...
Searching...
No Matches
TPCPadGainCalib.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 "TPCPadGainCalib.h"
16
17#include "GPUTPCGeometry.h"
19
20using namespace o2::gpu;
21
23{
24 GPUTPCGeometry geo{};
25 int32_t offset = 0;
26 for (int32_t r = 0; r < GPUCA_ROW_COUNT; r++) {
27 mPadOffsetPerRow[r] = offset;
28 offset += geo.NPads(r);
29 }
30}
31
32#ifndef GPUCA_STANDALONE
33#include "TPCBase/CalDet.h"
34
39
40TPCPadGainCalib::TPCPadGainCalib(const o2::tpc::CalDet<float>& gainMap, const float minValue, const float maxValue, const bool inv) : TPCPadGainCalib()
41{
42 setMinCorrectionFactor(minValue);
43 setMaxCorrectionFactor(maxValue);
44 setFromMap(gainMap, inv);
45}
46
47void TPCPadGainCalib::setFromMap(const o2::tpc::CalDet<float>& gainMap, const bool inv)
48{
49 for (int32_t sector = 0; sector < o2::tpc::constants::MAXSECTOR; sector++) {
50 for (int32_t p = 0; p < TPC_PADS_IN_SECTOR; p++) {
51 const float gainVal = gainMap.getValue(sector, p);
52 inv ? mGainCorrection[sector].set(p, (gainVal > 1.e-5f) ? 1.f / gainVal : 1.f) : mGainCorrection[sector].set(p, gainVal);
53 }
54 }
55}
56#endif
#define GPUCA_ROW_COUNT
const T getValue(const int sec, const int globalPadInSector) const
Definition CalDet.h:154
#define TPC_PADS_IN_SECTOR
GLintptr offset
Definition glcorearb.h:660
GLboolean r
Definition glcorearb.h:1233
constexpr int MAXSECTOR
Definition Constants.h:28
void setFromMap(const o2::tpc::CalDet< float > &, const bool inv=true)