1
/* This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus
3
* MAUS is free software: you can redistribute it and/or modify
4
* it under the terms of the GNU General Public License as published by
5
* the Free Software Foundation, either version 3 of the License, or
6
* (at your option) any later version.
8
* MAUS is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with MAUS. If not, see <http://www.gnu.org/licenses/>.
19
#include "gtest/gtest.h"
21
#include "tests/cpp_unit/JsonCppProcessors/CommonProcessorTest.hh"
22
#include "src/common_cpp/JsonCppProcessors/EMRBarHitProcessor.hh"
23
#include "src/common_cpp/JsonCppProcessors/EMRBarProcessor.hh"
24
#include "src/common_cpp/JsonCppProcessors/EMRPlaneHitProcessor.hh"
25
#include "src/common_cpp/JsonCppProcessors/EMREventProcessor.hh"
26
#include "src/common_cpp/JsonCppProcessors/ReconEventProcessor.hh"
29
namespace ReconEventProcessorTest {
31
std::string EMR_BAR_HIT = "{\"tot\":-1,\"delta_t\":-2}";
33
std::string EMR_BAR = "{\"bar\":-1,\"emr_bar_hits\":["+EMR_BAR_HIT+","+
36
std::string EMR_PLANE_HIT =
37
std::string("{\"emr_bars\":["+EMR_BAR+","+EMR_BAR+"], \"plane\":-1,")+
38
std::string("\"orientation\":-2, \"charge\":-3, \"time\":-4,")+
39
std::string("\"spill\":-5, \"trigger\":-6, \"delta_t\":-7}");
41
std::string EMR_EVENT = "{\"emr_plane_hits\":["+EMR_PLANE_HIT+","+EMR_PLANE_HIT+
44
std::string RECON_EVENT =
45
std::string("{\"part_event_number\":1, \"emr_event\":"+EMR_EVENT+"}");
47
TEST(ReconEventProcessorTest, EMRBarHitProcessorTest) {
48
EMRBarHitProcessor proc;
49
ProcessorTest::test_value(&proc, EMR_BAR_HIT);
52
TEST(ReconEventProcessorTest, EMRBarProcessorTest) {
54
ProcessorTest::test_value(&proc, EMR_BAR);
57
TEST(ReconEventProcessorTest, EMRPlaneHitProcessorTest) {
58
EMRPlaneHitProcessor proc;
59
ProcessorTest::test_value(&proc, EMR_PLANE_HIT);
62
TEST(ReconEventProcessorTest, EMREventProcessorTest) {
63
EMREventProcessor proc;
64
ProcessorTest::test_value(&proc, EMR_EVENT);
67
TEST(ReconEventProcessorTest, ReconEventProcessorTest) {
68
ReconEventProcessor proc;
69
ProcessorTest::test_value(&proc, RECON_EVENT);