Open IzaakWN opened 2 years ago
Sorry for the delay in responding, but this is a good addition. Perhaps with regards to the UI we could have a correction filter
command that takes in a single json file and then allows a sequence of keep and drop commands, each of which can address either a whole correction or perhaps even a key within a correction. e.g.
correction filter tau.json --keep tau_trigger:wp=Loose --keep tau_trigger:wp=Tight --drop * -o tau_small.json
I'm happy to assist with the implementation. Perhaps we start with just keeping whole corrections?
Some of the full JSONs provided by the TauPOG are quite large because the trigger SFs. A large number of tau analysts won't need these, so it could save some disk space and initial loading time if there's an easy way to remove unneeded data from a JSON.
Removing corrections from correction sets
We could add some type of "remove" and/or "filter" subcommand to
correction
, to remove someCorrection
objects from aCorrectionSet
in a file. Something likewhere the
Correction
objecttau_trigger
is removed from the set in the input filetau.json
. It would not be difficult to implement usingmerge
as a basis. If you want, I can have a look later and prepare a PR?Removing keys from corrections
Maybe related to Issues https://github.com/cms-nanoAOD/correctionlib/issues/15 & https://github.com/cms-nanoAOD/correctionlib/issues/38, this could later be extended to remove slices from a
Correction
object. For example, say you want to remove some specific category key you don't need, like a ID, WP or systematic variation, you would dowhere the script would recursively go through the data of the
Correction
objectsfs
and remove all data that is assigned exclusively to the keyDeepTau
for pre-defined input variableid
. Other example is to remove some unneeded WPs:if one only wants to keep
Medium
.