Skip to content
Snippets Groups Projects
Commit f4dadb7b authored by Alessandro Brusamolino's avatar Alessandro Brusamolino
Browse files

[load-from-root] SimClusterMerger and ID assignment tests

SimClusterMerger and ID assignment tests

See merge request abrusamo/pftruth-standalone!10
parents a10264af 0abeba66
Branches
No related tags found
No related merge requests found
#include "../interface/SimHistoryTool.h"
#include <catch2/catch.hpp>
TEST_CASE("SimHistoryTool_CreateMergedSimClusterID") {
std::vector<SimTrack> sts;
sts.push_back(SimTrack(1,1, 1, Vector4D(1, 1, 1, 1), 0, 1, Vector3D(1, 1, 1), Vector4D(1, 1, 1, 1)));
sts.push_back(SimTrack(2,2, 2, Vector4D(2, 2, 2, 2), 0, 2, Vector3D(2, 2, 2), Vector4D(2, 2, 2, 2)));
sts.push_back(SimTrack(3,3, 3, Vector4D(3, 3, 3, 3), 0, 3, Vector3D(3, 3, 3), Vector4D(3, 3, 3, 3)));
sts.push_back(SimTrack(4,4, 4, Vector4D(4, 4, 4, 4), 0, 4, Vector3D(4, 4, 4), Vector4D(4, 4, 4, 4)));
sts.push_back(SimTrack(5,5, 5, Vector4D(5, 5, 5, 5), 0, 5, Vector3D(5, 5, 5), Vector4D(5, 5, 5, 5)));
std::vector<SimVertex> svs;
svs.push_back(SimVertex(Vector3D(1, 1, 1), 1, 1, 1));
SimShower* sc = new SimShower();
for (const auto &st : sts) {
sc->addG4Tracks(st);
}
SimHistoryTool sht(sts, svs);
int mergedPdgId = sht.createMergedSimClusterID(sc);
REQUIRE(mergedPdgId == 1);
}
#include <catch2/catch.hpp>
#include "../interface/SimClusterMerger.h"
TEST_CASE("SimClusterMerger_DefaultConstructor") {
SimClusterMerger scMerger;
REQUIRE(scMerger.hits() == nullptr);
REQUIRE(scMerger.recEnergy(SimCluster()) == 0);
}
TEST_CASE("SimClusterMerger_ThresholdSetters") {
SimClusterMerger scMerger;
scMerger.setHighEfracThreshold(0.5);
scMerger.setConnectThreshold(0.5);
REQUIRE(scMerger.getIsHighEfracThreshold() == 0.5);
REQUIRE(scMerger.getConnectThreshold() == 0.5);
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment