cms-nanoAOD / cmssw

CMS NanoAOD software integration repository
http://cms-sw.github.io/
Apache License 2.0
3 stars 10 forks source link

LHE weights missed by GenWeightsTableProducer to store in LHEReweightingWeight branch #564

Closed Sumantifr closed 1 year ago

Sumantifr commented 3 years ago

Dear experts,

We are generating gridpacks in MadGraph5_aMCatNLO for EFT studies and using the reweighting facility to store the event weights for different combinations of Wilson coefficients we are interested in, and finally, we are using FastSIM for detector simulation.

While all the event weights are properly stored up to the MINIAOD level, we find two event weights that get dropped from the LHEReweightingWeight branch in NanoAOD files. These two weights are: "dummy" and the one corresponding to the combination of Wilson coefficients same as in the original param_card.

We found that this comes from a small difference in the "weight id" for those two missing weights. The convention used in [1] for the std::regex rwgt misses these two weight ids as there is a \ symbol between the end quote " and > (please see this in the first two lines in [2]). A possible fix can be obtained by the following change [3].

Please let us know what you think about this.

Thanks, Suman

[1] https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc#L595

[2] https://user-images.githubusercontent.com/17446877/108488516-c3307a00-72a0-11eb-9acc-73b3614bddb9.png

[3] Change std::regex rwgt("<weight\s+id=\"(.+)\">(.+)?()?") to std::regex rwgt("<weight\s+id=\"(.+)\"?>(.+)?()?")

nanoaod_issue

mariadalfonso commented 3 years ago

@Sumantifr thanks for the report

The gen fwk for storage of weight in nano is being rewritten https://github.com/cms-sw/cmssw/pull/32167 exactly because we cannot rely too much on those std::regex

we should check you case is taken care in the new fwk @agrohsje @kdlong @dteague

Sumantifr commented 3 years ago

Thanks a lot @mariadalfonso for the quick update. I will also keep an eye on the new gen fwk.