17#ifndef GPUCA_STANDALONE
37TPCFastTransformHelperO2* TPCFastTransformHelperO2::sInstance =
nullptr;
49void TPCFastTransformHelperO2::init()
55 const int nRows = geo.
NROWS;
60 for (
int iRow = 0; iRow < nRows; iRow++) {
61 mGeo.
setTPCrow(iRow, geo.Row2X(iRow), geo.NPads(iRow), geo.PadWidth(iRow));
66#ifndef GPUCA_STANDALONE
80 if (!mIsInitialized) {
97 const float vDrift = 0.f;
98 const long int initTimeStamp = -1;
106 return fastTransformPtr;
115 if (!mIsInitialized) {
122 return create(TimeStamp, correction);
126int TPCFastTransformHelperO2::updateCalibrationImpl(T& fastTransform, int64_t TimeStamp,
float vDriftFactor,
float vDriftRef,
float driftTimeOffset)
129 LOGP(
debug,
"Updating calibration: timestamp:{} vdriftFactor:{} vdriftRef:{}", TimeStamp, vDriftFactor, vDriftRef);
130 if (!mIsInitialized) {
143 fastTransform.setTimeStamp(TimeStamp);
144 if (vDriftRef == 0) {
147 const double vDrift = elParam.ZbinWidth * vDriftRef * vDriftFactor;
154 const double t0 = (driftTimeOffset + elParam.getAverageShapingTime()) / elParam.ZbinWidth;
156 fastTransform.setCalibration(TimeStamp,
t0, vDrift);
161#ifndef GPUCA_STANDALONE
171 LOG(fatal) <<
"Wrong number of rows :" << geo.getNumberOfRows() <<
" instead of " << mapper.
getNumberOfRows() << std::endl;
174 double maxDx = 0, maxDy = 0;
176 for (
int row = 0;
row < geo.getNumberOfRows();
row++) {
178 const int nPads = geo.getRowInfo(
row).maxPad + 1;
184 const double x = geo.getRowInfo(
row).x;
188 for (
int pad = 0; pad < nPads; pad++) {
193 geo.convPadDriftLengthToLocal(0,
row, pad, 0.,
y,
z);
195 const double dx =
x -
c.X();
196 const double dy =
y - (-
c.Y());
198 if (fabs(dx) >= 1.e-6 || fabs(dy) >= 1.e-5) {
199 LOG(warning) <<
"wrong calculated pad position:"
200 <<
" row " <<
row <<
" pad " << pad <<
" x calc " <<
x <<
" x in map " <<
c.X() <<
" dx " << (
x -
c.X())
201 <<
" y calc " <<
y <<
" y in map " << -
c.Y() <<
" dy " << dy << std::endl;
203 if (fabs(maxDx) < fabs(dx)) {
206 if (fabs(maxDy) < fabs(dy)) {
212 if (fabs(maxDx) >= 1.e-4 || fabs(maxDy) >= 1.e-4) {
213 LOG(fatal) <<
"wrong calculated pad position:"
214 <<
" max Dx " << maxDx <<
" max Dy " << maxDy << std::endl;
219template int TPCFastTransformHelperO2::updateCalibrationImpl(
TPCFastTransform&, int64_t,
float,
float,
float);
220template int TPCFastTransformHelperO2::updateCalibrationImpl(
TPCFastTransformPOD&, int64_t,
float,
float,
float);
Definition of the parameter class for the detector.
Definition of the parameter class for the detector electronics.
Definition of the parameter class for the detector gas.
static const ParameterElectronics & Instance()
static constexpr uint32_t NROWS
void constructWithNoCorrection(const TPCFastTransformGeo &geo)
int getNumberOfRows() const
int getNumberOfPadsInRowSector(int row) const
GlobalPadNumber globalPadNumber(const PadPos &globalPadPosition) const
static Mapper & instance(const std::string mappingDir="")
const PadCentre & padCentre(GlobalPadNumber padNumber) const
static constexpr int MAXSECTOR
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0
GLdouble GLdouble GLdouble z
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"