]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
Run analyzer: ThresholdHistogram calibrated added
authorBenjamin Linnik <blinnik@jspc28.x-matter.uni-frankfurt.de>
Mon, 18 May 2015 00:42:37 +0000 (02:42 +0200)
committerBenjamin Linnik <blinnik@jspc28.x-matter.uni-frankfurt.de>
Mon, 18 May 2015 00:42:37 +0000 (02:42 +0200)
MABS_run_analyzer/ChargeSpektrum.c
MABS_run_analyzer/Run.c
MABS_run_analyzer/Run.h

index 30a9c0b81721fdd638aa86c1da1dfdb3ee43ac8b..c10666157598ee7d0ed924483981b078ad4026c3 100644 (file)
@@ -170,15 +170,17 @@ void ChargeSpektrum(TString runnumber = "")
                 {
             //         gROOT->SetBatch(kTRUE);
                     //           runs[runi]->plotSeed();
-                    runs[runi]->plotSeedThreshold();
+//                     runs[runi]->plotSeedThresholdCalibrated();
+//                     runs[runi]->plotSeedThreshold();
             //         runs[runi]->plotSeed();
             //         runs[runi]->plotSum();
             //         runs[runi]->plotVeto();
                     //         runs[runi]->plotNoise();
                     if (!isBatch)
                         gROOT->SetBatch(kFALSE);
-            //         runs[runi]->plotAllHistograms();
-                    runs[runi]->plotAllHistogramsThresholdCluster();
+                    //         runs[runi]->plotAllHistograms();
+//                     runs[runi]->plotAllHistogramsThresholdCluster();
+//                     runs[runi]->plotAllHistogramsThresholdClusterCalibrated();
             //          runs[runi]->plotAllHistogramsCalibrated(); 
                     runs[runi]->writeAllHistogramsToFile(); 
                 }
@@ -186,8 +188,9 @@ void ChargeSpektrum(TString runnumber = "")
         }
     }
 //     plotAllRuns("");
-    plotAllRuns("threshold");
-    writeObservableToFile("Seed");
+    plotAllRuns("threshold calibrated");
+//     writeObservableToFile("seed threshold calibrated");
+    writeObservableToFile("seed threshold");
 }
 
 Int_t ReadRunList(std::vector<int>* runlist)
