Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore prescale decoding in CodaDecoder
Also, add checks to the THaRun initialization logic to detect uninitialized prescale factors. These now cause run initialization to fail, as it should, if prescale factors are requested. The prescale event decoder should really be placed in an event type handler object, but doing so is a lot more messy than I would like it to be. Here's why: The run initialization uses a private instance of the decoder, and only the decoder, to scan for essential run information. If the prescale processing (and other processing) is put in separate event type handlers, those handlers would have to be processed at this point of the code as well. Then the question arises, which handlers do we instantiate? What if the run asks for more than just prescales, or simply prescales are differently? How would we set up the correct prescale handler object for the decoder we want to use? Currently, this is all neatly handled via polymorphism of THaEvData. If we want to decode something other than CODA files, we just use a different concrete THaEvData class, e.g. OtherRawDataFormatDecoder, which extracts prescale factors in the appropriate way and offers them via the generic THaEvData interface. The decoder class is set up by the user via THaInterface::SetDecoder, so knowledge of this one class type is sufficient to decode the input data properly. If file-format-specific decoding is now moved into separate event type handler classes, this logic will fail. Obviously, this design will have to be revisited at a later time.
- Loading branch information
Showing
4 changed files
with
99 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters