Open bortigno opened 5 years ago
opened a branch issue-40-gen-reco-muon-index-for-fsr-access on this
Need to work on this part of the code https://github.com/UFLX2MuMu/Ntupliser/blob/4ce362425193e101b3d738fff2d368f068bdd628/DiMuons/src/MuonHelper.cc#L114
My plan is to move the filling of the GEN information earlier in the plugins so I can pass the GenMuonInfo to the FillMuonInfo instead of the GEN particle, so I can store an index to the GenMuonInfo collection. Let's see if I can make it work.
I need to remember that Rochester corrections need GEN_pt! I also need to update that. https://github.com/UFLX2MuMu/Ntupliser/blob/4ce362425193e101b3d738fff2d368f068bdd628/DiMuons/src/PtCorrRoch.cc#L6 https://github.com/UFLX2MuMu/Ntupliser/blob/4ce362425193e101b3d738fff2d368f068bdd628/DiMuons/src/MuonHelper.cc#L142
Seems easier than expected. Adding the index (but still not removing the GEN_pt in the dataformat) c87a049d77187457d389c98c14cecb736f802476 I get sound results:
root [12] tree->Scan("muons.pt:muons.eta:muons.phi:genMuons[muons.GEN_idx].pt:genMuons[muons.GEN_idx].eta:genMuons[muons.GEN_idx].phi:genMuons[muons.GEN_idx].postFSR:genMuons[muons.GEN_idx].FSR_pt","","colsize=20")
***************************************************************************************************************************************************************************************************************
* Row * Instance * muons.pt * muons.eta * muons.phi * genMuons[muons.GEN_i * genMuons[muons.GEN_i * genMuons[muons.GEN_i * genMuons[muons.GEN_i * genMuons[muons.GEN_i *
***************************************************************************************************************************************************************************************************************
* 0 * 0 * 66.5712356567382812 * -0.30758196115493774 * -2.98422074317932129 * 67.0574874877929688 * -0.30748224258422851 * -2.98427271842956543 * 0 * -999 *
* 0 * 1 * 52.8480453491210938 * 0.367498546838760376 * 0.442872911691665649 * 53.0518913269042969 * 0.367440760135650635 * 0.442883163690567017 * 0 * -999 *
* 1 * 0 * 65.3277130126953125 * 2.19934606552124023 * -0.52189093828201293 * 59.1864662170410156 * 2.19908690452575684 * -0.52144622802734375 * 1 * 0 *
* 1 * 1 * 51.2577323913574219 * 1.17195999622344971 * 2.36923027038574219 * 51.8778648376464844 * 1.17180371284484863 * 2.36916327476501465 * 1 * 0 *
* 2 * 0 * 73.6264419555664062 * 0.744300961494445801 * -1.95758664608001709 * 72.4166641235351562 * 0.744558036327362061 * -1.95751845836639404 * 1 * 0 *
* 3 * 0 * 43.9097518920898438 * 0.19991639256477356 * -3.03518533706665039 * 44.166717529296875 * 0.199898883700370789 * -3.03516674041748047 * 1 * 0 *
* 3 * 1 * 38.1082687377929688 * 2.29392433166503906 * 0.984103560447692871 * 37.1091194152832031 * 2.29428863525390625 * 0.984475374221801758 * 1 * 0.048865068703889846 *
* 4 * 0 * 25.4916477203369141 * 0.501309335231781006 * 2.47336602210998535 * 25.5961894989013672 * 0.501396358013153076 * 2.47327184677124023 * 0 * -999 *
* 5 * 0 * 50.2616119384765625 * -1.3736412525177002 * -0.49713608622550964 * 51.3181037902832031 * -1.37346768379211426 * -0.49703717231750488 * 1 * 0 *
* 6 * 0 * 74.3803558349609375 * 1.50561189651489258 * 1.66819143295288086 * 70.5788497924804688 * 1.50574338436126709 * 1.6683119535446167 * 1 * 0.0022125244140625 *
* 6 * 1 * 54.0612144470214844 * 1.58280050754547119 * -1.36267197132110596 * 54.6025009155273438 * 1.58280289173126221 * -1.3627164363861084 * 1 * 0.829344332218170166 *
* 7 * 0 * 60.1649436950683594 * 0.6218109130859375 * -1.37404966354370117 * 60.7296104431152344 * 0.622040688991546631 * -1.37415635585784912 * 1 * 0 *
* 7 * 1 * 34.5332756042480469 * -1.13555014133453369 * 2.56107020378112793 * 34.8974609375 * -1.13544058799743652 * 2.56117677688598633 * 1 * 0 *
* 8 * 0 * * * * * * * * *
* 9 * 0 * 31.1514797210693359 * -0.66955536603927612 * 2.48274064064025879 * 31.5230693817138672 * -0.66949194669723510 * 2.48298311233520508 * 1 * 0 *
* 9 * 1 * 27.5600700378417969 * 2.26016473770141602 * 1.54366910457611084 * 28.1672706604003906 * 2.2603151798248291 * 1.54336559772491455 * 1 * 0 *
* 10 * 0 * 57.1886215209960938 * -1.41028118133544922 * -2.3417966365814209 * 56.1131439208984375 * -1.4103621244430542 * -2.34182310104370117 * 1 * 0 *
* 11 * 0 * 57.3655014038085938 * 1.1958925724029541 * 0.808666706085205078 * 57.6186065673828125 * 1.19613265991210938 * 0.808553814888000488 * 1 * 0 *
* 12 * 0 * 54.4325447082519531 * 2.12513065338134766 * 1.3190455436706543 * 57.7247238159179688 * 2.12475848197937012 * 1.3190683126449585 * 0 * -999 *
* 13 * 0 * 94.0942153930664062 * 0.779654383659362793 * -0.55165696144104003 * 92.9952621459960938 * 0.779759824275970459 * -0.5516204833984375 * 1 * 0.21697998046875 *
* 13 * 1 * 44.4865264892578125 * 1.14721870422363281 * -2.67152667045593262 * 45.3744277954101562 * 1.14700782299041748 * -2.67154192924499512 * 1 * 6.22933053970336914 *
* 14 * 0 * 74.3687515258789062 * -2.20797514915466309 * -1.35779082775115967 * 71.0245513916015625 * -2.20725893974304199 * -1.35751962661743164 * 0 * -999 *
* 14 * 1 * 39.3030242919921875 * -0.98371171951293945 * 2.10359597206115723 * 39.3416557312011719 * -0.98379933834075927 * 2.10366702079772949 * 0 * -999 *
* 15 * 0 * * * * * * * * *
* 16 * 0 * 236.122024536132812 * 0.268529564142227173 * 2.5777745246887207 * 230.556884765625 * 0.268314093351364136 * 2.57781410217285156 * 1 * 0.4940032958984375 *
Add an index between reco muons and GEN associated muons so all GEN level information can be accessed.