DDASToys for NSCLDAQ  6.2-000
lmfit_template.h
Go to the documentation of this file.
1 /*
2  This software is Copyright by the Board of Trustees of Michigan
3  State University (c) Copyright 2017.
4 
5  You may use this software under the terms of the GNU public license
6  (GPL). The terms of this license are described at:
7 
8  http://www.gnu.org/licenses/gpl.txt
9 
10  Authors:
11  Aaron Chester
12  FRIB
13  Michigan State University
14  East Lansing, MI 48824-1321
15 */
16 
24 #ifndef LMFIT_TEMPLATE_H
25 #define LMFIT_TEMPLATE_H
26 
27 #include <cstdint>
28 #include <vector>
29 #include <utility>
30 
31 #include "fit_extensions.h"
32 
34 namespace ddastoys {
36  namespace templatefit {
37 
51  const std::vector<std::pair<uint16_t, uint16_t>>* s_pPoints;
52  const std::vector<double>* s_pTraceTemplate;
53  };
54 
74  void lmfit1(
75  fit1Info* pResult, std::vector<uint16_t>& trace,
76  std::vector<double>& traceTemplate, unsigned alignPoint,
77  const std::pair<unsigned, unsigned>& limits,
78  uint16_t saturation = 0xffff
79  );
80 
96  void lmfit2(
97  fit2Info* pResult, std::vector<uint16_t>& trace,
98  std::vector<double>& traceTemplate, unsigned alignPoint,
99  const std::pair<unsigned, unsigned>& limits,
100  fit1Info* pSinglePulseFit = nullptr,
101  uint16_t saturation = 0xffff
102  );
103 
105  }
106 };
107 
108 #endif
Define structs used by fitting functions and to extend DDAS hits.
void lmfit1(fit1Info *pResult, std::vector< uint16_t > &trace, std::vector< double > &traceTemplate, unsigned alignPoint, const std::pair< unsigned, unsigned > &limits, uint16_t saturation=0xffff)
Driver for the GSL LM fitter for single pulses.
Definition: lmfit_template.cpp:140
void lmfit2(fit2Info *pResult, std::vector< uint16_t > &trace, std::vector< double > &traceTemplate, unsigned alignPoint, const std::pair< unsigned, unsigned > &limits, fit1Info *pSinglePulseFit=nullptr, uint16_t saturation=0xffff)
Driver for the GSL LM fitter for double pulses.
Definition: lmfit_template.cpp:330
Full fitting information for the single pulse.
Definition: fit_extensions.h:48
Full fitting information for the double pulse.
Definition: fit_extensions.h:60
Data passed around the fitting subsystem to Jacobian and function evaluators.
Definition: lmfit_template.h:49
const std::vector< double > * s_pTraceTemplate
Template data.
Definition: lmfit_template.h:52
const std::vector< std::pair< uint16_t, uint16_t > > * s_pPoints
Definition: lmfit_template.h:51