MaCh3  2.8.0
Reference Guide
Public Member Functions | Protected Attributes | List of all members
NuDockServerBase Class Reference

A class that implements a NuDock server for cross-fitter communication. More...

#include <NuDock/NuDockServerBase.h>

Inheritance diagram for NuDockServerBase:
[legend]
Collaboration diagram for NuDockServerBase:
[legend]

Public Member Functions

 NuDockServerBase (Manager *const fitMan)
 Construct the NuDock server. More...
 
virtual ~NuDockServerBase ()
 Destructor. More...
 
std::string GetName () const
 Return a human-readable identifier for this fitter. More...
 
void setup ()
 Perform one-time server setup. More...
 
virtual double getLogLikelihood ()
 Compute the total log-likelihood across all systematics and samples. More...
 
virtual nlohmann::json setParameters (const nlohmann::json &request)
 Handle a "set_parameters" request. More...
 
virtual nlohmann::json getParametersNames (const nlohmann::json &request)
 Handle a "get_parameter_names" request. More...
 
virtual nlohmann::json getParameters (const nlohmann::json &request)
 Handle a "get_parameters" request. More...
 
virtual nlohmann::json get2NLL (const nlohmann::json &request)
 Handle a "log_likelihood" request. More...
 
virtual nlohmann::json setAsimovPoint (const nlohmann::json &request)
 Handle a "set_asimov" request. More...
 
virtual nlohmann::json getMCSpectrum (const nlohmann::json &request)
 Handle a "get_mc_spectrum" request. More...
 
virtual nlohmann::json getDataSpectrum (const nlohmann::json &request)
 Handle a "get_data_spectrum" request. More...
 
void RunMCMC () override
 No-op implementation — the server does not run own MCMC. More...
 
- Public Member Functions inherited from FitterBase
 FitterBase (Manager *const fitMan)
 Constructor. More...
 
virtual ~FitterBase ()
 Destructor for the FitterBase class. More...
 
void AddSampleHandler (SampleHandlerInterface *sample)
 This function adds a sample PDF object to the analysis framework. The sample PDF object will be utilized in fitting procedures or likelihood scans. More...
 
void AddSystObj (ParameterHandlerBase *cov)
 This function adds a Covariance object to the analysis framework. The Covariance object will be utilized in fitting procedures or likelihood scans. More...
 
void DragRace (const int NLaps=100)
 Calculates the required time for each sample or covariance object in a drag race simulation. Inspired by Dan's feature. More...
 
void RunLLHScan ()
 Perform a 1D likelihood scan. More...
 
void RunLLHMap ()
 Perform a general multi-dimensional likelihood scan. More...
 
void GetStepScaleBasedOnLLHScan (const std::string &filename="")
 LLH scan is good first estimate of step scale. More...
 
void Run2DLLHScan ()
 Perform a 2D likelihood scan. More...
 
void RunSigmaVar ()
 Perform a 1D/2D sigma var for all samples. More...
 
virtual void StartFromPreviousFit (const std::string &FitName)
 Allow to start from previous fit/chain. More...
 
std::string GetName () const
 Get name of class. More...
 
virtual std::string GetFancyName () const
 This name is to get include some special algorithm extensions. More...
 

Protected Attributes

bool verbose
 Flag controlling verbose logging of server operations. More...
 
bool add_prior_llh
 If true, systematic prior likelihoods are added to the total LLH. More...
 
- Protected Attributes inherited from FitterBase
Manager * fitMan
 The manager for configuration handling. More...
 
unsigned int step
 current state More...
 
double logLCurr
 current likelihood More...
 
double logLProp
 proposed likelihood More...
 
double accProb
 current acceptance prob More...
 
int accCount
 counts accepted steps More...
 
unsigned int stepStart
 step start, by default 0 if we start from previous chain then it will be different More...
 
std::vector< double > sample_llh
 store the llh breakdowns More...
 
std::vector< double > syst_llh
 systematic llh breakdowns More...
 
