Berkeley Nuclear Data Software
ConfigBuilder.h
Go to the documentation of this file.
1 #ifndef _CONFIG_BUILDER_H_
2 #define _CONFIG_BUILDER_H_
3 
4 #include "../external/json/single_include/nlohmann/json.hpp"
5 using nlohmann::json;
6 #include "ConfigClasses.h"
7 
8 #include <string>
9 
14 {
15 public:
17  ConfigBuilder();
20  static ExperimentConfig processFile(std::string a_filename,
21  bool a_optVerbose = false
22  );
25  static ExperimentConfig processFile(std::string a_filename,
26  std::string a_sectionName,
27  bool a_optVerbose = false
28  );
32  static ExperimentConfig procDetectorArray(json a_jsonObject,
33  bool a_optVerbose = false
34  );
40  bool a_optVerbose = false
41  );
44  static OrgScintInfo buildOrgScintInfo(json a_jsonObject);
50  static InorgScintInfo buildInorgScintInfo(json a_jsonObject);
53  static HPGeInfo buildHPGeInfo(json a_jsonObject);
56  static CloverInfo buildCloverInfo(json a_jsonObject);
57  //this function builds and returns a PointSourceInfo given a json
58  // representation of the class
59  static PointSourceInfo buildPointSourceInfo(json a_jsonObject);
63  json a_jsonObject);
66  /*incomplete and not used currently for STOF MC
67  static MultiPMTOrgScintUncInfo buildMultiPMTOrgScintUncInfo(
68  json a_jsonObject);
69  */
74  static void constructDetectorInfo(DetectorInfo& a_det, json a_jsonObject);
80  json a_jsonObject);
81 
82  static std::map<uint32_t , double> readTStepFile(std::string a_filename);
83  static std::map<std::string,std::pair< double , double >>
84  readClycConfig(std::string a_filename);
85  static std::map<std::string,double> readClycXSBuildConfig(std::string
86  a_filename);
87 private:
88 
89  //used to remove repetitive code
90  static void manageLinearGainCalib(DetectorElementInfo& a_det,
91  json a_jsonObject
92  );
93 
94  static void manageQuadraticGainCalib(DetectorElementInfo& a_det,
95  json a_jsonObject
96  );
97  //used to remove repetitive code
98  static void manageTimeOffsetCalib(DetectorElementInfo& a_det,
99  json a_jsonObject
100  );
101  //used to remove repetitive code
102  static void managePolyCalib(DetectorElementInfo& a_det,
103  json a_jsonObject
104  );
105  static DetType getDetType(json a_jsonObject);
106 
107 };
108 #endif
DetType
Definition: ConfigClasses.h:20
nlohmann::json json
Definition: PSDCutFinder.cpp:13
this class is inteded to represent of full set of information
Definition: ConfigClasses.h:341
Definition: ConfigBuilder.h:14
static std::map< std::string, double > readClycXSBuildConfig(std::string a_filename)
Definition: ConfigBuilder.cpp:1088
static HPGeInfo buildHPGeInfo(json a_jsonObject)
Definition: ConfigBuilder.cpp:472
static MultiPMTOrgScintInfo buildMultiPMTOrgScintInfo(json a_jsonObject)
Definition: ConfigBuilder.cpp:420
static InorgScintInfo buildInorgScintInfo(json a_jsonObject)
Definition: ConfigBuilder.cpp:456
static PointSourceInfo buildPointSourceInfo(json a_jsonObject)
Definition: ConfigBuilder.cpp:613
static OrgScintUncertaintiesInfo buildOrgScintUncertaintiesInfo(json a_jsonObject)
McGuire, 2023.
Definition: ConfigBuilder.cpp:646
static void constructDetectorElementInfo(DetectorElementInfo &a_det, json a_jsonObject)
Definition: ConfigBuilder.cpp:833
static CloverInfo buildCloverInfo(json a_jsonObject)
Definition: ConfigBuilder.cpp:501
static ExperimentUncertaintiesConfig procDetArrayUnc(json a_jsonObject, bool a_optVerbose=false)
Definition: ConfigBuilder.cpp:290
static OrgScintInfo buildOrgScintInfo(json a_jsonObject)
Definition: ConfigBuilder.cpp:325
static ExperimentConfig procDetectorArray(json a_jsonObject, bool a_optVerbose=false)
Definition: ConfigBuilder.cpp:208
static ExperimentConfig processFile(std::string a_filename, bool a_optVerbose=false)
Definition: ConfigBuilder.cpp:15
static void constructDetectorInfo(DetectorInfo &a_det, json a_jsonObject)
Definition: ConfigBuilder.cpp:770
ConfigBuilder()
default constructor puts the class into a working state
Definition: ConfigBuilder.cpp:9
static std::map< std::string, std::pair< double, double > > readClycConfig(std::string a_filename)
Definition: ConfigBuilder.cpp:1059
static std::map< uint32_t, double > readTStepFile(std::string a_filename)
Definition: ConfigBuilder.cpp:1034
Definition: ConfigClasses.h:169
Definition: ConfigClasses.h:76
Definition: ConfigClasses.h:431
Definition: ConfigClasses.h:652
Definition: ConfigClasses.h:332
Definition: ConfigClasses.h:323
Definition: ConfigClasses.h:248
Definition: ConfigClasses.h:197
Definition: ConfigClasses.h:606
Definition: ConfigClasses.h:40