Update to optional NanoAOD version - #106
Open
sofiagiappichini wants to merge 4 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every law/luigi command required
--nanoAOD_versionto be passed explicitly, even though the sample's nick is enough to determine unambiguously which version/directory a sample lives in. This work is related to the [sample database PR #62] (KIT-CMS/KingMaker_sample_database#62). This allows for multiple versions to be run from a single call.What this PR does:
processor/framework.py: Task.nanoAOD_version now defaults to "" instead of nanoAOD_v15. Adds two resolution helpers:Both return the passed-in version unchanged if one is given (
--nanoAOD_versionstill works exactly as before — no directory searching happens in that case, and the old single-version error-if-not-found behavior is preserved). Otherwise they scan sample_database/nanoAOD_v*/ and auto-pick the version if exactly one contains the sample; if none or more than one do, they raise a clear error telling you to either fix the sample_database naming collision or pass--nanoAOD-versionexplicitly.processor/tasks/CROWNBase.py: ProduceBase no longer forces one shared nanoAOD_version for an entire sample_list. dataset_database is only pinned to a single version's datasets.json when --nanoAOD_version (or --dataset-database) is passed explicitly — matching the old behavior exactly. Otherwise, set_sample_data() resolves each requested sample's version individually, so a single sample_list can freely mix samples from different NanoAOD versions as long as each one is unambiguous on its own. The printed sample table also gained a "NanoAOD" column showing each sample's resolved version.processor/tasks/ProduceNtuples.py: requires() now passes each sample's own resolved nanoAOD_version explicitly into its CROWNFriend.req()/CROWNRun.req() call, so every downstream task in that sample's chain uses the correct version (and any further tasks it itself requires inherit that same concrete value automatically via law's .req() propagation).