std::vector< SampleHandlerInterface * > samples
 Sample holder. More...
 
unsigned int TotalNSamples
 Total number of samples used, single SampleHandler can store more than one analysis sample! More...
 
std::vector< ParameterHandlerBase * > systematics
 Systematic holder. More...
 
std::unique_ptr< TStopwatch > clock
 tells global time how long fit took More...
 
std::unique_ptr< TStopwatch > stepClock
 tells how long single step/fit iteration took More...
 
double stepTime
 Time of single step. More...
 
TFile * outputFile
 Output. More...
 
TDirectory * CovFolder
 Output cov folder. More...
 
TDirectory * SampleFolder
 Output sample folder. More...
 
TTree * outTree
 Output tree with posteriors. More...
 
int auto_save
 auto save every N steps More...
 
bool fTestLikelihood
 Necessary for some fitting algorithms like PSO. More...
 
bool FileSaved
 Checks if file saved not repeat some operations. More...
 
bool SettingsSaved
 Checks if setting saved not repeat some operations. More...
 
bool OutputPrepared
 Checks if output prepared not repeat some operations. More...
 
std::string AlgorithmName
 Name of fitting algorithm that is being used. More...
 

Additional Inherited Members

- Protected Member Functions inherited from FitterBase
void ProcessMCMC ()
 Process MCMC output. More...
 
void PrepareOutput ()
 Prepare the output file. More...
 
void SaveOutput ()
 Save output and close files. More...
 
void SanitiseInputs ()
 Remove obsolete memory and make other checks before fit starts. More...
 
void SaveSettings ()
 Save the settings that the MCMC was run with. More...
 
bool GetScanRange (std::map< std::string, std::vector< double >> &scanRanges) const
 YSP: Set up a mapping to store parameters with user-specified ranges, suggested by D. Barrow. More...
 
void GetParameterScanRange (const ParameterHandlerBase *cov, const int i, double &CentralValue, double &lower, double &upper, const int n_points, const std::string &suffix="") const
 Helper function to get parameter scan range, central value. More...
 
bool CheckSkipParameter (const std::vector< std::string > &SkipVector, const std::string &ParamName) const
 KS: Check whether we want to skip parameter using skip vector. More...
 
void CustomRange (const std::string &ParName, const double sigma, double &ParamShiftValue) const
 For comparison with other fitting frameworks (like P-Theta) we usually have to apply different parameter values then usual 1, 3 sigma. More...
 
std::vector< double > CalculateBinEdges (double lowerlimit, double upperlimit, int n_points) const
 

Detailed Description

A class that implements a NuDock server for cross-fitter communication.

NuDockServerBase acts as the server-side adapter in the NuDock protocol. It inherits from FitterBase and translates incoming JSON requests into operations on MaCh3 systematic & sample objects (set/get parameters, compute likelihoods, set Asimov data, retrieve predicted spectra, etc.).

Experiment-specific servers should derive from this class and override the virtual handlers where custom behaviour is needed.

Author
Hank Hua

Definition at line 25 of file NuDockServerBase.h.

Constructor & Destructor Documentation

◆ NuDockServerBase()

NuDockServerBase::NuDockServerBase ( Manager *const  fitMan)

Construct the NuDock server.

Construct the NuDock server.

Parameters
fitManPointer to the MaCh3 manager that owns fit configuration.
fitManPointer to the MaCh3 manager that owns fit configuration.

Definition at line 7 of file NuDockServerBase.cpp.

7  : FitterBase(man) {
8 }
FitterBase(Manager *const fitMan)
Constructor.
Definition: FitterBase.cpp:17

◆ ~NuDockServerBase()

NuDockServerBase::~NuDockServerBase ( )
virtual

Destructor.

Destructor.

Definition at line 13 of file NuDockServerBase.cpp.

13  {
14 }

Member Function Documentation

◆ get2NLL()

