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
47 public:
49
52
55
58
61
64
66
68 void setNthreads(int n);
69
72
74 int getNthreads() const { return mNthreads; }
75
77
79 std::unique_ptr<TPCFastSpaceChargeCorrection> createFromLocalCorrection(
80 std::function<void(int roc, int irow, double y, double z, double& dx, double& dy, double& dz)> correctionLocal,
81 const int nKnotsY = 10, const int nKnotsZ = 20);
82
90 std::unique_ptr<TPCFastSpaceChargeCorrection> createFromLocalCorrection(
91 std::function<void(int roc, int irow, double y, double z, double& dx, double& dy, double& dz)> correctionLocal,
92 const std::vector<double>& knotsY, const std::vector<double>& knotsZ);
93
95 std::unique_ptr<TPCFastSpaceChargeCorrection> createFromGlobalCorrection(
96 std::function<void(int roc, double gx, double gy, double gz,
97 double& dgx, double& dgy, double& dgz)>
98 correctionGlobal,
99 const int nKnotsY = 10, const int nKnotsZ = 20);
100
112 std::unique_ptr<o2::gpu::TPCFastSpaceChargeCorrection> createFromTrackResiduals(
113 const o2::tpc::TrackResiduals& trackResiduals, TTree* voxResTree, TTree* voxResTreeInverse, //
114 bool useSmoothed, bool invertSigns, //
115 TPCFastSpaceChargeCorrectionMap* fitPointsDirect = nullptr,
116 TPCFastSpaceChargeCorrectionMap* fitPointsInverse = nullptr);
117
119
120 const TPCFastTransformGeo& getGeometry() { return mGeo; }
121
123
124 void testGeometry(const TPCFastTransformGeo& geo) const;
125
127 void initInverse(o2::gpu::TPCFastSpaceChargeCorrection& correction, bool prn);
128
130 void initInverse(std::vector<o2::gpu::TPCFastSpaceChargeCorrection*>& corrections, const std::vector<float>& scaling, bool prn);
131
137 void addCorrections(
138 o2::gpu::TPCFastSpaceChargeCorrection& mainCorrection, double scale,
139 const std::vector<std::pair<const o2::gpu::TPCFastSpaceChargeCorrection*, double>>& additionalCorrections);
140
146 void addCorrections(
148 const std::vector<std::pair<const o2::gpu::TPCFastSpaceChargeCorrection*, SectorScales>>& additionalCorrections);
149
155 void mergeCorrections(
156 o2::gpu::TPCFastSpaceChargeCorrection& destinationCorrection, const o2::gpu::TPCFastSpaceChargeCorrection& sourceCorrection,
157 const std::vector<int>& sectors);
158
161 {
162 mVoxelMeanValidityRange = range;
163 }
164
165 double getVoxelMeanValidityRange() const { return mVoxelMeanValidityRange; }
166
169
170 bool isDebugUseVoxelCenters() const { return mDebugUseVoxelCenters; }
171
174
175 bool isDebugMirrorAdata2C() const { return mDebugMirrorAdata2C; }
176
177 private:
179 void initGeometry();
180
181 void fillSpaceChargeCorrectionFromMap(TPCFastSpaceChargeCorrection& correction, bool processingInverseCorrection);
182
183 static TPCFastSpaceChargeCorrectionHelper* sInstance;
184 bool mIsInitialized = 0;
185 int mNthreads = 1;
187
188 TPCFastSpaceChargeCorrectionMap mCorrectionMap{0, 0};
189
190 double mVoxelMeanValidityRange{1.1};
191
192 bool mDebugUseVoxelCenters{false};
193 bool mDebugMirrorAdata2C{false};
194
196};
197
198} // namespace tpc
199} // namespace o2
200#endif
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual Show related Highlight grid Show only individual collision Color clusters belonging to track objects Set line Enable drawing TPC data Enable drawing TOF data Enable drawing magnetic field Set field line step count Invert colors configStandalone Heavy OpenGL display display_heavy Show tracks with ITS contribution Show tracks with TOF contribution Enable propagation of loopers Show clusters at nominal x of pad row for early transformed data Split CE tracks when they cross the central Mark clusters Mark adjacent clusters Hide rejected tracks Apply filter on tracks to be displayed Separate sectors
uint32_t roc
Definition RawData.h:3
Definition of TPCFastSpaceChargeCorrectionMap class.
Definition of TPCFastSpaceChargeCorrection class.
Definition of TPCFastTransformGeo class.
Definition of the TrackResiduals class.
static constexpr int32_t getNumberOfSectors()
_______________ Getters _________________________________
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 ________________________
std::array< double, TPCFastTransformGeo::getNumberOfSectors()> SectorScales
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)
void mergeCorrections(o2::gpu::TPCFastSpaceChargeCorrection &destinationCorrection, const o2::gpu::TPCFastSpaceChargeCorrection &sourceCorrection, const std::vector< int > &sectors)
~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.
std::unique_ptr< TPCFastSpaceChargeCorrection > createFromLocalCorrection(std::function< void(int roc, int irow, double y, double z, double &dx, double &dy, double &dz)> correctionLocal, const std::vector< double > &knotsY, const std::vector< double > &knotsZ)
void setDebugUseVoxelCenters()
debug: if true, use voxel centers instead of the fitted positions for correction
void setNthreadsToMaximum()
sets number of threads to N cpu cores
static TPCFastSpaceChargeCorrectionHelper * instance()
Singleton.
TPCFastSpaceChargeCorrectionHelper & operator=(const TPCFastSpaceChargeCorrectionHelper &)=delete
Assignment operator: disabled.
void addCorrections(o2::gpu::TPCFastSpaceChargeCorrection &mainCorrection, double scale, const std::vector< std::pair< const o2::gpu::TPCFastSpaceChargeCorrection *, double > > &additionalCorrections)
GLdouble n
Definition glcorearb.h:1982
GLenum GLint * range
Definition glcorearb.h:1899
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 ...