Skip to content

More change.#4163

Merged
osbornjd merged 9 commits intosPHENIX-Collaboration:masterfrom
Ishangoel11:master
Feb 6, 2026
Merged

More change.#4163
osbornjd merged 9 commits intosPHENIX-Collaboration:masterfrom
Ishangoel11:master

Conversation

@Ishangoel11
Copy link
Copy Markdown
Contributor

@Ishangoel11 Ishangoel11 commented Feb 4, 2026

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work for users)
  • Requiring change in macros repository (Please provide links to the macros pull request in the last section)
  • I am a member of GitHub organization of sPHENIX Collaboration, EIC, or ECCE (contact Chris Pinkenburg to join)

What kind of change does this PR introduce? (Bug fix, feature, ...)

TODOs (if applicable)

Links to other PRs in macros and calibration repositories (if applicable)

TPC Dead/Hot Channel Masking Support

Motivation / context
This PR adds the ability to mask known dead and hot TPC channels during clustering, allowing the reconstructor to ignore problematic pads from CDB-sourced or file-sourced channel maps. This helps produce more robust cluster reconstruction for both experimental and simulated data where specific channels should be excluded.

Key changes

  • New mask container type: typedef std::map<TrkrDefs::hitsetkey, std::unordered_setTrkrDefs::hitkey> hitMaskTpcSet.
  • Public setters to enable mask behavior and specify sources:
    • SetMaskChannelsFromFile()
    • SetDeadChannelMapName(const std::string&)
    • SetHotChannelMapName(const std::string&)
  • New helper: TpcClusterizer::makeChannelMask(hitMaskTpcSet& aMask, const std::string& dbName, const std::string& totalChannelsToMask) to populate masks from CDB or files.
  • Thread-local propagation: thread_data extended with pointers and flags:
    • hitMaskTpcSet *deadMap = nullptr; *hotMap = nullptr; bool maskDead = false; bool maskHot = false
      These are set from the main object (m_deadChannelMap/m_hotChannelMap, m_maskDeadChannels/m_maskHotChannels) and passed into worker threads.
  • Mask-aware clustering logic: introduces an is_pad_masked lambda and applies mask checks at multiple hot spots (edge detection and the hit-processing loops) to skip masked pads before cluster/edge decisions.
  • New includes and containers: added CDBTTree.h, CDBInterface.h, memory, unordered_set and related header changes.
  • Change size: ~+186/-14 in implementation, +34/-4 in header (estimated).

Potential risk areas

  • Thread-safety: masks are shared (read-only) pointers used by multiple worker threads. Ensure access patterns remain read-only and that the mask containers are fully initialized before threads read them.
  • Reconstruction behavior: masking changes which pads contribute to edges and clusters—this will alter outputs and may affect downstream analyses and QA comparisons.
  • IO/format dependency: mask loading expects specific CDB/file schema (layer/sector/side/pad and TotalDeadChannels/TotalHotChannels metadata). Mismatches or missing CDB entries can cause masking to be silently skipped or produce incomplete masks.
  • Performance: additional per-pad checks in tight loops add branching and lookups that may impact throughput; effect should be measured on representative datasets.
  • Error handling: current behavior logs errors and may continue without masks; clearer fallbacks or hard-fail options might be needed for some workflows.

Possible future improvements

  • Cache mask results across runs to avoid repeated CDB/file lookups.
  • Add stricter validation and clearer error reporting for mask file/CDB schema mismatches.
  • Benchmark and optimize mask lookup (e.g., more compact containers or precomputed bitsets) to reduce per-hit overhead.
  • Add unit/integration tests and QA plots showing reconstruction differences with/without masking.
  • Document the expected CDB/file schema and example files for users.

Note on analysis

  • This summary was generated with AI assistance; please verify critical details (function signatures, threading initialization order, and exact I/O expectations) against the code before merging—AI may make mistakes.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

Adds dead/hot TPC channel masking to TpcClusterizer: new mask container type, setters to enable masks and name maps, makeChannelMask helper to build masks (CDB/file), per-thread mask pointers/flags, and mask checks integrated into pad/hit processing and clustering logic to skip masked channels.

Changes

Cohort / File(s) Summary
Header: API & types
offline/packages/tpc/TpcClusterizer.h
Adds hitMaskTpcSet typedef, public setters SetMaskChannelsFromFile(), SetDeadChannelMapName(), SetHotChannelMapName(), and private makeChannelMask() declaration. Adds private members: m_deadChannelMap, m_hotChannelMap, m_maskDeadChannels, m_maskHotChannels, m_maskFromFile, m_deadChannelMapName, m_hotChannelMapName.
Implementation: masking logic
offline/packages/tpc/TpcClusterizer.cc
Implements makeChannelMask() (CDB/file support), adds includes (CDBTTree.h, CDBInterface.h, memory utilities), extends thread_data with deadMap, hotMap, maskDead, maskHot, wires mask maps into InitRun and per-thread initialization, and injects is_pad_masked checks across hit/cluster processing to skip masked pads. Adjusts control flow to honor masking flags.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sphenix-jenkins-ci
Copy link
Copy Markdown

Build & test report

Report for commit 2110245677195fc344372268bc0b40f8947fb239:
Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@sphenix-jenkins-ci
Copy link
Copy Markdown

Build & test report

Report for commit 40660d1532e54f5c5aab4a2f86d8510823a25b23:
Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@sphenix-jenkins-ci
Copy link
Copy Markdown

Build & test report

Report for commit a0c4f0024bf1d9fc1f5e4874d3f99283fe073c03:
Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@osbornjd osbornjd merged commit dde76a8 into sPHENIX-Collaboration:master Feb 6, 2026
22 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Feb 12, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants