should be it

This commit is contained in:
2025-10-24 19:21:19 -05:00
parent a4b23fc57c
commit f09560c7b1
14047 changed files with 3161551 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
x|y
10.0|346
30.0|427
50.0|196
70.0|25
90.0|1
110.0|4
130.0|1
1 x y
2 10.0 346
3 30.0 427
4 50.0 196
5 70.0 25
6 90.0 1
7 110.0 4
8 130.0 1

View File

@@ -0,0 +1,102 @@
x|y
15.225|96
15.675|76
16.125|55
16.575|66
17.025|59
17.475|52
17.925|39
18.375|59
18.825|44
19.275|40
19.725|30
20.175|25
20.625|27
21.075|35
21.525|28
21.975|19
22.425|26
22.875|18
23.325|27
23.775|19
24.225|16
24.675|20
25.125|23
25.575|17
26.025|12
26.475|22
26.925|13
27.375|19
27.825|16
28.275|14
28.725|12
29.175|10
29.625|9
30.075|16
30.525|15
30.975|13
31.425|16
31.875|12
32.325|9
32.775|9
33.225|15
33.675|17
34.125|6
34.575|2
35.025|7
35.475|6
35.925|5
36.375|8
36.825|12
37.275|7
37.725|8
38.175|9
38.625|9
39.075|6
39.525|13
39.975|6
40.425|9
40.875|12
41.325|7
41.775|2
42.225|6
42.675|6
43.125|10
43.575|3
44.025|11
44.475|3
44.925|6
45.375|5
45.825|5
46.275|6
46.725|6
47.175|7
47.625|3
48.075|2
48.525|5
48.975|9
49.425|3
49.875|3
50.325|7
50.775|3
51.225|8
51.675|7
52.125|5
52.575|5
53.025|4
53.475|5
53.925|4
54.375|6
54.825|5
55.275|1
55.725|4
56.175|3
56.625|2
57.075|6
57.525|4
57.975|4
58.425|1
58.875|3
59.325|2
59.775|4
60.225|208
1 x y
2 15.225 96
3 15.675 76
4 16.125 55
5 16.575 66
6 17.025 59
7 17.475 52
8 17.925 39
9 18.375 59
10 18.825 44
11 19.275 40
12 19.725 30
13 20.175 25
14 20.625 27
15 21.075 35
16 21.525 28
17 21.975 19
18 22.425 26
19 22.875 18
20 23.325 27
21 23.775 19
22 24.225 16
23 24.675 20
24 25.125 23
25 25.575 17
26 26.025 12
27 26.475 22
28 26.925 13
29 27.375 19
30 27.825 16
31 28.275 14
32 28.725 12
33 29.175 10
34 29.625 9
35 30.075 16
36 30.525 15
37 30.975 13
38 31.425 16
39 31.875 12
40 32.325 9
41 32.775 9
42 33.225 15
43 33.675 17
44 34.125 6
45 34.575 2
46 35.025 7
47 35.475 6
48 35.925 5
49 36.375 8
50 36.825 12
51 37.275 7
52 37.725 8
53 38.175 9
54 38.625 9
55 39.075 6
56 39.525 13
57 39.975 6
58 40.425 9
59 40.875 12
60 41.325 7
61 41.775 2
62 42.225 6
63 42.675 6
64 43.125 10
65 43.575 3
66 44.025 11
67 44.475 3
68 44.925 6
69 45.375 5
70 45.825 5
71 46.275 6
72 46.725 6
73 47.175 7
74 47.625 3
75 48.075 2
76 48.525 5
77 48.975 9
78 49.425 3
79 49.875 3
80 50.325 7
81 50.775 3
82 51.225 8
83 51.675 7
84 52.125 5
85 52.575 5
86 53.025 4
87 53.475 5
88 53.925 4
89 54.375 6
90 54.825 5
91 55.275 1
92 55.725 4
93 56.175 3
94 56.625 2
95 57.075 6
96 57.525 4
97 57.975 4
98 58.425 1
99 58.875 3
100 59.325 2
101 59.775 4
102 60.225 208

View File

