BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtD0toKLpipiPlot.cc
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2//
3// Environment:
4// This software is part of models developed at BES collaboration
5// based on the EvtGen framework. If you use all or part
6// of it, please give an appropriate acknowledgement.
7//
8// Copyright Information: See EvtGen/BesCopyright
9// Copyright (A) 2006 Ping Rong-Gang @IHEP
10//
11// Module: EvtD0toKLpipiPlot.cc
12//
13// Modification history:
14//
15// Liaoyuan Dong August, 2022 Module created
16//
17//------------------------------------------------------------------------
18#include "EvtD0toKLpipiPlot.hh"
25#include <stdlib.h>
26#include <string>
27
28#include "TApplication.h"
29#include "TAxis.h"
30#include "TFile.h"
31#include "TH1.h"
32#include "TH2.h"
33#include "TROOT.h"
34using std::endl;
35
37
38void EvtD0toKLpipiPlot::getName( std::string& model_name ) { model_name = "D0toKLpipiPlot"; }
39
41
43
44 checkNArg( 0 );
45
46 bool idKl = getDaugs()[0] == EvtPDL::getId( std::string( "K_L0" ) );
47 bool idpip = getDaugs()[1] == EvtPDL::getId( std::string( "pi+" ) );
48 bool idpim = getDaugs()[2] == EvtPDL::getId( std::string( "pi-" ) );
49 if ( !( idKl && idpip && idpim ) )
50 {
51 std::cout << "EvtD0toKLpipiPlot: the daughter sequence should be K_L0 pi+ pi-"
52 << std::endl;
53 abort();
54 }
56
57 Xmin = 0.45;
58 Xmax = 3.0;
59 Xwid = 0.06375;
60 Ymin = 0.45;
61 Ymax = 3.0;
62 Ywid = 0.06375;
63 avm1 = 495.743;
64 double HisPDFtmp[42][42] = {
65 { 0, 0, 0, 0, 0, 0, 0, 0, 0,
66 0, 0, 0, 0, 0, 0, 0, 0, 0,
67 0, 0, 0, 0, 0, 0, 0, 1.90826, 4.69954,
68 9.32781, 2.37907, 4.90235, 3.96359, 6.12545, 0.6902, 3.58214, 16.8293, 26.1971,
69 49.1234, 48.8678, 27.8285, 2.4941, 0, 0 },
70 { 0, 0, 0, 0, 0, 0, 0, 0, 0,
71 0, 0, 0, 0, 0, 0, 0, 0, 0,
72 0, 0, 1.14495, 2.28716, 8.37884, 15.4505, 28.3031, 41.9423, 25.537,
73 28.5801, 24.8886, 10.775, 10.3795, 2.56968, 8.60343, 10.0478, 24.9663, 55.7599,
74 105.466, 68.9306, 34.4964, 19.0672, 0.579817, 0 },
75 { 0, 0, 0, 0, 0, 0, 0, 0, 0,
76 0, 0, 0, 0, 0, 0, 0, 0, 0.949541,
77 1.99946, 10.9962, 19.4816, 22.1581, 39.2918, 35.7312, 41.4853, 54.7606, 39.6876,
78 20.3346, 14.9821, 5.79409, 9.10613, 10.3728, 10.6664, 28.4848, 55.4411, 91.007,
79 76.1465, 32.35, 14.8015, 8.45079, 0.512396, 0 },
80 { 0, 0, 0, 0, 0, 0, 0, 0, 0,
81 0, 0, 0, 0, 0, 0, 0.98749, 0.149193, 16.1546,
82 29.8089, 27.578, 39.0424, 30.8709, 29.9128, 24.3585, 25.4184, 27.8572, 29.3251,
83 9.26356, 10.6023, 2.63286, 12.8236, 19.9939, 26.2131, 59.1316, 84.0808, 62.8544,
84 49.1532, 24.6917, 12.9306, 4.46741, 0.44738, 0 },
85 { 0, 0, 0, 0, 0, 0, 0, 0, 0,
86 0, 0, 0, 0, 4.00092, 22.1123, 25.4904, 35.1547, 36.7326,
87 32.8042, 27.1622, 28.6267, 21.2089, 36.2336, 34.5455, 20.0191, 27.7042, 25.1497,
88 12.1962, 2.0667, 10.5141, 23.6155, 33.9306, 70.6356, 66.674, 51.6334, 41.8476,
89 18.0195, 20.5124, 18.0623, 14.7856, 0, 0 },
90 { 0, 0, 0, 0, 0, 0, 0, 0, 0,
91 0, 0, 2.89908, 97.6839, 163.832, 164.463, 147.839, 104.142, 109.093,
92 84.6226, 54.6484, 69.2203, 38.2265, 43.2485, 37.3749, 21.4705, 17.1762, 12.0885,
93 9.46427, 17.9225, 38.5093, 47.3792, 74.2928, 100.283, 68.0419, 60.2868, 55.391,
94 73.1551, 77.008, 77.8478, 3.92104, 0, 0 },
95 { 0, 0, 0, 0, 0, 0, 0, 0, 0,
96 0, 14.0061, 215.714, 440.836, 377.292, 359.827, 287.466, 253.644, 186.39,
97 160.018, 112.563, 102.678, 63.4051, 38.2802, 34.3702, 26.2659, 13.5021, 16.5579,
98 27.4402, 30.975, 43.0589, 65.4338, 80.9364, 80.8245, 118.726, 127.128, 176.849,
99 218.001, 290.348, 85.9697, 0, 0, 0 },
100 { 0, 0, 0, 0, 0, 0, 0, 0, 0.583224,
101 22.4797, 129.978, 256.805, 234.867, 188.523, 172.287, 140.184, 109.55, 98.5406,
102 97.6639, 59.5966, 41.144, 41.0181, 26.3496, 21.5388, 11.2261, 11.5857, 6.5041,
103 3.63721, 3.76012, 11.1503, 29.1471, 32.5619, 57.4764, 75.3605, 86.8908, 135.13,
104 145.657, 89.4037, 0, 0, 0, 0 },
105 { 0, 0, 0, 0, 0, 0, 0, 2.07733, 14.8971,
106 95.8219, 123.615, 128.42, 73.3972, 68.2, 64.7315, 60.3264, 60.6266, 48.9057,
107 41.4775, 30.751, 27.4423, 17.4858, 8.88721, 12.7804, 5.9255, 0, 0.115553,
108 0.257058, 10.6753, 19.6869, 39.4049, 33.5721, 33.2779, 41.1345, 55.9659, 77.8426,
109 38.6304, 0, 0, 0, 0, 0 },
110 { 0, 0, 0, 0, 0, 0, 1.73478, 10.4205, 111.119,
111 85.7501, 69.7333, 71.5621, 45.3611, 51.2416, 35.9967, 45.6354, 32.4893, 17.0856,
112 30.2752, 21.103, 14.4273, 16.4426, 15.1596, 2.78517, 4.41902, 4.88939, 1.90035,
113 8.11843, 23.0292, 30.8434, 29.9017, 22.7591, 28.8911, 49.2961, 38.4149, 40.3528,
114 4.3578, 0, 0, 0, 0, 0 },
115 { 0, 0, 0, 0, 0, 0, 16.9884, 153.037, 128.712,
116 74.3077, 76.0507, 43.4063, 37.7893, 30.7854, 22.7199, 27.5844, 28.7142, 23.1613,
117 25.5351, 13.7323, 16.0208, 7.05371, 5.98151, 6.5664, 4.86605, 4.0903, 6.53059,
118 23.5202, 19.1437, 22.6005, 20.6146, 27.7282, 26.6298, 45.2111, 27.3588, 0.957657,
119 0, 0, 0, 0, 0, 0 },
120 { 0, 0, 0, 0, 0, 6.29174, 209.312, 251.119, 91.8447,
121 65.9391, 60.9004, 36.169, 38.2322, 38.0071, 26.3809, 22.3798, 14.5385, 10.9995,
122 12.6746, 13.3823, 10.6655, 5.68455, 3.62136, 4.24721, 2.74166, 3.25631, 14.5872,
123 24.7464, 21.7734, 13.8206, 22.3166, 24.0842, 26.0197, 27.3679, 1.71656, 0,
124 0, 0, 0, 0, 0, 0 },
125 { 0, 0, 0, 0, 0, 91.6641, 495.743, 209.545, 93.9578,
126 48.6215, 35.7472, 34.083, 27.421, 18.7106, 16.5373, 20.6437, 12.3313, 13.7466,
127 14.4243, 12.664, 3.75043, 0, 5.50544, 2.53505, 0.332459, 12.9283, 12.5063,
128 17.2873, 15.9273, 23.0553, 23.9296, 33.7444, 29.5068, 5.9583, 0, 0,
129 0, 0, 0, 0, 0, 0 },
130 { 0, 0, 0, 0, 1.18098, 181.767, 413.261, 183.72, 57.0721,
131 57.5604, 37.1751, 21.1736, 25.1549, 15.886, 17.0751, 17.7128, 18.6543, 16.2722,
132 8.48871, 4.5754, 3.11706, 5.47186, 4.41194, 1.09845, 6.80441, 23.4397, 17.5801,
133 12.283, 19.4738, 16.6103, 20.8764, 23.2241, 2.48175, 0, 0, 0,
134 0, 0, 0, 0, 0, 0 },
135 { 0, 0, 0, 0, 35.0478, 198.05, 356.219, 172.051, 61.8559,
136 43.8686, 28.8139, 22.3413, 22.2728, 15.3376, 10.8712, 18.539, 7.71002, 11.8389,
137 2.68436, 2.8106, 4.40069, 4.63157, 0.79355, 5.1782, 9.99011, 8.10268, 15.2607,
138 19.6325, 18.7304, 22.7601, 27.7637, 7.84075, 0, 0, 0, 0,
139 0, 0, 0, 0, 0, 0 },
140 { 0, 0, 0, 1.15596, 36.9714, 183.62, 305.647, 145.827, 54.7347,
141 44.9159, 33.3896, 28.874, 28.7353, 20.431, 12.7136, 7.72658, 7.14475, 4.36773,
142 2.70694, 1.24871, 3.61621, 2.98787, 8.11721, 5.21419, 10.6677, 8.71383, 12.677,
143 10.3872, 15.4919, 27.9198, 6.80734, 0, 0, 0, 0, 0,
144 0, 0, 0, 0, 0, 0 },
145 { 0, 0, 0, 3.09104, 42.1358, 128.11, 256.138, 118.101, 64.9726,
146 35.5669, 25.5346, 14.0432, 11.9172, 15.0532, 7.5676, 6.86225, 3.33384, 2.16883,
147 5.19011, 2.6455, 2.6817, 3.56043, 2.05935, 4.35594, 8.39981, 2.31082, 7.9391,
148 15.0078, 15.7816, 3.56547, 0, 0, 0, 0, 0, 0,
149 0, 0, 0, 0, 0, 0 },
150 { 0, 0, 1.84954, 20.833, 40.0177, 105.672, 205.88, 82.2049, 45.5294,
151 25.0773, 14.3014, 10.6094, 16.8261, 9.14087, 9.8847, 3.27002, 1.57145, 2.93376,
152 5.51464, 0, 3.39075, 7.22876, 7.84746, 6.64176, 1.41248, 6.76421, 13.0273,
153 11.8821, 5.30256, 0, 0, 0, 0, 0, 0, 0,
154 0, 0, 0, 0, 0, 0 },
155 { 0, 0, 3.41045, 17.0406, 34.1589, 93.7246, 169.202, 87.2086, 40.269,
156 20.0118, 15.8743, 8.51396, 12.6606, 5.88262, 1.07641, 2.94512, 4.76261, 2.88706,
157 2.94231, 2.93958, 6.23235, 4.57644, 0.756755, 5.16745, 9.37327, 9.66878, 7.63688,
158 2.54466, 0, 0, 0, 0, 0, 0, 0, 0,
159 0, 0, 0, 0, 0, 0 },
160 { 0, 0, 4.83376, 33.276, 28.4998, 84.7579, 121.744, 52.802, 31.4974,
161 19.6708, 16.3185, 20.3557, 5.30244, 0.981244, 0, 0, 0.661127, 7.43531,
162 2.93345, 3.86512, 4.74674, 6.69047, 6.27752, 5.24271, 8.0929, 6.60611, 2.27974,
163 0, 0, 0, 0, 0, 0, 0, 0, 0,
164 0, 0, 0, 0, 0, 0 },
165 { 0, 0.648755, 12.082, 44.5927, 26.8592, 61.3847, 69.5799, 38.2931, 26.9229,
166 13.819, 15.6628, 8.19283, 4.52916, 8.46249, 1.8807, 0, 1.69897, 0,
167 4.24378, 2.40933, 3.73584, 10.2662, 6.76878, 12.1512, 7.47554, 4.10626, 0,
168 0, 0, 0, 0, 0, 0, 0, 0, 0,
169 0, 0, 0, 0, 0, 0 },
170 { 0, 0, 27.594, 29.4081, 38.5558, 46.3778, 68.1063, 28.4649, 18.8496,
171 16.9062, 6.36988, 0.113668, 4.66838, 5.21768, 3.60475, 4.32142, 7.18843, 1.43397,
172 6.24493, 6.79816, 10.4641, 6.55074, 3.44719, 2.34317, 0, 0, 0,
173 0, 0, 0, 0, 0, 0, 0, 0, 0,
174 0, 0, 0, 0, 0, 0 },
175 { 0, 4.6246, 42.8438, 31.1863, 31.1592, 47.4551, 53.6172, 19.1785, 12.6229,
176 12.7873, 0.757267, 1.82905, 3.28154, 4.10166, 6.19556, 5.6092, 4.77021, 3.0194,
177 5.04072, 6.74483, 2.8462, 4.74184, 6.26433, 3.4762, 0, 0, 0,
178 0, 0, 0, 0, 0, 0, 0, 0, 0,
179 0, 0, 0, 0, 0, 0 },
180 { 0, 20.4265, 30.5799, 24.203, 44.3689, 29.5895, 40.6593, 23.4773, 11.908,
181 4.546, 8.71045, 2.90541, 3.36528, 5.93946, 5.24948, 8.757, 4.17936, 3.92173,
182 7.68425, 8.517, 9.89642, 6.1679, 1.57516, 0, 0, 0, 0,
183 0, 0, 0, 0, 0, 0, 0, 0, 0,
184 0, 0, 0, 0, 0, 0 },
185 { 0, 33.002, 40.9061, 45.0861, 27.5116, 34.6222, 16.8057, 8.46741, 4.39514,
186 4.82814, 2.58252, 4.48784, 8.90098, 4.7243, 9.82579, 2.8058, 6.59362, 9.66905,
187 10.1271, 4.78777, 9.88206, 0.0636468, 0, 0, 0, 0, 0,
188 0, 0, 0, 0, 0, 0, 0, 0, 0,
189 0, 0, 0, 0, 0, 0 },
190 { 0, 49.2578, 63.9884, 40.856, 22.7683, 19.969, 14.1996, 5.78709, 7.93505,
191 0.427374, 0.281165, 1.15937, 12.7153, 12.1447, 15.7915, 11.1855, 4.61158, 5.88111,
192 6.83004, 7.51355, 4.92316, 0, 0, 0, 0, 0, 0,
193 0, 0, 0, 0, 0, 0, 0, 0, 0,
194 0, 0, 0, 0, 0, 0 },
195 { 3.90826, 45.3774, 37.177, 27.5122, 29.3566, 12.5675, 17.5923, 5.9413, 4.73755,
196 3.0811, 7.99467, 13.3018, 17.8642, 14.0483, 10.3745, 14.9573, 12.2072, 8.22539,
197 9.74509, 0, 0, 0, 0, 0, 0, 0, 0,
198 0, 0, 0, 0, 0, 0, 0, 0, 0,
199 0, 0, 0, 0, 0, 0 },
200 { 8.11009, 48.7068, 23.4502, 18.5946, 11.853, 10.1073, 18.5679, 7.10546, 0.36181,
201 8.31465, 16.1518, 22.7878, 12.8791, 19.6486, 19.3248, 16.5069, 20.2372, 18.3504,
202 4.20712, 0, 0, 0, 0, 0, 0, 0, 0,
203 0, 0, 0, 0, 0, 0, 0, 0, 0,
204 0, 0, 0, 0, 0, 0 },
205 { 12.2806, 21.1359, 23.1435, 12.4998, 13.9032, 25.5426, 27.2949, 6.94997, 6.63166,
206 27.8365, 32.1811, 16.4996, 11.6727, 16.307, 19.1621, 12.0417, 21.4599, 4.17982,
207 0, 0, 0, 0, 0, 0, 0, 0, 0,
208 0, 0, 0, 0, 0, 0, 0, 0, 0,
209 0, 0, 0, 0, 0, 0 },
210 { 0.604973, 15.2935, 9.73363, 3.95437, 12.8972, 40.2153, 53.979, 10.61, 28.2922,
211 33.1046, 23.6464, 23.9456, 23.6695, 31.6595, 24.5733, 21.7259, 5.91723, 0,
212 0, 0, 0, 0, 0, 0, 0, 0, 0,
213 0, 0, 0, 0, 0, 0, 0, 0, 0,
214 0, 0, 0, 0, 0, 0 },
215 { 7.96923, 15.0075, 6.75482, 9.82191, 26.9874, 57.6303, 59.7006, 32.176, 37.6959,
216 28.3653, 25.3851, 23.9796, 20.6448, 24.0216, 25.5869, 3.82755, 0, 0,
217 0, 0, 0, 0, 0, 0, 0, 0, 0,
218 0, 0, 0, 0, 0, 0, 0, 0, 0,
219 0, 0, 0, 0, 0, 0 },
220 { 3.69442, 6.30932, 15.7647, 22.6957, 33.8557, 89.9482, 92.1436, 36.1734, 36.8015,
221 36.573, 29.9958, 37.9187, 18.6068, 35.6084, 5.70914, 0, 0, 0,
222 0, 0, 0, 0, 0, 0, 0, 0, 0,
223 0, 0, 0, 0, 0, 0, 0, 0, 0,
224 0, 0, 0, 0, 0, 0 },
225 { 1.66705, 13.5792, 9.61949, 35.5403, 69.1726, 108.215, 88.2618, 68.6701, 39.8223,
226 42.3615, 39.1113, 48.2207, 21.2746, 6.83718, 0, 0, 0, 0,
227 0, 0, 0, 0, 0, 0, 0, 0, 0,
228 0, 0, 0, 0, 0, 0, 0, 0, 0,
229 0, 0, 0, 0, 0, 0 },
230 { 4.15861, 6.43829, 32.6557, 47.1791, 114.976, 104.763, 110.61, 97.0207, 51.5148,
231 49.7525, 45.7041, 33.8625, 2.1507, 0, 0, 0, 0, 0,
232 0, 0, 0, 0, 0, 0, 0, 0, 0,
233 0, 0, 0, 0, 0, 0, 0, 0, 0,
234 0, 0, 0, 0, 0, 0 },
235 { 12.1266, 21.314, 61.9436, 102.574, 65.9101, 69.7976, 154.892, 118.789, 70.9609,
236 58.0712, 23.7915, 1.8632, 0, 0, 0, 0, 0, 0,
237 0, 0, 0, 0, 0, 0, 0, 0, 0,
238 0, 0, 0, 0, 0, 0, 0, 0, 0,
239 0, 0, 0, 0, 0, 0 },
240 { 26.7309, 81.7205, 108.403, 75.561, 37.8921, 68.4178, 226.839, 162.27, 87.7451,
241 39.3417, 3.94102, 0, 0, 0, 0, 0, 0, 0,
242 0, 0, 0, 0, 0, 0, 0, 0, 0,
243 0, 0, 0, 0, 0, 0, 0, 0, 0,
244 0, 0, 0, 0, 0, 0 },
245 { 77.3519, 118.372, 88.8899, 30.5892, 31.1218, 104.814, 308.27, 192.645, 72.492,
246 0.963303, 0, 0, 0, 0, 0, 0, 0, 0,
247 0, 0, 0, 0, 0, 0, 0, 0, 0,
248 0, 0, 0, 0, 0, 0, 0, 0, 0,
249 0, 0, 0, 0, 0, 0 },
250 { 95.7064, 110.863, 50.876, 28.9277, 29.924, 119.388, 362.466, 104.864, 0, 0, 0,
251 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
252 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
253 0, 0, 0, 0, 0, 0, 0, 0, 0 },
254 { 33.1332, 24.3142, 24.4587, 13.3108, 17.1375, 118.012, 122.583, 0, 0, 0, 0, 0, 0, 0,
255 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
256 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
257 { 2.99517, 18.7136, 9.08199, 5.79694, 14.045, 10.7156, 0, 0, 0, 0, 0, 0, 0, 0,
258 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
259 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
260 { 0, 1.6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
261 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
262 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
263 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
264
265 for ( int i = 0; i < 42; i++ )
266 {
267 for ( int j = 0; j < 42; j++ ) { HisPDF[i][j] = HisPDFtmp[i][j]; }
268 }
269}
270
272
274
275loop:
277
278 EvtParticle *id1, *id2, *id3;
279 EvtVector4R pd1, pd2, pd3;
280 double xmass13, xmass12, xmass23; // 12 Klpi+ 13 Kl pi-
281
282 id1 = p->getDaug( 0 );
283 id2 = p->getDaug( 1 );
284 id3 = p->getDaug( 2 );
285
286 pd1 = id1->getP4Lab();
287 pd2 = id2->getP4Lab();
288 pd3 = id3->getP4Lab();
289
290 xmass12 = ( pd1 + pd2 ).mass() * ( pd1 + pd2 ).mass(); // M_Klpi+
291 xmass13 = ( pd1 + pd3 ).mass() * ( pd1 + pd3 ).mass(); // M_Klpi-
292 xmass23 = ( pd2 + pd3 ).mass() * ( pd2 + pd3 ).mass(); // M_K+pi-
293
294 int xbin = FindXBin( xmass12 );
295 int ybin = FindYBin( xmass13 );
296 double xratio12 = HisPDF[xbin][ybin] / avm1;
297
298 if ( xratio12 <= 0 ) goto loop;
299
300 double rd12 = EvtRandom::Flat( 0.0, 1.0 );
301 if ( rd12 > xratio12 ) goto loop; // single out event
302
303 return;
304}
305
306int EvtD0toKLpipiPlot::FindXBin( double mass2 ) {
307 if ( mass2 < Xmin ) { return 0; }
308 else if ( mass2 >= Xmax ) { return 41; }
309 else { return int( ( mass2 - Xmin ) / Xwid ) + 1; }
310}
311
312int EvtD0toKLpipiPlot::FindYBin( double mass2 ) {
313 if ( mass2 < Ymin ) { return 0; }
314 else if ( mass2 >= Ymax ) { return 41; }
315 else { return int( ( mass2 - Ymin ) / Ywid ) + 1; }
316}
double mass
int FindYBin(double mass2)
void getName(std::string &name)
EvtDecayBase * clone()
void decay(EvtParticle *p)
int FindXBin(double mass2)
EvtId getParentId()
EvtId * getDaugs()
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.hh:66
static EvtId getId(const std::string &name)
Definition EvtPDL.cc:272
EvtVector4R getP4Lab()
EvtParticle * getDaug(int i)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
static double Flat()
Definition EvtRandom.cc:69