TPC: Improve standalone dEdx calculation class - #15650
Draft
tubagundem wants to merge 2 commits into
Draft
Conversation
Collaborator
|
Is this relevant for the pb26 production? |
Contributor
Author
No, this is just to improve the dE/dx calculation class if we want to use it later or if we want to debug things locally. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Merge same-row clusters, then fix the traversal bug this introduced:
Added
handleSameRowClusters(), which merges clusters that fall in the same (sector, row) and are assigned to the same track into a single combined cluster — pad/time are a charge-weighted average, total charge is summed, max charge is the max across the merged clusters. Introducing this merge exposed a bug in the order clusters were traversed along the track; the second commit fixes it by walking clusters in the track's actual native cluster-reference order (rowOrder, recorded on first encounter) instead of assuming a fixed row order.Fixed frequent track-propagation failures, plus a faster propagation option:
Track propagation (
mPropagateTrack) previously left the track state corrupted ifrotate()orPropagateToXBxByBzfailed partway through a step, causing every later row's propagation to fail too. Both now snapshot the track state first and roll back to it on failure, so one bad row no longer poisons the rest. Also addedsetPropagateParams()/mPropagateParams, a cheaper alternative that propagates only the track parameters (no material corrections) instead of the full track.Excluded clusters no longer bias the subthreshold fill:
Minimum-charge tracking and missing-cluster counting used to run over every cluster, including ones that would later be excluded (dead region, edge, failed propagation, etc.). Now they only run over clusters that are actually accepted into the dE/dx calculation.
New cluster-exclusion:
ExcludeSplitClsplit intoExcludeSplitPadClandExcludeSplitTimeClfor finer-grained control (bit values renumbered).ExcludeSamePadRowCl— exclude clusters that were merged from the same pad row.isInStackBoundaries()and amStackBoundariestable (row ranges per GEM stack), controlled by a newstackBoundaryMethodparameter (0 = disabled, 1 = exclude boundary row, 2 = also exclude the adjacent row).loadCalibsFromCCDB()) and clusters in dead regions are excluded.Per-region occupancy output:
Added an
AverageOccupancystruct (IROC/OROC1-3) and a new output parameter oncalculatedEdx()returning average track occupancy per TPC region.Debug streamer overhaul:
Replaced the old per-track parallel debug vectors with two linked trees:
dEdxDebugTrack(one row per track: pristine track, output, average occupancy, summary counts) anddEdxDebugCl(one row per cluster, with the track's propagated/refit parameters at that cluster). Rows are matched via a new runningmDebugTrackIndex.setStreamer()also now keeps a map of streamers keyed by output filename, so differentcalculatedEdx()calls writing to different debug files each get their own independent tree.Simplified subthreshold cluster filling:
Removed the Landau-based method (method=2) from
fillMissingClusters(), keeping only minimum-charge and minimum-charge/2.getOccupancy()signature change:Now takes a cluster time (
float) instead of aClusterNative, and is only valid when the refit method (not propagation) is used, since the occupancy map is only filled bysetRefit().Added
macro/calculatedEdx.C:A full example macro demonstrating standalone use of
CalculatedEdx: reads TPC tracks and native clusters (real data or MC), optionally restricts to TPC tracks matched to an ITS track, runs oneCalculatedEdxinstance per worker thread for parallel processing, validates all parameters up front, and reports CPU/wall-clock timing.