CMSDeepFlavour / DeepNTuples

3 stars 47 forks source link

Broken in 10X #50

Open emilbols opened 6 years ago

emilbols commented 6 years ago

I was able to run the 94X branch in 10_0_1 without issues, but after PR https://github.com/CMSDeepFlavour/DeepNTuples/pull/44 , this appears to be no longer possible.

The ntuplizer fails with exception:

"RefCore: A request to resolve a reference to a product of type 'std::vector \<reco::GenParticle> ' with ProductID '2:3084' can not be satisfied because the product cannot be found."

specifically it seems to come when calling (*bhad_in_jet)->pt(), i.e. https://github.com/CMSDeepFlavour/DeepNTuples/pull/44/files#diff-4151dba03f072c2112f3609edced4746R405

An example of a file I use is: /eos/cms/store/mc/RunIISpring18MiniAOD/QCD_HT2000toInf_TuneCP5_13TeV-madgraph-pythia8/MINIAODSIM/100X_upgrade2018_realistic_v10-v1/00000/26656634-1247-E811-BE41-FA163E262593.root

After reverting PR https://github.com/CMSDeepFlavour/DeepNTuples/pull/44 , I can run without issues.

emilbols commented 6 years ago

i have the same issue in 9_4_1 running on /eos/cms/store/mc/RunIIFall17MiniAOD/QCD_Pt_50to80_TuneCP5_13TeV_pythia8/MINIAODSIM/94X_mc2017_realistic_v11_ext1-v1/70000/6025D7BF-6732-E811-9F96-FA163EDF22C6.root

jkiesele commented 6 years ago

Hi, thanks for pointing that out. It is not quite obvious to me how this happens. For now, I would suggest to remove this part of the code entirely (but don't remove the branch), and then work on a solution before re-implementing it. @daseith , can you please take care of this?

emilbols commented 6 years ago

an extra thing, I can run with the PR on the phase II samples without a problem. I assume this is what david tested on, and indeed, it seems to work fine here.

/eos/cms/store/mc/PhaseIITDRFall17MiniAOD/TT_TuneCUETP8M2T4_14TeV-powheg-pythia8/MINIAODSIM/PU200_93X_upgrade2023_realistic_v2_ext1-v1/30000/F2A8268B-16C7-E711-BA54-0025904C4F52.root

daseith commented 6 years ago

I will look into it. It seems to me the problem arises from the iterator in the loop. So maybe it is enough to replace the iterator in the for loop and loop over the vector in a different way.

jkiesele commented 6 years ago

Please first remove it for now such that the code is usable. Once you have a fix, make another PR to re-implement it.

daseith commented 6 years ago

I tried a couple of things now without success. Right now I don't know how to fix this issue. It seems to me currently like the reference to the individual GenParticles in the Jet is simply missing in the 94X samples and therefore one cannot access them.

jkiesele commented 6 years ago

Ok, given this is more a monitoring branch for studies, is there a way we can just not calculate the variable if the reference is missing? If so, please just implement it like this.

daseith commented 6 years ago

A simple thing one could do would be to just embrace the code in a try catch block.