From f93a24e330bd81285d3504ceafe7f49749a8c1f5 Mon Sep 17 00:00:00 2001 From: Danilo Piparo <danilo.piparo@cern.ch> Date: Mon, 8 Apr 2019 08:20:04 +0200 Subject: [PATCH] [VecOps] Add Construct test --- math/vecops/test/vecops_rvec.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/math/vecops/test/vecops_rvec.cxx b/math/vecops/test/vecops_rvec.cxx index df0b3597bfb..fa9a0e7032f 100644 --- a/math/vecops/test/vecops_rvec.cxx +++ b/math/vecops/test/vecops_rvec.cxx @@ -1,4 +1,7 @@ #include <gtest/gtest.h> +#include <Math/LorentzVector.h> +#include <Math/PtEtaPhiM4D.h> +#include <Math/Vector4Dfwd.h> #include <ROOT/RVec.hxx> #include <ROOT/TSeq.hxx> #include <TFile.h> @@ -1050,3 +1053,18 @@ TEST(VecOps, Map) CheckEqual(res, ref); } +TEST(VecOps, Construct) +{ + RVec<float> pts {15.5f, 34.32f, 12.95f}; + RVec<float> etas {.3f, 2.2f, 1.32f}; + RVec<float> phis {.1f, 3.02f, 2.2f}; + RVec<float> masses {105.65f, 105.65f, 105.65f}; + auto fourVects = Construct<ROOT::Math::PtEtaPhiMVector>(pts, etas, phis, masses); + const ROOT::Math::PtEtaPhiMVector ref0 {15.5f, .3f, .1f, 105.65f}; + const ROOT::Math::PtEtaPhiMVector ref1 {34.32f, 2.2f, 3.02f, 105.65f}; + const ROOT::Math::PtEtaPhiMVector ref2 {12.95f, 1.32f, 2.2f, 105.65f}; + EXPECT_TRUE(fourVects[0] == ref0); + EXPECT_TRUE(fourVects[1] == ref1); + EXPECT_TRUE(fourVects[2] == ref2); +} + -- GitLab