@@ -0,0 +1,99 @@
x|y
15.225|24
15.675|19
16.125|20
16.575|20
17.025|14
17.475|19
17.925|6
18.375|19
18.825|11
19.275|17
19.725|11
20.175|11
20.625|9
21.075|5
21.525|10
21.975|11
22.425|12
22.875|4
23.325|7
23.775|6
24.225|6
24.675|9
25.125|5
25.575|8
26.025|3
26.475|9
26.925|4
27.375|10
27.825|5
28.275|6
28.725|6
29.175|5
29.625|4
30.075|9
30.525|5
30.975|2
31.425|11
31.875|8
32.325|2
32.775|5
33.225|8
33.675|11
34.125|2
34.575|1
35.025|2
35.475|2
36.375|3
36.825|6
37.275|4
37.725|2
38.175|2
38.625|6
39.075|2
39.525|9
39.975|4
40.425|4
40.875|8
41.325|4
41.775|1
42.225|3
42.675|3
43.125|5
44.025|5
44.475|2
44.925|2
45.375|2
45.825|3
46.275|3
46.725|1
47.175|5
47.625|1
48.075|1
48.525|1
48.975|5
49.875|2
50.325|3
50.775|3
51.225|3
51.675|6
52.125|3
52.575|3
53.025|2
53.475|2
53.925|1
54.375|3
54.825|2
55.275|1
55.725|2
56.175|3
56.625|2
57.075|5
57.525|1
57.975|2
58.425|1
58.875|3
59.325|1
59.775|1
60.225|125
1 x y
2 15.225 24
3 15.675 19
4 16.125 20
5 16.575 20
6 17.025 14
7 17.475 19
8 17.925 6
9 18.375 19
10 18.825 11
11 19.275 17
12 19.725 11
13 20.175 11
14 20.625 9
15 21.075 5
16 21.525 10
17 21.975 11
18 22.425 12
19 22.875 4
20 23.325 7
21 23.775 6
22 24.225 6
23 24.675 9
24 25.125 5
25 25.575 8
26 26.025 3
27 26.475 9
28 26.925 4
29 27.375 10
30 27.825 5
31 28.275 6
32 28.725 6
33 29.175 5
34 29.625 4
35 30.075 9
36 30.525 5
37 30.975 2
38 31.425 11
39 31.875 8
40 32.325 2
41 32.775 5
42 33.225 8
43 33.675 11
44 34.125 2
45 34.575 1
46 35.025 2
47 35.475 2
48 36.375 3
49 36.825 6
50 37.275 4
51 37.725 2
52 38.175 2
53 38.625 6
54 39.075 2
55 39.525 9
56 39.975 4
57 40.425 4
58 40.875 8
59 41.325 4
60 41.775 1
61 42.225 3
62 42.675 3
63 43.125 5
64 44.025 5
65 44.475 2
66 44.925 2
67 45.375 2
68 45.825 3
69 46.275 3
70 46.725 1
71 47.175 5
72 47.625 1
73 48.075 1
74 48.525 1
75 48.975 5
76 49.875 2
77 50.325 3
78 50.775 3
79 51.225 3
80 51.675 6
81 52.125 3
82 52.575 3
83 53.025 2
84 53.475 2
85 53.925 1
86 54.375 3
87 54.825 2
88 55.275 1
89 55.725 2
90 56.175 3
91 56.625 2
92 57.075 5
93 57.525 1
94 57.975 2
95 58.425 1
96 58.875 3
97 59.325 1
98 59.775 1
99 60.225 125

View File

@@ -0,0 +1,7 @@
x|y
10.0|38
30.0|52
50.0|22
70.0|1
110.0|2
130.0|1
1 x y
2 10.0 38
3 30.0 52
4 50.0 22
5 70.0 1
6 110.0 2
7 130.0 1

View File

@@ -0,0 +1,5 @@
x|y
10.0|39
30.0|15
50.0|2
70.0|1
1 x y
2 10.0 39
3 30.0 15
4 50.0 2
5 70.0 1

View File

@@ -0,0 +1,76 @@
x|y
14.875|39
15.125|1
15.375|1
15.625|3
15.875|3
16.625|2
16.875|1
17.625|1
17.875|1
18.375|2
18.625|1
18.875|1
19.375|4
19.625|1
19.875|2
20.125|1
20.625|3
20.875|3
21.125|2
21.625|2
21.875|3
22.125|2
22.375|2
22.625|2
23.375|1
23.875|2
24.125|1
24.375|1
24.625|3
24.875|3
25.125|1
25.625|1
25.875|1
26.125|3
26.375|3
26.625|1
27.125|1
27.625|1
27.875|2
28.125|3
28.375|1
28.875|3
29.125|2
29.375|2
29.625|3
30.125|2
30.375|3
30.875|1
31.375|1
31.625|1
31.875|2
32.125|1
32.375|1
32.875|1
33.625|2
33.875|3
34.125|2
34.375|1
34.625|1
34.875|2
35.125|2
35.625|2
35.875|1
36.375|2
36.625|1
36.875|1
37.125|1
37.625|2
38.125|1
38.375|1
38.625|1
39.125|2
39.375|1
39.875|2
40.125|108
1 x y
2 14.875 39
3 15.125 1
4 15.375 1
5 15.625 3
6 15.875 3
7 16.625 2
8 16.875 1
9 17.625 1
10 17.875 1
11 18.375 2
12 18.625 1
13 18.875 1
14 19.375 4
15 19.625 1
16 19.875 2
17 20.125 1
18 20.625 3
19 20.875 3
20 21.125 2
21 21.625 2
22 21.875 3
23 22.125 2
24 22.375 2
25 22.625 2
26 23.375 1
27 23.875 2
28 24.125 1
29 24.375 1
30 24.625 3
31 24.875 3
32 25.125 1
33 25.625 1
34 25.875 1
35 26.125 3
36 26.375 3
37 26.625 1
38 27.125 1
39 27.625 1
40 27.875 2
41 28.125 3
42 28.375 1
43 28.875 3
44 29.125 2
45 29.375 2
46 29.625 3
47 30.125 2
48 30.375 3
49 30.875 1
50 31.375 1
51 31.625 1
52 31.875 2
53 32.125 1
54 32.375 1
55 32.875 1
56 33.625 2
57 33.875 3
58 34.125 2
59 34.375 1
60 34.625 1
61 34.875 2
62 35.125 2
63 35.625 2
64 35.875 1
65 36.375 2
66 36.625 1
67 36.875 1
68 37.125 1
69 37.625 2
70 38.125 1
71 38.375 1
72 38.625 1
73 39.125 2
74 39.375 1
75 39.875 2
76 40.125 108

View File

@@ -0,0 +1,79 @@
x|y
-0.005|23
0.015|2
0.025|2
0.035|1
0.045|1
0.065|1
0.075|3
0.085|5
0.095|1
0.105|1
0.115|4
0.125|2
0.135|1
0.145|2
0.165|2
0.175|1
0.185|3
0.195|6
0.205|4
0.215|6
0.225|2
0.235|5
0.245|5
0.265|2
0.285|2
0.295|5
0.305|1
0.315|4
0.325|1
0.345|1
0.365|3
0.375|2
0.395|4
0.415|1
0.425|2
0.445|1
0.455|3
0.465|1
0.495|1
0.505|2
0.515|2
0.545|1
0.555|4
0.565|2
0.585|2
0.595|1
0.605|1
0.625|1
0.635|2
0.645|2
0.665|2
0.675|4
0.685|1
0.695|1
0.715|1
0.735|2
0.755|1
0.765|1
0.785|2
0.795|1
0.805|1
0.815|2
0.835|2
0.855|3
0.865|2
0.875|1
0.885|3
0.895|7
0.905|5
0.915|2
0.925|6
0.935|8
0.945|4
0.955|12
0.965|8
0.975|12
0.985|10
0.995|33
1 x y
2 -0.005 23
3 0.015 2
4 0.025 2
5 0.035 1
6 0.045 1
7 0.065 1
8 0.075 3
9 0.085 5
10 0.095 1
11 0.105 1
12 0.115 4
13 0.125 2
14 0.135 1
15 0.145 2
16 0.165 2
17 0.175 1
18 0.185 3
19 0.195 6
20 0.205 4
21 0.215 6
22 0.225 2
23 0.235 5
24 0.245 5
25 0.265 2
26 0.285 2
27 0.295 5
28 0.305 1
29 0.315 4
30 0.325 1
31 0.345 1
32 0.365 3
33 0.375 2
34 0.395 4
35 0.415 1
36 0.425 2
37 0.445 1
38 0.455 3
39 0.465 1
40 0.495 1
41 0.505 2
42 0.515 2
43 0.545 1
44 0.555 4
45 0.565 2
46 0.585 2
47 0.595 1
48 0.605 1
49 0.625 1
50 0.635 2
51 0.645 2
52 0.665 2
53 0.675 4
54 0.685 1
55 0.695 1
56 0.715 1
57 0.735 2
58 0.755 1
59 0.765 1
60 0.785 2
61 0.795 1
62 0.805 1
63 0.815 2
64 0.835 2
65 0.855 3
66 0.865 2
67 0.875 1
68 0.885 3
69 0.895 7
70 0.905 5
71 0.915 2
72 0.925 6
73 0.935 8
74 0.945 4
75 0.955 12
76 0.965 8
77 0.975 12
78 0.985 10
79 0.995 33

View File

