16 double ContentInRange=0;
17 for (
int i=0;
i<=
hist->GetNbinsX();
i++)
19 if ( ( (
hist->GetBinCenter(
i) +
hist->GetBinWidth(
i)/2.) < centralX+halfWidth) &&
20 ( (
hist->GetBinCenter(
i) -
hist->GetBinWidth(
i)/2.) > centralX-halfWidth ))
22 ContentInRange=ContentInRange+
hist->GetBinContent(
i);
25 int borderbin=
hist->FindBin(centralX-halfWidth);
27 double ContentInLeftBorderBin =
hist->GetBinContent(borderbin)*
28 ((
hist->GetBinCenter(borderbin) +
hist->GetBinWidth(borderbin)/2.) -(centralX-halfWidth))/
hist->GetBinWidth(borderbin);
30 borderbin=
hist->FindBin(centralX+halfWidth);
31 double ContentInRightBorderBin =
hist->GetBinContent(borderbin)*((centralX+halfWidth) - (
hist->GetBinCenter(borderbin) -
32 hist->GetBinWidth(borderbin)/2.))/
hist->GetBinWidth(borderbin);
34 return ContentInRange+ContentInRightBorderBin+ContentInLeftBorderBin;
59 double PercentageOfEntriesInWidth,
69 if (n_max_runs<=0)
return;
72 Double_t old_sigma=0.0;
75 TF1 gaussian(
"g1",
"gaus");
76 gaussian.SetRange(-300,300);
79 for (
int i=1;
i<=n_max_runs ;
i++)
81 hist->Fit(&gaussian,
"R");
82 gaussian.GetParameters(&
par[0]);
88 if (std::abs(1.0-old_sigma/
sigma)<0.0001)
break;
94 PTSigma = std::abs(
sigma);
95 ErrMean = (gaussian.GetParError(1));
96 ErrSigma = std::abs((gaussian.GetParError(2)));
102 TailContent=TailContent+
hist->GetBinContent(
i);
109 TailContent=TailContent+
hist->GetBinContent(
i);
113 TailFraction = ((
double)(TailContent))/((
double)
hist->GetEntries());
115 if (PercentageOfEntriesInWidth>1) PercentageOfEntriesInWidth=PercentageOfEntriesInWidth/100;
117 double NumberOfEntriesInWidth = PercentageOfEntriesInWidth * 1.0 *
hist->GetEntries();