You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Detectors/TPC/calibration/include/TPCCalibration/CalculatedEdx.h
+92-15Lines changed: 92 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,21 @@ inline ClusterFlags operator&(ClusterFlags a, ClusterFlags b) { return static_ca
95
95
inline ClusterFlags operator~(ClusterFlags a) { returnstatic_cast<ClusterFlags>(~static_cast<unsignedshort>(a)); }
96
96
inline ClusterFlags operator|(ClusterFlags a, ClusterFlags b) { returnstatic_cast<ClusterFlags>(static_cast<unsignedshort>(a) | static_cast<unsignedshort>(b)); }
97
97
98
+
/// \brief bundles the settings of one calculatedEdx() call (everything except the track/output/averageOcc)
99
+
/// used by calculatedEdxMultipleSettings() to evaluate several settings for the same track without repeating
100
+
/// the track refit/propagation for every setting
101
+
structdEdxSettings {
102
+
float low = 0.015f; ///< lower cluster cut
103
+
float high = 0.6f; ///< higher cluster cut
104
+
CorrectionFlags correctionMask = CorrectionFlags::TopologyPol | CorrectionFlags::dEdxResidual; ///< corrections to apply
105
+
ClusterFlags clusterMask = ClusterFlags::None; ///< clusters to exclude
106
+
int subthresholdMethod = 0; ///< subthreshold cluster charge filling method
107
+
int stackBoundaryMethod = 0; ///< stack boundary cluster exclusion method
108
+
std::string debugRootFile = "dEdxDebug.root"; ///< debug streamer output file used if mDebug is set
109
+
float maxSubthresholdChargeTot = 100000.f; ///< upper limit for the per-region minimum qTot used as the virtual charge of a subthreshold cluster (default effectively disables the cap)
110
+
float maxSubthresholdChargeMax = 100000.f; ///< upper limit for the per-region minimum qMax used as the virtual charge of a subthreshold cluster (default effectively disables the cap)
111
+
};
112
+
98
113
classCalculatedEdx
99
114
{
100
115
public:
@@ -126,12 +141,6 @@ class CalculatedEdx
126
141
/// \param maxMissingCl maximum number of missing clusters for subthreshold check
/// \return returns the number of row gaps filled as subthreshold clusters by calculatedEdxFromRowData() since the last resetDebugCounters() per setting
/// \param rowOrder (sector, row) keys in the order they are first encountered while scanning the track's native cluster references (0..nClusterReferences-1), i.e. the track's true physical row-traversal order
/// \param correctionMask to apply different corrections: TopologySimple = simple analytical topology correction, TopologyPol = topology correction from polynomials, GainFull = full gain map from calibration container,
177
200
/// GainResidual = residuals gain map from calibration container, dEdxResidual = residual dEdx correction
/// evaluate several dEdx settings for the same track while performing the track refit/propagation to each cluster row only once
206
+
/// \param track input track
207
+
/// \param outputs output dEdxInfo, filled with one entry per entry in settingsList, in the same order
208
+
/// \param averageOcc output average cluster occupancy of the track, per TPC region; a single value, since occupancy does not depend on the dEdx settings and is therefore the same for every entry in settingsList
209
+
/// \param settingsList list of dEdx settings to evaluate for this track
/// \brief per (sector,row) cluster/track data gathered once per track by gatherRowClusterData(), independent of the dEdx settings reused by calculatedEdxFromRowData() for each entry in a settingsList so the track refit/propagation done in gatherRowClusterData() is not repeated per setting
298
+
structRowClusterData {
299
+
o2::tpc::ClusterNative cl; ///< cluster (combined if isCombined)
300
+
o2::tpc::TrackTPC trackSnapshot; ///< track state after refit/propagation to this row's cluster
301
+
unsignedchar sectorIndex;
302
+
unsignedchar rowIndex;
303
+
unsignedint region;
304
+
unsignedchar pad;
305
+
GEMstack stack;
306
+
int stackNumber;
307
+
StackID stackID;
308
+
float chargeTot;
309
+
float chargeMax;
310
+
float clPad;
311
+
float clTime;
312
+
float threshold;
313
+
float gain;
314
+
float gainResidual;
315
+
unsignedint occupancy;
316
+
bool isShared;
317
+
bool isCombined;
318
+
bool isDeadRegion;
319
+
bool propagationFailed; ///< true if refit/propagation to this row failed, or the resulting track param is NaN
320
+
int missingClusters; ///< number of skipped rows since the previous entry in rowData (i.e. rowIndex - previous rowIndex - 1); same for every settings entry since rowOrder does not depend on the settings
321
+
bool sameSectorAsPrevRow; ///< true if this row's sector equals the previous entry in rowData's sector
322
+
bool missingClusterGapDeadOrEdge; ///< true if any of the missingClusters skipped row(s) would land on a dead channel or off the padrow edge
323
+
};
324
+
325
+
/// gather, for every (sector, row) of the track's row-traversal order, performing the refit/propagation to each cluster row exactly once
326
+
/// \param track input track, mutated in place by refit/propagation
327
+
/// \param rowData output per-row data
328
+
/// \param averageOcc output average cluster occupancy of the track, per TPC region
/// compute the dEdx output for one dEdx settings entry from the row data previously gathered by gatherRowClusterData()
332
+
/// \param rowData per row data gathered by gatherRowClusterData() for the track being processed
333
+
/// \param settings dEdx settings to apply
334
+
/// \param settingsIndex index of settings within its settingsList
335
+
/// \param trackTime0 track.getTime0() of the track being processed, captured before refit/propagation (unaffected by it)
336
+
/// \param trackOrig pristine track (before refit/propagation mutated it), used for the debug "dEdxDebugTrack" row; ignored if mDebug is false
337
+
/// \param averageOcc average cluster occupancy of the track as computed by gatherRowClusterData(), only used for the debug "dEdxDebugTrack" row; ignored if mDebug is false
std::vector<TrackTPC>* mTracks{nullptr}; ///< vector containing the tpc tracks which will be processed
266
342
std::vector<TPCClRefElem>* mTPCTrackClIdxVecInput{nullptr}; ///< input vector with TPC tracks cluster indicies
267
343
const o2::tpc::ClusterNativeAccess* mClusterIndex{nullptr}; ///< needed to access clusternative with tpctracks
@@ -272,15 +348,16 @@ class CalculatedEdx
272
348
std::unique_ptr<o2::gpu::GPUO2InterfaceRefit> mRefit{nullptr}; ///< TPC refitter used for TPC tracks refit during the reconstruction
273
349
274
350
intmMaxMissingCl{1}; ///< maximum number of missing clusters for subthreshold check
275
-
floatmMinChargeTotThreshold{50}; ///< upper limit for minimum charge tot value in subthreshold treatment, i.e for a high dEdx track adding a minimum value of 500 to track as a virtual charge doesn't make sense
276
-
floatmMinChargeMaxThreshold{50}; ///< upper limit for minimum charge max value in subthreshold treatment, i.e for a high dEdx track adding a minimum value of 500 to track as a virtual charge doesn't make sense
277
351
floatmFieldNominalGPUBz{5}; ///< magnetic field in kG, used for track propagation
278
352
boolmPropagateTrack{false}; ///< propagating the track instead of performing a refit (faster than refit)
279
353
boolmPropagateParams{false}; ///< propagating the parameters instead of full propagation (faster than track propagation)
std::unordered_map<std::string, std::unique_ptr<o2::utils::TreeStreamRedirector>> mStreamers; ///< debug streamers, keyed by output file name so each debugRootFile gets its own tree
283
357
longmDebugTrackIndex{-1}; ///< running index of the track being processed, written to the debug trees so per-cluster rows can be grouped back into tracks
358
+
longmNPropagationFailed{0}; ///< number of rows where refit/propagation failed since the last resetDebugCounters()
359
+
longmNRowsProcessed{0}; ///< number of rows gathered by gatherRowClusterData() since the last resetDebugCounters()
360
+
std::vector<long> mNSubThresholdFilledPerSettings; ///< number of row gaps filled as subthreshold clusters, per dEdxSettings list index, since the last resetDebugCounters()
284
361
285
362
CorrectdEdxDistortions mSCdEdxCorrection; ///< for space-charge correction of dE/dx
0 commit comments