nlohmann::json NuDockServerBase::get2NLL ( const nlohmann::json &  request)
virtual

Handle a "log_likelihood" request.

Handle a "log_likelihood" request.

Returns twice the log-likelihood (2NLL) to match NuDock convention.

Parameters
requestJSON object (unused).
Returns
JSON response with a "log_likelihood" field containing 2*NLL.

Returns twice the log-likelihood (2NLL) to match NuDock convention.

Parameters
requestJSON object (unused).
Returns
JSON response with a "log_likelihood" field containing 2*NLL.

Definition at line 329 of file NuDockServerBase.cpp.

329  {
330  nlohmann::json response;
331  response["log_likelihood"] = 2*getLogLikelihood();
332  return response;
333 }
virtual double getLogLikelihood()
Compute the total log-likelihood across all systematics and samples.

◆ getDataSpectrum()

nlohmann::json NuDockServerBase::getDataSpectrum ( const nlohmann::json &  request)
virtual

Handle a "get_data_spectrum" request.

Handle a "get_data_spectrum" request.

Retrieves data bin contents and bin edges from every registered SampleHandlerFD sample, supporting 1-D and 2-D histograms.

Parameters
requestJSON object (unused).
Returns
JSON response containing sample names, dimensions, axis titles, bin edges, and bin values.
Exceptions
MaCh3Exceptionif a sample does not derive from SampleHandlerFD.

Retrieves data bin contents and bin edges from every registered SampleHandlerFD sample, supporting 1-D and 2-D histograms.

Parameters
requestJSON object (unused).
Returns
JSON response containing sample names, dimensions, axis titles, bin edges, and bin values.
Exceptions
MaCh3Exceptionif a sample does not derive from SampleHandlerFD.

Definition at line 244 of file NuDockServerBase.cpp.

244  {
245  nlohmann::json response;
246 
247  std::vector<std::string> sample_titles = {};
248 
249  for (size_t ipdf=0; ipdf<samples.size(); ipdf++) {
250  auto* base_casted_sample = dynamic_cast<SampleHandlerBase*>(samples[ipdf]);
251  if(!base_casted_sample) {
252  MACH3LOG_ERROR("Sample object does not derive from SampleHandlerBase. Consider overloading {} for this sample type.", __func__);
253  throw MaCh3Exception(__FILE__,__LINE__);
254  }
255  for (int iSample = 0; iSample < samples[ipdf]->GetNSamples(); ++iSample) {
256  std::string sample_title = samples[ipdf]->GetSampleTitle(iSample);
257  sample_titles.push_back(sample_title);
258 
259  int dimension = samples[ipdf]->GetNDim(iSample);
260  response["dimensions"][sample_title] = dimension;
261 
262  if (dimension == 1) {
263  TH1toResponse(samples[ipdf]->GetDataHist(iSample), sample_title, response);
264  } else if (dimension == 2) {
265  TH2toResponse(static_cast<const TH2*>(samples[ipdf]->GetDataHist(iSample)), sample_title, response);
266  } else {
267  MACH3LOG_ERROR("Not implemented for dim =", dimension);
268  throw MaCh3Exception(__FILE__,__LINE__);
269  }
270  }
271  }
272  response["sample_names"] = sample_titles;
273  return response;
274 }
#define MACH3LOG_ERROR
Definition: MaCh3Logger.h:37
void TH2toResponse(const TH2 *mc_hist, const std::string &sample_title, nlohmann::json &response)
void TH1toResponse(const TH1 *mc_hist, const std::string &sample_title, nlohmann::json &response)
std::vector< SampleHandlerInterface * > samples
Sample holder.
Definition: FitterBase.h:141
Custom exception class used throughout MaCh3.
Class responsible for handling implementation of samples used in analysis, reweighting and returning ...

◆ getLogLikelihood()

double NuDockServerBase::getLogLikelihood ( )
virtual

Compute the total log-likelihood across all systematics and samples.

Compute the total log-likelihood across all systematics and samples.

