~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

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

  • Committer: Chris Rogers
  • Date: 2014-04-16 11:48:45 UTC
  • mfrom: (707 merge)
  • mto: This revision was merged to the branch mainline in revision 711.
  • Revision ID: chris.rogers@stfc.ac.uk-20140416114845-h3u3q7pdcxkxvovs
Update to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus
 
2
 *
 
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.
 
7
 *
 
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.
 
12
 *
 
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/>.
 
15
 */
 
16
 
 
17
#include <string>
 
18
 
 
19
#include "gtest/gtest.h"
 
20
 
 
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"
 
27
 
 
28
namespace MAUS {
 
29
namespace ReconEventProcessorTest {
 
30
 
 
31
std::string EMR_BAR_HIT = "{\"tot\":-1,\"delta_t\":-2}";
 
32
 
 
33
std::string EMR_BAR = "{\"bar\":-1,\"emr_bar_hits\":["+EMR_BAR_HIT+","+
 
34
                                                       EMR_BAR_HIT+"]}";
 
35
 
 
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}");
 
40
 
 
41
std::string EMR_EVENT = "{\"emr_plane_hits\":["+EMR_PLANE_HIT+","+EMR_PLANE_HIT+
 
42
                        "]}";
 
43
 
 
44
std::string RECON_EVENT =
 
45
    std::string("{\"part_event_number\":1, \"emr_event\":"+EMR_EVENT+"}");
 
46
 
 
47
TEST(ReconEventProcessorTest, EMRBarHitProcessorTest) {
 
48
    EMRBarHitProcessor proc;
 
49
    ProcessorTest::test_value(&proc, EMR_BAR_HIT);
 
50
}
 
51
 
 
52
TEST(ReconEventProcessorTest, EMRBarProcessorTest) {
 
53
    EMRBarProcessor proc;
 
54
    ProcessorTest::test_value(&proc, EMR_BAR);
 
55
}
 
56
 
 
57
TEST(ReconEventProcessorTest, EMRPlaneHitProcessorTest) {
 
58
    EMRPlaneHitProcessor proc;
 
59
    ProcessorTest::test_value(&proc, EMR_PLANE_HIT);
 
60
}
 
61
 
 
62
TEST(ReconEventProcessorTest, EMREventProcessorTest) {
 
63
    EMREventProcessor proc;
 
64
    ProcessorTest::test_value(&proc, EMR_EVENT);
 
65
}
 
66
 
 
67
TEST(ReconEventProcessorTest, ReconEventProcessorTest) {
 
68
    ReconEventProcessor proc;
 
69
    ProcessorTest::test_value(&proc, RECON_EVENT);
 
70
}
 
71
}
 
72
}
 
73