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();
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()));
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();
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;