35 Double_t
mybw(Double_t *, Double_t *);
36 Double_t
mygauss(Double_t *, Double_t *);
52 : prefixME_(iConfig.getUntrackedParameter<
std::
string>(
"prefixME",
"")) {}
68 h_fitres1 = _ibooker.
book1D(
"Gaussian mean WP80 EB-EB",
"Gaussian mean WP80 EB-EB", 1, 0, 1);
69 h_fitres1bis = _ibooker.
book1D(
"Gaussian sigma WP80 EB-EB",
"Gaussian sigma WP80 EB-EB", 1, 0, 1);
70 h_fitres1Chi2 = _ibooker.
book1D(
71 "Gaussian Chi2 result over NDF WP80 EB-EB",
"Gaussian Chi2 result over NDF WP80 EB-EB", 1, 0, 1);
73 h_fitres3 = _ibooker.
book1D(
"Gaussian mean WP80 EB-EE",
"Gaussian mean result WP80 EB-EE", 1, 0, 1);
74 h_fitres3bis = _ibooker.
book1D(
"Gaussian sigma WP80 EB-EE",
"Gaussian sigma WP80 EB-EE", 1, 0, 1);
76 _ibooker.
book1D(
"Gaussian Chi2 result over NDF WP80 EB-EE",
"Gaussian Chi2 result over NDF WP80 EB-EE", 1, 0, 1);
78 h_fitres2 = _ibooker.
book1D(
"Gaussian mean WP80 EE-EE",
"Gaussian mean WP80 EE-EE", 1, 0, 1);
79 h_fitres2bis = _ibooker.
book1D(
"Gaussian sigma WP80 EE-EE",
"Gaussian sigma WP80 EE-EE", 1, 0, 1);
81 _ibooker.
book1D(
"Gaussian Chi2 result over NDF WP80 EE-EE",
"Gaussian Chi2 result over NDF WP80 EE-EE", 1, 0, 1);
83 LogTrace(
"EwkAnalyzer") <<
"Parameters initialization";
90 TH1F *
B =
me1->getTH1F();
91 TH1F *R1 = h_fitres1->
getTH1F();
92 int division =
B->GetNbinsX();
93 float massMIN =
B->GetBinLowEdge(1);
94 float massMAX =
B->GetBinLowEdge(division + 1);
97 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
98 func->SetParameter(0, 1.0);
99 func->SetParName(0,
"const");
100 func->SetParameter(1, 95.0);
101 func->SetParName(1,
"mean");
102 func->SetParameter(2, 5.0);
103 func->SetParName(2,
"sigma");
114 B->Fit(
"mygauss",
"QR");
119 if (
N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20) {
126 edm::LogError(
"ZFitter") <<
"[Zfitter]: Exception when fitting..." <<
e.what();
141 if (
me1 !=
nullptr) {
142 TH1F *Bbis =
me1->getTH1F();
143 TH1F *R1bis = h_fitres1bis->
getTH1F();
144 int division = Bbis->GetNbinsX();
145 float massMIN = Bbis->GetBinLowEdge(1);
146 float massMAX = Bbis->GetBinLowEdge(division + 1);
149 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
150 func->SetParameter(0, 1.0);
151 func->SetParName(0,
"const");
152 func->SetParameter(1, 95.0);
153 func->SetParName(1,
"mean");
154 func->SetParameter(2, 5.0);
155 func->SetParName(2,
"sigma");
158 R1bis->GetStats(
stats);
162 N = Bbis->GetEntries();
166 Bbis->Fit(
"mygauss",
"QR");
171 if (
N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50) {
178 edm::LogError(
"ZFitter") <<
"[Zfitter]: Exception when fitting..." <<
e.what();
189 R1bis->SetEntries(
N);
190 R1bis->PutStats(
stats);
194 if (
me2 !=
nullptr) {
195 TH1F *E =
me2->getTH1F();
196 TH1F *R2 = h_fitres2->
getTH1F();
197 int division = E->GetNbinsX();
198 float massMIN = E->GetBinLowEdge(1);
199 float massMAX = E->GetBinLowEdge(division + 1);
202 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
203 func->SetParameter(0, 1.0);
204 func->SetParName(0,
"const");
205 func->SetParameter(1, 95.0);
206 func->SetParName(1,
"mean");
207 func->SetParameter(2, 5.0);
208 func->SetParName(2,
"sigma");
219 E->Fit(
"mygauss",
"QR");
224 if (
N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20) {
231 edm::LogError(
"ZFitter") <<
"[Zfitter]: Exception when fitting..." <<
e.what();
247 if (
me2 !=
nullptr) {
248 TH1F *Ebis =
me2->getTH1F();
249 TH1F *R2bis = h_fitres2bis->
getTH1F();
250 int division = Ebis->GetNbinsX();
251 float massMIN = Ebis->GetBinLowEdge(1);
252 float massMAX = Ebis->GetBinLowEdge(division + 1);
255 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
256 func->SetParameter(0, 1.0);
257 func->SetParName(0,
"const");
258 func->SetParameter(1, 95.0);
259 func->SetParName(1,
"mean");
260 func->SetParameter(2, 5.0);
261 func->SetParName(2,
"sigma");
264 R2bis->GetStats(
stats);
268 N = Ebis->GetEntries();
272 Ebis->Fit(
"mygauss",
"QR");
277 if (
N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50) {
284 edm::LogError(
"ZFitter") <<
"[Zfitter]: Exception when fitting..." <<
e.what();
295 R2bis->SetEntries(
N);
296 R2bis->PutStats(
stats);
300 if (me3 !=
nullptr) {
301 TH1F *R3 = h_fitres3->
getTH1F();
303 int division = M->GetNbinsX();
304 float massMIN = M->GetBinLowEdge(1);
305 float massMAX = M->GetBinLowEdge(division + 1);
308 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
309 func->SetParameter(0, 1.0);
310 func->SetParName(0,
"const");
311 func->SetParameter(1, 95.0);
312 func->SetParName(1,
"mean");
313 func->SetParameter(2, 5.0);
314 func->SetParName(2,
"sigma");
325 M->Fit(
"mygauss",
"QR");
329 if (
N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20) {
336 edm::LogError(
"ZFitter") <<
"[Zfitter]: Exception when fitting..." <<
e.what();
352 if (me3 !=
nullptr) {
354 TH1F *R3bis = h_fitres3bis->
getTH1F();
355 int division = Mbis->GetNbinsX();
356 float massMIN = Mbis->GetBinLowEdge(1);
357 float massMAX = Mbis->GetBinLowEdge(division + 1);
360 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
361 func->SetParameter(0, 1.0);
362 func->SetParName(0,
"const");
363 func->SetParameter(1, 95.0);
364 func->SetParName(1,
"mean");
365 func->SetParameter(2, 5.0);
366 func->SetParName(2,
"sigma");
369 R3bis->GetStats(
stats);
373 N = Mbis->GetEntries();
377 Mbis->Fit(
"mygauss",
"QR");
382 if (
N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50) {
389 edm::LogError(
"ZFitter") <<
"[Zfitter]: Exception when fitting..." <<
e.what();
400 R3bis->SetEntries(
N);
401 R3bis->PutStats(
stats);
406 if (
me1 !=
nullptr) {
407 TH1F *C1 =
me1->getTH1F();
408 TH1F *S1 = h_fitres1Chi2->
getTH1F();
409 int division = C1->GetNbinsX();
410 float massMIN = C1->GetBinLowEdge(1);
411 float massMAX = C1->GetBinLowEdge(division + 1);
414 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
415 func->SetParameter(0, 1.0);
416 func->SetParName(0,
"const");
417 func->SetParameter(1, 95.0);
418 func->SetParName(1,
"mean");
419 func->SetParameter(2, 5.0);
420 func->SetParName(2,
"sigma");
427 N = C1->GetEntries();
431 C1->Fit(
"mygauss",
"QR");
432 if ((
func->GetNDF() != 0)) {
438 if (
N == 0 ||
Chi2 < 0 || NDF < 0) {
445 edm::LogError(
"ZFitter") <<
"[Zfitter]: Exception when fitting..." <<
e.what();
461 if (
me2 !=
nullptr) {
462 TH1F *C2 =
me2->getTH1F();
463 TH1F *S2 = h_fitres2Chi2->
getTH1F();
464 int division = C2->GetNbinsX();
465 float massMIN = C2->GetBinLowEdge(1);
466 float massMAX = C2->GetBinLowEdge(division + 1);
469 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
470 func->SetParameter(0, 1.0);
471 func->SetParName(0,
"const");
472 func->SetParameter(1, 95.0);
473 func->SetParName(1,
"mean");
474 func->SetParameter(2, 5.0);
475 func->SetParName(2,
"sigma");
482 N = C2->GetEntries();
486 C2->Fit(
"mygauss",
"QR");
487 if (
func->GetNDF() != 0) {
493 if (
N == 0 ||
Chi2 < 0 || NDF < 0) {
500 edm::LogError(
"ZFitter") <<
"[Zfitter]: Exception when fitting..." <<
e.what();
515 if (me3 !=
nullptr) {
517 TH1F *S3 = h_fitres3Chi2->
getTH1F();
518 int division = C3->GetNbinsX();
519 float massMIN = C3->GetBinLowEdge(1);
520 float massMAX = C3->GetBinLowEdge(division + 1);
523 TF1 *
func =
new TF1(
"mygauss",
mygauss, massMIN, massMAX, 3);
524 func->SetParameter(0, 1.0);
525 func->SetParName(0,
"const");
526 func->SetParameter(1, 95.0);
527 func->SetParName(1,
"mean");
528 func->SetParameter(2, 5.0);
529 func->SetParName(2,
"sigma");
536 N = C3->GetEntries();
540 C3->Fit(
"mygauss",
"QR");
541 if ((
func->GetNDF() != 0)) {
547 if (
N == 0 ||
Chi2 < 0 || NDF < 0) {
554 edm::LogError(
"ZFitter") <<
"[Zfitter]: Exception when fitting..." <<
e.what();
571 Double_t
mybw(Double_t *
x, Double_t *par) {
572 Double_t arg1 = 14.0 / 22.0;
573 Double_t arg2 = par[1] * par[1] * par[2] * par[2];
574 Double_t arg3 = ((
x[0] *
x[0]) - (par[1] * par[1])) * ((
x[0] *
x[0]) - (par[1] * par[1]));
575 Double_t arg4 =
x[0] *
x[0] *
x[0] *
x[0] * ((par[2] * par[2]) / (par[1] * par[1]));
576 return par[0] * arg1 * arg2 / (arg3 + arg4);
585 arg = (
x[0] - par[1]) / par[2];
586 return par[0] * TMath::Exp(-0.5 *
arg *
arg) / (TMath::Sqrt(2 *
TMath::Pi()) * par[2]);
virtual void setCurrentFolder(std::string const &fullpath)
~EcalZmassClient() override
Log< level::Error, false > LogError
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Double_t mybw(Double_t *, Double_t *)
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
virtual TH1F * getTH1F() const
virtual MonitorElement * get(std::string const &fullpath) const
Double_t mygauss(Double_t *, Double_t *)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
EcalZmassClient(const edm::ParameterSet &)