Skip to content

Commit

Permalink
Merge pull request #158 from DUNE/feature_nd_config
Browse files Browse the repository at this point in the history
update the ndlar yaml configuration
  • Loading branch information
mjkramer authored Feb 9, 2025
2 parents 35cf467 + e523dd8 commit e68b184
Show file tree
Hide file tree
Showing 15 changed files with 257 additions and 40 deletions.
34 changes: 34 additions & 0 deletions yamls/ndlar_flow/reco/charge/CalibHitBuilderMC.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
classname: CalibHitBuilder # reco/charge/calib_hit_builder.py
path: proto_nd_flow.reco.charge.calib_prompt_hits
requires:
- 'charge/events'
- 'charge/raw_hits'
- 'charge/packets'
- 'combined/t0'
- name: 'charge/packets_index'
path: ['charge/packets']
index_only: True
- name: 'packet_frac_backtrack'
path: ['charge/packets','mc_truth/packet_fraction']
- name: 'packet_seg_backtrack'
path: ['charge/packets','mc_truth/segments']

params:
# inputs
events_dset_name: 'charge/events'
packets_dset_name: 'charge/packets'
packets_index_name: 'charge/packets_index'
raw_hits_dset_name: 'charge/raw_hits'
t0_dset_name: 'combined/t0'
max_contrib_segments: 10

# output
calib_hits_dset_name: 'charge/calib_prompt_hits'
mc_hit_frac_dset_name: 'mc_truth/calib_prompt_hit_backtrack'

# configuration parameters
pedestal_mv: 580.0
vref_mv: 1568.0 #M0-like: 1300 #2x2: 1568.0
vcm_mv: 478.1 #M0-like:288 #478.0 #2x2: 478.1
adc_counts: 256
gain: 4.522 #datasheet: 4 #measurement(?): 4.522
40 changes: 40 additions & 0 deletions yamls/ndlar_flow/reco/charge/CalibNoiseFilter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This class implements several filters to remove irregularities in data from LArPix bugs or configuration issues.
# References on these issues can be found here:
# - https://docs.dunescience.org/cgi-bin/private/RetrieveFile?docid=32080&filename=2x2_Charge_Readout_Features_July2024_Data.pdf&version=1
#
# Further information on the implementation of the filters can be found here:
# - https://indico.fnal.gov/event/65995/contributions/298818/attachments/181069/248231/Aug%2027%2C%202024_%20sim_calib%20update%20on%20post-hit%20filtering.pdf
# - https://indico.fnal.gov/event/66399/contributions/300891/attachments/182225/250160/adc%20droop%20and%20data%20features%20-%20sim_calib%2010_01_2024.pdf
#


classname: CalibNoiseFilter # reco/charge/calib_noise_filter
path: proto_nd_flow.reco.charge.calib_noise_filter
requires:
- 'charge/events'
- 'charge/calib_prompt_hits'
- name: 'hits_frac_backtrack'
path: ['charge/calib_prompt_hits','mc_truth/calib_prompt_hit_backtrack']

params:
# inputs
events_dset_name: 'charge/events'
hits_name: 'charge/calib_prompt_hits'
filter_function_names: ['hot_pixel_filter','correlated_post_trigger_filter', 'low_current_filter'] #which filter functions to apply (this is an ordered list, but all filters will be "OR'd")

#params specific to each cut
low_current_filter__threshold: 6.0 #
hot_pixel_filter__max_n_hits: 35
#hot_pixel_filter__max_n_hits:
# - maximum number of hits on a channel in single event before filtering all hits from channel
# - 35 chosen by hand scanning events. in a 200us event, 35 hits corresponds to ~50% of the maximum data rate from a LArPix channel
#
# low_current_filter__threshold:
# - minimum Q for filter
# - 6 chosen from hand scanning, and to be ~1ke- above the mean 2x2 thresholds. This is currently crude, and this should be implemented in the future as a per-channel threshold.


# outputs
calib_hits_dset_name: 'charge/calib_final_hits'
mc_hit_frac_dset_name: 'mc_truth/calib_final_hit_backtrack'

12 changes: 12 additions & 0 deletions yamls/ndlar_flow/reco/charge/EventBuilder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
classname: EventBuilder
path: proto_nd_flow.reco.charge.event_builder
requires:
- 'charge/raw_hits'
- 'charge/ext_trigs'
params:
# inputs
hits_dset_name: 'charge/raw_hits'
ext_trigs_dset_name: 'charge/ext_trigs'

