charge event building

# Generates the low-level event built data for charge data (i.e. grouped
# packets)

flow:
  source: raw_event_generator
  stages: [] # just generate events, no analysis stages
  drop: []


resources:
  - !include yamls/module0_flow/resources/RunData.yaml


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

charge event reconstruction

# Generates the mid-level event built data for charge data (i.e. hits and
# external triggers)

flow:
  source: raw_events
  stages: [chip_id_bit_flip_fix, timestamp_corrector, ext_trig_finder, hit_builder, hit_merger, time_dependent_gain, event_builder]
  drop: []


resources:
  - !include yamls/module0_flow/resources/RunData.yaml
  - !include yamls/module0_flow/resources/Geometry.yaml


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


chip_id_bit_flip_fix:
  !include yamls/module0_flow/reco/charge/BitFlipFix.yaml


timestamp_corrector:
  !include yamls/module0_flow/reco/charge/TimestampCorrector.yaml


ext_trig_finder:
  !include yamls/module0_flow/reco/charge/ExternalTriggerFinder.yaml


hit_builder:
  !include yamls/module0_flow/reco/charge/HitBuilder.yaml


hit_merger:
  !include yamls/module0_flow/reco/charge/HitMerger.yaml


time_dependent_gain:
  !include yamls/module0_flow/reco/charge/TimeDependentGain.yaml


event_builder:
  !include yamls/module0_flow/reco/charge/EventBuilder.yaml

light event building

# Generates the low-level event built data for light data (i.e. grouped raw
# waveforms)

flow:
  source: light_event_generator

light_event_generator:
  !include yamls/module0_flow/reco/light/LightADC64EventGenerator.yaml
  

light event reconstruction

# Performs noise subtraction, deconvolution, and peak finding on raw light
# waveforms

flow:
  source: 'light/events'
  stages: [timestamp_corrector, wvfm_filt, wvfm_deconv, wvfm_align, wvfm_sum] #sipm_hit_finder, wvfm_sum, hit_finder]

  # remove waveforms from output file
  drop: ['light/wvfm', 'light/fwvfm', 'light/deconv']


resources:
  - !include yamls/module0_flow/resources/RunData.yaml
  - !include yamls/module0_flow/resources/Geometry.yaml
  - !include yamls/module0_flow/resources/LArData.yaml


timestamp_corrector:
  !include yamls/module0_flow/reco/light/LightTimestampCorrector.yaml


wvfm_filt:
  !include yamls/module0_flow/reco/light/WaveformNoiseFilter.yaml


wvfm_deconv:
  !include yamls/module0_flow/reco/light/WaveformDeconvolution.yaml


wvfm_align:
  !include yamls/module0_flow/reco/light/WaveformAlign.yaml


sipm_hit_finder:
  !include yamls/module0_flow/reco/light/SiPMHitFinder.yaml


wvfm_sum:
  !include yamls/module0_flow/reco/light/WaveformSum.yaml


hit_finder:
  !include yamls/module0_flow/reco/light/WaveformHitFinder.yaml

charge/light matching

# Generates associations between charge events and light events

flow:
  source: 'charge/events'
  stages: [charge_light_associator]
  drop: []


resources:
  - !include yamls/module0_flow/resources/RunData.yaml


charge_light_associator:
  !include yamls/module0_flow/reco/charge/Charge2LightAssociation.yaml

combined reconstruction

# Performs combined reconstruction, generating t0s, tracklets, ...

flow:
  source: events
  stages: [t0_reco, drift_reco, electron_lifetime_corr, tracklet_reco, tracklet_merge]
  drop: []

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

resources:
  - !include yamls/module0_flow/resources/RunData.yaml
  - !include yamls/module0_flow/resources/Geometry.yaml
  - !include yamls/module0_flow/resources/LArData.yaml
  - !include yamls/module0_flow/resources/DisabledChannels.yaml

t0_reco:
  !include yamls/module0_flow/reco/combined/T0Reconstruction.yaml


drift_reco:
  !include yamls/module0_flow/reco/combined/DriftReconstruction.yaml


electron_lifetime_corr:
  !include yamls/module0_flow/reco/combined/ElectronLifetimeCalib.yaml


tracklet_reco:
  !include yamls/module0_flow/reco/combined/TrackletReconstruction.yaml


tracklet_merge:
  !include yamls/module0_flow/reco/combined/TrackletMerger.yaml