REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Loading...
Searching...
No Matches
test/src/TRestRawSignalShapingProcess.cxx
1
2#include <TRestRawSignalShapingProcess.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 restRawSignalShapingProcessRml = filesPath / "TRestRawSignalShapingProcess.rml";
13
14TEST(TRestRawSignalShapingProcess, 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 EXPECT_TRUE(fs::exists(restRawSignalShapingProcessRml));
22}
23
24TEST(TRestRawSignalShapingProcess, Default) {
26 EXPECT_TRUE(process.GetProcessName() == (std::string) "rawSignalShaping");
27
28 EXPECT_TRUE(process.GetShapingType() == (std::string) "shaperSin");
29 EXPECT_TRUE(process.GetShapingTime() == 10.0);
30 EXPECT_TRUE(process.GetShapingGain() == 1.0);
31}
32
33TEST(TRestRawSignalShapingProcess, FromRml) {
34 TRestRawSignalShapingProcess process(restRawSignalShapingProcessRml.c_str());
35
36 process.PrintMetadata();
37
38 EXPECT_TRUE(process.GetShapingType() == (std::string) "responseFile");
39 EXPECT_TRUE(process.GetShapingTime() == 5.0);
40 EXPECT_TRUE(process.GetShapingGain() == 20.0);
41}
const char * GetProcessName() const override
Returns the name of this process.