Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Reinstate optical simulation #199

Merged
merged 4 commits into from
Aug 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions wfsim/strax_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,24 @@ class RawRecordsFromFax1T(RawRecordsFromFaxNT):
provides = ('raw_records', 'truth')


@export
class RawRecordsFromFaxOpticalNT(RawRecordsFromFaxNT):

def _setup(self):
self.sim = ChunkRawRecords(self.config,
rawdata_generator=wfsim.RawDataOptical,
channels=self.channels,
timings=self.timings,)
self.sim.truth_buffer = np.zeros(10000, dtype=instruction_dtype + optical_extra_dtype
+ truth_extra_dtype + [('fill', bool)])
self.sim_iter = self.sim(self.instructions)


def get_instructions(self):
assert self.config['fax_file'].endswith('.root'), 'You need to supply a root file for optical simulation!'
self.instructions, self.channels, self.timings = read_optical(self.config)


@export
@strax.takes_config(
strax.Option('epix_config', track=False, default={},
Expand Down