The systematic prior likelihoods are optionally included (controlled by add_prior_llh). Sample likelihoods are always summed.

Returns
The combined log-likelihood value.

The systematic prior likelihoods are optionally included (controlled by add_prior_llh). Sample likelihoods are always summed.

Returns
The combined log-likelihood value.

Definition at line 30 of file NuDockServerBase.cpp.

30  {
31  // HH: Based on MR2T2::ProposeStep()
32  // Initial likelihood
33  double llh = 0.0;
34 
35  if (add_prior_llh) {
36  // Loop over the systematics and propose the initial step
37  for (size_t s = 0; s < systematics.size(); ++s) {
38  // Get the likelihood from the systematics
39  syst_llh[s] = systematics[s]->GetLikelihood();
40  if (verbose) MACH3LOG_INFO("Syst {} llh: {}", systematics[s]->GetName(), syst_llh[s]);
41  llh += syst_llh[s];
42 
43  if (verbose) MACH3LOG_INFO("LLH after {} {}", systematics[s]->GetName(), llh);
44  }
45  }
46 
47  // DB for atmospheric event by event sample migration, need to fully reweight all samples to allow event passing prior to likelihood evaluation
48  for (size_t i = 0; i < samples.size(); ++i) {
49  // Get the sample likelihoods and add them
50  sample_llh[i] = samples[i]->GetLikelihood();
51  if (verbose) {
52  MACH3LOG_INFO("Total LLH in sample handler {}: {}", i, sample_llh[i]);
53  for (int iSample = 0; iSample < samples[i]->GetNSamples(); ++iSample) {
54  double sample_llh_ind = samples[i]->GetSampleLikelihood(iSample);
55  MACH3LOG_INFO(" Sample {} llh: {}", samples[i]->GetSampleTitle(iSample), sample_llh_ind);
56  }
57  }
58  llh += sample_llh[i];
59  if (verbose) MACH3LOG_INFO("LLH after sample {} {}", i, llh); }
60 
61  return llh;
62 }
#define MACH3LOG_INFO
Definition: MaCh3Logger.h:35
std::vector< double > sample_llh
store the llh breakdowns
Definition: FitterBase.h:136
std::vector< double > syst_llh
systematic llh breakdowns
Definition: FitterBase.h:138
std::vector< ParameterHandlerBase * > systematics
Systematic holder.
Definition: FitterBase.h:146
std::string GetName() const
Return a human-readable identifier for this fitter.
bool verbose
Flag controlling verbose logging of server operations.
bool add_prior_llh
If true, systematic prior likelihoods are added to the total LLH.

◆ getMCSpectrum()

nlohmann::json NuDockServerBase::getMCSpectrum ( const nlohmann::json &  request)
virtual

Handle a "get_mc_spectrum" request.

Handle a "get_mc_spectrum" request.

Retrieves predicted bin contents and bin edges from every registered SampleHandlerFD sample, supporting 1-D and 2-D histograms.

Parameters
requestJSON object (unused).
Returns
JSON response containing sample names, dimensions, axis titles, bin edges, and bin values.
Exceptions
MaCh3Exceptionif a sample does not derive from SampleHandlerFD.

Retrieves predicted bin contents and bin edges from every registered SampleHandlerFD sample, supporting 1-D and 2-D histograms.

Parameters
requestJSON object (unused).
Returns
JSON response containing sample names, dimensions, axis titles, bin edges, and bin values.
Exceptions
MaCh3Exceptionif a sample does not derive from SampleHandlerFD.

Definition at line 209 of file NuDockServerBase.cpp.

