Commit f5fe86a3 authored by Jens Dopke's avatar Jens Dopke
Browse files

Prealignment Module with variable range for residual plots providing for...

Prealignment Module with variable range for residual plots providing for variable pre-alignment for modules with more than 10mm scale sensor size.
parent 5cd50bf7
......@@ -24,6 +24,7 @@ Prealignment::Prealignment(Configuration& config, std::shared_ptr<Detector> dete
config_.setDefault<double>("damping_factor", 1.0);
config_.setDefault<std::string>("method", "mean");
config_.setDefault<int>("fit_range_rel", 500);
config_.setDefault<double>("range_abs", Units::get<double>(10, "mm"));
if(config_.count({"time_cut_rel", "time_cut_abs"}) == 0) {
config_.setDefault("time_cut_rel", 3.0);
......@@ -34,6 +35,7 @@ Prealignment::Prealignment(Configuration& config, std::shared_ptr<Detector> dete
max_correlation_rms = config_.get<double>("max_correlation_rms");
damping_factor = config_.get<double>("damping_factor");
range_abs = config_.get<double>("range_abs");
method = config_.get<std::string>("method");
std::transform(method.begin(), method.end(), method.begin(), ::tolower);
fit_range_rel = config_.get<int>("fit_range_rel");
......@@ -49,9 +51,9 @@ void Prealignment::initialize() {
// Correlation plots
std::string title = m_detector->getName() + ": correlation X;x_{ref}-x [mm];events";
correlationX = new TH1F("correlationX", title.c_str(), 1000, -10., 10.);
correlationX = new TH1F("correlationX", title.c_str(), 1000, -1.0 * range_abs, 1.0 * range_abs);
title = m_detector->getName() + ": correlation Y;y_{ref}-y [mm];events";
correlationY = new TH1F("correlationY", title.c_str(), 1000, -10., 10.);
correlationY = new TH1F("correlationY", title.c_str(), 1000, -1.0 * range_abs, 1.0 * range_abs);
// 2D correlation plots (pixel-by-pixel, local coordinates):
title = m_detector->getName() + ": 2D correlation X (local);x [px];x_{ref} [px];events";
correlationX2Dlocal = new TH2F("correlationX_2Dlocal",
......@@ -72,9 +74,11 @@ void Prealignment::initialize() {
-0.5,
reference->nPixels().Y() - 0.5);
title = m_detector->getName() + ": 2D correlation X (global);x [mm];x_{ref} [mm];events";
correlationX2D = new TH2F("correlationX_2D", title.c_str(), 100, -10., 10., 100, -10., 10.);
correlationX2D = new TH2F(
"correlationX_2D", title.c_str(), 100, -1.0 * range_abs, 1.0 * range_abs, 100, -1.0 * range_abs, 1.0 * range_abs);
title = m_detector->getName() + ": 2D correlation Y (global);y [mm];y_{ref} [mm];events";
correlationY2D = new TH2F("correlationY_2D", title.c_str(), 100, -10., 10., 100, -10., 10.);
correlationY2D = new TH2F(
"correlationY_2D", title.c_str(), 100, -1.0 * range_abs, 1.0 * range_abs, 100, -1.0 * range_abs, 1.0 * range_abs);
}
StatusCode Prealignment::run(const std::shared_ptr<Clipboard>& clipboard) {
......
......@@ -50,6 +50,7 @@ namespace corryvreckan {
double max_correlation_rms;
double damping_factor;
double timeCut;
double range_abs;
std::string method;
int fit_range_rel;
};
......
......@@ -21,6 +21,7 @@ However, for the prealignment this is a an acceptable estimation which works wit
* `time_cut_abs`: Specifies an absolute value for the maximum time difference between a cluster on the current detector and a cluster on the reference plane to be considered in the prealignment. Absolute and relative time cuts are mutually exclusive. No default value.
* `method`: Specifies which method should be used to compute the translational shifts. With the option `mean` the mean of the 1D correlation histogram is used. The option `maximum` uses the maximum value of the histogram. With `method` set to `gauss_fit` a Gaussian is fitted and the mean of the fit is used for the translational shift. Default is to `mean`.
* `fit_range_rel`: Parameter to set the fit range of the Gaussian fit if `method` is set to `gauss_fit`. The absolute fit range is given by `fit_range_rel` times the spatial resolution of the corresponding detector around the maximum of the 1D correlation histogram. The default of the relative fit range is `fit_range_rel` = 500.
* `range_abs`: Parameter to allow setting up the range in which residuals get plotted (mm, +- around 0). Default is `10mm`. This needs to be increased for large sensors, where the alignment might be out by well more than 10mm and thus residual plots might be emtpy in the range +- 10.
### Plots Created
......
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