Skip to content

Commit

Permalink
include check for default lorentzvectors in LV combination
Browse files Browse the repository at this point in the history
  • Loading branch information
nshadskiy authored and harrypuuter committed Jul 26, 2024
1 parent f55d433 commit 51a34c2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion include/lorentzvectors.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "ROOT/RDataFrame.hxx"
#include "ROOT/RVec.hxx"
#include "utility/utility.hxx"
#include "defaults.hxx"
#include <Math/Vector4D.h>

namespace lorentzvectors {
Expand Down Expand Up @@ -39,6 +40,12 @@ ROOT::RDF::RNode CombineP4s(ROOT::RDF::RNode df, const std::string &outputflag,
outputflag,
utility::PassAsVec<np4s, ROOT::Math::PtEtaPhiMVector>(
[](const ROOT::RVec<ROOT::Math::PtEtaPhiMVector> &p4s) {
for (int i = 0; i < p4s.size(); i++) {
auto p4 = p4s.at(i);
if (p4.pt() < 0.) {
return default_lorentzvector;
}
}
return Sum(p4s, ROOT::Math::PtEtaPhiMVector());
}),
P4List);
Expand All @@ -57,4 +64,4 @@ ROOT::RDF::RNode build(ROOT::RDF::RNode df, const std::string &pairname,
} // namespace mutau

} // namespace lorentzvectors
#endif /* GUARDLVECS_H */
#endif /* GUARDLVECS_H */

0 comments on commit 51a34c2

Please sign in to comment.