Commit f7261b60 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Merge branch 'master' into 'master'

In-pixel efficiency bin size parameter and `EventLoaderTimepix3` hitmap

See merge request !103
parents af368be4 f626465c
Pipeline #836741 passed with stages
in 41 minutes and 36 seconds
...@@ -20,8 +20,9 @@ AnalysisEfficiency::AnalysisEfficiency(Configuration config, std::shared_ptr<Det ...@@ -20,8 +20,9 @@ AnalysisEfficiency::AnalysisEfficiency(Configuration config, std::shared_ptr<Det
m_detector = detector; m_detector = detector;
m_timeCutFrameEdge = m_config.get<double>("time_cut_frameedge", Units::get<double>(20, "ns")); m_timeCutFrameEdge = m_config.get<double>("time_cut_frameedge", Units::get<double>(20, "ns"));
m_pixelTolerance = m_config.get<double>("pixel_toleracnce", 1.); m_pixelTolerance = m_config.get<double>("pixel_tolerance", 1.);
m_chi2ndofCut = m_config.get<double>("chi2ndof_cut", 3.); m_chi2ndofCut = m_config.get<double>("chi2ndof_cut", 3.);
m_inpixelBinSize = m_config.get<double>("inpixel_bin_size", Units::get<double>(1.0, "um"));
} }
void AnalysisEfficiency::initialise() { void AnalysisEfficiency::initialise() {
...@@ -33,10 +34,10 @@ void AnalysisEfficiency::initialise() { ...@@ -33,10 +34,10 @@ void AnalysisEfficiency::initialise() {
"#mum;y_{track} mod " + std::to_string(pitch_y) + "#mum;efficiency"; "#mum;y_{track} mod " + std::to_string(pitch_y) + "#mum;efficiency";
hPixelEfficiencyMap_trackPos = new TProfile2D("pixelEfficiencyMap_trackPos", hPixelEfficiencyMap_trackPos = new TProfile2D("pixelEfficiencyMap_trackPos",
title.c_str(), title.c_str(),
static_cast<int>(pitch_x), static_cast<int>(ceil(pitch_x / m_inpixelBinSize)),
0, 0,
pitch_x, pitch_x,
static_cast<int>(pitch_y), static_cast<int>(ceil(pitch_y / m_inpixelBinSize)),
0, 0,
pitch_y, pitch_y,
0, 0,
......
...@@ -45,7 +45,7 @@ namespace corryvreckan { ...@@ -45,7 +45,7 @@ namespace corryvreckan {
TProfile2D* hChipEfficiencyMap_clustPos; TProfile2D* hChipEfficiencyMap_clustPos;
TProfile2D* hGlobalEfficiencyMap_clustPos; TProfile2D* hGlobalEfficiencyMap_clustPos;
double m_chi2ndofCut, m_timeCutFrameEdge, m_pixelTolerance; double m_chi2ndofCut, m_timeCutFrameEdge, m_pixelTolerance, m_inpixelBinSize;
int total_tracks, matched_tracks; int total_tracks, matched_tracks;
}; };
......
...@@ -12,6 +12,7 @@ This module measures the efficiency of the device under test by comparing its cl ...@@ -12,6 +12,7 @@ This module measures the efficiency of the device under test by comparing its cl
the edge of the DUT. Defaults to `1.`, which excludes column/row zero and max. the edge of the DUT. Defaults to `1.`, which excludes column/row zero and max.
* `time_cut_frameedge`: Parameter to discard telescope tracks at the frame edges (start and end of the current event window). Defaults to `20ns`. * `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`. * `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`.
### Plots produced ### Plots produced
* 2D Map of in-pixel efficiency * 2D Map of in-pixel efficiency
......
...@@ -199,6 +199,16 @@ void EventLoaderTimepix3::initialise() { ...@@ -199,6 +199,16 @@ void EventLoaderTimepix3::initialise() {
LOG(INFO) << "No calibration file path or no DUT name given; data will be uncalibrated."; LOG(INFO) << "No calibration file path or no DUT name given; data will be uncalibrated.";
applyCalibration = false; applyCalibration = false;
} }
// Make debugging plots
std::string title = m_detector->name() + " Hit map;x [px];y [px];pixels";
hHitMap = new TH2F("hitMap",
title.c_str(),
m_detector->nPixels().X(),
0,
m_detector->nPixels().X(),
m_detector->nPixels().Y(),
0,
m_detector->nPixels().Y());
} }
StatusCode EventLoaderTimepix3::run(std::shared_ptr<Clipboard> clipboard) { StatusCode EventLoaderTimepix3::run(std::shared_ptr<Clipboard> clipboard) {
...@@ -606,6 +616,7 @@ bool EventLoaderTimepix3::loadData(std::shared_ptr<Clipboard> clipboard, Pixels* ...@@ -606,6 +616,7 @@ bool EventLoaderTimepix3::loadData(std::shared_ptr<Clipboard> clipboard, Pixels*
Pixel* pixel = new Pixel(detectorID, row, col, static_cast<int>(tot), ftimestamp); Pixel* pixel = new Pixel(detectorID, row, col, static_cast<int>(tot), ftimestamp);
pixel->setCharge(fcharge); pixel->setCharge(fcharge);
devicedata->push_back(pixel); devicedata->push_back(pixel);
hHitMap->Fill(col, row);
LOG(DEBUG) << "Pixel Charge = " << fcharge << "; ToT value = " << tot; LOG(DEBUG) << "Pixel Charge = " << fcharge << "; ToT value = " << tot;
pixelToT_aftercalibration->Fill(fcharge); pixelToT_aftercalibration->Fill(fcharge);
} else { } else {
...@@ -613,6 +624,7 @@ bool EventLoaderTimepix3::loadData(std::shared_ptr<Clipboard> clipboard, Pixels* ...@@ -613,6 +624,7 @@ bool EventLoaderTimepix3::loadData(std::shared_ptr<Clipboard> clipboard, Pixels*
// creating new pixel object with non-calibrated values of tot and toa // creating new pixel object with non-calibrated values of tot and toa
Pixel* pixel = new Pixel(detectorID, row, col, static_cast<int>(tot), timestamp); Pixel* pixel = new Pixel(detectorID, row, col, static_cast<int>(tot), timestamp);
devicedata->push_back(pixel); devicedata->push_back(pixel);
hHitMap->Fill(col, row);
} }
m_prevTime = time; m_prevTime = time;
......
...@@ -27,6 +27,7 @@ namespace corryvreckan { ...@@ -27,6 +27,7 @@ namespace corryvreckan {
std::shared_ptr<Detector> m_detector; std::shared_ptr<Detector> m_detector;
// ROOT graphs // ROOT graphs
TH2F* hHitMap;
TH1F* pixelToT_beforecalibration; TH1F* pixelToT_beforecalibration;
TH1F* pixelToT_aftercalibration; TH1F* pixelToT_aftercalibration;
TH2F* pixelTOTParameterA; TH2F* pixelTOTParameterA;
......
...@@ -23,6 +23,7 @@ This module requires either another event loader of another detector type before ...@@ -23,6 +23,7 @@ This module requires either another event loader of another detector type before
* `threshold`: String defining the `[threshold]` DAC value for loading the appropriate calibration file, See above. * `threshold`: String defining the `[threshold]` DAC value for loading the appropriate calibration file, See above.
### Plots produced ### Plots produced
* 2D map of pixel hits
* Histogram with pixel ToT before and after calibration * Histogram with pixel ToT before and after calibration
* Map for each calibration parameter if calibration is used * Map for each calibration parameter if calibration is used
......
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