Project
Loading...
Searching...
No Matches
TPCFastSpaceChargeCorrectionHelper.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
20
21#ifndef ALICEO2_TPC_TPCFastSpaceChargeCorrectionHelper_H_
22#define ALICEO2_TPC_TPCFastSpaceChargeCorrectionHelper_H_
23
24#include "Rtypes.h"
25#include <functional>
28#include "TPCFastTransformGeo.h"
30
31class TTree;
32
33namespace o2
34{
35namespace tpc
36{
37
38class TrackResiduals;
39
40using namespace o2::gpu;
41
43{
44 public:
46
49
52
55
58
61
63
65 void setNthreads(int n);
66
69
71 int getNthreads() const { return mNthreads; }
72
74
76 std::unique_ptr<TPCFastSpaceChargeCorrection> createFromLocalCorrection(
77 std::function<void(int roc, int irow, double y, double z, double& dx, double& dy, double& dz)> correctionLocal,
78 const int nKnotsY = 10, const int nKnotsZ = 20);
79
81 std::unique_ptr<TPCFastSpaceChargeCorrection> createFromGlobalCorrection(
82 std::function<void(int roc, double gx, double gy, double gz,
83 double& dgx, double& dgy, double& dgz)>
84 correctionGlobal,
85 const int nKnotsY = 10, const int nKnotsZ = 20);
86
98 std::unique_ptr<o2::gpu::TPCFastSpaceChargeCorrection> createFromTrackResiduals(
99 const o2::tpc::TrackResiduals& trackResiduals, TTree* voxResTree, TTree* voxResTreeInverse, //
100 bool useSmoothed, bool invertSigns, //
101 TPCFastSpaceChargeCorrectionMap* fitPointsDirect = nullptr,
102 TPCFastSpaceChargeCorrectionMap* fitPointsInverse = nullptr);
103
105
106 const TPCFastTransformGeo& getGeometry() { return mGeo; }
107
109
110 void testGeometry(const TPCFastTransformGeo& geo) const;
111
113 void initInverse(o2::gpu::TPCFastSpaceChargeCorrection& correction, bool prn);
114
116 void initInverse(std::vector<o2::gpu::TPCFastSpaceChargeCorrection*>& corrections, const std::vector<float>& scaling, bool prn);
117
124 void mergeCorrections(
125 o2::gpu::TPCFastSpaceChargeCorrection& mainCorrection, float scale,
126 const std::vector<std::pair<const o2::gpu::TPCFastSpaceChargeCorrection*, float>>& additionalCorrections, bool prn);
127
130 {
131 mVoxelMeanValidityRange = range;
132 }
133
134 double getVoxelMeanValidityRange() const { return mVoxelMeanValidityRange; }
135
138
139 bool isDebugUseVoxelCenters() const { return mDebugUseVoxelCenters; }
140
143
144 bool isDebugMirrorAdata2C() const { return mDebugMirrorAdata2C; }
145
146 private:
148 void initGeometry();
149
150 void fillSpaceChargeCorrectionFromMap(TPCFastSpaceChargeCorrection& correction, bool processingInverseCorrection);
151
152 static TPCFastSpaceChargeCorrectionHelper* sInstance;
153 bool mIsInitialized = 0;
154 int mNthreads = 1;
156
157 TPCFastSpaceChargeCorrectionMap mCorrectionMap{0, 0};
158
159 double mVoxelMeanValidityRange{1.1};
160
161 bool mDebugUseVoxelCenters{false};
162 bool mDebugMirrorAdata2C{false};
163
165};
166
167} // namespace tpc
168} // namespace o2
169#endif
uint32_t roc
Definition RawData.h:3
Definition of TPCFastSpaceChargeCorrectionMap class.
Definition of TPCFastSpaceChargeCorrection class.
Definition of TPCFastTransformGeo class.
Definition of the TrackResiduals class.
std::unique_ptr< TPCFastSpaceChargeCorrection > createFromLocalCorrection(std::function< void(int roc, int irow, double y, double z, double &dx, double &dy, double &dz)> correctionLocal, const int nKnotsY=10, const int nKnotsZ=20)
_______________ Main functionality ________________________
const TPCFastTransformGeo & getGeometry()
_______________ Utilities ________________________
void setVoxelMeanValidityRange(double range)
how far the voxel mean is allowed to be outside of the voxel (1.1 means 10%)
void initInverse(o2::gpu::TPCFastSpaceChargeCorrection &correction, bool prn)
initialise inverse transformation
std::unique_ptr< o2::gpu::TPCFastSpaceChargeCorrection > createFromTrackResiduals(const o2::tpc::TrackResiduals &trackResiduals, TTree *voxResTree, TTree *voxResTreeInverse, bool useSmoothed, bool invertSigns, TPCFastSpaceChargeCorrectionMap *fitPointsDirect=nullptr, TPCFastSpaceChargeCorrectionMap *fitPointsInverse=nullptr)
~TPCFastSpaceChargeCorrectionHelper()=default
Destructor.
std::unique_ptr< TPCFastSpaceChargeCorrection > createFromGlobalCorrection(std::function< void(int roc, double gx, double gy, double gz, double &dgx, double &dgy, double &dgz)> correctionGlobal, const int nKnotsY=10, const int nKnotsZ=20)
creates TPCFastSpaceChargeCorrection object from a continious space charge correction in global coord...
void testGeometry(const TPCFastTransformGeo &geo) const
void setDebugMirrorAdata2C()
debug: if true, mirror the data from the A side to the C side of the TPC
TPCFastSpaceChargeCorrectionHelper()=default
_____________ Constructors / destructors __________________________
void setNthreads(int n)
_______________ Settings ________________________
TPCFastSpaceChargeCorrectionHelper(const TPCFastSpaceChargeCorrectionHelper &)=delete
Copy constructor: disabled.
void setDebugUseVoxelCenters()
debug: if true, use voxel centers instead of the fitted positions for correction
void mergeCorrections(o2::gpu::TPCFastSpaceChargeCorrection &mainCorrection, float scale, const std::vector< std::pair< const o2::gpu::TPCFastSpaceChargeCorrection *, float > > &additionalCorrections, bool prn)
void setNthreadsToMaximum()
sets number of threads to N cpu cores
static TPCFastSpaceChargeCorrectionHelper * instance()
Singleton.
TPCFastSpaceChargeCorrectionHelper & operator=(const TPCFastSpaceChargeCorrectionHelper &)=delete
Assignment operator: disabled.
GLdouble n
Definition glcorearb.h:1982
GLenum GLint * range
Definition glcorearb.h:1899
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...