16 hist->StatOverflows(kTRUE);
23 if (
h.count(
s) == 0) {
24 edm::LogWarning(
"PVValidationHelpers") <<
"Trying to fill non-existing Histogram named " <<
s << std::endl;
34 if (
h.count(
s) == 0) {
35 edm::LogWarning(
"PVValidationHelpers") <<
"Trying to fill non-existing Histogram named " <<
s << std::endl;
49 edm::LogWarning(
"PVValidationHelpers") <<
"Trying to fill non-existing Histogram with index " <<
index
50 <<
" for array with size: " <<
h.size() <<
" tag: " <<
tag << std::endl;
59 h.erase(
h.begin() + desired_size,
h.end());
71 returnType = std::make_tuple(
"dxy",
"d_{xy}",
"[#mum]");
74 returnType = std::make_tuple(
"dx",
"d_{x}",
"[#mum]");
77 returnType = std::make_tuple(
"dy",
"d_{y}",
"[#mum]");
80 returnType = std::make_tuple(
"dz",
"d_{z}",
"[#mum]");
83 returnType = std::make_tuple(
"IP2D",
"IP_{2D}",
"[#mum]");
86 returnType = std::make_tuple(
"resz",
"z_{trk}-z_{vtx}",
"[#mum]");
89 returnType = std::make_tuple(
"IP3D",
"IP_{3D}",
"[#mum]");
92 returnType = std::make_tuple(
"d3D",
"d_{3D}",
"[#mum]");
98 returnType = std::make_tuple(
"norm_dxy",
"d_{xy}/#sigma_{d_{xy}}",
"");
101 returnType = std::make_tuple(
"norm_dx",
"d_{x}/#sigma_{d_{x}}",
"");
104 returnType = std::make_tuple(
"norm_dy",
"d_{y}/#sigma_{d_{y}}",
"");
107 returnType = std::make_tuple(
"norm_dz",
"d_{z}/#sigma_{d_{z}}",
"");
110 returnType = std::make_tuple(
"norm_IP2D",
"IP_{2D}/#sigma_{IP_{2D}}",
"");
113 returnType = std::make_tuple(
"norm_resz",
"z_{trk}-z_{vtx}/#sigma_{res_{z}}",
"");
116 returnType = std::make_tuple(
"norm_IP3D",
"IP_{3D}/#sigma_{IP_{3D}}",
"");
119 returnType = std::make_tuple(
"norm_d3D",
"d_{3D}/#sigma_{d_{3D}}",
"");
123 edm::LogWarning(
"PVValidationHelpers") <<
" getTypeString() unknown residual type: " <<
type << std::endl;
136 returnVar = std::make_tuple(
"phi",
"#phi",
"[rad]");
139 returnVar = std::make_tuple(
"eta",
"#eta",
"");
142 returnVar = std::make_tuple(
"pT",
"p_{T}",
"[GeV]");
145 returnVar = std::make_tuple(
"pTCentral",
"p_{T} |#eta|<1.",
"[GeV]");
148 returnVar = std::make_tuple(
"ladder",
"ladder number",
"");
151 returnVar = std::make_tuple(
"modZ",
"module number",
"");
154 edm::LogWarning(
"PVValidationHelpers") <<
" getVarString() unknown plot variable: " <<
var << std::endl;
164 std::vector<float>
v(
n);
166 std::iota(
v.begin(),
v.end(), 1.);
184 if (
histo->Integral() != 0) {
199 double x_lastBin =
histo->GetBinLowEdge(
nbins + 1);
203 TH1F* newHisto =
new TH1F(Finalname.c_str(), Finalname.c_str(),
nbins, 0., x_lastBin);
204 double* residuals =
new double[
nbins];
209 newHisto->Fill(residuals[
j],
weights[
j]);
216 newHisto->Delete(
"");
227 if (
hist->GetEntries() < 1) {
232 float sigma =
hist->GetRMS();
234 TF1
func(
"tmp",
"gaus",
mean - 1.5 * sigma,
mean + 1.5 * sigma);
237 sigma =
func.GetParameter(2);
242 if (0 ==
hist->Fit(&
func,
"Q0LR")) {
243 if (
hist->GetFunction(
func.GetName())) {
244 hist->GetFunction(
func.GetName())->ResetBit(TF1::kNotDraw);
249 float res_mean =
func.GetParameter(1);
250 float res_width =
func.GetParameter(2);
252 float res_mean_err =
func.GetParError(1);
253 float res_width_err =
func.GetParError(2);
258 std::pair<Measurement1D, Measurement1D>
result;
260 result = std::make_pair(resultM, resultW);