#include #include #include "Jeep/JPrint.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" #include "JOscProb/JOscParameters.hh" /** * \file * Auxiliary program to test JOscParameters. * * \author bjung */ int main(int argc, char **argv) { using namespace std; using namespace JPP; typedef JGrid JGrid_t; typedef JOscParameters JOscParametersGrid_t; JOscParameters parameters; JOscParameters parametersGrid; int debug; try { JParser<> zap; zap['@'] = make_field(parameters) = JOscParameters (false); zap['#'] = make_field(parametersGrid) = JOscParameters(false); zap['d'] = make_field(debug) = 3; zap(argc, argv); } catch (const exception& error) { FATAL(error.what() << endl); } // Test parameters NOTICE("User-defined parameters:\n" << parameters); ASSERT(getSize(parameters) > 0); JOscParameters parameters1("theta12", 0.584, "deltaCP", 1.544, "dM21sq", 7.42e-5); NOTICE("parameters1:\n" << parameters1); ASSERT(parameters1.is_valid() && getSize(parameters1) == 3); parameters1.set("theta23", 0.5); NOTICE("parameters1.theta23 = 0.5 -> parameters1:\n" << parameters1); ASSERT(parameters1.is_valid() && getSize(parameters1) == 4); // Test parameter grids NOTICE("User-defined parameters grid:\n" << parametersGrid); ASSERT(getSize(parametersGrid) > 0); const JGrid_t grid1 = make_grid(5, 0.6, 0.7); const JGrid_t grid2 = make_grid(6, 1.5, 1.6); const JGrid_t grid3 = make_grid(7, 7.4e-5, 7.5e-5); const JGrid_t grid4 = make_grid(3, 0.6, 0.8); JOscParametersGrid_t parametersGrid1("theta12", grid1, "deltaCP", grid2, "dM21sq", grid3); NOTICE("parametersGrid1:\n" << parametersGrid1); ASSERT(parametersGrid1.is_valid() && (int) getSize(parametersGrid1) == grid1.getSize() * grid2.getSize() * grid3.getSize()); parametersGrid1.set("theta23", grid4); NOTICE("parametersGrid1.theta23 = make_grid(3, 0.6, 0.8) -> parametersGrid1:\n" << parametersGrid1); ASSERT(parametersGrid1.is_valid() && (int) getSize(parametersGrid1) == grid1.getSize() * grid2.getSize() * grid3.getSize() * grid4.getSize()); }