~christopher-hunt08/maus/maus_integrated_kalman

« back to all changes in this revision

Viewing changes to tests/cpp_unit/Recon/SciFi/PatternRecognitionTest.cc

  • Committer: Durga Rajaram
  • Date: 2014-07-16 15:13:05 UTC
  • mfrom: (659.1.92 cand)
  • Revision ID: durga@fnal.gov-20140716151305-q27rv1y9p03v9lks
Tags: MAUS-v0.9, MAUS-v0.9.0
MAUS-v0.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
  }
90
90
};
91
91
 
 
92
TEST_F(PatternRecognitionTest, test_constructor) {
 
93
  PatternRecognition pr;
 
94
  pr.set_parameters_to_default();
 
95
  EXPECT_TRUE(pr._straight_pr_on);
 
96
  EXPECT_TRUE(pr._helical_pr_on);
 
97
  EXPECT_EQ(0, pr._verb);
 
98
  EXPECT_EQ(2, pr._n_trackers);
 
99
  EXPECT_EQ(5, pr._n_stations);
 
100
  EXPECT_EQ(0.3844, pr._sd_1to4);
 
101
  EXPECT_EQ(0.4298, pr._sd_5);
 
102
  EXPECT_EQ(1.0, pr._sd_phi_1to4);
 
103
  EXPECT_EQ(1.0, pr._sd_phi_5);
 
104
  EXPECT_EQ(2.0, pr._res_cut);
 
105
  EXPECT_EQ(150.0, pr._R_res_cut);
 
106
  EXPECT_EQ(15.0, pr._straight_chisq_cut);
 
107
  EXPECT_EQ(4.0, pr._sz_chisq_cut);
 
108
  EXPECT_EQ(0.75, pr._n_turns_cut);
 
109
  EXPECT_EQ(180.0, pr._Pt_max);
 
110
  EXPECT_EQ(50.0, pr._Pz_min);
 
111
}
 
112
 
92
113
/*
93
114
TEST_F(PatternRecognitionTest, test_process_good) {
94
115
 
95
116
  PatternRecognition pr;
 
117
  pr.set_parameters_to_default();
96
118
 
97
119
  // Set up the spacepoints vector
98
120
  std::vector<SciFiSpacePoint*> spnts = set_up_spacepoints();
165
187
TEST_F(PatternRecognitionTest, test_multiple_evts_per_trigger) {
166
188
 
167
189
  PatternRecognition pr;
 
190
  pr.set_parameters_to_default();
168
191
 
169
192
  // Set up the spacepoints vector
170
193
  std::vector<SciFiSpacePoint*> spnts_t1_trk1;
301
324
  spnts[17] = sp1;
302
325
 
303
326
  // Perform the recon
304
 
  pr.process(true, false, evt1); // Helical on, Straight off
 
327
  pr.set_helical_pr_on(true);
 
328
  pr.set_straight_pr_on(false);
 
329
  pr.process(evt1);
305
330
 
306
331
  std::vector<SciFiStraightPRTrack*> strks;
307
332
  std::vector<SciFiHelicalPRTrack*> htrks;
340
365
  spnts.push_back(spnts_all[0]);
341
366
 
342
367
  PatternRecognition pr;
 
368
  pr.set_parameters_to_default();
343
369
  int n_stations = 5;
344
370
 
345
371
  // Set up the spacepoints by station 2D vector
465
491
  spnts.push_back(spnts_all[0]);
466
492
 
467
493
  PatternRecognition pr;
 
494
  pr.set_parameters_to_default();
468
495
  int n_stations = 5;
469
496
 
470
497
  // Set up the spacepoints by station 2D vector
563
590
  spnts.push_back(spnts_all[0]);
564
591
 
565
592
  PatternRecognition pr;
 
593
  pr.set_parameters_to_default();
566
594
  int n_stations = 5;
567
595
 
568
596
  // Set up the spacepoints by station 2D vector
680
708
  int n_stations = 5;
681
709
  int tracker_num = 0;
682
710
  PatternRecognition pr;
 
711
  pr.set_parameters_to_default();
683
712
 
684
713
  // Set up the spacepoints vector
685
714
  std::vector<SciFiSpacePoint*> spnts = set_up_spacepoints();
735
764
TEST_F(PatternRecognitionTest, test_set_ignore_stations) {
736
765
 
737
766
  PatternRecognition pr;
 
767
  pr.set_parameters_to_default();
738
768
  std::vector<int> ignore_stations(0);
739
769
  int is1, is2;
740
770
 
761
791
TEST_F(PatternRecognitionTest, test_set_seed_stations) {
762
792
 
763
793
  PatternRecognition pr;
 
794
  pr.set_parameters_to_default();
764
795
  std::vector<int> ignore_stations(0);
765
796
  int outer_st_num, inner_st_num, mid_st_num;
766
797
 
910
941
TEST_F(PatternRecognitionTest, test_set_end_stations) {
911
942
 
912
943
  PatternRecognition pr;
 
944
  pr.set_parameters_to_default();
913
945
  std::vector<int> ignore_stations(0);
914
946
  int outer_st_num, inner_st_num;
915
947
 
1040
1072
TEST_F(PatternRecognitionTest, test_find_dsdz) {
1041
1073
 
1042
1074
  PatternRecognition pr;
 
1075
  pr.set_parameters_to_default();
1043
1076
 
1044
1077
  // Set up spacepoints from an MC helical track
1045
1078
  SciFiSpacePoint *sp1 = new SciFiSpacePoint();
1078
1111
  spnts.push_back(sp4);
1079
1112
  spnts.push_back(sp5);
1080
1113
 
1081
 
  LeastSquaresFitter lsq(0.3844, 0.4298, 150.0);
1082
1114
  SimpleCircle circle;
1083
 
  bool good_radius = lsq.circle_fit(spnts, circle);
 
1115
  bool good_radius = LeastSquaresFitter::circle_fit(0.3844, 0.4298, 150.0, spnts, circle);
1084
1116
 
1085
1117
  double epsilon = 0.01;
1086
1118
 
1112
1144
TEST_F(PatternRecognitionTest, test_find_n_turns) {
1113
1145
 
1114
1146
  PatternRecognition pr;
 
1147
  pr.set_parameters_to_default();
1115
1148
 
1116
1149
  // T1 positives
1117
1150
  double arr_z[] = {1100.41, 750.48, 450.48, 200.617, 0.6523};