209  {
210  nlohmann::json response;
211 
212  std::vector<std::string> sample_titles = {};
213 
214  for (size_t ipdf=0; ipdf<samples.size(); ipdf++) {
215  auto* base_casted_sample = dynamic_cast<SampleHandlerBase*>(samples[ipdf]);
216  if(!base_casted_sample) {
217  MACH3LOG_ERROR("Sample object does not derive from SampleHandlerBase. Consider overloading {} for this sample type.", __func__);
218  throw MaCh3Exception(__FILE__,__LINE__);
219  }
220  for (int iSample = 0; iSample < samples[ipdf]->GetNSamples(); ++iSample) {
221  std::string sample_title = samples[ipdf]->GetSampleTitle(iSample);
222  sample_titles.push_back(sample_title);
223 
224  int dimension = samples[ipdf]->GetNDim(iSample);
225  response["dimensions"][sample_title] = dimension;
226 
227  if (dimension == 1) {
228  TH1toResponse(samples[ipdf]->GetMCHist(iSample), sample_title, response);
229  } else if (dimension == 2) {
230  TH2toResponse(static_cast<const TH2*>(samples[ipdf]->GetMCHist(iSample)), sample_title, response);
231  } else {
232  MACH3LOG_ERROR("Not implemented for dim =", dimension);
233  throw MaCh3Exception(__FILE__,__LINE__);
234  }
235  }
236  }
237  response["sample_names"] = sample_titles;
238  return response;
239 }

◆ GetName()

std::string NuDockServerBase::GetName ( ) const
inline

Return a human-readable identifier for this fitter.

Definition at line 35 of file NuDockServerBase.h.

35 {return "NuDockServer";};

◆ getParameters()

nlohmann::json NuDockServerBase::getParameters ( const nlohmann::json &  request)
virtual

Handle a "get_parameters" request.

Handle a "get_parameters" request.

Returns current values of oscillation and systematic parameters.

Parameters
requestJSON object (unused).
Returns
JSON response with "osc_pars" and "sys_pars" maps.

Returns current values of oscillation and systematic parameters.

Parameters
requestJSON object (unused).
Returns
JSON response with "osc_pars" and "sys_pars" maps.

Definition at line 300 of file NuDockServerBase.cpp.

300  {
301  std::map<std::string, double> osc_params;
302  std::map<std::string, double> syst_params;
303 
304  for (size_t s = 0; s < systematics.size(); ++s) {
305  int npars = systematics[s]->GetNumParams();
306  for (int p = 0; p < npars; ++p) {
307  std::string param_name = systematics[s]->GetParFancyName(p);
308  double param_value = systematics[s]->GetParProp(p);
309  if (NuDockOscNameMap_r.find(param_name) != NuDockOscNameMap_r.end()){
310  param_name = NuDockOscNameMap_r.at(param_name);
311  osc_params[param_name] = param_value;
312  } else {
313  if (!systematics[s]->IsParameterFixed(p)) {
314  syst_params[param_name] = param_value;
315  }
316  }
317  }
318  }
319  // Convert maps to json
320  nlohmann::json response;
321  response["sys_pars"] = syst_params;
322  response["osc_pars"] = osc_params;
323  return response;
324 }
const std::unordered_map< std::string, std::string > NuDockOscNameMap_r
Mapping from MaCh3 oscillation parameter names to NuDock names.

◆ getParametersNames()

nlohmann::json NuDockServerBase::getParametersNames ( const nlohmann::json &  request)
virtual

Handle a "get_parameter_names" request.

Handle a "get_parameter_names" request.

Returns the names of all unfixed, non-oscillation systematic parameters.

Parameters
requestJSON object (unused).
Returns
JSON response with a "sys_pars" array of parameter name strings.

Returns the names of all unfixed, non-oscillation systematic parameters.

Parameters
requestJSON object (unused).
Returns
JSON response with a "sys_pars" array of parameter name strings.

Definition at line 279 of file NuDockServerBase.cpp.

