Skip to content
Snippets Groups Projects
Commit e53db5a1 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Merge branch 'asympxl_DUT_Analysis' into 'master'

Allow for asymmetric pixels in AnalysisDUT module

See merge request corryvreckan/corryvreckan!623
parents 93c37aed d307b8e6
No related branches found
No related tags found
No related merge requests found
Pipeline #5387056 passed
......@@ -31,7 +31,7 @@ AnalysisDUT::AnalysisDUT(Configuration& config, std::shared_ptr<Detector> detect
config_.setDefault<double>("charge_histo_range", 1000.0);
config_.setDefault<int>("n_raw_bins", 1000);
config_.setDefault<double>("raw_histo_range", 1000.0);
config_.setDefault<double>("inpixel_bin_size", Units::get<double>(0.5, "um"));
config_.setDefault<ROOT::Math::XYPoint>("inpixel_bin_size", {Units::get(0.5, "um"), Units::get(0.5, "um")});
time_cut_frameedge_ = config_.get<double>("time_cut_frameedge");
spatial_cut_sensoredge_ = config_.get<double>("spatial_cut_sensoredge");
......@@ -42,7 +42,12 @@ AnalysisDUT::AnalysisDUT(Configuration& config, std::shared_ptr<Detector> detect
correlations_ = config_.get<bool>("correlations");
n_chargebins_ = config_.get<int>("n_charge_bins");
charge_histo_range_ = config_.get<double>("charge_histo_range");
inpixelBinSize_ = config_.get<double>("inpixel_bin_size");
if(config_.getArray<double>("inpixel_bin_size").size() == 2) {
inpixelBinSize_ = config_.get<ROOT::Math::XYPoint>("inpixel_bin_size");
} else {
auto binsize = config_.get<double>("inpixel_bin_size");
inpixelBinSize_ = ROOT::Math::XYPoint(binsize, binsize);
}
// if no separate raw histo bin settings are given, use the ones specified for the charge
if(config_.has("n_charge_bins") & !config_.has("n_raw_bins")) {
......@@ -317,11 +322,6 @@ void AnalysisDUT::initialize() {
-0.5,
29.5);
// In-pixel studies:
auto pitch_x = m_detector->getPitch().X() * 1000.; // convert mm -> um
auto pitch_y = m_detector->getPitch().Y() * 1000.; // convert mm -> um
std::string mod_axes = "in-pixel x_{track} [#mum];in-pixel y_{track} [#mum];";
// cut flow histogram
title = m_detector->getName() + ": number of tracks discarded by different cuts;cut type;tracks";
hCutHisto = new TH1F("hCutHisto", title.c_str(), ETrackSelection::kNSelection, 0, ETrackSelection::kNSelection);
......@@ -334,43 +334,35 @@ void AnalysisDUT::initialize() {
hCutHisto->GetXaxis()->SetBinLabel(ETrackSelection::kPass + 1, "Pass all cuts");
hCutHisto->GetXaxis()->SetBinLabel(ETrackSelection::kAssociated + 1, "Associated cluster");
// In-pixel studies:
auto pitch_x = m_detector->getPitch().X() * 1000.; // convert mm -> um
auto pitch_y = m_detector->getPitch().Y() * 1000.; // convert mm -> um
auto nbins_x = static_cast<int>(std::ceil(m_detector->getPitch().X() / inpixelBinSize_.x()));
auto nbins_y = static_cast<int>(std::ceil(m_detector->getPitch().Y() / inpixelBinSize_.y()));
if(nbins_x > 1e4 || nbins_y > 1e4) {
throw InvalidValueError(config_, "inpixel_bin_size", "Too many bins for in-pixel histograms.");
}
std::string mod_axes = "in-pixel x_{track} [#mum];in-pixel y_{track} [#mum];";
title = "Resolution in X;" + mod_axes + "MAD(#Deltax) [#mum]";
rmsxvsxmym = new TProfile2D("rmsxvsxmym",
title.c_str(),
static_cast<int>(pitch_x),
-pitch_x / 2.,
pitch_x / 2.,
static_cast<int>(pitch_y),
-pitch_y / 2.,
pitch_y / 2.);
rmsxvsxmym = new TProfile2D(
"rmsxvsxmym", title.c_str(), nbins_x, -pitch_x / 2., pitch_x / 2., nbins_y, -pitch_y / 2., pitch_y / 2.);
title = "Resolution in Y;" + mod_axes + "MAD(#Deltay) [#mum]";
rmsyvsxmym = new TProfile2D("rmsyvsxmym",
title.c_str(),
static_cast<int>(pitch_x),
-pitch_x / 2.,
pitch_x / 2.,
static_cast<int>(pitch_y),
-pitch_y / 2.,
pitch_y / 2.);
rmsyvsxmym = new TProfile2D(
"rmsyvsxmym", title.c_str(), nbins_x, -pitch_x / 2., pitch_x / 2., nbins_y, -pitch_y / 2., pitch_y / 2.);
title = "Resolution;" + mod_axes + "MAD(#sqrt{#Deltax^{2}+#Deltay^{2}}) [#mum]";
rmsxyvsxmym = new TProfile2D("rmsxyvsxmym",
title.c_str(),
static_cast<int>(pitch_x),
-pitch_x / 2.,
pitch_x / 2.,
static_cast<int>(pitch_y),
-pitch_y / 2.,
pitch_y / 2.);
rmsxyvsxmym = new TProfile2D(
"rmsxyvsxmym", title.c_str(), nbins_x, -pitch_x / 2., pitch_x / 2., nbins_y, -pitch_y / 2., pitch_y / 2.);
title = "Mean cluster charge map;" + mod_axes + "<cluster charge> [a.u.]";
qvsxmym = new TProfile2D("qvsxmym",
title.c_str(),
static_cast<int>(pitch_x),
nbins_x,
-pitch_x / 2.,
pitch_x / 2.,
static_cast<int>(pitch_y),
nbins_y,
-pitch_y / 2.,
pitch_y / 2.,
0.0,
......@@ -379,10 +371,10 @@ void AnalysisDUT::initialize() {
title = "Most probable cluster charge map, Moyal approx.;" + mod_axes + "cluster charge MPV [a.u.]";
qMoyalvsxmym = new TProfile2D("qMoyalvsxmym",
title.c_str(),
static_cast<int>(pitch_x),
nbins_x,
-pitch_x / 2.,
pitch_x / 2.,
static_cast<int>(pitch_y),
nbins_y,
-pitch_y / 2.,
pitch_y / 2.,
0.0,
......@@ -391,74 +383,42 @@ void AnalysisDUT::initialize() {
title = "Seed pixel charge map;" + mod_axes + "<seed pixel charge> [a.u.]";
pxqvsxmym = new TProfile2D("pxqvsxmym",
title.c_str(),
static_cast<int>(pitch_x),
nbins_x,
-pitch_x / 2.,
pitch_x / 2.,
static_cast<int>(pitch_y),
nbins_y,
-pitch_y / 2.,
pitch_y / 2.,
0.0,
charge_histo_range_);
title = "Mean cluster size map;" + mod_axes + "<pixels/cluster>";
npxvsxmym = new TProfile2D("npxvsxmym",
title.c_str(),
static_cast<int>(pitch_x),
-pitch_x / 2.,
pitch_x / 2.,
static_cast<int>(pitch_y),
-pitch_y / 2.,
pitch_y / 2.,
0,
4.5);
npxvsxmym = new TProfile2D(
"npxvsxmym", title.c_str(), nbins_x, -pitch_x / 2., pitch_x / 2., nbins_y, -pitch_y / 2., pitch_y / 2., 0, 4.5);
title = "1-pixel cluster map;" + mod_axes + "clusters";
npx1vsxmym = new TH2F("npx1vsxmym",
title.c_str(),
static_cast<int>(pitch_x),
-pitch_x / 2.,
pitch_x / 2.,
static_cast<int>(pitch_y),
-pitch_y / 2.,
pitch_y / 2.);
npx1vsxmym =
new TH2F("npx1vsxmym", title.c_str(), nbins_x, -pitch_x / 2., pitch_x / 2., nbins_y, -pitch_y / 2., pitch_y / 2.);
title = "2-pixel cluster map;" + mod_axes + "clusters";
npx2vsxmym = new TH2F("npx2vsxmym",
title.c_str(),
static_cast<int>(pitch_x),
-pitch_x / 2.,
pitch_x / 2.,
static_cast<int>(pitch_y),
-pitch_y / 2.,
pitch_y / 2.);
npx2vsxmym =
new TH2F("npx2vsxmym", title.c_str(), nbins_x, -pitch_x / 2., pitch_x / 2., nbins_y, -pitch_y / 2., pitch_y / 2.);
title = "3-pixel cluster map;" + mod_axes + "clusters";
npx3vsxmym = new TH2F("npx3vsxmym",
title.c_str(),
static_cast<int>(pitch_x),
-pitch_x / 2.,
pitch_x / 2.,
static_cast<int>(pitch_y),
-pitch_y / 2.,
pitch_y / 2.);
npx3vsxmym =
new TH2F("npx3vsxmym", title.c_str(), nbins_x, -pitch_x / 2., pitch_x / 2., nbins_y, -pitch_y / 2., pitch_y / 2.);
title = "4-pixel cluster map;" + mod_axes + "clusters";
npx4vsxmym = new TH2F("npx4vsxmym",
title.c_str(),
static_cast<int>(pitch_x),
-pitch_x / 2.,
pitch_x / 2.,
static_cast<int>(pitch_y),
-pitch_y / 2.,
pitch_y / 2.);
npx4vsxmym =
new TH2F("npx4vsxmym", title.c_str(), nbins_x, -pitch_x / 2., pitch_x / 2., nbins_y, -pitch_y / 2., pitch_y / 2.);
title = "Mean cluster charge map (1-pixel);" + mod_axes + "<cluster charge> [a.u.]";
qvsxmym_1px = new TProfile2D("qvsxmym_1px",
title.c_str(),
static_cast<int>(pitch_x),
nbins_x,
-pitch_x / 2.,
pitch_x / 2.,
static_cast<int>(pitch_y),
nbins_y,
-pitch_y / 2.,
pitch_y / 2.,
0.0,
......@@ -467,10 +427,10 @@ void AnalysisDUT::initialize() {
title = "Mean cluster charge map (2-pixel);" + mod_axes + "<cluster charge> [a.u.]";
qvsxmym_2px = new TProfile2D("qvsxmym_2px",
title.c_str(),
static_cast<int>(pitch_x),
nbins_x,
-pitch_x / 2.,
pitch_x / 2.,
static_cast<int>(pitch_y),
nbins_y,
-pitch_y / 2.,
pitch_y / 2.,
0.0,
......@@ -479,10 +439,10 @@ void AnalysisDUT::initialize() {
title = "Mean cluster charge map (3-pixel);" + mod_axes + "<cluster charge> [a.u.]";
qvsxmym_3px = new TProfile2D("qvsxmym_3px",
title.c_str(),
static_cast<int>(pitch_x),
nbins_x,
-pitch_x / 2.,
pitch_x / 2.,
static_cast<int>(pitch_y),
nbins_y,
-pitch_y / 2.,
pitch_y / 2.,
0.0,
......@@ -491,15 +451,52 @@ void AnalysisDUT::initialize() {
title = "Mean cluster charge map (4-pixel);" + mod_axes + "<cluster charge> [a.u.]";
qvsxmym_4px = new TProfile2D("qvsxmym_4px",
title.c_str(),
static_cast<int>(pitch_x),
nbins_x,
-pitch_x / 2.,
pitch_x / 2.,
static_cast<int>(pitch_y),
nbins_y,
-pitch_y / 2.,
pitch_y / 2.,
0.0,
charge_histo_range_);
title = m_detector->getName() + " in-pixel cluster size map;" + mod_axes + "cluster size";
hclusterSize_trackPos_TProfile = new TProfile2D("clusterSize_trackPos_TProfile",
title.c_str(),
nbins_x,
-pitch_x / 2.,
pitch_x / 2.,
nbins_y,
-pitch_y / 2.,
pitch_y / 2.,
-500,
500);
title = m_detector->getName() + " in-pixel time resolution map;" + mod_axes + "#sigma time difference [ns]";
htimeRes_trackPos_TProfile = new TH2D("timeRes_trackPos_TProfile",
title.c_str(),
nbins_x,
-pitch_x / 2.,
pitch_x / 2.,
nbins_y,
-pitch_y / 2.,
pitch_y / 2.);
title = m_detector->getName() + " in-pixel time difference map;" + mod_axes + "time difference: track - cluster [ns]";
htimeDelay_trackPos_TProfile =
new TProfile2D("timeDelay_trackPos_TProfile",
title.c_str(),
nbins_x,
-pitch_x / 2.,
pitch_x / 2.,
nbins_y,
-pitch_y / 2.,
pitch_y / 2.,
-500,
500,
"s"); // standard deviation as the error on a bin, convenient for time resolution
// Time residual plots
residualsTime = new TH1F("residualsTime",
"Time residual;time_{track}-time_{hit} [ns];# entries",
n_timebins_,
......@@ -553,6 +550,7 @@ void AnalysisDUT::initialize() {
0.0,
charge_histo_range_);
// (Un-)Associated track histograms
hAssociatedTracksGlobalPosition =
new TH2F("hAssociatedTracksGlobalPosition",
"Map of associated track positions (global);global intercept x [mm];global intercept y [mm]",
......@@ -590,6 +588,7 @@ void AnalysisDUT::initialize() {
-10,
10);
// Pixel time histograms
pxTimeMinusSeedTime =
new TH1F("pxTimeMinusSeedTime",
"pixel - seed pixel timestamp (all pixels w/o seed);ts_{pixel} - ts_{seed} [ns];# entries",
......@@ -633,6 +632,7 @@ void AnalysisDUT::initialize() {
0.0,
charge_histo_range_);
// Track to track distance
track_trackDistance = new TH2F("track_to_track_distance",
"Local track to track distance;#Delta_x [#mum]; #Delta_y [#mum]",
800,
......@@ -641,49 +641,6 @@ void AnalysisDUT::initialize() {
800,
-1000,
1000);
auto nbins_x = static_cast<int>(std::ceil(m_detector->getPitch().X() / inpixelBinSize_));
auto nbins_y = static_cast<int>(std::ceil(m_detector->getPitch().Y() / inpixelBinSize_));
if(nbins_x > 1e4 || nbins_y > 1e4) {
throw InvalidValueError(config_, "inpixel_bin_size", "Too many bins for in-pixel histograms.");
}
title =
m_detector->getName() + "in pixel cluster size map;in-pixel x_{track} [#mum];in-pixel y_{track} #mum;cluster size";
hclusterSize_trackPos_TProfile = new TProfile2D("clusterSize_trackPos_TProfile",
title.c_str(),
nbins_x,
-pitch_x / 2.,
pitch_x / 2.,
nbins_y,
-pitch_y / 2.,
pitch_y / 2.,
-500,
500);
title = m_detector->getName() +
"in pixel time resolution map;in-pixel x_{track} [#mum];in-pixel y_{track} #mum;#sigma time difference [ns]";
htimeRes_trackPos_TProfile = new TH2D("timeRes_trackPos_TProfile",
title.c_str(),
nbins_x,
-pitch_x / 2.,
pitch_x / 2.,
nbins_y,
-pitch_y / 2.,
pitch_y / 2.);
title = m_detector->getName() + "in pixel time difference map;in-pixel x_{track} [#mum];in-pixel y_{track} #mum;time "
"difference: track - cluster [ns]";
htimeDelay_trackPos_TProfile =
new TProfile2D("timeDelay_trackPos_TProfile",
title.c_str(),
nbins_x,
-pitch_x / 2.,
pitch_x / 2.,
nbins_y,
-pitch_y / 2.,
pitch_y / 2.,
-500,
500,
"s"); // standard deviation as the error on a bin, convenient for time resolution
}
// Associated cluster histograms
......
......@@ -130,7 +130,7 @@ namespace corryvreckan {
TProfile2D* hclusterSize_trackPos_TProfile;
// Member variables
double inpixelBinSize_;
ROOT::Math::XYPoint inpixelBinSize_;
double time_cut_frameedge_;
double spatial_cut_sensoredge_;
double chi2_ndof_cut_;
......
......@@ -24,7 +24,7 @@ If a region of interest (ROI) is defined for the detector under investigation, o
* `n_raw_bins`: Number of bins for pixel raw values in histograms. Defaults to n_charge_bins if not specified.
* `raw_histo_range`: Axis range for pixel raw values axes in histograms. Defaults to charge_histo_range if not specified.
* `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`.
* `inpixel_bin_size`: The bin size for inpixel plots. Defaults to `500 nm`
* `inpixel_bin_size`: The bin size for inpixel plots. Different bin sizes can be set for the x and y axis. Defaults to `0.5um`, `0.5um`.
### Plots produced
For the DUT, the following plots are produced:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment