Commit 5726692a authored by Jens Kroeger's avatar Jens Kroeger
Browse files

AnalysisDUT: allow to choose correlations before or after applying cuts, added...

AnalysisDUT: allow to choose correlations before or after applying cuts, added new parameter + updated README
parent a07b9a57
Pipeline #2655445 passed with stages
in 15 minutes and 43 seconds
......@@ -25,6 +25,7 @@ AnalysisDUT::AnalysisDUT(Configuration& config, std::shared_ptr<Detector> detect
config_.setDefault<int>("n_time_bins", 20000);
config_.setDefault<double>("time_binning", Units::get<double>(0.1, "ns"));
config_.setDefault<bool>("correlations", false);
config_.setDefault<bool>("correlations_after_cuts", false);
time_cut_frameedge_ = config_.get<double>("time_cut_frameedge");
chi2_ndof_cut_ = config_.get<double>("chi2ndof_cut");
......@@ -32,6 +33,7 @@ AnalysisDUT::AnalysisDUT(Configuration& config, std::shared_ptr<Detector> detect
n_timebins_ = config_.get<int>("n_time_bins");
time_binning_ = config_.get<double>("time_binning");
correlations_ = config_.get<bool>("correlations");
correlations_after_cuts_ = config_.get<bool>("correlations_after_cuts");
}
void AnalysisDUT::initialize() {
......@@ -526,7 +528,7 @@ StatusCode AnalysisDUT::run(const std::shared_ptr<Clipboard>& clipboard) {
auto localIntercept = m_detector->globalToLocal(globalIntercept);
// Fill correlation plots before applying any cuts:
if(correlations_) {
if(correlations_ && !correlations_after_cuts_) {
auto clusters = clipboard->getData<Cluster>(m_detector->getName());
for(auto& cls : clusters) {
double xdistance_um = (globalIntercept.X() - cls->global().x()) * 1000.;
......@@ -550,7 +552,6 @@ StatusCode AnalysisDUT::run(const std::shared_ptr<Clipboard>& clipboard) {
}
// Check if it intercepts the DUT
if(!m_detector->hasIntercept(track.get(), 0.5)) {
LOG(DEBUG) << " - track outside DUT area";
hCutHisto->Fill(2);
......@@ -571,6 +572,18 @@ StatusCode AnalysisDUT::run(const std::shared_ptr<Clipboard>& clipboard) {
continue;
}
// Fill correlation plots after applying cuts:
if(correlations_ && correlations_after_cuts_) {
auto clusters = clipboard->getData<Cluster>(m_detector->getName());
for(auto& cls : clusters) {
double xdistance_um = (globalIntercept.X() - cls->global().x()) * 1000.;
double ydistance_um = (globalIntercept.Y() - cls->global().y()) * 1000.;
hTrackCorrelationX->Fill(xdistance_um);
hTrackCorrelationY->Fill(ydistance_um);
hTrackCorrelationTime->Fill(track->timestamp() - cls->timestamp());
}
}
// Get the event:
auto event = clipboard->getEvent();
......
......@@ -102,6 +102,7 @@ namespace corryvreckan {
int n_timebins_;
double time_binning_;
bool correlations_;
bool correlations_after_cuts_;
int num_tracks_;
};
} // namespace corryvreckan
......
......@@ -15,6 +15,7 @@ If a region of interest (ROI) is defined for the detector under investigation, o
* `n_time_bins`: Number of bins in the time residual and correlation histograms. Defaults to `20000`.
* `time_binning`: Bin width in the time residual and correlation histograms. Defaults to `0.1ns`.
* `correlations`: If `true`, correlation plots between all tracks and all clusters on the DUT (i.e. associated + non-associated) are created. Defaults to `false`.
* `correlations_after_cuts`: If `false`, correlation plots between all tracks and all clusters on the DUT (i.e. associated + non-associated) are filled before applying any of the above selection cuts to tracks, if `true` after applying the cuts.
### 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