# output
events_dset_name: 'charge/events'
17 changes: 17 additions & 0 deletions yamls/ndlar_flow/reco/charge/ExternalTriggerFinder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
classname: ExternalTriggerFinder
path: proto_nd_flow.reco.charge.external_trigger_finder
requires:
- 'charge/packets'
- name: 'charge/packets_corr_ts'
path: ['charge/packets', 'charge/packets_corr_ts']
params:
# inputs
packets_dset_name: 'charge/packets'
ts_dset_name: 'charge/packets_corr_ts'

# output
ext_trigs_dset_name: 'charge/ext_trigs'

# configuration parameters
pacman_trigger_enabled: True
pacman_trigger_word_filter: 2
13 changes: 13 additions & 0 deletions yamls/ndlar_flow/reco/charge/RawHitBuilder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
classname: RawHitBuilder # reco/charge/raw_hit_builder.py
path: proto_nd_flow.reco.charge.raw_hit_builder
requires:
- 'charge/packets'
- name: 'charge/packets_corr_ts'
path: ['charge/packets', 'charge/packets_corr_ts']
params:
# inputs
packets_dset_name: 'charge/packets'
ts_dset_name: 'charge/packets_corr_ts'

# output
hits_dset_name: 'charge/raw_hits'
86 changes: 86 additions & 0 deletions yamls/ndlar_flow/reco/charge/TimestampCorrectorMC.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
classname: TimestampCorrector
path: proto_nd_flow.reco.charge.timestamp_corrector
requires:
- 'charge/packets'
- name: 'charge/packets_index'
path: 'charge/packets'
index_only: True
params:
# input
packets_dset_name: 'charge/packets'

# output
ts_dset_name: 'charge/packets_corr_ts' # new dataset

# configuration parameters
correction:
1: [0., 0.]
2: [0., 0.]
3: [0., 0.]
4: [0., 0.]
5: [0., 0.]
6: [0., 0.]
7: [0., 0.]
8: [0., 0.]
9: [0., 0.]
10: [0., 0.]
11: [0., 0.]
12: [0., 0.]
13: [0., 0.]
14: [0., 0.]
15: [0., 0.]
16: [0., 0.]
17: [0., 0.]
18: [0., 0.]
19: [0., 0.]
20: [0., 0.]
21: [0., 0.]
22: [0., 0.]
23: [0., 0.]
24: [0., 0.]
25: [0., 0.]
26: [0., 0.]
27: [0., 0.]
28: [0., 0.]
29: [0., 0.]
30: [0., 0.]
31: [0., 0.]
32: [0., 0.]
33: [0., 0.]
34: [0., 0.]
35: [0., 0.]
36: [0., 0.]
37: [0., 0.]
38: [0., 0.]
39: [0., 0.]
40: [0., 0.]
41: [0., 0.]
42: [0., 0.]
43: [0., 0.]
44: [0., 0.]
45: [0., 0.]
46: [0., 0.]
47: [0., 0.]
48: [0., 0.]
49: [0., 0.]
50: [0., 0.]
51: [0., 0.]
52: [0., 0.]
53: [0., 0.]
54: [0., 0.]
55: [0., 0.]
56: [0., 0.]
57: [0., 0.]
58: [0., 0.]
59: [0., 0.]
60: [0., 0.]
61: [0., 0.]
62: [0., 0.]
63: [0., 0.]
64: [0., 0.]
65: [0., 0.]
66: [0., 0.]
67: [0., 0.]
68: [0., 0.]
69: [0., 0.]
70: [0., 0.]
File renamed without changes.
17 changes: 17 additions & 0 deletions yamls/ndlar_flow/resources/LArData.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
classname: LArData
path: proto_nd_flow.resources.lar_data
params:
path: 'lar_info'
# electron_lifetime_file: 'data/module0_flow/ElecLifetimeFit_Module0.npz'
# download link: https://portal.nersc.gov/project/dune/data/Module0/electronLifetime/ElecLifetimeFit_Module0.root
electron_lifetime: 2200 # us
#: Recombination :math:`\alpha` constant for the Box model
box_alpha: 0.93
#: Recombination :math:`\beta` value for the Box model in :math:`(kV/cm)(g/cm^2)/MeV`
box_beta: 0.207 #0.3 (MeV/cm)^-1 * 1.383 (g/cm^3)* 0.5 (kV/cm), R. Acciarri et al JINST 8 (2013) P08005
#: Recombination :math:`A_b` value for the Birks Model
birks_Ab: 0.800
#: Recombination :math:`k_b` value for the Birks Model in :math:`(kV/cm)(g/cm^2)/MeV`
birks_kb: 0.0486 # g/cm2/MeV Amoruso, et al NIM A 523 (2004) 275
#: Average energy expended per ion pair in LAr in :math:`eV` from Phys. Rev. A 10, 1452
W_ion: 23.6
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ flow:


resources:
- !include yamls/ndlar_flow/resources/RunData.yaml
- !include yamls/ndlar_flow/resources/RunDataMC.yaml


raw_event_generator: # groups time-sorted data packets from larpix datalog files
!include yamls/ndlar_flow/reco/charge/RawEventGenerator.yaml
!include yamls/ndlar_flow/reco/charge/RawEventGeneratorMC.yaml

Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ flow:


resources:
- !include yamls/ndlar_flow/resources/RunData.yaml
- !include yamls/ndlar_flow/resources/Geometry.yaml
- !include yamls/ndlar_flow/resources/RunDataMC.yaml
- !include yamls/ndlar_flow/resources/GeometryMC.yaml


raw_events:
Expand All @@ -21,17 +21,17 @@ raw_events:


timestamp_corrector:
!include yamls/proto_nd_flow/reco/charge/TimestampCorrector.yaml
!include yamls/ndlar_flow/reco/charge/TimestampCorrectorMC.yaml


ext_trig_finder:
!include yamls/proto_nd_flow/reco/charge/ExternalTriggerFinder.yaml
!include yamls/ndlar_flow/reco/charge/ExternalTriggerFinder.yaml


raw_hit_builder:
!include yamls/proto_nd_flow/reco/charge/RawHitBuilder.yaml
!include yamls/ndlar_flow/reco/charge/RawHitBuilder.yaml


event_builder:
!include yamls/proto_nd_flow/reco/charge/EventBuilder.yaml
!include yamls/ndlar_flow/reco/charge/EventBuilder.yaml

26 changes: 0 additions & 26 deletions yamls/ndlar_flow/workflows/charge/final_calibration.yaml

This file was deleted.

24 changes: 24 additions & 0 deletions yamls/ndlar_flow/workflows/charge/final_calibration_mc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generates the mid-level event built data for charge data (i.e. hits and
# external triggers)

flow:
source: raw_events
stages: [calib_noise_filter]
drop: []


resources:
- !include yamls/ndlar_flow/resources/RunDataMC.yaml
- !include yamls/ndlar_flow/resources/LArData.yaml
- !include yamls/ndlar_flow/resources/GeometryMC.yaml

raw_events:
classname: H5FlowDatasetLoopGenerator
path: h5flow.modules
dset_name: 'charge/raw_events'
params:
chunk_size: 32

calib_noise_filter:
!include yamls/ndlar_flow/reco/charge/CalibNoiseFilter.yaml

Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ flow:


resources:
- !include yamls/ndlar_flow/resources/RunData.yaml
- !include yamls/proto_nd_flow/resources/LArData.yaml
- !include yamls/ndlar_flow/resources/Geometry.yaml
- !include yamls/ndlar_flow/resources/RunDataMC.yaml
- !include yamls/ndlar_flow/resources/LArData.yaml
- !include yamls/ndlar_flow/resources/GeometryMC.yaml


raw_events:
Expand All @@ -21,5 +21,5 @@ raw_events:
chunk_size: 128

calib_hit_builder:
!include yamls/proto_nd_flow/reco/charge/CalibHitBuilder.yaml
!include yamls/ndlar_flow/reco/charge/CalibHitBuilderMC.yaml

Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ events:
chunk_size: 32

resources:
- !include yamls/ndlar_flow/resources/RunData.yaml
- !include yamls/ndlar_flow/resources/Geometry.yaml
- !include yamls/ndlar_flow/resources/RunDataMC.yaml
- !include yamls/ndlar_flow/resources/GeometryMC.yaml
- !include yamls/proto_nd_flow/resources/LArData.yaml
# - !include yamls/proto_nd_flow/resources/DisabledChannels.yaml

Expand Down

0 comments on commit e68b184

Please sign in to comment.