cms-l1-dpg / Phase2-L1Nano

NanoAOD ntupler for Phase-2 L1 Objects
Apache License 2.0
1 stars 5 forks source link

Add HW variables for standalone EG objects #1

Open artlbv opened 11 months ago

artlbv commented 11 months ago

In the current way we use the CandViewMerger to merge the barrel and endcap EG collections: https://github.com/cms-l1-dpg/Phase2-L1Nano/blob/7728e4237b4983f95f351458247b9611cdacba66/python/l1Ph2Nano_cff.py#L211-L214

This works with the SimpleCandidateFlatTableProducer but it fails when trying to access the HW values e.g. hwQual.

One can use the SimpleTriggerL1EGFlatTableProducer created for the BX Vector EG collection for Phase-1 to access this hwQual for the individual barrel and endcap collections separately though.

But when trying to use the SimpleTriggerL1EGFlatTableProducer on the Merged collection it fails:

An exception of category 'ProductNotFound' occurred while
   [0] Processing  Event run: 1 lumi: 677 event: 198889 stream: 0
   [1] Running path 'end'
   [2] Prefetching for module NanoAODOutputModule/'outnano'
   [3] Calling method for module SimpleTriggerL1EGFlatTableProducer/'staEGTable'
Exception Message:
Principal::getByToken: Found zero products matching all criteria
Looking for type: BXVector<l1t::EGamma>
Looking for module label: staEGmerged
Looking for productInstanceName: 

It seems that the merged collection does not preserve the BXVector<l1t::EGamma> type? Thus we have to figure out a way to properly merge these two EG collections and make a table from them.

artlbv commented 10 months ago

Reproduce by uncommenting this line:

cerminar commented 9 months ago

The behavior seems consistent with expectations. The CandViewMerger.cc produces a merged collection of type reco::CandidateCollection and not BXVector<l1t::EGamma>. I didn't manage to instantiate a generic Merge<> for BXVector. Possible solutions would be:

Maybe the second already exists somewhere in the CMSSW repo?