AE: Probably want to check that the pulse hasn't overflowed or underflowed before we try and create a template from it in TemplateCreator
AE: Move CreateRefinedPulseHistogram() from TemplateCreator to TemplateFitter so that it can be used by TemplateAPGenerator.
AE: Add a TemplateFitter and create the pulse histogram
AE: Make initial estimates for the parameters. I copied this code from TemplateCreator, when I probably shouldn't have and put the common code somehwere accessible to both
AE: Fit the pulse and print some debug statements
AE: Get the amplitude from the fit
AE: Normalise the templates properly since we want the amplitude to be 1 and not the area
AE: Comment out the really verbose debug output in HistogramFitFCN
AE: For TemplateAPGenerator the maximum amplitude could go up to the max_adc_value (since the amplitude is normalised to 1) whereas for the TemplateCreator we had a maximum limit of 100. Maybe I should find a clever way to allow both
AE: Add the TemplateFitter, also use the PulseCandidateFinder and also allow the corrected templates to be printed out