// TrackMatch.cpp #include "TrackMatch.h" #include "trfbase/ETrack.h" #include "trfutil/SimpleQuality.h" #include "trfutil/InvalidQuality.h" using trf::VTrack; using trf::ETrack; using trf::TrackMatch; //********************************************************************** // constructor TrackMatch::TrackMatch(const MCTrackList& mctracks, const RTrackList& rtracks) { // match lists match(mctracks,rtracks); } //********************************************************************** // destructor TrackMatch::~TrackMatch() { } //********************************************************************** // generate a match quality Quality* TrackMatch::_quality(const MCTrackPtr& ptrmc, const RTrackPtr& ptrr) const { // Fetch the MC VTrack const VTrack& trv = *ptrmc; // Fetch the reco ETrack const ETrack& tre = ptrr->get_track(); // Evaluate the chi-square difference between them. double diff = chisq_diff(trv,tre); // If diff < 0, then Chi-square difference calculation failed. if ( diff < 0.0 ) return new InvalidQuality; // construct and return the quality return new SimpleQuality( diff ); } //**********************************************************************