Skip to content
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

Add a Schema for Scouting NanoAOD #1148

Closed
jslawless opened this issue Aug 5, 2024 · 3 comments · Fixed by #1151
Closed

Add a Schema for Scouting NanoAOD #1148

jslawless opened this issue Aug 5, 2024 · 3 comments · Fixed by #1151
Labels
enhancement New feature or request

Comments

@jslawless
Copy link
Contributor

For the scouting data sets in CMS, there are several fields with unique names. "ScoutingJet", "ScoutingElectron", so on and so forth. If you use NanoAODSchema to open these files, these objects won't be recognized as four vectors and won't have the nice methods like DeltaR and what not.

I suggest that there should be a Schema for these Scouting data sets. At first it would be pretty simple to just have these fields inherit from there non scouting counter-parts, but if the scouting people want to add custom functionality to these fields it would then be pretty easy.

A proposed solution would look something like this:

class ScoutingNanoAODSchema(NanoAODSchema):

    mixins = {
        **NanoAODSchema.mixins,
        "ScoutingJet": "Jet",
         # all the other fields that have nice counter-parts
    }   

This is something I am interested in writing myself. I was hoping for feedback on if this is the correct approach and if this dataset warrants its own schema.

@jslawless jslawless added the enhancement New feature or request label Aug 5, 2024
@jslawless jslawless changed the title Add a Schema for Scouting NanaAOD Add a Schema for Scouting NanoAOD Aug 5, 2024
@nsmith-
Copy link
Member

nsmith- commented Aug 6, 2024

This sounds great! Indeed you have the correct approach in mind. For reference, you can look at PFNanoAODSchema,

class PFNanoAODSchema(NanoAODSchema):
"""PFNano schema builder
PFNano is an extended NanoAOD format that includes PF candidates and secondary vertices
More info at https://github.com/cms-jet/PFNano
"""
mixins = {
**NanoAODSchema.mixins,
"JetSVs": "AssociatedSV",
"FatJetSVs": "AssociatedSV",
"GenJetSVs": "AssociatedSV",
"GenFatJetSVs": "AssociatedSV",
"JetPFCands": "AssociatedPFCand",
"FatJetPFCands": "AssociatedPFCand",
"GenJetCands": "AssociatedPFCand",
"GenFatJetCands": "AssociatedPFCand",
"PFCands": "PFCand",
"GenCands": "PFCand",
}

which also introduces a few new mixin class types.

@NJManganelli
Copy link
Collaborator

NJManganelli commented Aug 7, 2024

This reminds me I should push an L1NanoAOD schema for Phase 2...
(For posterity, a gist which contains a not-quite-finalized/updated version is here:
https://gist.github.com/NJManganelli/9ed6597553a6700e4d733ffe9d815a9e)

Edit: Here's the relevant L1Nano for Phase II (which should eventually go into cmssw...)
https://github.com/cms-l1-dpg/Phase2-L1Nano

@jslawless
Copy link
Contributor Author

Thanks, I wrote the basic Schema and made a draft pull request.

@nsmith- nsmith- linked a pull request Aug 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants