Skip to content

Commit

Permalink
Allow setting maxZ2X via config params
Browse files Browse the repository at this point in the history
  • Loading branch information
wiechula committed Nov 4, 2024
1 parent 9f31741 commit 5a6db65
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,35 @@ struct SpacePointsCalibConfParam : public o2::conf::ConfigurableParamHelper<Spac
int additionalTracksMap = 3'500'000; ///< will be added to maxTracksPerCalibSlot for track sample with uniform acceptance (no PHOS hole)

// define track cuts for track interpolation
int minTPCNCls = 70; ///< min number of TPC clusters
int minTPCNClsNoOuterPoint = 50; ///< min number of TPC clusters if no hit in TRD or TOF exists
float maxTPCChi2 = 4.f; ///< cut on TPC reduced chi2
int minITSNCls = 4; ///< min number of ITS clusters
int minITSNClsNoOuterPoint = 6; ///< min number of ITS clusters if no hit in TRD or TOF exists
int minTRDNTrklts = 3; ///< min number of TRD space points
float maxITSChi2 = 20.f; ///< cut on ITS reduced chi2
float maxTRDChi2 = 10.f; ///< cut on TRD reduced chi2
float minPtNoOuterPoint = 0.8f; ///< minimum pt for ITS-TPC tracks to be considered for extrapolation
int minTOFTRDPVContributors = 0; ///< min contributors from TRD or TOF (fast detectors) to consider tracks of this PV
bool ignoreNonPVContrib = true; ///< flag if tracks which did not contribute to the PV should be ignored or not
int minTPCNCls = 70; ///< min number of TPC clusters
int minTPCNClsNoOuterPoint = 50; ///< min number of TPC clusters if no hit in TRD or TOF exists
float maxTPCChi2 = 4.f; ///< cut on TPC reduced chi2
int minITSNCls = 4; ///< min number of ITS clusters
int minITSNClsNoOuterPoint = 6; ///< min number of ITS clusters if no hit in TRD or TOF exists
int minTRDNTrklts = 3; ///< min number of TRD space points
float maxITSChi2 = 20.f; ///< cut on ITS reduced chi2
float maxTRDChi2 = 10.f; ///< cut on TRD reduced chi2
float minPtNoOuterPoint = 0.8f; ///< minimum pt for ITS-TPC tracks to be considered for extrapolation
int minTOFTRDPVContributors = 0; ///< min contributors from TRD or TOF (fast detectors) to consider tracks of this PV
bool ignoreNonPVContrib = true; ///< flag if tracks which did not contribute to the PV should be ignored or not
bool enableTrackDownsampling = false; ///< flag if track sampling shall be enabled or not
float tsalisThreshold = 1.f; ///< in case the sampling functions returns a value smaller than this the track is discarded (1. means no downsampling)

// other settings for track interpolation
float sigYZ2TOF{.75f}; ///< for now assume cluster error for TOF equal for all clusters in both Y and Z
float maxSnp{.85f}; ///< max snp when propagating tracks
float maxStep{2.f}; ///< maximum step for propagation
float sigYZ2TOF{.75f}; ///< for now assume cluster error for TOF equal for all clusters in both Y and Z
float maxSnp{.85f}; ///< max snp when propagating tracks
float maxStep{2.f}; ///< maximum step for propagation
bool debugTRDTOF{false}; ///< if true, ITS-TPC-TRD-TOF tracks and their seeding ITS-TPC-TRD track will both be interpolated and their residuals stored

// steering of map creation after the residuals have already been written to file
bool fitVdrift{true}; ///< if vDrift should be extracted (TODO: currently from unbinned residuals in macro mode only)
bool writeBinnedResiduals{false}; ///< when creating the map from unbinned residuals store the binned residuals together with the voxel results
bool useTrackData{true}; ///< if we have the track data available, we can redefine the above cuts for the map creation, e.g. minTPCNCls etc
bool timeFilter{false}; ///< consider only residuals as input from TFs with a specific time range specified via startTimeMS and endTimeMS
long startTimeMS{0L}; ///< the start of the time range in MS
long endTimeMS{1999999999999L}; ///< the end of the time range in MS
bool cutOnDCA{true}; ///< when creating the map from unbinned residuals cut on DCA estimated from ITS outer parameter
float maxDCA = 7.f; ///< DCA cut value in cm
bool timeFilter{false}; ///< consider only residuals as input from TFs with a specific time range specified via startTimeMS and endTimeMS
long startTimeMS{0L}; ///< the start of the time range in MS
long endTimeMS{1999999999999L}; ///< the end of the time range in MS
bool cutOnDCA{true}; ///< when creating the map from unbinned residuals cut on DCA estimated from ITS outer parameter
float maxDCA = 7.f; ///< DCA cut value in cm

// parameters for outlier rejection
bool skipOutlierFiltering{false}; ///< if set, the outlier filtering will not be applied at all
Expand Down Expand Up @@ -88,6 +88,7 @@ struct SpacePointsCalibConfParam : public o2::conf::ConfigurableParamHelper<Spac
float maxSigY = 1.1f; ///< maximum sigma for y of the voxel
float maxSigZ = .7f; ///< maximum sigma for z of the voxel
float maxGaussStdDev = 5.f; ///< maximum number of sigmas to be considered for gaussian kernel smoothing
float maxZ2X = 1.f; ///< maximum Z/X

O2ParamDef(SpacePointsCalibConfParam, "scdcalib");
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,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 float sMaxZ2X{1.f}; ///< max value for Z2X
static constexpr int sSmtLinDim{4}; ///< max matrix size for smoothing (pol1)
static constexpr int sMaxSmtDim{7}; ///< max matrix size for smoothing (pol2)

Expand Down
9 changes: 5 additions & 4 deletions Detectors/TPC/calibration/SpacePoints/src/TrackResiduals.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ void TrackResiduals::init(bool doBinning)
mSmoothPol2[VoxF] = true;
setKernelType();
mParams = &SpacePointsCalibConfParam::Instance();
mMaxZ2X = mParams->maxZ2X;
mIsInitialized = true;
LOG(info) << "Initialization complete";
}
Expand Down Expand Up @@ -182,10 +183,10 @@ void TrackResiduals::initBinning()
}
//
// Z/X binning
mDZ2XI = mNZ2XBins / sMaxZ2X;
mDZ2XI = mNZ2XBins / mMaxZ2X;
mDZ2X = 1.0f / mDZ2XI; // for uniform case only
if (mUniformBins[VoxZ]) {
LOGF(info, "Z/X-binning is uniform with %i bins from 0 to %f", mNZ2XBins, sMaxZ2X);
LOGF(info, "Z/X-binning is uniform with %i bins from 0 to %f", mNZ2XBins, mMaxZ2X);
for (int iz = 0; iz < mNZ2XBins; ++iz) {
mZ2XBinsDH.push_back(.5f * mDZ2X);
mZ2XBinsDI.push_back(mDZ2XI);
Expand Down Expand Up @@ -265,7 +266,7 @@ int TrackResiduals::getRowID(float x) const
bool TrackResiduals::findVoxelBin(int secID, float x, float y, float z, std::array<unsigned char, VoxDim>& bvox) const
{
// Z/X bin
if (fabs(z / x) > sMaxZ2X) {
if (fabs(z / x) > mMaxZ2X) {
return false;
}
int bz = getZ2XBinExact(secID < SECTORSPERSIDE ? z / x : -z / x);
Expand Down Expand Up @@ -601,7 +602,7 @@ int TrackResiduals::validateVoxels(int iSec)
resVox.flags |= Masked;
}
} // loop over Z
} // loop over Y/X
} // loop over Y/X
mValidFracXBins[iSec][ix] = static_cast<float>(cntValid) / (mNY2XBins * mNZ2XBins);
LOGP(debug, "Sector {}: xBin {} has {} % of voxels valid. Total masked due to fit: {} ,and sigma: {}",
iSec, ix, mValidFracXBins[iSec][ix] * 100., cntMaskedFit, cntMaskedSigma);
Expand Down

0 comments on commit 5a6db65

Please sign in to comment.