]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
Run analyzer: humanreadableruncode is given to the HistogramClass, so it can set...
authorBenjamin Linnik <blinnik@jspc28.x-matter.uni-frankfurt.de>
Mon, 21 Sep 2015 13:37:29 +0000 (15:37 +0200)
committerBenjamin Linnik <blinnik@jspc28.x-matter.uni-frankfurt.de>
Mon, 21 Sep 2015 13:37:29 +0000 (15:37 +0200)
MABS_run_analyzer/HistogramType.c
MABS_run_analyzer/HistogramType.h
MABS_run_analyzer/Run.c

index a2d2dcfa8de177a2454a44c32bc7db64a0e4efd5..1402d7dc63fb65823c1d88ce356a94676102446f 100644 (file)
@@ -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);        
index 68c7fceb972bc77b813cdb7b24647ffa6f53608a..c6f542abd43ff6d6ee1c173af0e401f98fe505b3 100644 (file)
@@ -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
index 07a8e556fe4b6d24c99f7ef38b2adfc9f58bb466..f5a3304a25e8cbe5053f6eefb07db50a238f5c85 100644 (file)
@@ -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<HistogramType*>::iterator curHistogramClass = HistogramClassVector.begin(); curHistogramClass != HistogramClassVector.end(); curHistogramClass++)
+        (*curHistogramClass)->humanreadablestr = humanreadablestr;
     
     runcode = Form("%i_", labbook.runnumber);
     if (labbook.chip.Length() < 2)