182 theDbe->
book1D (
"Gaussian mean WP80 EB-EB",
183 "Gaussian mean WP80 EB-EB", 1, 0, 1);
185 theDbe->
book1D (
"Gaussian sigma WP80 EB-EB",
186 "Gaussian sigma WP80 EB-EB", 1, 0, 1);
188 theDbe->
book1D (
"Gaussian Chi2 result over NDF WP80 EB-EB",
189 "Gaussian Chi2 result over NDF WP80 EB-EB", 1, 0, 1);
192 theDbe->
book1D (
"Gaussian mean WP80 EB-EE",
193 "Gaussian mean result WP80 EB-EE", 1, 0, 1);
195 theDbe->
book1D (
"Gaussian sigma WP80 EB-EE",
196 "Gaussian sigma WP80 EB-EE", 1, 0, 1);
198 theDbe->
book1D (
"Gaussian Chi2 result over NDF WP80 EB-EE",
199 "Gaussian Chi2 result over NDF WP80 EB-EE", 1, 0, 1);
202 theDbe->
book1D (
"Gaussian mean WP80 EE-EE",
203 "Gaussian mean WP80 EE-EE", 1, 0, 1);
205 theDbe->
book1D (
"Gaussian sigma WP80 EE-EE",
206 "Gaussian sigma WP80 EE-EE", 1, 0, 1);
208 theDbe->
book1D (
"Gaussian Chi2 result over NDF WP80 EE-EE",
209 "Gaussian Chi2 result over NDF WP80 EE-EE", 1, 0, 1);
217 Double_t arg1 = 14.0 / 22.0;
218 Double_t arg2 = par[1] * par[1] * par[2] * par[2];
220 ((x[0] * x[0]) - (par[1] * par[1])) * ((x[0] * x[0]) - (par[1] * par[1]));
222 x[0] * x[0] * x[0] * x[0] * ((par[2] * par[2]) / (par[1] * par[1]));
223 return par[0] * arg1 * arg2 / (arg3 + arg4);
234 arg = (x[0] - par[1]) / par[2];
235 return par[0] * TMath::Exp (-0.5 * arg * arg) / (TMath::Sqrt (2 *
TMath::Pi ()) * par[2]);
247 LogTrace (
"EwkAnalyzer") <<
"Parameters initialization";
258 int division = B->GetNbinsX ();
259 float massMIN = B->GetBinLowEdge (1);
260 float massMAX = B->GetBinLowEdge (division + 1);
263 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
264 func->SetParameter (0, 1.0);
265 func->SetParName (0,
"const");
266 func->SetParameter (1, 95.0);
267 func->SetParName (1,
"mean");
268 func->SetParameter (2, 5.0);
269 func->SetParName (2,
"sigma");
272 R1->GetStats (stats);
276 N = B->GetEntries ();
283 B->Fit (
"mygauss",
"QR");
284 mean = fabs (func->GetParameter (1));
285 sigma = fabs (func->GetParError (1));
288 if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20)
298 edm::LogError (
"ZFitter") <<
"[Zfitter]: Exception when fitting...";
307 stats[3] = sigma * sigma * N + mean * mean *
N;
310 R1->PutStats (stats);
317 int division = Bbis->GetNbinsX ();
318 float massMIN = Bbis->GetBinLowEdge (1);
319 float massMAX = Bbis->GetBinLowEdge (division + 1);
322 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
323 func->SetParameter (0, 1.0);
324 func->SetParName (0,
"const");
325 func->SetParameter (1, 95.0);
326 func->SetParName (1,
"mean");
327 func->SetParameter (2, 5.0);
328 func->SetParName (2,
"sigma");
331 R1bis->GetStats (stats);
335 N = Bbis->GetEntries ();
342 Bbis->Fit (
"mygauss",
"QR");
343 rms = fabs (func->GetParameter (2));
344 rmsErr = fabs (func->GetParError (2));
347 if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50)
357 edm::LogError (
"ZFitter") <<
"[Zfitter]: Exception when fitting...";
366 stats[3] = rmsErr * rmsErr * N + rms * rms *
N;
368 R1bis->SetEntries (N);
369 R1bis->PutStats (stats);
377 int division = E->GetNbinsX ();
378 float massMIN = E->GetBinLowEdge (1);
379 float massMAX = E->GetBinLowEdge (division + 1);
382 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
383 func->SetParameter (0, 1.0);
384 func->SetParName (0,
"const");
385 func->SetParameter (1, 95.0);
386 func->SetParName (1,
"mean");
387 func->SetParameter (2, 5.0);
388 func->SetParName (2,
"sigma");
391 R2->GetStats (stats);
395 N = E->GetEntries ();
401 E->Fit (
"mygauss",
"QR");
402 mean = fabs (func->GetParameter (1));
403 sigma = fabs (func->GetParError (1));
406 if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20)
417 edm::LogError (
"ZFitter") <<
"[Zfitter]: Exception when fitting...";
426 stats[3] = sigma * sigma * N + mean * mean *
N;
429 R2->PutStats (stats);
437 int division = Ebis->GetNbinsX ();
438 float massMIN = Ebis->GetBinLowEdge (1);
439 float massMAX = Ebis->GetBinLowEdge (division + 1);
442 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
443 func->SetParameter (0, 1.0);
444 func->SetParName (0,
"const");
445 func->SetParameter (1, 95.0);
446 func->SetParName (1,
"mean");
447 func->SetParameter (2, 5.0);
448 func->SetParName (2,
"sigma");
451 R2bis->GetStats (stats);
455 N = Ebis->GetEntries ();
462 Ebis->Fit (
"mygauss",
"QR");
463 rms = fabs (func->GetParameter (2));
464 rmsErr = fabs (func->GetParError (2));
467 if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50)
477 edm::LogError (
"ZFitter") <<
"[Zfitter]: Exception when fitting...";
486 stats[3] = rmsErr * rmsErr * N + rms * rms *
N;
488 R2bis->SetEntries (N);
489 R2bis->PutStats (stats);
497 int division = M->GetNbinsX ();
498 float massMIN = M->GetBinLowEdge (1);
499 float massMAX = M->GetBinLowEdge (division + 1);
502 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
503 func->SetParameter (0, 1.0);
504 func->SetParName (0,
"const");
505 func->SetParameter (1, 95.0);
506 func->SetParName (1,
"mean");
507 func->SetParameter (2, 5.0);
508 func->SetParName (2,
"sigma");
511 R3->GetStats (stats);
515 N = M->GetEntries ();
523 M->Fit (
"mygauss",
"QR");
524 mean = fabs (func->GetParameter (1));
525 sigma = fabs (func->GetParError (1));
527 if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20)
537 edm::LogError (
"ZFitter") <<
"[Zfitter]: Exception when fitting...";
546 stats[3] = sigma * sigma * N + mean * mean *
N;
549 R3->PutStats (stats);
557 int division = Mbis->GetNbinsX ();
558 float massMIN = Mbis->GetBinLowEdge (1);
559 float massMAX = Mbis->GetBinLowEdge (division + 1);
562 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
563 func->SetParameter (0, 1.0);
564 func->SetParName (0,
"const");
565 func->SetParameter (1, 95.0);
566 func->SetParName (1,
"mean");
567 func->SetParameter (2, 5.0);
568 func->SetParName (2,
"sigma");
571 R3bis->GetStats (stats);
575 N = Mbis->GetEntries ();
582 Mbis->Fit (
"mygauss",
"QR");
583 rms = fabs (func->GetParameter (2));
584 rmsErr = fabs (func->GetParError (2));
587 if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50)
597 edm::LogError (
"ZFitter") <<
"[Zfitter]: Exception when fitting...";
606 stats[3] = rmsErr * rmsErr * N + rms * rms *
N;
608 R3bis->SetEntries (N);
609 R3bis->PutStats (stats);
618 int division = C1->GetNbinsX ();
619 float massMIN = C1->GetBinLowEdge (1);
620 float massMAX = C1->GetBinLowEdge (division + 1);
623 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
624 func->SetParameter (0, 1.0);
625 func->SetParName (0,
"const");
626 func->SetParameter (1, 95.0);
627 func->SetParName (1,
"mean");
628 func->SetParameter (2, 5.0);
629 func->SetParName (2,
"sigma");
632 S1->GetStats (stats);
636 N = C1->GetEntries ();
643 C1->Fit (
"mygauss",
"QR");
644 if ((func->GetNDF () != 0))
646 Chi2 = fabs (func->GetChisquare ()) / fabs (func->GetNDF ());
651 if (N == 0 || Chi2 < 0 || NDF < 0)
661 edm::LogError (
"ZFitter") <<
"[Zfitter]: Exception when fitting...";
670 stats[3] = NDF * NDF * N + Chi2 * Chi2 *
N;
673 S1->PutStats (stats);
681 int division = C2->GetNbinsX ();
682 float massMIN = C2->GetBinLowEdge (1);
683 float massMAX = C2->GetBinLowEdge (division + 1);
686 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
687 func->SetParameter (0, 1.0);
688 func->SetParName (0,
"const");
689 func->SetParameter (1, 95.0);
690 func->SetParName (1,
"mean");
691 func->SetParameter (2, 5.0);
692 func->SetParName (2,
"sigma");
695 S2->GetStats (stats);
699 N = C2->GetEntries ();
705 C2->Fit (
"mygauss",
"QR");
706 if (func->GetNDF () != 0)
708 Chi2 = fabs (func->GetChisquare ()) / fabs (func->GetNDF ());
713 if (N == 0 || Chi2 < 0 || NDF < 0)
723 edm::LogError (
"ZFitter") <<
"[Zfitter]: Exception when fitting...";
732 stats[3] = NDF * NDF * N + Chi2 * Chi2 *
N;
735 S2->PutStats (stats);
742 int division = C3->GetNbinsX ();
743 float massMIN = C3->GetBinLowEdge (1);
744 float massMAX = C3->GetBinLowEdge (division + 1);
747 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
748 func->SetParameter (0, 1.0);
749 func->SetParName (0,
"const");
750 func->SetParameter (1, 95.0);
751 func->SetParName (1,
"mean");
752 func->SetParameter (2, 5.0);
753 func->SetParName (2,
"sigma");
756 S3->GetStats (stats);
760 N = C3->GetEntries ();
766 C3->Fit (
"mygauss",
"QR");
767 if ((func->GetNDF () != 0))
769 Chi2 = fabs (func->GetChisquare ()) / fabs (func->GetNDF ());
775 if (N == 0 || Chi2 < 0 || NDF < 0)
785 edm::LogError (
"ZFitter") <<
"[Zfitter]: Exception when fitting...";
794 stats[3] = NDF * NDF * N + Chi2 * Chi2 *
N;
797 S3->PutStats (stats);
824 descriptions.addDefault (desc);
MonitorElement * h_e1_phi
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * h_fitres1Chi2
MonitorElement * h_fitres2
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
MonitorElement * h_ee_invMass_EE
MonitorElement * h_ee_invMass
MonitorElement * h_ee_invMass_EB
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * h_95_ee_invMass_EE
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
#define DEFINE_FWK_MODULE(type)
MonitorElement * h_e2_phi
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
Double_t mybw(Double_t *x, Double_t *par)
virtual void endRun(edm::Run const &, edm::EventSetup const &)
MonitorElement * h_e1_eta
MonitorElement * h_fitres1
Double_t mygauss(Double_t *x, Double_t *par)
MonitorElement * h_ee_invMass_BB
MonitorElement * h_95_ee_invMass_BB
MonitorElement * h_fitres2Chi2
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
MonitorElement * h_95_ee_invMass_EB
MonitorElement * h_fitres3Chi2
MonitorElement * h_fitres2bis
MonitorElement * h_e2_eta
MonitorElement * h_fitres3
MonitorElement * h_fitres3bis
TH1F * getTH1F(void) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
EcalZmassClient(const edm::ParameterSet &)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * h_fitres1bis