Skip to content

Commit

Permalink
Can't combine correcting chip hit edges, and parse clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulVanSchayck committed Feb 17, 2022
1 parent 3030a7b commit 52164b5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
5 changes: 4 additions & 1 deletion lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ def parse_config(argv=None):
parser.error('Parsing clusters (-C) is required when parsing events (-E)')

if settings.freq_tot and settings.hits_combine_chips:
parser.error('When building --freq_tot you cannot combine chips to one matrix first. Set --hits_combine_chips to 0.')
parser.error('When building --freq_tot you cannot combine chips to one matrix first. Set --hits_combine_chips to 0.')

if settings.hits_correct_chip_edges and settings.C:
parser.error("Cannot combine correcting for hit chip edges and parsing clusters at the same time.")

return settings

Expand Down
8 changes: 1 addition & 7 deletions orchestration/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,7 @@ def run(self):
}

if self.settings.store_hits:
# We need to pass the uncorrected hits to cluster finding. So create copy of hits
if self.settings.hits_correct_chip_edges:
hits_corrected = hits.copy()
hits_corrected = tpx3format.correct_chip_edge_hits(hits_corrected)
output['hits'] = hits_corrected
else:
output['hits'] = hits
output['hits'] = hits

if self.settings.C:
cl, cl_info = self.parse_hits(hits)
Expand Down
2 changes: 2 additions & 0 deletions tpx3HitParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def main():

# ToA sorting for hits and events
if settings.hits_sort_toa:
# TODO: Handle hits data not being present
logger.info('Start sorting hits data on ToA...')
hits = io.read_hits(settings.output)
hits = numpy.sort(hits, 0, 'stable', 'ToA')
Expand All @@ -83,6 +84,7 @@ def main():
logger.info('Finished sorting hits data on ToA.')

if settings.event_sort_toa:
# TODO: Handle events data not being present
logger.info('Start sorting event data on ToA...')
events = io.read_events(settings.output)
events = numpy.sort(events, 0, 'stable', 'ToA')
Expand Down
3 changes: 3 additions & 0 deletions tpx3format/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,9 @@ def parse_data_packages(positions, f, tot_correction, settings):
if settings.hits_combine_chips:
combine_chips(hits, settings.hits_cross_extra_offset)

if settings.hits_correct_chip_edges:
correct_chip_edge_hits(hits)

hits = np.sort(hits, 0, 'stable', 'ToA')

return hits, min_toa, max_toa
Expand Down

0 comments on commit 52164b5

Please sign in to comment.