@@ -220,9 +223,20 @@ Int_t ReadRunList(std::vector<int>* runlist)
 
 void writeObservableToFile(TString histogramtype)
 {
-    if (histogramtype.Contains("threshold")) {
-        for(Int_t runi=0;runi<numberRuns;runi++)/* loop over runs read from file */ {
-            runs[runi]->plothistogramstructpointer = &runs[runi]->histogramthreshold; } }
+    if (histogramtype.Contains("threshold"))
+    {
+        if (histogramtype.Contains("calibrated"))
+        {
+            for(Int_t runi=0;runi<numberRuns;runi++)/* loop over runs read from file */
+                runs[runi]->plothistogramstructpointer = &runs[runi]->histogramthresholdCalibrated;
+        }
+        else
+        {
+            for(Int_t runi=0;runi<numberRuns;runi++)/* loop over runs read from file */ 
+                runs[runi]->plothistogramstructpointer = &runs[runi]->histogramthreshold;
+        }
+        
+    }
     else if (histogramtype.Contains("calibrated") || histogramtype.Contains("electron")) {
         for(Int_t runi=0;runi<numberRuns;runi++) /* loop over runs read from file */ {
             runs[runi]->plothistogramstructpointer = &runs[runi]->histogramCalibrated; } }
@@ -287,15 +301,26 @@ void writeObservableToFile()
 
 void plotAllRuns(TString histogramtype)
 {
-    if (histogramtype.Contains("threshold")) {
-        for(Int_t runi=0;runi<numberRuns;runi++)/* loop over runs read from file */ {
-            runs[runi]->plothistogramstructpointer = &runs[runi]->histogramthreshold; } }
+    if (histogramtype.Contains("threshold"))
+    {
+        if (histogramtype.Contains("calibrated"))
+        {
+            for(Int_t runi=0;runi<numberRuns;runi++)/* loop over runs read from file */
+                runs[runi]->plothistogramstructpointer = &runs[runi]->histogramthresholdCalibrated;
+        }
+        else
+        {
+            for(Int_t runi=0;runi<numberRuns;runi++)/* loop over runs read from file */ 
+                runs[runi]->plothistogramstructpointer = &runs[runi]->histogramthreshold;
+        }
+        
+    }
     else if (histogramtype.Contains("calibrated") || histogramtype.Contains("electron")) {
         for(Int_t runi=0;runi<numberRuns;runi++) /* loop over runs read from file */ {
             runs[runi]->plothistogramstructpointer = &runs[runi]->histogramCalibrated; } }
-    else {
-        for(Int_t runi=0;runi<numberRuns;runi++) /* loop over runs read from file */ {
-            runs[runi]->plothistogramstructpointer = &runs[runi]->histogram; } }
+            else {
+                for(Int_t runi=0;runi<numberRuns;runi++) /* loop over runs read from file */ {
+                    runs[runi]->plothistogramstructpointer = &runs[runi]->histogram; } }
     plotAllRuns();
 }
 
index 2cd06e6c92bcc0d2a92343817cf86ac6a79f0c58..3fb01cda3c68638bdcba25f9cf8e9fb9f48c0601 100644 (file)
@@ -250,6 +250,7 @@ Bool_t Run::analyzeRun(Bool_t force)
             binSeedSumVeto();
             cout << colorwhite << "rescaleHistograms():" << endlr;
             histogramCalibrated.calibrated = rescaleHistograms();
+            histogramthresholdCalibrated.calibrated = histogramCalibrated.calibrated;
             cout << colorwhite << "calculateCCE():" << endlr;
             calculteCCE();
             cout << colorwhite << "updateDatabase():" << endlr;
@@ -313,6 +314,18 @@ Bool_t Run::rescaleHistograms()
     histogramCalibrated.avgNoise = histogram.avgNoise * gain;
     histogramCalibrated.avgNoisePlus = histogram.avgNoisePlus * gain;
     histogramCalibrated.avgNoiseMinus = histogram.avgNoiseMinus * gain;
+        
+    rescaleHistogram(histogramthresholdCalibrated.Seed, histogramthreshold.Seed);
+    rescaleHistogram(histogramthresholdCalibrated.Sum, histogramthreshold.Sum);
+    rescaleHistogram(histogramthresholdCalibrated.Veto, histogramthreshold.Veto);
+    rescaleHistogram(histogramthresholdCalibrated.Noise, histogramthreshold.Noise);
+    
+    histogramthresholdCalibrated.posSeed = histogramthreshold.posSeed * gain;
+    histogramthresholdCalibrated.posSum = histogramthreshold.posSum * gain;
+    histogramthresholdCalibrated.posVeto = histogramthreshold.posVeto * gain;
+    histogramthresholdCalibrated.avgNoise = histogramthreshold.avgNoise * gain;
+    histogramthresholdCalibrated.avgNoisePlus = histogramthreshold.avgNoisePlus * gain;
+    histogramthresholdCalibrated.avgNoiseMinus = histogramthreshold.avgNoiseMinus * gain;
     return 1;    
 }
 
@@ -722,6 +735,17 @@ Bool_t Run::plotSeedThreshold()
     return 1;
 }
 
+Bool_t Run::plotSeedThresholdCalibrated()
+{
+    if (!error)
+    {
+        plot1DHistogram(histogramthresholdCalibrated.Seed, "landau");
+        return 0;
+    }
+    return 1;
+}
+
+
 
 Bool_t Run::plotSum()
 {
@@ -838,6 +862,16 @@ Bool_t Run::plotAllHistogramsThresholdCluster()
     return 1;
 }
 
+Bool_t Run::plotAllHistogramsThresholdClusterCalibrated()
+{
+    if (!error)
+    {
+        plotAllHistograms(&histogramthresholdCalibrated);
+        return 0;
+    }
+    return 1;
+}
+
 Float_t Run::FitPerform(TH1F* histogrampointer, TString fitFuncType, Bool_t verbose)
 {
     Float_t posMax = 0;
index e2da7b3f4e8e2005b630cd6fc329b346881c6235..76d5402fbf7d715b06e8d22f87c86b7a5e12c315 100644 (file)
@@ -261,6 +261,9 @@ public:
     /** @brief Plot all histograms from #histogramthreshold into one canvas */
     Bool_t plotAllHistogramsThresholdCluster();      
     
+    /** @brief Plot all histograms from #histogramthreshold into one canvas */
+    Bool_t plotAllHistogramsThresholdClusterCalibrated();      
+    
     /** @brief Writes a given histogram into a file */
     Bool_t writeHistogramToFile(TH1F* onehistogram);
     
@@ -297,6 +300,7 @@ public:
     Bool_t plotNoise();
     Bool_t plotSeed();
     Bool_t plotSeedThreshold();
+    Bool_t plotSeedThresholdCalibrated();
     Bool_t plotSum();
     Bool_t plotVeto();
     
@@ -419,6 +423,7 @@ public:
     histogramstruct histogram;
     histogramstruct histogramCalibrated;
     histogramstruct histogramthreshold;
+    histogramstruct histogramthresholdCalibrated;
     histogramstruct* plothistogramstructpointer;
     TH1F** plothistogrampointer;