Feature/writer WIP
Add Writer feature and one Writer strategy.
Still need to:
- Implement getBaselineMu() and getBaselineRMS() in Channel.
- Correct ntpTime so that rather than finding the time between the first two pulses in a waveform, it finds the time between the last two (I believe that's how it's implemented in the original code).
Writer follows the same pattern as PulseFinding and PulseAnalysis - using strategies so that code is easily expandable. This makes sense for Writer; an experimenter may need to configure output data, file structure, and file hierarchies.
Adds new Output
object added to JSON configuration file. Output
has three attribute, all used exclusively by the Writer:
-
FilePath
(str) -
FitType
(int) -
WriterStrategy
(str)Filepath
andFitType
are concatenated to generate [descriptive] output-file names. The end result being the same as the original implementation; something like:path/to/file.root.Ch1Fit2
We'll leave it up to the experimenters to change the format of the filename, if desired. A downside to how output-file naming is currently being implemented is that the configuration file Output.FilePath
value only applies to the filename substring up to the second dot ('.'). In other words, if Output.FilePath == "./ntp/dec_25/experiment_1.root"
, the resulting filename will be postfixed with ".ChXFitY" (where X is the channel number and Y is the fit number). This implementation currently requires editing code, not just the config file, if modifying or removing the ".ChXFitY" postfix is desired.
It may also be desired to edit output file headers and contents from the configuration file; something to consider for the future. IMO there are now two available paths forward for further modifying Writer: expanding config and using it to change file headers, etc, or creating new Writer strategies.
Note also that a baseline histogram is written for the first channel only. I believe that this is the same as the original implementation.
Makefile was edited to include Writer, this was based on Jolie's recommendations (and was implemented to the best of my knowledge).