From: Benjamin Linnik Date: Mon, 21 Sep 2015 13:37:29 +0000 (+0200) Subject: Run analyzer: humanreadableruncode is given to the HistogramClass, so it can set... X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=d999066adcfbe3084ddcd298728ac92352e4fb7b;p=radhard.git Run analyzer: humanreadableruncode is given to the HistogramClass, so it can set the titles of the histograms correctly --- diff --git a/MABS_run_analyzer/HistogramType.c b/MABS_run_analyzer/HistogramType.c index a2d2dcf..1402d7d 100644 --- a/MABS_run_analyzer/HistogramType.c +++ b/MABS_run_analyzer/HistogramType.c @@ -19,11 +19,11 @@ HistogramType::~HistogramType( void) { } -HistogramType::HistogramType(TString suffix, systemparam* gotsystempar, sensorinfostruct* gotsensorinfo, Bool_t threshold, Int_t gotcolor, Int_t gotstyle ) { +HistogramType::HistogramType(TString suffix, systemparam* gotsystempar, sensorinfostruct* gotsensorinfo, TString gothumanreadablestr, Int_t gotcolor, Int_t gotstyle ) { histogramdescription = suffix; + humanreadablestr = gothumanreadablestr; cursystempar = gotsystempar; cursensorinfo = gotsensorinfo; - setThresholdType(threshold); initHistograms(gotcolor, gotstyle); }; @@ -32,13 +32,6 @@ HistogramType::HistogramType(TString suffix, systemparam* gotsystempar, sensorin // GETTER AND SETTER //***************** -void HistogramType::setThresholdType(Bool_t threshold) { - if (threshold) { - isthresholdclustertype = 1; } - else { - isthresholdclustertype = 0; } -} - //***************** // INIT FUNCTIONS //***************** @@ -55,7 +48,7 @@ void HistogramType::initHistograms(Int_t gotcolor, Int_t gotstyle) { } void HistogramType::initHistogram(TH1F* &histogrampointer, TString prefix, Int_t color, Int_t style) { - histogrampointer=new TH1F(prefix.Data(), prefix.Data(), cursystempar->nbins, 0, cursystempar->maxbin); + histogrampointer=new TH1F(prefix.Data(), Form("%s, %s",prefix.Data(), humanreadablestr.Data()), cursystempar->nbins, 0, cursystempar->maxbin); histogrampointer->SetLineStyle(style); histogrampointer->SetLineColor(color); histogrampointer->SetStats(kTRUE); diff --git a/MABS_run_analyzer/HistogramType.h b/MABS_run_analyzer/HistogramType.h index 68c7fce..c6f542a 100644 --- a/MABS_run_analyzer/HistogramType.h +++ b/MABS_run_analyzer/HistogramType.h @@ -90,7 +90,7 @@ public: ~HistogramType(void); /** @brief constructor */ - HistogramType(TString suffix, systemparam* gotsystempar, sensorinfostruct* gotsensorinfo, Bool_t threshold=0, Int_t gotcolor=0, Int_t gotstyle=0); + HistogramType(TString suffix, systemparam* gotsystempar, sensorinfostruct* gotsensorinfo, TString gothumanreadablestr, Int_t gotcolor=0, Int_t gotstyle=0); //***************** // TH HISTOGRAMS @@ -135,7 +135,6 @@ public: //***************** // GETTER AND SETTER //***************** - void setThresholdType(Bool_t threshold); //***************** // INIT FUNCTIONS @@ -148,6 +147,8 @@ public: //***************** // GENERAL HISTOGRAM PROPERTIES //***************** + /// A string representing the current run database information in a human readable format + TString humanreadablestr=""; /// type in here what the histogram is intended for or how it is calculated, will be added to filenames TString histogramdescription = ""; /// The gain used to rescale the histograms diff --git a/MABS_run_analyzer/Run.c b/MABS_run_analyzer/Run.c index 07a8e55..f5a3304 100644 --- a/MABS_run_analyzer/Run.c +++ b/MABS_run_analyzer/Run.c @@ -149,16 +149,16 @@ Run::Run(Int_t runnumber, Int_t loopi) cout << colorwhite << "init Histogram classes:" << endlr; // default histogram class, no special cuts applied - histogram = new HistogramType("", &cursystemparam, &cursensorinfo, 0, rootcolors[plotStyle], rootlinestyle[plotStyle] ); + histogram = new HistogramType("", &cursystemparam, &cursensorinfo, humanreadablestr, rootcolors[plotStyle], rootlinestyle[plotStyle] ); HistogramClassVector.push_back(histogram); // dynamical cluster threshold cut - histogramthreshold = new HistogramType(" Threshold", &cursystemparam, &cursensorinfo, 1, rootcolors[plotStyle], rootlinestyle[plotStyle] ); + histogramthreshold = new HistogramType(" Threshold", &cursystemparam, &cursensorinfo, humanreadablestr, rootcolors[plotStyle], rootlinestyle[plotStyle] ); HistogramClassVector.push_back(histogramthreshold); // fixed threshold cut - histogramfixedthreshold = new HistogramType(" fixed Threshold", &cursystemparam, &cursensorinfo, 1, rootcolors[plotStyle], rootlinestyle[plotStyle] ); + histogramfixedthreshold = new HistogramType(" fixed Threshold", &cursystemparam, &cursensorinfo, humanreadablestr, rootcolors[plotStyle], rootlinestyle[plotStyle] ); HistogramClassVector.push_back(histogramfixedthreshold); // dennis megacut - dennismegacut = new HistogramType(" Dennis Mega Cut", &cursystemparam, &cursensorinfo, 0, rootcolors[plotStyle], rootlinestyle[plotStyle] ); + dennismegacut = new HistogramType(" Dennis Mega Cut", &cursystemparam, &cursensorinfo, humanreadablestr, rootcolors[plotStyle], rootlinestyle[plotStyle] ); HistogramClassVector.push_back(dennismegacut); debugDBreadout(); @@ -485,6 +485,8 @@ Bool_t Run::checkFileExists(TString file) Bool_t Run::generateReadableRunCode() { humanreadablestr = Form("%s, %s, chip %s, %s, %sT=%.1f", labbook.source.Data(), labbook.chipGen.Data(), labbook.chip.Data(), labbook.matrix.Data(), humanreadablesuffix.Data(), labbook.temp); + for (vector::iterator curHistogramClass = HistogramClassVector.begin(); curHistogramClass != HistogramClassVector.end(); curHistogramClass++) + (*curHistogramClass)->humanreadablestr = humanreadablestr; runcode = Form("%i_", labbook.runnumber); if (labbook.chip.Length() < 2)