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);