Skip to content
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

Include ZDC in L1T re-emulation workflows #43214

Open
missirol opened this issue Nov 7, 2023 · 22 comments
Open

Include ZDC in L1T re-emulation workflows #43214

missirol opened this issue Nov 7, 2023 · 22 comments

Comments

@missirol
Copy link
Contributor

missirol commented Nov 7, 2023

Weeks ago, the L1-uGT emulator (#42634) and unpacker (#42733) were updated to make use of data from the Zero-Degree Calorimeter, for the 2023 HIon run (and beyond). These updates were the necessary ones to be able to correctly take data online with a L1T menu including algorithms using ZDC data.

Other updates needed to properly test/re-emulate such L1T menus offline are still missing. For what I understand, this includes (at least) the following.

  • A "packer" ("digi to raw") of the ZDC digis, as part of L1TDigiToRaw.
  • The necessary updates to include this in all the relevant sequences/workflows to re-emulate the L1T results, e.g. SimL1EmulatorRepack_Full_cff.

As long as these updates are missing, any re-emulation of the L1T results in standard workflows will return incorrect results for any L1T algorithms using ZDC (again, for what I understand).

FYI: @cms-sw/hlt-l2

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 7, 2023

A new Issue was created by @missirol Marino Missiroli.

@Dr15Jones, @sextonkennedy, @smuzaffar, @rappoccio, @antoniovilela, @makortel can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@mmusich
Copy link
Contributor

mmusich commented Nov 7, 2023

assign l1

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 7, 2023

New categories assigned: l1

@epalencia,@aloeliger you have been requested to review this Pull request/Issue and eventually sign? Thanks

@aloeliger
Copy link
Contributor

@missirol @mmusich, I spoke with the ZDC developers a few weeks ago about providing a packer for their workflows. No update since then.

@mmusich
Copy link
Contributor

mmusich commented Nov 7, 2023

, I spoke with the ZDC developers a few weeks ago about providing a packer for their workflows. No update since then.

Might be useful to tag them here as well if you know the gutHub accounts.
I don't know what are the general CMS plans for HI MC production, but looks like the ZDC L1T packer would be a necessary ingredient for the HLT simulation.

@aloeliger
Copy link
Contributor

@matt2275 Just tagging you on this. @cfmcginn We didn't talk about this, but you developed the original ZDC emulator, so perhaps you should be in the loop.

@matt2275
Copy link
Contributor

matt2275 commented Nov 7, 2023

I have a first draft of a ZDC packer here (https://github.com/matt2275/cmssw/tree/ZDCUnpacker/EventFilter/L1TRawToDigi). I have not done any testing since I'm not sure how to do that. One way of testing this would be to produce two sets of digis one that was only unpacked once and the other that was unpacked, repacked and unpacked again. If the sets are identical, it's a good sign the packer is working properly. Unfortunately, I'm not sure how to go about doing that.

@missirol
Copy link
Contributor Author

missirol commented Jan 9, 2024

@cms-sw/l1-l2

What's the status of this issue ?

@mmusich
Copy link
Contributor

mmusich commented Jul 8, 2024

What's the status of this issue?
@cms-sw/l1-l2 @matt2275

@mmusich
Copy link
Contributor

mmusich commented Jul 8, 2024

IIUC

A "packer" ("digi to raw") of the ZDC digis, as part of L1TDigiToRaw.

was done at #44019

What about the item

The necessary updates to include this in all the relevant sequences/workflows to re-emulate the L1T results, e.g. SimL1EmulatorRepack_Full_cff.

@hjbossi
Copy link
Contributor

hjbossi commented Jul 8, 2024

Hi @mmusich, the L1TZDC emulation is included here: #42818 - is this what you mean or something else? Of course, this is also dependent on the outstanding issue related to the geometry (see #43582) but this is being fixed by @bsunanda .

@hjbossi
Copy link
Contributor

hjbossi commented Jul 8, 2024

tagging also @Michael-Krohn, @cfmcginn, @abdoulline

@matt2275
Copy link
Contributor

matt2275 commented Jul 9, 2024

@mmusich the packer was added with #44019.

I do not about the status of updating the relevant sequences and workflows

@abdoulline
Copy link

abdoulline commented Jul 10, 2024

I hope @Michael-Krohn can correct me, but my understanding of the caveat with ZDC TP emulation ( #42818 ) is the following:

  • it works/serves solely for data re-emulation for consistency checks of emulated vs on-detector ZDC TPs

Because:

  • existing ZDC DB conditions correspond to Run1 legacy ZDC, as Run3 ZDC Geometry (-> channels serialization) is not yet available
  • Run3 ZDC MC simulation (including Run3 ZDC TPs) does not exist, as there is still Run1 legacy ZDC Geometry and Digitization (+ legacy DB conditions) in CMSSW_14_1_X

@hjbossi
Copy link
Contributor

hjbossi commented Jul 12, 2024

Yes, that is also my understanding. Assuming that the geometry issues are fixed by @bsunanda, are there still other changes that we need to do for this?

@missirol
Copy link
Contributor Author

  • The necessary updates to include this in all the relevant sequences/workflows to re-emulate the L1T results, e.g. SimL1EmulatorRepack_Full_cff.

The example in [*] for CMSSW_14_1_0_pre5 shows that the L1T results before prescales are the same for hltData_ref.log (no L1T emulation) and hltData_L1uGT.log (L1REPACK:uGT), while all the ZDC L1T seeds accept zero events in hltData_L1Full.log (L1REPACK:Full).

Is the test in [*] with L1REPACK:Full expected not to work for ZDC seeds ? (cc: @eyigitba)

[*]

#!/bin/bash

# CMSSW_14_1_0_pre5

execmd="hltGetConfiguration /dev/CMSSW_14_0_0/HIon --no-prescale --no-output --max-events 100"
execmd+=" --paths HLTriggerFirstPath,HLTriggerFinalPath,HLTAnalyzerEndpath"

${execmd} \
  --customise HLTrigger/Configuration/CustomConfigs.customiseHLTforHIonRepackedRAWPrime \
  --input file:/eos/cms/store/user/cmsbuild/store/hidata/HIRun2023A/HIPhysicsRawPrime0/RAW/v1/000/375/491/00000/de963321-c0a0-49fb-b771-1a312a69db03.root \
  --globaltag 140X_dataRun3_HLT_v3 \
  --data \
  > hltData_ref.py && cmsRun hltData_ref.py &> hltData_ref.log

${execmd} \
  --customise HLTrigger/Configuration/CustomConfigs.customiseL1THLTforHIonRepackedRAWPrime \
  --input file:/eos/cms/store/user/cmsbuild/store/hidata/HIRun2023A/HIPhysicsRawPrime0/RAW/v1/000/375/491/00000/de963321-c0a0-49fb-b771-1a312a69db03.root \
  --globaltag 140X_dataRun3_HLT_v3 \
  --data \
  --eras Run3 --l1-emulator uGT \
  > hltData_L1uGT.py && cmsRun hltData_L1uGT.py &> hltData_L1uGT.log

${execmd} \
  --customise HLTrigger/Configuration/CustomConfigs.customiseL1THLTforHIonRepackedRAWPrime \
  --input file:/eos/cms/store/user/cmsbuild/store/hidata/HIRun2023A/HIPhysicsRawPrime0/RAW/v1/000/375/491/00000/de963321-c0a0-49fb-b771-1a312a69db03.root \
  --globaltag 140X_dataRun3_HLT_v3 \
  --data \
  --eras Run3 --l1-emulator Full \
  > hltData_L1Full.py && cmsRun hltData_L1Full.py &> hltData_L1Full.log

@eyigitba
Copy link
Contributor

Hi @missirol , I would assume that L1REPACK:Full and L1REPACK:FullSimTP should re-emulate ZDC ETSum and trigger on this correctly. I think the reason for zero events passing is that something about the ZDC emulation workflow is missing in these sequences.

Let me ping @aloeliger @epalencia directly and hopefully they can have a look at this.

@hjbossi
Copy link
Contributor

hjbossi commented Jul 14, 2024

Hi All, Thanks for your help with this. Yes, it would be good to have a look and discuss as needed. We have some workforce that could help make the required changes as long as we have a good understanding of what is needed. Please let me know if it would be helpful to discuss offline.

@abdoulline
Copy link

abdoulline commented Jul 14, 2024

I'm not sure whether
ZDC TPs emulation would work (as is) in CMSSW_14_0/14_1, even if uses only EM and HAD (existing since the beginning of ZDC deployment) channels.
E.g. for generating 2023 ZDC LUTs were used private txt conditions in a privately "hacked" CMSSW.

Actual ZDC DB conditions contain Run1 legacy constants and recently (14_0) ZDCDetId was changed.
@Michael-Krohn @JHiltbrand do you have an idea what'd happen if ZDC TPs emulation were run "as is"?

@Michael-Krohn
Copy link
Contributor

I have not tried to run the ZDC TP emulation as is (with the Run1 legacy DB conditions and the emulation in 14_0), but I am not surprised that there are zero events passing the ZDC trigger.

In our current version of the condition HcalLutMetadata there are no ZDC channels. This condition is used to construct the output LUT for all channels, including the ZDC ones. Where specifically a calibration factor is grabbed from that file (https://github.com/cms-sw/cmssw/blob/master/CalibCalorimetry/HcalTPGAlgos/src/HcaluLUTTPGCoder.cc#L633) and multiplied to the output energy of each channel. With this value not set for the ZDC channels in the current conditions, I'm not sure what value is being multiplied here but if it defaults to 0 then the output energy for every EM and HAD channel in the emulation would be 0.

@missirol
Copy link
Contributor Author

Afaiu, L1REPACK:FullSimTP includes the re-emulation of the TPs, but L1REPACK:Full does not (it starts from the unpacked TPs in data), and the latter is also not working (based on #43214 (comment)).

@missirol
Copy link
Contributor Author

I think the reason for zero events passing is that something about the ZDC emulation workflow is missing in these sequences.

@eyigitba , I think that's indeed the case, see #45712. Note that even with #45712 the results of L1REPACK:uGT and L1REPACK:Full are not the same for L1T-ZDC seeds (and I did not investigate why, but someone should).

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

No branches or pull requests

9 participants