-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmyPDF.cxx~
730 lines (645 loc) · 28.1 KB
/
myPDF.cxx~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
/*****************************************************************************
* Project: RooFit *
* *
* This code was autogenerated by RooClassFactory *
* *
* A simple AA PDF class by Ivan Heredia de la Cruz on 4/25/16. *
*****************************************************************************/
#include "Riostream.h"
#include "myPDF.h"
#include "RooAbsReal.h"
#include "RooAbsCategory.h"
#include <math.h>
#include "TMath.h"
#include <map>
ClassImp(myPDF)
myPDF::myPDF(const char *name, const char *title,
/*
RooAbsReal& _mKP,
RooAbsReal& _cLb,
RooAbsReal& _cJ,
RooAbsReal& _cLs,
RooAbsReal& _phiMu,
RooAbsReal& _phiK,
RooAbsReal& _a1600L0S1,
RooAbsReal& _b1600L0S1,
RooAbsReal& _a1600L1S1,
RooAbsReal& _b1600L1S1,
RooAbsReal& _a1600L1S3,
RooAbsReal& _b1600L1S3,
RooAbsReal& _a1600L2S3,
RooAbsReal& _b1600L2S3,
RooAbsReal& _a1670L0S1,
RooAbsReal& _b1670L0S1,
RooAbsReal& _a1670L1S1,
RooAbsReal& _b1670L1S1,
RooAbsReal& _a1670L1S3,
RooAbsReal& _b1670L1S3,
RooAbsReal& _a1670L2S3,
RooAbsReal& _b1670L2S3
*/
// B^0 -> psi(nS) K* -> mu+ mu- K- pi+
RooAbsReal& _mKP,
RooAbsReal& _cJ,
RooAbsReal& _cKs,
RooAbsReal& _phi,
/*
// K*(892)
RooAbsReal& _a892m1,
RooAbsReal& _b892m1,
RooAbsReal& _a892z,
RooAbsReal& _b892z,
RooAbsReal& _a892p1,
RooAbsReal& _b892p1
*/
//const vector< pair<TString, pair< pair<Double_t, Double_t>, pair<Double_t, Double_t> > > >& _Kstar_spin,
const vector< pair<TString, pair<const Double_t, const Double_t> > >& _Kstar_spin,
const vector< TString >& _varNames,
const RooArgSet _amplitudeVars,
const TString& _psi_nS
) :
RooAbsPdf(name,title),
/*
mKP("mKP","mKP",this,_mKP),
cLb("cLb","cLb",this,_cLb),
cJ("cJ","cJ",this,_cJ),
cLs("cLs","cLs",this,_cLs),
phiMu("phiMu","phiMu",this,_phiMu),
phiK("phiK","phiK",this,_phiK),
a1600L0S1("a1600L0S1","a1600L0S1",this,_a1600L0S1),
b1600L0S1("b1600L0S1","b1600L0S1",this,_b1600L0S1),
a1600L1S1("a1600L1S1","a1600L1S1",this,_a1600L1S1),
b1600L1S1("b1600L1S1","b1600L1S1",this,_b1600L1S1),
a1600L1S3("a1600L1S3","a1600L1S3",this,_a1600L1S3),
b1600L1S3("b1600L1S3","b1600L1S3",this,_b1600L1S3),
a1600L2S3("a1600L2S3","a1600L2S3",this,_a1600L2S3),
b1600L2S3("b1600L2S3","b1600L2S3",this,_b1600L2S3),
a1670L0S1("a1670L0S1","a1670L0S1",this,_a1670L0S1),
b1670L0S1("b1670L0S1","b1670L0S1",this,_b1670L0S1),
a1670L1S1("a1670L1S1","a1670L1S1",this,_a1670L1S1),
b1670L1S1("b1670L1S1","b1670L1S1",this,_b1670L1S1),
a1670L1S3("a1670L1S3","a1670L1S3",this,_a1670L1S3),
b1670L1S3("b1670L1S3","b1670L1S3",this,_b1670L1S3),
a1670L2S3("a1670L2S3","a1670L2S3",this,_a1670L2S3),
b1670L2S3("b1670L2S3","b1670L2S3",this,_b1670L2S3)
*/
// B^0 -> psi(nS) K* -> mu+ mu- K- pi+
mKP("mKP","mKP",this,_mKP),
cJ("cJ","cJ",this,_cJ),
cKs("cKs","cKs",this,_cKs),
phi("phi","phi",this,_phi),
/*
// K*(892)
a892m1("a892m1","a892m1",this,_a892m1),
b892m1("b892m1","b892m1",this,_b892m1),
a892z("a892z","a892z",this,_a892z),
b892z("b892z","b892z",this,_b892z),
a892p1("a892p1","a892p1",this,_a892p1),
b892p1("b892p1","b892p1",this,_b892p1)
*/
Kstar_spin(_Kstar_spin),
varNames(_varNames),
amplitudeVars(_amplitudeVars),
psi_nS(_psi_nS)
{
for (Int_t iAmplitudevar=0; iAmplitudevar<amplitudeVars.getSize(); ++iAmplitudevar) {
TString varName = varNames[iAmplitudevar];
amplitudeVarProxy_map[varName] = new RooRealProxy(varName,varName,this,(RooAbsReal&)(*(amplitudeVars.find(varName)))) ;
//amplitudeVarProxy_map[varName] = new RooRealProxy(varName,varName,amplitudeVars.find(varName),(RooAbsReal&)(*(amplitudeVars.find(varName)))) ;
}
}
myPDF::myPDF(const myPDF& other, const char* name) :
RooAbsPdf(other,name),
/*
mKP("mKP",this,other.mKP),
cLb("cLb",this,other.cLb),
cJ("cJ",this,other.cJ),
cLs("cLs",this,other.cLs),
phiMu("phiMu",this,other.phiMu),
phiK("phiK",this,other.phiK),
a1600L0S1("a1600L0S1",this,other.a1600L0S1),
b1600L0S1("b1600L0S1",this,other.b1600L0S1),
a1600L1S1("a1600L1S1",this,other.a1600L1S1),
b1600L1S1("b1600L1S1",this,other.b1600L1S1),
a1600L1S3("a1600L1S3",this,other.a1600L1S3),
b1600L1S3("b1600L1S3",this,other.b1600L1S3),
a1600L2S3("a1600L2S3",this,other.a1600L2S3),
b1600L2S3("b1600L2S3",this,other.b1600L2S3),
a1670L0S1("a1670L0S1",this,other.a1670L0S1),
b1670L0S1("b1670L0S1",this,other.b1670L0S1),
a1670L1S1("a1670L1S1",this,other.a1670L1S1),
b1670L1S1("b1670L1S1",this,other.b1670L1S1),
a1670L1S3("a1670L1S3",this,other.a1670L1S3),
b1670L1S3("b1670L1S3",this,other.b1670L1S3),
a1670L2S3("a1670L2S3",this,other.a1670L2S3),
b1670L2S3("b1670L2S3",this,other.b1670L2S3)
*/
// B^0 -> psi(nS) K* -> mu+ mu- K- pi+
mKP("mKP",this,other.mKP),
cJ("cJ",this,other.cJ),
cKs("cKs",this,other.cKs),
phi("phi",this,other.phi),
/*
// K*(892)
a892m1("a892m1",this,other.a892m1),
b892m1("b892m1",this,other.b892m1),
a892z("a892z",this,other.a892z),
b892z("b892z",this,other.b892z),
a892p1("a892p1",this,other.a892p1),
b892p1("b892p1",this,other.b892p1)
*/
Kstar_spin(other.Kstar_spin),
varNames(other.varNames),
amplitudeVars(other.amplitudeVars),
amplitudeVarProxy_map(other.amplitudeVarProxy_map),
psi_nS(other.psi_nS)
{
}
Double_t myPDF::evaluate() const
{
// ENTER EXPRESSION IN TERMS OF VARIABLE ARGUMENTS HERE
Double_t MPsi_nS = 0.;
if (psi_nS.EqualTo("1"))
MPsi_nS = MJpsi;
else if (psi_nS.EqualTo("2"))
MPsi_nS = MPsi2S;
else
cout <<"psi_nS = " <<psi_nS <<" not allowed in the \"evaluate\" function at the moment. Keeping MPsi_nS to 0" <<endl;
if ((mKP < MKaon + MPion) || (mKP > MBd - MPsi_nS))
return 0.;
else
return PDF();
}
Int_t myPDF::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* ) const //rangeName
{
// LIST HERE OVER WHICH VARIABLES ANALYTICAL INTEGRATION IS SUPPORTED,
// ASSIGN A NUMERIC CODE FOR EACH SUPPORTED (SET OF) PARAMETERS
// THE EXAMPLE BELOW ASSIGNS CODE 1 TO INTEGRATION OVER VARIABLE X
// YOU CAN ALSO IMPLEMENT MORE THAN ONE ANALYTICAL INTEGRAL BY REPEATING THE matchArgs
// EXPRESSION MULTIPLE TIMES
// if (matchArgs(allVars,analVars,mKP)) return 1 ;
// if (matchArgs(allVars,analVars,mKP,cJ)) return 2 ;
return 0 ;
}
Double_t myPDF::analyticalIntegral(Int_t code, const char* rangeName) const
{
// RETURN ANALYTICAL INTEGRAL DEFINED BY RETURN CODE ASSIGNED BY getAnalyticalIntegral
// THE MEMBER FUNCTION x.min(rangeName) AND x.max(rangeName) WILL RETURN THE INTEGRATION
// BOUNDARIES FOR EACH OBSERVABLE x
// if (code==1){
// return 1;
// }
// if (code==2){
// return 1;
return 0 ;
}
/*
// second last term in slide 11 last line
// "c" stands for conjugate
Double_t myPDF::cWignerD_Lb(string helLb, string helLs, string helJ) const
{
if(helLb=="m1h" && helLs=="m1h" && helJ=="m1")
return -TMath::Sin(TMath::ACos(cLb)/2.);
else if(helLb=="m1h" && helLs=="m1h" && helJ=="0")
return TMath::Cos(TMath::ACos(cLb)/2.);
else if(helLb=="m1h" && helLs=="m1h" && helJ=="p1")
return 0.0;
else if(helLb=="m1h" && helLs=="p1h" && helJ=="m1")
return 0.0;
else if(helLb=="m1h" && helLs=="p1h" && helJ=="0")
return -TMath::Sin(TMath::ACos(cLb)/2.);
else if(helLb=="m1h" && helLs=="p1h" && helJ=="p1")
return TMath::Cos(TMath::ACos(cLb)/2.);
else if(helLb=="m1h" && helLs=="p3h" && helJ=="p1")
return -TMath::Sin(TMath::ACos(cLb)/2.);
else if(helLb=="p1h" && helLs=="m1h" && helJ=="m1")
return TMath::Cos(TMath::ACos(cLb)/2.);
else if(helLb=="p1h" && helLs=="m1h" && helJ=="0")
return TMath::Sin(TMath::ACos(cLb)/2.);
else if(helLb=="p1h" && helLs=="m1h" && helJ=="p1")
return 0.0;
else if(helLb=="p1h" && helLs=="p1h" && helJ=="m1")
return 0.0;
else if(helLb=="p1h" && helLs=="p1h" && helJ=="0")
return TMath::Cos(TMath::ACos(cLb)/2.);
else if(helLb=="p1h" && helLs=="p1h" && helJ=="p1")
return TMath::Sin(TMath::ACos(cLb)/2.);
else return 0.0;
}
*/
/*
// exponential * last term in slide 11 last line
TComplex myPDF::WignerDLsSpinOneHalf(string helLs, string help) const
{
if(helLs=="m1h" && help=="m1h")
return -(TComplex::Exp((TComplex::I()*phiK)/2.)*TMath::Sin(TMath::ACos(cLs)/2.));
else if(helLs=="m1h" && help=="p1h")
return TComplex::Exp((TComplex::I()*phiK)/2.)*TMath::Cos(TMath::ACos(cLs)/2.);
else if(helLs=="p1h" && help=="m1h")
return TMath::Cos(TMath::ACos(cLs)/2.)/TComplex::Exp((TComplex::I()*phiK)/2.);
else if(helLs=="p1h" && help=="p1h")
return TMath::Sin(TMath::ACos(cLs)/2.)/TComplex::Exp((TComplex::I()*phiK)/2.);
else
return 0;
}
TComplex myPDF::cWignerDLsSpinOneHalf(TComplex WignerDLsSpinOneHalf) const
// "c" stands for conjugate
{
return TComplex::Conjugate( WignerDLsSpinOneHalf ) ;
}
*/
// Second last sum terms of slide 11: Exp(i*helJ*phiMu) * (Wigner small d-matrix for spin 1)
TComplex myPDF::WignerD_J(string helJ, string helDmu, Double_t angle) const
{
if (helJ=="m1") {
if (helDmu=="m1")
return +((+1. + cJ)*TComplex::Exp(TComplex::I()*angle))/2.;
else if (helDmu=="p1")
return -((-1. + cJ)*TComplex::Exp(TComplex::I()*angle))/2.;
else {
cout <<"helDmu = " <<helDmu <<" not allowed in \"WignerD_J\" functions for helJ = " <<helJ <<" at the moment. Returning 0 -> \"AngularTerm\" = 0" <<endl ;
return 0; }
} else if (helJ=="0") {
if (helDmu=="m1")
return -(TMath::Sqrt(1. - TMath::Power(cJ,2))/TMath::Sqrt2());
else if (helDmu=="p1")
return +(TMath::Sqrt(1. - TMath::Power(cJ,2))/TMath::Sqrt2());
else {
cout <<"helDmu = " <<helDmu <<" not allowed in \"WignerD_J\" functions for helJ = " <<helJ <<" at the moment. Returning 0 -> \"AngularTerm\" = 0" <<endl ;
return 0; }
} else if(helJ=="p1") {
if (helDmu=="m1")
return -(-1. + cJ)/(2.*TComplex::Exp(TComplex::I()*angle));
else if (helDmu=="p1")
return +(+1. + cJ)/(2.*TComplex::Exp(TComplex::I()*angle));
else {
cout <<"helDmu = " <<helDmu <<" not allowed in \"WignerD_J\" functions for helJ = " <<helJ <<" at the moment. Returning 0 -> \"AngularTerm\" = 0" <<endl ;
return 0; }
} else {
cout <<"helJ = " <<helJ <<" not allowed in \"WignerD_J\" functions at the moment. Returning 0 -> \"AngularTerm\" = 0" <<endl ;
return 0;
}
}
// "c" stands for conjugate
TComplex myPDF::cWignerD_J(TComplex _WignerD_J) const
{
return TComplex::Conjugate( _WignerD_J );
}
Double_t myPDF::Pmom(Double_t mkp) const
{
Double_t mkp2 = mkp*mkp;
/*
Double_t rootterm = MJpsi4mTwoMJpsi2MLb2pMLb4 + mkp2*(mkp2 - TwoMJpsi2pTwoMLb2);
if (rootterm > 0)
return InvTwoMLb * TMath::Sqrt(rootterm);
*/
Double_t rootterm = 0;
if (psi_nS.EqualTo("1"))
rootterm = MJpsi4mTwoMJpsi2MBd2pMBd4 + mkp2*(mkp2 - TwoMJpsi2pTwoMBd2);
else if (psi_nS.EqualTo("2"))
rootterm = MPsi2S4mTwoMPsi2S2MBd2pMBd4 + mkp2*(mkp2 - TwoMPsi2S2pTwoMBd2);
else
cout <<"psi_nS = " <<psi_nS <<" not allowed in \"Pmom\" function at the moment. Keeping rootterm at 0" <<endl;
//cout <<"\nrootterm for psi_nS = " <<psi_nS <<" and mkp = " <<mkp <<": " <<rootterm <<endl;
if (rootterm > 0)
return InvTwoMBd * TMath::Sqrt(rootterm);
else { cout <<"WARNING! In \"Pmom\" function: rootterm (" <<rootterm <<") <= 0 for mkp = " <<mkp <<" and psi_nS = " <<psi_nS <<" -> returning 0" <<endl;
return 0.;
}
}
Double_t myPDF::Qmom(Double_t mkp) const
{
Double_t mkp2 = mkp*mkp;
/*
Double_t rootterm = MKaon4mTwoMKaon2MProton2pMProton4 + mkp2*(mkp2 - TwoMKaon2pTwoMProton2) ;
*/
Double_t rootterm = MKaon4mTwoMKaon2MPion2pMPion4 + mkp2*(mkp2 - TwoMKaon2pTwoMPion2) ;
if (rootterm > 0)
return 0.5*TMath::Sqrt(rootterm)/mkp;
else { cout <<"WARNING! In \"Qmom\" function: rootterm <= 0 for mkp = " <<mkp <<" -> returning 0" <<endl;
return 0.;
}
}
Double_t myPDF::PhiPHSP(Double_t mkp) const
{
return Pmom(mkp) * Qmom(mkp) ;
}
Double_t myPDF::BlattWeisskopf(Int_t Lmin, Double_t q, Double_t q0, Double_t D) const
{
Double_t Dq = D*q;
Double_t Dq0 = D*q0;
Double_t Dq2 = Dq*Dq;
Double_t Dq02 = Dq0*Dq0;
Double_t Dq4 = Dq2*Dq2;
Double_t Dq04 = Dq02*Dq02;
Double_t Dq6 = Dq4*Dq2;
Double_t Dq06 = Dq04*Dq02;
Double_t rootterm = -1;
if (Lmin==0)
return 1.;
else if (Lmin==1)
rootterm = (1. + Dq02) / (1. + Dq2) ;
else if (Lmin==2)
rootterm = (9. + 3*Dq02 +Dq04) / (9. + 3*Dq2 +Dq4) ;
else if (Lmin==3)
rootterm = (225. + 45*Dq02 + 6*Dq04 + Dq06) / (225. + 45*Dq2 + 6*Dq4 + Dq6) ;
else { cout <<"WARNING! Lmin = " <<Lmin <<" is not implemented for BlattWeisskopf functions at the moment. Returning 1 -> \"AngularTerm\" = 0" <<endl;
return 1.;
}
if (rootterm > 0)
return TMath::Sqrt( rootterm );
else { cout <<"WARNING! In \"BlattWeisskopf\" function: rootterm <= 0 -> returning 1" <<endl;
return 1.;
}
}
Double_t myPDF::BWGamma(Double_t RMass, Double_t RGamma, Int_t Lmin, Double_t D) const
{
Double_t QmKP = Qmom(mKP);
Double_t QRMass = Qmom(RMass);
Int_t expoterm = 2*Lmin + 1 ;
Double_t BWG = ( RGamma * RMass * TMath::Power(QmKP/QRMass,expoterm) * TMath::Power(BlattWeisskopf(Lmin, QmKP, QRMass, D),2) ) / mKP;
//cout <<"BWGamma for RMass = " <<RMass <<": " <<BWG <<endl;
return BWG ;
}
TComplex myPDF::BW(Double_t RMass, Double_t RGamma, Int_t Lmin, Double_t D) const
{
Double_t num1term = RMass*RMass - mKP*mKP ;
Double_t num2term = RMass * BWGamma(RMass, RGamma, Lmin, D) ;
Double_t denoterm = num1term*num1term + num2term*num2term ;
TComplex bw = TComplex(num1term / denoterm, num2term / denoterm);
//cout <<"BW for RMass = " <<RMass <<": " <<bw <<endl;
return bw ;
}
TComplex myPDF::RFunction(Double_t RMass, Double_t RGamma, Double_t MomMass, Int_t LminMom, Int_t LminR, Double_t D) const
{
Double_t PmKP = Pmom(mKP);
Double_t PRMass = Pmom(RMass);
Double_t QmKP = Qmom(mKP);
Double_t QRMass = Qmom(RMass);
//TComplex RFunc = BlattWeisskopf(LminMom, PmKP, PRMass, D) * TMath::Power(PmKP/MomMass,LminMom) * BW(RMass, RGamma, LminR, D) * BlattWeisskopf(LminR, QmKP, QRMass, D) * TMath::Power(QmKP/RMass,LminR);
TComplex RFunc = BlattWeisskopf(LminMom, PmKP, PRMass, D) * TMath::Power(PmKP/MomMass,LminMom) * BW(RMass, RGamma, LminR, D) * BlattWeisskopf(LminR, QmKP, QRMass, D) * TMath::Power(QmKP/mKP,LminR);
//cout <<"BlattWeisskopf(LminR, QmKP, QRMass, D) for RMass " <<RMass <<" = " <<BlattWeisskopf(LminR, QmKP, QRMass, D) <<endl;
//cout <<"BlattWeisskopf(LminMom, PmKP, PRMass, D) for RMass " <<RMass <<" = " <<BlattWeisskopf(LminMom, PmKP, PRMass, D) <<endl;
//cout <<"BlattWeisskopf(LminMom, PmKP, PRMass, D) * BlattWeisskopf(LminR, QmKP, QRMass, D) for RMass " <<RMass <<" = " <<BlattWeisskopf(LminMom, PmKP, PRMass, D) * BlattWeisskopf(LminR, QmKP, QRMass, D) <<endl;
//cout <<"TMath::Power(QmKP/RMass,LminR) for RMass " <<RMass <<" = " <<TMath::Power(QmKP/mKP,LminR) <<endl;
//cout <<"TMath::Power(PmKP/MomMass,LminMom) * TMath::Power(QmKP/RMass,LminR) for RMass " <<RMass <<" = " <<(TMath::Power(PmKP/MomMass,LminMom) * TMath::Power(QmKP/RMass,LminR)) <<endl;
//cout <<"\nRFunction for RMass " <<RMass <<" = " <<RFunc <<"\n\n" <<endl;
return RFunc ;
}
/*
// (R * H^{Lambda*} from slide 11 second last line) * (H^{LambdaB} * exp * d^{1/2} from slide 11 last line)
TComplex myPDF::Cterm(string helLs, string helJ, string help) const
{
if ( (helLs=="p1h" && helJ=="p1") || (helLs=="p1h" && helJ=="0") || (helLs=="m1h" && helJ=="0") || (helLs=="m1h" && helJ=="m1") )
{
// K+ spin = 0 and proton spin = 1/2 -> second last argument of Lambda* RFunction can have several values
TComplex sum1h = HLb1670(helLs, helJ) * HLs1670(help) * RFunction(M1670, G1670, MLb, 0, 0, dRad) + HLb1600(helLs, helJ) * HLs1600(help) * RFunction(M1600, G1600, MLb, 0, 1, dRad) ;
return sum1h * WignerDLsSpinOneHalf(helLs, help) ;
//return sum1h * cWignerDLsSpinOneHalf(helLs, help) ;
}
return 0.;
}
// Second last line terms of slide 11 plus last line H^{LambdaB}*exp*d^{1} functions
TComplex myPDF::Cfterm(string helLs, string helJ, string help, string helDmu) const
{
//return Cterm(helLs, helJ, help) * WignerD_J(helJ, helDmu, phiMu) ;
return Cterm(helLs, helJ, help) * cWignerD_J(WignerD_J(helJ, helDmu, phiMu)) ;
}
*/
//Double_t myPDF::Wignerd_R(string spinR, string helJ) const
Double_t myPDF::Wignerd_R(TString spinR, string helJ) const
{
if (spinR=="0")
return 1. ;
else if (spinR=="1")
if (helJ=="m1")
return +(TMath::Sin(TMath::ACos(cKs)) / TMath::Sqrt2()) ;
else if (helJ=="0")
return cKs ;
else if (helJ=="p1")
return -(TMath::Sin(TMath::ACos(cKs)) / TMath::Sqrt2()) ;
else { cout <<"helJ = " <<helJ <<" is not allowed for spinR-" <<spinR <<" Wigner d^{spinR}_{helJ,0} functions. Returning 0" <<endl;
return 0 ;
}
else if (spinR=="2")
if (helJ=="m1")
return +(TMath::Sin(2*TMath::ACos(cKs)) * TMath::Sqrt(3./8.)) ;
else if (helJ=="0")
return +(3*TMath::Power(cKs,2) -1)/2. ;
else if (helJ=="p1")
return -(TMath::Sin(2*TMath::ACos(cKs)) * TMath::Sqrt(3./8.)) ;
else { cout <<"helJ = " <<helJ <<" is not allowed for spinR-" <<spinR <<" Wigner d^{spinR}_{helJ,0} functions. Returning 0" <<endl;
return 0 ;
}
else if (spinR=="3")
if (helJ=="m1")
return +(TMath::Sin(TMath::ACos(cKs))*(5*TMath::Cos(2*TMath::ACos(cKs)) + 3.) * TMath::Sqrt(3.)/8.) ;
else if (helJ=="0")
return +(5*TMath::Power(cKs,3) - 3*cKs)/2. ;
else if (helJ=="p1")
return -(TMath::Sin(TMath::ACos(cKs))*(5*TMath::Cos(2*TMath::ACos(cKs)) + 3.) * TMath::Sqrt(3.)/8.) ;
else { cout <<"helJ = " <<helJ <<" is not allowed for spinR-" <<spinR <<" Wigner d^{spinR}_{helJ,0} functions. Returning 0" <<endl;
return 0 ;
}
else {
cout <<"spinR = " <<spinR <<" is not implemented for Wigner d^{spinR}_{helJ,0} functions at the moment. Returning 0 -> \"AngularTerm\" = 0" <<endl;
return 0 ;
}
}
//TComplex myPDF::AngularTerm(string R, string spinR, string helJ, string helDmu) const
TComplex myPDF::AngularTerm(TString R, TString spinR, string helJ, string helDmu) const
{
//cout <<"\nAngularTerm for K* " <<R <<" and helDmu = " <<helDmu <<" and helJ = " <<helJ <<" is made of Wignerd_R(spinR, helJ) * cWignerD_J(helJ, helDmu, phi) = " <<Wignerd_R(spinR, helJ) <<" * " <<cWignerD_J( WignerD_J(helJ, helDmu, phi) ) <<endl;
//cout <<"It is multiplied by H(R,helJ) = H(" <<R <<"," <<helJ <<") = " <<H(R,helJ) <<endl;
return H(R,helJ) * Wignerd_R(spinR, helJ) * cWignerD_J( WignerD_J(helJ, helDmu, phi) ) ;
}
/*
// all allowed sums terms in slide 11 last equation
TComplex myPDF::ME(string helLb, string help, string helDmu) const
{
return
Cfterm("m1h", "m1", help, helDmu) * cWignerD_Lb(helLb, "m1h", "m1") +
Cfterm("m1h", "0", help, helDmu) * cWignerD_Lb(helLb, "m1h", "0") +
Cfterm("m1h", "p1", help, helDmu) * cWignerD_Lb(helLb, "m1h", "p1") +
Cfterm("p1h", "m1", help, helDmu) * cWignerD_Lb(helLb, "p1h", "m1") +
Cfterm("p1h", "0", help, helDmu) * cWignerD_Lb(helLb, "p1h", "0") +
Cfterm("p1h", "p1", help, helDmu) * cWignerD_Lb(helLb, "p1h", "p1")
;
}
*/
TComplex myPDF::ME( string helDmu ) const
{
/*
// K+ and pi- have 0 spin -> second last argument of K* RFunction is = spin(K*)
return
RFunction(M892, G892, MBd, 0, 1, dRad) * ( AngularTerm("K*(892)", "1", "m1", helDmu) +
AngularTerm("K*(892)", "1", "0", helDmu) +
AngularTerm("K*(892)", "1", "p1", helDmu) )
// + ...
;
// any other K* should be added above
*/
TComplex matrixElement = 0.;
// K+ and pi- have 0 spin -> second last argument of K* RFunction is = spin(K*)
for (Int_t iKstar_S=0; iKstar_S<(Int_t)Kstar_spin.size(); ++iKstar_S) {
TString R = Kstar_spin[iKstar_S].first ;
TString spin = R(Kstar_spin[iKstar_S].first.Length() -1) ;
TString mass = R(0, Kstar_spin[iKstar_S].first.Length() -2) ;
TComplex matrixElement_R = 0.;
if (spin.EqualTo("0")) { // for spin0 K*, third last argument = spin(psi_nS) = spin.Atoi() + 1 = 1
matrixElement_R = RFunction(Kstar_spin[iKstar_S].second.first, Kstar_spin[iKstar_S].second.second, MBd, spin.Atoi()+1, spin.Atoi(), dRad) *
AngularTerm(R, spin, "0", helDmu) ;
} else { // for non-0 spin K*, third last argument = spin(K*) - spin(psi_nS) = spin.Atoi() - 1
matrixElement_R = RFunction(Kstar_spin[iKstar_S].second.first, Kstar_spin[iKstar_S].second.second, MBd, spin.Atoi()-1, spin.Atoi(), dRad) *
( AngularTerm(R, spin, "m1", helDmu) + AngularTerm(R, spin, "0", helDmu) + AngularTerm(R, spin, "p1", helDmu) ) ;
}
//cout <<"\nAngularTerm.Rho() for " <<R <<" = " <<(AngularTerm(R, spin, "0", helDmu)).Rho() <<endl;
//cout <<"matrixElement for (R,helDmu) = (" <<R <<"," <<helDmu <<") = H(R,helJ) * RFunction * AngularTerm = " <<matrixElement_R <<endl;
matrixElement += matrixElement_R;
//cout <<"matrixElement_R.Rho2() for (R,helDmu) = (" <<R <<"," <<helDmu <<") = " <<matrixElement_R.Rho2() <<"\n\n" <<endl;
}
return matrixElement ;
}
// all allowed sums terms in slide 11 second last equation
/*
TComplex myPDF::ME2() const
{
// M_{HelLambdaB,HelP,DeltaHelMu} in slide 11
TComplex MEm1hm1hm1 = ME("m1h", "m1h", "m1");
TComplex MEm1hm1hp1 = ME("m1h", "m1h", "p1");
TComplex MEm1hp1hm1 = ME("m1h", "p1h", "m1");
TComplex MEm1hp1hp1 = ME("m1h", "p1h", "p1");
TComplex MEp1hm1hm1 = ME("p1h", "m1h", "m1");
TComplex MEp1hm1hp1 = ME("p1h", "m1h", "p1");
TComplex MEp1hp1hm1 = ME("p1h", "p1h", "m1");
TComplex MEp1hp1hp1 = ME("p1h", "p1h", "p1");
return
MEm1hm1hm1 * TComplex::Conjugate(MEm1hm1hm1) +
MEm1hm1hp1 * TComplex::Conjugate(MEm1hm1hp1) +
MEm1hp1hm1 * TComplex::Conjugate(MEm1hp1hm1) +
MEm1hp1hp1 * TComplex::Conjugate(MEm1hp1hp1) +
MEp1hm1hm1 * TComplex::Conjugate(MEp1hm1hm1) +
MEp1hm1hp1 * TComplex::Conjugate(MEp1hm1hp1) +
MEp1hp1hm1 * TComplex::Conjugate(MEp1hp1hm1) +
MEp1hp1hp1 * TComplex::Conjugate(MEp1hp1hp1)
;
}
*/
/*
TComplex myPDF::ME2() const
{
// M_{DeltaHelMu}
TComplex MEm1 = ME("m1");
TComplex MEp1 = ME("p1");
return
MEm1 * TComplex::Conjugate(MEm1) +
MEp1 * TComplex::Conjugate(MEp1)
;
}
*/
Double_t myPDF::ME2() const
{
//cout <<"\nME(\"m1\") + ME(\"p1\") = " <<ME("m1") <<" + " <<ME("p1") <<endl;
//cout <<"ME(\"m1\").Rho2() + ME(\"p1\").Rho2() = " <<ME("m1").Rho2() <<" + " <<ME("p1").Rho2() <<endl;
return ME("m1").Rho2() + ME("p1").Rho2() ;
}
//TComplex myPDF::PDF() const
Double_t myPDF::PDF() const
{
//cout <<"\nME2() = " <<ME2() <<endl;
return ME2() * PhiPHSP(mKP); // missing * efficiency(from reconstructed PHSP MC)
}
/*
// first term in slide 11 last line for Lambda*(1600)
TComplex myPDF::HLb1600(string helLs, string helJ) const
{
if(helLs=="m1h" && helJ=="m1")
return (-2.*a1600L0S1 + 2.*a1600L1S1 - TMath::Sqrt2()*a1600L1S3 + TMath::Sqrt2()*a1600L2S3 + TComplex::I()*(-2.*b1600L0S1 + 2.*b1600L1S1 + TMath::Sqrt2()*(-b1600L1S3 + b1600L2S3)))/(2.*TMath::Sqrt(3.));
else if(helLs=="m1h" && helJ=="0")
return -(TMath::Sqrt2()*a1600L0S1 + TMath::Sqrt2()*a1600L1S1 + 2.*a1600L1S3 + 2.*a1600L2S3 + TComplex::I()*(TMath::Sqrt2()*b1600L0S1 + TMath::Sqrt2()*b1600L1S1 + 2.*(b1600L1S3 + b1600L2S3)))/(2.*TMath::Sqrt(3.));
else if(helLs=="m1h" && helJ=="p1")
return 0.;
else if(helLs=="p1h" && helJ=="m1")
return 0.;
else if(helLs=="p1h" && helJ=="0")
return (TMath::Sqrt2()*(a1600L0S1 - a1600L1S1) + 2.*(a1600L2S3 - a1600L1S3) + TComplex::I()*(TMath::Sqrt2()*(b1600L0S1 - b1600L1S1) + 2.*(b1600L2S3 - b1600L1S3)))/(2.*TMath::Sqrt(3.));
else if(helLs=="p1h" && helJ=="p1")
return (2.*a1600L0S1 + 2.*a1600L1S1 - TMath::Sqrt2()*a1600L1S3 - TMath::Sqrt2()*a1600L2S3 + TComplex::I()*(2.*b1600L0S1 + 2.*b1600L1S1 - TMath::Sqrt2()*(b1600L1S3 + b1600L2S3)))/(2.*TMath::Sqrt(3.));
else
return 0.;
}
// first term in slide 11 last line for Lambda*(1670)
TComplex myPDF::HLb1670(string helLs, string helJ) const
{
if(helLs=="m1h" && helJ=="m1")
return (-2.*a1670L0S1 + 2.*a1670L1S1 - TMath::Sqrt2()*a1670L1S3 + TMath::Sqrt2()*a1670L2S3 + TComplex::I()*(-2.*b1670L0S1 + 2.*b1670L1S1 + TMath::Sqrt2()*(-b1670L1S3 + b1670L2S3)))/(2.*TMath::Sqrt(3.));
else if(helLs=="m1h" && helJ=="0")
return -(TMath::Sqrt2()*a1670L0S1 + TMath::Sqrt2()*a1670L1S1 + 2.*a1670L1S3 + 2.*a1670L2S3 + TComplex::I()*(TMath::Sqrt2()*b1670L0S1 + TMath::Sqrt2()*b1670L1S1 + 2.*(b1670L1S3 + b1670L2S3)))/(2.*TMath::Sqrt(3.));
else if(helLs=="m1h" && helJ=="p1")
return 0.;
else if(helLs=="p1h" && helJ=="m1")
return 0.;
else if(helLs=="p1h" && helJ=="0")
return (TMath::Sqrt2()*(a1670L0S1 - a1670L1S1) + 2.*(a1670L2S3 - a1670L1S3) + TComplex::I()*(TMath::Sqrt2()*(b1670L0S1 - b1670L1S1) + 2.*(b1670L2S3 - b1670L1S3)))/(2.*TMath::Sqrt(3.));
else if(helLs=="p1h" && helJ=="p1")
return (2.*a1670L0S1 + 2.*a1670L1S1 - TMath::Sqrt2()*a1670L1S3 - TMath::Sqrt2()*a1670L2S3 + TComplex::I()*(2.*b1670L0S1 + 2.*b1670L1S1 - TMath::Sqrt2()*(b1670L1S3 + b1670L2S3)))/(2.*TMath::Sqrt(3.));
else
return 0.;
}
*/
// H term in slide 11 second last line for Lambda*(1600)
Double_t myPDF::HLs1600(string help) const
{
if(help=="m1h")
return -1.;
else if(help=="p1h")
return 1.;
else { cout <<"WARNING! In \"HLs1600\" function: help = " <<help <<" -> returning 0" <<endl;
return 0;
}
}
// H term in slide 11 second last line for Lambda*(1670)
Double_t myPDF::HLs1670(string help) const
{
if(help=="m1h")
return 1.;
else if(help=="p1h")
return 1.;
else { cout <<"WARNING! In \"HLs1670\" function: help = " <<help <<" -> returning 0" <<endl;
return 0;
}
}
//TComplex myPDF::H(string R, string helJ) const
TComplex myPDF::H(TString R, string helJ) const
{
/*
if ( R=="K*(892)" ) {
if ( helJ=="m1")
return a892m1 + TComplex::I()*b892m1 ;
else if ( helJ=="0" )
return a892z + TComplex::I()*b892z ;
else if ( helJ=="p1" )
return a892p1 + TComplex::I()*b892p1 ;
else {
cout <<"helJ = \"" <<helJ <<"\" not allowed for R = \"" <<R <<"\" in the H function at the moment. Returning 0" <<endl;
return 0.;
}
else {
cout <<"helJ = \"" <<helJ <<"\" not allowed for R = \"" <<R <<"\" in the H function at the moment. Returning 0" <<endl;
return 0.;
}
*/
TString name_helJ = R+"_"+helJ;
RooRealProxy* a = amplitudeVarProxy_map.find("a"+name_helJ)->second ;
RooRealProxy* b = amplitudeVarProxy_map.find("b"+name_helJ)->second ;
if ( a ) {
if ( b )
return (RooRealProxy)(*a) * TComplex::Exp(TComplex::I()*(RooRealProxy)(*b)) ;
else {
cout <<"RooRealProxy = \"b"+name_helJ+"\" not found in amplitudeVarProxy_map. Returning 0" <<endl;
return 0.; }
} else {
cout <<"RooRealProxy = \"a"+name_helJ+"\" not found in amplitudeVarProxy_map. Returning 0" <<endl;
return 0.;
}
}