Skip to content

Commit ae26c6c

Browse files
committed
debug hit scripts for hades
1 parent 43d5983 commit ae26c6c

File tree

4 files changed

+34
-20
lines changed

4 files changed

+34
-20
lines changed

src/legenddataflowscripts/par/geds/hit/aoe.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,13 @@ def par_geds_hit_aoe() -> None:
251251
]
252252

253253
if "dt_param" in kwarg_dict:
254-
params += kwarg_dict["dt_param"]
254+
params.append(kwarg_dict["dt_param"])
255255
else:
256256
params.append("dt_eff")
257257

258258
if "dt_cut" in kwarg_dict and kwarg_dict["dt_cut"] is not None:
259259
cal_dict.update(kwarg_dict["dt_cut"]["cut"])
260260
params.append(kwarg_dict["dt_cut"]["out_param"])
261-
262261
# load data in
263262
data, threshold_mask = load_data(
264263
files,
@@ -271,9 +270,12 @@ def par_geds_hit_aoe() -> None:
271270
msg = f"Loaded {len(data)} events"
272271
log.info(msg)
273272

274-
mask = get_pulser_mask(
275-
pulser_file=args.pulser_file,
276-
)
273+
if args.pulser_file is not None:
274+
mask = get_pulser_mask(
275+
pulser_file=args.pulser_file,
276+
)
277+
else:
278+
mask = np.zeros(len(threshold_mask), dtype=bool)
277279

278280
data["is_pulser"] = mask[threshold_mask]
279281

src/legenddataflowscripts/par/geds/hit/ecal.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -532,9 +532,12 @@ def par_geds_hit_ecal() -> None:
532532
cal_energy_param="trapTmax",
533533
)
534534

535-
mask = get_pulser_mask(
536-
pulser_file=args.pulser_file,
537-
)
535+
if args.pulser_file is not None:
536+
mask = get_pulser_mask(
537+
pulser_file=args.pulser_file,
538+
)
539+
else:
540+
mask = np.zeros(len(threshold_mask), dtype=bool)
538541

539542
data["is_pulser"] = mask[threshold_mask]
540543

src/legenddataflowscripts/par/geds/hit/lq.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,12 @@ def par_geds_hit_lq() -> None:
288288
msg = f"Loaded {len(data)} events"
289289
log.info(msg)
290290

291-
mask = get_pulser_mask(
292-
pulser_file=args.pulser_file,
293-
)
291+
if args.pulser_file is not None:
292+
mask = get_pulser_mask(
293+
pulser_file=args.pulser_file,
294+
)
295+
else:
296+
mask = np.zeros(len(threshold_mask), dtype=bool)
294297

295298
data["is_pulser"] = mask[threshold_mask]
296299

src/legenddataflowscripts/par/geds/hit/qc.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,18 @@ def build_qc(
3939
):
4040
search_name = table_name if table_name[-1] == "/" else table_name + "/"
4141

42-
kwarg_dict_fft = config["fft_fields"]
42+
kwarg_dict_fft = config.get("fft_fields", None)
4343
kwarg_dict_cal = config["cal_fields"]
4444

4545
cut_fields = get_keys(
4646
[key.replace(search_name, "") for key in ls(cal_files[0], search_name)],
4747
kwarg_dict_cal["cut_parameters"],
4848
)
49-
cut_fields += get_keys(
50-
[key.replace(search_name, "") for key in ls(cal_files[0], search_name)],
51-
kwarg_dict_fft["cut_parameters"],
52-
)
49+
if kwarg_dict_fft is not None:
50+
cut_fields += get_keys(
51+
[key.replace(search_name, "") for key in ls(cal_files[0], search_name)],
52+
kwarg_dict_fft["cut_parameters"],
53+
)
5354

5455
if "initial_cal_cuts" in config:
5556
init_cal = config["initial_cal_cuts"]
@@ -147,9 +148,12 @@ def build_qc(
147148
cal_energy_param="trapTmax",
148149
)
149150

150-
mask = get_pulser_mask(
151-
pulser_file=pulser_file,
152-
)
151+
if pulser_file is not None:
152+
mask = get_pulser_mask(
153+
pulser_file=pulser_file,
154+
)
155+
else:
156+
mask = np.zeros(len(threshold_mask), dtype=bool)
153157

154158
data["is_pulser"] = mask[threshold_mask]
155159

@@ -289,7 +293,9 @@ def build_qc(
289293
def par_geds_hit_qc() -> None:
290294
argparser = argparse.ArgumentParser()
291295
argparser.add_argument("--cal-files", help="cal_files", nargs="*", type=str)
292-
argparser.add_argument("--fft-files", help="fft_files", nargs="*", type=str)
296+
argparser.add_argument(
297+
"--fft-files", help="fft_files", nargs="*", type=str, default=[]
298+
)
293299

294300
argparser.add_argument(
295301
"--tcm-filelist", help="tcm_filelist", type=str, required=False

0 commit comments

Comments
 (0)