@@ -0,0 +1,71 @@
x|y
30.725|20
32.575|21
34.425|21
36.275|15
38.125|11
39.975|13
41.825|10
43.675|15
45.525|7
47.375|12
49.225|12
51.075|10
52.925|11
54.775|7
56.625|9
58.475|2
60.325|6
62.175|3
64.025|7
65.875|3
67.725|6
69.575|4
71.425|5
73.275|2
75.125|1
76.975|4
78.825|4
80.675|1
82.525|5
84.375|4
86.225|1
88.075|4
89.925|3
91.775|7
93.625|6
95.475|4
97.325|2
99.175|2
101.025|1
102.875|3
104.725|2
106.575|1
108.425|2
110.275|3
112.125|2
113.975|1
115.825|1
117.675|1
119.525|1
121.375|1
128.775|2
130.625|3
132.475|1
134.325|1
136.175|2
138.025|4
139.875|3
143.575|1
145.425|1
150.975|2
154.675|1
156.525|1
158.375|1
160.225|1
165.775|1
173.175|1
175.025|1
182.425|1
189.825|1
200.925|16
1 x y
2 30.725 20
3 32.575 21
4 34.425 21
5 36.275 15
6 38.125 11
7 39.975 13
8 41.825 10
9 43.675 15
10 45.525 7
11 47.375 12
12 49.225 12
13 51.075 10
14 52.925 11
15 54.775 7
16 56.625 9
17 58.475 2
18 60.325 6
19 62.175 3
20 64.025 7
21 65.875 3
22 67.725 6
23 69.575 4
24 71.425 5
25 73.275 2
26 75.125 1
27 76.975 4
28 78.825 4
29 80.675 1
30 82.525 5
31 84.375 4
32 86.225 1
33 88.075 4
34 89.925 3
35 91.775 7
36 93.625 6
37 95.475 4
38 97.325 2
39 99.175 2
40 101.025 1
41 102.875 3
42 104.725 2
43 106.575 1
44 108.425 2
45 110.275 3
46 112.125 2
47 113.975 1
48 115.825 1
49 117.675 1
50 119.525 1
51 121.375 1
52 128.775 2
53 130.625 3
54 132.475 1
55 134.325 1
56 136.175 2
57 138.025 4
58 139.875 3
59 143.575 1
60 145.425 1
61 150.975 2
62 154.675 1
63 156.525 1
64 158.375 1
65 160.225 1
66 165.775 1
67 173.175 1
68 175.025 1
69 182.425 1
70 189.825 1
71 200.925 16

View File

@@ -0,0 +1,25 @@
x|y
13.825|30
16.175|2
18.525|2
20.875|3
23.225|4
25.575|2
27.925|2
30.275|2
32.625|1
34.975|5
37.325|2
39.675|3
42.025|1
44.375|1
46.725|1
49.075|3
51.425|2
53.775|1
60.825|1
91.375|1
93.725|1
96.075|1
100.775|1
138.375|1
1 x y
2 13.825 30
3 16.175 2
4 18.525 2
5 20.875 3
6 23.225 4
7 25.575 2
8 27.925 2
9 30.275 2
10 32.625 1
11 34.975 5
12 37.325 2
13 39.675 3
14 42.025 1
15 44.375 1
16 46.725 1
17 49.075 3
18 51.425 2
19 53.775 1
20 60.825 1
21 91.375 1
22 93.725 1
23 96.075 1
24 100.775 1
25 138.375 1

View File

@@ -0,0 +1,16 @@
# name: ${FILE_PATH}
# description: ${DESCRIPTION}
# group: [hep]
# The HEP benckmarks repository: https://github.com/iris-hep/adl-benchmarks-index/?tab=readme-ov-file
# The paper: https://www.vldb.org/pvldb/vol15/p154-muller.pdf
require httpfs
cache hep_singleMu.duckdb
load benchmark/realnest/hep/load.sql
run benchmark/realnest/hep/queries/q${QUERY_NUMBER_PADDED}.sql
result benchmark/realnest/hep/answers/q${QUERY_NUMBER_PADDED}.csv

View File

@@ -0,0 +1,78 @@
CREATE TABLE hep_singleMu AS SELECT * FROM READ_PARQUET('https://blobs.duckdb.org/data/realnest/Run2012B_SingleMu_restructured_1000.parquet');
CREATE FUNCTION Pi() AS (ACOS(-1));
CREATE FUNCTION FMod2Pi(x) AS (FMod(x, 2 * Pi()));
CREATE FUNCTION Square(x) AS (x*x);
CREATE FUNCTION DeltaPhi(p1, p2) AS (
CASE
WHEN FMod2Pi(p1['phi'] - p2['phi']) < -Pi() THEN FMod2Pi(p1['phi'] - p2['phi']) + 2 * Pi()
WHEN FMod2Pi(p1['phi'] - p2['phi']) > Pi() THEN FMod2Pi(p1['phi'] - p2['phi']) - 2 * Pi()
ELSE FMod2Pi(p1['phi'] - p2['phi'])
END
);
CREATE FUNCTION DeltaR(p1, p2) AS (SQRT(Square(p1['eta'] - p2['eta']) + Square(DeltaPhi(p1, p2))));
CREATE FUNCTION RhoZ2Eta(Rho, Z) AS (log(Z/Rho + sqrt(Z/Rho * Z/Rho + 1.0)));
CREATE OR REPLACE FUNCTION PtEtaPhiM2PxPyPzE(pepm) AS
{'x': pepm['pt'] * cos(pepm['phi']),
'y': pepm['pt'] * sin(pepm['phi']),
'z': pepm['pt'] * sinh(pepm['eta']),
't': sqrt((pepm['pt'] * cosh(pepm['eta']))*(pepm['pt'] * cosh(pepm['eta'])) + pepm['mass'] * pepm['mass'])
};
CREATE OR REPLACE FUNCTION PxPyPzE2PtEtaPhiM(xyzt) AS
{'pt': sqrt(xyzt['x']*xyzt['x'] + xyzt['y']*xyzt['y']),
'eta': RhoZ2Eta(sqrt(xyzt['x']*xyzt['x'] + xyzt['y']*xyzt['y']), xyzt['z']),
'phi': CASE WHEN (xyzt['x'] = 0.0 AND xyzt['y'] = 0.0) THEN 0 ELSE atan2(xyzt['y'], xyzt['x']) END,
'mass': sqrt(xyzt['t']*xyzt['t'] - xyzt['x']*xyzt['x'] - xyzt['y']*xyzt['y'] - xyzt['z']*xyzt['z'])
};
CREATE OR REPLACE FUNCTION AddPxPyPzE2( xyzt1, xyzt2) AS
{'x' : xyzt1['x'] + xyzt2['x'],
'y' : xyzt1['y'] + xyzt2['y'],
'z' : xyzt1['z'] + xyzt2['z'],
't' : xyzt1['t'] + xyzt2['t']
};
CREATE OR REPLACE FUNCTION AddPxPyPzE3(xyzt1, xyzt2, xyzt3) AS
AddPxPyPzE2(xyzt1, AddPxPyPzE2(xyzt2, xyzt3)
);
CREATE OR REPLACE FUNCTION AddPtEtaPhiM2(pepm1, pepm2) AS
AddPxPyPzE2(
PtEtaPhiM2PxPyPzE(pepm1),
PtEtaPhiM2PxPyPzE(pepm2)
);
CREATE OR REPLACE FUNCTION AddPtEtaPhiM3(
pepm1,
pepm2 ,
pepm3) AS
PxPyPzE2PtEtaPhiM(
AddPxPyPzE3(
PtEtaPhiM2PxPyPzE(pepm1),
PtEtaPhiM2PxPyPzE(pepm2),
PtEtaPhiM2PxPyPzE(pepm3)
)
);
CREATE OR REPLACE FUNCTION HistogramBinHelper(
value, lo, hi, bin_width) AS (
FLOOR((
CASE
WHEN value < lo THEN lo - bin_width / 4
WHEN value > hi THEN hi + bin_width / 4
ELSE value
END - FMod(lo, bin_width)) / bin_width) * bin_width
+ bin_width / 2 + FMod(lo, bin_width)
);
CREATE OR REPLACE FUNCTION HistogramBin(
value, lo, hi, num_bins) AS (
HistogramBinHelper(value, lo, hi, (hi - lo) / num_bins)
);

View File

@@ -0,0 +1,7 @@
# name: benchmark/realnest/hep/q01.benchmark
# description: Q1 - Plot the missing transverse energy of all events
# group: [hep]
template benchmark/realnest/hep/hep.benchmark.in
QUERY_NUMBER=1
QUERY_NUMBER_PADDED=01

View File

@@ -0,0 +1,7 @@
# name: benchmark/realnest/hep/q02.benchmark
# description: Q2 - Plot the transverse momentum of all jets in all events.
# group: [hep]
template benchmark/realnest/hep/hep.benchmark.in
QUERY_NUMBER=2
QUERY_NUMBER_PADDED=02

View File

@@ -0,0 +1,7 @@
# name: benchmark/realnest/hep/q03.benchmark
# description: Q3 - Plot the momentum of jets with |𝜂| < 1 (jet pseudorapidity).
# group: [hep]
template benchmark/realnest/hep/hep.benchmark.in
QUERY_NUMBER=3
QUERY_NUMBER_PADDED=03

View File

@@ -0,0 +1,7 @@
# name: benchmark/realnest/hep/q04.benchmark
# description: Q4 - Plot the energy emission of the events that have at least two jets with a momentum threshold 40 GeV (gigaelectronvolt).
# group: [hep]
template benchmark/realnest/hep/hep.benchmark.in
QUERY_NUMBER=4
QUERY_NUMBER_PADDED=04

View File

@@ -0,0 +1,7 @@
# name: benchmark/realnest/hep/q05.benchmark
# description: Q5 - Plot the transeverse energy of events that have an opposite-charge muon pair with an invariant mass between 60 GeV and 120 GeV.
# group: [hep]
template benchmark/realnest/hep/hep.benchmark.in
QUERY_NUMBER=5
QUERY_NUMBER_PADDED=05

View File

@@ -0,0 +1,7 @@
# name: benchmark/realnest/hep/q06_1.benchmark
# description: Q6-1 - For events with at least three jets, plot the 𝑝𝑇 of the trijet system four-momentum (i.e., any combination of three distinct jets within the same event) that has the invariant mass closest to 172.5 GeV in each event and plot the maximum b-tagging discriminant value among the jets in this trijet.
# group: [hep]
template benchmark/realnest/hep/hep.benchmark.in
QUERY_NUMBER=6_1
QUERY_NUMBER_PADDED=06_1

