@@ -171,9 +171,7 @@ def get_cluster_closest_primary_label_batch(data, coord_label, clusts, primary_i
171171 return TensorBatch (labels , clusts .counts )
172172
173173
174- def get_cluster_points_label_batch (
175- data , coord_label , clusts , random_order = True , use_group = False
176- ):
174+ def get_cluster_points_label_batch (data , coord_label , clusts , random_order = True ):
177175 """Batched version of :func:`get_cluster_points_label`
178176
179177 Parameters
@@ -187,11 +185,6 @@ def get_cluster_points_label_batch(
187185 random_order : bool, default True
188186 If `True`, randomize the order in which the start en end points of
189187 a track are stored in the output
190- use_group : bool, default False
191- If `True`, use the true group ID to fetch the particle end point
192- labels. Otherwise, use particle IDs and select the earliest particle
193- in time.
194-
195188 Returns
196189 -------
197190 np.ndarray
@@ -210,7 +203,6 @@ def get_cluster_points_label_batch(
210203 coord_label [b ],
211204 clusts [b ],
212205 random_order ,
213- use_group ,
214206 )
215207
216208 return TensorBatch (points , clusts .counts , coord_cols = points .shape [1 ])
@@ -982,9 +974,7 @@ def _get_cluster_features_extended(
982974 keep_torch = True ,
983975 ref_arg = "data" ,
984976)
985- def get_cluster_points_label (
986- data , coord_label , clusts , random_order = True , use_group = False
987- ):
977+ def get_cluster_points_label (data , coord_label , clusts , random_order = True ):
988978 """Gets label points for each cluster.
989979
990980 Returns start point of primary shower fragment twice if shower, delta or
@@ -1002,11 +992,6 @@ def get_cluster_points_label(
1002992 random_order : bool, default True
1003993 If `True`, randomize the order in which the start en end points of
1004994 a track are stored in the output
1005- use_group : bool, default False
1006- If `True`, use the true group ID to fetch the particle end point
1007- labels. Otherwise, use particle IDs and select the earliest particle
1008- in time.
1009-
1010995 Returns
1011996 -------
1012997 np.ndarray
@@ -1015,7 +1000,7 @@ def get_cluster_points_label(
10151000 if len (clusts ) == 0 :
10161001 return np .empty ((0 , 6 ), dtype = data .dtype )
10171002
1018- return _get_cluster_points_label (data , coord_label , clusts , random_order , use_group )
1003+ return _get_cluster_points_label (data , coord_label , clusts , random_order )
10191004
10201005
10211006@nb .njit (cache = True )
@@ -1024,28 +1009,22 @@ def _get_cluster_points_label(
10241009 coord_label : nb .float64 [:, :],
10251010 clusts : nb .types .List (nb .int64 [:]),
10261011 random_order : nb .boolean = True ,
1027- use_group : nb .boolean = False ,
10281012) -> nb .float64 [:, :]:
10291013
10301014 # Get start and end points (one and the same for all but track class)
10311015 points = np .empty ((len (clusts ), 6 ), dtype = data .dtype )
10321016 for i , c in enumerate (clusts ):
1033- if use_group :
1034- # Use the true aggregate particle identity directly.
1035- label_ids = np .unique (data [c , GROUP_COL ]).astype (np .int64 )
1036- label_id = label_ids [0 ]
1037- else :
1038- # Use the first constituent particle in time.
1039- part_ids = np .unique (data [c , PART_COL ]).astype (np .int64 )
1040- label_id = - 1
1041- min_time = np .inf
1042- for part_id in part_ids :
1043- if part_id < 0 or part_id >= len (coord_label ):
1044- raise IndexError ("Invalid label index for coord_label." )
1045- time = coord_label [part_id , COORD_TIME_COL ]
1046- if time < min_time :
1047- min_time = time
1048- label_id = part_id
1017+ # Use the first constituent particle in time.
1018+ part_ids = np .unique (data [c , PART_COL ]).astype (np .int64 )
1019+ label_id = - 1
1020+ min_time = np .inf
1021+ for part_id in part_ids :
1022+ if part_id < 0 or part_id >= len (coord_label ):
1023+ raise IndexError ("Invalid label index for coord_label." )
1024+ time = coord_label [part_id , COORD_TIME_COL ]
1025+ if time < min_time :
1026+ min_time = time
1027+ label_id = part_id
10491028
10501029 if label_id < 0 or label_id >= len (coord_label ):
10511030 raise IndexError ("Invalid label index for coord_label." )
0 commit comments