193 float*
xbins =
new float[nProfileBins+1];
194 std::string Xvar_name =
m_binnames[binnumber];
195 std::string Xvar_name_s = Xvar_name;
196 size_t found0 = Xvar_name_s.find(
'#');
197 if(found0 != std::string::npos) Xvar_name_s.erase(Xvar_name_s.begin(), Xvar_name_s.begin()+found0+1);
198 size_t found1 = Xvar_name_s.find(
'_');
199 if(found1 != std::string::npos) Xvar_name_s.erase(Xvar_name_s.begin()+found1,Xvar_name_s.end());
200 for(
int i = 0 ;
i < nProfileBins+1 ;
i++)
204 std::string RMSname =
name + std::string(
"_RMS_vs_") + Xvar_name_s;
205 std::string RMStitle = std::string(
"Resolution of ") +
206 title + std::string(
" vs ") + Xvar_name;
207 name =
name + std::string(
"_Mean_vs_") + Xvar_name_s;
208 title = std::string(
"Mean of ") +
title + std::string(
" vs ") + Xvar_name;
211 nProfileBins,
xbins);
213 nProfileBins,
xbins);
215 theMeanProfile->GetXaxis()->SetTitle( Xvar_name.c_str() );
216 theRMSProfile->GetXaxis()->SetTitle( Xvar_name.c_str() );
217 theMeanProfile->GetYaxis()->SetTitle( (std::string(
"Mean of ") +
m_axisName).c_str() );
218 theRMSProfile->GetYaxis()->SetTitle( (std::string(
"RMS of ") +
m_axisName).c_str() );
221 std::vector<int> indexes;
222 for(
int ibin = 0; ibin < nProfileBins; ibin++){
225 std::ostringstream binname;
228 double limits =
swap->GetXaxis()->GetXmax();
230 TH1D *
bin =
new TH1D(binname.str().c_str(), bintitle.c_str(),
231 nbins,-limits,limits);
234 if(indexes[binnumber] == ibin){
242 double mean_error = 0.;
244 double rms_error = 0.;
246 if(
bin->GetEntries() > 50){
257 theMeanProfile->SetBinContent(ibin+1,
mean*
entries);
258 theMeanProfile->SetBinError(ibin+1,mean_error);
259 theMeanProfile->SetBinEntries(ibin+1,
entries);
260 theRMSProfile->SetBinContent(ibin+1,
rms*
entries);
261 theRMSProfile->SetBinError(ibin+1,rms_error);
262 theRMSProfile->SetBinEntries(ibin+1,
entries);
275 (*m_MeanProfilesVector)[binnumber] = theMeanProfile;
276 (*m_RMSProfilesVector)[binnumber] = theRMSProfile;
277 if(
RMS)
return theRMSProfile;
278 else return theMeanProfile;