should be it
This commit is contained in:
8
external/duckdb/benchmark/realnest/hep/answers/q01.csv
vendored
Normal file
8
external/duckdb/benchmark/realnest/hep/answers/q01.csv
vendored
Normal 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
|
||||
|
102
external/duckdb/benchmark/realnest/hep/answers/q02.csv
vendored
Normal file
102
external/duckdb/benchmark/realnest/hep/answers/q02.csv
vendored
Normal 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
|
||||
|
99
external/duckdb/benchmark/realnest/hep/answers/q03.csv
vendored
Normal file
99
external/duckdb/benchmark/realnest/hep/answers/q03.csv
vendored
Normal 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
|
||||
|
7
external/duckdb/benchmark/realnest/hep/answers/q04.csv
vendored
Normal file
7
external/duckdb/benchmark/realnest/hep/answers/q04.csv
vendored
Normal 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
|
||||
|
5
external/duckdb/benchmark/realnest/hep/answers/q05.csv
vendored
Normal file
5
external/duckdb/benchmark/realnest/hep/answers/q05.csv
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
x|y
|
||||
10.0|39
|
||||
30.0|15
|
||||
50.0|2
|
||||
70.0|1
|
||||
|
76
external/duckdb/benchmark/realnest/hep/answers/q06_1.csv
vendored
Normal file
76
external/duckdb/benchmark/realnest/hep/answers/q06_1.csv
vendored
Normal 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
|
||||
|
79
external/duckdb/benchmark/realnest/hep/answers/q06_2.csv
vendored
Normal file
79
external/duckdb/benchmark/realnest/hep/answers/q06_2.csv
vendored
Normal 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
|
||||
|
71
external/duckdb/benchmark/realnest/hep/answers/q07.csv
vendored
Normal file
71
external/duckdb/benchmark/realnest/hep/answers/q07.csv
vendored
Normal 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
|
||||
|
25
external/duckdb/benchmark/realnest/hep/answers/q08.csv
vendored
Normal file
25
external/duckdb/benchmark/realnest/hep/answers/q08.csv
vendored
Normal 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
|
||||
|
16
external/duckdb/benchmark/realnest/hep/hep.benchmark.in
vendored
Normal file
16
external/duckdb/benchmark/realnest/hep/hep.benchmark.in
vendored
Normal 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
|
||||
78
external/duckdb/benchmark/realnest/hep/load.sql
vendored
Normal file
78
external/duckdb/benchmark/realnest/hep/load.sql
vendored
Normal 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)
|
||||
);
|
||||
7
external/duckdb/benchmark/realnest/hep/q01.benchmark
vendored
Normal file
7
external/duckdb/benchmark/realnest/hep/q01.benchmark
vendored
Normal 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
|
||||
7
external/duckdb/benchmark/realnest/hep/q02.benchmark
vendored
Normal file
7
external/duckdb/benchmark/realnest/hep/q02.benchmark
vendored
Normal 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
|
||||
7
external/duckdb/benchmark/realnest/hep/q03.benchmark
vendored
Normal file
7
external/duckdb/benchmark/realnest/hep/q03.benchmark
vendored
Normal 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
|
||||
7
external/duckdb/benchmark/realnest/hep/q04.benchmark
vendored
Normal file
7
external/duckdb/benchmark/realnest/hep/q04.benchmark
vendored
Normal 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
|
||||
7
external/duckdb/benchmark/realnest/hep/q05.benchmark
vendored
Normal file
7
external/duckdb/benchmark/realnest/hep/q05.benchmark
vendored
Normal 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
|
||||
7
external/duckdb/benchmark/realnest/hep/q06_1.benchmark
vendored
Normal file
7
external/duckdb/benchmark/realnest/hep/q06_1.benchmark
vendored
Normal 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
|
||||
7
external/duckdb/benchmark/realnest/hep/q06_2.benchmark
vendored
Normal file
7
external/duckdb/benchmark/realnest/hep/q06_2.benchmark
vendored
Normal 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
|
||||
7
external/duckdb/benchmark/realnest/hep/q07.benchmark
vendored
Normal file
7
external/duckdb/benchmark/realnest/hep/q07.benchmark
vendored
Normal 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
|
||||
7
external/duckdb/benchmark/realnest/hep/q08.benchmark
vendored
Normal file
7
external/duckdb/benchmark/realnest/hep/q08.benchmark
vendored
Normal 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
|
||||
16
external/duckdb/benchmark/realnest/hep/queries/q01.sql
vendored
Normal file
16
external/duckdb/benchmark/realnest/hep/queries/q01.sql
vendored
Normal 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;
|
||||
17
external/duckdb/benchmark/realnest/hep/queries/q02.sql
vendored
Normal file
17
external/duckdb/benchmark/realnest/hep/queries/q02.sql
vendored
Normal 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;
|
||||
18
external/duckdb/benchmark/realnest/hep/queries/q03.sql
vendored
Normal file
18
external/duckdb/benchmark/realnest/hep/queries/q03.sql
vendored
Normal 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;
|
||||
17
external/duckdb/benchmark/realnest/hep/queries/q04.sql
vendored
Normal file
17
external/duckdb/benchmark/realnest/hep/queries/q04.sql
vendored
Normal 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;
|
||||
36
external/duckdb/benchmark/realnest/hep/queries/q05.sql
vendored
Normal file
36
external/duckdb/benchmark/realnest/hep/queries/q05.sql
vendored
Normal 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;
|
||||
19
external/duckdb/benchmark/realnest/hep/queries/q06_1.sql
vendored
Normal file
19
external/duckdb/benchmark/realnest/hep/queries/q06_1.sql
vendored
Normal 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;
|
||||
20
external/duckdb/benchmark/realnest/hep/queries/q06_2.sql
vendored
Normal file
20
external/duckdb/benchmark/realnest/hep/queries/q06_2.sql
vendored
Normal 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;
|
||||
36
external/duckdb/benchmark/realnest/hep/queries/q07.sql
vendored
Normal file
36
external/duckdb/benchmark/realnest/hep/queries/q07.sql
vendored
Normal 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;
|
||||
87
external/duckdb/benchmark/realnest/hep/queries/q08.sql
vendored
Normal file
87
external/duckdb/benchmark/realnest/hep/queries/q08.sql
vendored
Normal 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;
|
||||
Reference in New Issue
Block a user