View File

@@ -0,0 +1,7 @@
# name: benchmark/realnest/hep/q06_2.benchmark
# description: Q6-2 - For events with at least three jets, plot the 𝑝𝑇 of the trijet system four-momentum (i.e., any combination of three distinct jets within the same event) that has the invariant mass closest to 172.5 GeV in each event and plot the maximum b-tagging discriminant value among the jets in this trijet.
# group: [hep]
template benchmark/realnest/hep/hep.benchmark.in
QUERY_NUMBER=6_2
QUERY_NUMBER_PADDED=06_2

View File

@@ -0,0 +1,7 @@
# name: benchmark/realnest/hep/q07.benchmark
# description: Q7 - Plot the scalar sum in each event of the 𝑝𝑇 of the jets with 𝑝𝑇 30 GeV that are not within 0.4 in 𝑅 of any light lepton (i.e., electron or muon) with 𝑝𝑇 10 GeV.
# group: [hep]
template benchmark/realnest/hep/hep.benchmark.in
QUERY_NUMBER=7
QUERY_NUMBER_PADDED=07

View File

@@ -0,0 +1,7 @@
# name: benchmark/realnest/hep/q08.benchmark
# description: Q8 - For events with at least three light leptons and a same-flavor opposite-charge light lepton pair, find such a pair that has the invariant mass closest to 91.2 GeV in each event and plot the transverse mass of the system, consisting of the missing transverse momentum and the highest-𝑝𝑇 light lepton not in this pair.
# group: [hep]
template benchmark/realnest/hep/hep.benchmark.in
QUERY_NUMBER=8
QUERY_NUMBER_PADDED=08

View File

@@ -0,0 +1,16 @@
SELECT
FLOOR((
CASE
WHEN MET.pt < 0 THEN -1
WHEN MET.pt > 2000 THEN 2001
ELSE MET.pt
END) / 20) * 20 + 10 AS x,
COUNT(*) AS y
FROM hep_singleMu
GROUP BY FLOOR((
CASE
WHEN MET.pt < 0 THEN -1
WHEN MET.pt > 2000 THEN 2001
ELSE MET.pt
END) / 20) * 20 + 10
ORDER BY x;

View File

@@ -0,0 +1,17 @@
SELECT
FLOOR((
CASE
WHEN j.pt < 15 THEN 14.99
WHEN j.pt > 60 THEN 60.01
ELSE j.pt
END - 0.15) / 0.45) * 0.45 + 0.375 AS x,
COUNT(*) AS y
FROM hep_singleMu
CROSS JOIN UNNEST(Jet) AS _j(j)
GROUP BY FLOOR((
CASE
WHEN j.pt < 15 THEN 14.99
WHEN j.pt > 60 THEN 60.01
ELSE j.pt
END - 0.15) / 0.45) * 0.45 + 0.375
ORDER BY x;

View File

@@ -0,0 +1,18 @@
SELECT
FLOOR((
CASE
WHEN j.pt < 15 THEN 14.99
WHEN j.pt > 60 THEN 60.01
ELSE j.pt
END - 0.15) / 0.45) * 0.45 + 0.375 AS x,
COUNT(*) AS y
FROM hep_singleMu
CROSS JOIN UNNEST(Jet) AS _j(j)
WHERE abs(j.eta) < 1
GROUP BY FLOOR((
CASE
WHEN j.pt < 15 THEN 14.99
WHEN j.pt > 60 THEN 60.01
ELSE j.pt
END - 0.15) / 0.45) * 0.45 + 0.375
ORDER BY x;

View File

@@ -0,0 +1,17 @@
SELECT
FLOOR((
CASE
WHEN MET.pt < 0 THEN -1
WHEN MET.pt > 2000 THEN 2001
ELSE MET.pt
END) / 20) * 20 + 10 AS x,
COUNT(*) AS y
FROM hep_singleMu
WHERE len(filter(Jet, lambda x: x.pt > 40)) > 1
GROUP BY FLOOR((
CASE
WHEN MET.pt < 0 THEN -1
WHEN MET.pt > 2000 THEN 2001
ELSE MET.pt
END) / 20) * 20 + 10
ORDER BY x;

View File

