NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
SetFileReader.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 
21  #ifndef SETFILEREADER_H
22  #define SETFILEREADER_H
23 
24  #include "SettingsReader.h"
25  #include "SetFile.h"
26  #include <string>
27  #include <map>
28  namespace DDAS {
30  {
31  private:
32  std::string m_setfile;
33  std::string m_varfile;
34  unsigned m_Mhz;
35  unsigned m_slotId;
36  public:
38  const char* setfile, const char* varfile,
39  unsigned Mhz, unsigned slot
40  );
41  virtual ~SetFileReader() {}
42  virtual DDAS::ModuleSettings get();
43 
44  private:
45  std::pair<unsigned, uint32_t*> findSlot(
46  const std::pair<unsigned, uint32_t*>& vars,
47  const VarOffsetArray& map
48  );
49  DDAS::ModuleSettings getModuleSettings(
50  unsigned nLongs, uint32_t* pVars, const VarOffsetArray& map
51  );
52  std::pair<unsigned, uint32_t*> next(
53  unsigned nLongs, uint32_t* pVars, const VarOffsetArray& map
54  );
55 
56  uint32_t getSingleItem(
57  const DDAS::SetFileByName& settings, const char* name
58  );
59  std::vector<uint32_t> getItemVector(
60  const DDAS::SetFileByName& settings, const char* name
61  );
62  std::vector<float> getFloats(
63  const DDAS::SetFileByName& settings, const char* name
64  );
65  uint32_t getMsPs();
66  double toMicros(uint32_t value, uint32_t MsPs);
67 
68  void setChannelParamsUs(
69  double* dest, const DDAS::SetFileByName& src,
70  const char* which, uint32_t msps, double fastFilterRange
71  );
72  void setChannelParamsV(
73  double* dest, const DDAS::SetFileByName& src,
74  const char* which, uint32_t range
75  );
76  void setChannelParamsI(
77  uint32_t* dest, const DDAS::SetFileByName& src,
78  const char* which
79  );
80  void setChannelParamsD(
81  double* dest, const DDAS::SetFileByName& src,
82  const char* which
83  );
84  void convertTriggerThresholds(
85  double* rawThresholds, const DDAS::SetFileByName& src, uint32_t msps
86  );
87  void convertEnergyTimes(
88  double* raw, double multiplier, uint32_t msps
89  );
90  void convertTraceLength(double* raw, double ffr, uint32_t msps);
91  void convertTraceDelay(
92  double* raw, const DDAS::SetFileByName& src, double ffr, uint32_t msps
93  );
94  void convertBinFactor(uint32_t* raw);
95  void convertBlAverage(uint32_t* raw);
96  void computeXdt(double* raw);
97  void convertQdcLen(double* raw, uint32_t msps);
98  const Variable& throwIfNotPresent(
99  const DDAS::SetFileByName& src, const char* which
100  );
101 
102 
103  };
104  } // DDASNamespace
105 
106  #endif
Definition: SetFile.h:94
: Define the abstract base class SettingsReader
Definition: SetFileReader.h:29
SetFileReader(const char *setfile, const char *varfile, unsigned Mhz, unsigned slot)
Definition: SetFileReader.cpp:38
Definition: ModuleSettings.h:36
Definition: SettingsReader.h:38
: Define structures and funcions for setfiles.
Definition: functions.h:26