-
Notifications
You must be signed in to change notification settings - Fork 0
/
DP4KKPiPi.cu
314 lines (226 loc) · 13.4 KB
/
DP4KKPiPi.cu
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
//THIS PROGRAM FITS A SET OF DATA WITH THE RESONANCES YOU GIVE IT
#include <fstream>
// GooFit stuff
#include "goofit/FitManager.h"
#include "goofit/Variable.h"
#include "goofit/PDFs/basic/PolynomialPdf.h"
#include "goofit/PDFs/combine/AddPdf.h"
#include "goofit/UnbinnedDataSet.h"
#include "goofit/PDFs/physics/DP4Pdf.h"
using namespace std;
const fptype _mD0 = 1.8645;
const fptype piPlusMass = 0.13957018;
const fptype piMinusMass = 0.13957018;
const fptype kPlusMass = 0.493677;
const fptype kMinusMass = 0.493677;
// Constants used in more than one PDF component.
int main (int argc, char** argv) {
Variable* m12 = new Variable("m12", 0, 3);
Variable* m34 = new Variable("m34", 0, 3);
Variable* cos12 = new Variable("cos12", -1, 1);
Variable* cos34 = new Variable("cos34", -1, 1);
Variable* phi = new Variable("phi", 0.0, 6.28);
Variable* eventNumber = new Variable("eventNumber", 0, INT_MAX);
std::vector<Variable*> vars;
vars.push_back(m12);
vars.push_back(m34);
vars.push_back(cos12);
vars.push_back(cos34);
vars.push_back(phi);
vars.push_back(eventNumber);
UnbinnedDataSet currData(vars);
unsigned int MCevents = 0;
//Load in nTuple and give it to currData/addevent
fstream input("DZeroData2.txt", std::ios_base::in);
while(input >> *m12 >> *m34 >> *cos12 >> *cos34 >> *phi){
*eventNumber = MCevents++;
currData.addEvent();
}
printf("done reading in %i events\n", MCevents );
DecayInfo_DP* DKKPP_DI = new DecayInfo_DP();
DKKPP_DI->meson_radius =1.5;
DKKPP_DI->particle_masses.push_back(_mD0);
DKKPP_DI->particle_masses.push_back(piPlusMass);
DKKPP_DI->particle_masses.push_back(piMinusMass);
DKKPP_DI->particle_masses.push_back(kPlusMass);
DKKPP_DI->particle_masses.push_back(kMinusMass);
//Need to add K1(1270), phi, kstar0 and kstar0bar?? (this might be K1430 christoph has listed), k
Variable* RhoMass = new Variable("rho_mass" , 0.77526);
Variable* RhoWidth = new Variable("rho_width", 0.1478 );
Variable* Kstar892M = new Variable("Kstar892M" , 0.89581);
Variable* Kstar892W = new Variable("Kstar892W" , 0.0474 );
Variable* f600M = new Variable("f600M" , 0.519 );
Variable* f600W = new Variable("f600W" , 0.454 );
Variable* a1M = new Variable("a1M" , 1.23 );
Variable* a1W = new Variable("a1W" , 0.42 );
Variable* K1M = new Variable("K1M" , 1.272 );
Variable* K1W = new Variable("K1W" , 0.09 );
Variable* K1430M = new Variable("K1430M" , 1.414 );//not used?
Variable* K1430W = new Variable("K1430W" , 0.29 );
Variable* Kstar1410M = new Variable("Kstar1410M" , 1.414);
Variable* Kstar1410W = new Variable("Kstar1410W", 0.232);
Variable* K11270M = new Variable("K11270M", 1.272);
Variable* K11270W = new Variable("K11270W", 0.09);
Variable* phi1020M = new Variable("phi1020M", 1.019);
Variable* phi1020W = new Variable("phi1020W", 0.004);
//Spin factors: we have two due to the bose symmetrization of the two pi+
//K11270->Kstar0 (2?)----
//K11270->rho (2?)-----
//Kstar1410-> Kstar0 (2?)-----
//phi rho (D and S)
//phi (s) non resonant?
// non resonant?
/////////////----------------------NOTE----------------
// p1-> pi+
// p2-> pi-
// p3-> K+
// p4-> K-
std::vector<SpinFactor*> SFK1P2Kstar;//K1(1270)+(Kstar0 pi+)K-
SFK1P2Kstar.push_back( new SpinFactor("SF", SF_4Body::DtoAP1_AtoVP2_VtoP3P4, 3,0,1,2));
std::vector<SpinFactor*> SFK1M2Kstar;//K1(1270)-(Kstar0bar pi-)K+
SFK1M2Kstar.push_back( new SpinFactor("SF", SF_4Body::DtoAP1_AtoVP2_VtoP3P4, 2,1,0,3));
std::vector<SpinFactor*> SFK1P2Rho;//K1(1270)+(rho K+)K-
SFK1P2Rho.push_back( new SpinFactor("SF", SF_4Body::DtoAP1_AtoVP2_VtoP3P4, 3,2,0,1));
std::vector<SpinFactor*> SFK1M2Rho;//K1(1270)-(rho K-)K+
SFK1M2Rho.push_back( new SpinFactor("SF", SF_4Body::DtoAP1_AtoVP2_VtoP3P4, 2,3,1,0));
std::vector<SpinFactor*> SFKstarP2Kstar;//Kstar(1410)+(Kstar0 pi+)K-
SFKstarP2Kstar.push_back( new SpinFactor("SF", SF_4Body::DtoAP1_AtoVP2_VtoP3P4, 3,0,1,2));
std::vector<SpinFactor*> SFKstarM2Kstar;//Kstar(1410)-(Kstar0 pi-)K+
SFKstarM2Kstar.push_back( new SpinFactor("SF", SF_4Body::DtoAP1_AtoVP2_VtoP3P4,2,1,0,3));
std::vector<SpinFactor*> SFKstarKstar;
SFKstarKstar.push_back( new SpinFactor("SF", SF_4Body::DtoV1V2_V1toP1P2_V2toP3P4_S, 0,3,1,2));
std::vector<SpinFactor*> SFPhiRhoS;
SFPhiRhoS.push_back( new SpinFactor("SF", SF_4Body::DtoV1V2_V1toP1P2_V2toP3P4_S, 2,3,0,1));
std::vector<SpinFactor*> SFPhiRhoD;
SFPhiRhoD.push_back( new SpinFactor("SF", SF_4Body::DtoV1V2_V1toP1P2_V2toP3P4_D, 2,3,0,1));
// std::vector<SpinFactor*> SFPhipipi;
// SFPhipipi.push_back( new SpinFactor("SF", SF_4Body::DtoVP1P2_VtoP3P4, 0,1,2,3));
std::vector<SpinFactor*> SFNonRes1;
SFNonRes1.push_back( new SpinFactor("SF", SF_4Body::ONE, 0,1,2,3));
std::vector<SpinFactor*> SFNonRes2;
SFNonRes2.push_back( new SpinFactor("SF", SF_4Body::ONE, 1,2,0,3));
//////////////////////////////////////////////////////////////////////////////////////////////////
std::vector<Lineshape*> LSK1P2Kstar;
LSK1P2Kstar.push_back( new Lineshape("K1(1270)+", K11270M, K11270W, 1, M_23_4, LS::BW, FF::BL2) );
LSK1P2Kstar.push_back( new Lineshape("Kstar(1410)", Kstar1410M, Kstar1410W, 1, M_23, LS::BW, FF::BL2) );
std::vector<Lineshape*> LSK1M2Kstar;
LSK1M2Kstar.push_back( new Lineshape("K1(1270)-", K11270M, K11270W, 1, M_14_2, LS::BW, FF::BL2) );
LSK1M2Kstar.push_back( new Lineshape("Kstar(1410)", Kstar1410M, Kstar1410W,1, M_14, LS::BW, FF::BL2) );
std::vector<Lineshape*> LSK1P2Rho;
LSK1P2Rho.push_back( new Lineshape("K1(1270)+", K11270M, K11270W, 1, M_12_3, LS::BW, FF::BL2) );
LSK1P2Rho.push_back( new Lineshape("Rho ", RhoMass, RhoWidth, 1, M_12, LS::BW, FF::BL2) );
std::vector<Lineshape*> LSK1M2Rho;
LSK1M2Rho.push_back( new Lineshape("K1(1270)-", K11270M, K11270W, 1, M_12_4, LS::BW, FF::BL2) );
LSK1M2Rho.push_back( new Lineshape("Rho ", RhoMass, RhoWidth, 1, M_12, LS::BW, FF::BL2) );
std::vector<Lineshape*> LSKstarP2Kstar;
LSKstarP2Kstar.push_back( new Lineshape("KstarP", Kstar1410M, Kstar1410W, 1, M_23_1, LS::BW, FF::BL2) );
LSKstarP2Kstar.push_back( new Lineshape("Kstar", Kstar892M, Kstar892W, 1, M_23, LS::BW, FF::BL2) );
std::vector<Lineshape*> LSKstarM2Kstar;
LSKstarM2Kstar.push_back( new Lineshape("KstarM", Kstar1410M, Kstar1410W, 1, M_14_2, LS::BW, FF::BL2) );
LSKstarM2Kstar.push_back( new Lineshape("Kstar", Kstar892M, Kstar892W, 1, M_14, LS::BW, FF::BL2) );
std::vector<Lineshape*> LSKstarKstarbar;
LSKstarKstarbar.push_back( new Lineshape("Kstar", Kstar892M, Kstar892W, 1, M_23, LS::BW, FF::BL2) );
LSKstarKstarbar.push_back( new Lineshape("Kstarbar", Kstar892M, Kstar892W, 1, M_14, LS::BW, FF::BL2) );
std::vector<Lineshape*> LSPhiRhoS;
LSPhiRhoS.push_back( new Lineshape("Phi ", phi1020M, phi1020W, 1, M_34, LS::BW, FF::BL2) );
LSPhiRhoS.push_back( new Lineshape("Rho ", RhoMass, RhoWidth, 1, M_12, LS::BW, FF::BL2) );
std::vector<Lineshape*> LSPhiRhoD;
LSPhiRhoD.push_back( new Lineshape("Phi ", phi1020M, phi1020W, 1, M_34, LS::BW, FF::BL2) );
LSPhiRhoD.push_back( new Lineshape("Rho ", RhoMass, RhoWidth, 1, M_12, LS::BW, FF::BL2) );
// std::vector<Lineshape*> LSPhipipi;
// LSPhipipi.push_back( new Lineshape("Phi ",phi1020M,phi1020W, 1, M_34, LS::BW, FF::BL2) );
// LSPhipipi.push_back( new Lineshape("pipi ", new Variable("NR5", 0.0), new Variable("NR6",0.0), 1, M_12, LS::BW, FF::BL2) );
std::vector<Lineshape*> LSNonRes1;
LSNonRes1.push_back( new Lineshape("NonRes1 ", new Variable("NR1", 0.0), new Variable("NR2", 0.0),1, M_34_2, LS::nonRes, FF::BL2) );
std::vector<Lineshape*> LSNonRes2;
LSNonRes2.push_back( new Lineshape("NonRes2 ", new Variable("NR3", 0.0), new Variable("NR4", 0.0),1, M_34_2, LS::nonRes, FF::BL2) );
/////////////////////////////////////////////////////////////////////////////////////////////////
// Amplitude* AMP_K1P2Kstar = new Amplitude("K1(1270)+(Kstar0 pi+)K- ", new Variable("amp_real1", -0.1, 0.001,0,0), new Variable("amp_imag1", 0.1, 0.001, 0,0), LSK1P2Kstar, SFK1P2Kstar, 1);
Amplitude* AMP_K1P2Kstar = new Amplitude("K1(1270)+(Kstar0) pi+)K- ",new Variable("AmPK1P2Kstar_R", -0.1, 0.001, 0,0),new Variable("AmpK1P2Kstar_I", 0.1, 0.001, 0, 0), LSK1P2Kstar, SFK1P2Kstar, 1);
Amplitude* AMP_K1M2Kstar = new Amplitude("K1(1270)-(Kstar0 pi-)K+ ", new Variable("AmpK1M2Kstar_R", -0.1, 0.001,0,0), new Variable("AmpK1M2Kstar_I", 0.1, 0.001, 0,0), LSK1M2Kstar, SFK1M2Kstar, 1);
Amplitude* AMP_K1P2Rho = new Amplitude("K1(1270)+(Rho K+) K- ", new Variable("AmpK1P2Rho_R", -0.1, 0.001,0,0), new Variable("AmpK1P2Rho_I", 0.1, 0.001, 0,0), LSK1P2Rho, SFK1P2Rho, 1);
Amplitude* AMP_K1M2Rho = new Amplitude("K1(1270)-(Rho k-)K+ ", new Variable("AmpK1M2Rho_R", -0.1, 0.001,0,0), new Variable("AmpK1M2Rho_I", 0.1, 0.001, 0,0), LSK1M2Rho, SFK1M2Rho, 1);
Amplitude* AMP_KstarP2Kstar = new Amplitude("Kstar(1410)+(Kstar pi+)K- ", new Variable("AmpKstarP2Kstar_R", -0.1, 0.001,0,0), new Variable("AmpKstarP2Kstar_I", 0.1, 0.001, 0,0), LSKstarP2Kstar, SFKstarP2Kstar, 1);
Amplitude* AMP_KstarM2Kstar = new Amplitude("Kstar(1410)-(Kstarbar pi-) K+ ", new Variable("AMpKstarM2Kstar_R", -0.1, 0.001,0,0), new Variable("AmpKstarM2Kstar_I", 0.1, 0.001, 0,0), LSKstarM2Kstar, SFKstarM2Kstar, 1);
Amplitude* AMP_KstarKstarbar = new Amplitude("KstarKstar ", new Variable("AmpKstarKstarbar_R", -0.1, 0.001,0,0), new Variable("AmpKstarKstarbar_I", -0.1,0.001, 0,0), LSKstarKstarbar, SFKstarKstar, 1);
Amplitude* AMP_PhiRhoSFix = new Amplitude("PhiRhoS", new Variable("AmpPhiRhoS_R", 1, 0,0,0), new Variable("AmpPhiRhoS_I", 0, 0, 0,0), LSPhiRhoS, SFPhiRhoS, 1);
Amplitude* AMP_PhiRhoD = new Amplitude("PhiRhoD", new Variable("AmpPhiRhoD_R", -0.1, 0.001,0,0), new Variable("AmpPhiRhoD_I", 0.1, 0.001, 0,0), LSPhiRhoD, SFPhiRhoD, 1);
// Amplitude* AMP_PhiPiPi = new Amplitude("PhiPiPi", new Variable("amp_real10", -0.1, 0.001,0,0), new Variable("amp_imag10", 0.1, 0.001, 0,0), LSPhipipi, SFPhipipi, 1);
Amplitude* AMP_NonRes1 = new Amplitude("NonRes1", new Variable("amp_real11", -0.1, 0.001,0,0), new Variable("amp_imag11", 0.1, 0.001, 0,0), LSNonRes1, SFNonRes1, 1);
Amplitude* AMP_NonRes2 = new Amplitude("NonRes2", new Variable("amp_real12", -0.1, 0.001,0,0), new Variable("amp_imag12", 0.1, 0.001, 0,0), LSNonRes1, SFNonRes2, 1);
DKKPP_DI->amplitudes.push_back(AMP_K1P2Kstar);
DKKPP_DI->amplitudes.push_back(AMP_K1M2Kstar);
DKKPP_DI->amplitudes.push_back(AMP_K1P2Rho);
DKKPP_DI->amplitudes.push_back(AMP_K1M2Rho);
DKKPP_DI->amplitudes.push_back(AMP_KstarP2Kstar);
DKKPP_DI->amplitudes.push_back(AMP_KstarM2Kstar);
DKKPP_DI->amplitudes.push_back(AMP_KstarKstarbar);
DKKPP_DI->amplitudes.push_back(AMP_PhiRhoSFix);
DKKPP_DI->amplitudes.push_back(AMP_PhiRhoD);
//DKKPP_DI->amplitudes.push_back(AMP_PhiPiPi);
// DKKPP_DI->amplitudes.push_back(AMP_NonRes1);
// DKKPP_DI->amplitudes.push_back(AMP_NonRes2);
for (auto res = LSK1P2Kstar.begin(); res != LSK1P2Kstar.end(); ++res) {
(*res)->setParameterConstantness(true);
}
for (auto res = LSK1M2Kstar.begin(); res != LSK1M2Kstar.end(); ++res) {
(*res)->setParameterConstantness(true);
}
for (auto res = LSK1P2Rho.begin(); res != LSK1P2Rho.end(); ++res) {
(*res)->setParameterConstantness(true);
}
for (auto res = LSK1M2Rho.begin(); res != LSK1M2Rho.end(); ++res) {
(*res)->setParameterConstantness(true);
}
for (auto res = LSKstarP2Kstar.begin(); res != LSKstarP2Kstar.end(); ++res) {
(*res)->setParameterConstantness(true);
}
for (auto res = LSKstarM2Kstar.begin(); res != LSKstarM2Kstar.end(); ++res) {
(*res)->setParameterConstantness(true);
}
for (auto res = LSKstarKstarbar.begin(); res != LSKstarKstarbar.end(); ++res) {
(*res)->setParameterConstantness(true);
}
for (auto res = LSPhiRhoS.begin(); res != LSPhiRhoS.end(); ++res) {
(*res)->setParameterConstantness(true);
}
for (auto res = LSPhiRhoD.begin(); res != LSPhiRhoD.end(); ++res) {
(*res)->setParameterConstantness(true);
}
// for (auto res = LSPhipipi.begin(); res != LSPhipipi.end(); ++res) {
// (*res)->setParameterConstantness(true);
// }
// for (auto res = LSNonRes1.begin(); res != LSNonRes1.end(); ++res) {
(*res)->setParameterConstantness(true);
}
// for (auto res = LSNonRes2.begin(); res != LSNonRes2.end(); ++res) {
(*res)->setParameterConstantness(true);
}
Variable* constantOne = new Variable("constantOne", 1);
Variable* constantZero = new Variable("constantZero", 0);
vector<Variable*> observables;
vector<Variable*> coefficients;
vector<Variable*> offsets;
observables.push_back(m12);
observables.push_back(m34);
observables.push_back(cos12);
observables.push_back(cos34);
observables.push_back(phi);
observables.push_back(eventNumber);
offsets.push_back(constantZero);
offsets.push_back(constantZero);
coefficients.push_back(constantOne);
PolynomialPdf* eff = new PolynomialPdf("constantEff", observables, coefficients, offsets, 0);
DPPdf* dp = new DPPdf("test", observables, DKKPP_DI, eff,1e6);
Variable* constant = new Variable("constant", 0.1);
Variable* constant2 = new Variable("constant", 1.0);
vars.clear();
vars.push_back(constant);
PolynomialPdf backgr("backgr", m12, vars);
AddPdf* signal = new AddPdf("signal",constant2,dp, &backgr);
signal->setData(&currData);
dp->setDataSize(currData.getNumEvents(), 6);
FitManager datapdf(signal);
datapdf.fit();
return 0;
}