97 void plotMaker(TString histoName, TString typeOfplot,
98 vector<TString>
file, vector<TString>
type,
102 double METCut,
double I,
double dI,
double Fz,
double dFz,
103 double FzP,
double dFzP,
double ewkerror,
106 double Trionym(
double a,
double b,
double c,
double sum);
108 (
double I,
double Fz,
double FzP,
double K,
double ewk,
109 double Na_,
double Nb_,
double Nc_,
double Nd_,
110 double Ea_,
double Eb_,
double Ec_,
double Ed_);
134 ifstream
input(
"inputFiles");
136 TString typeOfplot =
"";
137 vector<TString>
types;
138 vector<TString>
files;
141 if (input.is_open()) {
143 while (! input.eof()) {
144 getline(input, myline);
145 TString
line(myline);
150 if (i==1) typeOfplot=
line;
156 int lineSize = (
int) line.Length();
159 if(line[j] != empty) fname += line[j];
164 if(line[j] != empty) ftype += line[j];
165 else if(ftype.Length()==3)
break;
169 if(line[j] != empty) fw += line[j];
170 else{
if(fw.Length()>0)
break;}
173 if (fname.Length() == 0)
break;
174 files.push_back(fname);
175 types.push_back(ftype);
176 double w = fw.Atof();
177 weights.push_back(w);
179 std::cout << fname <<
", " << ftype <<
", "<< w << std::endl;
186 std::cout <<
"File with name inputFile was not found" << std::endl;
191 if (typeOfplot ==
"wenu") {
192 cout <<
"wenu plot maker" << endl;
196 plotMaker(
"h_met", typeOfplot, files, types, weights,
"MET (GeV)");
198 else if (typeOfplot ==
"zee"){
199 cout <<
"zee plot maker" << endl;
203 plotMaker(
"h_mee", typeOfplot, files, types, weights,
"M_{ee} (GeV)");
205 else if (typeOfplot(0,4) ==
"abcd") {
225 if (METCut<0 || (data<-0.7 && mc<-0.7 && mcOnly<-0.7)) {
226 cout <<
"Error in your configurtion!" << endl;
227 if (METCut <0)
cout <<
"Error in MET Cut" << endl;
228 else cout <<
"You need to specify one mc or data or mcOnly" 232 if (mc>-0.7 && mc <0 && ewkerror<0) {
233 cout <<
"You have specified mc option, but you have forgotten" 234 <<
" to set the ewkerror!" << endl;
240 cout <<
"doing ABCD with input: " << typeOfplot << endl;
241 abcd(files, types, weights, METCut, I, dI, Fz, dFz, FzP, dFzP,
242 ewkerror, data, mc, mcOnly);
252 double METCut,
double I,
double dI,
double Fz,
double dFz,
253 double FzP,
double dFzP,
double ewkerror,
257 gROOT->ProcessLine(
".L tdrstyle.C");
258 gROOT->ProcessLine(
"setTDRStyle()");
260 std::cout <<
"Trying ABCD method for Background subtration" << std::endl;
263 TString histoName_Ba(
"h_met_EB");
264 TString histoName_Bb(
"h_met_inverse_EB");
265 TString histoName_Ea(
"h_met_EE");
266 TString histoName_Eb(
"h_met_inverse_EE");
269 int fmax = (
int) file.size();
270 int NBins = 0;
double min = 0;
double max = -1;
271 for (
int i=0;
i<fmax; ++
i) {
275 TH1F *
h = (TH1F*) f.Get(histoName_Ba);
276 NBins = h->GetNbinsX();
277 min = h->GetBinLowEdge(1);
278 max = h->GetBinLowEdge(NBins+1);
282 if (NBins ==0 || (max<min)) {
283 std::cout <<
"PlotCombiner::abcd error: Could not find valid histograms in file" 287 cout <<
"Histograms with "<< NBins <<
" bins and range " << min <<
"-" << max << endl;
290 TH1F h_wenu(
"h_wenu",
"h_wenu", NBins, min, max);
291 TH1F h_wenu_inv(
"h_wenu_inv",
"h_wenu_inv", NBins, min, max);
292 for (
int i=0;
i<fmax; ++
i) {
293 if (type[
i] ==
"sig" && weight[
i]>0 ) {
296 TH1F *h_ba = (TH1F*) f.Get(histoName_Ba);
297 h_wenu.Add(h_ba, weight[i]);
298 TH1F *h_ea = (TH1F*) f.Get(histoName_Ea);
299 h_wenu.Add(h_ea, weight[i]);
301 TH1F *h_bb = (TH1F*) f.Get(histoName_Bb);
302 h_wenu_inv.Add(h_bb, weight[i]);
303 TH1F *h_eb = (TH1F*) f.Get(histoName_Eb);
304 h_wenu_inv.Add(h_eb, weight[i]);
308 TH1F h_qcd(
"h_qcd",
"h_qcd", NBins, min, max);
309 TH1F h_qcd_inv(
"h_qcd_inv",
"h_qcd_inv", NBins, min, max);
310 for (
int i=0;
i<fmax; ++
i) {
311 if ((type[
i] ==
"qcd" || type[
i] ==
"bce" 312 || type[
i] ==
"gje") && weight[
i]>0) {
315 TH1F *h_ba = (TH1F*) f.Get(histoName_Ba);
316 h_qcd.Add(h_ba, weight[i]);
317 TH1F *h_ea = (TH1F*) f.Get(histoName_Ea);
318 h_qcd.Add(h_ea, weight[i]);
320 TH1F *h_bb = (TH1F*) f.Get(histoName_Bb);
321 h_qcd_inv.Add(h_bb, weight[i]);
322 TH1F *h_eb = (TH1F*) f.Get(histoName_Eb);
323 h_qcd_inv.Add(h_eb, weight[i]);
327 TH1F h_ewk(
"h_ewk",
"h_ewk", NBins, min, max);
328 TH1F h_ewk_inv(
"h_ewk_inv",
"h_ewk_inv", NBins, min, max);
329 for (
int i=0;
i<fmax; ++
i) {
330 if ( type[
i] ==
"ewk" && weight[
i]>0) {
333 TH1F *h_ba = (TH1F*) f.Get(histoName_Ba);
334 h_ewk.Add(h_ba, weight[i]);
335 TH1F *h_ea = (TH1F*) f.Get(histoName_Ea);
336 h_ewk.Add(h_ea, weight[i]);
338 TH1F *h_bb = (TH1F*) f.Get(histoName_Bb);
339 h_ewk_inv.Add(h_bb, weight[i]);
340 TH1F *h_eb = (TH1F*) f.Get(histoName_Eb);
341 h_ewk_inv.Add(h_eb, weight[i]);
349 int IMET =
int ((METCut - min)/(max-min) *
double(NBins));
351 double metCalc = min + (max-
min)*
double(IMET)/double(NBins);
352 if (metCalc < METCut || metCalc > METCut) {
353 std::cout <<
"PlotCombiner:abcd: your MET Cut is not in low egde bin position" 356 cout <<
"MET Cut in " << METCut <<
"GeV corresponds to bin #" << IMET << endl;
359 double a_sig = h_wenu.Integral(IMET,NBins+1);
360 double b_sig = h_wenu.Integral(0,IMET-1);
361 double c_sig = h_wenu_inv.Integral(0,IMET-1);
362 double d_sig = h_wenu_inv.Integral(IMET,NBins+1);
364 double a_qcd = h_qcd.Integral(IMET,NBins+1);
365 double b_qcd = h_qcd.Integral(0,IMET-1);
366 double c_qcd = h_qcd_inv.Integral(0,IMET-1);
367 double d_qcd = h_qcd_inv.Integral(IMET,NBins+1);
369 double a_ewk = h_ewk.Integral(IMET,NBins+1);
370 double b_ewk = h_ewk.Integral(0,IMET-1);
371 double c_ewk = h_ewk_inv.Integral(0,IMET-1);
372 double d_ewk = h_ewk_inv.Integral(IMET,NBins+1);
377 if (data < 0 && data >-0.75) {
380 std::cout <<
"Calculating ABCD Result and Stat Error Assuming DATA" 381 << std::endl <<
"Summary: in this implementation we have assumed" 382 <<
" that what real 'data' appear with type sig in the input" 383 << std::endl <<
"No systematics available with this type of" 384 <<
" calculation. If you need systematics try one of the other" 385 <<
" options" << std::endl;
386 double A = (1.0-
I)*(FzP-Fz);
387 double B = I*(FzP+1.0)*(FzP*(c_sig-c_ewk)-(d_sig-d_ewk)) +
388 (1+Fz)*(1-
I)*((a_sig-a_ewk)-dFzP*(b_sig-b_ewk));
389 double C = I*(1.+Fz)*(1.+FzP)*((d_sig-d_ewk)*(b_sig-b_ewk) - (a_sig-a_ewk)*(c_sig-c_ewk));
392 double S =
Trionym(A,B,C, a_sig+b_sig);
396 double ApI=0, ApFz=0, ApFzP=0, ApNa=0, ApNb=0, ApNc=0, ApNd=0;
397 double BpI=0, BpFz=0, BpFzP=0, BpNa=0, BpNb=0, BpNc=0, BpNd=0;
398 double CpI=0, CpFz=0, CpFzP=0, CpNa=0, CpNb=0, CpNc=0, CpNd=0;
399 double SpI=0, SpFz=0, SpFzP=0, SpNa=0, SpNb=0, SpNc=0, SpNd=0;
401 double Na = a_sig, Nb = b_sig, Nc=c_sig, Nd = d_sig;
402 double Ea = a_ewk, Eb = b_ewk, Ec=c_ewk, Ed = d_ewk;
413 BpI = (FzP+1.0)*(Fz*(Nc-Ec)-(Nd-Ed))-(1.0+Fz)*((Na-Ea)-FzP*(Nb-Eb));
414 BpFz = I*(FzP+1.0)*(Nc-Ec)+(1.0-I)*((Na-Ea)-FzP*(Nb-Eb));
415 BpFzP = I*(Fz*(Nc-Ec)-(Nd-Ed))-(1.0-I)*(1.0+Fz)*(Nb-Eb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ec)-(Nd-Ed))-(1.0+Fz)*((Na-Ea)-FzP*(Nb-Eb));
439 BpFz = I*(FzP+1.0)*(Nc-Ec)+(1.0-I)*((Na-Ea)-FzP*(Nb-Eb));
440 BpFzP = I*(Fz*(Nc-Ec)-(Nd-Ed))-(1.0-I)*(1.0+Fz)*(Nb-Eb);
441 BpNa = (1.0-
I)*(1.0+Fz);
442 BpNb = -(1.0-
I)*(1.0+Fz)*FzP;
443 BpNc = I*(FzP+1.0)*Fz;
446 CpI = (1.0+Fz)*(1.0+FzP)*((Nd-Ed)*(Nb-Eb)-(Na-Ea)*(Nc-Ec));
447 CpFz = I*(1.0+FzP)*((Nd-Ed)*(Nb-Eb)-(Na-Ea)*(Nc-Ec));
448 CpFzP = I*(1.0+Fz)*((Nd-Ed)*(Nb-Eb)-(Na-Ea)*(Nc-Ec));
449 CpNa = -I*(1.0+Fz)*(1.0+FzP)*(Nc-Ec);
450 CpNb = I*(1.0+Fz)*(1.0+FzP)*(Nd-Ed);
451 CpNc = -I*(1.0+Fz)*(1.0+FzP)*(Na-Ea);
452 CpNd = I*(1.0+Fz)*(1.0+FzP)*(Nb-Eb);
454 SpI = -CpI/B+C*BpI/(B*
B);
455 SpFz = -CpFz/B+C*BpFz/(B*
B);
456 SpFzP = -CpFzP/B+C*BpFzP/(B*
B);
457 SpNa = -CpNa/B+C*BpNa/(B*
B);
458 SpNb = -CpNb/B+C*BpNb/(B*
B);
459 SpNc = -CpNc/B+C*BpNc/(B*
B);
460 SpNd = -CpNd/B+C*BpNd/(B*
B);
463 DS =
sqrt( SpI*dI*SpI*dI + SpFz*dFz*SpFz*dFz + SpFzP*dFzP*SpFzP*dFzP +
464 SpNa*SpNa*Na + SpNb*SpNb*Nb + SpNc*SpNc*Nc + SpNd*SpNd*Nd );
466 cout <<
"********************************************************" << endl;
467 cout <<
"Signal Prediction: " << S <<
"+-" << DS <<
"(stat)" << endl;
468 cout <<
"********************************************************" << endl;
469 cout <<
"Parameters used in calculation: " << endl;
470 cout <<
"I= " << I <<
"+-" << dI << endl;
471 cout <<
"Fz= " << Fz <<
"+-" << dFz << endl;
472 cout <<
"FzP=" << FzP <<
"+-" << dFzP << endl;
474 cout <<
"ABCD Regions population:" << endl;
475 cout <<
"A: N=" << Na <<
", sig=" << a_sig <<
", qcd=" << a_qcd
476 <<
", ewk=" << a_ewk << endl;
477 cout <<
"B: N=" << Nb <<
", sig=" << b_sig <<
", qcd=" << b_qcd
478 <<
", ewk=" << b_ewk << endl;
479 cout <<
"C: N=" << Nc <<
", sig=" << c_sig <<
", qcd=" << c_qcd
480 <<
", ewk=" << c_ewk << endl;
481 cout <<
"D: N=" << Nd <<
", sig=" << d_sig <<
", qcd=" << d_qcd
482 <<
", ewk=" << d_ewk << endl;
485 cout <<
"Statistical Error Summary: " << endl;
486 cout <<
"due to Fz = "<< SpFz*dFz<<
", ("<<SpFz*dFz*100./S <<
"%)"<< endl;
487 cout <<
"due to FzP= "<< SpFzP*dFzP
488 <<
", ("<<SpFzP*dFzP*100./S <<
"%)"<< endl;
489 cout <<
"due to I = "<< SpI*dI
490 <<
", ("<<SpI*dI*100./S <<
"%)"<< endl;
491 cout <<
"due to Na = "<< SpNa*
sqrt(Na)
492 <<
", ("<< SpNa*
sqrt(Na)*100./S <<
"%)"<< endl;
493 cout <<
"due to Nb = "<< SpNb*
sqrt(Nb)
494 <<
", ("<< SpNb*
sqrt(Nb)*100./S <<
"%)"<< endl;
495 cout <<
"due to Nc = "<< SpNc*
sqrt(Nc)
496 <<
", ("<< SpNc*
sqrt(Nc)*100./S <<
"%)"<< endl;
497 cout <<
"due to Nd = "<< SpNd*
sqrt(Nd)
498 <<
", ("<< SpNd*
sqrt(Nd)*100./S <<
"%)"<< endl;
499 cout <<
"Total Statistical Error: " 500 << DS <<
", (" << DS*100./S <<
"%)"<< endl;
501 cout <<
"Stat Error percentages are wrt S prediction, not S mc" << endl;
508 if (mc < 0 && mc >-0.75) {
512 double A = (1.0-
I)*(FzP-Fz);
513 double B = I*(FzP+1.0)*(FzP*(c_sig+c_qcd)-(d_sig+d_qcd)) +
514 (1+Fz)*(1-
I)*((a_sig+a_qcd)-dFzP*(b_sig+b_qcd));
515 double C = I*(1.+Fz)*(1.+FzP)*((d_sig+d_qcd)*(b_sig+b_qcd) -
516 (a_sig+a_qcd)*(c_sig+c_qcd));
519 double S =
Trionym(A,B,C, a_sig+b_sig);
521 double ApI=0, ApFz=0, ApFzP=0, ApNa=0, ApNb=0, ApNc=0, ApNd=0;
522 double BpI=0, BpFz=0, BpFzP=0, BpNa=0, BpNb=0, BpNc=0, BpNd=0;
523 double CpI=0, CpFz=0, CpFzP=0, CpNa=0, CpNb=0, CpNc=0, CpNd=0;
524 double SpI=0, SpFz=0, SpFzP=0, SpNa=0, SpNb=0, SpNc=0, SpNd=0;
526 double Na = a_sig+a_qcd+a_ewk, Nb = b_sig+b_qcd+b_ewk;
527 double Nc=c_sig+c_qcd+c_ewk, Nd = d_sig+d_qcd+d_ewk;
528 double Ea = a_ewk, Eb = b_ewk, Ec=c_ewk, Ed = d_ewk;
539 BpI = (FzP+1.0)*(Fz*(Nc-Ec)-(Nd-Ed))-(1.0+Fz)*((Na-Ea)-FzP*(Nb-Eb));
540 BpFz = I*(FzP+1.0)*(Nc-Ec)+(1.0-I)*((Na-Ea)-FzP*(Nb-Eb));
541 BpFzP = I*(Fz*(Nc-Ec)-(Nd-Ed))-(1.0-I)*(1.0+Fz)*(Nb-Eb);
542 BpNa = (1.0-
I)*(1.0+Fz);
543 BpNb = -(1.0-
I)*(1.0+Fz)*FzP;
544 BpNc = I*(FzP+1.0)*Fz;
547 CpI = (1.0+Fz)*(1.0+FzP)*((Nd-Ed)*(Nb-Eb)-(Na-Ea)*(Nc-Ec));
548 CpFz = I*(1.0+FzP)*((Nd-Ed)*(Nb-Eb)-(Na-Ea)*(Nc-Ec));
549 CpFzP = I*(1.0+Fz)*((Nd-Ed)*(Nb-Eb)-(Na-Ea)*(Nc-Ec));
550 CpNa = -I*(1.0+F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Ed)*(Nb-Eb)-(Na-Ea)*(Nc-Ec));
573 CpFz = I*(1.0+FzP)*((Nd-Ed)*(Nb-Eb)-(Na-Ea)*(Nc-Ec));
574 CpFzP = I*(1.0+Fz)*((Nd-Ed)*(Nb-Eb)-(Na-Ea)*(Nc-Ec));
575 CpNa = -I*(1.0+Fz)*(1.0+FzP)*(Nc-Ec);
576 CpNb = I*(1.0+Fz)*(1.0+FzP)*(Nd-Ed);
577 CpNc = -I*(1.0+Fz)*(1.0+FzP)*(Na-Ea);
578 CpNd = I*(1.0+Fz)*(1.0+FzP)*(Nb-Eb);
580 SpI = -CpI/B+C*BpI/(B*
B);
581 SpFz = -CpFz/B+C*BpFz/(B*
B);
582 SpFzP = -CpFzP/B+C*BpFzP/(B*
B);
583 SpNa = -CpNa/B+C*BpNa/(B*
B);
584 SpNb = -CpNb/B+C*BpNb/(B*
B);
585 SpNc = -CpNc/B+C*BpNc/(B*
B);
586 SpNd = -CpNd/B+C*BpNd/(B*
B);
589 DS =
sqrt( SpI*dI*SpI*dI + SpFz*dFz*SpFz*dFz + SpFzP*dFzP*SpFzP*dFzP +
590 SpNa*SpNa*Na + SpNb*SpNb*Nb + SpNc*SpNc*Nc + SpNd*SpNd*Nd );
596 double Imc = (a_sig + b_sig) / (a_sig + b_sig + c_sig + d_sig);
597 double dImc =
sqrt(Imc*(1-Imc)/(a_sig + b_sig + c_sig + d_sig));
598 double Fzmc = a_sig/b_sig;
599 double e =a_sig/(a_sig + b_sig);
600 double de =
sqrt(e*(1-e)/(a_sig + b_sig));
601 double alpha = de/(2.*Fzmc-
e);
602 double dFzmc = alpha/(1-
alpha);
603 double FzPmc = d_sig/c_sig;
604 double ep =d_sig/(c_sig + d_sig);
605 double dep =
sqrt(ep*(1-ep)/(c_sig + d_sig));
606 double alphap = dep/(2.*FzPmc-ep);
607 double dFzPmc = alphap/(1-alphap);
610 double KMC = (d_qcd/c_qcd)/(a_qcd/b_qcd);
611 double SMC = a_sig + b_sig;
613 double dfz = Fz -Fzmc;
615 double dfzp = FzP - FzPmc;
616 double fk = fabs(1-KMC);
619 double fm = 1.-ewkerror;
620 double fp = 1.+ewkerror;
621 double S_EWK_PLUS =
CalcABCD(Imc, Fzmc, FzPmc, KMC, fp, Na, Nb, Nc, Nd, Ea,Eb,Ec,Ed);
622 double S_EWK_MINUS =
CalcABCD(Imc, Fzmc, FzPmc, KMC, fm, Na, Nb, Nc, Nd, Ea,Eb,Ec,Ed);
624 double S_K=
CalcABCD(Imc, Fzmc, FzPmc, 1., 1., Na, Nb, Nc, Nd, Ea,Eb,Ec,Ed);
626 double S_FZ=
CalcABCD(Imc, Fz, FzPmc, KMC, 1., Na, Nb, Nc, Nd, Ea,Eb,Ec,Ed);
628 double S_FZP=
CalcABCD(Imc, Fzmc, FzP, KMC, 1., Na, Nb, Nc, Nd, Ea,Eb,Ec,Ed);
630 double S_I =
CalcABCD(I, Fzmc, FzPmc, KMC, 1., Na, Nb, Nc, Nd, Ea,Eb,Ec,Ed);
639 int const POINTS = 10;
640 int const allPOINTS = 2*POINTS;
641 TGraph g_ewk(allPOINTS);
642 TGraph g_fz(allPOINTS);
643 TGraph g_fzp(allPOINTS);
644 TGraph g_k(allPOINTS);
645 TGraph g_i(allPOINTS);
660 for (
int i=0;
i<POINTS; ++
i) {
661 double x_ewk = 1.-ewk_syst_min + (ewk_syst_min)*
i/POINTS;
662 double x_fz = fz_syst_min + (Fzmc-fz_syst_min)*
i/POINTS;
663 double x_fzp = fzp_syst_min + (FzPmc-fzp_syst_min)*
i/POINTS;
664 double x_k = k_syst_min + (KMC-k_syst_min)*
i/POINTS;
665 double x_i = i_syst_min + (Imc-i_syst_min)*
i/POINTS;
667 double y_ewk=
CalcABCD(Imc, Fzmc, FzPmc, KMC, x_ewk, Na, Nb, Nc, Nd, Ea,Eb,Ec,Ed);
668 double y_fz =
CalcABCD(Imc, x_fz, FzPmc, KMC, 1., Na, Nb, Nc, Nd, Ea,Eb,Ec,Ed);
669 double y_fzp=
CalcABCD(Imc, Fzmc, x_fzp, KMC, 1., Na, Nb, Nc, Nd, Ea,Eb,Ec,Ed);
670 double y_k =
CalcABCD(Imc, Fzmc, FzPmc, x_k, 1., Na, Nb, Nc, Nd, Ea,Eb,Ec,Ed);
671 double y_i =
CalcABCD(x_i, Fzmc, FzPmc, KMC, 1., Na, Nb, Nc, Nd, Ea,Eb,Ec,Ed);
673 g_ewk.SetPoint(
i,(x_ewk-1.)*100., 100.*fabs(y_ewk-SMC)/SMC);
674 g_fz.SetPoint(
i,(x_fz-Fzmc)*100./Fzmc, 100.*fabs(y_fz-SMC)/SMC);
675 g_fzp.SetPoint(
i,(x_fzp-FzPmc)*100./FzPmc, 100.*fabs(y_fzp-SMC)/SMC);
676 g_i.SetPoint(
i,(x_i-Imc)*100./Imc, 100.*fabs(y_i-SMC)/SMC);
677 g_k.SetPoint(
i,(x_k-KMC)*100./KMC, 100.*fabs(y_k-SMC)/SMC);
681 for (
int i=0;
i<=POINTS; ++
i) {
682 double x_ewk = 1.+ewk_syst_max*
i/POINTS;
683 double x_fz = Fzmc+fz_syst_max*
i/POINTS;
684 double x_fzp = FzPmc+fzp_syst_max*
i/POINTS;
685 double x_k = KMC+k_syst_max*
i/POINTS;
686 double x_i = Imc+i_syst_max*
i/POINTS;
688 double y_ewk=
CalcABCD(Imc, Fzmc, FzPmc, KMC, x_ewk, Na, Nb, Nc, Nd, Ea,Eb,Ec,Ed);
689 double y_fz =
CalcABCD(Imc, x_fz, FzPmc, KMC, 1., Na, Nb, Nc, Nd, Ea,Eb,Ec,Ed);
690 double y_fzp=
CalcABCD(Imc, Fzmc, x_fzp, KMC, 1., Na, Nb, Nc, Nd, Ea,Eb,Ec,Ed);
691 double y_k =
CalcABCD(Imc, Fzmc, FzPmc, x_k, 1., Na, Nb, Nc, Nd, Ea,Eb,Ec,Ed);
692 double y_i =
CalcABCD(x_i, Fzmc, FzPmc, KMC, 1., Na, Nb, Nc, Nd, Ea,Eb,Ec,Ed);
694 g_ewk.SetPoint(
i+POINTS,(x_ewk-1.)*100., 100.*fabs(y_ewk-SMC)/SMC);
695 g_fz.SetPoint(
i+POINTS,(x_fz-Fzmc)*100./Fzmc, 100.*fabs(y_fz-SMC)/SMC);
696 g_fzp.SetPoint(
i+POINTS,(x_fzp-FzPmc)*100./FzPmc, 100.*fabs(y_fzp-SMC)/SMC);
697 g_i.SetPoint(
i+POINTS,(x_i-Imc)*100./Imc, 100.*fabs(y_i-SMC)/SMC);
698 g_k.SetPoint(
i+POINTS,(x_k-KMC)*100./KMC, 100.*fabs(y_k-SMC)/SMC);
700 TString yaxis(
"(S-S_{mc})/S_{mc} (%)");
702 g_ewk.SetLineWidth(2);
703 g_ewk.GetXaxis()->SetTitle(
"EWK Variation (%)");
704 g_ewk.GetYaxis()->SetTitle(yaxis);
706 c.Print(
"ewk_syst_variation.C");
708 g_fz.SetLineWidth(2);
709 g_fz.GetXaxis()->SetTitle(
"F_{z} Variation (%)");
710 g_fz.GetYaxis()->SetTitle(yaxis);
712 c.Print(
"fz_syst_variation.C");
714 g_fzp.SetLineWidth(2);
715 g_fzp.GetXaxis()->SetTitle(
"F_{z}' Variation (%)");
716 g_fzp.GetYaxis()->SetTitle(yaxis);
718 c.Print(
"fzp_syst_variation.C");
721 g_i.GetXaxis()->SetTitle(
"I Variation (%)");
722 g_i.GetYaxis()->SetTitle(yaxis);
724 c.Print(
"i_syst_variation.C");
727 g_k.GetXaxis()->SetTitle(
"K Variation (%)");
728 g_k.GetYaxis()->SetTitle(yaxis);
730 c.Print(
"k_syst_variation.C");
736 double err_ewk =
std::max(fabs(SMC-S_EWK_PLUS),fabs(SMC-S_EWK_MINUS));
737 double err_fz = fabs(SMC-S_FZ);
738 double err_fzp = fabs(SMC-S_FZP);
739 double err_i = fabs(SMC-S_I);
740 double err_k = fabs(SMC-S_K);
742 double DS_syst =
sqrt(err_ewk*err_ewk + err_fz*err_fz + err_fzp*err_fzp+
743 err_i*err_i + err_k*err_k);
745 cout <<
"********************************************************" << endl;
746 cout <<
"Signal Prediction: " << S <<
"+-" << DS <<
"(stat) +-" 747 << DS_syst <<
"(syst)" << endl;
748 cout <<
"stat error: " << 100.*DS/S <<
"%" << endl;
749 cout <<
"syt error: " << 100.*DS_syst/S<<
"%" << endl;
750 cout <<
"********************************************************" << endl;
751 cout <<
"Parameters used in calculation: " << endl;
752 cout <<
"I= " << I <<
"+-" << dI << endl;
753 cout <<
"Fz= " << Fz <<
"+-" << dFz << endl;
754 cout <<
"FzP=" << FzP <<
"+-" << dFzP << endl;
755 cout <<
"EWK error assumed to be: " << ewkerror << endl;
757 cout <<
"ABCD Regions population:" << endl;
758 cout <<
"A: N=" << Na <<
", sig=" << a_sig <<
", qcd=" << a_qcd
759 <<
", ewk=" << a_ewk << endl;
760 cout <<
"B: N=" << Nb <<
", sig=" << b_sig <<
", qcd=" << b_qcd
761 <<
", ewk=" << b_ewk << endl;
762 cout <<
"C: N=" << Nc <<
", sig=" << c_sig <<
", qcd=" << c_qcd
763 <<
", ewk=" << c_ewk << endl;
764 cout <<
"D: N=" << Nd <<
", sig=" << d_sig <<
", qcd=" << d_qcd
765 <<
", ewk=" << d_ewk << endl;
767 cout <<
"Parameters from MC: " << endl;
768 cout <<
"I= " << Imc <<
"+-" << dImc << endl;
769 cout <<
"Fz= " << Fzmc <<
"+-" << dFzmc << endl;
770 cout <<
"FzP=" << FzPmc <<
"+-" << dFzPmc << endl;
772 cout <<
"Real value of K=" << KMC << endl;
773 cout <<
"Real value of Signal=" << SMC << endl;
775 cout <<
"Difference Measured - MC value (% wrt MC value except K=1): " 777 cout <<
"Fz : " << dfz <<
", (" << dfz*100./Fzmc <<
"%)" << endl;
778 cout <<
"FzP: " << dfzp <<
", (" << dfzp*100./FzPmc <<
"%)" << endl;
779 cout <<
"I : " << di <<
", (" << di*100./Imc <<
"%)" << endl;
780 cout <<
"K : " << fk <<
", (" << fk*100./1. <<
"%)" << endl;
783 cout <<
"DETAILS OF THE CALCULATION" << endl;
784 cout <<
"^^^^^^^^^^^^^^^^^^^^^^^^^^" << endl;
785 cout <<
"Statistical Error Summary: " << endl;
786 cout <<
"due to Fz = "<< SpFz*dFz<<
", ("<<SpFz*dFz*100./S <<
"%)"<< endl;
787 cout <<
"due to FzP= "<< SpFzP*dFzP
788 <<
", ("<<SpFzP*dFzP*100./S <<
"%)"<< endl;
789 cout <<
"due to I = "<< SpI*dI
790 <<
", ("<<SpI*dI*100./S <<
"%)"<< endl;
791 cout <<
"due to Na = "<< SpNa*
sqrt(Na)
792 <<
", ("<< SpNa*
sqrt(Na)*100./S <<
"%)"<< endl;
793 cout <<
"due to Nb = "<< SpNb*
sqrt(Nb)
794 <<
", ("<< SpNb*
sqrt(Nb)*100./S <<
"%)"<< endl;
795 cout <<
"due to Nc = "<< SpNc*
sqrt(Nc)
796 <<
", ("<< SpNc*
sqrt(Nc)*100./S <<
"%)"<< endl;
797 cout <<
"due to Nd = "<< SpNd*
sqrt(Nd)
798 <<
", ("<< SpNd*
sqrt(Nd)*100./S <<
"%)"<< endl;
799 cout <<
"Total Statistical Error: " 800 << DS <<
", (" << DS*100./S <<
"%)"<< endl;
801 cout <<
"Stat Error percentages are wrt S prediction, not S mc" << endl;
803 cout <<
"Systematic Error Summary:" << endl;
804 cout <<
"due to k = " << err_k <<
" ( " << err_k*100./S <<
"%)" << endl;
805 cout <<
"due to Fz = " << err_fz <<
" ( " << err_fz*100./S <<
"%)" << endl;
806 cout <<
"due to FzP = " << err_fzp <<
" ( " << err_fzp*100./S <<
"%)" << endl;
807 cout <<
"due to I = " << err_i <<
" ( " << err_i*100./S <<
"%)" << endl;
808 cout <<
"due to EWK = " << err_ewk <<
" ( " << err_ewk*100./S <<
"%)" << endl;
810 cout <<
"Syst Error percentages are wrt S prediction, not S mc" << endl;
814 if (mcOnly < 0 && mcOnly >-0.75) {
816 cout <<
"=======================================================" << endl;
817 cout <<
"Calculating ABCD Result and Stat Error Assuming MC ONLY" << endl;
818 cout <<
"=======================================================" << endl;
819 cout <<
"All input parameters that the user have inserted will be " 820 <<
"ignored and recalculated from MC" << endl;
821 cout <<
"This option will not give you systematics estimation" << endl;
823 I = (a_sig + b_sig) / (a_sig + b_sig + c_sig + d_sig);
824 dI =
sqrt(I*(1-I)/(a_sig + b_sig + c_sig + d_sig));
826 double e =a_sig/(a_sig + b_sig);
827 double de =
sqrt(e*(1-e)/(a_sig + b_sig));
828 double alpha = de/(2.*Fz-
e);
829 dFz = alpha/(1-
alpha);
831 double ep =d_sig/(c_sig + d_sig);
832 double dep =
sqrt(ep*(1-ep)/(c_sig + d_sig));
833 double alphap = dep/(2.*FzP-ep);
834 dFzP = alphap/(1-alphap);
836 double KMC = (d_qcd/c_qcd)/(a_qcd/b_qcd);
839 double A = (1.0-
I)*(FzP-Fz);
840 double B = I*(FzP+1.0)*(FzP*(c_sig+c_qcd)-(d_sig+d_qcd)) +
841 (1+Fz)*(1-
I)*((a_sig+a_qcd)-dFzP*(b_sig+b_qcd));
842 double C = I*(1.+Fz)*(1.+FzP)*((d_sig+d_qcd)*(b_sig+b_qcd) -
843 (a_sig+a_qcd)*(c_sig+c_qcd));
846 double S =
Trionym(A,B,C, a_sig+b_sig);
850 double ApI=0, ApFz=0, ApFzP=0, ApNa=0, ApNb=0, ApNc=0, ApNd=0;
851 double BpI=0, BpFz=0, BpFzP=0, BpNa=0, BpNb=0, BpNc=0, BpNd=0;
852 double CpI=0, CpFz=0, CpFzP=0, CpNa=0, CpNb=0, CpNc=0, CpNd=0;
853 double SpI=0, SpFz=0, SpFzP=0, SpNa=0, SpNb=0, SpNc=0, SpNd=0;
855 double Na = a_sig+a_qcd+a_ewk, Nb = b_sig+b_qcd+b_ewk;
856 double Nc=c_sig+c_qcd+c_ewk, Nd = d_sig+d_qcd+d_ewk;
857 double Ea = a_ewk, Eb = b_ewk, Ec=c_ewk, Ed = d_ewk;
868 BpI = (FzP+1.0)*(Fz*(Nc-Ec)-(Nd-Ed))-(1.0+Fz)*((Na-Ea)-FzP*(Nb-Eb));
869 BpFz = I*(F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nd );
921 cout <<
"********************************************************" << endl;
922 cout <<
"Signal Prediction: " << S <<
"+-" << DS <<
"(stat)" << endl;
923 cout <<
"********************************************************" << endl;
924 cout <<
"Parameters used in calculation: " << endl;
925 cout <<
"I= " << I <<
"+-" << dI << endl;
926 cout <<
"Fz= " << Fz <<
"+-" << dFz << endl;
927 cout <<
"FzP=" << FzP <<
"+-" << dFzP << endl;
929 cout <<
"ABCD Regions population:" << endl;
930 cout <<
"A: N=" << Na <<
", sig=" << a_sig <<
", qcd=" << a_qcd
931 <<
", ewk=" << a_ewk << endl;
932 cout <<
"B: N=" << Nb <<
", sig=" << b_sig <<
", qcd=" << b_qcd
933 <<
", ewk=" << b_ewk << endl;
934 cout <<
"C: N=" << Nc <<
", sig=" << c_sig <<
", qcd=" << c_qcd
935 <<
", ewk=" << c_ewk << endl;
936 cout <<
"D: N=" << Nd <<
", sig=" << d_sig <<
", qcd=" << d_qcd
937 <<
", ewk=" << d_ewk << endl;
938 cout <<
"K value from MC: " << KMC << endl;
940 cout <<
"Statistical Error Summary: " << endl;
941 cout <<
"due to Fz = "<< SpFz*dFz<<
", ("<<SpFz*dFz*100./S <<
"%)"<< endl;
942 cout <<
"due to FzP= "<< SpFzP*dFzP
943 <<
", ("<<SpFzP*dFzP*100./S <<
"%)"<< endl;
944 cout <<
"due to I = "<< SpI*dI
945 <<
", ("<<SpI*dI*100./S <<
"%)"<< endl;
946 cout <<
"due to Na = "<< SpNa*
sqrt(Na)
947 <<
", ("<< SpNa*
sqrt(Na)*100./S <<
"%)"<< endl;
948 cout <<
"due to Nb = "<< SpNb*
sqrt(Nb)
949 <<
", ("<< SpNb*
sqrt(Nb)*100./S <<
"%)"<< endl;
950 cout <<
"due to Nc = "<< SpNc*
sqrt(Nc)
951 <<
", ("<< SpNc*
sqrt(Nc)*100./S <<
"%)"<< endl;
952 cout <<
"due to Nd = "<< SpNd*
sqrt(Nd)
953 <<
", ("<< SpNd*
sqrt(Nd)*100./S <<
"%)"<< endl;
954 cout <<
"Total Statistical Error: " 955 << DS <<
", (" << DS*100./S <<
"%)"<< endl;
956 cout <<
"Stat Error percentages are wrt S prediction, not S mc" << endl;
963 vector<TString>
file, vector<TString>
type,
967 gROOT->ProcessLine(
".L tdrstyle.C");
968 gROOT->ProcessLine(
"setTDRStyle()");
970 int NBins = 0;
double min = 0;
double max = -1;
971 for (
int i=0;
i< (
int) file.size(); ++
i) {
974 TH1F *
h = (TH1F*) f.Get(histoName);
975 NBins = h->GetNbinsX();
976 min = h->GetBinLowEdge(1);
977 max = h->GetBinLowEdge(NBins+1);
981 if (NBins ==0 || (max<min)) {
982 std::cout <<
"PlotCombiner::abcd error: Could not find valid histograms in file" 986 cout <<
"Histograms with "<< NBins <<
" bins and range " << min <<
"-" << max << endl;
988 TH1F h_wenu(
"h_wenu",
"h_wenu", NBins, min, max);
989 int fmax = (
int) file.size();
990 for (
int i=0;
i<fmax; ++
i) {
991 if (type[
i] ==
"sig" && weight[
i]>0) {
993 TH1F *
h = (TH1F*) f.Get(histoName);
994 h_wenu.Add(h, weight[i]);
1000 TH1F h_qcd(
"h_qcd",
"h_qcd", NBins, min, max);
1001 for (
int i=0;
i<fmax; ++
i) {
1002 if (type[
i] ==
"qcd" && weight[
i]>0) {
1004 TH1F *
h = (TH1F*) f.Get(histoName);
1005 h_qcd.Add(h, weight[i]);
1009 TH1F h_bce(
"h_bce",
"h_bce", NBins, min, max);
1010 for (
int i=0;
i<fmax; ++
i) {
1011 if (type[
i] ==
"bce" && weight[
i]>0) {
1013 TH1F *
h = (TH1F*) f.Get(histoName);
1014 h_bce.Add(h, weight[i]);
1018 TH1F h_gj(
"h_gj",
"h_gj", NBins, min, max);
1019 for (
int i=0;
i<fmax; ++
i) {
1020 if (type[
i] ==
"gje" && weight[
i]>0) {
1022 TH1F *
h = (TH1F*) f.Get(histoName);
1023 h_gj.Add(h, weight[i]);
1027 TH1F h_ewk(
"h_ewk",
"h_ewk", NBins, min, max);
1028 for (
int i=0;
i<fmax; ++
i) {
1029 if (type[
i] ==
"ewk" && weight[
i]>0) {
1031 TH1F *
h = (TH1F*) f.Get(histoName);
1032 h_ewk.Add(h, weight[i]);
1038 h_ewk.SetFillColor(3);
1042 h_gj.SetFillColor(1);
1046 h_bce.SetFillColor(2);
1048 TH1F h_tot(
"h_tot",
"h_tot", NBins, min, max);
1051 h_wenu.SetLineColor(4); h_wenu.SetLineWidth(2);
1054 h_tot.GetXaxis()->SetTitle(xtitle);
1059 h_wenu.Draw(
"same");
1062 TLegend
leg(0.6,0.65,0.95,0.92);
1063 if (wzsignal ==
"wenu")
1064 leg.AddEntry(&h_wenu,
"W#rightarrow e#nu",
"l");
1066 leg.AddEntry(&h_wenu,
"Z#rightarrow ee",
"l");
1067 leg.AddEntry(&h_tot,
"Signal + Bkg",
"p");
1068 leg.AddEntry(&h_bce,
"dijets",
"f");
1069 leg.AddEntry(&h_gj,
"#gamma + jets",
"f");
1070 leg.AddEntry(&h_ewk,
"EWK+t#bar t",
"f");
1073 c.Print(
"test.png");
1091 int size = keyword.Sizeof();
1092 int existsEntry = abcdString.Index(keyword);
1094 if (existsEntry==-1)
return -1.;
1096 TString previousVal = abcdString(existsEntry-1);
1097 if (!(previousVal ==
"," || previousVal ==
" " ||
1098 previousVal ==
"(" ))
return -1.;
1100 TString afterVal = abcdString(existsEntry+size-1);
1102 if (afterVal ==
"," || afterVal==
")")
return -0.5;
1103 else if (afterVal !=
"=")
return -1.;
1106 int comma = abcdString.Index(
",",existsEntry);
1108 if (comma<0) comma = abcdString.Index(
")",existsEntry);
1110 std::cout <<
"Error in parcing abcd line, chech syntax " 1114 TString svalue=abcdString(existsEntry+size,comma-existsEntry-size);
1115 std::cout <<
"Found ABCD parameter "<< keyword
1116 <<
" with value " << svalue << endl;
1118 double value = svalue.Atof();
1129 double D2 = b*b - 4.*a*
c;
1132 double s1 = (-b +
sqrt(D2)) / (2.*a);
1133 double s2 = (-b -
sqrt(D2)) / (2.*a);
1134 double solution = fabs(s1-sum)<fabs(s2-sum)?s1:
s2;
1148 (
double I,
double Fz,
double FzP,
double K,
double ewk,
1149 double Na_,
double Nb_,
double Nc_,
double Nd_ ,
1150 double Ea_,
double Eb_,
double Ec_,
double Ed_)
1153 A = (1.0-
I)*(FzP-K*Fz);
1154 B = I*(FzP+1.0)*(K*Fz*(Nc_-ewk*Ec_)-(Nd_-ewk*Ed_))+
1155 (1.0-I)*(1.0+Fz)*(K*(Na_-ewk*Ea_)-FzP*(Nb_-ewk*Eb_));
1156 C = I*(1.0+Fz)*(1.0+FzP)*((Nd_-ewk*Ed_)*(Nb_-ewk*Eb_)-
1157 K*(Na_-ewk*Ea_)*(Nc_-ewk*Ec_));
1159 return Trionym(A, B, C, Na_+Nb_-Ea_-Eb_);
double Trionym(double a, double b, double c, double sum)
void plotMaker(TString histoName, TString typeOfplot, vector< TString > file, vector< TString > type, vector< double > weight, TString xtitle)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const double EWK_SYST_MIN
const double EWK_SYST_MAX
static std::string const input
void abcd(vector< TString > file, vector< TString > type, vector< double > weight, double METCut, double I, double dI, double Fz, double dFz, double FzP, double dFzP, double ewkerror, double data, double mc, double mcOnly)
const std::complex< double > I
static const std::string B
double CalcABCD(double I, double Fz, double FzP, double K, double ewk, double Na_, double Nb_, double Nc_, double Nd_, double Ea_, double Eb_, double Ec_, double Ed_)
const double FZP_SYST_MIN
const double FZP_SYST_MAX
double S(const TLorentzVector &, const TLorentzVector &)
char data[epos_bytes_allocation]
double searchABCDstring(TString abcdString, TString keyword)