-
Notifications
You must be signed in to change notification settings - Fork 18
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
Multiweight implementation #205
base: substructure
Are you sure you want to change the base?
Conversation
Hello. You may have forgotten to update the changelog!
|
sumweight_positive_ += std::abs(weight); | ||
else | ||
sumweight_negative_ += std::abs(weight); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method addWeightedEvents
does not seem to be used anymore. Should we get rid of it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this writes total weights in the main SAF file as a summary, we can extend it with weight collections
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the proposed extension
madanalysis/multiweight/histogram.py
Outdated
if not self.has_pdf_unc: | ||
return [self.weights * self.scale] * 2 | ||
|
||
method = "replicas" # "eigenvector" # |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BFuks both implementations are ready to be tested and it can be switched from here (until we hardcode which pdfset uses which method)
* update version * bugfix probably occured during branch merging
* add control for multiple pdf sets (not available atm) * minor changes for retreiving items
f"{central_pdfs[weight_set[0].pdfset].name} will be used instead" | ||
) | ||
|
||
return weight_set[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we compute them independently and store all errors? Like for the multiple scale choice possibilities?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can, but lets go step by step please. First we need to figure which method to use for each pdfset then I can look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. Let's now test it on true events :-)
# wrong so we need to correct them. Some of the files includes | ||
# AUX tag for every weight definition. If the name is AUX_XXX | ||
# where XXX is integer, that is a true aux, if not remove the | ||
# AUX tag. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rewrite as:
# Check the weight name and make sure its written according
# to standard conventions, and update it if necessary. This is
# needed due to terribly written HEPMC files by MadSTR.
# These files include an `AUX` tag for every weight name.
# Therefore, if the weight name is `AUX_XXX`with XXX being
# an integer, then we have a true `AUX` weight. Otherwise, we
# remove the `AUX` string from the weight name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. You can use "make a suggestion" option when checking, that automatically creates a comit for the portion of the code that you want to change. Will be more efficient.
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 takesMAfloat64
event weight value, is deprecated. It is an empty function which does not do anything at the moment. This has been replaced byvoid InitializeForNewEvent(const WeightCollection &EventWeight)
function, which takes weight collection as an input.MCEventFormat
no longer has a single weight value; everything is controlled byWeightCollection
class.Weights are initialised within
main.cpp
function. The user does not need to initialise them within the analysis.