-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathann.smk
79 lines (73 loc) · 2.51 KB
/
ann.smk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
"""
Snakemake rules for processing ann tier. This is done only for the coax detectors
to apply the ann and risetime cuts for psd.
"""
from legenddataflow.patterns import (
get_pattern_tier,
get_pattern_log,
get_pattern_pars,
)
from legenddataflow.execenv import execenv_pyexe
rule build_ann:
input:
dsp_file=get_pattern_tier(config, "dsp", check_in_cycle=False),
pars_file=lambda wildcards: get_input_par_file(
setup=config, wildcards=wildcards, tier="ann", name="cuts"
),
params:
timestamp="{timestamp}",
datatype="{datatype}",
output:
tier_file=get_pattern_tier(config, "ann", check_in_cycle=check_in_cycle),
db_file=get_pattern_pars_tmp(config, "ann_db"),
log:
get_pattern_log(config, "tier_ann", time),
group:
"tier-ann"
resources:
runtime=300,
mem_swap=lambda wildcards: 25 if wildcards.datatype == "cal" else 15,
shell:
execenv_pyexe(config, "build-tier-dsp") + "--log {log} "
"--configs {configs} "
"--metadata {meta} "
"--tier ann "
"--datatype {params.datatype} "
"--timestamp {params.timestamp} "
"--input {input.dsp_file} "
"--output {output.tier_file} "
"--db-file {output.db_file} "
"--pars-file {input.pars_file} "
rule build_pan:
input:
dsp_file=get_pattern_tier(config, "psp", check_in_cycle=False),
pars_file=lambda wildcards: get_input_par_file(
setup=config, wildcards=wildcards, tier="ann", name="cuts"
),
params:
timestamp="{timestamp}",
datatype="{datatype}",
table_map=lambda wildcards: get_table_mapping(
channelmap_textdb, wildcards.timestamp, wildcards.datatype, "dsp"
),
output:
tier_file=get_pattern_tier(config, "pan", check_in_cycle=check_in_cycle),
db_file=get_pattern_pars_tmp(config, "pan_db"),
log:
get_pattern_log(config, "tier_pan", time),
group:
"tier-ann"
resources:
runtime=300,
mem_swap=lambda wildcards: 25 if wildcards.datatype == "cal" else 15,
shell:
execenv_pyexe(config, "build-tier-dsp") + "--log {log} "
"--configs {configs} "
"--table-map '{params.table_map}' "
"--tier pan "
"--datatype {params.datatype} "
"--timestamp {params.timestamp} "
"--input {input.dsp_file} "
"--output {output.tier_file} "
"--db-file {output.db_file} "
"--pars-file {input.pars_file} "