cms-dpoa / cms-dpoa-getting-started

https://cms-dpoa.github.io/cms-dpoa-getting-started/intro.html
2 stars 2 forks source link

Andro - add vertex information to POET #86

Open katilp opened 3 years ago

katilp commented 3 years ago

Create a separate cc file in the modular branch of POET for vertex information.

The goal is to get from AOD the vertex information in the PV branch of Run-2 NanoAOD i.e. the variables in

https://cms-nanoaod-integration.web.cern.ch/integration/master-cmsswmaster/mc102X_doc.html#PV

You can try to see how part of this information is extracted in this code https://gitlab.cern.ch/cms-opendata/cms-opendata-nanoaodplus/nanoaodplus_v1/-/blob/master/src/NanoAnalyzer.cc#L2398

You can find some information on different collections in https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideAodDataTable The links in that table won't work unfortunately.

I will see if I find examples that could be easier to follow.

To develop the code, you can make a fork of your own from https://github.com/cms-legacydata-analyses/PhysObjectExtractorTool (top right) and you work on your own area. You can find some notions on "forks" at the start of https://cms-dpoa.github.io/cms-dpoa-getting-started/computing/basic/git-faq.html

apetkovi1 commented 3 years ago

Done so far: https://github.com/apetkovi1/PhysObjectExtractorTool/tree/modular/PhysObjectExtractor Should I write vertex info in a TTree ? Should I add InputTag for different collections : offlinePrimaryVertices, offlinePrimaryVerticesWithBS (now it has only offlinePrimaryVertices ) ?

katilp commented 3 years ago

Looks good, that was quick! Yes, write it to a TTree and check that it comes out in the output file. I think we can start with offlinePrimaryVertices only.

katilp commented 3 years ago

You can also have a look at how the Vertex information is filled in https://github.com/cms-sw/cmssw/tree/master/PhysicsTools/NanoAOD/plugins, in particular, VertexTableProducer.cc and see if you can implement the missing variables

Note however that the NanoAOD format has been produced only starting from Run-2 (or from 2016 data onwards) so it can be that there are differences to what we need to do, i.e. getting it from Run-1 AOD format.

katilp commented 3 years ago

Have a look also in https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/NanoAOD/python/vertices_cff.py