Skip to content

Commit 3a1dd5c

Browse files
committed
Revert "Merge pull request #8275 from matthias-kleiner/dedxdev"
This reverts commit 466d4e9.
1 parent e596525 commit 3a1dd5c

9 files changed

Lines changed: 14 additions & 284 deletions

File tree

DataFormats/Detectors/TPC/include/DataFormatsTPC/CalibdEdxTrackTopologyPol.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ struct CalibdEdxTrackTopologyPolContainer {
4949
float mQTotMax{200}; ///< maximum qTot for which the correction is valid
5050
std::vector<float> mScalingFactorsqTot{}; ///< value which is used to scale the result of the polynomial for qTot (can be used for normalization)
5151
std::vector<float> mScalingFactorsqMax{}; ///< value which is used to scale the result of the polynomial for qMax (can be used for normalization)
52-
53-
ClassDefNV(CalibdEdxTrackTopologyPolContainer, 1);
5452
};
5553
#endif
5654

@@ -208,9 +206,6 @@ class CalibdEdxTrackTopologyPol : public o2::gpu::FlatObject
208206
/// sets the polynomials from an input file. The names of the objects have to be the same as in the getPolyName() function
209207
/// \param inpf file where the polynomials are stored
210208
void setPolynomialsFromFile(TFile& inpf);
211-
212-
/// setting a default topology correction which just returns 1
213-
void setDefaultPolynomials();
214209
#endif
215210

216211
/// \return returns the name of the polynomial object which can be read in with the setPolynomialsFromFile() function

DataFormats/Detectors/TPC/src/CalibdEdxTrackTopologyPol.cxx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,6 @@ void CalibdEdxTrackTopologyPol::construct()
131131
}
132132
}
133133

134-
void CalibdEdxTrackTopologyPol::setDefaultPolynomials()
135-
{
136-
for (int i = 0; i < FFits; ++i) {
137-
mCalibPolsqTot[i].setParam(0, 1);
138-
mCalibPolsqMax[i].setParam(0, 1);
139-
}
140-
construct();
141-
}
142-
143134
void CalibdEdxTrackTopologyPol::writeToFile(TFile& outf, const char* name) const
144135
{
145136
CalibdEdxTrackTopologyPolContainer cont(mMaxTanTheta, mMaxSinPhi, mThresholdMin, mThresholdMax, mQTotMin, mQTotMax);
@@ -196,7 +187,6 @@ void CalibdEdxTrackTopologyPol::setFromContainer(const CalibdEdxTrackTopologyPol
196187
mScalingFactorsqTot[i] = container.mScalingFactorsqTot[i];
197188
mScalingFactorsqMax[i] = container.mScalingFactorsqMax[i];
198189
}
199-
construct();
200190
}
201191

202192
void CalibdEdxTrackTopologyPol::loadFromFile(const char* fileName, const char* name)
@@ -206,6 +196,7 @@ void CalibdEdxTrackTopologyPol::loadFromFile(const char* fileName, const char* n
206196
inpf.GetObject(name, polTmp);
207197
if (polTmp) {
208198
setFromContainer(*polTmp);
199+
construct();
209200
delete polTmp;
210201
} else {
211202
LOGP(info, fmt::format("couldnt load object {} from input file", name));

Detectors/TPC/base/include/TPCBase/CDBInterface.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ enum class CDBType {
4545
CalPadGainFull, ///< Full pad gain calibration
4646
CalPadGainResidual, ///< ResidualpPad gain calibration (e.g. from tracks)
4747
CalLaserTracks, ///< Laser track calibration data
48-
CalTimeGain, ///< Residual gain correction for angular dependencies etc. from tracks
49-
CalTopologyGain, ///< Q cluster topology correction
5048
///
5149
ParDetector, ///< Parameter for Detector
5250
ParElectronics, ///< Parameter for Electronics
@@ -70,8 +68,6 @@ const std::unordered_map<CDBType, const std::string> CDBTypeMap{
7068
{CDBType::CalPadGainFull, "TPC/Calib/PadGainFull"},
7169
{CDBType::CalPadGainResidual, "TPC/Calib/PadGainResidual"},
7270
{CDBType::CalLaserTracks, "TPC/Calib/LaserTracks"},
73-
{CDBType::CalTimeGain, "TPC/Calib/TimeGain"},
74-
{CDBType::CalTopologyGain, "TPC/Calib/TopologyGain"},
7571
//
7672
{CDBType::ParDetector, "TPC/Parameter/Detector"},
7773
{CDBType::ParElectronics, "TPC/Parameter/Electronics"},

GPU/GPUTracking/DataTypes/CalibdEdxContainer.cxx

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -150,23 +150,6 @@ void CalibdEdxContainer::loadSplineTopologyCorrectionFromFile(std::string_view f
150150
loadTopologyCorrectionFromFile(fileName, mCalibTrackTopologySpline);
151151
}
152152

153-
void CalibdEdxContainer::setPolTopologyCorrection(const CalibdEdxTrackTopologyPol& calibTrackTopology)
154-
{
155-
setTopologyCorrection(calibTrackTopology, mCalibTrackTopologyPol);
156-
}
157-
158-
void CalibdEdxContainer::setDefaultPolTopologyCorrection()
159-
{
160-
CalibdEdxTrackTopologyPol calibTrackTopology;
161-
calibTrackTopology.setDefaultPolynomials();
162-
setTopologyCorrection(calibTrackTopology, mCalibTrackTopologyPol);
163-
}
164-
165-
void CalibdEdxContainer::setSplineTopologyCorrection(const CalibdEdxTrackTopologySpline& calibTrackTopology)
166-
{
167-
setTopologyCorrection(calibTrackTopology, mCalibTrackTopologySpline);
168-
}
169-
170153
void CalibdEdxContainer::loadZeroSupresssionThresholdFromFile(std::string_view fileName, std::string_view objName, const float minCorrectionFactor, const float maxCorrectionFactor)
171154
{
172155
TFile fInp(fileName.data(), "READ");
@@ -182,18 +165,6 @@ void CalibdEdxContainer::setZeroSupresssionThreshold(const CalDet<float>& thresh
182165
mThresholdMap = thresholdMapTmp;
183166
}
184167

185-
void CalibdEdxContainer::setGainMap(const CalDet<float>& gainMap, const float minGain, const float maxGain)
186-
{
187-
o2::gpu::TPCPadGainCalib gainMapTmp(gainMap, minGain, maxGain, false);
188-
mGainMap = gainMapTmp;
189-
}
190-
191-
void CalibdEdxContainer::setGainMapResidual(const CalDet<float>& gainMapResidual, const float minResidualGain, const float maxResidualGain)
192-
{
193-
o2::gpu::TPCPadGainCalib gainMapResTmp(gainMapResidual, minResidualGain, maxResidualGain, false);
194-
mGainMapResidual = gainMapResTmp;
195-
}
196-
197168
void CalibdEdxContainer::setDefaultZeroSupresssionThreshold()
198169
{
199170
const float defaultVal = getMinZeroSupresssionThreshold() + (getMaxZeroSupresssionThreshold() - getMinZeroSupresssionThreshold()) / 2;
@@ -209,15 +180,10 @@ void CalibdEdxContainer::setDefaultZeroSupresssionThreshold()
209180
template <class Type>
210181
void CalibdEdxContainer::loadTopologyCorrectionFromFile(std::string_view fileName, Type*& obj)
211182
{
183+
FlatObject::startConstruction();
184+
212185
// load and set-up container
213186
Type calibTrackTopologyTmp(fileName.data());
214-
setTopologyCorrection(calibTrackTopologyTmp, obj);
215-
}
216-
217-
template <class Type>
218-
void CalibdEdxContainer::setTopologyCorrection(const Type& calibTrackTopologyTmp, Type*& obj)
219-
{
220-
FlatObject::startConstruction();
221187

222188
// get size of the flat buffer of the splines
223189
const std::size_t flatbufferSize = calibTrackTopologyTmp.getFlatBufferSize();

GPU/GPUTracking/DataTypes/CalibdEdxContainer.h

Lines changed: 8 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,6 @@
3232
namespace o2::tpc
3333
{
3434

35-
/// flags to set which corrections will be loaded from the CCDB
36-
enum class CalibsdEdx : unsigned short {
37-
CalTopologySpline = 1 << 0, ///< flag for a topology correction using splines
38-
CalTopologyPol = 1 << 1, ///< flag for a topology correction using polynomials
39-
CalThresholdMap = 1 << 2, ///< flag for using threshold map
40-
CalGainMap = 1 << 3, ///< flag for using the gain map to get the correct cluster charge
41-
CalResidualGainMap = 1 << 4, ///< flag for applying residual gain map
42-
CalTimeGain = 1 << 5, ///< flag for residual dE/dx time dependent gain correction
43-
};
44-
45-
inline CalibsdEdx operator|(CalibsdEdx a, CalibsdEdx b) { return static_cast<CalibsdEdx>(static_cast<int>(a) | static_cast<int>(b)); }
46-
47-
inline CalibsdEdx operator&(CalibsdEdx a, CalibsdEdx b) { return static_cast<CalibsdEdx>(static_cast<int>(a) & static_cast<int>(b)); }
48-
49-
inline CalibsdEdx operator~(CalibsdEdx a) { return static_cast<CalibsdEdx>(~static_cast<int>(a)); }
50-
5135
///
5236
/// This container class contains all necessary corrections for the dE/dx
5337
/// Currently it holds the residual dE/dx correction and the track topology correction, which can be either provided by 2D-splines or by 5D-polynomials.
@@ -123,26 +107,13 @@ class CalibdEdxContainer : public o2::gpu::FlatObject
123107
/// \param row global pad row
124108
GPUd() float getZeroSupressionThreshold(const int sector, const gpu::tpccf::Row row, const gpu::tpccf::Pad pad) const { return mThresholdMap.getGainCorrection(sector, row, pad); }
125109

126-
/// \return returns gain from the full gain map
127-
/// \param sector tpc sector
128-
/// \param row global pad row
129-
GPUd() float getGain(const int sector, const gpu::tpccf::Row row, const gpu::tpccf::Pad pad) const { return mGainMap.getGainCorrection(sector, row, pad); }
130-
131-
/// \return returns gain from residual gain map
132-
/// \param sector tpc sector
133-
/// \param row global pad row
134-
GPUd() float getResidualGain(const int sector, const gpu::tpccf::Row row, const gpu::tpccf::Pad pad) const { return mGainMapResidual.getGainCorrection(sector, row, pad); }
135-
136110
/// \return returns the residual dE/dx correction for the cluster charge
137111
/// \param stack ID of the GEM stack
138112
/// \param charge type of the charge (qMax or qTot)
139113
/// \param z z position
140114
/// \param tgl tracking parameter tgl
141115
GPUd() float getResidualCorrection(const StackID& stack, const ChargeType charge, const float z = 0, const float tgl = 0) const { return mCalibResidualdEdx.getCorrection(stack, charge, z, tgl); }
142116

143-
/// \return returns if the full gain map will be used during the calculation of the dE/dx to correct the cluster charge
144-
GPUd() bool isUsageOfFullGainMap() const { return mApplyFullGainMap; }
145-
146117
/// ========== FlatObject functionality, see FlatObject class for description =================
147118
#if !defined(GPUCA_GPUCODE)
148119
/// cloning a container object (use newFlatBufferPtr=nullptr for simple copy)
@@ -172,78 +143,32 @@ class CalibdEdxContainer : public o2::gpu::FlatObject
172143
/// \param fileName input file containing the correction
173144
void loadSplineTopologyCorrectionFromFile(std::string_view fileName);
174145

175-
/// set the polynomial track topology
176-
/// \param calibTrackTopology polynomial track topology correction
177-
void setPolTopologyCorrection(const CalibdEdxTrackTopologyPol& calibTrackTopology);
178-
179-
/// setting a default topology correction which just returns 1
180-
void setDefaultPolTopologyCorrection();
181-
182-
/// set the spline track topology
183-
/// \param calibTrackTopology spline track topology correction
184-
void setSplineTopologyCorrection(const CalibdEdxTrackTopologySpline& calibTrackTopology);
185-
186146
// loading the residual dE/dx correction from a file
187147
/// \param fileName input file containing the correction
188148
void loadResidualCorrectionFromFile(std::string_view fileName) { mCalibResidualdEdx.loadFromFile(fileName); }
189149

190-
/// setting the residual dEdx correction
191-
/// \param residualCorr residual gain calibration object
192-
void setResidualCorrection(const CalibdEdxCorrection& residualCorr) { mCalibResidualdEdx = residualCorr; }
193-
194150
// loading the zero supression threshold map from a file
195151
/// \param fileName input file containing the CalDet map
196152
void loadZeroSupresssionThresholdFromFile(std::string_view fileName, std::string_view objName, const float minCorrectionFactor, const float maxCorrectionFactor);
197153

198-
/// setting the zero supression threshold map from a CalDet
199-
/// \param thresholdMap CalDet containing the zero supression threshold
154+
// loading the zero supression threshold map from a file
155+
/// \param fileName input file containing the CalDet map
200156
void setZeroSupresssionThreshold(const CalDet<float>& thresholdMap) { setZeroSupresssionThreshold(thresholdMap, getMinZeroSupresssionThreshold(), getMaxZeroSupresssionThreshold()); }
201157

202-
/// setting the zero supression threshold map from a CalDet
203-
/// \param thresholdMap CalDet containing the zero supression threshold
158+
// loading the zero supression threshold map from a file
159+
/// \param fileName input file containing the CalDet map
204160
void setZeroSupresssionThreshold(const CalDet<float>& thresholdMap, const float minCorrectionFactor, const float maxCorrectionFactor);
205161

206-
/// setting the gain map map from a CalDet
207-
void setGainMap(const CalDet<float>& gainMap, const float minGain, const float maxGain);
208-
209-
/// setting the gain map map from a CalDet
210-
void setGainMapResidual(const CalDet<float>& gainMapResidual, const float minResidualGain = 0.7f, const float maxResidualGain = 1.3f);
211-
212162
/// setting default zero supression threshold map (all values are set to getMinZeroSupresssionThreshold())
213163
/// \param fileName input file containing the CalDet map
214164
void setDefaultZeroSupresssionThreshold();
215-
216-
/// returns status if the spline correction is set
217-
bool isTopologyCorrectionSplinesSet() const { return mCalibTrackTopologySpline ? true : false; }
218-
219-
/// returns status if the polynomials correction is set
220-
bool isTopologyCorrectionPolynomialsSet() const { return mCalibTrackTopologyPol ? true : false; }
221-
222-
/// set loading of a correction from CCDB
223-
/// \param calib calibration which will be loaded from CCDB
224-
void setCorrectionCCDB(const CalibsdEdx calib) { mCalibsLoad = calib | mCalibsLoad; }
225-
226-
/// disable loading of a correction from CCDB
227-
/// \param calib calibration which will not be loaded from CCDB
228-
void disableCorrectionCCDB(const CalibsdEdx calib) { mCalibsLoad = ~calib & mCalibsLoad; }
229-
230-
/// check if a correction will be loaded from CCDB
231-
/// \param calib calibration which will be loaded from CCDB
232-
bool isCorrectionCCDB(const CalibsdEdx calib) const { return ((mCalibsLoad & calib) == calib) ? true : false; }
233-
234-
/// \param applyFullGainMap if set to true the cluster charge will be corrected with the full gain map
235-
void setUsageOfFullGainMap(const bool applyFullGainMap) { mApplyFullGainMap = applyFullGainMap; }
236165
#endif // !GPUCA_GPUCODE
237166

238167
private:
239-
CalibdEdxTrackTopologySpline* mCalibTrackTopologySpline{nullptr}; ///< calibration for the track topology correction (splines)
240-
CalibdEdxTrackTopologyPol* mCalibTrackTopologyPol{nullptr}; ///< calibration for the track topology correction (polynomial)
241-
o2::gpu::TPCPadGainCalib mThresholdMap{}; ///< calibration object containing the zero supression threshold map
242-
o2::gpu::TPCPadGainCalib mGainMap{}; ///< calibration object containing the gain map
243-
o2::gpu::TPCPadGainCalib mGainMapResidual{}; ///< calibration object containing the residual gain map
244-
CalibdEdxCorrection mCalibResidualdEdx{}; ///< calibration for the residual dE/dx correction
245-
bool mApplyFullGainMap{false}; ///< if set to true the cluster charge will be corrected with the full gain map (when the gain map was not applied during the clusterizer)
246-
CalibsdEdx mCalibsLoad{CalibsdEdx::CalTopologyPol | CalibsdEdx::CalThresholdMap | CalibsdEdx::CalGainMap | CalibsdEdx::CalResidualGainMap | CalibsdEdx::CalTimeGain}; ///< flags to set which corrections will be loaded from the CCDB and used during calculation of the dE/dx
168+
CalibdEdxTrackTopologySpline* mCalibTrackTopologySpline{nullptr}; ///< calibration for the track topology correction (splines)
169+
CalibdEdxTrackTopologyPol* mCalibTrackTopologyPol{nullptr}; ///< calibration for the track topology correction (polynomial)
170+
o2::gpu::TPCPadGainCalib mThresholdMap{}; ///< calibration object containing the zero supression threshold map
171+
CalibdEdxCorrection mCalibResidualdEdx{}; ///< calibration for the residual dE/dx correction
247172

248173
#if !defined(GPUCA_GPUCODE)
249174
template <class Type>
@@ -254,9 +179,6 @@ class CalibdEdxContainer : public o2::gpu::FlatObject
254179

255180
template <class Type>
256181
void loadTopologyCorrectionFromFile(std::string_view fileName, Type*& obj);
257-
258-
template <class Type>
259-
void setTopologyCorrection(const Type& calibTrackTopologyTmp, Type*& obj);
260182
#endif
261183

262184
template <class Type>

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -414,12 +414,6 @@ AddOption(rundEdx, int, -1, "", 0, "Enable/disable dEdx processing (-1 for autos
414414
AddOption(dEdxSplineTopologyCorrFile, std::string, "", "", 0, "File name of the dE/dx spline track topology correction file")
415415
AddOption(dEdxCorrFile, std::string, "", "", 0, "File name of dEdx residual correction file")
416416
AddOption(dEdxPolTopologyCorrFile, std::string, "", "", 0, "File name of the dE/dx polynomial track topology correction")
417-
AddOption(dEdxDisableTopologyPol, bool, false, "", 0, "Disable loading of polynomial track topology correction from CCDB")
418-
AddOption(dEdxDisableThresholdMap, bool, false, "", 0, "Disable loading of threshold map from CCDB")
419-
AddOption(dEdxDisableGainMap, bool, false, "", 0, "Disable loading of gain map from CCDB")
420-
AddOption(dEdxDisableResidualGainMap, bool, false, "", 0, "Disable loading of residual gain map from CCDB")
421-
AddOption(dEdxDisableResidualGain, bool, false, "", 0, "Disable loading of residual dE/dx gain correction from CCDB")
422-
AddOption(dEdxUseFullGainMap, bool, false, "", 0, "Enable using the full gain map for correcting the cluster charge during calculation of the dE/dx")
423417
AddOption(transformationFile, std::string, "", "", 0, "File name of TPC fast transformation map")
424418
AddOption(matLUTFile, std::string, "", "", 0, "File name of material LUT file")
425419
AddOption(gainCalibFile, std::string, "", "", 0, "File name of TPC pad gain calibration")

GPU/GPUTracking/dEdx/GPUdEdx.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,7 @@ GPUdnii() void GPUdEdx::fillCluster(float qtot, float qmax, int padRow, unsigned
145145
const int region = param.tpcGeometry.GetRegion(padRow);
146146
z = CAMath::Abs(z);
147147
const float threshold = calibContainer->getZeroSupressionThreshold(slice, padRow, padPos); // TODO: Use the mean zero supresion threshold of all pads in the cluster?
148-
const bool useFullGainMap = calibContainer->isUsageOfFullGainMap();
149-
float qTotIn = CAMath::Clamp(qtot, calibContainer->getMinqTot(), calibContainer->getMaxqTot());
150-
const float fullGainMapGain = calibContainer->getGain(slice, padRow, padPos);
151-
if (useFullGainMap) {
152-
qmax /= fullGainMapGain;
153-
qtot /= fullGainMapGain;
154-
} else {
155-
qTotIn *= fullGainMapGain;
156-
}
157-
148+
const float qTotIn = CAMath::Clamp(qtot, calibContainer->getMinqTot(), calibContainer->getMaxqTot());
158149
const float qMaxTopologyCorr = calibContainer->getTopologyCorrection(region, o2::tpc::ChargeType::Max, tanTheta, snp, z, absRelPad, relTime, threshold, qTotIn);
159150
const float qTotTopologyCorr = calibContainer->getTopologyCorrection(region, o2::tpc::ChargeType::Tot, tanTheta, snp, z, absRelPad, relTime, threshold, qTotIn);
160151
qmax /= qMaxTopologyCorr;
@@ -170,10 +161,6 @@ GPUdnii() void GPUdEdx::fillCluster(float qtot, float qmax, int padRow, unsigned
170161
qmax /= qMaxResidualCorr;
171162
qtot /= qTotResidualCorr;
172163

173-
const float residualGainMapGain = calibContainer->getResidualGain(slice, padRow, padPos);
174-
qmax /= residualGainMapGain;
175-
qtot /= residualGainMapGain;
176-
177164
mChargeTot[mCount] = (GPUCA_DEDX_STORAGE_TYPE)(qtot * scalingFactor<GPUCA_DEDX_STORAGE_TYPE>::factor + scalingFactor<GPUCA_DEDX_STORAGE_TYPE>::round);
178165
mChargeMax[mCount++] = (GPUCA_DEDX_STORAGE_TYPE)(qmax * scalingFactor<GPUCA_DEDX_STORAGE_TYPE>::factor + scalingFactor<GPUCA_DEDX_STORAGE_TYPE>::round);
179166
mNClsROC[roc]++;

GPU/TPCFastTransformation/MultivariatePolynomial.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ class MultivariatePolynomial : public FlatObject, public MultivariatePolynomialH
101101
/// \param params parameter for the coefficients
102102
void setParams(const float params[/*mNParams*/]) { std::copy(params, params + mNParams, mParams); }
103103

104-
/// \param parameter which will be set
105-
/// \val value of the parameter
106-
void setParam(const unsigned int param, const float val) { mParams[param] = val; };
107-
108104
/// \return returns the paramaters of the coefficients
109105
const float* getParams() const { return mParams; }
110106

0 commit comments

Comments
 (0)