Project
Loading...
Searching...
No Matches
TPCFastSpaceChargeCorrectionMap.h
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
16
17#ifndef ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_TPCFASTSPACECHARGECORRECTIONMAP_H
18#define ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_TPCFASTSPACECHARGECORRECTIONMAP_H
19
20#include "GPUCommonDef.h"
21#include "GPUCommonRtypes.h"
22#include <vector>
23
24namespace o2::gpu
25{
26
37{
38 public:
43 double mY{0.}, mZ{0.}; // not-distorted local coordinates
44 double mDx{0.}, mDy{0.}, mDz{0.}; // corrections to the local coordinates
45 double mWeight{0.}; // weight of the point
46 };
47
49
51 TPCFastSpaceChargeCorrectionMap(int32_t nSectors, int32_t nRows)
52 {
53 init(nSectors, nRows);
54 }
55
58
60 void init(int32_t nSectors, int32_t nRows)
61 {
62 mNsectors = nSectors;
63 mNrows = nRows;
64 int32_t n = mNsectors * mNrows;
65 fDataPoints.resize(n);
66 for (uint32_t i = 0; i < fDataPoints.size(); ++i) {
67 fDataPoints[i].clear();
68 }
69 }
70
72 void addCorrectionPoint(int32_t iSector, int32_t iRow,
73 double y, double z,
74 double dx, double dy, double dz, double weight)
75 {
76 int32_t ind = mNrows * iSector + iRow;
77 fDataPoints.at(ind).push_back(CorrectionPoint{y, z,
78 dx, dy, dz, weight});
79 }
80
81 const std::vector<CorrectionPoint>& getPoints(int32_t iSector, int32_t iRow) const
82 {
83 int32_t ind = mNrows * iSector + iRow;
84 return fDataPoints.at(ind);
85 }
86
87 int32_t getNsectors() const { return mNsectors; }
88
89 int32_t getNrows() const { return mNrows; }
90
91 bool isInitialized() const { return mNsectors > 0 && mNrows > 0; }
92
93 private:
95 int32_t mNsectors{0};
96 int32_t mNrows{0};
97 std::vector<std::vector<CorrectionPoint>> fDataPoints;
98
99 ClassDefNV(TPCFastSpaceChargeCorrectionMap, 0);
100};
101
102} // namespace o2::gpu
103
104#endif
int32_t i
uint32_t iSector
const std::vector< CorrectionPoint > & getPoints(int32_t iSector, int32_t iRow) const
void init(int32_t nSectors, int32_t nRows)
(re-)init the map
void addCorrectionPoint(int32_t iSector, int32_t iRow, double y, double z, double dx, double dy, double dz, double weight)
Starts the construction procedure, reserves temporary memory.
TPCFastSpaceChargeCorrectionMap(int32_t nSectors, int32_t nRows)
_____________ Constructors / destructors __________________________
~TPCFastSpaceChargeCorrectionMap()=default
Destructor.
GLdouble n
Definition glcorearb.h:1982
GLuint GLuint GLfloat weight
Definition glcorearb.h:5477
GLint y
Definition glcorearb.h:270
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843