NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
SetFileWriter.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  Ron Fox
12  Giordano Cerriza
13  NSCL
14  Michigan State University
15  East Lansing, MI 48824-1321
16 */
17 
22 #ifndef SETFILEWRITER_H
23 #define SETFILEWRITER_H
24 #include "SettingsWriter.h"
25 
26 namespace DDAS {
27 
28 class SetFileEditor;
29 class ModuleSettings;
30 
38 {
39 private:
40  SetFileEditor& m_editor;
41  unsigned short m_slot;
42  unsigned short m_Mhz;
43 public:
45  SetFileEditor& editor, unsigned short slot,
46  unsigned short Mhz
47  );
48  virtual ~SetFileWriter(){}
49 
50  virtual void write(const ModuleSettings& dspSettings);
51 private:
52  void writeModuleSettings(const ModuleSettings& dspSettings);
53  void writeChannelSettings(const ModuleSettings& dspSettings);
54 
55  void writeTriggerRiseTime(const double* riseTimes, uint32_t ffrange);
56  void writeTriggerFlattop(const double* ftops, uint32_t ffrange);
57  void writeTriggerThresholds(const double* ts);
58  void writeVoffsets(const double* voffs);
59  void writeXDTs(const double* xdts);
60  void writeBaselines(const double* bls);
61  void writeBinFactor(const uint32_t* fs);
62  void writeBaselineAverages(const uint32_t* blas);
63  void setIntFromDoubles(const char* what, const double* vals, int bound=-1);
64  void writeFastTriggerBacklens(const double* blens);
65  void writeCFDDelays(const double* dels);
66  void writeQDCLen(const char* which, const double* lens);
67  void writeExtTrigStretch(const double* stretches);
68  void writeTaus(const double* taus);
69  void writeERise(const double* rise);
70  void writeEFlattop(const double* flats);
71  void writeTraceLengths(const double* lens);
72  void writeTraceDelays(const double* dels);
73 
74  void computePeakSampleAndSep(
75  uint32_t sfr,
76  const std::vector<uint32_t>& sls, const std::vector<uint32_t>& sgs
77  );
78  void computeFifo(uint32_t traceDelay, unsigned short chan);
79  void writeClockScaledWithLimits(
80  const char* what, const double* raw, uint32_t low, uint32_t high
81  );
82  double clkMult() const;
83  void throwInvalidMhz() const;
84 };
85 
86 } // namespace DDAS.
87 #endif
Definition: SettingsWriter.h:41
Definition: SetFileWriter.h:37
: Abstract base class to write DSP settings to file.
Definition: ModuleSettings.h:36
Definition: SetFileEditor.h:34
SetFileWriter(SetFileEditor &editor, unsigned short slot, unsigned short Mhz)
Definition: SetFileWriter.cpp:42
Definition: functions.h:26
virtual void write(const ModuleSettings &dspSettings)
Definition: SetFileWriter.cpp:57