~jan.greis/maus/1811

« back to all changes in this revision

Viewing changes to tests/cpp_unit/JsonCppProcessors/ReconEventProcessorTest.cc

  • Committer: Adam Dobbs
  • Date: 2016-01-13 11:31:12 UTC
  • mfrom: (659.2.18 release-candidate)
  • Revision ID: phuccj@gmail.com-20160113113112-bhbguupn50eyvd0z
Tags: MAUS-v1.4, MAUS-v1.4.0
MAUS-v1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "gtest/gtest.h"
20
20
 
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"
27
32
 
28
33
namespace MAUS {
29
34
namespace ReconEventProcessorTest {
30
35
 
 
36
std::string THREE_VECTOR =
 
37
    std::string("{\"x\":-1., \"y\":-2., \"z\":-3.}");
 
38
 
 
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.}");
 
43
 
 
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.}");
 
51
 
 
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.}");
 
56
 
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.}");
37
 
 
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}");
39
59
 
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]}");
 
65
 
 
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.}");
48
72
 
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.}");
57
77
 
58
78
std::string RECON_EVENT =
59
79
    std::string("{\"part_event_number\":1, \"emr_event\":"+EMR_EVENT+"}");
60
80
 
 
81
TEST(ReconEventProcessorTest, EMRTrackPointProcessorTest) {
 
82
    EMRTrackPointProcessor proc;
 
83
    ProcessorTest::test_value(&proc, EMR_TRACK_POINT);
 
84
}
 
85
 
 
86
TEST(ReconEventProcessorTest, EMRTrackProcessorTest) {
 
87
    EMRTrackProcessor proc;
 
88
    ProcessorTest::test_value(&proc, EMR_TRACK);
 
89
}
 
90
 
 
91
TEST(ReconEventProcessorTest, EMRSpacePointProcessorTest) {
 
92
    EMRSpacePointProcessor proc;
 
93
    ProcessorTest::test_value(&proc, EMR_SPACE_POINT);
 
94
}
 
95
 
61
96
TEST(ReconEventProcessorTest, EMRBarHitProcessorTest) {
62
97
    EMRBarHitProcessor proc;
63
98
    ProcessorTest::test_value(&proc, EMR_BAR_HIT);
64
99
}
65
100
 
66
 
TEST(ReconEventProcessorTest, EMRBarProcessorTest) {
67
 
    EMRBarProcessor proc;
68
 
    ProcessorTest::test_value(&proc, EMR_BAR);
69
 
}
70
 
 
71
101
TEST(ReconEventProcessorTest, EMRPlaneHitProcessorTest) {
72
102
    EMRPlaneHitProcessor proc;
73
103
    ProcessorTest::test_value(&proc, EMR_PLANE_HIT);
74
104
}
75
105
 
 
106
TEST(ReconEventProcessorTest, EMREventTrackProcessorTest) {
 
107
    EMREventTrackProcessor proc;
 
108
    ProcessorTest::test_value(&proc, EMR_EVENT_TRACK);
 
109
}
 
110
 
76
111
TEST(ReconEventProcessorTest, EMREventProcessorTest) {
77
112
    EMREventProcessor proc;
78
113
    ProcessorTest::test_value(&proc, EMR_EVENT);
82
117
    ReconEventProcessor proc;
83
118
    ProcessorTest::test_value(&proc, RECON_EVENT);
84
119
}
85
 
}
86
 
}
87
 
 
 
120
} // namespace ReconEventProcessorTest
 
121
} // namespace MAUS