Commit 1ec226dc authored by Katharina Dort's avatar Katharina Dort
Browse files

Formatting changes

parent 0584b589
......@@ -127,23 +127,21 @@ void Prealignment::finalise() {
double shift_X = 0.;
double shift_Y = 0.;
LOG(INFO) << "Using prealignment method: " << prealign_method;
if(prealign_method == "gauss_fit"){
correlationX->Fit("gaus", "Q","", fit_low, fit_high);
correlationY->Fit("gaus", "Q","", fit_low, fit_high);
LOG(INFO) << "Using prealignment method: " << prealign_method;
if(prealign_method == "gauss_fit") {
correlationX->Fit("gaus", "Q", "", fit_low, fit_high);
correlationY->Fit("gaus", "Q", "", fit_low, fit_high);
shift_X = correlationX->GetFunction("gaus")->GetParameter(1);
shift_Y = correlationY->GetFunction("gaus")->GetParameter(1);
}
else if(prealign_method == "mean"){
} else if(prealign_method == "mean") {
shift_X = correlationX->GetMean();
shift_Y = correlationY->GetMean();
} else if(prealign_method == "maximum") {
int binMaxX = correlationX->GetMaximumBin();
shift_X = correlationX->GetXaxis()->GetBinCenter(binMaxX);
int binMaxY = correlationY->GetMaximumBin();
shift_Y = correlationY->GetXaxis()->GetBinCenter(binMaxY);
}
else if(prealign_method == "maximum"){
int binMaxX = correlationX->GetMaximumBin();
shift_X = correlationX->GetXaxis()->GetBinCenter(binMaxX);
int binMaxY = correlationY->GetMaximumBin();
shift_Y = correlationY->GetXaxis()->GetBinCenter(binMaxY);
}
LOG(INFO) << "Detector " << m_detector->name() << ": x = " << Units::display(shift_X, {"mm", "um"})
<< " , y = " << Units::display(shift_Y, {"mm", "um"});
......
......@@ -12,9 +12,9 @@
#define PREALIGNMENT_H 1
#include <TCanvas.h>
#include <TF1.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TF1.h>
#include <iostream>
#include "core/module/Module.hpp"
#include "objects/Cluster.hpp"
......@@ -50,9 +50,9 @@ namespace corryvreckan {
double max_correlation_rms;
double damping_factor;
double timeCut;
std::string prealign_method;
double fit_high;
double fit_low;
std::string prealign_method;
double fit_high;
double fit_low;
};
} // namespace corryvreckan
#endif // PREALIGNMENT_H
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