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