Commit 9e16026a authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Merge branch 'analysisdut_correlations_before_after_cuts' into 'master'

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

See merge request !430
parents a07b9a57 734e5bed
Pipeline #2670671 passed with stages
in 19 minutes and 36 seconds
......@@ -37,15 +37,43 @@ AnalysisDUT::AnalysisDUT(Configuration& config, std::shared_ptr<Detector> detect
void AnalysisDUT::initialize() {
if(correlations_) {
hTrackCorrelationX = new TH1F(
"hTrackCorrelationX", "Track residual X, all clusters;x_{track}-x_{hit} [#mum];# entries", 8000, -1000.5, 999.5);
hTrackCorrelationY = new TH1F(
"hTrackCorrelationY", "Track residual Y, all clusters;y_{track}-y_{hit} [#mum];# entries", 8000, -1000.5, 999.5);
hTrackCorrelationTime = new TH1F("hTrackCorrelationTime",
"Track time residual, all clusters;time_{track}-time_{hit} [ns];# entries",
n_timebins_,
-(n_timebins_ + 1) / 2. * time_binning_,
(n_timebins_ - 1) / 2. * time_binning_);
trackCorrelationX_beforeCuts =
new TH1F("trackCorrelationX_beforeCuts",
"Track residual X (tracks before cuts), all clusters;x_{track}-x_{hit} [#mum];# entries",
8000,
-1000.5,
999.5);
trackCorrelationY_beforeCuts =
new TH1F("trackCorrelationY_beforeCuts",
"Track residual Y (tracks before cuts), all clusters;y_{track}-y_{hit} [#mum];# entries",
8000,
-1000.5,
999.5);
trackCorrelationTime_beforeCuts =
new TH1F("trackCorrelationTime_beforeCuts",
"Track time residual (tracks before cuts), all clusters;time_{track}-time_{hit} [ns];# entries",
n_timebins_,
-(n_timebins_ + 1) / 2. * time_binning_,
(n_timebins_ - 1) / 2. * time_binning_);
trackCorrelationX_afterCuts =
new TH1F("trackCorrelationX_afterCuts",
"Track residual X (tracks after cuts), all clusters;x_{track}-x_{hit} [#mum];# entries",
8000,
-1000.5,
999.5);
trackCorrelationY_afterCuts =
new TH1F("trackCorrelationY_afterCuts",
"Track residual Y (tracks after cuts), all clusters;y_{track}-y_{hit} [#mum];# entries",
8000,
-1000.5,
999.5);
trackCorrelationTime_afterCuts =
new TH1F("trackCorrelationTime_afterCuts",
"Track time residual (tracks after cuts), all clusters;time_{track}-time_{hit} [ns];# entries",
n_timebins_,
-(n_timebins_ + 1) / 2. * time_binning_,
(n_timebins_ - 1) / 2. * time_binning_);
}
hClusterMapAssoc = new TH2F("clusterMapAssoc",
......@@ -525,15 +553,15 @@ StatusCode AnalysisDUT::run(const std::shared_ptr<Clipboard>& clipboard) {
auto globalIntercept = m_detector->getIntercept(track.get());
auto localIntercept = m_detector->globalToLocal(globalIntercept);
// Fill correlation plots before applying any cuts:
// Fill correlation plots BEFORE applying any cuts:
if(correlations_) {
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());
trackCorrelationX_beforeCuts->Fill(xdistance_um);
trackCorrelationY_beforeCuts->Fill(ydistance_um);
trackCorrelationTime_beforeCuts->Fill(track->timestamp() - cls->timestamp());
}
}
......@@ -550,7 +578,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 +598,18 @@ StatusCode AnalysisDUT::run(const std::shared_ptr<Clipboard>& clipboard) {
continue;
}
// Fill correlation plots after applying cuts:
if(correlations_) {
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.;
trackCorrelationX_afterCuts->Fill(xdistance_um);
trackCorrelationY_afterCuts->Fill(ydistance_um);
trackCorrelationTime_afterCuts->Fill(track->timestamp() - cls->timestamp());
}
}
// Get the event:
auto event = clipboard->getEvent();
......
......@@ -38,9 +38,8 @@ namespace corryvreckan {
std::shared_ptr<Detector> m_detector;
// Histograms
TH1F* hTrackCorrelationX;
TH1F* hTrackCorrelationY;
TH1F* hTrackCorrelationTime;
TH1F *trackCorrelationX_beforeCuts, *trackCorrelationY_beforeCuts, *trackCorrelationTime_beforeCuts;
TH1F *trackCorrelationX_afterCuts, *trackCorrelationY_afterCuts, *trackCorrelationTime_afterCuts;
TH2F *hClusterMapAssoc, *hHitMapAssoc;
TProfile2D *hClusterSizeMapAssoc, *hClusterChargeMapAssoc;
......
......@@ -14,7 +14,7 @@ If a region of interest (ROI) is defined for the detector under investigation, o
* `use_closest_cluster`: If `true` the cluster with the smallest distance to the track is used if a track has more than one associated cluster. If `false`, loop over all associated clusters. Defaults to `true`.
* `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`: If `true`, correlation plots between all (before and after applying cuts) tracks and all clusters on the DUT (i.e. associated + non-associated) are created. Defaults to `false`.
### 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