Skip to content

better integration for DeltaPhiQCD, cleanup and fix a few bugs

Kevin Pedro requested to merge github/fork/kpedro88/upgradeDeltaPhiQCD into Run2

@aminghiasi, I noticed several places where the DeltaPhiQCD code could be better integrated with the rest of TreeMaker or written more efficiently. In the process, I fixed a few bugs.

  1. The two categories of jets are: (pT > 30, |eta| < 5.0) and (pT > 30, |eta| < 2.4). We already produce these categories as MHTJets and HTJets, respectively, so it's easier just to use those collections instead of redoing all the cuts. I generalized SubJetSelection to make the same collections for GenJets, also (and then we can just add the GenMHTJets directly to the tree).
  2. I added GenMET to the METDouble producer, and made GenMHT from the GenMHTJets collection, further simplifying the DeltaPhiQCD code. (I also fixed a bug where the GenMET didn't get filled when the MET recorrection tool was used.)
  3. I simplified the calculation of MHTStar: just calculate the MHT vector from all the jets, then add back each jet separately.
  4. The vectors of MinDeltaPhi results can be set using initializer lists (new C++11 feature).
  5. It's easier to sort the gen neutrinos by pT using a map, and then just take the highest five entries (using reverse iterators, because maps sort from low to high).
  6. Bug fix: for genetacut == 2.4, the Eta5 results vectors were filled again (typo), so the Eta24 vectors were empty.
  7. The MHTStar was calculated using only the pT > 30 jets, but it was calculated for all the jets. This seems like it probably wasn't what was intended. Now, using the subjet collection, it can only consider the jets with pT > 30 and the desired eta cut.
  8. I wasn't sure if this was a bug, so I didn't address it yet: the mindeltaphiXjetindex is stored as "index+1", where "index" is the collection index. It seems like the +1 shouldn't be there, but maybe I misunderstand how you use the index.

I tested the new code with 100 QCD events and didn't see any unexpected changes. Let me know if I misunderstood anything and if I should fix point 8 before merging.

Merge request reports