Commit b353905f authored by Mateus Vicente's avatar Mateus Vicente
Browse files

adding back changes from latest commit a07b9a57 from Jens

parent 2974a6fa
......@@ -29,6 +29,7 @@ AnalysisEfficiency::AnalysisEfficiency(Configuration& config, std::shared_ptr<De
m_timeCutFrameEdge = config_.get<double>("time_cut_frameedge");
m_chi2ndofCut = config_.get<double>("chi2ndof_cut");
m_inpixelBinSize = config_.get<double>("inpixel_bin_size");
require_associated_cluster_on_ = config_.getArray<std::string>("require_associated_cluster_on", {});
m_inpixelEdgeCut = config_.get<double>("inpixelEdge_cut");
m_maskedPixelDistanceCut = config_.get<int>("maskedPixelDistance_cut");
}
......@@ -328,6 +329,21 @@ StatusCode AnalysisEfficiency::run(const std::shared_ptr<Clipboard>& clipboard)
continue;
}
// check if track has an associated cluster on required detector(s):
auto foundRequiredAssocCluster = [this](Track* t) {
for(auto& requireAssocCluster : require_associated_cluster_on_) {
if(!requireAssocCluster.empty() && t->getAssociatedClusters(requireAssocCluster).size() == 0) {
LOG(DEBUG) << "No associated cluster from required detector " << requireAssocCluster << " on the track.";
return false;
}
}
return true;
};
if(!foundRequiredAssocCluster(track.get())) {
n_requirecluster++;
continue;
}
// Count this as reference track:
total_tracks++;
......@@ -454,6 +470,7 @@ void AnalysisEfficiency::finalize(const std::shared_ptr<ReadonlyClipboard>&) {
<< "* track outside DUT -" << n_dut << std::endl
<< "* track close to masked px -" << n_masked << std::endl
<< "* track close to frame edge -" << n_frameedge << std::endl
<< "* track without an associated cluster on required detector - " << n_requirecluster << std::endl
<< "Accepted tracks: " << total_tracks;
double totalEff = 100 * static_cast<double>(matched_tracks) / (total_tracks > 0 ? total_tracks : 1);
......
......@@ -85,7 +85,8 @@ namespace corryvreckan {
double last_track_timestamp = 0;
double last_track_col = 0.;
double last_track_row = 0.;
double n_track = 0, n_chi2 = 0, n_dut = 0, n_roi = 0, n_masked = 0, n_frameedge = 0;
double n_track = 0, n_chi2 = 0, n_dut = 0, n_roi = 0, n_masked = 0, n_frameedge = 0, n_requirecluster = 0;
std::vector<std::string> require_associated_cluster_on_;
Matrix<double> prev_hit_ts; // matrix containing previous hit timestamp for every pixel
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment