Commit a07b9a57 authored by Jens Kroeger's avatar Jens Kroeger
Browse files

Merge branch 'AnalysisEfficiency-add-require_detectors_parameter' into 'master'

AnalysisEfficiency: added parameter require_associated_cluster_on

See merge request !423
parents 2f1d6336 e557164e
......@@ -27,6 +27,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", {});
}
void AnalysisEfficiency::initialize() {
......@@ -306,6 +307,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++;
......@@ -420,6 +436,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);
......
......@@ -82,7 +82,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
};
......
......@@ -19,6 +19,7 @@ More information can be found in the ROOT `TEfficiency` class reference, section
* `time_cut_frameedge`: Parameter to discard telescope tracks at the frame edges (start and end of the current event window). Defaults to `20ns`.
* `chi2ndof_cut`: Acceptance criterion for telescope tracks, defaults to a value of `3`.
* `inpixel_bin_size`: Parameter to set the bin size of the in-pixel 2D efficiency histogram. This should be given in units of distance and the same value is used in both axes. Defaults to `1.0um`.
* `require_associated_cluster_on`: Names of detectors which are required to have an associated cluster to the telescope tracks. Detectors listed here must be marked as `role = DUT` in the detector configuration file. Only tracks satisfying this requirement are accepted for the efficiency measurement. If empty, no detector is required. Default is empty.
### Plots produced
......
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