From: Benjamin Linnik Date: Mon, 18 Sep 2017 12:16:01 +0000 (+0200) Subject: Analyzer: adjustments for Ali X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=a4a46396ce7b86fb1b42d27429a2a06706a5a114;p=radhard.git Analyzer: adjustments for Ali --- diff --git a/MABS_run_analyzer/ChargeSpektrumFunctions.c b/MABS_run_analyzer/ChargeSpektrumFunctions.c index 44496b2..f8263d0 100644 --- a/MABS_run_analyzer/ChargeSpektrumFunctions.c +++ b/MABS_run_analyzer/ChargeSpektrumFunctions.c @@ -509,8 +509,9 @@ Bool_t CompareHistograms(vector* ptCompareHistogramVector, TString title for (UInt_t histogrami=0; histogrami < ptCompareHistogramVector->size(); histogrami++) { TH1F* curhistogramclone = (TH1F*) ptCompareHistogramVector->at(histogrami)->Clone(); - lastbin1 = (curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(2,heighestval1/100))>lastbin1)?curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(2,heighestval1/100)):lastbin1; + lastbin1 = (curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(heighestval1/50,1))>lastbin1)?curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(heighestval1/50,1)):lastbin1; } + cout << "lastbin1: " << lastbin1 << endl; TCanvas* canvas = new TCanvas(canvasname, canvastitle, 1200, 800); TPad *grid = new TPad("grid","",0,0,1,1); grid->Draw(); @@ -535,7 +536,7 @@ Bool_t CompareHistograms(vector* ptCompareHistogramVector, TString title leg1->Draw("SAME"); curhistogramclone->SetAxisRange(0,lastbin1*1.1,"X"); - curhistogramclone->GetYaxis()->SetRangeUser(1,heighestval1*1.4); + curhistogramclone->GetYaxis()->SetRangeUser(1,heighestval1*1.4); owntitle->Clear(); owntitle->AddText(trimRunnumberAtBegin(curhistogramclone->GetName())); @@ -805,9 +806,7 @@ Bool_t plotAllRuns(vector* ptCompareHistogramClassVector) curhistogramclone->GetXaxis()->UnZoom(); curhistogramclone->GetXaxis()->SetRange(curhistogramclone->GetXaxis()->FindBin(curhistogramclassp->noisethresholdborder),curhistogramclone->GetXaxis()->FindBin(posMaxValHist)); // look only for maxima with x greater than noiseborder, cut away noise heighestval1 = (curhistogramclone->GetMaximum()>heighestval1?curhistogramclone->GetMaximum():heighestval1); - lastbin1 = (curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(2,3))>lastbin1)?curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(2,3)):lastbin1; -// cout << "Last bin: " << colorcyan << lastbin1 << endlr; -// cout << "curhistogramclone->GetMaximum(): " << colorcyan << curhistogramclone->GetMaximum() << endlr; + curhistogramclone = (TH1F*) curhistogramclassp->Sum->Clone(); posMaxValHist = curhistogramclone->GetXaxis()->GetXmax(); @@ -816,22 +815,30 @@ Bool_t plotAllRuns(vector* ptCompareHistogramClassVector) heighestval2 = (curhistogramclone->GetMaximum()>heighestval2?curhistogramclone->GetMaximum():heighestval2); - lastbin2 = (curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(2,3))>lastbin2)?curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(2,3)):lastbin2; curhistogramclone = (TH1F*) curhistogramclassp->Veto->Clone(); posMaxValHist = curhistogramclone->GetXaxis()->GetXmax(); curhistogramclone->GetXaxis()->UnZoom(); curhistogramclone->GetXaxis()->SetRange(curhistogramclone->GetXaxis()->FindBin(curhistogramclassp->noisethresholdborder),curhistogramclone->GetXaxis()->FindBin(posMaxValHist)); // look only for maxima with x greater than noiseborder, cut away noise heighestval3 = (curhistogramclone->GetMaximum()>heighestval3?curhistogramclone->GetMaximum():heighestval3); - lastbin3 = (curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(2,3))>lastbin3)?curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(2,3)):lastbin3; - // cout << "heighestval3: " << colorcyan << heighestval3 << endlr; - // cout << "curhistogramclone->GetMaximum(): " << colorcyan << curhistogramclone->GetMaximum() << endlr; curhistogramclone = (TH1F*) curhistogramclassp->Noise->Clone(); curhistogramclone->GetXaxis()->UnZoom(); heighestval4 = (curhistogramclone->GetMaximum()>heighestval4?curhistogramclone->GetMaximum():heighestval4); } for (UInt_t histogrami=0; histogrami < ptCompareHistogramClassVector->size(); histogrami++) + { + HistogramType* curhistogramclassp = ptCompareHistogramClassVector->at(histogrami); + TH1F* curhistogramclone = (TH1F*) curhistogramclassp->Seed->Clone(); + lastbin1 = (curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(heighestval1/20,1))>lastbin1)?curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(heighestval1/20,1)):lastbin1; + + curhistogramclone = (TH1F*) curhistogramclassp->Sum->Clone(); + lastbin2 = (curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(heighestval2/20,1))>lastbin2)?curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(heighestval2/20,1)):lastbin2; + + curhistogramclone = (TH1F*) curhistogramclassp->Veto->Clone(); + lastbin3 = (curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(heighestval3/20,1))>lastbin3)?curhistogramclone->GetBinCenter(curhistogramclone->FindLastBinAbove(heighestval3/20,1)):lastbin3; + } + for (UInt_t histogrami=0; histogrami < ptCompareHistogramClassVector->size(); histogrami++) { HistogramType* curhistogramclassp = ptCompareHistogramClassVector->at(histogrami); TH1F* curhistogramclone;