REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Loading...
Searching...
No Matches
test/src/TRestWimpSensitivity.cxx
1
2#include <TRestWimpSensitivity.h>
3#include <gtest/gtest.h>
4
5#include <filesystem>
6
7namespace fs = std::filesystem;
8
9using namespace std;
10
11const auto filesPath = fs::path(__FILE__).parent_path().parent_path() / "files";
12const auto wimpRml = filesPath / "wimp.rml";
13
14TEST(TRestWimpSensitivity, TestFiles) {
15 cout << "Test files path: " << filesPath << endl;
16
17 // Check dir exists and is a directory
18 EXPECT_TRUE(fs::is_directory(filesPath));
19 // Check it's not empty
20 EXPECT_TRUE(!fs::is_empty(filesPath));
21
22 // All used files in this tests
23 EXPECT_TRUE(fs::exists(wimpRml));
24}
25
26TEST(TRestWimpSensitivity, FromRml) {
27 cout << "Path: " << wimpRml << endl;
28
29 TRestWimpSensitivity WS(wimpRml.c_str());
30
31 WS.PrintMetadata();
32
33 EXPECT_TRUE(abs(WS.GetSensitivity(1) - 2.9732007e-39) < 1E-45);
34}