36 Double_t
mybw(Double_t*, Double_t*);
37 Double_t
mygauss(Double_t*, Double_t*);
76 _ibooker.
book1D (
"Gaussian mean WP80 EB-EB",
77 "Gaussian mean WP80 EB-EB", 1, 0, 1);
79 _ibooker.
book1D (
"Gaussian sigma WP80 EB-EB",
80 "Gaussian sigma WP80 EB-EB", 1, 0, 1);
82 _ibooker.
book1D (
"Gaussian Chi2 result over NDF WP80 EB-EB",
83 "Gaussian Chi2 result over NDF WP80 EB-EB", 1, 0, 1);
86 _ibooker.
book1D (
"Gaussian mean WP80 EB-EE",
87 "Gaussian mean result WP80 EB-EE", 1, 0, 1);
89 _ibooker.
book1D (
"Gaussian sigma WP80 EB-EE",
90 "Gaussian sigma WP80 EB-EE", 1, 0, 1);
92 _ibooker.
book1D (
"Gaussian Chi2 result over NDF WP80 EB-EE",
93 "Gaussian Chi2 result over NDF WP80 EB-EE", 1, 0, 1);
96 _ibooker.
book1D (
"Gaussian mean WP80 EE-EE",
97 "Gaussian mean WP80 EE-EE", 1, 0, 1);
99 _ibooker.
book1D (
"Gaussian sigma WP80 EE-EE",
100 "Gaussian sigma WP80 EE-EE", 1, 0, 1);
102 _ibooker.
book1D (
"Gaussian Chi2 result over NDF WP80 EE-EE",
103 "Gaussian Chi2 result over NDF WP80 EE-EE", 1, 0, 1);
105 LogTrace (
"EwkAnalyzer") <<
"Parameters initialization";
114 TH1F *R1 = h_fitres1->
getTH1F ();
115 int division = B->GetNbinsX ();
116 float massMIN = B->GetBinLowEdge (1);
117 float massMAX = B->GetBinLowEdge (division + 1);
120 TF1 *
func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
121 func->SetParameter (0, 1.0);
122 func->SetParName (0,
"const");
123 func->SetParameter (1, 95.0);
124 func->SetParName (1,
"mean");
125 func->SetParameter (2, 5.0);
126 func->SetParName (2,
"sigma");
129 R1->GetStats (stats);
133 N = B->GetEntries ();
140 B->Fit (
"mygauss",
"QR");
141 mean =
std::abs (func->GetParameter (1));
142 sigma =
std::abs (func->GetParError (1));
145 if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20)
164 stats[3] = sigma * sigma * N + mean * mean *
N;
167 R1->PutStats (stats);
173 TH1F *R1bis = h_fitres1bis->
getTH1F ();
174 int division = Bbis->GetNbinsX ();
175 float massMIN = Bbis->GetBinLowEdge (1);
176 float massMAX = Bbis->GetBinLowEdge (division + 1);
179 TF1 *
func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
180 func->SetParameter (0, 1.0);
181 func->SetParName (0,
"const");
182 func->SetParameter (1, 95.0);
183 func->SetParName (1,
"mean");
184 func->SetParameter (2, 5.0);
185 func->SetParName (2,
"sigma");
188 R1bis->GetStats (stats);
192 N = Bbis->GetEntries ();
199 Bbis->Fit (
"mygauss",
"QR");
200 rms =
std::abs (func->GetParameter (2));
201 rmsErr =
std::abs (func->GetParError (2));
204 if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50)
223 stats[3] = rmsErr * rmsErr * N + rms * rms *
N;
225 R1bis->SetEntries (N);
226 R1bis->PutStats (stats);
233 TH1F *R2 = h_fitres2->
getTH1F ();
234 int division = E->GetNbinsX ();
235 float massMIN = E->GetBinLowEdge (1);
236 float massMAX = E->GetBinLowEdge (division + 1);
239 TF1 *
func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
240 func->SetParameter (0, 1.0);
241 func->SetParName (0,
"const");
242 func->SetParameter (1, 95.0);
243 func->SetParName (1,
"mean");
244 func->SetParameter (2, 5.0);
245 func->SetParName (2,
"sigma");
248 R2->GetStats (stats);
252 N = E->GetEntries ();
258 E->Fit (
"mygauss",
"QR");
259 mean =
std::abs (func->GetParameter (1));
260 sigma =
std::abs (func->GetParError (1));
263 if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20)
283 stats[3] = sigma * sigma * N + mean * mean *
N;
286 R2->PutStats (stats);
293 TH1F *R2bis = h_fitres2bis->
getTH1F ();
294 int division = Ebis->GetNbinsX ();
295 float massMIN = Ebis->GetBinLowEdge (1);
296 float massMAX = Ebis->GetBinLowEdge (division + 1);
299 TF1 *
func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
300 func->SetParameter (0, 1.0);
301 func->SetParName (0,
"const");
302 func->SetParameter (1, 95.0);
303 func->SetParName (1,
"mean");
304 func->SetParameter (2, 5.0);
305 func->SetParName (2,
"sigma");
308 R2bis->GetStats (stats);
312 N = Ebis->GetEntries ();
319 Ebis->Fit (
"mygauss",
"QR");
320 rms =
std::abs (func->GetParameter (2));
321 rmsErr =
std::abs (func->GetParError (2));
324 if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50)
343 stats[3] = rmsErr * rmsErr * N + rms * rms *
N;
345 R2bis->SetEntries (N);
346 R2bis->PutStats (stats);
352 TH1F *R3 = h_fitres3->
getTH1F ();
354 int division = M->GetNbinsX ();
355 float massMIN = M->GetBinLowEdge (1);
356 float massMAX = M->GetBinLowEdge (division + 1);
359 TF1 *
func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
360 func->SetParameter (0, 1.0);
361 func->SetParName (0,
"const");
362 func->SetParameter (1, 95.0);
363 func->SetParName (1,
"mean");
364 func->SetParameter (2, 5.0);
365 func->SetParName (2,
"sigma");
368 R3->GetStats (stats);
372 N = M->GetEntries ();
380 M->Fit (
"mygauss",
"QR");
381 mean =
std::abs (func->GetParameter (1));
382 sigma =
std::abs (func->GetParError (1));
384 if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20)
403 stats[3] = sigma * sigma * N + mean * mean *
N;
406 R3->PutStats (stats);
413 TH1F *R3bis = h_fitres3bis->
getTH1F ();
414 int division = Mbis->GetNbinsX ();
415 float massMIN = Mbis->GetBinLowEdge (1);
416 float massMAX = Mbis->GetBinLowEdge (division + 1);
419 TF1 *
func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
420 func->SetParameter (0, 1.0);
421 func->SetParName (0,
"const");
422 func->SetParameter (1, 95.0);
423 func->SetParName (1,
"mean");
424 func->SetParameter (2, 5.0);
425 func->SetParName (2,
"sigma");
428 R3bis->GetStats (stats);
432 N = Mbis->GetEntries ();
439 Mbis->Fit (
"mygauss",
"QR");
440 rms =
std::abs (func->GetParameter (2));
441 rmsErr =
std::abs (func->GetParError (2));
444 if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50)
463 stats[3] = rmsErr * rmsErr * N + rms * rms *
N;
465 R3bis->SetEntries (N);
466 R3bis->PutStats (stats);
474 TH1F *S1 = h_fitres1Chi2->
getTH1F ();
475 int division = C1->GetNbinsX ();
476 float massMIN = C1->GetBinLowEdge (1);
477 float massMAX = C1->GetBinLowEdge (division + 1);
480 TF1 *
func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
481 func->SetParameter (0, 1.0);
482 func->SetParName (0,
"const");
483 func->SetParameter (1, 95.0);
484 func->SetParName (1,
"mean");
485 func->SetParameter (2, 5.0);
486 func->SetParName (2,
"sigma");
489 S1->GetStats (stats);
493 N = C1->GetEntries ();
500 C1->Fit (
"mygauss",
"QR");
501 if ((func->GetNDF () != 0))
508 if (N == 0 || Chi2 < 0 || NDF < 0)
527 stats[3] = NDF * NDF * N + Chi2 * Chi2 *
N;
530 S1->PutStats (stats);
537 TH1F *S2 = h_fitres2Chi2->
getTH1F ();
538 int division = C2->GetNbinsX ();
539 float massMIN = C2->GetBinLowEdge (1);
540 float massMAX = C2->GetBinLowEdge (division + 1);
543 TF1 *
func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
544 func->SetParameter (0, 1.0);
545 func->SetParName (0,
"const");
546 func->SetParameter (1, 95.0);
547 func->SetParName (1,
"mean");
548 func->SetParameter (2, 5.0);
549 func->SetParName (2,
"sigma");
552 S2->GetStats (stats);
556 N = C2->GetEntries ();
562 C2->Fit (
"mygauss",
"QR");
563 if (func->GetNDF () != 0)
570 if (N == 0 || Chi2 < 0 || NDF < 0)
589 stats[3] = NDF * NDF * N + Chi2 * Chi2 *
N;
592 S2->PutStats (stats);
598 TH1F *S3 = h_fitres3Chi2->
getTH1F ();
599 int division = C3->GetNbinsX ();
600 float massMIN = C3->GetBinLowEdge (1);
601 float massMAX = C3->GetBinLowEdge (division + 1);
604 TF1 *
func =
new TF1 (
"mygauss",
mygauss, massMIN, massMAX, 3);
605 func->SetParameter (0, 1.0);
606 func->SetParName (0,
"const");
607 func->SetParameter (1, 95.0);
608 func->SetParName (1,
"mean");
609 func->SetParameter (2, 5.0);
610 func->SetParName (2,
"sigma");
613 S3->GetStats (stats);
617 N = C3->GetEntries ();
623 C3->Fit (
"mygauss",
"QR");
624 if ((func->GetNDF () != 0))
632 if (N == 0 || Chi2 < 0 || NDF < 0)
651 stats[3] = NDF * NDF * N + Chi2 * Chi2 *
N;
654 S3->PutStats (stats);
662 Double_t arg1 = 14.0 / 22.0;
663 Double_t arg2 = par[1] * par[1] * par[2] * par[2];
665 ((x[0] * x[0]) - (par[1] * par[1])) * ((x[0] * x[0]) - (par[1] * par[1]));
667 x[0] * x[0] * x[0] * x[0] * ((par[2] * par[2]) / (par[1] * par[1]));
668 return par[0] * arg1 * arg2 / (arg3 + arg4);
679 arg = (x[0] - par[1]) / par[2];
680 return par[0] * TMath::Exp (-0.5 * arg * arg) / (TMath::Sqrt (2 *
TMath::Pi ()) * par[2]);
MonitorElement * get(const std::string &path)
#define DEFINE_FWK_MODULE(type)
char const * what() const override
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Double_t mybw(Double_t *, Double_t *)
MonitorElement * book1D(Args &&...args)
Abs< T >::type abs(const T &t)
static const std::string B
void setCurrentFolder(const std::string &fullpath)
TH1F * getTH1F(void) const
Double_t mygauss(Double_t *, Double_t *)
EcalZmassClient(const edm::ParameterSet &)