19
19
#include "gtest/gtest.h"
21
21
#include "tests/cpp_unit/JsonCppProcessors/CommonProcessorTest.hh"
22
#include "src/common_cpp/JsonCppProcessors/ThreeVectorProcessor.hh"
23
#include "src/common_cpp/JsonCppProcessors/EMRTrackPointProcessor.hh"
24
#include "src/common_cpp/JsonCppProcessors/EMRTrackProcessor.hh"
25
#include "src/common_cpp/JsonCppProcessors/EMRSpacePointProcessor.hh"
22
26
#include "src/common_cpp/JsonCppProcessors/EMRBarHitProcessor.hh"
23
#include "src/common_cpp/JsonCppProcessors/EMRBarProcessor.hh"
24
27
#include "src/common_cpp/JsonCppProcessors/EMRPlaneHitProcessor.hh"
28
#include "src/common_cpp/JsonCppProcessors/EMREventTrackProcessor.hh"
25
29
#include "src/common_cpp/JsonCppProcessors/EMREventProcessor.hh"
30
#include "src/common_cpp/JsonCppProcessors/EMRSpillDataProcessor.hh"
26
31
#include "src/common_cpp/JsonCppProcessors/ReconEventProcessor.hh"
29
34
namespace ReconEventProcessorTest {
36
std::string THREE_VECTOR =
37
std::string("{\"x\":-1., \"y\":-2., \"z\":-3.}");
39
std::string EMR_TRACK_POINT =
40
std::string("{\"pos\":"+THREE_VECTOR+", \"gpos\":"+THREE_VECTOR+", ")+
41
std::string("\"pos_err\":"+THREE_VECTOR+", \"ch\":-1, \"resx\":-2., ")+
42
std::string("\"resy\":-3., \"chi2\":-4.}");
44
std::string EMR_TRACK =
45
std::string("{\"track_points\":["+EMR_TRACK_POINT+","+EMR_TRACK_POINT+"], ")+
46
std::string("\"parx\":[-1.,-2.], \"pary\":[-1.,-2.], \"parx_err\":[-1.,-2.], ")+
47
std::string("\"pary_err\":[-1.,-2.], \"origin\":"+THREE_VECTOR+", ")+
48
std::string("\"origin_err\":"+THREE_VECTOR+", \"polar\":-1., \"polar_err\":-2., ")+
49
std::string("\"azimuth\":-3., \"azimuth_err\":-4., \"chi2\":-5., \"range\":-6., ")+
50
std::string("\"range_err\":-7., \"mom\":-8., \"mom_err\":-9.}");
52
std::string EMR_SPACE_POINT =
53
std::string("{\"pos\":"+THREE_VECTOR+", \"gpos\":"+THREE_VECTOR+", ")+
54
std::string("\"pos_err\":"+THREE_VECTOR+", \"ch\":-1, \"time\":-2., \"deltat\":-3., ")+
55
std::string("\"charge_ma\":-4., \"charge_sa\":-5.}");
31
57
std::string EMR_BAR_HIT =
32
std::string("{\"tot\":-1, \"delta_t\":-2, \"hittime\":-3, ")+
33
std::string("\"x\":-4., \"y\":-6., \"z\":-8., \"ex\":-5., \"ey\":-7., \"ez\":-9., ")+
34
std::string("\"x_global\":-10., \"y_global\":-11., \"z_global\":-12., ")+
35
std::string("\"charge_corrected\":-13., \"total_charge_corrected\":-14., ")+
36
std::string("\"path_length\":-15.}");
38
std::string EMR_BAR = "{\"bar\":-1, \"emr_bar_hits\":["+EMR_BAR_HIT+","+EMR_BAR_HIT+"]}";
58
std::string("{\"ch\":-1, \"tot\":-2, \"time\":-3, \"deltat\":-4}");
40
60
std::string EMR_PLANE_HIT =
41
std::string("{\"emr_bars\":["+EMR_BAR+","+EMR_BAR+"], ")+
42
std::string("\"emr_bars_primary\":["+EMR_BAR+","+EMR_BAR+"], ")+
43
std::string("\"emr_bars_secondary\":["+EMR_BAR+","+EMR_BAR+"], ")+
44
std::string("\"plane\":-1, \"orientation\":-2, \"charge\":-3., ")+
45
std::string("\"charge_corrected\":-4., \"pedestal_area\":-5., \"time\":-6, ")+
46
std::string("\"spill\":-7, \"trigger\":-8, \"run\":-9, \"delta_t\":-10, ")+
47
std::string("\"samples\":[1,2,3]}");
61
std::string("{\"bar_hits\":["+EMR_BAR_HIT+","+EMR_BAR_HIT+"], ")+
62
std::string("\"plane\":-1, \"orientation\":-2, \"time\":-3, ")+
63
std::string("\"deltat\":-4, \"charge\":-5., \"pedestal_area\":-6., ")+
64
std::string("\"samples\":[-1,-2,-3]}");
66
std::string EMR_EVENT_TRACK =
67
std::string("{\"plane_hits\":["+EMR_PLANE_HIT+","+EMR_PLANE_HIT+"], ")+
68
std::string("\"space_points\":["+EMR_SPACE_POINT+","+EMR_SPACE_POINT+"], ")+
69
std::string("\"track\":"+EMR_TRACK+", \"type\":\"none\", \"id\":-1, \"time\":-2., ")+
70
std::string("\"plane_density_ma\":-3., \"plane_density_sa\":-4., \"total_charge_ma\":-5., ")+
71
std::string("\"total_charge_sa\":-6., \"charge_ratio_ma\":-7., \"charge_ratio_sa\":-8.}");
49
73
std::string EMR_EVENT =
50
std::string("{\"emr_plane_hits\":["+EMR_PLANE_HIT+","+EMR_PLANE_HIT+"], ")+
51
std::string("\"has_primary\":true, ")+
52
std::string("\"range_primary\":-1., \"has_secondary\":true, ")+
53
std::string("\"range_secondary\":-2., \"secondary_to_primary_track_distance\":-3., ")+
54
std::string("\"total_charge_MA\":-4., \"charge_ratio_MA\":-5., ")+
55
std::string("\"total_charge_SA\":-6., \"charge_ratio_SA\":-7., ")+
56
std::string("\"plane_density_MA\":-8., \"plane_density_SA\":-9., \"chi2\":-10.}");
74
std::string("{\"event_tracks\":["+EMR_EVENT_TRACK+","+EMR_EVENT_TRACK+"], ")+
75
std::string("\"vertex\":"+THREE_VECTOR+", \"vertex_err\":"+THREE_VECTOR+", \"deltat\":1., ")+
76
std::string("\"distance\":2., \"polar\":3., \"azimuth\":4.}");
58
78
std::string RECON_EVENT =
59
79
std::string("{\"part_event_number\":1, \"emr_event\":"+EMR_EVENT+"}");
81
TEST(ReconEventProcessorTest, EMRTrackPointProcessorTest) {
82
EMRTrackPointProcessor proc;
83
ProcessorTest::test_value(&proc, EMR_TRACK_POINT);
86
TEST(ReconEventProcessorTest, EMRTrackProcessorTest) {
87
EMRTrackProcessor proc;
88
ProcessorTest::test_value(&proc, EMR_TRACK);
91
TEST(ReconEventProcessorTest, EMRSpacePointProcessorTest) {
92
EMRSpacePointProcessor proc;
93
ProcessorTest::test_value(&proc, EMR_SPACE_POINT);
61
96
TEST(ReconEventProcessorTest, EMRBarHitProcessorTest) {
62
97
EMRBarHitProcessor proc;
63
98
ProcessorTest::test_value(&proc, EMR_BAR_HIT);
66
TEST(ReconEventProcessorTest, EMRBarProcessorTest) {
68
ProcessorTest::test_value(&proc, EMR_BAR);
71
101
TEST(ReconEventProcessorTest, EMRPlaneHitProcessorTest) {
72
102
EMRPlaneHitProcessor proc;
73
103
ProcessorTest::test_value(&proc, EMR_PLANE_HIT);
106
TEST(ReconEventProcessorTest, EMREventTrackProcessorTest) {
107
EMREventTrackProcessor proc;
108
ProcessorTest::test_value(&proc, EMR_EVENT_TRACK);
76
111
TEST(ReconEventProcessorTest, EMREventProcessorTest) {
77
112
EMREventProcessor proc;
78
113
ProcessorTest::test_value(&proc, EMR_EVENT);