-
Notifications
You must be signed in to change notification settings - Fork 159
[QC-1020] Custom Parameters for Post-Processing #2041
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
[QC-1020] Custom Parameters for Post-Processing #2041
Conversation
|
Communist Party for Perpetual Prosperity? |
|
:-D Custom Parameters for Post-Processing |
knopers8
left a comment
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.
Thanks, it seems OK, please address my few suggestions though.
| CustomParameters::CustomParameters() | ||
| { | ||
| mCustomParameters["default"]["default"] = {}; | ||
| mCustomParameters["null"]["null"] = {}; |
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.
Why?
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.
because we need to differentiate between the case when we have the defaults coming from a config file and this case
| auto ppTree = config.get_child("qc.postprocessing." + id); | ||
| if (ppTree.count("extendedTaskParameters")) { | ||
| for (const auto& [runtype, subTreeRunType] : ppTree.get_child("extendedTaskParameters")) { | ||
| for (const auto& [beamtype, subTreeBeamType] : subTreeRunType) { | ||
| for (const auto& [key, value] : subTreeBeamType) { | ||
| customParameters.set(key, value.get_value<std::string>(), runtype, beamtype); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
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 am wondering if it's a good idea that code outside of CustomParameters is aware of the tree structure which is expected there. It might make any changes more prone to generating new bugs.
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.
indeed, I have extracted it and put it in CustomParameters
Co-authored-by: Piotr Konopka <piotr.jan.konopka@cern.ch>
No description provided.