Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ class TrackResiduals

// some constants
static constexpr float sFloatEps{1.e-7f}; ///< float epsilon for robust linear fitting
static constexpr float sDeadZone{1.5f}; ///< dead zone for TPC in between sectors
static constexpr int sSmtLinDim{4}; ///< max matrix size for smoothing (pol1)
static constexpr int sMaxSmtDim{7}; ///< max matrix size for smoothing (pol2)

Expand All @@ -483,7 +482,7 @@ class TrackResiduals
int mNVoxPerSector{}; ///< number of voxels per sector
float mDX{}; ///< x bin size
float mDXI{}; ///< inverse of x bin size
std::vector<float> mMaxY2X{}; ///< max y/x at each x bin, accounting dead zones
std::vector<float> mMaxY2X{}; ///< max y/x at each x bin: the pad plane's edge in its pad row
std::vector<float> mDY2X{}; ///< y/x bin size at given x bin
std::vector<float> mDY2XI{}; ///< inverse y/x bin size at given x bin
std::vector<float> mY2XBinsDH{}; ///< half width in y/x within the interval [-1..1]
Expand Down
12 changes: 10 additions & 2 deletions Detectors/TPC/calibration/SpacePoints/src/TrackResiduals.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
///

#include "SpacePoints/TrackResiduals.h"
#include "TPCBase/Mapper.h"
#include "CommonConstants/MathConstants.h"
#include "ReconstructionDataFormats/Track.h"
#include "MathUtils/fit.h"
Expand Down Expand Up @@ -164,14 +165,21 @@ void TrackResiduals::initBinning()
mDXI = 1.f / mDX; // should not be used
}
//
// Y/X binning
// Y/X binning: y/x = +-mMaxY2X is the pad plane's edge in the pad row of the x bin (the outer edge of its outermost pads; with uniform
// X-binning the pad row closest to the bin centre), so the outermost y/x bins end with the row's last pads
mMaxY2X.resize(mNXBins);
mDY2XI.resize(mNXBins);
mDY2X.resize(mNXBins);
//
const auto& mapper = Mapper::instance();
for (int ix = 0; ix < mNXBins; ++ix) {
float x = getX(ix);
mMaxY2X[ix] = tan(.5f * SECPHIWIDTH) - sDeadZone / x;
int row = ix;
if (mUniformBins[VoxX]) {
row = int(std::min_element(param::RowX, param::RowX + param::NPadRows, [x](float a, float b) { return std::abs(a - x) < std::abs(b - x); }) - param::RowX);
}
const float halfWidth = 0.5f * mapper.getNumberOfPadsInRowSector(row) * mapper.getPadRegionInfo(Mapper::REGION[row]).getPadWidth();
mMaxY2X[ix] = halfWidth / x;
mDY2XI[ix] = mNY2XBins / (2.f * mMaxY2X[ix]);
mDY2X[ix] = 1.f / mDY2XI[ix];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include "SpacePoints/TrackResiduals.h"
#include "TPCBase/Mapper.h"

namespace o2::tpc
{
Expand Down Expand Up @@ -58,4 +59,16 @@ BOOST_AUTO_TEST_CASE(TrackResidualsBinning_test)
}
}

// the y/x grid ends at the pad plane's edge of each pad row
BOOST_AUTO_TEST_CASE(TrackResidualsY2XEdge_test)
{
TrackResiduals resid;
resid.initBinning();
const auto& mapper = Mapper::instance();
for (int ix = 0; ix < resid.getNXBins(); ++ix) {
const float halfWidth = 0.5f * mapper.getNumberOfPadsInRowSector(ix) * mapper.getPadRegionInfo(Mapper::REGION[ix]).getPadWidth();
BOOST_CHECK_CLOSE(resid.getMaxY2X(ix) * resid.getX(ix), halfWidth, 1e-3);
}
}

} // namespace o2::tpc
Loading