30 for(
int i=0;
i<16;
i++)
32 sprintf(
name,
"BH_Residual_vsPhi_%d",
i);
35 sprintf(
name,
"BH_Residual_vsPhi_PC_%d", i);
40 for (
int i=1;
i<15;
i++)
45 sprintf(
name,
"BH_Residual_vsPhi_Corrected_%d",
i);
49 sprintf(
name,
"BH_Residual_vsPhi_PC_Corrected_%d",
i);
55 for (
int k=1;
k<15;
k++)
57 cout <<
"Calculating corrections for layer " <<
k << endl;
84 for (
int i=1;
i<15;
i++)
96 if (hist->Integral()<1000) {
return; }
99 double min = ProjectionY->GetBinCenter(1);
100 double max = ProjectionY->GetBinCenter(ProjectionY->GetNbinsX());
102 double amp = ProjectionY->GetBinContent(ProjectionY->GetMaximumBin());
103 double mean = ProjectionY->GetMean();
104 double sigma = ProjectionY->GetRMS();
106 if (!
GAUSS) {
GAUSS =
new TF1(
"GAUSS",
"[0]*exp(-(x-[1])*(x-[1])/(2.0*[2]*[2]))", min, max); }
108 for (
int j=0;
j<3;
j++)
110 GAUSS->SetParameter(0,amp);
111 GAUSS->SetParameter(1,mean);
112 GAUSS->SetParameter(2,sigma);
114 ProjectionY->Fit(
GAUSS,
"Q0",
"", min, max);
116 amp = ProjectionY->GetFunction(
"GAUSS")->GetParameter(0);
117 mean = ProjectionY->GetFunction(
"GAUSS")->GetParameter(1);
118 sigma = ProjectionY->GetFunction(
"GAUSS")->GetParameter(2);
120 min = mean - 2.0*
sigma;
121 max = mean + 2.0*
sigma;
125 cout <<
"Name: " << hist->GetName();
126 cout <<
"\t Amp:" << amp;
127 cout <<
"\t Mean:" <<
mean;
128 cout <<
"\t Sigma:" <<
sigma;