]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
Run analyzer: bugfix in spectrum integration, noise border was not found correctly
authorBenjamin Linnik <blinnik@jspc28.x-matter.uni-frankfurt.de>
Mon, 21 Sep 2015 16:29:02 +0000 (18:29 +0200)
committerBenjamin Linnik <blinnik@jspc28.x-matter.uni-frankfurt.de>
Mon, 21 Sep 2015 16:29:02 +0000 (18:29 +0200)
MABS_run_analyzer/HistogramType.c

index 590d37f91c6721c763307f18b8fea292f4edaed0..7d76841bf5ec6333b0464c442d9d4d9af8a688b6 100644 (file)
@@ -319,27 +319,28 @@ Bool_t HistogramType::integrateSr90Spectra(TH1F* histogrampointer, Int_t frames_
     
     TH1F* smoothedcurce = (TH1F*)histogrampointer->Clone();
     smoothedcurce->Smooth(4);
+    smoothedcurce->SetAxisRange(0,histogrampointer->GetBinCenter(histogrampointer->GetNbinsX()));
     
-    //     Int_t random = random1->Rndm()*100000;
-    //     TString canvastitle = Form("%s %s sdfasdf", histogrampointer->GetName(), runcode.Data());
-    //     TString canvasname =  Form("%s %s %d dfgsdfgsdfg", histogrampointer->GetName(), runcode.Data(), random);
-    //     TCanvas* canvas = new TCanvas(canvasname, canvastitle, 900, 700);
-    //     smoothedcurce->Draw();
+//         TString canvastitle = Form("%s sdfasdf", histogrampointer->GetName());
+//         TString canvasname =  Form("%s dfgsdfgsdfg", histogrampointer->GetName());
+//         TCanvas* canvas = new TCanvas(canvasname, canvastitle, 900, 700);
+//         smoothedcurce->Draw();
     
     Int_t thresholdbincurcandidate = 0;
     if (thresholdborder < 0)
     {
         Int_t rising = 0;
         Int_t bini =smoothedcurce->GetMaximumBin();
+        thresholdbincurcandidate = bini;
         Float_t curval = smoothedcurce->GetXaxis()->GetBinCenter(bini);
-        //         cout << "smoothedcurce->GetXaxis()->GetBinCenter(" << bini << "): " << curval << endl;
+//         cout << "GetMaximumBin: smoothedcurce->GetXaxis()->GetBinCenter(" << bini << "): " << curval << endl;
         
         do {
             curval=smoothedcurce->GetBinContent(bini++);
             if (curval*0.95 <= smoothedcurce->GetBinContent(bini))
             {
                 rising++;
-                //                 cout << "rising at " <<  smoothedcurce->GetXaxis()->GetBinCenter(bini) << "   as " << curval  << " < " << smoothedcurce->GetBinContent(bini) << endl; // debug
+//                 cout << "rising at " <<  smoothedcurce->GetXaxis()->GetBinCenter(bini) << "   as " << curval  << " < " << smoothedcurce->GetBinContent(bini) << endl; // debug
             }
             else
             {
@@ -360,6 +361,8 @@ Bool_t HistogramType::integrateSr90Spectra(TH1F* histogrampointer, Int_t frames_
     //     Float_t posChargeMax= histogrampointer->GetMaximum();
     
     noisethresholdborder = histogrampointer->GetXaxis()->GetBinUpEdge(thresholdbincurcandidate);
+//     cout << "thresholdbincurcandidate: " << thresholdbincurcandidate << endl;
+//     cout << "noisethresholdborder: " << noisethresholdborder << endl;
     
     if (verbose) {
         cout << "   Integrating " << histogrampointer->GetTitle() << endlr;