17#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE)
24#if !defined(GPUCA_GPUCODE)
28#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE)
33#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE)
40 :
FlatObject(), mTimeStamp(0), mCorrection(), mApplyCorrection(1), mT0(0.f), mVdrift(0.f), mVdriftCorrY(0.f), mLdriftCorr(0.f), mTOFcorr(0.f), mPrimVtxZ(0.f), mLumi(
TPCFastTransform::DEFLUMI), mLumiError(0.f), mLumiScaleFactor(1.0f), mIDC(
TPCFastTransform::DEFIDC), mIDCError(0.f), mCTP2IDCFallBackThreshold(30.f)
53 mTimeStamp = obj.mTimeStamp;
54 mApplyCorrection = obj.mApplyCorrection;
56 mVdrift = obj.mVdrift;
57 mVdriftCorrY = obj.mVdriftCorrY;
58 mLdriftCorr = obj.mLdriftCorr;
59 mTOFcorr = obj.mTOFcorr;
60 mPrimVtxZ = obj.mPrimVtxZ;
62 mLumiError = obj.mLumiError;
64 mIDCError = obj.mIDCError;
65 mCTP2IDCFallBackThreshold = obj.mCTP2IDCFallBackThreshold;
66 mLumiScaleFactor = obj.mLumiScaleFactor;
107 mApplyCorrection = 1;
118 mCTP2IDCFallBackThreshold = 30.f;
119 mLumiScaleFactor = 1.f;
133 mTimeStamp = timeStamp;
136 mVdriftCorrY = vDriftCorrY;
137 mLdriftCorr = lDriftCorr;
139 mPrimVtxZ = primVtxZ;
157#if !defined(GPUCA_GPUCODE)
158 LOG(info) <<
"TPC Fast Transformation: ";
159 LOG(info) <<
"mTimeStamp = " << mTimeStamp;
160 LOG(info) <<
"mApplyCorrection = " << mApplyCorrection;
161 LOG(info) <<
"mT0 = " << mT0;
162 LOG(info) <<
"mVdrift = " << mVdrift;
163 LOG(info) <<
"mVdriftCorrY = " << mVdriftCorrY;
164 LOG(info) <<
"mLdriftCorr = " << mLdriftCorr;
165 LOG(info) <<
"mTOFcorr = " << mTOFcorr;
166 LOG(info) <<
"mPrimVtxZ = " << mPrimVtxZ;
167 LOG(info) <<
"mLumi = " << mLumi;
168 LOG(info) <<
"mLumiError = " << mLumiError;
169 LOG(info) <<
"mIDC = " << mIDC;
170 LOG(info) <<
"mIDCError = " << mIDCError;
171 LOG(info) <<
"mCTP2IDCFallBackThreshold = " << mCTP2IDCFallBackThreshold;
172 LOG(info) <<
"mLumiScaleFactor = " << mLumiScaleFactor;
177#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE)
184 if (outFName.empty()) {
185 outFName =
"tpcFastTransform.root";
188 name =
"TPCFastTransform";
190 TFile outf(outFName.data(),
"recreate");
191 if (outf.IsZombie()) {
192 LOG(error) <<
"Failed to open output file " << outFName;
197 if (isBufferExternal) {
200 outf.WriteObjectAny(
this, Class(),
name.data());
202 if (isBufferExternal) {
217 if (inpFName.empty()) {
218 inpFName =
"tpcFastTransform.root";
221 name =
"TPCFastTransform";
223 TFile inpf(inpFName.data());
224 if (inpf.IsZombie()) {
225 LOG(error) <<
"Failed to open input file " << inpFName;
230 LOG(error) <<
"Failed to load " <<
name <<
" from " << inpFName;
234 LOG(error) <<
"Failed to load " <<
name <<
" from " << inpFName <<
": empty flat buffer container";
243#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE)
264float TPCFastTransform::getIDC()
const
268 if (mLumi < mCTP2IDCFallBackThreshold) {
269#if !defined(GPUCA_GPUCODE)
270 bool static report =
true;
273 LOG(warn) <<
"IDC scaling is requested but map IDC record is empty. Since map Lumi " << mLumi <<
" is less than fall-back threshold " << mCTP2IDCFallBackThreshold <<
", interpret Lumi record as IDC";
278#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE)
279 LOG(fatal) <<
"IDC scaling is requested but map IDC record is empty. The map Lumi " << mLumi <<
" exceeds Lumi->IDC fall-back threshold " << mCTP2IDCFallBackThreshold;
This class contains the algorithms for calculation the distortions and corrections.
void setFutureBufferAddress(char *futureFlatBufferPtr)
uint32_t mConstructionMask
mask for constructed object members, first two bytes are used by this class
int32_t mFlatBufferSize
size of the flat buffer
void adoptInternalBuffer(char *buf)
char * mFlatBufferContainer
bool isConstructed() const
Tells if the object is constructed.
static T * relocatePointer(const char *oldBase, char *newBase, const T *ptr)
Relocates a pointer inside a buffer to the new buffer address.
void setActualBufferAddress(char *actualFlatBufferPtr)
_____________ Methods for moving the class with its external buffer to another location _____________...
void startConstruction()
_____________ Construction _________
void moveBufferTo(char *newBufferPtr)
void finishConstruction(int32_t flatBufferSize)
bool isBufferInternal() const
Tells if the buffer is internal.
void cloneFromObject(const FlatObject &obj, char *newFlatBufferPtr)
void clearInternalBufferPtr()
size_t getFlatBufferSize() const
Gives size of the flat buffer.
@ InProgress
construction started: temporary memory is reserved
const char * getFlatBufferPtr() const
Gives pointer to the flat buffer.
void moveBufferTo(char *newBufferPtr)
void print() const
Print method.
void setFutureBufferAddress(char *futureFlatBufferPtr)
void setActualBufferAddress(char *actualFlatBufferPtr)
Moving the class with its external buffer to another location.
void cloneFromObject(const TPCFastSpaceChargeCorrection &obj, char *newFlatBufferPtr)
Construction interface.
void setGlobalCorrectionsFromFile(std::string_view file, const Side side)
void getCorrections(const DataT x, const DataT y, const DataT z, const Side side, DataT &corrX, DataT &corrY, DataT &corrZ) const
GLuint const GLchar * name
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0
void report(gsl::span< o2::InteractionTimeRecord > irs, int threshold, bool verbose)
constexpr unsigned char SECTORSPERSIDE
simple struct to hold the space charge object which can be used for CPU reconstruction only
~TPCSlowSpaceChargeCorrection()
destructor
o2::tpc::SpaceCharge< float > * mCorr
reference space charge corrections
void getCorrections(const float gx, const float gy, const float gz, const int32_t slice, float &gdxC, float &gdyC, float &gdzC) const
getting the corrections for global coordinates
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"