~jan.greis/maus/1811

« back to all changes in this revision

Viewing changes to src/map/MapCppTrackerRecon/MapCppTrackerRecon.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:
72
72
  _use_eloss          = (*json)["SciFiKalman_use_Eloss"].asBool();
73
73
  _use_patrec_seed    = (*json)["SciFiSeedPatRec"].asBool();
74
74
  _correct_pz         = (*json)["SciFiKalmanCorrectPz"].asBool();
 
75
// Values used to set the track rating:
 
76
  _excellent_num_trackpoints     = (*json)["SciFiExcellentNumTrackpoints"].asInt();
 
77
  _good_num_trackpoints          = (*json)["SciFiGoodNumTrackpoints"].asInt();
 
78
  _poor_num_trackpoints          = (*json)["SciFiPoorNumTrackpoints"].asInt();
 
79
  _excellent_p_value             = (*json)["SciFiExcellentPValue"].asDouble();
 
80
  _good_p_value                  = (*json)["SciFiGoodPValue"].asDouble();
 
81
  _poor_p_value                  = (*json)["SciFiPoorPValue"].asDouble();
 
82
  _excellent_num_spacepoints  = (*json)["SciFiExcellentNumSpacepoints"].asInt();
 
83
  _good_num_spacepoints       = (*json)["SciFiGoodNumSpacepoints"].asInt();
 
84
  _poor_num_spacepoints       = (*json)["SciFiPoorNumSpacepoints"].asInt();
 
85
 
75
86
 
76
87
  MiceModule* module = Globals::GetReconstructionMiceModules();
77
88
  std::vector<const MiceModule*> modules =
418
429
      _helical_track_fitter->Smooth(false);
419
430
 
420
431
      SciFiTrack* track = ConvertToSciFiTrack(_helical_track_fitter, &_geometry_helper, helical);
 
432
      calculate_track_rating(track);
421
433
 
422
434
      evt.add_scifitrack(track);
423
435
    }
434
446
      _straight_track_fitter->Smooth(false);
435
447
 
436
448
      SciFiTrack* track = ConvertToSciFiTrack(_straight_track_fitter, &_geometry_helper, straight);
 
449
      calculate_track_rating(track);
437
450
 
438
451
      evt.add_scifitrack(track);
439
452
    }
570
583
  }
571
584
}
572
585
 
 
586
void MapCppTrackerRecon::calculate_track_rating(SciFiTrack* track) const {
 
587
  SciFiBasePRTrack* pr_track = track->pr_track_pointer();
 
588
  int number_spacepoints = pr_track->get_num_points();
 
589
  int number_trackpoints = track->GetNumberDataPoints();
 
590
 
 
591
  bool excel_numtp = (number_trackpoints >= _excellent_num_trackpoints);
 
592
  bool good_numtp = (number_trackpoints >= _good_num_trackpoints);
 
593
  bool poor_numtp = (number_trackpoints >= _poor_num_trackpoints);
 
594
  bool excel_numsp = (number_spacepoints >= _excellent_num_spacepoints);
 
595
  bool good_numsp = (number_spacepoints >= _good_num_spacepoints);
 
596
  bool poor_numsp = (number_spacepoints >= _poor_num_spacepoints);
 
597
  bool excel_pval = (track->P_value() >= _excellent_p_value);
 
598
  bool good_pval = (track->P_value() >= _good_p_value);
 
599
  bool poor_pval = (track->P_value() >= _poor_p_value);
 
600
 
 
601
  int rating = 0;
 
602
 
 
603
  if (excel_numtp && excel_numsp && excel_pval) {
 
604
    rating = 1;
 
605
  } else if (good_numtp && good_numsp && good_pval) {
 
606
    rating = 2;
 
607
  } else if (poor_numtp && poor_numsp && poor_pval) {
 
608
    rating = 3;
 
609
  } else {
 
610
    rating = 5;
 
611
  }
 
612
 
 
613
  track->SetRating(rating);
 
614
}
 
615
 
573
616
 
574
617
void MapCppTrackerRecon::print_event_info(SciFiEvent &event) const {
575
618
  std::cerr << "\n ######  SciFi Event Details  ######\n\n";