From: Benjamin Linnik Date: Mon, 21 Sep 2015 16:29:02 +0000 (+0200) Subject: Run analyzer: bugfix in spectrum integration, noise border was not found correctly X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=a0c82cfc842881f3de1b724ee9d468dbd8d82145;p=radhard.git Run analyzer: bugfix in spectrum integration, noise border was not found correctly --- diff --git a/MABS_run_analyzer/HistogramType.c b/MABS_run_analyzer/HistogramType.c index 590d37f..7d76841 100644 --- a/MABS_run_analyzer/HistogramType.c +++ b/MABS_run_analyzer/HistogramType.c @@ -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;