Commit 9eaafcb1 authored by Sejla Hadzic's avatar Sejla Hadzic
Browse files

AnalysisEfficiency: added require_detectors parameter

parent 580aacb8
......@@ -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_detectors_ = config_.getArray<std::string>("require_detectors", {});
}
void AnalysisEfficiency::initialize() {
......@@ -306,7 +307,20 @@ StatusCode AnalysisEfficiency::run(const std::shared_ptr<Clipboard>& clipboard)
continue;
}
// Count this as reference track:
// check if track has an associated cluster on required detector(s):
auto foundRequiredDetector = [this](Track* t) {
for(auto& requireDet : require_detectors_) {
if(!requireDet.empty() && t->getAssociatedClusters(requireDet).size() == 0) {
LOG(DEBUG) << "No cluster from required detector " << requireDet << " on the track.";
return false;
}
}
return true;
};
if(!foundRequiredDetector(track.get())) {
n_requiredet++;
continue;
}
total_tracks++;
// Calculate in-pixel position of track in microns
......@@ -420,6 +434,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_requiredet << 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_requiredet = 0;
std::vector<std::string> require_detectors_;
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_detectors`: Names of detectors which are required to have an associated cluster to the telescope tracks. 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