From 0e383eabe23b117f15e340b617d169356ed5d779 Mon Sep 17 00:00:00 2001 From: Benjamin Linnik Date: Tue, 1 Sep 2015 16:33:01 +0200 Subject: [PATCH] Run analyzer: added a suffix to runcode and humanreadable string, is set automatically when submatrix is selected/cropped out in selectSubMatrixFSBB() or setSubMatrixBorders() --- MABS_run_analyzer/Run.c | 29 +++++++++++++++++++++-------- MABS_run_analyzer/Run.h | 11 ++++++++--- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/MABS_run_analyzer/Run.c b/MABS_run_analyzer/Run.c index 05b30f6..536be77 100644 --- a/MABS_run_analyzer/Run.c +++ b/MABS_run_analyzer/Run.c @@ -492,6 +492,7 @@ Bool_t Run::generateReadableRunCode() else runcode+= Form("Rn0%.0f",labbook.radDoseNonIon); runcode+= labbook.matrix; + runcode+= runcodesuffix; if (labbook.resistivity > 0) runcode+= Form("HR%d",labbook.resistivity); string tempstring = labbook.source.Data(); @@ -591,20 +592,31 @@ void Run::setMatrixSpecificParameters() } -void Run::setSubMatrixBorders(u_int x_start, u_int x_end, u_int y_start, u_int y_end) +void Run::setSubMatrixBorders(u_int x_start, u_int x_end, u_int y_start, u_int y_end, Bool_t addtoruncodesuffix) { submatrix_x_start = x_start; submatrix_x_end = x_end; submatrix_y_start = y_start; submatrix_y_end = y_end; + if (addtoruncodesuffix) + { + runcodesuffix += Form("_row%u-%u_colu%u-%u_", x_start, x_end, y_start, y_end); + humanreadablesuffix += Form("Row: %u - %u, Column: %u - %u, ", x_start, x_end, y_start, y_end); + } } void Run::selectSubMatrixFSBB(TString matrixname) { - if (matrixname.EqualTo("A0")) - setSubMatrixBorders(0, sensorinfocur.columns, 0, sensorinfocur.rows/2-2); - else if (matrixname.EqualTo("A1")) - setSubMatrixBorders(0, sensorinfocur.columns, sensorinfocur.rows/2+2, sensorinfocur.rows); + if (matrixname.EqualTo("A0")) { + setSubMatrixBorders(0, sensorinfocur.columns, 0, sensorinfocur.rows/2-2, false); + runcodesuffix += "_A0_"; + humanreadablesuffix += "A0, "; + } + else if (matrixname.EqualTo("A1")) { + setSubMatrixBorders(0, sensorinfocur.columns, sensorinfocur.rows/2+2, sensorinfocur.rows, false); + runcodesuffix += "_A1_"; + humanreadablesuffix += "A1, "; + } else cout << colorred << "Error in selectSubMatrixFSBB(), given submatrix with name: " << matrixname << " not known. " << endlr; } @@ -1877,7 +1889,8 @@ void Run::initHistograms(histogramstruct* histogramstructpointer, TString suffix initHistogram(histogramstructpointer->Veto, "Veto" + suffix); TString prefix = "Noise" + suffix; - TString humanreadablestr = Form("%s, %s spectrum, %s, chip %s, %s, T=%.1f",prefix.Data(), labbook.source.Data(), labbook.chipGen.Data(), labbook.chip.Data(), labbook.matrix.Data(), labbook.temp); + + TString humanreadablestr = Form("%s, %s spectrum, %s, chip %s, %s, %sT=%.1f",prefix.Data(), labbook.source.Data(), labbook.chipGen.Data(), labbook.chip.Data(), labbook.matrix.Data(), humanreadablesuffix.Data(), labbook.temp); if (suffix.Contains("threshold")) { histogramstructpointer->thresholdcluster = 1; @@ -1900,7 +1913,7 @@ void Run::initHistograms(histogramstruct* histogramstructpointer, TString suffix void Run::initHistogram(TH1F* &histogrampointer, TString prefix) { - TString humanreadablestr = Form("%s, %s spectrum, %s, chip %s, %s, T=%.1f",prefix.Data(), labbook.source.Data(), labbook.chipGen.Data(), labbook.chip.Data(), labbook.matrix.Data(), labbook.temp); + TString humanreadablestr = Form("%s, %s spectrum, %s, chip %s, %s, %sT=%.1f",prefix.Data(), labbook.source.Data(), labbook.chipGen.Data(), labbook.chip.Data(), labbook.matrix.Data(), humanreadablesuffix.Data(), labbook.temp); histogrampointer=new TH1F(prefix.Data(), humanreadablestr.Data(), systemparamcur.nbins, 0, systemparamcur.maxbin); histogrampointer->SetLineStyle(rootlinestyle[plotStyle]); histogrampointer->SetLineColor(rootcolors[plotStyle]); @@ -1932,7 +1945,7 @@ void Run::initClusters(Float_t xcoord_min_step, Float_t xcoord_abs_min, Float_t void Run::initCluster(histogramstruct* histogramstructpointer, TString suffix, Float_t xcoord_min_step, Float_t xcoord_abs_min, Float_t xcoord_abs_max, Float_t ycoord_min_step, Float_t ycoord_abs_min, Float_t ycoord_abs_max) { TString prefix = "Cluster" + suffix; - TString humanreadablestr = Form("%s, %s cluster, %s, chip %s, %s, T=%.1f",prefix.Data(), labbook.source.Data(), labbook.chipGen.Data(), labbook.chip.Data(), labbook.matrix.Data(), labbook.temp); + TString humanreadablestr = Form("%s, %s cluster, %s, chip %s, %s %sT=%.1f",prefix.Data(), labbook.source.Data(), labbook.chipGen.Data(), labbook.chip.Data(), labbook.matrix.Data(), humanreadablesuffix.Data(), labbook.temp); Int_t sizearrrotx= (int)((xcoord_abs_max-xcoord_abs_min)/xcoord_min_step+0.5); Int_t sizearrroty = (int)((ycoord_abs_max-ycoord_abs_min)/ycoord_min_step+0.5); // cout << "xcoord_abs_min: " << xcoord_abs_min << ", xcoord_abs_max: " << xcoord_abs_max << ", xcoord_min_step: " << xcoord_min_step << endl; diff --git a/MABS_run_analyzer/Run.h b/MABS_run_analyzer/Run.h index d6d92ba..590248d 100644 --- a/MABS_run_analyzer/Run.h +++ b/MABS_run_analyzer/Run.h @@ -479,7 +479,7 @@ public: void setSystemSpecificParameters(); /** @brief sets boundaries for submatrix analysis, sets #Run::submatrix_x_start, #Run::submatrix_x_end, #Run::submatrix_y_start and #Run::submatrix_y_end to default values to given values */ - void setSubMatrixBorders(u_int x_start, u_int x_end, u_int y_start, u_int y_end); + void setSubMatrixBorders(u_int x_start, u_int x_end, u_int y_start, u_int y_end, Bool_t addtoruncodesuffix=true); /** @brief calls #Run::setSubMatrixBorders() with the correct boundaries for FSBB submatrix A0 or A1 */ void selectSubMatrixFSBB(TString matrixname); @@ -609,10 +609,15 @@ public: Double_t sr90IntegralVal = -1; Double_t sr90IntegralErr = -1; - - /// specific string wich encodes the database information of the run + /** @brief specific string wich encodes the database information of the run */ TString runcode=""; + /** @brief other information to include in the #Run::runcode, not set automatically or gathered by the database */ + TString runcodesuffix=""; + + /** @brief other information to include in the #Run::humanreadable, not set automatically or gathered by the database */ + TString humanreadablesuffix=""; + /** @brief Converting string to numbers */ Float_t stringToNumber ( string ); -- 2.43.0