156 theDbe->
book1D (
"Gaussian mean WP80 EB-EB",
157 "Gaussian mean WP80 EB-EB", 1, 0, 1);
159 theDbe->
book1D (
"Gaussian sigma WP80 EB-EB",
160 "Gaussian sigma WP80 EB-EB", 1, 0, 1);
162 theDbe->
book1D (
"Gaussian Chi2 result over NDF WP80 EB-EB",
163 "Gaussian Chi2 result over NDF WP80 EB-EB", 1, 0, 1);
166 theDbe->
book1D (
"Gaussian mean WP80 EB-EE",
167 "Gaussian mean result WP80 EB-EE", 1, 0, 1);
169 theDbe->
book1D (
"Gaussian sigma WP80 EB-EE",
170 "Gaussian sigma WP80 EB-EE", 1, 0, 1);
172 theDbe->
book1D (
"Gaussian Chi2 result over NDF WP80 EB-EE",
173 "Gaussian Chi2 result over NDF WP80 EB-EE", 1, 0, 1);
176 theDbe->
book1D (
"Gaussian mean WP80 EE-EE",
177 "Gaussian mean WP80 EE-EE", 1, 0, 1);
179 theDbe->
book1D (
"Gaussian sigma WP80 EE-EE",
180 "Gaussian sigma WP80 EE-EE", 1, 0, 1);
182 theDbe->
book1D (
"Gaussian Chi2 result over NDF WP80 EE-EE",
183 "Gaussian Chi2 result over NDF WP80 EE-EE", 1, 0, 1);
191 Double_t arg1 = 14.0 / 22.0;
192 Double_t arg2 = par[1] * par[1] * par[2] * par[2];
194 ((x[0] * x[0]) - (par[1] * par[1])) * ((x[0] * x[0]) - (par[1] * par[1]));
196 x[0] * x[0] * x[0] * x[0] * ((par[2] * par[2]) / (par[1] * par[1]));
197 return par[0] * arg1 * arg2 / (arg3 + arg4);
208 arg = (x[0] - par[1]) / par[2];
209 return par[0] * TMath::Exp (-0.5 * arg * arg) / (TMath::Sqrt (2 *
TMath::Pi ()) * par[2]);
221 LogTrace (
"EwkAnalyzer") <<
"Parameters initialization";
232 int division = B->GetNbinsX ();
233 float massMIN = B->GetBinLowEdge (1);
234 float massMAX = B->GetBinLowEdge (division + 1);
237 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
238 func->SetParameter (0, 1.0);
239 func->SetParName (0,
"const");
240 func->SetParameter (1, 95.0);
241 func->SetParName (1,
"mean");
242 func->SetParameter (2, 5.0);
243 func->SetParName (2,
"sigma");
246 R1->GetStats (stats);
250 N = B->GetEntries ();
257 B->Fit (
"mygauss",
"QR");
258 mean = fabs (func->GetParameter (1));
259 sigma = fabs (func->GetParError (1));
262 if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20)
281 stats[3] = sigma * sigma * N + mean * mean *
N;
284 R1->PutStats (stats);
291 int division = Bbis->GetNbinsX ();
292 float massMIN = Bbis->GetBinLowEdge (1);
293 float massMAX = Bbis->GetBinLowEdge (division + 1);
296 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
297 func->SetParameter (0, 1.0);
298 func->SetParName (0,
"const");
299 func->SetParameter (1, 95.0);
300 func->SetParName (1,
"mean");
301 func->SetParameter (2, 5.0);
302 func->SetParName (2,
"sigma");
305 R1bis->GetStats (stats);
309 N = Bbis->GetEntries ();
316 Bbis->Fit (
"mygauss",
"QR");
317 rms = fabs (func->GetParameter (2));
318 rmsErr = fabs (func->GetParError (2));
321 if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50)
340 stats[3] = rmsErr * rmsErr * N + rms * rms *
N;
342 R1bis->SetEntries (N);
343 R1bis->PutStats (stats);
351 int division = E->GetNbinsX ();
352 float massMIN = E->GetBinLowEdge (1);
353 float massMAX = E->GetBinLowEdge (division + 1);
356 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
357 func->SetParameter (0, 1.0);
358 func->SetParName (0,
"const");
359 func->SetParameter (1, 95.0);
360 func->SetParName (1,
"mean");
361 func->SetParameter (2, 5.0);
362 func->SetParName (2,
"sigma");
365 R2->GetStats (stats);
369 N = E->GetEntries ();
375 E->Fit (
"mygauss",
"QR");
376 mean = fabs (func->GetParameter (1));
377 sigma = fabs (func->GetParError (1));
380 if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20)
400 stats[3] = sigma * sigma * N + mean * mean *
N;
403 R2->PutStats (stats);
411 int division = Ebis->GetNbinsX ();
412 float massMIN = Ebis->GetBinLowEdge (1);
413 float massMAX = Ebis->GetBinLowEdge (division + 1);
416 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
417 func->SetParameter (0, 1.0);
418 func->SetParName (0,
"const");
419 func->SetParameter (1, 95.0);
420 func->SetParName (1,
"mean");
421 func->SetParameter (2, 5.0);
422 func->SetParName (2,
"sigma");
425 R2bis->GetStats (stats);
429 N = Ebis->GetEntries ();
436 Ebis->Fit (
"mygauss",
"QR");
437 rms = fabs (func->GetParameter (2));
438 rmsErr = fabs (func->GetParError (2));
441 if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50)
460 stats[3] = rmsErr * rmsErr * N + rms * rms *
N;
462 R2bis->SetEntries (N);
463 R2bis->PutStats (stats);
471 int division = M->GetNbinsX ();
472 float massMIN = M->GetBinLowEdge (1);
473 float massMAX = M->GetBinLowEdge (division + 1);
476 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
477 func->SetParameter (0, 1.0);
478 func->SetParName (0,
"const");
479 func->SetParameter (1, 95.0);
480 func->SetParName (1,
"mean");
481 func->SetParameter (2, 5.0);
482 func->SetParName (2,
"sigma");
485 R3->GetStats (stats);
489 N = M->GetEntries ();
497 M->Fit (
"mygauss",
"QR");
498 mean = fabs (func->GetParameter (1));
499 sigma = fabs (func->GetParError (1));
501 if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20)
520 stats[3] = sigma * sigma * N + mean * mean *
N;
523 R3->PutStats (stats);
531 int division = Mbis->GetNbinsX ();
532 float massMIN = Mbis->GetBinLowEdge (1);
533 float massMAX = Mbis->GetBinLowEdge (division + 1);
536 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
537 func->SetParameter (0, 1.0);
538 func->SetParName (0,
"const");
539 func->SetParameter (1, 95.0);
540 func->SetParName (1,
"mean");
541 func->SetParameter (2, 5.0);
542 func->SetParName (2,
"sigma");
545 R3bis->GetStats (stats);
549 N = Mbis->GetEntries ();
556 Mbis->Fit (
"mygauss",
"QR");
557 rms = fabs (func->GetParameter (2));
558 rmsErr = fabs (func->GetParError (2));
561 if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50)
580 stats[3] = rmsErr * rmsErr * N + rms * rms *
N;
582 R3bis->SetEntries (N);
583 R3bis->PutStats (stats);
592 int division = C1->GetNbinsX ();
593 float massMIN = C1->GetBinLowEdge (1);
594 float massMAX = C1->GetBinLowEdge (division + 1);
597 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
598 func->SetParameter (0, 1.0);
599 func->SetParName (0,
"const");
600 func->SetParameter (1, 95.0);
601 func->SetParName (1,
"mean");
602 func->SetParameter (2, 5.0);
603 func->SetParName (2,
"sigma");
606 S1->GetStats (stats);
610 N = C1->GetEntries ();
617 C1->Fit (
"mygauss",
"QR");
618 if ((func->GetNDF () != 0))
620 Chi2 = fabs (func->GetChisquare ()) / fabs (func->GetNDF ());
625 if (N == 0 || Chi2 < 0 || NDF < 0)
644 stats[3] = NDF * NDF * N + Chi2 * Chi2 *
N;
647 S1->PutStats (stats);
655 int division = C2->GetNbinsX ();
656 float massMIN = C2->GetBinLowEdge (1);
657 float massMAX = C2->GetBinLowEdge (division + 1);
660 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
661 func->SetParameter (0, 1.0);
662 func->SetParName (0,
"const");
663 func->SetParameter (1, 95.0);
664 func->SetParName (1,
"mean");
665 func->SetParameter (2, 5.0);
666 func->SetParName (2,
"sigma");
669 S2->GetStats (stats);
673 N = C2->GetEntries ();
679 C2->Fit (
"mygauss",
"QR");
680 if (func->GetNDF () != 0)
682 Chi2 = fabs (func->GetChisquare ()) / fabs (func->GetNDF ());
687 if (N == 0 || Chi2 < 0 || NDF < 0)
706 stats[3] = NDF * NDF * N + Chi2 * Chi2 *
N;
709 S2->PutStats (stats);
716 int division = C3->GetNbinsX ();
717 float massMIN = C3->GetBinLowEdge (1);
718 float massMAX = C3->GetBinLowEdge (division + 1);
721 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
722 func->SetParameter (0, 1.0);
723 func->SetParName (0,
"const");
724 func->SetParameter (1, 95.0);
725 func->SetParName (1,
"mean");
726 func->SetParameter (2, 5.0);
727 func->SetParName (2,
"sigma");
730 S3->GetStats (stats);
734 N = C3->GetEntries ();
740 C3->Fit (
"mygauss",
"QR");
741 if ((func->GetNDF () != 0))
743 Chi2 = fabs (func->GetChisquare ()) / fabs (func->GetNDF ());
749 if (N == 0 || Chi2 < 0 || NDF < 0)
768 stats[3] = NDF * NDF * N + Chi2 * Chi2 *
N;
771 S3->PutStats (stats);
798 descriptions.addDefault (desc);
virtual char const * what() const
T getUntrackedParameter(std::string const &, T const &) const
virtual void endRun(edm::Run const &, edm::EventSetup const &) override
MonitorElement * h_fitres1Chi2
MonitorElement * h_fitres2
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
#define DEFINE_FWK_MODULE(type)
Double_t mybw(Double_t *x, Double_t *par)
virtual void endJob() override
MonitorElement * h_fitres1
virtual void beginJob() override
Double_t mygauss(Double_t *x, Double_t *par)
MonitorElement * h_fitres2Chi2
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
MonitorElement * h_fitres3Chi2
MonitorElement * h_fitres2bis
MonitorElement * h_fitres3
MonitorElement * h_fitres3bis
TH1F * getTH1F(void) const
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
virtual void beginRun(edm::Run const &, edm::EventSetup const &) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
EcalZmassClient(const edm::ParameterSet &)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * h_fitres1bis