madanalysis5 icon indicating copy to clipboard operation
madanalysis5 copied to clipboard

Multiweight implementation

Open jackaraz opened this issue 2 years ago • 4 comments

Context: This PR implements the treatment of multiple weights originating from scale and PDF uncertainties.

Description of the Change:

Readers, cutflow and histogramming objects have been updated to accommodate more than one weight.

Benefits:

This will allow the implementation of theoretical uncertainties into the analysis

Major changes and limitations to backwards compatibility

InitializeForNewEvent function which takes MAfloat64 event weight value, is deprecated. It is an empty function which does not do anything at the moment. This has been replaced by void InitializeForNewEvent(const WeightCollection &EventWeight) function, which takes weight collection as an input. MCEventFormat no longer has a single weight value; everything is controlled by WeightCollection class.

Weights are initialised within main.cpp function. The user does not need to initialise them within the analysis.

jackaraz avatar Jun 27 '23 14:06 jackaraz

Hello. You may have forgotten to update the changelog! Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

github-actions[bot] avatar Jun 27 '23 14:06 github-actions[bot]

Hi @jackaraz. Can you please review the last commit? Thanks in advance.

BFuks avatar Jul 20 '23 16:07 BFuks

Hi @BenjaminFuks, can you please check the last two commits?

Next in line

  • Cutflows
  • externalisation of the unc computation for hist and cutflows
  • tests, lots and lots of tests

jackaraz avatar Jul 21 '23 16:07 jackaraz

Hi @BenjaminFuks, can you check this out? I think I'm making a mistake in the calculation of scale uncertainties

https://github.com/MadAnalysis/madanalysis5/blob/98c6d1cd77b2079035af30b8a9267ae44c7f2103/madanalysis/multiweight/histogram.py#L445-L488

seems to be problematic. My uncertainties (scaling here is turned off for unc atm just to check) seem to be the order of magnitude larger than the nominal weight.

jackaraz avatar Jan 03 '24 19:01 jackaraz