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
25{
26namespace gpu
27{
28
39{
40 public:
45 double mY, mZ; // not-distorted local coordinates
46 double mDx, mDy, mDz; // corrections to the local coordinates
47 };
48
50
52 TPCFastSpaceChargeCorrectionMap(int32_t nRocs, int32_t nRows)
53 {
54 init(nRocs, nRows);
55 }
56
59
61 void init(int32_t nRocs, int32_t nRows)
62 {
63 mNrocs = nRocs;
64 mNrows = nRows;
65 int32_t n = mNrocs * mNrows;
66 fDataPoints.resize(n);
67 for (uint32_t i = 0; i < fDataPoints.size(); ++i) {
68 fDataPoints[i].clear();
69 }
70 }
71
73 void addCorrectionPoint(int32_t iRoc, int32_t iRow,
74 double y, double z,
75 double dx, double dy, double dz)
76 {
77 int32_t ind = mNrows * iRoc + iRow;
78 fDataPoints.at(ind).push_back(CorrectionPoint{y, z,
79 dx, dy, dz});
80 }
81
82 const std::vector<CorrectionPoint>& getPoints(int32_t iRoc, int32_t iRow) const
83 {
84 int32_t ind = mNrows * iRoc + iRow;
85 return fDataPoints.at(ind);
86 }
87
88 int32_t getNrocs() const { return mNrocs; }
89
90 int32_t getNrows() const { return mNrows; }
91
92 bool isInitialized() const { return mNrocs > 0 && mNrows > 0; }
93
94 private:
96 int32_t mNrocs{0};
97 int32_t mNrows{0};
98 std::vector<std::vector<CorrectionPoint>> fDataPoints;
99
100 ClassDefNV(TPCFastSpaceChargeCorrectionMap, 0);
101};
102
103} // namespace gpu
104} // namespace o2
105
106#endif
int32_t i
void addCorrectionPoint(int32_t iRoc, int32_t iRow, double y, double z, double dx, double dy, double dz)
Starts the construction procedure, reserves temporary memory.
~TPCFastSpaceChargeCorrectionMap()=default
Destructor.
const std::vector< CorrectionPoint > & getPoints(int32_t iRoc, int32_t iRow) const
void init(int32_t nRocs, int32_t nRows)
(re-)init the map
TPCFastSpaceChargeCorrectionMap(int32_t nRocs, int32_t nRows)
_____________ Constructors / destructors __________________________
GLdouble n
Definition glcorearb.h:1982
GLint y
Definition glcorearb.h:270
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...