-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Unpacker for L1T Calo Layer 1 to unpack CICADA #45037
Conversation
…CICADA score from AMC Slot 7
cms-bot internal usage |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-45037/40336
|
A new Pull Request was created by @aloeliger for master. It involves the following packages:
@epalencia, @cmsbuild, @aloeliger can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
test parameters: |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-a1eda2/39510/summary.html Comparison SummarySummary:
|
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-45037/40671
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
Pull request #45037 was updated. @cmsbuild, @aloeliger, @epalencia can you please check and sign again. |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-a1eda2/40014/summary.html Comparison SummarySummary:
|
+l1
|
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @sextonkennedy, @rappoccio, @antoniovilela (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
Congratulations. Merging this PR alone completely obliterated the IB CMSSW_14_1_X_2024-06-25-2300, https://cmssdt.cern.ch/SDT/html/cmssdt-ib/#/ib/CMSSW_14_1_X |
I guess that's because:
which is not yet ready to be merged ? |
std::vector<uint32_t> cicadaWords = {0, 0, 0, 0}; | ||
//the last 4 words are CICADA words | ||
for (uint32_t i = 2; i < 6; ++i) { | ||
cicadaWords.at(i - 2) = ((block.payload().at(i)) >> 28); | ||
} | ||
|
||
float cicadaScore = convertCICADABitsToFloat(cicadaWords); | ||
res->push_back(0, cicadaScore); | ||
return true; | ||
} | ||
} | ||
|
||
//convert the 4 CICADA bits/words into a proper number | ||
float CICADAUnpacker::convertCICADABitsToFloat(const std::vector<uint32_t>& cicadaBits) { | ||
uint32_t tempResult = 0; | ||
tempResult |= cicadaBits.at(0) << 12; | ||
tempResult |= cicadaBits.at(1) << 8; | ||
tempResult |= cicadaBits.at(2) << 4; | ||
tempResult |= cicadaBits.at(3); | ||
float result = 0.0; | ||
result = (float)tempResult * pow(2.0, -8); | ||
return result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be replaced by a simpler implementation, see https://github.com/cms-sw/cmssw/pull/44222/files#r1653052470 .
In fact, it would be better to share the duplicate code between EventFilter/L1TRawToDigi/plugins/implementations_stage2/CICADAUnpacker.cc
and EventFilter/L1TRawToDigi/plugins/implementations_stage2/CaloSummaryUnpacker.cc
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am working on this this morning, however just for posterity's sake, I will note that the exact bits grabbed are ever so slightly different, being the first 4 bits of the last 4 words for FED 1356, instead of the first 4 bits of the first 4 words for FEDs 1404 & 1405.
In any case, you are entirely correct that this could be simplified down from the ad-hoc first drafts. I can do that for the uGT one while the HLT experts review. I am not sure what happens for this one now.
@cms-sw/orp-l2 , we might not be able to converge on #44222 before 11h00 IB. I would suggest to revert this PR for 11h00 ? Any objections @cms-sw/l1-l2 ? |
I have opened #45308 ( which is revert of this PR) |
No objections here. I can sign the revert quickly. My apologies for this, I thought this was tested and tagged with the uGT unpacker as external. |
I think everything was done correctly on your side, but the |
PR description:
This PR adds an unpacker to the L1T Calo Layer 1 Unpacking Setup to explicitly unpack CICADA (found in FED 1356, AMC slot 7). This PR relies on data-types introduced in it's companion PR #44222. #44222 Unpacks the uGT received CICADA scores, while this PR unpacks the Calo sent CICADA scores.
PR validation:
All code compiles and has had code formatting applied. This Unpacker has also been tested against events with the CaloSummary/CICADA cards in DAQ. A screenshot of some debugging output of the development of the unpacker is attached. On the left side you can see the unpacked data from FED 1356, which matches the dumped FED output seen on the right (CICADA/CaloSummary highlighted)
Also shown is a demonstration that the correct CICADA bits are received in the correct order, and the resulting constructed score, matched to the expected hex number (when transformed into a 16 bit fixed-point number, with 8 integer bits, and 8 bits after the decimal point, to within machine epsilon, or display precision).
If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:
This PR is not a backport, and is not expected to need a backport. It is however, a feature of an upcoming data-taking tool, so it is not impossible that a backport will be requested for it.
@eyigitba @slaurila FYI, this is one of the DPG requested pieces for CICADA that we have made for our own commissioning purposes now. Packers will be made when we are satisfied with commissioning progress using these unpackers.