~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

Viewing changes to tests/cpp_unit/Recon/SciFi/RealDataDigitizationTest.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:
20
20
#include "src/common_cpp/DataStructure/Spill.hh"
21
21
#include "src/common_cpp/Recon/SciFi/RealDataDigitization.hh"
22
22
#include "src/common_cpp/Utils/JsonWrapper.hh"
23
 
#include "src/legacy/Interface/Squeal.hh"
 
23
#include "Utils/Exception.hh"
24
24
 
25
25
namespace MAUS {
26
26
 
34
34
 
35
35
TEST_F(RealDataDigitizationTest, test_calibration_load) {
36
36
  RealDataDigitization test_case_1;
37
 
  EXPECT_THROW(test_case_1.load_calibration("nonsense.txt"), Squeal);
 
37
  EXPECT_THROW(test_case_1.load_calibration("nonsense.txt"), MAUS::Exception);
38
38
  RealDataDigitization test_case_2;
39
39
  bool good_calib = test_case_2.load_calibration("scifi_calibration_jan2013.txt");
40
40
  EXPECT_TRUE(good_calib);
57
57
 
58
58
TEST_F(RealDataDigitizationTest, test_mapping_load) {
59
59
  RealDataDigitization test_case;
60
 
  EXPECT_THROW(test_case.load_mapping("nonsense.txt"), Squeal);
 
60
  EXPECT_THROW(test_case.load_mapping("nonsense.txt"), MAUS::Exception);
61
61
  bool good_map = test_case.load_mapping("mapping_7.txt");
62
62
  EXPECT_TRUE(good_map);
63
63
  int missing_channel_counter = 0;
65
65
    for ( int bank = 0; bank < 4; bank++ ) {
66
66
      for ( int chan_ro = 0; chan_ro < 128; chan_ro++ ) {
67
67
        int tracker, station, plane, channel;
 
68
        int extWG, inWG, WGfib;
68
69
        test_case.get_StatPlaneChannel(board, bank, chan_ro,
69
 
                                       tracker, station, plane, channel);
 
70
                                       tracker, station, plane, channel, extWG, inWG, WGfib);
70
71
        if ( tracker == -1 ) {
71
72
          missing_channel_counter += 1;
72
73
        }
87
88
  int plane = 0;
88
89
  int channel = 0;
89
90
  int bad_bank = 99;
 
91
  int extWG, inWG, WGfib;
90
92
 
91
93
  bool correct = test_case.get_StatPlaneChannel(board, bank, chan_ro,
92
 
                                                tracker, station, plane, channel);
 
94
                                                tracker, station, plane,
 
95
                                                channel, extWG, inWG, WGfib);
93
96
  EXPECT_TRUE(correct);
94
97
  bool wrong = test_case.get_StatPlaneChannel(board, bad_bank, chan_ro,
95
 
                                                tracker, station, plane, channel);
 
98
                                              tracker, station, plane,
 
99
                                              channel, extWG, inWG, WGfib);
96
100
  EXPECT_FALSE(wrong);
97
101
}
98
102