JHUGen MELA  JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
ScalarPdfFactory.cc
Go to the documentation of this file.
1 #include "ScalarPdfFactory.h"
2 
3 
4 using namespace std;
5 using namespace MELAStreamHelpers;
6 
7 
8 ScalarPdfFactory::ScalarPdfFactory(RooSpin::modelMeasurables const& measurables_, bool acceptance_, RooSpin::VdecayType V1decay_, RooSpin::VdecayType V2decay_, Bool_t OnshellH_) :
9 SpinPdfFactory(measurables_, V1decay_, V2decay_, OnshellH_),
10 parameterization(0),
11 pmf_applied(false),
12 acceptance(acceptance_)
13 {
14  initGVals();
15 }
17  RooSpin::modelMeasurables const& measurables_,
18  double gRatio_[4][8],
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_,
24  RooSpin::VdecayType V1decay_, RooSpin::VdecayType V2decay_, Bool_t OnshellH_
25 ) : SpinPdfFactory(measurables_, V1decay_, V2decay_, OnshellH_),
26 parameterization(1),
27 pmf_applied(pmf_applied_),
28 acceptance(acceptance_)
29 {
30  for (int v=0; v<4; v++){
31  for (int k=0; k<8; k++){
32  gRatio[v][k] = gRatio_[v][k];
33  if (k==0){
34  gZGsRatio[v][k] = gZGsRatio_[v][k];
35  if (v>0) gGsGsRatio[v-1][k] = gGsGsRatio_[v-1][k];
36  if (v==0){
37  gVVpRatio[v][k]=gVVpRatio_[v][k];
38  gVpVpRatio[v][k]=gVVpRatio_[v][k];
39  }
40  }
41  }
42  }
43  initGVals();
44 }
46  destroyGVals();
47 }
48 
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]);
53 
54  // ZG, GG
55  if (k==0){
56  // Special case for ZG ghzgs1_prime2!!!
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]);
60  if (v==0){
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]);
63  }
64  }
65 
66  }
67  }
68 
69  RooArgList gBareFracList;
70  for (int v=0; v<8; v++){
71  TString strcore;
72  TString strapp;
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");
78 
79  double firstFracVal = 0;
80  double phaseBound = TMath::Pi();
81  if (pmf_applied){
82  firstFracVal = -1;
83  phaseBound = 0;
84  }
85 
86  if (v>0){
87  strcore = "g1";
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]));
92 
93  if (v==2){ // ghzgs_prime2
94  strcore = "gzgs1";
95  strcore.Append(strapp);
96  if (gZGsRatioVal[0][v-2]!=0) gzgs1Frac[v-2] = new RooRealVar(strcore, strcore, 0, firstFracVal, 1);
97  else gzgs1Frac[v-2] = new RooRealVar(strcore, strcore, 0);
98  gBareFracList.add(*(gzgs1Frac[v-2]));
99  }
100  }
101 
102  strcore = "g2";
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]));
107  if (v==0){ // ghzgs2 and ghgsgs2
108  strcore = "gzgs2";
109  strcore.Append(strapp);
110  if (gZGsRatioVal[1][v]!=0) gzgs2Frac[v] = new RooRealVar(strcore, strcore, 0, firstFracVal, 1);
111  else gzgs2Frac[v] = new RooRealVar(strcore, strcore, 0);
112  gBareFracList.add(*(gzgs2Frac[v]));
113  strcore = "ggsgs2";
114  strcore.Append(strapp);
115  if (gGsGsRatioVal[0][v]!=0) ggsgs2Frac[v] = new RooRealVar(strcore, strcore, 0, firstFracVal, 1);
116  else ggsgs2Frac[v] = new RooRealVar(strcore, strcore, 0);
117  gBareFracList.add(*(ggsgs2Frac[v]));
118  }
119 
120  strcore = "g3";
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]));
125  if (v==0){ // ghzgs3 and ghgsgs3
126  strcore = "gzgs3";
127  strcore.Append(strapp);
128  if (gZGsRatioVal[2][v]!=0) gzgs3Frac[v] = new RooRealVar(strcore, strcore, 0, firstFracVal, 1);
129  else gzgs3Frac[v] = new RooRealVar(strcore, strcore, 0);
130  gBareFracList.add(*(gzgs3Frac[v]));
131  strcore = "ggsgs3";
132  strcore.Append(strapp);
133  if (gGsGsRatioVal[1][v]!=0) ggsgs3Frac[v] = new RooRealVar(strcore, strcore, 0, firstFracVal, 1);
134  else ggsgs3Frac[v] = new RooRealVar(strcore, strcore, 0);
135  gBareFracList.add(*(ggsgs3Frac[v]));
136  }
137 
138  strcore = "g4";
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]));
143  if (v==0){ // ghzgs4 and ghgsgs4
144  strcore = "gzgs4";
145  strcore.Append(strapp);
146  if (gZGsRatioVal[3][v]!=0) gzgs4Frac[v] = new RooRealVar(strcore, strcore, 0, firstFracVal, 1);
147  else gzgs4Frac[v] = new RooRealVar(strcore, strcore, 0);
148  gBareFracList.add(*(gzgs4Frac[v]));
149  strcore = "ggsgs4";
150  strcore.Append(strapp);
151  if (gGsGsRatioVal[2][v]!=0) ggsgs4Frac[v] = new RooRealVar(strcore, strcore, 0, firstFracVal, 1);
152  else ggsgs4Frac[v] = new RooRealVar(strcore, strcore, 0);
153  gBareFracList.add(*(ggsgs4Frac[v]));
154  }
155 
156  if (v==0){ // ghzzp1/ghwwp1 and ghzpzp1/ghwpwp1
157  strcore = "gvvp1";
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);
161  gBareFracList.add(*(gvvp1Frac[v]));
162 
163  strcore = "gvpvp1";
164  strcore.Append(strapp);
165  if (gVpVpRatio[0][v]!=0) gvpvp1Frac[v] = new RooRealVar(strcore, strcore, 0, firstFracVal, 1);
166  else gvpvp1Frac[v] = new RooRealVar(strcore, strcore, 0);
167  gBareFracList.add(*(gvpvp1Frac[v]));
168  }
169 
170  if (v>0){
171  strcore = "g1";
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);
175 
176  if (v==2){ // ghzgs_prime2
177  strcore = "gzgs1";
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);
181  }
182  }
183 
184  strcore = "g2";
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);
188  if (v==0){ // ghzgs2 and ghgsgs2
189  strcore = "gzgs2";
190  strcore.Append(strappPhase);
191  if (gZGsRatioVal[1][v]!=0) gzgs2Phase[v] = new RooRealVar(strcore, strcore, 0, -phaseBound, phaseBound);
192  else gzgs2Phase[v] = new RooRealVar(strcore, strcore, 0);
193  strcore = "ggsgs2";
194  strcore.Append(strappPhase);
195  if (gGsGsRatioVal[0][v]!=0) ggsgs2Phase[v] = new RooRealVar(strcore, strcore, 0, -phaseBound, phaseBound);
196  else ggsgs2Phase[v] = new RooRealVar(strcore, strcore, 0);
197  }
198 
199  strcore = "g3";
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);
203  if (v==0){ // ghzgs3 and ghgsgs3
204  strcore = "gzgs3";
205  strcore.Append(strappPhase);
206  if (gZGsRatioVal[2][v]!=0) gzgs3Phase[v] = new RooRealVar(strcore, strcore, 0, -phaseBound, phaseBound);
207  else gzgs3Phase[v] = new RooRealVar(strcore, strcore, 0);
208  strcore = "ggsgs3";
209  strcore.Append(strappPhase);
210  if (gGsGsRatioVal[1][v]!=0) ggsgs3Phase[v] = new RooRealVar(strcore, strcore, 0, -phaseBound, phaseBound);
211  else ggsgs3Phase[v] = new RooRealVar(strcore, strcore, 0);
212  }
213 
214  strcore = "g4";
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);
218  if (v==0){ // ghzgs4 and ghgsgs4
219  strcore = "gzgs4";
220  strcore.Append(strappPhase);
221  if (gZGsRatioVal[3][v]!=0) gzgs4Phase[v] = new RooRealVar(strcore, strcore, 0, -phaseBound, phaseBound);
222  else gzgs4Phase[v] = new RooRealVar(strcore, strcore, 0);
223  strcore = "ggsgs4";
224  strcore.Append(strappPhase);
225  if (gGsGsRatioVal[2][v]!=0) ggsgs4Phase[v] = new RooRealVar(strcore, strcore, 0, -phaseBound, phaseBound);
226  else ggsgs4Phase[v] = new RooRealVar(strcore, strcore, 0);
227  }
228 
229  if (v==0){ // ghzzp1/ghwwp1 and ghzpzp1/ghwpwp1
230  strcore = "gvvp1";
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);
234 
235  strcore = "gvpvp1";
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);
239  }
240  }
241 
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);
249  }
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++){
254  TString strcore;
255  TString strapp;
256  if (v>1) strapp.Prepend(Form("%i", v));
257  if (v>0) strapp.Prepend("_prime");
258  strapp.Append("InterpFrac");
259 
260  if (v>0){
261  strcore = "g1";
262  strcore.Append(strapp);
263  RooArgList tmpArg1(*(g1Frac[v-1]), *gFracSum);
264  g1FracInterp[v] = new RooFormulaVar(strcore, strcore, "(@1>1 ? 0. : @0)", tmpArg1);
265 
266  if (v==2){ // ghzgs_prime2
267  strcore = "gzgs1";
268  strcore.Append(strapp);
269  RooArgList tmpArg_zgs1(*(gzgs1Frac[v-2]), *gFracSum);
270  gzgs1FracInterp[v-2] = new RooFormulaVar(strcore, strcore, "(@1>1 ? 0. : @0)", tmpArg_zgs1);
271  }
272  }
273  else{
274  strcore = "g1";
275  strcore.Append(strapp);
276  RooArgList tmpGArg(*gFracSum);
277  g1FracInterp[v] = new RooFormulaVar(strcore, strcore, "(@0>1 ? 0. : abs(1.-@0))", tmpGArg);
278  }
279 
280  strcore = "g2";
281  strcore.Append(strapp);
282  RooArgList tmpArg2(*(g2Frac[v]), *gFracSum);
283  g2FracInterp[v] = new RooFormulaVar(strcore, strcore, "(@1>1 ? 0. : @0)", tmpArg2);
284  if (v==0){ // ghzgs2 and ghgsgs2
285  strcore = "gzgs2";
286  strcore.Append(strapp);
287  RooArgList tmpArg_zgs2(*(gzgs2Frac[v]), *gFracSum);
288  gzgs2FracInterp[v] = new RooFormulaVar(strcore, strcore, "(@1>1 ? 0. : @0)", tmpArg_zgs2);
289 
290  strcore = "ggsgs2";
291  strcore.Append(strapp);
292  RooArgList tmpArg_gsgs2(*(ggsgs2Frac[v]), *gFracSum);
293  ggsgs2FracInterp[v] = new RooFormulaVar(strcore, strcore, "(@1>1 ? 0. : @0)", tmpArg_gsgs2);
294  }
295 
296  strcore = "g3";
297  strcore.Append(strapp);
298  RooArgList tmpArg3(*(g3Frac[v]), *gFracSum);
299  g3FracInterp[v] = new RooFormulaVar(strcore, strcore, "(@1>1 ? 0. : @0)", tmpArg3);
300  if (v==0){ // ghzgs3 and ghgsgs3
301  strcore = "gzgs3";
302  strcore.Append(strapp);
303  RooArgList tmpArg_zgs3(*(gzgs3Frac[v]), *gFracSum);
304  gzgs3FracInterp[v] = new RooFormulaVar(strcore, strcore, "(@1>1 ? 0. : @0)", tmpArg_zgs3);
305 
306  strcore = "ggsgs3";
307  strcore.Append(strapp);
308  RooArgList tmpArg_gsgs3(*(ggsgs3Frac[v]), *gFracSum);
309  ggsgs3FracInterp[v] = new RooFormulaVar(strcore, strcore, "(@1>1 ? 0. : @0)", tmpArg_gsgs3);
310  }
311 
312  strcore = "g4";
313  strcore.Append(strapp);
314  RooArgList tmpArg4(*(g4Frac[v]), *gFracSum);
315  g4FracInterp[v] = new RooFormulaVar(strcore, strcore, "(@1>1 ? 0. : @0)", tmpArg4);
316  if (v==0){ // ghzgs4 and ghgsgs4
317  strcore = "gzgs4";
318  strcore.Append(strapp);
319  RooArgList tmpArg_zgs4(*(gzgs4Frac[v]), *gFracSum);
320  gzgs4FracInterp[v] = new RooFormulaVar(strcore, strcore, "(@1>1 ? 0. : @0)", tmpArg_zgs4);
321 
322  strcore = "ggsgs4";
323  strcore.Append(strapp);
324  RooArgList tmpArg_gsgs4(*(ggsgs4Frac[v]), *gFracSum);
325  ggsgs4FracInterp[v] = new RooFormulaVar(strcore, strcore, "(@1>1 ? 0. : @0)", tmpArg_gsgs4);
326  }
327 
328  if (v==0){ // ghzzp1/ghwwp1 and ghzpzp1/ghwpwp1
329  strcore = "gvvp1";
330  strcore.Append(strapp);
331  RooArgList tmpArg_vvp1(*(gvvp1Frac[v]), *gFracSum);
332  gvvp1FracInterp[v] = new RooFormulaVar(strcore, strcore, "(@1>1 ? 0. : @0)", tmpArg_vvp1);
333 
334  strcore = "gvpvp1";
335  strcore.Append(strapp);
336  RooArgList tmpArg_vpvp1(*(gvpvp1Frac[v]), *gFracSum);
337  gvpvp1FracInterp[v] = new RooFormulaVar(strcore, strcore, "(@1>1 ? 0. : @0)", tmpArg_vpvp1);
338  }
339  }
340  for (int v=0; v<8; v++){
341  for (int im=0; im<2; im++){
342  TString strcore;
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");
347 
348  strcore = "g1";
349  strcore.Append(strapp);
350  RooArgList tmpArg1(*(gRatioVal[0][v]), *(g1FracInterp[v]));
351  TString strFormulag1 = "@0*sqrt(@1)";
352  if (v>0){
353  tmpArg1.add(*(g1Phase[v-1]));
354  if (im==0) strFormulag1.Append("*cos(@2)");
355  else strFormulag1.Append("*sin(@2)");
356  }
357  RooFormulaVar* g1Val = new RooFormulaVar(strcore, strcore, strFormulag1, tmpArg1);
358  couplings.g1List[v][im] = (RooAbsReal*)g1Val;
359 
360  strcore = "g2";
361  strcore.Append(strapp);
362  RooArgList tmpArg2(*(gRatioVal[1][v]), *(g2FracInterp[v]), *(g2Phase[v]));
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);
367  couplings.g2List[v][im] = (RooAbsReal*)g2Val;
368 
369  strcore = "g3";
370  strcore.Append(strapp);
371  RooArgList tmpArg3(*(gRatioVal[2][v]), *(g3FracInterp[v]), *(g3Phase[v]));
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);
376  couplings.g3List[v][im] = (RooAbsReal*)g3Val;
377 
378  strcore = "g4";
379  strcore.Append(strapp);
380  RooArgList tmpArg4(*(gRatioVal[3][v]), *(g4FracInterp[v]), *(g4Phase[v]));
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);
385  couplings.g4List[v][im] = (RooAbsReal*)g4Val;
386 
387  // Z+gamma*
388  if (v==2){
389  strcore = "gzgs1";
390  strcore.Append(strapp);
391  RooArgList tmpArg_zgs1(*(gZGsRatioVal[0][v-2]), *(gzgs1FracInterp[v-2]), *(gzgs1Phase[v-2]));
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);
396  couplings.gzgs1List[v-2][im] = (RooAbsReal*)gzgs1Val;
397  }
398  if (v==0){
399  strcore = "gzgs2";
400  strcore.Append(strapp);
401  RooArgList tmpArg_zgs2(*(gZGsRatioVal[1][v]), *(gzgs2FracInterp[v]), *(gzgs2Phase[v]));
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);
406  couplings.gzgs2List[v][im] = (RooAbsReal*)gzgs2Val;
407 
408  strcore = "gzgs3";
409  strcore.Append(strapp);
410  RooArgList tmpArg_zgs3(*(gZGsRatioVal[1][v]), *(gzgs3FracInterp[v]), *(gzgs3Phase[v]));
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);
415  couplings.gzgs3List[v][im] = (RooAbsReal*)gzgs3Val;
416 
417  strcore = "gzgs4";
418  strcore.Append(strapp);
419  RooArgList tmpArg_zgs4(*(gZGsRatioVal[1][v]), *(gzgs4FracInterp[v]), *(gzgs4Phase[v]));
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);
424  couplings.gzgs4List[v][im] = (RooAbsReal*)gzgs4Val;
425 
426  strcore = "ggsgs2";
427  strcore.Append(strapp);
428  RooArgList tmpArg_gsgs2(*(gGsGsRatioVal[0][v]), *(ggsgs2FracInterp[v]), *(ggsgs2Phase[v]));
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);
433  couplings.ggsgs2List[v][im] = (RooAbsReal*)ggsgs2Val;
434 
435  strcore = "ggsgs3";
436  strcore.Append(strapp);
437  RooArgList tmpArg_gsgs3(*(gGsGsRatioVal[1][v]), *(ggsgs3FracInterp[v]), *(ggsgs3Phase[v]));
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);
442  couplings.ggsgs3List[v][im] = (RooAbsReal*)ggsgs3Val;
443 
444  strcore = "ggsgs4";
445  strcore.Append(strapp);
446  RooArgList tmpArg_gsgs4(*(gGsGsRatioVal[2][v]), *(ggsgs4FracInterp[v]), *(ggsgs4Phase[v]));
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);
451  couplings.ggsgs4List[v][im] = (RooAbsReal*)ggsgs4Val;
452 
453  // ghzzp1/ghwwp1 and ghzpzp1/ghwpwp1
454  strcore = "gvvp1";
455  strcore.Append(strapp);
456  RooArgList tmpArg_vvp1(*(gVVpRatioVal[0][v]), *(gvvp1FracInterp[v]), *(gvvp1Phase[v]));
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);
461  couplings.gvvp1List[v][im] = (RooAbsReal*) gvvp1Val;
462 
463  strcore = "gvpvp1";
464  strcore.Append(strapp);
465  RooArgList tmpArg_vpvp1(*(gVpVpRatioVal[0][v]), *(gvpvp1FracInterp[v]), *(gvpvp1Phase[v]));
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);
470  couplings.gvpvp1List[v][im] = (RooAbsReal*) gvpvp1Val;
471  }
472 
473  }
474  }
475 }
477  couplings.Lambda = new RooRealVar("Lambda", "Lambda", 1000.);
478  couplings.Lambda_z1 = new RooRealVar("Lambda_z1", "Lambda_z1", 10000.);
479  couplings.Lambda_z2 = new RooRealVar("Lambda_z2", "Lambda_z2", 10000.);
480  couplings.Lambda_z3 = new RooRealVar("Lambda_z3", "Lambda_z3", 10000.);
481  couplings.Lambda_z4 = new RooRealVar("Lambda_z4", "Lambda_z4", 10000.);
482  couplings.Lambda_Q = new RooRealVar("Lambda_Q", "Lambda_Q", 10000.);
483  couplings.Lambda_zgs1 = new RooRealVar("Lambda_zgs1", "Lambda_zgs1", 10000.);
484 
485  for (int v=0; v<SIZE_HVV_CQSQ; v++){
486  TString strcore;
487  double initval = 100.;
488 
489  strcore = "Lambda_z1";
490  strcore.Append(Form("%i", (v!=3 ? v+1 : 0)));
491  couplings.Lambda_z1qsq[v] = new RooRealVar(strcore, strcore, initval, 0., 1e15);
492  ((RooRealVar*)couplings.Lambda_z1qsq[v])->removeMax();
493  strcore = "Lambda_z2";
494  strcore.Append(Form("%i", (v!=3 ? v+1 : 0)));
495  couplings.Lambda_z2qsq[v] = new RooRealVar(strcore, strcore, initval, 0., 1e15);
496  ((RooRealVar*)couplings.Lambda_z2qsq[v])->removeMax();
497  strcore = "Lambda_z3";
498  strcore.Append(Form("%i", (v!=3 ? v+1 : 0)));
499  couplings.Lambda_z3qsq[v] = new RooRealVar(strcore, strcore, initval, 0., 1e15);
500  ((RooRealVar*)couplings.Lambda_z3qsq[v])->removeMax();
501  strcore = "Lambda_z4";
502  strcore.Append(Form("%i", (v!=3 ? v+1 : 0)));
503  couplings.Lambda_z4qsq[v] = new RooRealVar(strcore, strcore, initval, 0., 1e15);
504  ((RooRealVar*)couplings.Lambda_z4qsq[v])->removeMax();
505 
506  initval=0;
507  strcore = "cz_q";
508  strcore.Append(Form("%i%s", (v!=3 ? v+1 : 12),"sq"));
509  couplings.cLambda_qsq[v] = new RooRealVar(strcore, strcore, initval, -1., 1.);
510  }
511 
512  if (parameterization==0){
513  for (int v=0; v<8; v++){
514  for (int im=0; im<2; im++){
515  TString strcore;
516  double initval = ((v==0 && im==0) ? 1 : 0);
517 
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");
522 
523  strcore = "g1";
524  strcore.Append(strapp);
525  RooRealVar* g1Val = new RooRealVar(strcore, strcore, initval, -1e15, 1e15);
526  g1Val->removeMin();
527  g1Val->removeMax();
528  couplings.g1List[v][im] = (RooAbsReal*)g1Val;
529 
530  strcore = "g2";
531  strcore.Append(strapp);
532  RooRealVar* g2Val = new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
533  g2Val->removeMin();
534  g2Val->removeMax();
535  couplings.g2List[v][im] = (RooAbsReal*)g2Val;
536 
537  strcore = "g3";
538  strcore.Append(strapp);
539  RooRealVar* g3Val = new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
540  g3Val->removeMin();
541  g3Val->removeMax();
542  couplings.g3List[v][im] = (RooAbsReal*)g3Val;
543 
544  strcore = "g4";
545  strcore.Append(strapp);
546  RooRealVar* g4Val = new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
547  g4Val->removeMin();
548  g4Val->removeMax();
549  couplings.g4List[v][im] = (RooAbsReal*)g4Val;
550 
551  if (v==2){
552  strcore = "gzgs1";
553  strcore.Append(strapp);
554  RooRealVar* gzgs1Val = new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
555  gzgs1Val->removeMin();
556  gzgs1Val->removeMax();
557  couplings.gzgs1List[v-2][im] = (RooAbsReal*)gzgs1Val;
558  }
559  if(v==0){
560  strcore = "gzgs2";
561  strcore.Append(strapp);
562  RooRealVar* gzgs2Val = new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
563  gzgs2Val->removeMin();
564  gzgs2Val->removeMax();
565  couplings.gzgs2List[v][im] = (RooAbsReal*)gzgs2Val;
566 
567  strcore = "gzgs3";
568  strcore.Append(strapp);
569  RooRealVar* gzgs3Val = new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
570  gzgs3Val->removeMin();
571  gzgs3Val->removeMax();
572  couplings.gzgs3List[v][im] = (RooAbsReal*)gzgs3Val;
573 
574  strcore = "gzgs4";
575  strcore.Append(strapp);
576  RooRealVar* gzgs4Val = new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
577  gzgs4Val->removeMin();
578  gzgs4Val->removeMax();
579  couplings.gzgs4List[v][im] = (RooAbsReal*)gzgs4Val;
580 
581  strcore = "ggsgs2";
582  strcore.Append(strapp);
583  RooRealVar* ggsgs2Val = new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
584  ggsgs2Val->removeMin();
585  ggsgs2Val->removeMax();
586  couplings.ggsgs2List[v][im] = (RooAbsReal*)ggsgs2Val;
587 
588  strcore = "ggsgs3";
589  strcore.Append(strapp);
590  RooRealVar* ggsgs3Val = new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
591  ggsgs3Val->removeMin();
592  ggsgs3Val->removeMax();
593  couplings.ggsgs3List[v][im] = (RooAbsReal*)ggsgs3Val;
594 
595  strcore = "ggsgs4";
596  strcore.Append(strapp);
597  RooRealVar* ggsgs4Val = new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
598  ggsgs4Val->removeMin();
599  ggsgs4Val->removeMax();
600  couplings.ggsgs4List[v][im] = (RooAbsReal*)ggsgs4Val;
601 
602  // ghzzp1/ghwwp1 and ghzpzp1/ghwpwp1
603  strcore = "gvvp1";
604  strcore.Append(strapp);
605  RooRealVar* gvvp1Val = new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
606  gvvp1Val->removeMin();
607  gvvp1Val->removeMax();
608  couplings.gvvp1List[v][im] = (RooAbsReal*) gvvp1Val;
609 
610  strcore = "gvpvp1";
611  strcore.Append(strapp);
612  RooRealVar* gvpvp1Val = new RooRealVar(strcore, strcore, 0, -1e15, 1e15);
613  gvpvp1Val->removeMin();
614  gvpvp1Val->removeMax();
615  couplings.gvpvp1List[v][im] = (RooAbsReal*) gvpvp1Val;
616  }
617 
618  }
619  }
620  }
621  else initFractionsPhases();
622 }
623 
625  for (int v=0; v<8; v++){
626  delete g1FracInterp[v];
627  delete g2FracInterp[v];
628  delete g3FracInterp[v];
629  delete g4FracInterp[v];
630  if (v==2){
631  delete gzgs1FracInterp[v-2];
632  }
633  if (v==0){
634  delete gzgs2FracInterp[v];
635  delete gzgs3FracInterp[v];
636  delete gzgs4FracInterp[v];
637  delete ggsgs2FracInterp[v];
638  delete ggsgs3FracInterp[v];
639  delete ggsgs4FracInterp[v];
640  delete gvvp1FracInterp[v];
641  delete gvpvp1FracInterp[v];
642  }
643  }
644  delete gFracSum;
645  for (int v=0; v<8; v++){
646  delete g2Frac[v];
647  delete g3Frac[v];
648  delete g4Frac[v];
649  delete g2Phase[v];
650  delete g3Phase[v];
651  delete g4Phase[v];
652  if (v>0){
653  delete g1Frac[v-1];
654  delete g1Phase[v-1];
655  }
656 
657  if (v==2){
658  delete gzgs1Frac[v-2];
659  delete gzgs1Phase[v-2];
660  }
661  if (v==0){
662  delete gzgs2Frac[v];
663  delete gzgs3Frac[v];
664  delete gzgs4Frac[v];
665  delete ggsgs2Frac[v];
666  delete ggsgs3Frac[v];
667  delete ggsgs4Frac[v];
668  delete gzgs2Phase[v];
669  delete gzgs3Phase[v];
670  delete gzgs4Phase[v];
671  delete ggsgs2Phase[v];
672  delete ggsgs3Phase[v];
673  delete ggsgs4Phase[v];
674  delete gvvp1Frac[v];
675  delete gvpvp1Frac[v];
676  delete gvvp1Phase[v];
677  delete gvpvp1Phase[v];
678  }
679  }
680  for (int gg=0; gg<4; gg++){
681  for (int v=0; v<8; v++){
682  delete gRatioVal[gg][v];
683  if (v==0){
684  delete gZGsRatioVal[gg][v];
685  if (gg>0) delete gGsGsRatioVal[gg-1][v];
686  if (gg==0){
687  delete gVVpRatioVal[gg][v];
688  delete gVpVpRatioVal[gg][v];
689  }
690  }
691  }
692  }
693 }
695  for (int v=0; v<8; v++){
696  for (int im=0; im<2; im++){
697  delete couplings.g1List[v][im];
698  delete couplings.g2List[v][im];
699  delete couplings.g3List[v][im];
700  delete couplings.g4List[v][im];
701 
702  if (v==2){
703  delete couplings.gzgs1List[v-2][im];
704  }
705  if (v==0){
706  delete couplings.gzgs2List[v][im];
707  delete couplings.gzgs3List[v][im];
708  delete couplings.gzgs4List[v][im];
709  delete couplings.ggsgs2List[v][im];
710  delete couplings.ggsgs3List[v][im];
711  delete couplings.ggsgs4List[v][im];
712  }
713  if (v==0){
714  delete couplings.gvvp1List[v][im];
715  delete couplings.gvpvp1List[v][im];
716  }
717  }
718  }
720  for (int v=0; v<SIZE_HVV_CQSQ; v++){
721  delete couplings.Lambda_z1qsq[v];
722  delete couplings.Lambda_z2qsq[v];
723  delete couplings.Lambda_z3qsq[v];
724  delete couplings.Lambda_z4qsq[v];
725  delete couplings.cLambda_qsq[v];
726  }
727  delete couplings.Lambda;
728  delete couplings.Lambda_zgs1;
729  delete couplings.Lambda_z1;
730  delete couplings.Lambda_z2;
731  delete couplings.Lambda_z3;
732  delete couplings.Lambda_z4;
733  delete couplings.Lambda_Q;
734 }
735 
736 void ScalarPdfFactory::addHypothesis(int ig, int ilam, double iphase, double altparam_fracval){
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; }
740 
741  if (parameterization==0){
742  double mVval;
743  getMVGamV(&mVval);
744 
745  // Good guesses of c-constants
746  Double_t initval=1.;
747  if (ilam>0){
748  if (ig==0){ // g1_dyn
749  if (ilam>=1 && ilam<=3) initval = pow(couplings.Lambda_z1->getVal()/mVval, 2);
750  else if (ilam>=5 && ilam<=7) initval = pow(couplings.Lambda_z1->getVal()/mVval, 4);
751  else if (ilam==4) initval = pow(couplings.Lambda_Q->getVal()/parameters.mX->getVal(), 2);
752  }
753  else if (ig==1){ // g2_dyn
754  if (ilam>=1 && ilam<=3) initval = pow(couplings.Lambda_z2->getVal()/mVval, 2);
755  else if (ilam>=5 && ilam<=7) initval = pow(couplings.Lambda_z2->getVal()/mVval, 4);
756  else if (ilam==4) initval = pow(couplings.Lambda_Q->getVal()/parameters.mX->getVal(), 2);
757  }
758  else if (ig==2){ // g3_dyn
759  if (ilam>=1 && ilam<=3) initval = pow(couplings.Lambda_z3->getVal()/mVval, 2);
760  else if (ilam>=5 && ilam<=7) initval = pow(couplings.Lambda_z3->getVal()/mVval, 4);
761  else if (ilam==4) initval = pow(couplings.Lambda_Q->getVal()/parameters.mX->getVal(), 2);
762  }
763  else if (ig==3){ // g4_dyn
764  if (ilam>=1 && ilam<=3) initval = pow(couplings.Lambda_z4->getVal()/mVval, 2);
765  else if (ilam>=5 && ilam<=7) initval = pow(couplings.Lambda_z4->getVal()/mVval, 4);
766  else if (ilam==4) initval = pow(couplings.Lambda_Q->getVal()/parameters.mX->getVal(), 2);
767  }
768  else if (ig==4){ // gzgs1_dyn
769  if (ilam>=1 && ilam<=3) initval = pow(couplings.Lambda_zgs1->getVal()/mVval, 2);
770  else if (ilam>=5 && ilam<=7) initval = pow(couplings.Lambda_zgs1->getVal()/mVval, 4);
771  else if (ilam==4) initval = pow(couplings.Lambda_Q->getVal()/parameters.mX->getVal(), 2);
772  }
773  }
774  if (ig==2 || ig==6) initval *= fabs(pow(couplings.Lambda->getVal(), 2)/(pow(parameters.mX->getVal(), 2) - pow(mVval, 2)));
775  if (ig==9) initval *= pow(couplings.Lambda->getVal()/parameters.mX->getVal(), 2);
776 
777  if (ig==0){
778  ((RooRealVar*)couplings.g1List[ilam][0])->setVal(initval*cos(iphase));
779  ((RooRealVar*)couplings.g1List[ilam][1])->setVal(initval*sin(iphase));
780  }
781  else if (ig==1){
782  ((RooRealVar*)couplings.g2List[ilam][0])->setVal(initval*cos(iphase));
783  ((RooRealVar*)couplings.g2List[ilam][1])->setVal(initval*sin(iphase));
784  }
785  else if (ig==2){
786  ((RooRealVar*)couplings.g3List[ilam][0])->setVal(initval*cos(iphase));
787  ((RooRealVar*)couplings.g3List[ilam][1])->setVal(initval*sin(iphase));
788  }
789  else if (ig==3){
790  ((RooRealVar*)couplings.g4List[ilam][0])->setVal(initval*cos(iphase));
791  ((RooRealVar*)couplings.g4List[ilam][1])->setVal(initval*sin(iphase));
792  }
793  else if (ig==4){
794  ((RooRealVar*)couplings.gzgs1List[ilam-2][0])->setVal(initval*cos(iphase));
795  ((RooRealVar*)couplings.gzgs1List[ilam-2][1])->setVal(initval*sin(iphase));
796  }
797  else if (ig==5){
798  ((RooRealVar*)couplings.gzgs2List[ilam][0])->setVal(initval*cos(iphase));
799  ((RooRealVar*)couplings.gzgs2List[ilam][1])->setVal(initval*sin(iphase));
800  }
801  else if (ig==6){
802  ((RooRealVar*)couplings.gzgs3List[ilam][0])->setVal(initval*cos(iphase));
803  ((RooRealVar*)couplings.gzgs3List[ilam][1])->setVal(initval*sin(iphase));
804  }
805  else if (ig==7){
806  ((RooRealVar*)couplings.gzgs4List[ilam][0])->setVal(initval*cos(iphase));
807  ((RooRealVar*)couplings.gzgs4List[ilam][1])->setVal(initval*sin(iphase));
808  }
809  else if (ig==8){
810  ((RooRealVar*)couplings.ggsgs2List[ilam][0])->setVal(initval*cos(iphase));
811  ((RooRealVar*)couplings.ggsgs2List[ilam][1])->setVal(initval*sin(iphase));
812  }
813  else if (ig==9){
814  ((RooRealVar*)couplings.ggsgs3List[ilam][0])->setVal(initval*cos(iphase));
815  ((RooRealVar*)couplings.ggsgs3List[ilam][1])->setVal(initval*sin(iphase));
816  }
817  else if (ig==10){
818  ((RooRealVar*)couplings.ggsgs4List[ilam][0])->setVal(initval*cos(iphase));
819  ((RooRealVar*)couplings.ggsgs4List[ilam][1])->setVal(initval*sin(iphase));
820  }
821  else if (ig==11){
822  ((RooRealVar*) couplings.gvvp1List[ilam][0])->setVal(initval*cos(iphase));
823  ((RooRealVar*) couplings.gvvp1List[ilam][1])->setVal(initval*sin(iphase));
824  }
825  else if (ig==15){
826  ((RooRealVar*) couplings.gvpvp1List[ilam][0])->setVal(initval*cos(iphase));
827  ((RooRealVar*) couplings.gvpvp1List[ilam][1])->setVal(initval*sin(iphase));
828  }
829  }
830  else{
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; }
834  else{
835  if (ig==0){
836  g1Frac[ilam-1]->setVal(altparam_fracval);
837  g1Phase[ilam-1]->setVal(iphase);
838  }
839  else if (ig==1){
840  g2Frac[ilam]->setVal(altparam_fracval);
841  g2Phase[ilam]->setVal(iphase);
842  }
843  else if (ig==2){
844  g3Frac[ilam]->setVal(altparam_fracval);
845  g3Phase[ilam]->setVal(iphase);
846  }
847  else if (ig==3){
848  g4Frac[ilam]->setVal(altparam_fracval);
849  g4Phase[ilam]->setVal(iphase);
850  }
851  else if (ig==4){
852  gzgs1Frac[ilam-2]->setVal(altparam_fracval);
853  gzgs1Phase[ilam-2]->setVal(iphase);
854  }
855  else if (ig==5){
856  gzgs2Frac[ilam]->setVal(altparam_fracval);
857  gzgs2Phase[ilam]->setVal(iphase);
858  }
859  else if (ig==6){
860  gzgs3Frac[ilam]->setVal(altparam_fracval);
861  gzgs3Phase[ilam]->setVal(iphase);
862  }
863  else if (ig==7){
864  gzgs4Frac[ilam]->setVal(altparam_fracval);
865  gzgs4Phase[ilam]->setVal(iphase);
866  }
867  else if (ig==8){
868  ggsgs2Frac[ilam]->setVal(altparam_fracval);
869  ggsgs2Phase[ilam]->setVal(iphase);
870  }
871  else if (ig==9){
872  ggsgs3Frac[ilam]->setVal(altparam_fracval);
873  ggsgs3Phase[ilam]->setVal(iphase);
874  }
875  else if (ig==10){
876  ggsgs4Frac[ilam]->setVal(altparam_fracval);
877  ggsgs4Phase[ilam]->setVal(iphase);
878  }
879  else if (ig==11){
880  gvvp1Frac[ilam]->setVal(altparam_fracval);
881  gvvp1Phase[ilam]->setVal(iphase);
882  }
883  else if (ig==15){
884  gvpvp1Frac[ilam]->setVal(altparam_fracval);
885  gvpvp1Phase[ilam]->setVal(iphase);
886  }
887  }
888  }
889 }
891  for (int ilam=0; ilam<8; ilam++){
892  if (parameterization==0){
893  for (int im=0; im<2; im++){
894  ((RooRealVar*)couplings.g1List[ilam][im])->setVal(0.); // This is different from setting the fractions!
895  ((RooRealVar*)couplings.g2List[ilam][im])->setVal(0.);
896  ((RooRealVar*)couplings.g3List[ilam][im])->setVal(0.);
897  ((RooRealVar*)couplings.g4List[ilam][im])->setVal(0.);
898 
899  if (ilam==2){
900  ((RooRealVar*)couplings.gzgs1List[ilam-2][im])->setVal(0.);
901  }
902  if (ilam==0){
903  ((RooRealVar*)couplings.gzgs2List[ilam][im])->setVal(0.);
904  ((RooRealVar*)couplings.gzgs3List[ilam][im])->setVal(0.);
905  ((RooRealVar*)couplings.gzgs4List[ilam][im])->setVal(0.);
906  ((RooRealVar*)couplings.ggsgs2List[ilam][im])->setVal(0.);
907  ((RooRealVar*)couplings.ggsgs3List[ilam][im])->setVal(0.);
908  ((RooRealVar*)couplings.ggsgs4List[ilam][im])->setVal(0.);
909  ((RooRealVar*)couplings.gvvp1List[ilam][im])->setVal(0.);
910  ((RooRealVar*)couplings.gvpvp1List[ilam][im])->setVal(0.);
911  }
912  }
913  }
914  else{
915  if (ilam>0){
916  g1Frac[ilam-1]->setVal(0.);
917  g1Phase[ilam-1]->setVal(0.);
918 
919  if (ilam==2){
920  gzgs1Frac[ilam-2]->setVal(0.);
921  gzgs1Phase[ilam-2]->setVal(0.);
922  }
923  }
924  else{
925  g2Frac[ilam]->setVal(0.);
926  g2Phase[ilam]->setVal(0.);
927  g3Frac[ilam]->setVal(0.);
928  g3Phase[ilam]->setVal(0.);
929  g4Frac[ilam]->setVal(0.);
930  g4Phase[ilam]->setVal(0.);
931 
932  if (ilam==0){
933  gzgs2Frac[ilam]->setVal(0.);
934  gzgs2Phase[ilam]->setVal(0.);
935  gzgs3Frac[ilam]->setVal(0.);
936  gzgs3Phase[ilam]->setVal(0.);
937  gzgs4Frac[ilam]->setVal(0.);
938  gzgs4Phase[ilam]->setVal(0.);
939  ggsgs2Frac[ilam]->setVal(0.);
940  ggsgs2Phase[ilam]->setVal(0.);
941  ggsgs3Frac[ilam]->setVal(0.);
942  ggsgs3Phase[ilam]->setVal(0.);
943  ggsgs4Frac[ilam]->setVal(0.);
944  ggsgs4Phase[ilam]->setVal(0.);
945  gvvp1Frac[ilam]->setVal(0.);
946  gvvp1Phase[ilam]->setVal(0.);
947  gvpvp1Frac[ilam]->setVal(0.);
948  gvpvp1Phase[ilam]->setVal(0.);
949  }
950  }
951  }
952  }
953 }
954 
956  couplings.Lambda->setConstant(true); // The user is not allowed to change the lambda values!
957  couplings.Lambda_zgs1->setConstant(true);
958  couplings.Lambda_z1->setConstant(true);
959  couplings.Lambda_z2->setConstant(true);
960  couplings.Lambda_z3->setConstant(true);
961  couplings.Lambda_z4->setConstant(true);
962  couplings.Lambda_Q->setConstant(true);
963 
964  if (parameterization==0){
965  // Set the g decay couplings
966  for (int ig=0; ig<8; ig++){
967  for (int im=0; im<2; im++){
968  ((RooRealVar*)couplings.g1List[ig][im])->setConstant(yesNo);
969  ((RooRealVar*)couplings.g2List[ig][im])->setConstant(yesNo);
970  ((RooRealVar*)couplings.g3List[ig][im])->setConstant(yesNo);
971  ((RooRealVar*)couplings.g4List[ig][im])->setConstant(yesNo);
972 
973  if (ig==2) ((RooRealVar*)couplings.gzgs1List[ig-2][im])->setConstant(yesNo); // ghzgs_prime2
974  if (ig==0){
975  ((RooRealVar*)couplings.gzgs2List[ig][im])->setConstant(yesNo);
976  ((RooRealVar*)couplings.gzgs3List[ig][im])->setConstant(yesNo);
977  ((RooRealVar*)couplings.gzgs4List[ig][im])->setConstant(yesNo);
978  ((RooRealVar*)couplings.ggsgs2List[ig][im])->setConstant(yesNo);
979  ((RooRealVar*)couplings.ggsgs3List[ig][im])->setConstant(yesNo);
980  ((RooRealVar*)couplings.ggsgs4List[ig][im])->setConstant(yesNo);
981  ((RooRealVar*)couplings.gvvp1List[ig][im])->setConstant(yesNo);
982  ((RooRealVar*)couplings.gvpvp1List[ig][im])->setConstant(yesNo);
983  }
984  }
985  }
986  for (int iV=0; iV<SIZE_HVV_CQSQ; iV++){
987  ((RooRealVar*)couplings.Lambda_z1qsq[iV])->setConstant(yesNo);
988  ((RooRealVar*)couplings.Lambda_z2qsq[iV])->setConstant(yesNo);
989  ((RooRealVar*)couplings.Lambda_z3qsq[iV])->setConstant(yesNo);
990  ((RooRealVar*)couplings.Lambda_z4qsq[iV])->setConstant(yesNo);
991  ((RooRealVar*)couplings.cLambda_qsq[iV])->setConstant(yesNo);
992  }
993  }
994  else{
995  for (int ilam=0; ilam<8; ilam++){
996  if (ilam==1){
997  g1Frac[ilam-1]->setConstant(yesNo);
998  g1Phase[ilam-1]->setConstant(yesNo);
999  }
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);
1006  if (ilam==2){
1007  gzgs1Frac[ilam-2]->setConstant(yesNo);
1008  gzgs1Phase[ilam-2]->setConstant(yesNo);
1009  }
1010  if (ilam==0){
1011  gzgs2Frac[ilam]->setConstant(yesNo);
1012  gzgs2Phase[ilam]->setConstant(yesNo);
1013  gzgs3Frac[ilam]->setConstant(yesNo);
1014  gzgs3Phase[ilam]->setConstant(yesNo);
1015  gzgs4Frac[ilam]->setConstant(yesNo);
1016  gzgs4Phase[ilam]->setConstant(yesNo);
1017  ggsgs2Frac[ilam]->setConstant(yesNo);
1018  ggsgs2Phase[ilam]->setConstant(yesNo);
1019  ggsgs3Frac[ilam]->setConstant(yesNo);
1020  ggsgs3Phase[ilam]->setConstant(yesNo);
1021  ggsgs4Frac[ilam]->setConstant(yesNo);
1022  ggsgs4Phase[ilam]->setConstant(yesNo);
1023  gvvp1Frac[ilam]->setConstant(yesNo);
1024  gvvp1Phase[ilam]->setConstant(yesNo);
1025  gvpvp1Frac[ilam]->setConstant(yesNo);
1026  gvpvp1Phase[ilam]->setConstant(yesNo);
1027  }
1028  }
1029  }
1030 }
1031 
1032 
ScalarPdfFactory::g4Phase
RooRealVar * g4Phase[8]
Definition: ScalarPdfFactory.h:21
RooSpinZero::modelCouplings::gzgs4List
RooAbsReal * gzgs4List[1][2]
Definition: RooSpinZero.h:19
ScalarPdfFactory::ScalarPdfFactory
ScalarPdfFactory(RooSpin::modelMeasurables const &measurables_, bool acceptance_=false, RooSpin::VdecayType V1decay_=RooSpin::kVdecayType_Zll, RooSpin::VdecayType V2decay_=RooSpin::kVdecayType_Zll, Bool_t OnshellH_=true)
Definition: ScalarPdfFactory.cc:8
ScalarPdfFactory::gzgs2Phase
RooRealVar * gzgs2Phase[1]
Definition: ScalarPdfFactory.h:28
ScalarPdfFactory::gVVpRatio
double gVVpRatio[1][1]
Definition: ScalarPdfFactory.h:95
ScalarPdfFactory::gzgs3FracInterp
RooFormulaVar * gzgs3FracInterp[1]
Definition: ScalarPdfFactory.h:53
ScalarPdfFactory::g2Phase
RooRealVar * g2Phase[8]
Definition: ScalarPdfFactory.h:19
SIZE_HVV_CQSQ
@ SIZE_HVV_CQSQ
Definition: raw_couplings.txt:74
ScalarPdfFactory.h
RooSpinZero::modelCouplings::Lambda_z2
RooRealVar * Lambda_z2
Definition: RooSpinZero.h:27
SpinPdfFactory
Definition: SpinPdfFactory.h:9
ScalarPdfFactory::gzgs4Frac
RooRealVar * gzgs4Frac[1]
Definition: ScalarPdfFactory.h:26
ScalarPdfFactory::destroyFractionsPhases
virtual void destroyFractionsPhases()
Definition: ScalarPdfFactory.cc:624
RooSpinZero::modelCouplings::Lambda_zgs1
RooRealVar * Lambda_zgs1
Definition: RooSpinZero.h:25
ScalarPdfFactory::gZGsRatioVal
RooRealVar * gZGsRatioVal[4][1]
Definition: ScalarPdfFactory.h:64
ScalarPdfFactory::gvvp1FracInterp
RooFormulaVar * gvvp1FracInterp[1]
Definition: ScalarPdfFactory.h:59
ScalarPdfFactory::gvpvp1Frac
RooRealVar * gvpvp1Frac[1]
Definition: ScalarPdfFactory.h:42
ScalarPdfFactory::gzgs1FracInterp
RooFormulaVar * gzgs1FracInterp[1]
Definition: ScalarPdfFactory.h:51
ScalarPdfFactory::gvvp1Phase
RooRealVar * gvvp1Phase[1]
Definition: ScalarPdfFactory.h:40
RooSpinZero::modelCouplings::g2List
RooAbsReal * g2List[8][2]
Definition: RooSpinZero.h:12
ScalarPdfFactory::gzgs3Phase
RooRealVar * gzgs3Phase[1]
Definition: ScalarPdfFactory.h:29
RooSpinZero::modelCouplings::gzgs3List
RooAbsReal * gzgs3List[1][2]
Definition: RooSpinZero.h:18
ScalarPdfFactory::gZGsRatio
double gZGsRatio[4][1]
Definition: ScalarPdfFactory.h:93
RooSpinZero::modelCouplings::gvpvp1List
RooAbsReal * gvpvp1List[1][2]
Definition: RooSpinZero.h:39
ScalarPdfFactory::g3Frac
RooRealVar * g3Frac[8]
Definition: ScalarPdfFactory.h:16
RooSpinZero::modelCouplings::Lambda_z3
RooRealVar * Lambda_z3
Definition: RooSpinZero.h:28
RooSpinZero::modelCouplings::gvvp1List
RooAbsReal * gvvp1List[1][2]
Definition: RooSpinZero.h:38
ScalarPdfFactory::makeCouplingsConst
virtual void makeCouplingsConst(bool yesNo=true)
Definition: ScalarPdfFactory.cc:955
ScalarPdfFactory::ggsgs4Phase
RooRealVar * ggsgs4Phase[1]
Definition: ScalarPdfFactory.h:37
ScalarPdfFactory::gFracSum
RooFormulaVar * gFracSum
Definition: ScalarPdfFactory.h:45
ScalarPdfFactory::gzgs1Phase
RooRealVar * gzgs1Phase[1]
Definition: ScalarPdfFactory.h:27
ScalarPdfFactory::gzgs4Phase
RooRealVar * gzgs4Phase[1]
Definition: ScalarPdfFactory.h:30
ScalarPdfFactory::gRatio
double gRatio[4][8]
Definition: ScalarPdfFactory.h:92
ScalarPdfFactory::g2Frac
RooRealVar * g2Frac[8]
Definition: ScalarPdfFactory.h:15
ScalarPdfFactory::addHypothesis
virtual void addHypothesis(int ig, int ilam, double iphase=0, double altparam_fracval=0)
Definition: ScalarPdfFactory.cc:736
RooSpinZero::modelCouplings::Lambda_z1
RooRealVar * Lambda_z1
Definition: RooSpinZero.h:26
RooSpinZero::modelCouplings::Lambda_Q
RooRealVar * Lambda_Q
Definition: RooSpinZero.h:30
ScalarPdfFactory::g1Phase
RooRealVar * g1Phase[7]
Definition: ScalarPdfFactory.h:18
RooSpinZero::modelCouplings::Lambda_z4qsq
RooAbsReal * Lambda_z4qsq[SIZE_HVV_CQSQ]
Definition: RooSpinZero.h:35
SpinPdfFactory::parameters
RooSpin::modelParameters parameters
Definition: SpinPdfFactory.h:12
ScalarPdfFactory::parameterization
int parameterization
Definition: ScalarPdfFactory.h:88
RooSpinZero::modelCouplings::Lambda_z1qsq
RooAbsReal * Lambda_z1qsq[SIZE_HVV_CQSQ]
Definition: RooSpinZero.h:32
SpinPdfFactory::getMVGamV
virtual void getMVGamV(Double_t *mV=0, Double_t *gamV=0) const
Definition: SpinPdfFactory.cc:86
ScalarPdfFactory::gvpvp1Phase
RooRealVar * gvpvp1Phase[1]
Definition: ScalarPdfFactory.h:43
ScalarPdfFactory::g2FracInterp
RooFormulaVar * g2FracInterp[8]
Definition: ScalarPdfFactory.h:47
ScalarPdfFactory::gvpvp1FracInterp
RooFormulaVar * gvpvp1FracInterp[1]
Definition: ScalarPdfFactory.h:61
ScalarPdfFactory::g3FracInterp
RooFormulaVar * g3FracInterp[8]
Definition: ScalarPdfFactory.h:48
RooSpinZero::modelCouplings::ggsgs4List
RooAbsReal * ggsgs4List[1][2]
Definition: RooSpinZero.h:22
ScalarPdfFactory::g4Frac
RooRealVar * g4Frac[8]
Definition: ScalarPdfFactory.h:17
ScalarPdfFactory::ggsgs2Frac
RooRealVar * ggsgs2Frac[1]
Definition: ScalarPdfFactory.h:32
RooSpinZero::modelCouplings::gzgs2List
RooAbsReal * gzgs2List[1][2]
Definition: RooSpinZero.h:17
RooSpin::modelParameters::mX
RooAbsReal * mX
Definition: RooSpin.h:62
ScalarPdfFactory::resetHypotheses
virtual void resetHypotheses()
Definition: ScalarPdfFactory.cc:890
ScalarPdfFactory::gRatioVal
RooRealVar * gRatioVal[4][8]
Definition: ScalarPdfFactory.h:63
ScalarPdfFactory::ggsgs4Frac
RooRealVar * ggsgs4Frac[1]
Definition: ScalarPdfFactory.h:34
ScalarPdfFactory::gzgs1Frac
RooRealVar * gzgs1Frac[1]
Definition: ScalarPdfFactory.h:23
RooSpinZero::modelCouplings::Lambda
RooRealVar * Lambda
Definition: RooSpinZero.h:24
ScalarPdfFactory::gvvp1Frac
RooRealVar * gvvp1Frac[1]
Definition: ScalarPdfFactory.h:39
ScalarPdfFactory::~ScalarPdfFactory
virtual ~ScalarPdfFactory()
Definition: ScalarPdfFactory.cc:45
ScalarPdfFactory::g3Phase
RooRealVar * g3Phase[8]
Definition: ScalarPdfFactory.h:20
ScalarPdfFactory::gGsGsRatioVal
RooRealVar * gGsGsRatioVal[3][1]
Definition: ScalarPdfFactory.h:65
ScalarPdfFactory::ggsgs2FracInterp
RooFormulaVar * ggsgs2FracInterp[1]
Definition: ScalarPdfFactory.h:55
ScalarPdfFactory::g4FracInterp
RooFormulaVar * g4FracInterp[8]
Definition: ScalarPdfFactory.h:49
MELAStreamHelpers::MELAerr
MELAOutputStreamer MELAerr
ScalarPdfFactory::g1FracInterp
RooFormulaVar * g1FracInterp[8]
Definition: ScalarPdfFactory.h:46
ScalarPdfFactory::gVpVpRatioVal
RooRealVar * gVpVpRatioVal[1][1]
Definition: ScalarPdfFactory.h:67
ScalarPdfFactory::pmf_applied
bool pmf_applied
Definition: ScalarPdfFactory.h:89
ScalarPdfFactory::g1Frac
RooRealVar * g1Frac[7]
Definition: ScalarPdfFactory.h:14
ScalarPdfFactory::gVpVpRatio
double gVpVpRatio[1][1]
Definition: ScalarPdfFactory.h:96
MELAStreamHelpers
Definition: MELAStreamHelpers.hh:7
ScalarPdfFactory::ggsgs4FracInterp
RooFormulaVar * ggsgs4FracInterp[1]
Definition: ScalarPdfFactory.h:57
RooSpinZero::modelCouplings::Lambda_z3qsq
RooAbsReal * Lambda_z3qsq[SIZE_HVV_CQSQ]
Definition: RooSpinZero.h:34
RooSpinZero::modelCouplings::gzgs1List
RooAbsReal * gzgs1List[1][2]
Definition: RooSpinZero.h:16
ScalarPdfFactory::ggsgs3Phase
RooRealVar * ggsgs3Phase[1]
Definition: ScalarPdfFactory.h:36
RooSpinZero::modelCouplings::g3List
RooAbsReal * g3List[8][2]
Definition: RooSpinZero.h:13
RooSpinZero::modelCouplings::g1List
RooAbsReal * g1List[8][2]
Definition: RooSpinZero.h:11
ScalarPdfFactory::ggsgs3Frac
RooRealVar * ggsgs3Frac[1]
Definition: ScalarPdfFactory.h:33
ScalarPdfFactory::couplings
RooSpinZero::modelCouplings couplings
Definition: ScalarPdfFactory.h:12
RooSpinZero::modelCouplings::ggsgs3List
RooAbsReal * ggsgs3List[1][2]
Definition: RooSpinZero.h:21
ScalarPdfFactory::gGsGsRatio
double gGsGsRatio[3][1]
Definition: ScalarPdfFactory.h:94
ScalarPdfFactory::initFractionsPhases
virtual void initFractionsPhases()
Definition: ScalarPdfFactory.cc:49
RooSpinZero::modelCouplings::Lambda_z2qsq
RooAbsReal * Lambda_z2qsq[SIZE_HVV_CQSQ]
Definition: RooSpinZero.h:33
RooSpinZero::modelCouplings::g4List
RooAbsReal * g4List[8][2]
Definition: RooSpinZero.h:14
RooSpin::modelMeasurables
Definition: RooSpin.h:50
RooSpinZero::modelCouplings::cLambda_qsq
RooAbsReal * cLambda_qsq[SIZE_HVV_CQSQ]
Definition: RooSpinZero.h:36
ScalarPdfFactory::gzgs4FracInterp
RooFormulaVar * gzgs4FracInterp[1]
Definition: ScalarPdfFactory.h:54
ScalarPdfFactory::ggsgs2Phase
RooRealVar * ggsgs2Phase[1]
Definition: ScalarPdfFactory.h:35
RooSpinZero::modelCouplings::Lambda_z4
RooRealVar * Lambda_z4
Definition: RooSpinZero.h:29
ScalarPdfFactory::gzgs2FracInterp
RooFormulaVar * gzgs2FracInterp[1]
Definition: ScalarPdfFactory.h:52
RooSpinZero::modelCouplings::ggsgs2List
RooAbsReal * ggsgs2List[1][2]
Definition: RooSpinZero.h:20
ScalarPdfFactory::ggsgs3FracInterp
RooFormulaVar * ggsgs3FracInterp[1]
Definition: ScalarPdfFactory.h:56
RooSpin::VdecayType
VdecayType
Definition: RooSpin.h:28
ScalarPdfFactory::gVVpRatioVal
RooRealVar * gVVpRatioVal[1][1]
Definition: ScalarPdfFactory.h:66
ScalarPdfFactory::gzgs3Frac
RooRealVar * gzgs3Frac[1]
Definition: ScalarPdfFactory.h:25
ScalarPdfFactory::initGVals
virtual void initGVals()
Definition: ScalarPdfFactory.cc:476
ScalarPdfFactory::gzgs2Frac
RooRealVar * gzgs2Frac[1]
Definition: ScalarPdfFactory.h:24
ScalarPdfFactory::destroyGVals
virtual void destroyGVals()
Definition: ScalarPdfFactory.cc:694