1 #include <goofit/PDFs/physics/DalitzPlotHelpers.h>
2 #include <goofit/PDFs/physics/DalitzVetoPdf.h>
6 __device__ fptype device_DalitzVeto(fptype *evt, fptype *p, unsigned int *indices) {
7 fptype x = evt[RO_CACHE(indices[2 + RO_CACHE(indices[0]) + 0])];
8 fptype y = evt[RO_CACHE(indices[2 + RO_CACHE(indices[0]) + 1])];
10 fptype motherM = RO_CACHE(p[RO_CACHE(indices[1])]);
11 fptype d1m = RO_CACHE(p[RO_CACHE(indices[2])]);
12 fptype d2m = RO_CACHE(p[RO_CACHE(indices[3])]);
13 fptype d3m = RO_CACHE(p[RO_CACHE(indices[4])]);
15 fptype massSum = motherM * motherM + d1m * d1m + d2m * d2m + d3m * d3m;
16 fptype z = massSum - x - y;
18 fptype ret = inDalitz(x, y, motherM, d1m, d2m, d3m) ? 1.0 : 0.0;
19 unsigned int numVetos = RO_CACHE(indices[5]);
21 for(int i = 0; i < numVetos; ++i) {
22 unsigned int varIndex = indices[6 + i * 3 + 0];
23 fptype minimum = RO_CACHE(p[RO_CACHE(indices[6 + i * 3 + 1])]);
24 fptype maximum = RO_CACHE(p[RO_CACHE(indices[6 + i * 3 + 2])]);
25 fptype currDalitzVar = (PAIR_12 == varIndex ? x : PAIR_13 == varIndex ? y : z);
27 ret *= ((currDalitzVar < maximum) && (currDalitzVar > minimum)) ? 0.0 : 1.0;
33 __device__ device_function_ptr ptr_to_DalitzVeto = device_DalitzVeto;
35 __host__ DalitzVetoPdf::DalitzVetoPdf(std::string n,
42 std::vector<VetoInfo> vetos)
44 std::vector<unsigned int> pindices;
45 pindices.push_back(registerParameter(motherM));
46 pindices.push_back(registerParameter(d1m));
47 pindices.push_back(registerParameter(d2m));
48 pindices.push_back(registerParameter(d3m));
50 pindices.push_back(vetos.size());
52 for(auto &veto : vetos) {
53 pindices.push_back(veto.cyclic_index);
54 pindices.push_back(registerParameter(veto.minimum));
55 pindices.push_back(registerParameter(veto.maximum));
58 GET_FUNCTION_ADDR(ptr_to_DalitzVeto);