]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
Analyzer: Leakage current can be very high and even negative, adjusted Histogram...
authorBenjamin Linnik <blinnik@jspc61.x-matter.uni-frankfurt.de>
Wed, 20 Dec 2017 11:55:17 +0000 (12:55 +0100)
committerBenjamin Linnik <blinnik@jspc61.x-matter.uni-frankfurt.de>
Wed, 20 Dec 2017 11:55:17 +0000 (12:55 +0100)
MABS_run_analyzer/ChargeSpektrum.c
MABS_run_analyzer/HistogramType.cpp
MABS_run_analyzer/Run.cpp
MABS_run_analyzer/Run.h

index 25395222462503cdca9900d3af8ba4161ec08279..e764fe7d9fd45508795f96485237e2e72117034e 100644 (file)
@@ -278,14 +278,26 @@ void ChargeSpektrum(TString runnumber = "")
                         
                         
                         if (analysisType.Contains("leak")) { // analyze cluster formation
+                            if (analysisType.Contains("rts")) {
+                                vector<TH1FO*> compareHistogramVectorLeakage;                        
+                                compareHistogramVectorLeakage.push_back(runs[runi]->histogramwoRTS->LeakageCurrentDistrib);
+                                compareHistogramVectorLeakage.push_back(runs[runi]->histogram->LeakageCurrentDistrib);
+                                // plot and clear compareHistogramClassVectorRTS vector,
+                                CompareHistograms(&compareHistogramVectorLeakage);
+                                compareHistogramVectorLeakage.clear();
+                            }
+                            
                             // Plot leakage current            
-                            compareHistogramLeakageCurrent.push_back(runs[runi]->histogram->LeakageCurrentDistrib);
+                            compareHistogramLeakageCurrent.push_back(HistogramTypeDefaultPt->LeakageCurrentDistrib);
                             if (runi+1 == numberRuns) {
                                 compareHistogramVectorVector.push_back(compareHistogramLeakageCurrent);     
                             }
-                            
-                            runs[runi]->plot1DHistogram(runs[runi]->histogramdynamicalthreshold->Veto, "GaussTail", true);
-                            runs[runi]->plot1DHistogram(runs[runi]->histogram->LeakageCurrentInPixelSorted, "", false, true);
+                            if (runs[runi]->labbook.chipGen.EqualTo("Pipper2")) {
+                                runs[runi]->plot1DHistogram(runs[runi]->histogramdynamicalthreshold->Veto, "GaussTail", true);
+                            } else {
+                                runs[runi]->plot1DHistogram(runs[runi]->histogramwoRTS->Veto, "GaussTail", true);
+                            }                            
+                            runs[runi]->plot1DHistogram(HistogramTypeDefaultPt->LeakageCurrentInPixelSorted, "", false, true);
                         }
                         
                         if (analysisType.Contains("seedf")) { // seedfit: seed integral anaylsis
index 82aed94d6a156c5ed1bd6c171c49af86f593fda3..9e3e871151ec96ee620dda41805f3d73fcc01397 100644 (file)
@@ -56,7 +56,7 @@ void HistogramType::initHistograms(Int_t gotcolor, Int_t gotstyle) {
     initHistogramCustom(pixeltimefiredDistrib, "Fire counter" + histogramdescription, color, style, 0, labbook->frames_foundDB/100, labbook->frames_foundDB/100, "times fired", "Counts");
     initHistogramCustom(LeakageCurrentInPixel, "Leakage current per pixel" + histogramdescription, color, style, 0, cursensorinfo->columns*cursensorinfo->rows, cursensorinfo->columns*cursensorinfo->rows, "Pixel index", "Average CDS");
     initHistogramCustom(LeakageCurrentInPixelSorted, "Leakage current per pixel sorted" + histogramdescription, color, style, 0, cursensorinfo->columns*cursensorinfo->rows, cursensorinfo->columns*cursensorinfo->rows, "Pixel index", "Average CDS");
-    initHistogramCustom(LeakageCurrentDistrib, "Average Leakage current per pixel" + histogramdescription, color, style, 0, 20, 200, "Average CDS", "Count");
+    initHistogramCustom(LeakageCurrentDistrib, "Average Leakage current per pixel" + histogramdescription, color, style, -100, 400, 1000, "Average CDS", "Count");
     //     initHistogram(LeakageCurrentInPixelSorted, "Leakage current" + histogramdescription, color, style);
     initHistogramCustom(pixelHadGoodVeto, "Number of times pixel had good veto" + histogramdescription, color, style, 0, cursensorinfo->columns*cursensorinfo->rows, cursensorinfo->columns*cursensorinfo->rows, "Pixel index", "Counter good veto");
     
index 2d28e8103bfc8cb43cc829e9f9d5a8c1d0e9019c..353d98b485348099b5a97c1d30b9c382f30b0733 100644 (file)
@@ -465,6 +465,7 @@ Bool_t Run::analyzeRun(Bool_t force)
         cout << "---------- 1. loop over all classes --------" << endl;
         for (vector<HistogramType*>::iterator curHistogramClass = HistogramClassVector.begin(); curHistogramClass != HistogramClassVector.end(); curHistogramClass++)  {
             cout << "Processing histograms in class: <" << colorwhite << (*curHistogramClass)->histogramdescription << colorreset << " >" << endlr;
+            BinFiringRates(*curHistogramClass);
             if ((*curHistogramClass)->maskRTSpixel) {
                 //                 if (labbook.chipGen=="Mi19") {
                 cout << colorwhite << " FindRTSPixelToMask():" << endlr;
@@ -533,17 +534,9 @@ Bool_t Run::analyzeRun(Bool_t force)
     return 1;
 }
 
-Bool_t Run::FindRTSPixelToMask(HistogramType* HistogramTypepointer, Bool_t verbose)
-{
-    
-    Double_t meanpixeltimesfired = 0;
-    Double_t RTSpixelHits = 0;
-    Double_t totalHits = 0;
-    Double_t stdeviation = 0;
-    numberofactivepixel = 0;
-    
-    labbook.numberofRTSpixel = 0;    
-    
+
+Bool_t Run::BinFiringRates(HistogramType* HistogramTypepointer, Bool_t verbose)
+{    
     // first run, bin number of times pixel fired, sort by pixelindex
     uint pixelnumber = 0;
     uint binnumber = 0;
@@ -552,8 +545,6 @@ Bool_t Run::FindRTSPixelToMask(HistogramType* HistogramTypepointer, Bool_t verbo
         for(Int_t hiti=0; (unsigned int)hiti<processed->fFrameInfo.hits;hiti++) { // loop over hits in a frame
             pixelnumber = processed->fFrameInfo.pixel[hiti];
             binnumber = HistogramTypepointer->pixeltimefired->Fill(pixelnumber);
-            //             cout << "binnumber: " << binnumber; // Pixel #10 will be saved in bin number 11 (!)
-            //             cout << colorcyan << " Pixel " << pixelnumber << " fired in frame " << framei << " hiti " << hiti << endlr;
         }
     }
     
@@ -562,17 +553,37 @@ Bool_t Run::FindRTSPixelToMask(HistogramType* HistogramTypepointer, Bool_t verbo
     for (Int_t pixeli=1; pixeli <= HistogramTypepointer->pixeltimefired->GetNbinsX(); pixeli++) {
         if (HistogramTypepointer->pixeltimefired->GetBinContent(pixeli) > 0) {
             HistogramTypepointer->pixeltimefiredDistrib->Fill(HistogramTypepointer->pixeltimefired->GetBinContent(pixeli));
+        }
+    }   
+    return 0;
+}
+
+
+Bool_t Run::FindRTSPixelToMask(HistogramType* HistogramTypepointer, Bool_t verbose)
+{
+    
+    Double_t meanpixeltimesfired = 0;
+    Double_t RTSpixelHits = 0;
+    Double_t totalHits = 0;
+    Double_t stdeviation = 0;
+    numberofactivepixel = 0;
+    
+    labbook.numberofRTSpixel = 0;    
+
+    // calculate the mean firing times and bin fireing times in a propability histogram, first approach
+    for (Int_t pixeli=1; pixeli <= HistogramTypepointer->pixeltimefired->GetNbinsX(); pixeli++) {
+        if (HistogramTypepointer->pixeltimefired->GetBinContent(pixeli) > 0) {
             meanpixeltimesfired += HistogramTypepointer->pixeltimefired->GetBinContent(pixeli);
             numberofactivepixel++;
-            //             HistogramTypepointer->pixeltimefiredsorted->Fill(2000);
         }
     }   
     meanpixeltimesfired /= numberofactivepixel; // Very rough estimate of a mean firing time
     
     // vrey rough estimate on standard deviation
     for (Int_t pixeli=1; pixeli <= HistogramTypepointer->pixeltimefired->GetNbinsX(); pixeli++) {
-        if (HistogramTypepointer->pixeltimefired->GetBinContent(pixeli) > 0)
+        if (HistogramTypepointer->pixeltimefired->GetBinContent(pixeli) > 0) {
             stdeviation += pow(HistogramTypepointer->pixeltimefired->GetBinContent(pixeli)-meanpixeltimesfired,2);
+        }
     }
     stdeviation /= numberofactivepixel;
     stdeviation = sqrt(stdeviation);
@@ -1178,16 +1189,16 @@ Bool_t Run::binLeakageCurrent(HistogramType* oneHistogramClass)
     oneHistogramClass->medianLeakageCurrentMinus = oneHistogramClass->LeakageCurrentInPixelSorted->GetBinContent(lastbinabovezero*probabilities[0]);
     oneHistogramClass->medianLeakageCurrentMinus = oneHistogramClass->medianLeakageCurrentMinus - oneHistogramClass->medianLeakageCurrent;
     
-    //     TCanvas *c1 = new TCanvas("c1","c1",600,400);
-    //     oneHistogramClass->LeakageCurrentInPixelSorted->Draw("");
-    //     c1->Update();
-    //     TCanvas *c2 = new TCanvas("c2","c2",600,400);
-    //     oneHistogramClass->LeakageCurrentDistrib->Draw("");
-    //     c2->Update();
-    //     cout << "medianLeakageCurrent: " << oneHistogramClass->medianLeakageCurrent << endl;
-    //     cout << "medianLeakageCurrentPlus: " << oneHistogramClass->medianLeakageCurrentPlus << endl;
-    //     cout << "medianLeakageCurrentMinus: " << oneHistogramClass->medianLeakageCurrentMinus << endl;
-    //     
+//         TCanvas *c1 = new TCanvas("c1","c1",600,400);
+//         oneHistogramClass->LeakageCurrentInPixelSorted->Draw("");
+//         c1->Update();
+//     TCanvas *c2 = new TCanvas(oneHistogramClass->histogramdescription,oneHistogramClass->histogramdescription,600,400);
+//         oneHistogramClass->LeakageCurrentDistrib->Draw("");
+//         c2->Update();
+//         cout << "medianLeakageCurrent: " << oneHistogramClass->medianLeakageCurrent << endl;
+//         cout << "medianLeakageCurrentPlus: " << oneHistogramClass->medianLeakageCurrentPlus << endl;
+//         cout << "medianLeakageCurrentMinus: " << oneHistogramClass->medianLeakageCurrentMinus << endl;
+//     //     
     //     
     //     oneHistogramClass->medianLeakageCurrent = leakagequantiles[1];
     //     oneHistogramClass->medianLeakageCurrentPlus = leakagequantiles[2];
index eac0fd2f709a98b6964df7a563ef4ceb1fdc7bf4..61cb3c6a4ad2fd4a95e9a3e9188030f7c7f4dee8 100644 (file)
@@ -207,6 +207,10 @@ private:
     
     /** @brief finds and and masks RTS pixel if maskRTSpixel isset to true */
     Bool_t FindRTSPixelToMask(HistogramType* histogramtypepointer, Bool_t verbose = kFALSE);
+        
+    /** @brief Bins firing rates, filled in all histogram classes, used by rts pixel masing for specified #HistogramType classes */
+    Bool_t BinFiringRates(HistogramType* histogramtypepointer, Bool_t verbose = kFALSE);
+    
     
 public:
     /** @brief empty constructor */