Berkeley Nuclear Data Software
STOFConfig.h
Go to the documentation of this file.
1 #ifndef _STOF_CONFIG_H_
2 #define _STOF_CONFIG_H_
3 
4 //project includes
5 #include "ConfigClasses.h"
6 #include "ConfigBuilder.h"
7 #include "CalibrationClasses.h"
8 //external inputs
9 #include "json.hpp"
10 
16 {
17 public:
19 STOFConfig();
20 STOFConfig(const STOFConfig& a_config);
21 virtual STOFConfig& operator=(const STOFConfig& a_rhs);
22 
23 void procFile(std::string a_jsonConfig);
24 
25 bool isConstructed();
26 
27 bool isKnown(int a_ch,
28  int a_modID =0
29  ) const;
30 bool isTarget(int a_ch,
31 
32  int a_modID =0
33  ) const;
34 bool isScatter(int a_ch,
35  int a_modID =0
36  ) const;
37 bool isRF(int a_ch) const;
38 int getRFCh() const;
42 double getTCal(int a_targID,int a_scatID);
45 double getTarTCal(int a_targID);
46 const ScintConfig& getTargetConfig() const;
47 const ScintConfig& getScatterConfig() const;
51 bool canDoTiming();
53 bool hasOffsetCalib();
55 bool passesDtCut(int a_targID,
56  double a_timeDiff
57  );
59 void buildTarScatDistMap();
63 double getTargScatDistance(int a_targID,int a_scatID);
64 
65 double getTarScintBUDistance(int a_targID);
66 double getRFPeriod();
67 double getTargetSR(int a_targID);
68 
71 double getAvgTheta();
72 
75 double getAvgExitFP();
76 
79 CutBase* getTargZCut(int a_targID);
82 CutBase* getScatZCut(int a_scatID);
83 void setTargZCut(int a_targID,CutBase* a_cut);
84 void setScatZCut(int a_scatID,CutBase* a_cut);
85 //this function is a passthrough to the target timeing calibratoins
86 void setTime(uint32_t a_t);
89 void setTargetConfig(ScintConfig a_targetConfig);
92 void setScatterConfig(ScintConfig a_scatterConfig);
93 void clearScintConfigs();
94 //clean up internally managed memory
95 virtual ~STOFConfig();
96 protected:
99 double m_detHalfLength; //in m
100 std::map<int,double> m_targetArea;
103 uint m_rfChID;
104 std::map<std::pair<int,int>, double > m_tCalibs;
105 std::map<int, DetectorCalib*> m_tarTCalibs;
106 std::map<int, double> m_tarBUDistance;
107 std::map<int, CutBase*> m_tarDTCuts;
108 std::map<std::pair<int,int>,double> m_tarScatDist;
109 std::map<int, CutBase*> m_scatZCuts;
110 std::map<int, CutBase*> m_targZCuts;
111 
112 double m_RFPeriod;
114 
115 
116 };
117 
119 {
120 public:
121  STOFErrorConfig();
122  void procMCConfig(std::string a_config);
123 
126 
127  double getCoinTOFCalibUnc(int a_targID,
128  int a_scatID);
129  double getIncTOFCalibUnc(int a_targID);
130  double getIncFlightPathUnc(int a_targID);
131  std::vector<double> getMatchWindow();
132  double getMatchWindowUncertainty();
133  double getZCutUncTarget(int a_targID);
134  double getZCutUncScatter(int a_scatID);
135 
136 private:
139  //map for storing uncertainties on incoming time calibrations
140  std::map<int, double> m_incTOFCalibUnc;
141  //map for storing uncertainties on coincident time calibrations
142  std::map<std::pair<int,int>, double> m_coinTOFCalibUnc;
143  //map for storing uncertainties on zcut
144  std::map<int, double> m_targZCutsUnc;
145  std::map<int, double> m_scatZCutsUnc;
146  std::map<int, double> m_tarBUDistanceUnc;
147  std::vector<double> m_matchWindow;
148  double m_matchUnc;
149 };
150 
151 #endif
Definition: CutClasses.h:70
Definition: ConfigClasses.h:652
Definition: STOFConfig.h:16
std::map< int, CutBase * > m_tarDTCuts
Definition: STOFConfig.h:107
void setTargetConfig(ScintConfig a_targetConfig)
Definition: STOFConfig.cpp:460
const ScintConfig & getScatterConfig() const
Definition: STOFConfig.cpp:315
std::map< int, DetectorCalib * > m_tarTCalibs
Definition: STOFConfig.h:105
double getRFPeriod()
Definition: STOFConfig.cpp:382
double getTargScatDistance(int a_targID, int a_scatID)
Definition: STOFConfig.cpp:371
std::map< int, CutBase * > m_scatZCuts
Definition: STOFConfig.h:109
std::map< int, double > m_tarBUDistance
Definition: STOFConfig.h:106
int getRFCh() const
Definition: STOFConfig.cpp:296
double getAvgExitFP()
Definition: STOFConfig.cpp:410
bool canDoTiming()
Definition: STOFConfig.cpp:321
std::map< std::pair< int, int >, double > m_tCalibs
Definition: STOFConfig.h:104
std::map< std::pair< int, int >, double > m_tarScatDist
Definition: STOFConfig.h:108
bool isRF(int a_ch) const
Definition: STOFConfig.cpp:292
double getTarTCal(int a_targID)
Definition: STOFConfig.cpp:306
void setScatterConfig(ScintConfig a_scatterConfig)
Definition: STOFConfig.cpp:464
void buildTarScatDistMap()
builds target-Scatter distances
Definition: STOFConfig.cpp:342
uint m_rfChID
Definition: STOFConfig.h:103
double getTCal(int a_targID, int a_scatID)
Definition: STOFConfig.cpp:301
double getTarScintBUDistance(int a_targID)
Definition: STOFConfig.cpp:377
bool hasOffsetCalib()
tests if the config has built m_tarDTCuts,
Definition: STOFConfig.cpp:331
double getTargetSR(int a_targID)
Definition: STOFConfig.cpp:387
std::map< int, double > m_targetArea
Definition: STOFConfig.h:100
ScintConfig m_targetConfig
Definition: STOFConfig.h:101
bool isTarget(int a_ch, int a_modID=0) const
Definition: STOFConfig.cpp:279
bool isScatter(int a_ch, int a_modID=0) const
Definition: STOFConfig.cpp:285
CutBase * getTargZCut(int a_targID)
Definition: STOFConfig.cpp:425
virtual ~STOFConfig()
Definition: STOFConfig.cpp:635
double getAvgTheta()
Definition: STOFConfig.cpp:396
void setTime(uint32_t a_t)
Definition: STOFConfig.cpp:451
bool passesDtCut(int a_targID, double a_timeDiff)
call to passesCut for multipmtTargets
Definition: STOFConfig.cpp:335
double m_detHalfLength
Definition: STOFConfig.h:99
void clearScintConfigs()
Definition: STOFConfig.cpp:469
STOFConfig()
default contstructor puts the class into a working but empty state
Definition: STOFConfig.cpp:3
void setScatZCut(int a_scatID, CutBase *a_cut)
Definition: STOFConfig.cpp:443
const ScintConfig & getTargetConfig() const
Definition: STOFConfig.cpp:311
ScintConfig m_scatterConfig
Definition: STOFConfig.h:102
double m_RFPeriod
Definition: STOFConfig.h:112
std::map< int, CutBase * > m_targZCuts
Definition: STOFConfig.h:110
virtual STOFConfig & operator=(const STOFConfig &a_rhs)
Definition: STOFConfig.cpp:48
bool isKnown(int a_ch, int a_modID=0) const
Definition: STOFConfig.cpp:266
bool m_isConstructed
Definition: STOFConfig.h:113
void procFile(std::string a_jsonConfig)
Definition: STOFConfig.cpp:106
CutBase * getScatZCut(int a_scatID)
Definition: STOFConfig.cpp:431
void setTargZCut(int a_targID, CutBase *a_cut)
Definition: STOFConfig.cpp:435
bool isConstructed()
Definition: STOFConfig.cpp:262
Definition: STOFConfig.h:119
std::vector< double > getMatchWindow()
Definition: STOFConfig.cpp:618
const ExperimentUncertaintiesConfig & getScatterUncConfig() const
Definition: STOFConfig.cpp:596
const ExperimentUncertaintiesConfig & getTargetUncConfig() const
Definition: STOFConfig.cpp:592
double getMatchWindowUncertainty()
Definition: STOFConfig.cpp:622
double getZCutUncScatter(int a_scatID)
Definition: STOFConfig.cpp:630
STOFErrorConfig()
Definition: STOFConfig.cpp:476
double getCoinTOFCalibUnc(int a_targID, int a_scatID)
Definition: STOFConfig.cpp:601
double getZCutUncTarget(int a_targID)
Definition: STOFConfig.cpp:626
void procMCConfig(std::string a_config)
Definition: STOFConfig.cpp:482
double getIncFlightPathUnc(int a_targID)
Definition: STOFConfig.cpp:613
double getIncTOFCalibUnc(int a_targID)
Definition: STOFConfig.cpp:608
Definition: ConfigClasses.h:571