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
88 std::unique_ptr<o2::gpu::TPCFastSpaceChargeCorrection> createFromTrackResiduals(
89 const o2::tpc::TrackResiduals& trackResiduals, TTree* voxResTree, bool useSmoothed = false, bool invertSigns = false);
91
92 const TPCFastTransformGeo& getGeometry() { return mGeo; }
93
95
97
98 void testGeometry(const TPCFastTransformGeo& geo) const;
99
101 void initInverse(o2::gpu::TPCFastSpaceChargeCorrection& correction, bool prn);
102
104 void initInverse(std::vector<o2::gpu::TPCFastSpaceChargeCorrection*>& corrections, const std::vector<float>& scaling, bool prn);
105
106 private:
108 void initGeometry();
109
111 void getSpaceChargeCorrection(const TPCFastSpaceChargeCorrection& correction, int slice, int row, o2::gpu::TPCFastSpaceChargeCorrectionMap::CorrectionPoint p, double& su, double& sv, double& dx, double& du, double& dv);
112
114 void initMaxDriftLength(o2::gpu::TPCFastSpaceChargeCorrection& correction, bool prn);
115
116 static TPCFastSpaceChargeCorrectionHelper* sInstance;
117 bool mIsInitialized = 0;
118 int mNthreads = 1;
120
121 TPCFastSpaceChargeCorrectionMap mCorrectionMap{0, 0};
122
124};
125
126} // namespace tpc
127} // namespace o2
128#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 initInverse(o2::gpu::TPCFastSpaceChargeCorrection &correction, bool prn)
initialise inverse transformation
std::unique_ptr< o2::gpu::TPCFastSpaceChargeCorrection > createFromTrackResiduals(const o2::tpc::TrackResiduals &trackResiduals, TTree *voxResTree, bool useSmoothed=false, bool invertSigns=false)
Create SpaceCharge correction out of the voxel tree.
~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
TPCFastSpaceChargeCorrectionHelper()=default
_____________ Constructors / destructors __________________________
void setNthreads(int n)
_______________ Settings ________________________
TPCFastSpaceChargeCorrectionHelper(const TPCFastSpaceChargeCorrectionHelper &)=delete
Copy constructor: disabled.
void setNthreadsToMaximum()
sets number of threads to N cpu cores
void fillSpaceChargeCorrectionFromMap(TPCFastSpaceChargeCorrection &correction)
static TPCFastSpaceChargeCorrectionHelper * instance()
Singleton.
TPCFastSpaceChargeCorrectionHelper & operator=(const TPCFastSpaceChargeCorrectionHelper &)=delete
Assignment operator: disabled.
GLdouble n
Definition glcorearb.h:1982
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< int > row