|
| 1 | +import warnings |
| 2 | + |
1 | 3 | import awkward as ak
|
2 | 4 | import numpy as np
|
3 | 5 |
|
@@ -555,6 +557,25 @@ def replace(self, layout, cluster, level):
|
555 | 557 | else:
|
556 | 558 | raise AssertionError(layout)
|
557 | 559 |
|
| 560 | + def _warn_for_exclusive(self): |
| 561 | + if ( |
| 562 | + self.jetdef |
| 563 | + not in [ |
| 564 | + fastjet.kt_algorithm, |
| 565 | + fastjet.cambridge_algorithm, |
| 566 | + fastjet.ee_kt_algorithm, |
| 567 | + fastjet.plugin_algorithm, |
| 568 | + ] |
| 569 | + ) and ( |
| 570 | + (self.jetdef not in [fastjet.kt_algorithm, fastjet.cambridge_algorithm]) |
| 571 | + or self.jetdef.extra_param() < 0 |
| 572 | + ): |
| 573 | + warnings.formatwarning = fastjet.formatwarning |
| 574 | + warnings.warn( |
| 575 | + "dcut and exclusive jets for jet-finders other than kt, C/A or genkt with p>=0 should be interpreted with care." |
| 576 | + ) |
| 577 | + return |
| 578 | + |
558 | 579 | def inclusive_jets(self, min_pt):
|
559 | 580 | self._out = []
|
560 | 581 | self._input_flag = 0
|
@@ -727,6 +748,7 @@ def jets(self):
|
727 | 748 | return res
|
728 | 749 |
|
729 | 750 | def exclusive_jets(self, n_jets, dcut):
|
| 751 | + self._warn_for_exclusive() |
730 | 752 | self._out = []
|
731 | 753 | self._input_flag = 0
|
732 | 754 | for i in range(len(self._clusterable_level)):
|
@@ -764,6 +786,7 @@ def exclusive_jets(self, n_jets, dcut):
|
764 | 786 | return res
|
765 | 787 |
|
766 | 788 | def exclusive_jets_ycut(self, ycut):
|
| 789 | + self._warn_for_exclusive() |
767 | 790 | self._out = []
|
768 | 791 | self._input_flag = 0
|
769 | 792 | for i in range(len(self._clusterable_level)):
|
|
0 commit comments