279  {
280  std::vector<std::string> syst_par_names;
281 
282  for (size_t s = 0; s < systematics.size(); ++s) {
283  int npars = systematics[s]->GetNumParams();
284  for (int p = 0; p < npars; ++p) {
285  std::string param_name = systematics[s]->GetParFancyName(p);
286  if (NuDockOscNameMap_r.find(param_name) != NuDockOscNameMap_r.end()) continue;
287  if (!systematics[s]->IsParameterFixed(p)) {
288  syst_par_names.push_back(param_name);
289  }
290  }
291  }
292  nlohmann::json response;
293  response["sys_pars"] = syst_par_names;
294  return response;
295 }

◆ RunMCMC()

void NuDockServerBase::RunMCMC ( )
inlineoverridevirtual

No-op implementation — the server does not run own MCMC.

Implements FitterBase.

Definition at line 118 of file NuDockServerBase.h.

118 {return; /* do nothing */};

◆ setAsimovPoint()

nlohmann::json NuDockServerBase::setAsimovPoint ( const nlohmann::json &  request)
virtual

Handle a "set_asimov" request.

Handle a "set_asimov" request.

Reweights all samples then clones the MC prediction as the "data". Prefit parameter central values are updated to match the current proposed values.

Parameters
requestJSON object (unused).
Returns
JSON response with a "status" field.

Reweights all samples then clones the MC prediction as the "data". Prefit parameter central values are updated to match the current proposed values.

Parameters
requestJSON object (unused).
Returns
JSON response with a "status" field.

Definition at line 119 of file NuDockServerBase.cpp.

119  {
120  // reweight sample and add to data
121  for (size_t ipdf=0; ipdf<samples.size(); ipdf++) {
122  samples[ipdf]->Reweight();
123  auto* base_casted_sample = dynamic_cast<SampleHandlerBase*>(samples[ipdf]);
124  if(!base_casted_sample) {
125  MACH3LOG_ERROR("Sample object does not derive from SampleHandlerBase. Consider overloading {} for this sample type.", __func__);
126  throw MaCh3Exception(__FILE__,__LINE__);
127  }
128  for (int iSample = 0; iSample < samples[ipdf]->GetNSamples(); ++iSample) {
129  base_casted_sample->AddData(iSample, base_casted_sample->GetMCArray(iSample));
130  }
131  }
132 
133  // set prefit parameter values to the current parameter values
134  for (size_t s = 0; s < systematics.size(); ++s) {
135  int npars = systematics[s]->GetNumParams();
136  for (int p = 0; p < npars; ++p) {
137  std::string param_name = systematics[s]->GetParFancyName(p);
138  double param_value = systematics[s]->GetParCurr(p);
139  systematics[s]->SetPar(p, param_value);
140  if (verbose) MACH3LOG_INFO("Setting prefit param {} to current value {}", param_name, param_value);
141  }
142  }
143 
144  nlohmann::json response;
145  response["status"] = "success";
146  return response;
147 }

◆ setParameters()

nlohmann::json NuDockServerBase::setParameters ( const nlohmann::json &  request)
virtual

Handle a "set_parameters" request.

Handle a "set_parameters" request.

Expects the JSON payload to contain "sys_pars" and "osc_pars" maps. Oscillation parameters are converted from NuDock convention to MaCh3 convention before being applied. Samples are reweighted after all parameters are updated.

Parameters
requestJSON object with "sys_pars" and "osc_pars" entries.
Returns
JSON response with a "status" field.

Expects the JSON payload to contain "sys_pars" and "osc_pars" maps. Oscillation parameters are converted from NuDock convention to MaCh3 convention before being applied. Samples are reweighted after all parameters are updated.

Parameters
requestJSON object with "sys_pars" and "osc_pars" entries.
Returns
JSON response with a "status" field.

Definition at line 67 of file NuDockServerBase.cpp.

67  {
68  if (verbose) {
69  MACH3LOG_INFO("Setting parameters from NuDock request: {}", request.dump());
70  }
71  std::map<std::string, double> syst_params = request["sys_pars"].get<std::map<std::string, double>>();
72  std::map<std::string, double> osc_params = request["osc_pars"].get<std::map<std::string, double>>();
73  // Loop over systematic objects
74  for (size_t s = 0; s < systematics.size(); ++s) {
75  int npars = systematics[s]->GetNumParams();
76  // Loop over each parameter in the systematics object
77  for (int p = 0; p < npars; ++p) {
78  std::string param_name = systematics[s]->GetParFancyName(p);
79  // Check if this is an oscillation parameter
80  if (NuDockOscNameMap_r.find(param_name) != NuDockOscNameMap_r.end()) {
81  std::string param_name_nudock = NuDockOscNameMap_r.at(param_name);
82  // Check if it exists in the request
83  if (osc_params.find(param_name_nudock) != osc_params.end()) {
84  double param_value = osc_params[param_name_nudock];
85  FormatOscParsForMaCh3(param_name_nudock, param_value);
86  systematics[s]->SetParCurrProp(p, param_value);
87  if (verbose) MACH3LOG_INFO("Setting osc param {} to value {}", param_name, param_value);
88  } else {
89  MACH3LOG_WARN("Oscillation parameter {} not found in request", param_name);
90  }
91  } else {
92  if (!systematics[s]->IsParameterFixed(p)) {
93  // Non-oscillation parameter
94  // Check if it exists in the request
95  if (syst_params.find(param_name) != syst_params.end()) {
96  double param_value = syst_params[param_name];
97  systematics[s]->SetParCurrProp(p, param_value);
98  if (verbose) MACH3LOG_INFO("Setting syst param {} to value {}", param_name, param_value);
99  } else {
100  MACH3LOG_WARN("Systematic parameter {} not found in request", param_name);
101  }
102  }
103  }
104  }
105  }
106  // HH: Reweights here is probably a better idea than getLikelihood, thanks to Jude
107  for (size_t i = 0; i < samples.size(); ++i) {
108  samples[i]->Reweight();
109  }
110 
111  nlohmann::json response;
112  response["status"] = "success";
113  return response;
114 }
#define MACH3LOG_WARN
Definition: MaCh3Logger.h:36
void FormatOscParsForMaCh3(const std::string &param_name, double &param_value)
Convert an oscillation parameter value from NuDock convention to MaCh3 convention.

◆ setup()

void NuDockServerBase::setup ( )

Perform one-time server setup.

Perform one-time server setup.

Resizes internal likelihood storage vectors and reads the "Verbose" and "AddPriorLLH" flags from the NuDock configuration block.

Resizes internal likelihood storage vectors and reads the "Verbose" and "AddPriorLLH" flags from the NuDock configuration block.

Definition at line 19 of file NuDockServerBase.cpp.

19  {
20  // Resize the likelihood storage vectors
21  syst_llh.resize(systematics.size(), M3::_BAD_DOUBLE_);
22  sample_llh.resize(samples.size(), M3::_BAD_DOUBLE_);
23  verbose = GetFromManager(fitMan->raw()["NuDock"]["Verbose"], false, __FILE__, __LINE__);
24  add_prior_llh = GetFromManager(fitMan->raw()["NuDock"]["AddPriorLLH"], false, __FILE__, __LINE__);
25 }
Type GetFromManager(const YAML::Node &node, const Type defval, const std::string &File, const int Line)
Get content of config file if node is not found take default value specified.
Definition: YamlHelper.h:328
Manager * fitMan
The manager for configuration handling.
Definition: FitterBase.h:120
YAML::Node const & raw() const
Return config.
Definition: Manager.h:48
constexpr static const double _BAD_DOUBLE_
Default value used for double initialisation.
Definition: Core.h:53

Member Data Documentation

◆ add_prior_llh

bool NuDockServerBase::add_prior_llh
protected

If true, systematic prior likelihoods are added to the total LLH.

Definition at line 124 of file NuDockServerBase.h.

◆ verbose

bool NuDockServerBase::verbose
protected

Flag controlling verbose logging of server operations.

Definition at line 122 of file NuDockServerBase.h.


The documentation for this class was generated from the following files: