36 Double_t
mybw(Double_t *, Double_t *);
37 Double_t
mygauss(Double_t *, Double_t *);
69 h_fitres1 = _ibooker.
book1D(
"Gaussian mean WP80 EB-EB",
"Gaussian mean WP80 EB-EB", 1, 0, 1);
70 h_fitres1bis = _ibooker.
book1D(
"Gaussian sigma WP80 EB-EB",
"Gaussian sigma WP80 EB-EB", 1, 0, 1);
71 h_fitres1Chi2 = _ibooker.
book1D(
72 "Gaussian Chi2 result over NDF WP80 EB-EB",
"Gaussian Chi2 result over NDF WP80 EB-EB", 1, 0, 1);
74 h_fitres3 = _ibooker.
book1D(
"Gaussian mean WP80 EB-EE",
"Gaussian mean result WP80 EB-EE", 1, 0, 1);
75 h_fitres3bis = _ibooker.
book1D(
"Gaussian sigma WP80 EB-EE",
"Gaussian sigma WP80 EB-EE", 1, 0, 1);
77 _ibooker.
book1D(
"Gaussian Chi2 result over NDF WP80 EB-EE",
"Gaussian Chi2 result over NDF WP80 EB-EE", 1, 0, 1);
79 h_fitres2 = _ibooker.
book1D(
"Gaussian mean WP80 EE-EE",
"Gaussian mean WP80 EE-EE", 1, 0, 1);
80 h_fitres2bis = _ibooker.
book1D(
"Gaussian sigma WP80 EE-EE",
"Gaussian sigma WP80 EE-EE", 1, 0, 1);
82 _ibooker.
book1D(
"Gaussian Chi2 result over NDF WP80 EE-EE",
"Gaussian Chi2 result over NDF WP80 EE-EE", 1, 0, 1);
84 LogTrace(
"EwkAnalyzer") <<
"Parameters initialization";
92 TH1F *R1 = h_fitres1->
getTH1F();
93 int division = B->GetNbinsX();
94 float massMIN = B->GetBinLowEdge(1);
95 float massMAX = B->GetBinLowEdge(division + 1);
98 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
99 func->SetParameter(0, 1.0);
100 func->SetParName(0,
"const");
101 func->SetParameter(1, 95.0);
102 func->SetParName(1,
"mean");
103 func->SetParameter(2, 5.0);
104 func->SetParName(2,
"sigma");
115 B->Fit(
"mygauss",
"QR");
116 mean =
std::abs(func->GetParameter(1));
117 sigma =
std::abs(func->GetParError(1));
120 if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20) {
136 stats[3] = sigma * sigma * N + mean * mean *
N;
142 if (me1 !=
nullptr) {
144 TH1F *R1bis = h_fitres1bis->
getTH1F();
145 int division = Bbis->GetNbinsX();
146 float massMIN = Bbis->GetBinLowEdge(1);
147 float massMAX = Bbis->GetBinLowEdge(division + 1);
150 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
151 func->SetParameter(0, 1.0);
152 func->SetParName(0,
"const");
153 func->SetParameter(1, 95.0);
154 func->SetParName(1,
"mean");
155 func->SetParameter(2, 5.0);
156 func->SetParName(2,
"sigma");
159 R1bis->GetStats(stats);
163 N = Bbis->GetEntries();
167 Bbis->Fit(
"mygauss",
"QR");
168 rms =
std::abs(func->GetParameter(2));
169 rmsErr =
std::abs(func->GetParError(2));
172 if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50) {
188 stats[3] = rmsErr * rmsErr * N + rms * rms *
N;
190 R1bis->SetEntries(N);
191 R1bis->PutStats(stats);
195 if (me2 !=
nullptr) {
197 TH1F *R2 = h_fitres2->
getTH1F();
198 int division = E->GetNbinsX();
199 float massMIN = E->GetBinLowEdge(1);
200 float massMAX = E->GetBinLowEdge(division + 1);
203 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
204 func->SetParameter(0, 1.0);
205 func->SetParName(0,
"const");
206 func->SetParameter(1, 95.0);
207 func->SetParName(1,
"mean");
208 func->SetParameter(2, 5.0);
209 func->SetParName(2,
"sigma");
220 E->Fit(
"mygauss",
"QR");
221 mean =
std::abs(func->GetParameter(1));
222 sigma =
std::abs(func->GetParError(1));
225 if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20) {
241 stats[3] = sigma * sigma * N + mean * mean *
N;
248 if (me2 !=
nullptr) {
250 TH1F *R2bis = h_fitres2bis->
getTH1F();
251 int division = Ebis->GetNbinsX();
252 float massMIN = Ebis->GetBinLowEdge(1);
253 float massMAX = Ebis->GetBinLowEdge(division + 1);
256 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
257 func->SetParameter(0, 1.0);
258 func->SetParName(0,
"const");
259 func->SetParameter(1, 95.0);
260 func->SetParName(1,
"mean");
261 func->SetParameter(2, 5.0);
262 func->SetParName(2,
"sigma");
265 R2bis->GetStats(stats);
269 N = Ebis->GetEntries();
273 Ebis->Fit(
"mygauss",
"QR");
274 rms =
std::abs(func->GetParameter(2));
275 rmsErr =
std::abs(func->GetParError(2));
278 if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50) {
294 stats[3] = rmsErr * rmsErr * N + rms * rms *
N;
296 R2bis->SetEntries(N);
297 R2bis->PutStats(stats);
301 if (me3 !=
nullptr) {
302 TH1F *R3 = h_fitres3->
getTH1F();
304 int division = M->GetNbinsX();
305 float massMIN = M->GetBinLowEdge(1);
306 float massMAX = M->GetBinLowEdge(division + 1);
309 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
310 func->SetParameter(0, 1.0);
311 func->SetParName(0,
"const");
312 func->SetParameter(1, 95.0);
313 func->SetParName(1,
"mean");
314 func->SetParameter(2, 5.0);
315 func->SetParName(2,
"sigma");
326 M->Fit(
"mygauss",
"QR");
327 mean =
std::abs(func->GetParameter(1));
328 sigma =
std::abs(func->GetParError(1));
330 if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20) {
346 stats[3] = sigma * sigma * N + mean * mean *
N;
353 if (me3 !=
nullptr) {
355 TH1F *R3bis = h_fitres3bis->
getTH1F();
356 int division = Mbis->GetNbinsX();
357 float massMIN = Mbis->GetBinLowEdge(1);
358 float massMAX = Mbis->GetBinLowEdge(division + 1);
361 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
362 func->SetParameter(0, 1.0);
363 func->SetParName(0,
"const");
364 func->SetParameter(1, 95.0);
365 func->SetParName(1,
"mean");
366 func->SetParameter(2, 5.0);
367 func->SetParName(2,
"sigma");
370 R3bis->GetStats(stats);
374 N = Mbis->GetEntries();
378 Mbis->Fit(
"mygauss",
"QR");
379 rms =
std::abs(func->GetParameter(2));
380 rmsErr =
std::abs(func->GetParError(2));
383 if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50) {
399 stats[3] = rmsErr * rmsErr * N + rms * rms *
N;
401 R3bis->SetEntries(N);
402 R3bis->PutStats(stats);
407 if (me1 !=
nullptr) {
409 TH1F *S1 = h_fitres1Chi2->
getTH1F();
410 int division = C1->GetNbinsX();
411 float massMIN = C1->GetBinLowEdge(1);
412 float massMAX = C1->GetBinLowEdge(division + 1);
415 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
416 func->SetParameter(0, 1.0);
417 func->SetParName(0,
"const");
418 func->SetParameter(1, 95.0);
419 func->SetParName(1,
"mean");
420 func->SetParameter(2, 5.0);
421 func->SetParName(2,
"sigma");
428 N = C1->GetEntries();
432 C1->Fit(
"mygauss",
"QR");
433 if ((func->GetNDF() != 0)) {
439 if (N == 0 || Chi2 < 0 || NDF < 0) {
455 stats[3] = NDF * NDF * N + Chi2 * Chi2 *
N;
462 if (me2 !=
nullptr) {
464 TH1F *S2 = h_fitres2Chi2->
getTH1F();
465 int division = C2->GetNbinsX();
466 float massMIN = C2->GetBinLowEdge(1);
467 float massMAX = C2->GetBinLowEdge(division + 1);
470 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
471 func->SetParameter(0, 1.0);
472 func->SetParName(0,
"const");
473 func->SetParameter(1, 95.0);
474 func->SetParName(1,
"mean");
475 func->SetParameter(2, 5.0);
476 func->SetParName(2,
"sigma");
483 N = C2->GetEntries();
487 C2->Fit(
"mygauss",
"QR");
488 if (func->GetNDF() != 0) {
494 if (N == 0 || Chi2 < 0 || NDF < 0) {
510 stats[3] = NDF * NDF * N + Chi2 * Chi2 *
N;
516 if (me3 !=
nullptr) {
518 TH1F *S3 = h_fitres3Chi2->
getTH1F();
519 int division = C3->GetNbinsX();
520 float massMIN = C3->GetBinLowEdge(1);
521 float massMAX = C3->GetBinLowEdge(division + 1);
524 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
525 func->SetParameter(0, 1.0);
526 func->SetParName(0,
"const");
527 func->SetParameter(1, 95.0);
528 func->SetParName(1,
"mean");
529 func->SetParameter(2, 5.0);
530 func->SetParName(2,
"sigma");
537 N = C3->GetEntries();
541 C3->Fit(
"mygauss",
"QR");
542 if ((func->GetNDF() != 0)) {
548 if (N == 0 || Chi2 < 0 || NDF < 0) {
564 stats[3] = NDF * NDF * N + Chi2 * Chi2 *
N;
572 Double_t
mybw(Double_t *
x, Double_t *par) {
573 Double_t arg1 = 14.0 / 22.0;
574 Double_t arg2 = par[1] * par[1] * par[2] * par[2];
575 Double_t arg3 = ((x[0] * x[0]) - (par[1] * par[1])) * ((x[0] * x[0]) - (par[1] * par[1]));
576 Double_t arg4 = x[0] * x[0] * x[0] * x[0] * ((par[2] * par[2]) / (par[1] * par[1]));
577 return par[0] * arg1 * arg2 / (arg3 + arg4);
586 arg = (x[0] - par[1]) / par[2];
587 return par[0] * TMath::Exp(-0.5 * arg * arg) / (TMath::Sqrt(2 *
TMath::Pi()) * par[2]);
~EcalZmassClient() override
char const * what() const override
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Double_t mybw(Double_t *, Double_t *)
#define DEFINE_FWK_MODULE(type)
void setCurrentFolder(std::string const &fullpath)
MonitorElement * book1D(Args &&...args)
Abs< T >::type abs(const T &t)
static const std::string B
MonitorElement * get(std::string const &path)
Double_t mygauss(Double_t *, Double_t *)
EcalZmassClient(const edm::ParameterSet &)