Skip to content

[MTD]: BTL readout mapping - first implementation in CondFormats#51279

Open
martinamalberti wants to merge 3 commits into
cms-sw:masterfrom
martinamalberti:mm_BTLMappingCondFormat_20260622
Open

[MTD]: BTL readout mapping - first implementation in CondFormats#51279
martinamalberti wants to merge 3 commits into
cms-sw:masterfrom
martinamalberti:mm_BTLMappingCondFormat_20260622

Conversation

@martinamalberti

Copy link
Copy Markdown
Contributor

PR description:

This PR introduces a first implementation of the BTL electronics readout mapping infrastructure for the BTL detector. It supersedes #50918.

Two new objects are added in CondFormats/MTDObjects

  • BTLElectronicsId: encodes the full electronics address of a BTL readout channel (FED/Slink, HS-link, e-link, TOFHIR channel, see [1]) packed into a single uint32_t

  • BTLReadoutMap : the conditions payload providing a bidirectional mapping between BTLDetId (detector geometry) and BTLElectronicsId (readout electronics). The forward map (BTLDetIdBTLElectronicsIdPair) is serialized; the reverse map (BTLElectronicsIdBTLDetId) is transient and rebuilt at initialization. Each crystal has two readout channels, represented by BTLElectronicsIdPair.

The map is currently populated by BTLReadoutMapESProducer, which makes the map available via the EventSetup.
The S-link identifiers (which will eventually correspond to FED IDs) are currently assigned temporarily in the [0–11] range as placeholders and will be updated once the official FED IDs are defined.
This work is a prerequisite to start the development of the BTL packer/unpacker.
A testing script has also been added in CondFormats/MTDObjects/test to verify the mapping and validate the behaviour of all implemented functions.

[1] slide 5 of https://indico.cern.ch/event/1484764/contributions/6257318/attachments/2983853/5254667/MTD_DAQ_PCD_CMS_WEEK.pdf

PR validation:

The code compiles successfully and was tested with CondFormats/MTDObjects/test/testBTLReadoutMap.py, to validate the mapping and verify that the implemented functions work as expected.

@cmsbuild

cmsbuild commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

cms-bot internal usage

@cmsbuild

Copy link
Copy Markdown
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51279/49887

@cmsbuild

Copy link
Copy Markdown
Contributor

A new Pull Request was created by @martinamalberti for master.

It involves the following packages:

  • CondCore/MTDPlugins (****)
  • CondFormats/DataRecord (alca, db)
  • CondFormats/MTDObjects (alca, db)
  • EventFilter/MTDRawToDigi (****)
  • Geometry/MTDCommonData (geometry)

The following packages do not have a category, yet:

CondCore/MTDPlugins
EventFilter/MTDRawToDigi
Please create a PR for https://github.com/cms-sw/cms-bot/blob/master/categories_map.py to assign category

@Alejandro1400, @Dr15Jones, @EltonSh, @JanChyczynski, @arunhep, @bsunanda, @civanch, @cmsbuild, @francescobrivio, @kpedro88, @makortel, @mdhildreth, @perrotta can you please review it and eventually sign? Thanks.
@JanChyczynski, @Martin-Grunewald, @PonIlya, @bsunanda, @fabiocos, @missirol, @mmusich, @seemasharmafnal, @tocheng this is something you requested to watch as well.
@ftenchini, @mandrenguyen, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@martinamalberti

Copy link
Copy Markdown
Contributor Author

please test

@cmsbuild

Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 64KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-e7de61/54199/summary.html
COMMIT: ab86078
CMSSW: CMSSW_20_1_X_2026-06-22-2300/el9_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/51279/54199/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 3 lines to the logs
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 45
  • DQMHistoTests: Total histograms compared: 3414477
  • DQMHistoTests: Total failures: 68
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3414391
  • DQMHistoTests: Total skipped: 18
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 44 files compared)
  • Checked 195 log files, 163 edm output root files, 45 DQM output files

@cmsbuild

Copy link
Copy Markdown
Contributor

24LopezR added a commit to 24LopezR/cmssw that referenced this pull request Jun 24, 2026
@martinamalberti

Copy link
Copy Markdown
Contributor Author

please test

@perrotta perrotta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Martina: since you are updating anyhow, you can also take this trivia into account

<< "BTL electronics mapping not available for BTL crystal layout " << static_cast<int>(btlCrysLayout)
<< ", use layout 7 (v4) or later!" << std::endl;
return std::make_unique<BTLReadoutMap>();
;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
;

@cmsbuild

Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 24KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-e7de61/54275/summary.html
COMMIT: 6dc4e71
CMSSW: CMSSW_20_1_X_2026-06-25-1100/el9_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/51279/54275/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 1 lines to the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 45
  • DQMHistoTests: Total histograms compared: 3414477
  • DQMHistoTests: Total failures: 69
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3414390
  • DQMHistoTests: Total skipped: 18
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 44 files compared)
  • Checked 195 log files, 163 edm output root files, 45 DQM output files
  • TriggerResults: no differences found

@cmsbuild

Copy link
Copy Markdown
Contributor

@cmsbuild

Copy link
Copy Markdown
Contributor

@martinamalberti

Copy link
Copy Markdown
Contributor Author

please test

@cmsbuild

Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 24KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-e7de61/54294/summary.html
COMMIT: a32af1b
CMSSW: CMSSW_20_1_X_2026-06-25-2300/el9_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/51279/54294/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 45
  • DQMHistoTests: Total histograms compared: 3414477
  • DQMHistoTests: Total failures: 26
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3414433
  • DQMHistoTests: Total skipped: 18
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 44 files compared)
  • Checked 195 log files, 163 edm output root files, 45 DQM output files
  • TriggerResults: no differences found

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for my understanding what is purpose of this file ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to this tutorial: https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideCondObjectsTutorial the src/headers.h file is read by the serialization system to find the serializable classes and generate serialization code for them.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, thanks

@perrotta

Copy link
Copy Markdown
Contributor

+1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, just for my own understanding, shouldn't the file be named BTLReadoutMap.cc instead of BTLReadouMap.cc?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Moanwar Yes, indeed. Thanks for spotting it.

static constexpr std::array<std::pair<int, int>, BTLDetId::kDModulesPerRU * 2> ELINK_to_FE_mapping_L1{{
{6, 1}, // e-link 0: {DM 6, chipId 1}
{3, 1}, // e-link 1: {DM 3, chipId 1}
{11, 0}, {11, 1}, {3, 0}, {6, 0}, {2, 1}, {2, 0}, {1, 0}, {1, 1}, {0, 0}, {0, 1}, {5, 1}, {5, 0},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not an expert on this mapping, but it might be worth checking: I don't see module 7 in the table, while module 11 appears twice. Is that intentional?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants