From 931f7a48d633f895a13af3672edace05f5380033 Mon Sep 17 00:00:00 2001 From: Peter Gaemers Date: Fri, 27 Aug 2021 15:54:20 +0200 Subject: [PATCH 1/4] Update strax_interface.py --- wfsim/strax_interface.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/wfsim/strax_interface.py b/wfsim/strax_interface.py index 9fc6ce53..d86f66d5 100644 --- a/wfsim/strax_interface.py +++ b/wfsim/strax_interface.py @@ -539,6 +539,21 @@ 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.nveto_channels, + timings=self.nveto_timings,) + 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={}, From dce313d52b56e825603f51e24e8be6c760e21919 Mon Sep 17 00:00:00 2001 From: Peter Gaemers Date: Fri, 27 Aug 2021 15:56:26 +0200 Subject: [PATCH 2/4] Update strax_interface.py woops --- wfsim/strax_interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wfsim/strax_interface.py b/wfsim/strax_interface.py index d86f66d5..7c9df4c4 100644 --- a/wfsim/strax_interface.py +++ b/wfsim/strax_interface.py @@ -545,8 +545,8 @@ class RawRecordsFromFaxOpticalNT(RawRecordsFromFaxNT): def _setup(self): self.sim = ChunkRawRecords(self.config, rawdata_generator=wfsim.RawDataOptical, - channels=self.nveto_channels, - timings=self.nveto_timings,) + channels=self.channels, + timings=self.timings,) self.sim_iter = self.sim(self.instructions) def get_instructions(self): From 07b7131f9c0575ecae60669cf4fa401c756efc5d Mon Sep 17 00:00:00 2001 From: Andrii Terliuk Date: Fri, 27 Aug 2021 10:21:36 -0500 Subject: [PATCH 3/4] fixing comma in assert --- wfsim/strax_interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wfsim/strax_interface.py b/wfsim/strax_interface.py index 7c9df4c4..9701fb24 100644 --- a/wfsim/strax_interface.py +++ b/wfsim/strax_interface.py @@ -550,7 +550,7 @@ def _setup(self): 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!' + 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) From 2ebc297cc96b4ef784548b922397e85f889f02d9 Mon Sep 17 00:00:00 2001 From: Peter Gaemers Date: Fri, 27 Aug 2021 20:59:10 +0200 Subject: [PATCH 4/4] Update strax_interface.py --- wfsim/strax_interface.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wfsim/strax_interface.py b/wfsim/strax_interface.py index 9701fb24..785d6ea4 100644 --- a/wfsim/strax_interface.py +++ b/wfsim/strax_interface.py @@ -547,8 +547,11 @@ def _setup(self): 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)