Initiatlize a 4 vector with pt, rapidity, phi, m
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
Hướng nghiên cứu
Bắt đầu với phần xác thực tọa độ được hiển thị trong vector/backends/awkward.py quanh dòng 259, sau đó tái hiện ví dụ ak.zip và ak.sum của issue. Công việc hoàn tất khi Momentum4D chấp nhận pt, rapidity, phi và m, đồng thời có thể tính khối lượng của vector đã được cộng, với độ bao phủ cho các đầu vào được minh họa.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the potential feature
Hi ! Is there a way to make a 4 vector with rapidity instead of pseudo rapidity?
I'm including a "minimal example" of what would be nice :)
pt = [2,1]
rap = [-1,2]
phi=[0,1]
m=[.139,.139]
arr = ak.zip(
{
"pt": pt,
"rapidity": rap,
"phi": phi,
"m": m,
},
with_name="Momentum4D",
)
ak.sum(arr).mass
Right now, the error message is:
ValueError Traceback (most recent call last)
Cell In[238], [line 1](vscode-notebook-cell:?execution_count=238&line=1)
----> [1](vscode-notebook-cell:?execution_count=238&line=1) ak.sum(arr).mass
File ~/miniforge3/lib/python3.12/site-packages/awkward/_dispatch.py:38, in named_high_level_function.<locals>.dispatch(*args, **kwargs)
[35](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/awkward/_dispatch.py:35) @wraps(func)
[36](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/awkward/_dispatch.py:36) def dispatch(*args, **kwargs):
[37](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/awkward/_dispatch.py:37) # NOTE: this decorator assumes that the operation is exposed under `ak.`
---> [38](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/awkward/_dispatch.py:38) with OperationErrorContext(name, args, kwargs):
[39](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/awkward/_dispatch.py:39) gen_or_result = func(*args, **kwargs)
[40](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/awkward/_dispatch.py:40) if isgenerator(gen_or_result):
File ~/miniforge3/lib/python3.12/site-packages/awkward/_errors.py:80, in ErrorContext.__exit__(self, exception_type, exception_value, traceback)
[78](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/awkward/_errors.py:78) self._slate.__dict__.clear()
[79](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/awkward/_errors.py:79) # Handle caught exception
---> [80](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/awkward/_errors.py:80) raise self.decorate_exception(exception_type, exception_value)
[81](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/awkward/_errors.py:81) else:
[82](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/awkward/_errors.py:82) # Step out of the way so that another ErrorContext can become primary.
[83](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/awkward/_errors.py:83) if self.primary() is self:
File ~/miniforge3/lib/python3.12/site-packages/awkward/_dispatch.py:64, in named_high_level_function.<locals>.dispatch(*args, **kwargs)
[62](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/awkward/_dispatch.py:62) # Failed to find a custom overload, so resume the original function
[63](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/awkward/_dispatch.py:63) try:
---> [64](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/awkward/_dispatch.py:64) next(gen_or_result)
...
[259](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/vector/backends/awkward.py:259) "array does not have longitudinal coordinates (z/pz or theta or eta): "
[260](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/vector/backends/awkward.py:260) f"{', '.join(fields)}"
[261](https://file+.vscode-resource.vscode-cdn.net/Users/nicolehartman/Programming/Jet-Clustering/pythia/~/miniforge3/lib/python3.12/site-packages/vector/backends/awkward.py:261) )
ValueError: array does not have longitudinal coordinates (z/pz or theta or eta): pt, rapidity, phi, m
Motivation
As the message suggests, the above code snippet works if I pass eta instead of rapidity, but I'd like to pass rapidity instead in some cases w/o doing the variable transform first to pz or theta.
1802.05356 motivates using rapidity instead of pseudorapidity for HEP :)
Possible Implementation
If you guys give me a pointer where to edit the package, I think I could implement this myself too.
Thank you so much for all the great work on this package, I've loved using it in my workflows, and I'm very enthusiastic supporter of you all!!
- Ngôn ngữ chính
- Python
- Star
- 102
- Fork
- 45
- Merge trung bình
- 4 giờ 11 phút
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của scikit-hep/vector
-
Numba object backend: missing to_2D/to_3D/to_4D, momentum-named conversions, and like()Có thể đã có người làm @Thanatos9404 đã nhận 10 ngày trước. Đang mởfeature
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
scikit-hep/vector#750 · 1 bình luận ·
-
Add ability to somehow map field names to coordinate axis names that vector expectsCó thể làm lại được @hjaat đã nhận 90 ngày trước và không có pull request nào đang mở. Đang mởfeature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
scikit-hep/vector#732 · 3 bình luận ·
-
feature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
scikit-hep/vector#731 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
scikit-hep/vector#711 · 1 bình luận ·
-
Pyright showing errorsĐang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
scikit-hep/vector#654 ·
Tất cả issue của scikit-hep/vector
Issue tương tự
-
Project submission:Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
slavakurilyak/awesome-ai-agents#845 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tests: pin that the atomic writers in utils/paths.py stage the temporary file in the target's directoryCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởdifficulty:2 enhancement good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
MakazhanAlpamys/Soup#2178 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] dcg.waggr permutation p-values are folded twice, so near-zero scores get the smallest p-valuesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
scverse/rapids-singlecell#854 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Slang input: int8_t4_packed and uint8_t4_packed are copied into CrossGLCó thể đã có người làm @ninglinLiu đã nhận hôm nay. Đang mởarea:frontend backend:slang bug direction:input
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
random_elements(unique=True) on an OrderedDict: ZeroDivisionError once only zero weights remain, AssertionError with use_weighting=FalseCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 13 ngày