183 theDbe->
book1D (
"Gaussian mean WP80 EB-EB",
184 "Gaussian mean WP80 EB-EB", 1, 0, 1);
186 theDbe->
book1D (
"Gaussian sigma WP80 EB-EB",
187 "Gaussian sigma WP80 EB-EB", 1, 0, 1);
189 theDbe->
book1D (
"Gaussian Chi2 result over NDF WP80 EB-EB",
190 "Gaussian Chi2 result over NDF WP80 EB-EB", 1, 0, 1);
193 theDbe->
book1D (
"Gaussian mean WP80 EB-EE",
194 "Gaussian mean result WP80 EB-EE", 1, 0, 1);
196 theDbe->
book1D (
"Gaussian sigma WP80 EB-EE",
197 "Gaussian sigma WP80 EB-EE", 1, 0, 1);
199 theDbe->
book1D (
"Gaussian Chi2 result over NDF WP80 EB-EE",
200 "Gaussian Chi2 result over NDF WP80 EB-EE", 1, 0, 1);
203 theDbe->
book1D (
"Gaussian mean WP80 EE-EE",
204 "Gaussian mean WP80 EE-EE", 1, 0, 1);
206 theDbe->
book1D (
"Gaussian sigma WP80 EE-EE",
207 "Gaussian sigma WP80 EE-EE", 1, 0, 1);
209 theDbe->
book1D (
"Gaussian Chi2 result over NDF WP80 EE-EE",
210 "Gaussian Chi2 result over NDF WP80 EE-EE", 1, 0, 1);
218 Double_t arg1 = 14.0 / 22.0;
219 Double_t arg2 = par[1] * par[1] * par[2] * par[2];
221 ((x[0] * x[0]) - (par[1] * par[1])) * ((x[0] * x[0]) - (par[1] * par[1]));
223 x[0] * x[0] * x[0] * x[0] * ((par[2] * par[2]) / (par[1] * par[1]));
224 return par[0] * arg1 * arg2 / (arg3 + arg4);
235 arg = (x[0] - par[1]) / par[2];
236 return par[0] * TMath::Exp (-0.5 * arg * arg) / (TMath::Sqrt (2 *
TMath::Pi ()) * par[2]);
248 LogTrace (
"EwkAnalyzer") <<
"Parameters initialization";
259 int division = B->GetNbinsX ();
260 float massMIN = B->GetBinLowEdge (1);
261 float massMAX = B->GetBinLowEdge (division + 1);
264 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
265 func->SetParameter (0, 1.0);
266 func->SetParName (0,
"const");
267 func->SetParameter (1, 95.0);
268 func->SetParName (1,
"mean");
269 func->SetParameter (2, 5.0);
270 func->SetParName (2,
"sigma");
273 R1->GetStats (stats);
277 N = B->GetEntries ();
284 B->Fit (
"mygauss",
"QR");
285 mean = fabs (func->GetParameter (1));
286 sigma = fabs (func->GetParError (1));
289 if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20)
308 stats[3] = sigma * sigma * N + mean * mean *
N;
311 R1->PutStats (stats);
318 int division = Bbis->GetNbinsX ();
319 float massMIN = Bbis->GetBinLowEdge (1);
320 float massMAX = Bbis->GetBinLowEdge (division + 1);
323 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
324 func->SetParameter (0, 1.0);
325 func->SetParName (0,
"const");
326 func->SetParameter (1, 95.0);
327 func->SetParName (1,
"mean");
328 func->SetParameter (2, 5.0);
329 func->SetParName (2,
"sigma");
332 R1bis->GetStats (stats);
336 N = Bbis->GetEntries ();
343 Bbis->Fit (
"mygauss",
"QR");
344 rms = fabs (func->GetParameter (2));
345 rmsErr = fabs (func->GetParError (2));
348 if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50)
367 stats[3] = rmsErr * rmsErr * N + rms * rms *
N;
369 R1bis->SetEntries (N);
370 R1bis->PutStats (stats);
378 int division = E->GetNbinsX ();
379 float massMIN = E->GetBinLowEdge (1);
380 float massMAX = E->GetBinLowEdge (division + 1);
383 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
384 func->SetParameter (0, 1.0);
385 func->SetParName (0,
"const");
386 func->SetParameter (1, 95.0);
387 func->SetParName (1,
"mean");
388 func->SetParameter (2, 5.0);
389 func->SetParName (2,
"sigma");
392 R2->GetStats (stats);
396 N = E->GetEntries ();
402 E->Fit (
"mygauss",
"QR");
403 mean = fabs (func->GetParameter (1));
404 sigma = fabs (func->GetParError (1));
407 if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20)
427 stats[3] = sigma * sigma * N + mean * mean *
N;
430 R2->PutStats (stats);
438 int division = Ebis->GetNbinsX ();
439 float massMIN = Ebis->GetBinLowEdge (1);
440 float massMAX = Ebis->GetBinLowEdge (division + 1);
443 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
444 func->SetParameter (0, 1.0);
445 func->SetParName (0,
"const");
446 func->SetParameter (1, 95.0);
447 func->SetParName (1,
"mean");
448 func->SetParameter (2, 5.0);
449 func->SetParName (2,
"sigma");
452 R2bis->GetStats (stats);
456 N = Ebis->GetEntries ();
463 Ebis->Fit (
"mygauss",
"QR");
464 rms = fabs (func->GetParameter (2));
465 rmsErr = fabs (func->GetParError (2));
468 if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50)
487 stats[3] = rmsErr * rmsErr * N + rms * rms *
N;
489 R2bis->SetEntries (N);
490 R2bis->PutStats (stats);
498 int division = M->GetNbinsX ();
499 float massMIN = M->GetBinLowEdge (1);
500 float massMAX = M->GetBinLowEdge (division + 1);
503 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
504 func->SetParameter (0, 1.0);
505 func->SetParName (0,
"const");
506 func->SetParameter (1, 95.0);
507 func->SetParName (1,
"mean");
508 func->SetParameter (2, 5.0);
509 func->SetParName (2,
"sigma");
512 R3->GetStats (stats);
516 N = M->GetEntries ();
524 M->Fit (
"mygauss",
"QR");
525 mean = fabs (func->GetParameter (1));
526 sigma = fabs (func->GetParError (1));
528 if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20)
547 stats[3] = sigma * sigma * N + mean * mean *
N;
550 R3->PutStats (stats);
558 int division = Mbis->GetNbinsX ();
559 float massMIN = Mbis->GetBinLowEdge (1);
560 float massMAX = Mbis->GetBinLowEdge (division + 1);
563 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
564 func->SetParameter (0, 1.0);
565 func->SetParName (0,
"const");
566 func->SetParameter (1, 95.0);
567 func->SetParName (1,
"mean");
568 func->SetParameter (2, 5.0);
569 func->SetParName (2,
"sigma");
572 R3bis->GetStats (stats);
576 N = Mbis->GetEntries ();
583 Mbis->Fit (
"mygauss",
"QR");
584 rms = fabs (func->GetParameter (2));
585 rmsErr = fabs (func->GetParError (2));
588 if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50)
607 stats[3] = rmsErr * rmsErr * N + rms * rms *
N;
609 R3bis->SetEntries (N);
610 R3bis->PutStats (stats);
619 int division = C1->GetNbinsX ();
620 float massMIN = C1->GetBinLowEdge (1);
621 float massMAX = C1->GetBinLowEdge (division + 1);
624 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
625 func->SetParameter (0, 1.0);
626 func->SetParName (0,
"const");
627 func->SetParameter (1, 95.0);
628 func->SetParName (1,
"mean");
629 func->SetParameter (2, 5.0);
630 func->SetParName (2,
"sigma");
633 S1->GetStats (stats);
637 N = C1->GetEntries ();
644 C1->Fit (
"mygauss",
"QR");
645 if ((func->GetNDF () != 0))
647 Chi2 = fabs (func->GetChisquare ()) / fabs (func->GetNDF ());
652 if (N == 0 || Chi2 < 0 || NDF < 0)
671 stats[3] = NDF * NDF * N + Chi2 * Chi2 *
N;
674 S1->PutStats (stats);
682 int division = C2->GetNbinsX ();
683 float massMIN = C2->GetBinLowEdge (1);
684 float massMAX = C2->GetBinLowEdge (division + 1);
687 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
688 func->SetParameter (0, 1.0);
689 func->SetParName (0,
"const");
690 func->SetParameter (1, 95.0);
691 func->SetParName (1,
"mean");
692 func->SetParameter (2, 5.0);
693 func->SetParName (2,
"sigma");
696 S2->GetStats (stats);
700 N = C2->GetEntries ();
706 C2->Fit (
"mygauss",
"QR");
707 if (func->GetNDF () != 0)
709 Chi2 = fabs (func->GetChisquare ()) / fabs (func->GetNDF ());
714 if (N == 0 || Chi2 < 0 || NDF < 0)
733 stats[3] = NDF * NDF * N + Chi2 * Chi2 *
N;
736 S2->PutStats (stats);
743 int division = C3->GetNbinsX ();
744 float massMIN = C3->GetBinLowEdge (1);
745 float massMAX = C3->GetBinLowEdge (division + 1);
748 TF1 *func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
749 func->SetParameter (0, 1.0);
750 func->SetParName (0,
"const");
751 func->SetParameter (1, 95.0);
752 func->SetParName (1,
"mean");
753 func->SetParameter (2, 5.0);
754 func->SetParName (2,
"sigma");
757 S3->GetStats (stats);
761 N = C3->GetEntries ();
767 C3->Fit (
"mygauss",
"QR");
768 if ((func->GetNDF () != 0))
770 Chi2 = fabs (func->GetChisquare ()) / fabs (func->GetNDF ());
776 if (N == 0 || Chi2 < 0 || NDF < 0)
795 stats[3] = NDF * NDF * N + Chi2 * Chi2 *
N;
798 S3->PutStats (stats);
825 descriptions.addDefault (desc);
MonitorElement * h_e1_phi
virtual char const * what() const
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