@@ -0,0 +1,36 @@
WITH temp AS (
WITH m as (select unnest(Muon) as m from hep_singleMu )
SELECT rowid, MET.pt, COUNT(*)
FROM hep_singleMu
CROSS JOIN (
SELECT row_number() OVER () idx1, m.charge as c1, m.eta as e1, m.phi as ph1, m.pt as p1
FROM m
) AS _m1
CROSS JOIN (
SELECT row_number() OVER () idx2, m.charge as c2, m.eta as e2, m.phi as ph2, m.pt as p2
FROM m
) AS _m2
WHERE
len(Muon) > 1 AND
idx1 < idx2 AND
c1 <> c2 AND
SQRT(2 * p1 * p2 * (COSH(e1 - e2) - COS(ph1 - ph2))) BETWEEN 60 AND 120
GROUP BY rowid, MET.pt
HAVING COUNT(*) > 0
)
SELECT
FLOOR((
CASE
WHEN pt < 0 THEN -1
WHEN pt > 2000 THEN 2001
ELSE pt
END) / 20) * 20 + 10 AS x,
COUNT(*) AS y
FROM temp
GROUP BY FLOOR((
CASE
WHEN pt < 0 THEN -1
WHEN pt > 2000 THEN 2001
ELSE pt
END) / 20) * 20 + 10
ORDER BY x;

View File

@@ -0,0 +1,19 @@
WITH trijets_invariant_mass AS materialized (SELECT
row_id_i,
AddPtEtaPhiM3({'pt':j1.pt, 'eta':j1.eta, 'phi':j1.phi, 'mass':j1.mass},
{'pt':j2.pt, 'eta':j2.eta, 'phi':j2.phi, 'mass':j2.mass},
{'pt':j3.pt, 'eta':j3.eta, 'phi':j3.phi, 'mass':j3.mass}) AS triJet,
abs(triJet['mass'] - 172.5) AS invariant_mass
FROM (SELECT j1, row_number() OVER(PARTITION BY row_id) i, row_id row_id_i FROM (SELECT UNNEST(Jet) j1, rowid row_id FROM hep_singleMu WHERE array_length(jet) >= 3)),
(SELECT j2, row_number() OVER(PARTITION BY row_id) j, row_id row_id_j FROM (SELECT UNNEST(Jet) j2, rowid row_id FROM hep_singleMu WHERE array_length(jet) >= 3)),
(SELECT j3, row_number() OVER(PARTITION BY row_id) k, row_id row_id_k FROM (SELECT UNNEST(Jet) j3, rowid row_id FROM hep_singleMu WHERE array_length(jet) >= 3))
WHERE i < j AND j < k AND row_id_i = row_id_j AND row_id_j = row_id_k
ORDER BY invariant_mass ASC)
SELECT
HistogramBin(trijets_invariant_mass.triJet['pt'], 15, 40, 100) AS x,
count(*) AS y
FROM trijets_invariant_mass
WHERE
invariant_mass IN (SELECT min(tim_2.invariant_mass) FROM trijets_invariant_mass tim_2 GROUP BY tim_2.row_id_i)
GROUP BY x
ORDER BY x;

View File

@@ -0,0 +1,20 @@
WITH trijets_b_tag_dval AS materialized (SELECT
row_id_i,
list_max(list_transform([j1, j2, j3], lambda x: x.btag)) AS b_tag_dval,
AddPtEtaPhiM3({'pt':j1.pt, 'eta':j1.eta, 'phi':j1.phi, 'mass':j1.mass},
{'pt':j2.pt, 'eta':j2.eta, 'phi':j2.phi, 'mass':j2.mass},
{'pt':j3.pt, 'eta':j3.eta, 'phi':j3.phi, 'mass':j3.mass}) AS triJet,
abs(triJet['mass'] - 172.5) AS invariant_mass
FROM (SELECT j1, row_number() OVER(Partition BY row_id) i, row_id row_id_i FROM (SELECT UNNEST(Jet) j1, rowid row_id FROM hep_singleMu WHERE array_length(jet) >= 3)),
(SELECT j2, row_number() OVER(Partition BY row_id) j, row_id row_id_j FROM (SELECT UNNEST(Jet) j2, rowid row_id FROM hep_singleMu WHERE array_length(jet) >= 3)),
(SELECT j3, row_number() OVER(Partition BY row_id) k, row_id row_id_k FROM (SELECT UNNEST(Jet) j3, rowid row_id FROM hep_singleMu WHERE array_length(jet) >= 3))
WHERE i < j AND j < k AND row_id_i = row_id_j AND row_id_j = row_id_k
ORDER BY invariant_mass asc)
SELECT
round(HistogramBin(trijets_b_tag_dval.b_tag_dval, 0, 1, 100),3) AS x,
count(*) AS y
FROM trijets_b_tag_dval
WHERE
invariant_mass in (SELECT min(tim_2.invariant_mass) FROM trijets_b_tag_dval tim_2 GROUP BY tim_2.row_id_i)
GROUP BY x
ORDER BY x;

View File

@@ -0,0 +1,36 @@
WITH matching_jets AS (
SELECT rowid, SUM(j.pt) AS pt_sum
FROM hep_singleMu
CROSS JOIN UNNEST(Jet) AS _j(j)
WHERE
j.pt > 30 AND
len(
filter(
Electron,
lambda x: x.pt > 10 AND
sqrt( (j.eta - x.eta) * (j.eta - x.eta) +
pow( (j.phi - x.phi + pi()) % (2 * pi()) - pi(), 2) ) < 0.4)) = 0 AND
len(
filter(
Muon,
lambda x: x.pt > 10 AND
sqrt( (j.eta - x.eta) * (j.eta - x.eta) +
pow( (j.phi - x.phi + pi()) % (2 * pi()) - pi(), 2) ) < 0.4)) = 0
GROUP BY rowid
)
SELECT
FLOOR((
CASE
WHEN pt_sum < 15 THEN 14.9
WHEN pt_sum > 200 THEN 200.1
ELSE pt_sum
END - 0.2) / 1.85) * 1.85 + 1.125 AS x,
COUNT(*) AS y
FROM matching_jets
GROUP BY FLOOR((
CASE
WHEN pt_sum < 15 THEN 14.9
WHEN pt_sum > 200 THEN 200.1
ELSE pt_sum
END - 0.2) / 1.85) * 1.85 + 1.125
ORDER BY x;

View File

@@ -0,0 +1,87 @@
WITH uniform_structure_leptons AS (
SELECT
event,
MET,
list_distinct(
list_concat(
list_transform(
COALESCE(Muon, ARRAY []),
x -> CAST( ROW(x.pt, x.eta, x.phi, x.mass, x.charge, 'm') AS ROW( pt REAL, eta REAL, phi REAL, mass REAL, charge INTEGER, type CHAR ) )
),
list_transform(
COALESCE(Electron, ARRAY []),
x -> CAST( ROW(x.pt, x.eta, x.phi, x.mass, x.charge, 'e') AS ROW( pt REAL, eta REAL, phi REAL, mass REAL, charge INTEGER, type CHAR ) )
)
)
) AS Leptons
FROM hep_singleMu
WHERE len(Muon) + len(Electron) > 2
),
lepton_pairs AS (
WITH m AS (select unnest(Leptons) AS m FROM hep_singleMu)
SELECT
*,
CAST(
ROW(
l1.pt * cos(l1.phi) + l2.pt * cos(l2.phi),
l1.pt * sin(l1.phi) + l2.pt * sin(l2.phi),
l1.pt * ( ( exp(l1.eta) - exp(-l1.eta) ) / 2.0 ) + l2.pt * ( ( exp(l2.eta) - exp(-l2.eta) ) / 2.0 ),
sqrt(l1.pt * cosh(l1.eta) * l1.pt * cosh(l1.eta) + l1.mass * l1.mass) + sqrt(l2.pt * cosh(l2.eta) * l2.pt * cosh(l2.eta) + l2.mass * l2.mass)
) AS
ROW (x REAL, y REAL, z REAL, e REAL)
) AS l,
idx1 AS l1_idx,
idx2 AS l2_idx
FROM uniform_structure_leptons
CROSS JOIN (
SELECT l1, row_number()OVER (PARTITION BY event) idx1
FROM (select unnest(Leptons) l1, event FROM uniform_structure_leptons)
) AS _l1
CROSS JOIN (
SELECT l2, row_number()OVER (PARTITION BY event) idx2
FROM (select unnest(Leptons) l2, event FROM uniform_structure_leptons)
) AS _l2
WHERE idx1 < idx2 AND l1.type = l2.type AND l1.charge != l2.charge
),
processed_pairs AS (
SELECT
event,
min_by(
ROW(
l1_idx,
l2_idx,
Leptons,
MET.pt,
MET.phi
),
abs(91.2 - sqrt(l.e * l.e - l.x * l.x - l.y * l.y - l.z * l.z))
) AS system
FROM lepton_pairs
GROUP BY event
),
other_max_pt AS (
SELECT event, CAST(max_by(sqrt(2 * system[4] * l.pt * (1.0 - cos((system[5]- l.phi + pi()) % (2 * pi()) - pi()))), l.pt) AS REAL) AS pt
FROM processed_pairs
CROSS JOIN (
SELECT l, row_number()OVER (PARTITION BY row_id) idx
FROM (select unnest(system[3]) AS l, event row_id FROM processed_pairs)
)
WHERE idx != system[1] AND idx != system[2]
GROUP BY event
)
SELECT
FLOOR((
CASE
WHEN pt < 15 THEN 14.99
WHEN pt > 250 THEN 250.1
ELSE pt
END - 0.9) / 2.35) * 2.35 + 2.075 AS x,
COUNT(*) AS y
FROM other_max_pt
GROUP BY FLOOR((
CASE
WHEN pt < 15 THEN 14.99
WHEN pt > 250 THEN 250.1
ELSE pt
END - 0.9) / 2.35) * 2.35 + 2.075
ORDER BY x;