Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CaloWaveformFitting.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CaloWaveformFitting.h
1 #ifndef CALORECO_CALOWAVEFORMFITTING_H
2 #define CALORECO_CALOWAVEFORMFITTING_H
3 
4 #include <string>
5 #include <vector>
6 
7 class TProfile;
8 
10 {
11  public:
12  CaloWaveformFitting() = default;
13  ~CaloWaveformFitting() = default;
14 
15  void set_template_file(const std::string &template_input_file)
16  {
17  m_template_input_file = template_input_file;
18  return;
19  }
20 
21  void set_nthreads(int nthreads)
22  {
23  _nthreads = nthreads;
24  return;
25  }
26 
27  void set_softwarezerosuppression(bool usezerosuppression,int softwarezerosuppression)
28  {
29  _nsoftwarezerosuppression = softwarezerosuppression;
30  _bdosoftwarezerosuppression = usezerosuppression;
31  }
32 
33  int get_nthreads()
34  {
35  return _nthreads;
36  }
37 
38  std::vector<std::vector<float>> process_waveform(std::vector<std::vector<float>> waveformvector);
39  std::vector<std::vector<float>> calo_processing_templatefit(std::vector<std::vector<float>> chnlvector);
40  std::vector<std::vector<float>> calo_processing_fast(std::vector<std::vector<float>> chnlvector);
41 
42  void initialize_processing(const std::string &templatefile);
43 
44  private:
45  void FastMax(float x0, float x1, float x2, float y0, float y1, float y2, float &xmax, float &ymax);
46  TProfile *h_template = nullptr;
47  double template_function(double *x, double *par);
48  int _nthreads = 1;
54  double m_peakTimeTemp = 0;
55 
58 };
59 #endif