diff --git a/include/lorentzvectors.hxx b/include/lorentzvectors.hxx index 30d392a7..2c53bdac 100644 --- a/include/lorentzvectors.hxx +++ b/include/lorentzvectors.hxx @@ -5,6 +5,7 @@ #include "ROOT/RDataFrame.hxx" #include "ROOT/RVec.hxx" #include "utility/utility.hxx" +#include "defaults.hxx" #include namespace lorentzvectors { @@ -39,6 +40,12 @@ ROOT::RDF::RNode CombineP4s(ROOT::RDF::RNode df, const std::string &outputflag, outputflag, utility::PassAsVec( [](const ROOT::RVec &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); @@ -57,4 +64,4 @@ ROOT::RDF::RNode build(ROOT::RDF::RNode df, const std::string &pairname, } // namespace mutau } // namespace lorentzvectors -#endif /* GUARDLVECS_H */ \ No newline at end of file +#endif /* GUARDLVECS_H */