12 acceptance(acceptance_)
19 double gZGsRatio_[4][1],
20 double gGsGsRatio_[3][1],
21 double gVVpRatio_[1][1],
22 double gVpVpRatio_[1][1],
23 bool pmf_applied_,
bool acceptance_,
27 pmf_applied(pmf_applied_),
28 acceptance(acceptance_)
30 for (
int v=0; v<4; v++){
31 for (
int k=0; k<8; k++){
32 gRatio[v][k] = gRatio_[v][k];
35 if (v>0)
gGsGsRatio[v-1][k] = gGsGsRatio_[v-1][k];
50 for (
int v=0; v<4; v++){
51 for (
int k=0; k<8; k++){
52 gRatioVal[v][k] =
new RooRealVar(Form(
"g%i_%iMixVal", v+1, k), Form(
"g%i_%iMixVal", v+1, k),
gRatio[v][k]);
57 if (v==0)
gZGsRatioVal[v][k] =
new RooRealVar(Form(
"gzgs%i_%iMixVal", v+1, k+2), Form(
"gzgs%i_%iMixVal", v+1, k+2),
gZGsRatio[v][k]);
58 else gZGsRatioVal[v][k] =
new RooRealVar(Form(
"gzgs%i_%iMixVal", v+1, k), Form(
"gzgs%i_%iMixVal", v+1, k),
gZGsRatio[v][k]);
59 if (v>0)
gGsGsRatioVal[v-1][k] =
new RooRealVar(Form(
"ggsgs%i_%iMixVal", v+1, k), Form(
"ggsgs%i_%iMixVal", v+1, k),
gGsGsRatio[v-1][k]);
61 gVVpRatioVal[v][k] =
new RooRealVar(Form(
"gvvp%i_%iMixVal", v+1, k), Form(
"gvvp%i_%iMixVal", v+1, k),
gVVpRatio[v][k]);
62 gVpVpRatioVal[v][k] =
new RooRealVar(Form(
"gvpvp%i_%iMixVal", v+1, k), Form(
"gvpvp%i_%iMixVal", v+1, k),
gVpVpRatio[v][k]);
69 RooArgList gBareFracList;
70 for (
int v=0; v<8; v++){
73 if (v>1) strapp.Prepend(Form(
"%i", v));
74 if (v>0) strapp.Prepend(
"_prime");
75 TString strappPhase = strapp;
76 strapp.Append(
"Frac");
77 strappPhase.Append(
"Phase");
79 double firstFracVal = 0;
80 double phaseBound = TMath::Pi();
88 strcore.Append(strapp);
89 if (
gRatio[0][v]!=0)
g1Frac[v-1] =
new RooRealVar(strcore, strcore, 0, firstFracVal, 1);
90 else g1Frac[v-1] =
new RooRealVar(strcore, strcore, 0);
91 gBareFracList.add(*(
g1Frac[v-1]));
95 strcore.Append(strapp);
97 else gzgs1Frac[v-2] =
new RooRealVar(strcore, strcore, 0);
103 strcore.Append(strapp);
104 if (
gRatio[1][v]!=0)
g2Frac[v] =
new RooRealVar(strcore, strcore, 0, firstFracVal, 1);
105 else g2Frac[v] =
new RooRealVar(strcore, strcore, 0);
106 gBareFracList.add(*(
g2Frac[v]));
109 strcore.Append(strapp);
111 else gzgs2Frac[v] =
new RooRealVar(strcore, strcore, 0);
114 strcore.Append(strapp);
116 else ggsgs2Frac[v] =
new RooRealVar(strcore, strcore, 0);
121 strcore.Append(strapp);
122 if (
gRatio[2][v]!=0)
g3Frac[v] =
new RooRealVar(strcore, strcore, 0, firstFracVal, 1);
123 else g3Frac[v] =
new RooRealVar(strcore, strcore, 0);
124 gBareFracList.add(*(
g3Frac[v]));
127 strcore.Append(strapp);
129 else gzgs3Frac[v] =
new RooRealVar(strcore, strcore, 0);
132 strcore.Append(strapp);
134 else ggsgs3Frac[v] =
new RooRealVar(strcore, strcore, 0);
139 strcore.Append(strapp);
140 if (
gRatio[3][v]!=0)
g4Frac[v] =
new RooRealVar(strcore, strcore, 0, firstFracVal, 1);
141 else g4Frac[v] =
new RooRealVar(strcore, strcore, 0);
142 gBareFracList.add(*(
g4Frac[v]));
145 strcore.Append(strapp);
147 else gzgs4Frac[v] =
new RooRealVar(strcore, strcore, 0);
150 strcore.Append(strapp);
152 else ggsgs4Frac[v] =
new RooRealVar(strcore, strcore, 0);
158 strcore.Append(strapp);
159 if (
gVVpRatio[0][v]!=0)
gvvp1Frac[v] =
new RooRealVar(strcore, strcore, 0, firstFracVal, 1);
160 else gvvp1Frac[v] =
new RooRealVar(strcore, strcore, 0);
164 strcore.Append(strapp);
166 else gvpvp1Frac[v] =
new RooRealVar(strcore, strcore, 0);
172 strcore.Append(strappPhase);
173 if (
gRatio[0][v]!=0)
g1Phase[v-1] =
new RooRealVar(strcore, strcore, 0, -phaseBound, phaseBound);
174 else g1Phase[v-1] =
new RooRealVar(strcore, strcore, 0);
178 strcore.Append(strappPhase);
179 if (
gZGsRatioVal[0][v-2]!=0)
gzgs1Phase[v-2] =
new RooRealVar(strcore, strcore, 0, -phaseBound, phaseBound);
180 else gzgs1Phase[v-2] =
new RooRealVar(strcore, strcore, 0);
185 strcore.Append(strappPhase);
186 if (
gRatio[1][v]!=0)
g2Phase[v] =
new RooRealVar(strcore, strcore, 0, -phaseBound, phaseBound);
187 else g2Phase[v] =
new RooRealVar(strcore, strcore, 0);
190 strcore.Append(strappPhase);
192 else gzgs2Phase[v] =
new RooRealVar(strcore, strcore, 0);
194 strcore.Append(strappPhase);
196 else ggsgs2Phase[v] =
new RooRealVar(strcore, strcore, 0);
200 strcore.Append(strappPhase);
201 if (
gRatio[2][v]!=0)
g3Phase[v] =
new RooRealVar(strcore, strcore, 0, -phaseBound, phaseBound);
202 else g3Phase[v] =
new RooRealVar(strcore, strcore, 0);
205 strcore.Append(strappPhase);
207 else gzgs3Phase[v] =
new RooRealVar(strcore, strcore, 0);
209 strcore.Append(strappPhase);
211 else ggsgs3Phase[v] =
new RooRealVar(strcore, strcore, 0);
215 strcore.Append(strappPhase);
216 if (
gRatio[3][v]!=0)
g4Phase[v] =
new RooRealVar(strcore, strcore, 0, -phaseBound, phaseBound);
217 else g4Phase[v] =
new RooRealVar(strcore, strcore, 0);
220 strcore.Append(strappPhase);
222 else gzgs4Phase[v] =
new RooRealVar(strcore, strcore, 0);
224 strcore.Append(strappPhase);
226 else ggsgs4Phase[v] =
new RooRealVar(strcore, strcore, 0);
231 strcore.Append(strappPhase);
232 if (
gVVpRatio[0][v]!=0)
gvvp1Phase[v] =
new RooRealVar(strcore, strcore, 0, -phaseBound, phaseBound);
233 else gvvp1Phase[v] =
new RooRealVar(strcore, strcore, 0);
236 strcore.Append(strappPhase);
237 if (
gVpVpRatio[0][v]!=0)
gvpvp1Phase[v] =
new RooRealVar(strcore, strcore, 0, -phaseBound, phaseBound);
238 else gvpvp1Phase[v] =
new RooRealVar(strcore, strcore, 0);
242 TString sumFormula =
"(";
243 for (
int gg=0; gg<gBareFracList.getSize(); gg++){
244 TString bareFormula =
"abs(@";
245 bareFormula.Append(Form(
"%i", gg));
246 bareFormula.Append(
")");
247 if (gg!=(gBareFracList.getSize()-1)) bareFormula.Append(
"+");
248 sumFormula.Append(bareFormula);
250 sumFormula.Append(
")");
251 TString gFracSumName =
"sum_gjAbsFrac";
252 gFracSum =
new RooFormulaVar(gFracSumName, gFracSumName, sumFormula.Data(), gBareFracList);
253 for (
int v=0; v<8; v++){
256 if (v>1) strapp.Prepend(Form(
"%i", v));
257 if (v>0) strapp.Prepend(
"_prime");
258 strapp.Append(
"InterpFrac");
262 strcore.Append(strapp);
264 g1FracInterp[v] =
new RooFormulaVar(strcore, strcore,
"(@1>1 ? 0. : @0)", tmpArg1);
268 strcore.Append(strapp);
270 gzgs1FracInterp[v-2] =
new RooFormulaVar(strcore, strcore,
"(@1>1 ? 0. : @0)", tmpArg_zgs1);
275 strcore.Append(strapp);
277 g1FracInterp[v] =
new RooFormulaVar(strcore, strcore,
"(@0>1 ? 0. : abs(1.-@0))", tmpGArg);
281 strcore.Append(strapp);
283 g2FracInterp[v] =
new RooFormulaVar(strcore, strcore,
"(@1>1 ? 0. : @0)", tmpArg2);
286 strcore.Append(strapp);
288 gzgs2FracInterp[v] =
new RooFormulaVar(strcore, strcore,
"(@1>1 ? 0. : @0)", tmpArg_zgs2);
291 strcore.Append(strapp);
293 ggsgs2FracInterp[v] =
new RooFormulaVar(strcore, strcore,
"(@1>1 ? 0. : @0)", tmpArg_gsgs2);
297 strcore.Append(strapp);
299 g3FracInterp[v] =
new RooFormulaVar(strcore, strcore,
"(@1>1 ? 0. : @0)", tmpArg3);
302 strcore.Append(strapp);
304 gzgs3FracInterp[v] =
new RooFormulaVar(strcore, strcore,
"(@1>1 ? 0. : @0)", tmpArg_zgs3);
307 strcore.Append(strapp);
309 ggsgs3FracInterp[v] =
new RooFormulaVar(strcore, strcore,
"(@1>1 ? 0. : @0)", tmpArg_gsgs3);
313 strcore.Append(strapp);
315 g4FracInterp[v] =
new RooFormulaVar(strcore, strcore,
"(@1>1 ? 0. : @0)", tmpArg4);
318 strcore.Append(strapp);
320 gzgs4FracInterp[v] =
new RooFormulaVar(strcore, strcore,
"(@1>1 ? 0. : @0)", tmpArg_zgs4);
323 strcore.Append(strapp);
325 ggsgs4FracInterp[v] =
new RooFormulaVar(strcore, strcore,
"(@1>1 ? 0. : @0)", tmpArg_gsgs4);
330 strcore.Append(strapp);
332 gvvp1FracInterp[v] =
new RooFormulaVar(strcore, strcore,
"(@1>1 ? 0. : @0)", tmpArg_vvp1);
335 strcore.Append(strapp);
337 gvpvp1FracInterp[v] =
new RooFormulaVar(strcore, strcore,
"(@1>1 ? 0. : @0)", tmpArg_vpvp1);
340 for (
int v=0; v<8; v++){
341 for (
int im=0; im<2; im++){
343 TString strapp =
"Val";
344 if (im==1) strapp.Append(
"Im");
345 if (v>1) strapp.Prepend(Form(
"%i", v));
346 if (v>0) strapp.Prepend(
"_prime");
349 strcore.Append(strapp);
351 TString strFormulag1 =
"@0*sqrt(@1)";
354 if (im==0) strFormulag1.Append(
"*cos(@2)");
355 else strFormulag1.Append(
"*sin(@2)");
357 RooFormulaVar* g1Val =
new RooFormulaVar(strcore, strcore, strFormulag1, tmpArg1);
361 strcore.Append(strapp);
363 TString strFormulag2 =
"@0*sqrt(@1)";
364 if (im==0) strFormulag2.Append(
"*cos(@2)");
365 else strFormulag2.Append(
"*sin(@2)");
366 RooFormulaVar* g2Val =
new RooFormulaVar(strcore, strcore, strFormulag2, tmpArg2);
370 strcore.Append(strapp);
372 TString strFormulag3 =
"@0*sqrt(@1)";
373 if (im==0) strFormulag3.Append(
"*cos(@2)");
374 else strFormulag3.Append(
"*sin(@2)");
375 RooFormulaVar* g3Val =
new RooFormulaVar(strcore, strcore, strFormulag3, tmpArg3);
379 strcore.Append(strapp);
381 TString strFormulag4 =
"@0*sqrt(@1)";
382 if (im==0) strFormulag4.Append(
"*cos(@2)");
383 else strFormulag4.Append(
"*sin(@2)");
384 RooFormulaVar* g4Val =
new RooFormulaVar(strcore, strcore, strFormulag4, tmpArg4);
390 strcore.Append(strapp);
392 TString strFormulagzgs1 =
"@0*sqrt(@1)";
393 if (im==0) strFormulagzgs1.Append(
"*cos(@2)");
394 else strFormulagzgs1.Append(
"*sin(@2)");
395 RooFormulaVar* gzgs1Val =
new RooFormulaVar(strcore, strcore, strFormulagzgs1, tmpArg_zgs1);
400 strcore.Append(strapp);
402 TString strFormulagzgs2 =
"@0*sqrt(@1)";
403 if (im==0) strFormulagzgs2.Append(
"*cos(@2)");
404 else strFormulagzgs2.Append(
"*sin(@2)");
405 RooFormulaVar* gzgs2Val =
new RooFormulaVar(strcore, strcore, strFormulagzgs2, tmpArg_zgs2);
409 strcore.Append(strapp);
411 TString strFormulagzgs3 =
"@0*sqrt(@1)";
412 if (im==0) strFormulagzgs3.Append(
"*cos(@2)");
413 else strFormulagzgs3.Append(
"*sin(@2)");
414 RooFormulaVar* gzgs3Val =
new RooFormulaVar(strcore, strcore, strFormulagzgs3, tmpArg_zgs3);
418 strcore.Append(strapp);
420 TString strFormulagzgs4 =
"@0*sqrt(@1)";
421 if (im==0) strFormulagzgs4.Append(
"*cos(@2)");
422 else strFormulagzgs4.Append(
"*sin(@2)");
423 RooFormulaVar* gzgs4Val =
new RooFormulaVar(strcore, strcore, strFormulagzgs4, tmpArg_zgs4);
427 strcore.Append(strapp);
429 TString strFormulaggsgs2 =
"@0*sqrt(@1)";
430 if (im==0) strFormulaggsgs2.Append(
"*cos(@2)");
431 else strFormulaggsgs2.Append(
"*sin(@2)");
432 RooFormulaVar* ggsgs2Val =
new RooFormulaVar(strcore, strcore, strFormulaggsgs2, tmpArg_gsgs2);
436 strcore.Append(strapp);
438 TString strFormulaggsgs3 =
"@0*sqrt(@1)";
439 if (im==0) strFormulaggsgs3.Append(
"*cos(@2)");
440 else strFormulaggsgs3.Append(
"*sin(@2)");
441 RooFormulaVar* ggsgs3Val =
new RooFormulaVar(strcore, strcore, strFormulaggsgs3, tmpArg_gsgs3);
445 strcore.Append(strapp);
447 TString strFormulaggsgs4 =
"@0*sqrt(@1)";
448 if (im==0) strFormulaggsgs4.Append(
"*cos(@2)");
449 else strFormulaggsgs4.Append(
"*sin(@2)");
450 RooFormulaVar* ggsgs4Val =
new RooFormulaVar(strcore, strcore, strFormulaggsgs4, tmpArg_gsgs4);
455 strcore.Append(strapp);
457 TString strFormulagvvp1 =
"@0*sqrt(@1)";
458 if (im==0) strFormulagvvp1.Append(
"*cos(@2)");
459 else strFormulagvvp1.Append(
"*sin(@2)");
460 RooFormulaVar* gvvp1Val =
new RooFormulaVar(strcore, strcore, strFormulagvvp1, tmpArg_vvp1);
464 strcore.Append(strapp);
466 TString strFormulagvpvp1 =
"@0*sqrt(@1)";
467 if (im==0) strFormulagvpvp1.Append(
"*cos(@2)");
468 else strFormulagvpvp1.Append(
"*sin(@2)");
469 RooFormulaVar* gvpvp1Val =
new RooFormulaVar(strcore, strcore, strFormulagvpvp1, tmpArg_vpvp1);
487 double initval = 100.;
489 strcore =
"Lambda_z1";
490 strcore.Append(Form(
"%i", (v!=3 ? v+1 : 0)));
493 strcore =
"Lambda_z2";
494 strcore.Append(Form(
"%i", (v!=3 ? v+1 : 0)));
497 strcore =
"Lambda_z3";
498 strcore.Append(Form(
"%i", (v!=3 ? v+1 : 0)));
501 strcore =
"Lambda_z4";
502 strcore.Append(Form(
"%i", (v!=3 ? v+1 : 0)));
508 strcore.Append(Form(
"%i%s", (v!=3 ? v+1 : 12),
"sq"));
513 for (
int v=0; v<8; v++){
514 for (
int im=0; im<2; im++){
516 double initval = ((v==0 && im==0) ? 1 : 0);
518 TString strapp =
"Val";
519 if (im==1) strapp.Append(
"Im");
520 if (v>1) strapp.Prepend(Form(
"%i", v));
521 if (v>0) strapp.Prepend(
"_prime");
524 strcore.Append(strapp);
525 RooRealVar* g1Val =
new RooRealVar(strcore, strcore, initval, -1e15, 1e15);
531 strcore.Append(strapp);
532 RooRealVar* g2Val =
new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
538 strcore.Append(strapp);
539 RooRealVar* g3Val =
new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
545 strcore.Append(strapp);
546 RooRealVar* g4Val =
new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
553 strcore.Append(strapp);
554 RooRealVar* gzgs1Val =
new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
555 gzgs1Val->removeMin();
556 gzgs1Val->removeMax();
561 strcore.Append(strapp);
562 RooRealVar* gzgs2Val =
new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
563 gzgs2Val->removeMin();
564 gzgs2Val->removeMax();
568 strcore.Append(strapp);
569 RooRealVar* gzgs3Val =
new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
570 gzgs3Val->removeMin();
571 gzgs3Val->removeMax();
575 strcore.Append(strapp);
576 RooRealVar* gzgs4Val =
new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
577 gzgs4Val->removeMin();
578 gzgs4Val->removeMax();
582 strcore.Append(strapp);
583 RooRealVar* ggsgs2Val =
new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
584 ggsgs2Val->removeMin();
585 ggsgs2Val->removeMax();
589 strcore.Append(strapp);
590 RooRealVar* ggsgs3Val =
new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
591 ggsgs3Val->removeMin();
592 ggsgs3Val->removeMax();
596 strcore.Append(strapp);
597 RooRealVar* ggsgs4Val =
new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
598 ggsgs4Val->removeMin();
599 ggsgs4Val->removeMax();
604 strcore.Append(strapp);
605 RooRealVar* gvvp1Val =
new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
606 gvvp1Val->removeMin();
607 gvvp1Val->removeMax();
611 strcore.Append(strapp);
612 RooRealVar* gvpvp1Val =
new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
613 gvpvp1Val->removeMin();
614 gvpvp1Val->removeMax();
625 for (
int v=0; v<8; v++){
645 for (
int v=0; v<8; v++){
680 for (
int gg=0; gg<4; gg++){
681 for (
int v=0; v<8; v++){
695 for (
int v=0; v<8; v++){
696 for (
int im=0; im<2; im++){
737 if ((ig==4 && ilam!=2) || (ig>4 && ilam!=0)){
MELAerr <<
"Invalid ZG/GG/VVp/VpVp g" << ig <<
"_prime" << ilam << endl;
return; }
738 if (ig>=16 || ig<0 || (ig<15 && ig>11)){
MELAerr <<
"Invalid g" << ig << endl;
return; }
739 if (ilam>=8 || ilam<0){
MELAerr <<
"Out-of-range g" << ig <<
"_prime" << ilam << endl;
return; }
831 if (ig==0 && ilam==0){
MELAerr <<
"Cannot set fa1! Try to set everything else." << endl;
return; }
832 else if (ig>4 && ilam!=0){
MELAerr <<
"Cannot set fa1 for the g_primes of ZG, GG, VVp or VpVp! Try to set everything else." << endl;
return; }
833 else if (ig==4 && ilam!=2){
MELAerr <<
"Cannot set fa1 for the g_primes of ZG or GG! Try to set everything else." << endl;
return; }
836 g1Frac[ilam-1]->setVal(altparam_fracval);
837 g1Phase[ilam-1]->setVal(iphase);
840 g2Frac[ilam]->setVal(altparam_fracval);
844 g3Frac[ilam]->setVal(altparam_fracval);
848 g4Frac[ilam]->setVal(altparam_fracval);
852 gzgs1Frac[ilam-2]->setVal(altparam_fracval);
856 gzgs2Frac[ilam]->setVal(altparam_fracval);
860 gzgs3Frac[ilam]->setVal(altparam_fracval);
864 gzgs4Frac[ilam]->setVal(altparam_fracval);
880 gvvp1Frac[ilam]->setVal(altparam_fracval);
891 for (
int ilam=0; ilam<8; ilam++){
893 for (
int im=0; im<2; im++){
916 g1Frac[ilam-1]->setVal(0.);
966 for (
int ig=0; ig<8; ig++){
967 for (
int im=0; im<2; im++){
995 for (
int ilam=0; ilam<8; ilam++){
997 g1Frac[ilam-1]->setConstant(yesNo);
998 g1Phase[ilam-1]->setConstant(yesNo);
1000 g2Frac[ilam]->setConstant(yesNo);
1001 g2Phase[ilam]->setConstant(yesNo);
1002 g3Frac[ilam]->setConstant(yesNo);
1003 g3Phase[ilam]->setConstant(yesNo);
1004 g4Frac[ilam]->setConstant(yesNo);
1005 g4Phase[ilam]->setConstant(yesNo);