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

Clicpix2Correlator: use C++11 std::sto_string()

parent afcd34f9
...@@ -6,12 +6,6 @@ using namespace std; ...@@ -6,12 +6,6 @@ using namespace std;
Clicpix2Correlator::Clicpix2Correlator(Configuration config, std::vector<Detector*> detectors) Clicpix2Correlator::Clicpix2Correlator(Configuration config, std::vector<Detector*> detectors)
: Algorithm(std::move(config), std::move(detectors)) {} : Algorithm(std::move(config), std::move(detectors)) {}
template <typename T> std::string makeString(T number) {
std::ostringstream ss;
ss << number;
return ss.str();
}
void Clicpix2Correlator::initialise(Parameters* par) { void Clicpix2Correlator::initialise(Parameters* par) {
parameters = par; parameters = par;
...@@ -32,7 +26,7 @@ void Clicpix2Correlator::initialise(Parameters* par) { ...@@ -32,7 +26,7 @@ void Clicpix2Correlator::initialise(Parameters* par) {
angleStop = 2. * M_PI; angleStop = 2. * M_PI;
for(double angle = angleStart; angle < angleStop; angle += angleStep) { for(double angle = angleStart; angle < angleStop; angle += angleStep) {
string name = "rotated" + makeString(angle); string name = "rotated" + std::to_string(angle);
string histo = "hTrackDiffX_" + name; string histo = "hTrackDiffX_" + name;
hTrackDiffX[name] = new TH1F(histo.c_str(), histo.c_str(), 4000, -20, 20); hTrackDiffX[name] = new TH1F(histo.c_str(), histo.c_str(), 4000, -20, 20);
} }
...@@ -118,7 +112,7 @@ void Clicpix2Correlator::finalise() { ...@@ -118,7 +112,7 @@ void Clicpix2Correlator::finalise() {
double ycorr = cluster->globalY() - trackIntercept.Y(); double ycorr = cluster->globalY() - trackIntercept.Y();
// Fill histograms on correlations // Fill histograms on correlations
string name = "rotated" + makeString(angle); string name = "rotated" + std::to_string(angle);
hTrackDiffX[name]->Fill(xcorr); hTrackDiffX[name]->Fill(xcorr);
hTrackDiffY[name]->Fill(ycorr); hTrackDiffY[name]->Fill(ycorr);
} }
......
Supports Markdown
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