MaCh3  2.5.1
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...
 

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
ManagerfitMan
 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...
 
std::unique_ptr< TRandom3 > random
 Random number. 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...
 

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:15

◆ ~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 334 of file NuDockServerBase.cpp.

334  {
335  (void)request;
336  nlohmann::json response;
337  response["log_likelihood"] = 2*getLogLikelihood();
338  return response;
339 }
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 246 of file NuDockServerBase.cpp.

246  {
247  (void)request;
248  nlohmann::json response;
249 
250  std::vector<std::string> sample_titles = {};
251 
252  for (size_t ipdf=0; ipdf<samples.size(); ipdf++) {
253  auto* base_casted_sample = dynamic_cast<SampleHandlerBase*>(samples[ipdf]);
254  if(!base_casted_sample) {
255  MACH3LOG_ERROR("Sample object does not derive from SampleHandlerBase. Consider overloading {} for this sample type.", __func__);
256  throw MaCh3Exception(__FILE__,__LINE__);
257  }
258  for (int iSample = 0; iSample < samples[ipdf]->GetNSamples(); ++iSample) {
259  std::string sample_title = samples[ipdf]->GetSampleTitle(iSample);
260  sample_titles.push_back(sample_title);
261 
262  int dimension = samples[ipdf]->GetNDim(iSample);
263  response["dimensions"][sample_title] = dimension;
264 
265  if (dimension == 1) {
266  TH1toResponse(samples[ipdf]->GetDataHist(iSample), sample_title, response);
267  } else if (dimension == 2) {
268  TH2toResponse(static_cast<const TH2*>(samples[ipdf]->GetDataHist(iSample)), sample_title, response);
269  } else {
270  MACH3LOG_ERROR("Not implemented for dim =", dimension);
271  throw MaCh3Exception(__FILE__,__LINE__);
272  }
273  }
274  }
275  response["sample_names"] = sample_titles;
276  return response;
277 }
#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:131
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:126
std::vector< double > syst_llh
systematic llh breakdowns
Definition: FitterBase.h:128
std::vector< ParameterHandlerBase * > systematics
Systematic holder.
Definition: FitterBase.h:136
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 210 of file NuDockServerBase.cpp.

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

◆ 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 304 of file NuDockServerBase.cpp.

304  {
305  std::map<std::string, double> osc_params;
306  std::map<std::string, double> syst_params;
307 
308  for (size_t s = 0; s < systematics.size(); ++s) {
309  int npars = systematics[s]->GetNumParams();
310  for (int p = 0; p < npars; ++p) {
311  std::string param_name = systematics[s]->GetParFancyName(p);
312  double param_value = systematics[s]->GetParProp(p);
313  if (NuDockOscNameMap_r.find(param_name) != NuDockOscNameMap_r.end()){
314  param_name = NuDockOscNameMap_r.at(param_name);
315  osc_params[param_name] = param_value;
316  } else {
317  if (!systematics[s]->IsParameterFixed(p)) {
318  syst_params[param_name] = param_value;
319  }
320  }
321  }
322  }
323  (void)request;
324  // Convert maps to json
325  nlohmann::json response;
326  response["sys_pars"] = syst_params;
327  response["osc_pars"] = osc_params;
328  return response;
329 }
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 282 of file NuDockServerBase.cpp.

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

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

◆ 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);
24  add_prior_llh = GetFromManager(fitMan->raw()["NuDock"]["AddPriorLLH"], false);
25 }
Type GetFromManager(const YAML::Node &node, const Type defval, const std::string File="", const int Line=1)
Get content of config file if node is not found take default value specified.
Definition: YamlHelper.h:329
Manager * fitMan
The manager for configuration handling.
Definition: FitterBase.h:110
YAML::Node const & raw() const
Return config.
Definition: Manager.h:47
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: