Skip to content

Commit 9c26a3d

Browse files
committed
Allow setting maxZ2X via config params
1 parent 34ca379 commit 9c26a3d

File tree

3 files changed

+31
-29
lines changed

3 files changed

+31
-29
lines changed

Detectors/TPC/calibration/SpacePoints/include/SpacePoints/SpacePointsCalibConfParam.h

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,35 @@ struct SpacePointsCalibConfParam : public o2::conf::ConfigurableParamHelper<Spac
2929
int additionalTracksMap = 3'500'000; ///< will be added to maxTracksPerCalibSlot for track sample with uniform acceptance (no PHOS hole)
3030

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

4646
// other settings for track interpolation
47-
float sigYZ2TOF{.75f}; ///< for now assume cluster error for TOF equal for all clusters in both Y and Z
48-
float maxSnp{.85f}; ///< max snp when propagating tracks
49-
float maxStep{2.f}; ///< maximum step for propagation
47+
float sigYZ2TOF{.75f}; ///< for now assume cluster error for TOF equal for all clusters in both Y and Z
48+
float maxSnp{.85f}; ///< max snp when propagating tracks
49+
float maxStep{2.f}; ///< maximum step for propagation
5050
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
5151

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

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

9293
O2ParamDef(SpacePointsCalibConfParam, "scdcalib");
9394
};

Detectors/TPC/calibration/SpacePoints/include/SpacePoints/TrackResiduals.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,6 @@ class TrackResiduals
449449
// some constants
450450
static constexpr float sFloatEps{1.e-7f}; ///< float epsilon for robust linear fitting
451451
static constexpr float sDeadZone{1.5f}; ///< dead zone for TPC in between sectors
452-
static constexpr float sMaxZ2X{1.f}; ///< max value for Z2X
453452
static constexpr int sSmtLinDim{4}; ///< max matrix size for smoothing (pol1)
454453
static constexpr int sMaxSmtDim{7}; ///< max matrix size for smoothing (pol2)
455454

Detectors/TPC/calibration/SpacePoints/src/TrackResiduals.cxx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,18 @@ using namespace o2::tpc;
5050
//______________________________________________________________________________
5151
void TrackResiduals::init(bool doBinning)
5252
{
53-
if (doBinning) {
54-
// initialize binning
55-
initBinning();
56-
}
57-
5853
mSmoothPol2[VoxX] = true;
5954
mSmoothPol2[VoxF] = true;
6055
setKernelType();
6156
mParams = &SpacePointsCalibConfParam::Instance();
57+
mMaxZ2X = mParams->maxZ2X;
6258
mIsInitialized = true;
59+
60+
if (doBinning) {
61+
// initialize binning
62+
initBinning();
63+
}
64+
6365
LOG(info) << "Initialization complete";
6466
}
6567

@@ -182,10 +184,10 @@ void TrackResiduals::initBinning()
182184
}
183185
//
184186
// Z/X binning
185-
mDZ2XI = mNZ2XBins / sMaxZ2X;
187+
mDZ2XI = mNZ2XBins / mMaxZ2X;
186188
mDZ2X = 1.0f / mDZ2XI; // for uniform case only
187189
if (mUniformBins[VoxZ]) {
188-
LOGF(info, "Z/X-binning is uniform with %i bins from 0 to %f", mNZ2XBins, sMaxZ2X);
190+
LOGF(info, "Z/X-binning is uniform with %i bins from 0 to %f", mNZ2XBins, mMaxZ2X);
189191
for (int iz = 0; iz < mNZ2XBins; ++iz) {
190192
mZ2XBinsDH.push_back(.5f * mDZ2X);
191193
mZ2XBinsDI.push_back(mDZ2XI);
@@ -265,7 +267,7 @@ int TrackResiduals::getRowID(float x) const
265267
bool TrackResiduals::findVoxelBin(int secID, float x, float y, float z, std::array<unsigned char, VoxDim>& bvox) const
266268
{
267269
// Z/X bin
268-
if (fabs(z / x) > sMaxZ2X) {
270+
if (fabs(z / x) > mMaxZ2X) {
269271
return false;
270272
}
271273
int bz = getZ2XBinExact(secID < SECTORSPERSIDE ? z / x : -z / x);
@@ -601,7 +603,7 @@ int TrackResiduals::validateVoxels(int iSec)
601603
resVox.flags |= Masked;
602604
}
603605
} // loop over Z
604-
} // loop over Y/X
606+
} // loop over Y/X
605607
mValidFracXBins[iSec][ix] = static_cast<float>(cntValid) / (mNY2XBins * mNZ2XBins);
606608
LOGP(debug, "Sector {}: xBin {} has {} % of voxels valid. Total masked due to fit: {} ,and sigma: {}",
607609
iSec, ix, mValidFracXBins[iSec][ix] * 100., cntMaskedFit, cntMaskedSigma);

0 commit comments

Comments
 (0)