-
Notifications
You must be signed in to change notification settings - Fork 27
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 P2GT decisions to L1Nano #1179
Comments
Hi @artlbv, I think there is a bug in uproot. If you remove the with uproot.open("l1t_emulation.root") as f:
arr = f["Events"].arrays(filter_name = f"l1tP2GTAlgoBlocks_l1tGTAlgoBlockProducer__{prod}.obj.algoName_")
print(ak.to_regular(arr)[f"l1tP2GTAlgoBlocks_l1tGTAlgoBlockProducer__{prod}.obj.algoName_"][0]) I'll check the uproot source code. |
Thanks for this @HaarigerHarald though the issue here is to get the trigger bits into "CMSSW Nano". |
An update: First, one can use the SingleFlatTableProducer for the P2GT AlgoBlock with: #include "DataFormats/L1Trigger/interface/P2GTAlgoBlock.h"
typedef SimpleFlatTableProducer<l1t::P2GTAlgoBlock> P2GTAlgoBlockFlatTableProducer; And then in the cff: gtAlgoTable = cms.EDProducer(
"P2GTAlgoBlockFlatTableProducer",
src = cms.InputTag('l1tGTAlgoBlockProducer'),
cut = cms.string(""),
name = cms.string("L1GT"),
doc = cms.string("GT Algo Block decisions"),
singleton = cms.bool(False), # the number of entries is variable
variables = cms.PSet(
name = Var("algoName",string, doc = "algo name"),
final = Var("decisionFinal",float, doc = "final decision"),
initial = Var("decisionBeforeBxMaskAndPrescale_",float, doc = "initial decision"),
)
) Next, the names need to be added and we discussed different options with @aloeliger, @qvyz and @HaarigerHarald (this is for L1: https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/NanoAOD/plugins/L1TriggerResultsConverter.cc) Alternatively, one would need to save the trigger names differently e.g. through the meta data or even the table producer. |
An equivalent to process.l1tP2GTTrigConvert = cms.EDProducer("P2GTTriggerResultsConverter",
src = cms.InputTag("l1tGTAlgoBlockProducer")
prefix = cms.string("L1_"), # can be anything or omitted, default: "L1_"
decision = cms.string("final"), # can be "beforeBxMaskAndPrescale", "beforePrescale", "final" or omitted, default: "final"
) |
The goal is to store the P2GT emulator trigger decisions in the L1Nano as done for Phase-1, e.g. having one branch
L1_SingleMu22
per trigger seed. For reference: the Phase-2L1Nano setup is here: https://github.com/cms-l1-dpg/Phase2-L1NanoFor phase-1 there is a dedicated producer
L1TriggerResultsConverter
used in the Nano that dumps the GT trigger seed decisions to individual branches:https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/NanoAOD/python/triggerObjects_cff.py#L375-L379
The source code is here: https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/NanoAOD/plugins/L1TriggerResultsConverter.cc
Hence I imagine we would need to write something similar for the P2GT->Nano conversion.
I briefly discussed/shared this with the P2GT team (Elias @qvyz , Benjamin, Hannes, Dinyar and Jaana @jheikkil ) and they were agreeing with this.
@aloeliger @epalencia, could you provide some support for this?
cc @mcepeda
Some more technical information below:
Within CMSSW the P2GT "algorithm block" decisions can be accesses as described here:
https://twiki.cern.ch/twiki/bin/viewauth/CMS/PhaseIIL1TriggerMenuTools#Accessing_the_trigger_decision_o
and here: https://twiki.cern.ch/twiki/pub/CMS/PhaseIIL1TriggerMenuTools/P2GTEmulator-AlgoBlock.pdf
With
uproot
one can read the decisions from theEDM/FEVT
file like this:One does however not know the order of the seeds directly here unlike in the Phase-1 version, where the algorithm seed names are encoded in the
TTree
aliases, but instead through the CMSSW accessoralgo.algoName()
.This can be done in FWlite as shown here:
https://github.com/cms-sw/cmssw/blob/master/L1Trigger/Phase2L1GT/test/menu_analyzer.py#L68C28-L68C36
The text was updated successfully, but these errors were encountered: