How to avoid looping?
1- DeltaR calculation between muons
- loop over all selected muons,
- and then according to the muons charge (same sign or opposite sign) fill the output vector with DeltaR.
- DeltaR and DeltaPhi calculation:
https://gist.github.com/bastienvoirin/7cb014674a59e66e3a772eb33996a1af#file-utility-cpp-L1
- Minimum DeltaR calculation:
https://gist.github.com/bastienvoirin/7cb014674a59e66e3a772eb33996a1af#file-utility-cpp-L32
2- Reconstruction depending on Chi2 with
- loop over all selected jets/bjets
- it keeps the index of jets from chi2 permutations, chi2 value, and mass from permutations.
https://github.com/sarakm0704/anaTprimeHad/blob/main/ana/src/utility.cpp#L383-L491
What is the logic of the ROOT::VecOps::Take() method?