gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
SpecBit_VS.cpp
Go to the documentation of this file.
1 // GAMBIT: Global and Modular BSM Inference Tool
2 // *********************************************
35 
36 #include <string>
37 #include <sstream>
38 #include <sys/types.h>
39 #include <sys/stat.h>
40 
49 
50 #include "SLHAea/slhaea.h"
51 #include <gsl/gsl_math.h>
52 #include <gsl/gsl_min.h>
53 #ifdef WITH_MPI
54  #include "mpi.h"
55 #endif
56 
57 // Switch for debug mode
58 //#define SPECBIT_DEBUG
59 
60 namespace Gambit
61 {
62 
63  namespace SpecBit
64  {
65 
66  using namespace LogTags;
67  using namespace flexiblesusy;
68 
70  {
71  // check that the electroweak scale stability conditions are satisfied
73 
75 
76  double lambda_h = fullspectrum.get(Par::dimensionless,"lambda_h");
77  double lambda_s = fullspectrum.get(Par::dimensionless,"lambda_S");
78  double lambda_hs = fullspectrum.get(Par::dimensionless,"lambda_hS");
79  double mu3 = fullspectrum.get(Par::mass1,"mu3");
80  double ms = fullspectrum.get(Par::Pole_Mass,"S");
81 
82  double check = 0;
83 
84  if ( (lambda_h*lambda_s > 0 ) )
85  {
86  check = 2 * pow( lambda_h * lambda_s , 0.5) + lambda_hs;
87  }
88  double check_2 = 2.*pow(abs(lambda_s),0.5)*ms - mu3;
89 
90  result = 0;
91 
92  // if any condition not satisfied set bad likelihood and invalidate point
93  if ( lambda_hs < 0 || lambda_s < 0 || check < 0 || check_2 < 0)
94  {
95  invalid_point().raise("Electroweak vacuum is unstable at low scale.");
96  result = -1e100;
97  }
98  }
99 
100  bool check_perturb_to_min_lambda(const Spectrum& spec,double scale,int pts
101  ,const std::vector<SpectrumParameter> required_parameters)
102  {
103 
104  std::unique_ptr<SubSpectrum> subspec = spec.clone_HE();
105  double step = log10(scale) / pts;
106  double runto;
107 
108  double ul=3.5449077018110318; // sqrt(4*Pi)
109  for (int i=0;i<pts;i++)
110  {
111  runto = pow(10,step*float(i+1.0)); // scale to run spectrum to
112  if (runto<100){runto=200.0;}// avoid running to low scales
113 
114  try
115  {
116  subspec -> RunToScale(runto);
117  }
118  catch (const Error& error)
119  {
120  return false;
121  }
122 
123  for(std::vector<SpectrumParameter>::const_iterator it = required_parameters.begin();
124  it != required_parameters.end(); ++it)
125  {
126  const Par::Tags tag = it->tag();
127  const std::string name = it->name();
128  const std::vector<int> shape = it->shape();
129  std::ostringstream label;
130  label << name <<" "<< Par::toString.at(tag);
131  if(shape.size()==1 and shape[0]==1)
132  {
133  if (abs(subspec->get(tag,name))>ul)
134  {
135  return false;
136  }
137  }
138 
139  else if(shape.size()==1 and shape[0]>1)
140  {
141  for(int k = 1; k<=shape[0]; ++k) {
142  if (abs(subspec->get(tag,name,k))>ul)
143  {
144  return false;
145  }
146 
147  }
148  }
149  else if(shape.size()==2)
150  {
151  for(int k = 1; k<=shape[0]; ++k) {
152  for(int j = 1; j<=shape[0]; ++j) {
153  if (abs(subspec->get(tag,name,k,j))>ul)
154  {
155  return false;
156  }
157  }
158  }
159  }
160  }
161  }
162 
163  return true;
164  }
165 
166  double run_lambda(double scale , void *params)
167  {
168 
169  std::unique_ptr<SubSpectrum>* spec=(std::unique_ptr<SubSpectrum>* )params;
170  SubSpectrum& speccloned = **spec;
171 
172  // clone the original spectrum incase the running takes the spectrum
173  // into a non-perturbative scale and thus the spectrum is no longer reliable
174  std::unique_ptr<SubSpectrum> speccloned2 = speccloned.clone();
175 
176  if (scale>1.0e21){scale=1.0e21;}// avoid running to high scales
177 
178  if (scale<100.0){scale=100.0;}// avoid running to very low scales
179 
180  double lambda;
181  try
182  {
183  speccloned2->RunToScale(scale);
184  lambda = speccloned2->get(Par::dimensionless,"lambda_h");
185  }
186  catch (const Error& error)
187  {
188  // ERROR(error.what());
189  //cout << "error encountered" << endl;
190  lambda = 0;
191  // return EXIT_FAILURE;
192  }
193 
194  return lambda;
195  }
196 
197 
198  void find_min_lambda_Helper(dbl_dbl_bool& vs_tuple, const Spectrum& fullspectrum,
199  double high_energy_limit, int check_perturb_pts,
200  const std::vector<SpectrumParameter> required_parameters)
201  {
202  std::unique_ptr<SubSpectrum> speccloned = fullspectrum.clone_HE();
203 
204  // three scales at which we choose to run the quartic coupling up to, and then use a Lagrange interpolating polynomial
205  // to get an estimate for the location of the minimum, this is an efficient way to narrow down over a huge energy range
206  double u_1 = 1, u_2 = 5, u_3 = 12;
207  double lambda_1,lambda_2,lambda_3;
208  double lambda_min = 0;
209 
210 
211  bool min_exists = 1;// check if gradient is positive at electroweak scale
212  if ( run_lambda(101.0, &speccloned ) > run_lambda(100.0, &speccloned ) )
213  {
214  // gradient is positive, the minimum is less than electroweak scale so
215  // lambda_h must be monotonally increasing
216  min_exists = 0;
217  lambda_min = run_lambda(100.0,&speccloned);
218  }
219 
220  double mu_min = 0;
221  if (min_exists)
222  {
223 
224  // fit parabola (in log space) to the 3 trial points and use this to estimate the minimum
225 
226  for (int i=1;i<2;i++)
227  {
228 
229  lambda_1 = run_lambda(pow(10,u_1),&speccloned);
230  lambda_2 = run_lambda(pow(10,u_2),&speccloned);
231  lambda_3 = run_lambda(pow(10,u_3),&speccloned);
232 
233  double min_u= (lambda_1*(pow(u_2,2)-pow(u_3,2)) - lambda_2*(pow(u_1,2)-pow(u_3,2)) + lambda_3*(pow(u_1,2)-pow(u_2,2)));
234  double denominator = ( lambda_1*(u_2-u_3)+ lambda_2*(u_3-u_1) +lambda_3*(u_1-u_2));
235 
236  min_u=0.5*(min_u/denominator);
237  u_1=min_u-2/(pow(float(i),0.01));
238  u_2=min_u;
239  u_3=min_u+2/(pow(float(i),0.01));
240 
241  }
242 
243  // run downhill minimization routine to find exact minimum
244 
245  double mu_lower = pow(10,u_1);
246  double mu_upper = pow(10,u_3);
247  mu_min = pow(10,u_2);
248 
249  gsl_function F;
250  F.function = &run_lambda;
251  F.params = &speccloned;
252 
253  int status;
254  int iteration = 0, max_iteration = 1000;
255 
256  const gsl_min_fminimizer_type *T;
257  gsl_min_fminimizer *s;
258 
259  T = gsl_min_fminimizer_brent;
260  s = gsl_min_fminimizer_alloc (T);
261  gsl_min_fminimizer_set (s, &F, mu_min, mu_lower, mu_upper);
262 
263  do
264  {
265  iteration++;
266  status = gsl_min_fminimizer_iterate (s);
267 
268  mu_min = gsl_min_fminimizer_x_minimum (s);
269  mu_lower = gsl_min_fminimizer_x_lower (s);
270  mu_upper = gsl_min_fminimizer_x_upper (s);
271 
272  status = gsl_min_test_interval (mu_lower, mu_upper, 0.0001, 0.0001);
273  // cout << "mu_lower = " << mu_lower << " mu_upper = " << mu_upper << endl;
274  }
275  while (status == GSL_CONTINUE && iteration < max_iteration);
276 
277  if (iteration == max_iteration)
278  {
279  SpecBit_error().raise(LOCAL_INFO,"The minimum of the quartic coupling could not be found");
280  }
281 
282  gsl_min_fminimizer_free (s);
283 
284  lambda_min = run_lambda(mu_min,&speccloned);
285 
286  }
287 
288  #ifdef SPECBIT_DEBUG
289  std::cout<< "minimum value of quartic coupling is "<< lambda_min << " at " << mu_min <<" GeV"<<std::endl;
290  #endif
291 
292  double lifetime,LB;
293  if (lambda_min<0) // second minimum exists, now determine stability and lifetime
294  {
295  LB=mu_min;
296  #ifdef SPECBIT_DEBUG
297  double p=exp(4*140-26/(abs(0.5*lambda_min)))*pow(LB/(1.2e19),4); // compute tunnelling rate
298  if (p>1)
299  {
300  cout<< "vacuum is unstable" << endl;
301  }
302  else
303  {
304  cout<< "vacuum is metastable" << endl;
305  }
306  #endif
307  double pi2_8_over3 = 8.* pow ( pi , 2 ) / 3.;
308  double conversion = (6.5821195e-25)/(31536000);
309  // top factor is hbar in units of GeV.s and bottom factor is number of seconds in a year
310  lifetime=conversion/(exp(3*140-pi2_8_over3/(abs(0.5*lambda_min)))*pow(1/(1.2e19),3)*pow(LB,4));
311 
312  }
313  else // quartic coupling always positive, set output to default values
314  {
315  LB=high_energy_limit;
316  lifetime=1e300;
317  #ifdef SPECBIT_DEBUG
318  cout << "vacuum is absolutely stable" << endl;
319  #endif
320  // vacuum is stable
321  }
322  // now do a check on the perturbativity of the couplings up to this scale
323  bool perturbative=check_perturb_to_min_lambda(fullspectrum,LB,check_perturb_pts,required_parameters);
324  double perturb=float(!perturbative);
325  #ifdef SPECBIT_DEBUG
326  cout << "perturbativity checked up to " << LB << " result = " << perturbative << endl;
327  cout << "Higgs pole mass = " << fullspectrum.get(Par::Pole_Mass, "h0_1") << endl;
328  #endif
329  vs_tuple = dbl_dbl_bool(lifetime,LB,perturb);
330  }
331 
332 
334  {
336  double high_energy_limit = myPipe::runOptions->getValueOrDef<double>(1.22e19,"set_high_scale");
337  int check_perturb_pts = myPipe::runOptions->getValueOrDef<double>(10,"check_perturb_pts");
338  static const SpectrumContents::ScalarSingletDM_Z2 contents;
339  static const std::vector<SpectrumParameter> required_parameters = contents.all_parameters_with_tag(Par::dimensionless);
340  find_min_lambda_Helper(vs_tuple, *myPipe::Dep::ScalarSingletDM_Z2_spectrum, high_energy_limit, check_perturb_pts, required_parameters);
341  }
342 
344  {
346  double high_energy_limit = myPipe::runOptions->getValueOrDef<double>(1.22e19,"set_high_scale");
347  int check_perturb_pts = myPipe::runOptions->getValueOrDef<double>(10,"check_perturb_pts");
348  static const SpectrumContents::ScalarSingletDM_Z2 contents;
349  static const std::vector<SpectrumParameter> required_parameters = contents.all_parameters_with_tag(Par::dimensionless);
350  find_min_lambda_Helper(vs_tuple, *myPipe::Dep::ScalarSingletDM_Z3_spectrum, high_energy_limit, check_perturb_pts, required_parameters);
351  }
352 
354  {
355  namespace myPipe = Pipes::find_min_lambda_MDM;
356  double high_energy_limit = myPipe::runOptions->getValueOrDef<double>(1.22e19,"set_high_scale");
357  int check_perturb_pts = myPipe::runOptions->getValueOrDef<double>(10,"check_perturb_pts");
358  static const SpectrumContents::MDM contents;
359  static const std::vector<SpectrumParameter> required_parameters = contents.all_parameters_with_tag(Par::dimensionless);
360  find_min_lambda_Helper(vs_tuple, *myPipe::Dep::MDM_spectrum, high_energy_limit, check_perturb_pts, required_parameters);
361  }
362 
363 
364  // the functions below are used to extract the desired outputs from find_min_lambda
365 
366  // gives expected lifetime in units of years, if stable give extremly large number (1e300)
367  void get_expected_vacuum_lifetime(double &lifetime)
368  {
369  namespace myPipe = Pipes::get_expected_vacuum_lifetime;
370  dbl_dbl_bool vs_tuple = *myPipe::Dep::high_scale_vacuum_info;
371 
372  if (vs_tuple.first<1e300)
373  {
374  lifetime=vs_tuple.first;
375  }
376  else
377  {
378  lifetime=1e300;
379  }
380  }
381 
382  // log of the likelihood
384  {
386  dbl_dbl_bool vs_tuple = *myPipe::Dep::high_scale_vacuum_info;
387 
388  const Options& runOptions=*myPipe::runOptions;
389  bool demand_stable = runOptions.getValueOrDef<bool>(false,"demand_stable");
390  double stability_scale = runOptions.getValueOrDef<double>(1.22e19,"set_stability_scale");
391 
392  if (demand_stable && (vs_tuple.second < stability_scale))
393  {
394  result = -1e100;
395  }
396  else
397  {
398  double conversion = (6.5821195e-25)/(31536000);
399  result=((- ( 1 / ( vs_tuple.first/conversion ) ) * exp(140) * (1/ (1.2e19) ) ) );
400  }
401 
402  }
403 
404  // Get the scale of the high-scale minimum
405  void get_lambdaB(double &result)
406  {
407  namespace myPipe = Pipes::get_lambdaB;
408  dbl_dbl_bool vs_tuple = *myPipe::Dep::high_scale_vacuum_info;
409  result=vs_tuple.second;
410  }
411 
412 
413  // Returns poor likelihood and invalidates point if couplings go non-perturbative at or below the scale of the high-scale minimum of the potential
414  void check_perturb_min_lambda(double &result)
415  {
416  namespace myPipe = Pipes::check_perturb_min_lambda;
417  dbl_dbl_bool vs_tuple = *myPipe::Dep::high_scale_vacuum_info;
418 
419  if (vs_tuple.flag)
420  {
421  invalid_point().raise("Couplings are non-perturbative before scale of vacuum instability");
422  result = -1e100;
423  }
424  else
425  {
426  result = 0;
427  }
428  }
429 
430  /******************************************/
431  /* Vacuum stability likelihoods & results */
432  /******************************************/
433 
437  void get_likelihood_VS(double &result)
438  {
439  using namespace Pipes::get_likelihood_VS;
440 
441  // Compute all vacuum stability results
442  VevaciousResultContainer vevacious_results = *Dep::check_vacuum_stability;
443 
444  // Add the decay width for global and nearest vacua
445  double width = 0.0;
446  for(auto vacua : *Dep::compare_panic_vacua)
447  {
448  if (vacua.second != "JustThermal")
449  {
450  logger() << LogTags::debug << "Adding " << vevacious_results.get_width(vacua.first) << " to decay withd for " << vacua.second << " contribution" << EOM;
451  width += vevacious_results.get_width(vacua.first);
452  }
453  if (vacua.second != "JustQuantum")
454  {
455  logger() << LogTags::debug << "Adding " << vevacious_results.get_thermalWidth(vacua.first) << " to decay withd for " << vacua.second << " contribution" << EOM;
456  width += vevacious_results.get_thermalWidth(vacua.first);
457  }
458  }
459 
460  double lifetime = hbar/width;
461 
462  // This is based on the estimation of the past lightcone from 1806.11281
463  double conversion = (6.5821195e-25)/(31536000);
464  result= - 1 / ( lifetime/conversion ) * exp(140) * (1/1.2e19) ;
465  }
466 
469  {
470  using namespace Pipes::get_VS_results;
471 
472  VevaciousResultContainer vevacious_results = *Dep::check_vacuum_stability;
473  for(auto vacua : *Dep::compare_panic_vacua)
474  {
475  map_str_dbl tempmap;
476  if (vacua.first == "global")
477  tempmap = vevacious_results.get_global_results();
478  else if(vacua.first == "nearest")
479  tempmap = vevacious_results.get_nearest_results();
480  for(auto it = tempmap.begin(); it != tempmap.end(); ++it)
481  result[it->first + "::" + vacua.first] = it->second;
482  }
483  }
484 
485  /**********************/
486  /* VEVACIOUS ROUTINES */
487  /**********************/
488 
492  {
493  static bool firstrun = true;
494  int rank;
495 
496  // Here we make sure files are only written the first time this is run
497  if(firstrun)
498  {
499  std::string vevaciouslibpath = Backends::backendInfo().path_dir("vevacious", "1.0");
500 
501  std::string vevaciouspath = vevaciouslibpath + "/../";
502 
503  // Get MPI rank
504  #ifdef WITH_MPI
505  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
506  #else
507  rank = 0;
508  #endif
509 
510  //Creating string with rank number
511  std::string rankstring = std::to_string(rank);
512 
513  // Getting the run folder for saving initialization files
514  std::string inputspath = opts["inputspath"];
515 
516  // Declare some filenames before we make 'em.'
517  std::string initfilesPath = inputspath + "/InitializationFiles/mpirank_"+ rankstring + "/";
518  std::string modelfilesPath = inputspath + "/ModelFiles/mpirank_"+ rankstring + "/";
519  std::string potentialfunctioninitpath = initfilesPath + "/PotentialFunctionInitialization.xml";
520  std::string potentialminimizerinitpath = initfilesPath +"/PotentialMinimizerInitialization.xml";
521  std::string tunnelingcalculatorinitpath = initfilesPath +"/TunnelingCalculatorInitialization.xml";
522 
523 
524  // Creating folders for initialization files
525  try
526  {
527  Utils::ensure_path_exists(initfilesPath);
528  Utils::ensure_path_exists(modelfilesPath);
529  }
530  catch(const std::exception& e)
531  {
532  std::ostringstream errmsg;
533  errmsg << "Error creating vevacious initialization and model files folders for MPI process " << rankstring;
534  SpecBit_error().forced_throw(LOCAL_INFO,errmsg.str());
535  }
536 
537  // Copy model files.
538  try
539  {
540 
541  std::ifstream ScaleAndBlocksrc(opts.at("ScaleAndBlockFileSource") , std::ios::binary);
542  std::ofstream ScaleAndBlockdst(opts.at("ScaleAndBlockFile") , std::ios::binary);
543 
544  ScaleAndBlockdst << ScaleAndBlocksrc.rdbuf();
545 
546  std::ifstream ModelFilesrc(opts.at("ModelFileSource") , std::ios::binary);
547  std::ofstream ModelFiledst(opts.at("ModelFile") , std::ios::binary);
548 
549  ModelFiledst << ModelFilesrc.rdbuf();
550  }
551  catch(const std::exception& e)
552  {
553  std::ostringstream errmsg;
554  errmsg << "Error copying model and scale/block vevacious files. Check they exist." << rankstring;
555  SpecBit_error().forced_throw(LOCAL_INFO,errmsg.str());
556  }
557 
558  // Writing potential function initialization file
559  // File contents
560  std::string potentialfunctioninit =
561  "<VevaciousPlusPlusPotentialFunctionInitialization>\n"
562  " <LagrangianParameterManagerClass>\n"
563  " <ClassType>\n"
564  " SlhaCompatibleWithSarahManager\n"
565  " </ClassType>\n"
566  " <ConstructorArguments>\n"
567  " <ScaleAndBlockFile>\n"
568  " " + opts.at("ScaleAndBlockFile") + "\n"
569  " </ScaleAndBlockFile>\n"
570  " </ConstructorArguments>\n"
571  " </LagrangianParameterManagerClass>\n"
572  " <PotentialFunctionClass>\n"
573  " <ClassType>\n"
574  " " + opts.at("PotentialFunctionClassType") + "\n"
575  " </ClassType>\n"
576  " <ConstructorArguments>\n"
577  " <ModelFile>\n"
578  " " + opts.at("ModelFile") +
579  "\n"
580  " </ModelFile>\n"
581  " <AssumedPositiveOrNegativeTolerance>\n"
582  " 0.5\n"
583  " </AssumedPositiveOrNegativeTolerance>\n"
584  " </ConstructorArguments>\n"
585  " </PotentialFunctionClass>\n"
586  "</VevaciousPlusPlusPotentialFunctionInitialization>";
587  std::ofstream potentialfunctioninitwrite(potentialfunctioninitpath);
588  potentialfunctioninitwrite << potentialfunctioninit;
589  potentialfunctioninitwrite.close();
590 
591  std::string potentialminimizerinit;
592 
593  // Writing potential minimizer initialization file
594  // Check whether user wants hom4ps2 or PHC as homotopy continuation backend
595 
596  if(opts.at("homotopybackend") == "hom4ps")
597  {
598 
599  // Getting Path to hom4ps2
600 
601  std::string PathToHom4ps2 = Backends::backendInfo().path_dir("hom4ps", "2.0");
602 
603  // File contents
604  potentialminimizerinit =
605  "<VevaciousPlusPlusPotentialMinimizerInitialization>\n"
606  " <PotentialMinimizerClass>\n"
607  " <ClassType>\n"
608  " GradientFromStartingPoints\n"
609  " </ClassType>\n"
610  " <ConstructorArguments>\n"
611  " <StartingPointFinderClass>\n"
612  " <ClassType>\n"
613  " PolynomialAtFixedScalesSolver\n"
614  " </ClassType>\n"
615  " <ConstructorArguments>\n"
616  " <NumberOfScales>\n"
617  " 1\n"
618  " </NumberOfScales>\n"
619  " <ReturnOnlyPolynomialMinima>\n"
620  " No\n"
621  " </ReturnOnlyPolynomialMinima>\n"
622  " <PolynomialSystemSolver>\n"
623  " <ClassType>\n"
624  " Hom4ps2Runner\n"
625  " </ClassType>\n"
626  " <ConstructorArguments>\n"
627  " <PathToHom4ps2>\n"
628  " " + PathToHom4ps2 + "\n"
629  " </PathToHom4ps2>\n"
630  " <Hom4ps2Argument>\n"
631  " 1\n"
632  " </Hom4ps2Argument>\n"
633  " <ResolutionSize>\n"
634  " 1.0\n"
635  " </ResolutionSize>\n"
636  " </ConstructorArguments>\n"
637  " </PolynomialSystemSolver>\n"
638  " </ConstructorArguments>\n"
639  " </StartingPointFinderClass>\n"
640  " <GradientMinimizerClass>\n"
641  " <ClassType>\n"
642  " MinuitPotentialMinimizer\n"
643  " </ClassType>\n"
644  " <ConstructorArguments>\n"
645  " <InitialStepSizeFraction>\n"
646  " 0.1\n"
647  " </InitialStepSizeFraction>\n"
648  " <MinimumInitialStepSize>\n"
649  " 1.0\n"
650  " </MinimumInitialStepSize>\n"
651  " <MinuitStrategy>\n"
652  " "+ opts.at("MinuitStrategy") +"\n"
653  " </MinuitStrategy>\n"
654  " </ConstructorArguments>\n"
655  " </GradientMinimizerClass>\n"
656  " <ExtremumSeparationThresholdFraction>\n"
657  " 0.05\n"
658  " </ExtremumSeparationThresholdFraction>\n"
659  " <NonDsbRollingToDsbScalingFactor>\n"
660  " 4.0\n"
661  " </NonDsbRollingToDsbScalingFactor>\n"
662  " </ConstructorArguments>\n"
663  " </PotentialMinimizerClass>\n"
664  "</VevaciousPlusPlusObjectInitialization>\n";
665  }
666  else if(opts.at("homotopybackend") == "phc")
667  {
668  // Getting path to PHC
669  std::string PathToPHC = Backends::backendInfo().path_dir("phc", "2.4.58");
670  // Creating symlink to PHC in run folder
671  std::string PHCSymlink = inputspath + "Homotopy/mpirank_"+ rankstring + "/";
672 
673  // random seed for phc (can be fixed as input option)
674  std::string randomseed = opts["phc_random_seed"];
675 
676  try
677  {
678  Utils::ensure_path_exists(PHCSymlink);
679  }
680  catch(const std::exception& e)
681  {
682  std::ostringstream errmsg;
683  errmsg << "Error creating PHC folder for MPI process " << rankstring;
684  SpecBit_error().forced_throw(LOCAL_INFO,errmsg.str());
685  }
686 
687  // Here we check whether the symlink to phc already exists.
688  std::string filename(PHCSymlink + "/phc");
689  std::ifstream in(filename.c_str(), std::ios::binary);
690  if(in.good())
691  {
692  logger() << LogTags::debug << "Symlink for phc already exists, skipping creating it." << EOM;
693  }
694  else
695  {
696 
697  logger() << LogTags::debug << "Creating PHC symlink" << EOM;
698  std::string systemCommand( "ln -s " + PathToPHC + "/phc" + " " + PHCSymlink );
699 
700  int systemReturn = system( systemCommand.c_str() ) ;
701  if( systemReturn == -1 )
702  {
703  std::ostringstream errmsg;
704  errmsg << "Error making symlink for PHC in process " << rankstring;
705  SpecBit_error().forced_throw(LOCAL_INFO,errmsg.str());
706  }
707  }
708 
709  // File contents
710  potentialminimizerinit =
711  "<VevaciousPlusPlusPotentialMinimizerInitialization>\n"
712  " <PotentialMinimizerClass>\n"
713  " <ClassType>\n"
714  " GradientFromStartingPoints\n"
715  " </ClassType>\n"
716  " <ConstructorArguments>\n"
717  " <StartingPointFinderClass>\n"
718  " <ClassType>\n"
719  " PolynomialAtFixedScalesSolver\n"
720  " </ClassType>\n"
721  " <ConstructorArguments>\n"
722  " <NumberOfScales>\n"
723  " 1\n"
724  " </NumberOfScales>\n"
725  " <ReturnOnlyPolynomialMinima>\n"
726  " No\n"
727  " </ReturnOnlyPolynomialMinima>\n"
728  " <PolynomialSystemSolver>\n"
729  " <ClassType>\n"
730  " PHCRunner\n"
731  " </ClassType>\n"
732  " <ConstructorArguments>\n"
733  " <PathToPHC>\n"
734  " " + PHCSymlink + "\n"
735  " </PathToPHC>\n"
736  " <ResolutionSize>\n"
737  " 1.0\n"
738  " </ResolutionSize>\n"
739  " <RandomSeed>\n"
740  " " + randomseed + "\n"
741  " </Randomseed>\n"
742  " <Tasks>\n "
743  " 1 "
744  " </Tasks>\n "
745  " </ConstructorArguments>\n"
746  " </PolynomialSystemSolver>\n"
747  " </ConstructorArguments>\n"
748  " </StartingPointFinderClass>\n"
749  " <GradientMinimizerClass>\n"
750  " <ClassType>\n"
751  " MinuitPotentialMinimizer\n"
752  " </ClassType>\n"
753  " <ConstructorArguments>\n"
754  " <InitialStepSizeFraction>\n"
755  " 0\n"
756  " </InitialStepSizeFraction>\n"
757  " <MinimumInitialStepSize>\n"
758  " 0.5\n"
759  " </MinimumInitialStepSize>\n"
760  " <MinuitStrategy>\n"
761  " "+ opts.at("MinuitStrategy") +"\n"
762  " </MinuitStrategy>\n"
763  " </ConstructorArguments>\n"
764  " </GradientMinimizerClass>\n"
765  " <ExtremumSeparationThresholdFraction>\n"
766  " 0.1\n"
767  " </ExtremumSeparationThresholdFraction>\n"
768  " <NonDsbRollingToDsbScalingFactor>\n"
769  " 4.0\n"
770  " </NonDsbRollingToDsbScalingFactor>\n"
771  " </ConstructorArguments>\n"
772  " </PotentialMinimizerClass>\n"
773  "</VevaciousPlusPlusObjectInitialization>\n";
774  } else
775  {
776  std::ostringstream errmsg;
777  errmsg << "The homotopy_backend option in the YAML file has not been set up properly. Check the input YAML file." << std::endl;
778  SpecBit_error().raise(LOCAL_INFO,errmsg.str());
779  }
780 
781  std::ofstream potentialminimizerinitwrite(potentialminimizerinitpath);
782  potentialminimizerinitwrite << potentialminimizerinit;
783  potentialminimizerinitwrite.close();
784 
785  // Writing tunneling calculator initialization file
786  // File contents
787  std::string tunnelingcalculatorinit =
788  "<VevaciousPlusPlusObjectInitialization>\n"
789  " <TunnelingClass>\n"
790  " <ClassType>\n"
791  " BounceAlongPathWithThreshold\n"
792  " </ClassType>\n"
793  " <ConstructorArguments>\n"
794  " <TunnelingStrategy>\n"
795  " " + opts.at("TunnelingStrategy") + "\n"
796  " </TunnelingStrategy>\n"
797  " <SurvivalProbabilityThreshold>\n"
798  " " + opts.at("SurvivalProbabilityThreshold") + "\n"
799  " </SurvivalProbabilityThreshold>\n"
800  " <ThermalActionResolution>\n"
801  " 5\n"
802  " </ThermalActionResolution>\n"
803  " <CriticalTemperatureAccuracy>\n"
804  " 4\n"
805  " </CriticalTemperatureAccuracy>\n"
806  " <PathResolution>\n"
807  " " + opts.at("PathResolution") + "\n"
808  " </PathResolution>\n"
809  " <Timeout>\n"
810  " "+ opts.at("pathFindingTimeout") +"\n"
811  " </Timeout>\n"
812  " <MinimumVacuumSeparationFraction>\n"
813  " 0.2\n"
814  " </MinimumVacuumSeparationFraction>\n"
815  " <BouncePotentialFit>\n"
816  " <ClassType>\n"
817  " BubbleShootingOnPathInFieldSpace\n"
818  " </ClassType>\n"
819  " <ConstructorArguments>\n"
820  " <NumberShootAttemptsAllowed>\n"
821  " 32\n"
822  " </NumberShootAttemptsAllowed>\n"
823  " <RadialResolution>\n"
824  " "+ opts.at("radialResolution") +"\n"
825  " </RadialResolution>\n"
826  " </ConstructorArguments>\n"
827  " </BouncePotentialFit>\n"
828  " <TunnelPathFinders>\n"
829  " <PathFinder>\n"
830  " <ClassType>\n"
831  " MinuitOnPotentialOnParallelPlanes\n"
832  " </ClassType>\n"
833  " <ConstructorArguments>\n"
834  " <NumberOfPathSegments>\n"
835  " 50 \n"
836  " </NumberOfPathSegments>\n"
837  " <MinuitStrategy>\n"
838  " "+ opts.at("MinuitStrategy") +"\n"
839  " </MinuitStrategy>\n"
840  " <MinuitTolerance>\n"
841  " 1\n"
842  " </MinuitTolerance>\n"
843  " </ConstructorArguments>\n"
844  " </PathFinder>\n"
845  " <PathFinder>\n"
846  " <ClassType>\n"
847  " MinuitOnPotentialPerpendicularToPath\n"
848  " </ClassType>\n"
849  " <ConstructorArguments>\n"
850  " <NumberOfPathSegments>\n"
851  " 50\n"
852  " </NumberOfPathSegments>\n"
853  " <NumberOfAllowedWorsenings>\n"
854  " 3\n"
855  " </NumberOfAllowedWorsenings>\n"
856  " <ConvergenceThresholdFraction>\n"
857  " 0.5\n"
858  " </ConvergenceThresholdFraction>\n"
859  " <MinuitDampingFraction>\n"
860  " 0.75\n"
861  " </MinuitDampingFraction>\n"
862  " <NeighborDisplacementWeights>\n"
863  " 0.5\n"
864  " 0.25\n"
865  " </NeighborDisplacementWeights>\n"
866  " <MinuitStrategy>\n"
867  " "+ opts.at("MinuitStrategy") +"\n"
868  " </MinuitStrategy>\n"
869  " <MinuitTolerance>\n"
870  " 1\n"
871  " </MinuitTolerance>\n"
872  " </ConstructorArguments>\n"
873  " </PathFinder>\n"
874  " </TunnelPathFinders>\n"
875  " </ConstructorArguments>\n"
876  " </TunnelingClass>\n"
877  "</VevaciousPlusPlusObjectInitialization>";
878 
879  std::ofstream tunnelingcalculatorinitwrite(tunnelingcalculatorinitpath);
880  tunnelingcalculatorinitwrite << tunnelingcalculatorinit;
881  tunnelingcalculatorinitwrite.close();
882 
883  //Finally write the main input file for VevaciousPlusPlus
884 
885  std::string inputFilename =
886  inputspath + "/InitializationFiles/VevaciousPlusPlusObjectInitialization_mpirank_"+ rankstring +".xml";
887 
888  // File contents
889  std::string inputfile =
890  "<VevaciousPlusPlusObjectInitialization>\n"
891  " <PotentialFunctionInitializationFile>\n"
892  " " + potentialfunctioninitpath + "\n"
893  " </PotentialFunctionInitializationFile>\n"
894  " <PotentialMinimizerInitializationFile>\n"
895  " " + potentialminimizerinitpath + "\n"
896  " </PotentialMinimizerInitializationFile>\n"
897  " <TunnelingCalculatorInitializationFile>\n"
898  " " +
899  tunnelingcalculatorinitpath + "\n"
900  " </TunnelingCalculatorInitializationFile>\n"
901  "</VevaciousPlusPlusObjectInitialization>";
902  std::ofstream inputwrite(inputFilename);
903  inputwrite << inputfile;
904  inputwrite.close();
905  firstrun = false;
906  }
907 
908  }
909 
910 
916  void set_panic_vacua(std::set<std::string> & result)
917  {
918  using namespace Pipes::set_panic_vacua;
919 
920  static bool firstrun = true;
921 
922  if(firstrun)
923  {
924  // Get the list of likelihoods given in the YAML file as sub-capabilities.
925  std::vector<str> subcaps = Downstream::subcaps->getNames();
926 
927  // if no sub-capabilities are set, fix default behaviour: calculate tunneling to global and
928  // nearest minimum
929  std::set<std::string> default_choice = {"global","nearest"};
930 
931  // read in yaml options or ..
932  if(not subcaps.empty()) for (const auto& x : subcaps) {result.insert(x);}
933  // .. use default behaviour
934  else {result = default_choice;}
935 
936  // add info which contributions will be added up to logger
937  std::ostringstream ss;
938  ss << "The LogLike calculation 'VS_likelihood' will add up the contributions" << endl;
939  for (const auto& x : result) ss << "- "<< x << endl;
940  ss << "from the tunneling calculations. " << endl
941  << "You can change this in the ObsLikes section of your YAML file," << endl
942  << "by setting sub_capabilities 'VS_likelihood', e.g." << endl
943  << " sub_capabilities:" << endl
944  << " - nearest" << endl
945  << "to only calculate the tunneling probabilities to the nearest minimum." << endl;
946  logger() << LogTags::debug << ss.str() << EOM;
947 
948  // just need to set this once
949  firstrun = false;
950  }
951  }
952 
958  void set_tunnelling_strategy(std::set<std::string> &result)
959  {
960  using namespace Pipes::set_tunnelling_strategy;
961 
962  static bool firstrun = true;
963 
964  if(firstrun)
965  {
966  result.clear();
967 
968  // Get the tunnelling strategies given in the YAML file from the sub-capabilities.
969  YAML::Node subcaps = Downstream::subcaps->getNode();
970 
971  // Default behavious is to do both
972  std::set<std::string> default_choice = {"quantum","thermal"};
973 
974  // Iterate over sub-capabilites to extract the strategies
975  // If list is a sequence it will just take the default
976  if(subcaps.IsNull() or subcaps.IsSequence())
977  result = default_choice;
978  // If list is a map then it probably has options
979  if(subcaps.IsMap())
980  {
981  for(const auto& subcap : subcaps)
982  {
983  std::set<str> temp;
984  if (subcap.second.IsNull())
985  temp = default_choice;
986  else if(subcap.second.IsScalar())
987  temp.insert(subcap.second.as<str>());
988  else if(subcap.second.IsSequence())
989  for (size_t i=0; i<subcap.second.size();i++) temp.insert(subcap.second[i].as<str>());
990 
991  if (not result.empty() and temp != result)
992  {
993  std::ostringstream errmsg;
994  errmsg << "Different tunnelling processes selected for different vacua, please select the same for both ";
995  SpecBit_error().raise(LOCAL_INFO,errmsg.str());
996  }
997  result = temp;
998  }
999  }
1000  firstrun = false;
1001  }
1002  }
1003 
1009  str helper_set_tunnelingStrategy(std::set<std::string> tunnelling_strategy)
1010  {
1011 
1012  // quantum and thermal tunnelling
1013  if(tunnelling_strategy.size() == 2 and
1014  tunnelling_strategy.find("quantum") != tunnelling_strategy.end() and
1015  tunnelling_strategy.find("thermal") != tunnelling_strategy.end())
1016  {
1017  return "QuantumThenThermal";
1018  }
1019  // only thermal requested
1020  else if(tunnelling_strategy.size() == 1 and
1021  tunnelling_strategy.find("thermal") != tunnelling_strategy.end())
1022  {
1023  return "JustThermal";
1024  }
1025  // only quantum requested
1026  else if(tunnelling_strategy.size() == 1 and
1027  tunnelling_strategy.find("quantum") != tunnelling_strategy.end())
1028  {
1029  return "JustQuantum";
1030  }
1031  else
1032  {
1033  std::ostringstream errmsg;
1034  errmsg << "No valid tunnelling stragety selected. You must select a valid option via";
1035  errmsg << "the sub-capabilities of capability VS_likelihood in the following way";
1036  errmsg << " - capability: VS_likelihood\n";
1037  errmsg << " purpose: LogLike\n";
1038  errmsg << " sub_capabilities:\n";
1039  errmsg << " - global: [quantum, thermal]\n";
1040  errmsg << " - nearest: [quantum, thermal]" << std::endl;
1041  SpecBit_error().raise(LOCAL_INFO,errmsg.str());
1042  }
1043 
1044  return "";
1045  }
1046 
1049  void initialize_vevacious(std::string &inputspath)
1050  {
1051  using namespace Pipes::initialize_vevacious;
1052 
1053  static bool firstrun = true;
1054 
1055  if (firstrun)
1056  {
1057  // Create a map of opts to pass to the helper function
1058  map_str_str opts;
1059 
1060  // Generating a Random seed from Gambit random generator
1061  std::string randomseed_gen = std::to_string(int(Random::draw() * 2 * 1987.));
1062 
1063  opts["phc_random_seed"] = runOptions->getValueOrDef<std::string>(randomseed_gen, "phc_random_seed");
1064  opts["MinuitStrategy"] = runOptions->getValueOrDef<std::string>("0", "minuit_strategy");
1065  opts["PotentialFunctionClassType"] = runOptions->getValueOrDef<std::string>("FixedScaleOneLoopPotential", "potential_type");
1066  opts["homotopybackend"] = runOptions->getValueOrDef<std::string>("hom4ps", "homotopy_backend");
1067  opts["pathFindingTimeout"] = runOptions->getValueOrDef<std::string>("3600", "path_finding_timeout");
1068  opts["SurvivalProbabilityThreshold"] = runOptions->getValueOrDef<std::string>("0.01", "survival_probability_threshold");
1069  opts["radialResolution"] = runOptions->getValueOrDef<std::string>("0.1", "radial_resolution_undershoot_overshoot");
1070  opts["PathResolution"] = runOptions->getValueOrDef<std::string>("1000", "PathResolution");
1071 
1072  // Tunnelling strategy is given by the capability tunnelling_strategy that extracts the info from the subcaps
1073  opts["TunnelingStrategy"] = helper_set_tunnelingStrategy(*Dep::tunnelling_strategy);
1074 
1075  // Insert the file location info to the options map
1076  map_str_str file_locations = *Dep::vevacious_file_location;
1077  opts.insert(file_locations.begin(), file_locations.end());
1078 
1079  // Pass to the helper function and make some vevacious input.
1080  make_vpp_inputs(opts);
1081 
1082  inputspath = opts["inputspath"];
1083 
1084  firstrun = false;
1085  }
1086  // Done.
1087  }
1088 
1094  vevacious_1_0::VevaciousPlusPlus::VevaciousPlusPlus exec_pass_spectrum_to_vevacious(SpectrumEntriesForVevacious &pass_spectrum )
1095  {
1096 
1097  // get inputFilename and initialise vevaciousPlusPlus object with it
1098  static std::string inputFilename = pass_spectrum.get_inputFilename();
1099  vevacious_1_0::VevaciousPlusPlus::VevaciousPlusPlus vevaciousPlusPlus(inputFilename);
1100 
1101  // get scale and the map containing all spectrum entries that need to be passed to vevacious
1102  double scale = pass_spectrum.get_scale();
1103  map_str_SpectrumEntry spec_entry_map = pass_spectrum.get_spec_entry_map();
1104 
1105  // iterate through map and call vevacious' 'ReadLhaBlock' to read spectrum entries
1106  for (auto it=spec_entry_map.begin(); it!=spec_entry_map.end(); ++it)
1107  {
1108  SpectrumEntry entry = it->second;
1109  logger() << LogTags::debug << "Passing ReadLhaBlock option "<< entry.name << " scale " << scale << " parameters" << entry.parameters <<" and dimension " << entry.dimension << " to vevacious" << EOM;
1110  vevaciousPlusPlus.ReadLhaBlock(entry.name, scale , entry.parameters, entry.dimension );
1111  }
1112 
1113  return vevaciousPlusPlus;
1114  }
1115 
1118  void helper_run_vevacious(vevacious_1_0::VevaciousPlusPlus::VevaciousPlusPlus &vevaciousPlusPlus,VevaciousResultContainer& result, std::string panic_vacuum, std::string inputPath)
1119  {
1120 
1121  double lifetime, thermalProbability, thermalWidth;
1122 
1123  //Checking if file exists, fastest method.
1124  struct stat buffer;
1125  std::string HomotopyLockfile = inputPath + "/Homotopy/busy.lock";
1126  // Check if homotopy binary is being used
1127  //Here I check it the busy.lock file exists and if it does I go into a
1128  // while loop that either breaks when the file is deleted or after
1129  // 30 seconds have passed.
1130  // This deals with the problem of MARCONI not liking a binary accessed by too many
1131  // processes at the same time
1133 
1134  while(stat(HomotopyLockfile.c_str(), &buffer)==0)
1135  {
1137  std::chrono::seconds tSofar = std::chrono::duration_cast<std::chrono::seconds>(tNow - tStart);
1138  if(tSofar >= std::chrono::seconds(30) )
1139  {
1140  remove( HomotopyLockfile.c_str());
1141  break;
1142  }
1143  }
1144 
1145  // call vevacious and pass the setting for which vacuum is supposed
1146  // to be used for tunneling calculation as string
1147  vevaciousPlusPlus.RunPoint(panic_vacuum);
1148 
1149  // get vevacious results
1150  lifetime = vevaciousPlusPlus.GetLifetimeInSeconds();
1151  thermalProbability = vevaciousPlusPlus.GetThermalProbability();
1152  thermalWidth = vevaciousPlusPlus.GetThermalDecayWidth();
1153 
1154  // decide how to deal with different vevacious outcomes
1155  // here -1 from Vevacious means that the point is stable.
1156  if(lifetime == -1 && thermalProbability == -1 )
1157  {
1158  lifetime = 3.0E+100;
1159  thermalProbability = 1;
1160  }
1161  else if(lifetime == -1 && thermalProbability != -1)
1162  {
1163  lifetime = 3.0E+100;
1164  }
1165  else if(lifetime != -1 && thermalProbability == -1)
1166  {
1167  thermalProbability = 1;
1168  }
1169 
1170  // return a vector containing the results from vevacious, these are filled
1171  // in any successfully run case with the entries
1172  // BounceActionsThermal = ["Bounce Action Threshold", "straight path bounce action",
1173  // "best result from path_finder 1", "best result from path_finder 2",...]
1174  // Note that the entries "best result from path_finder x" are only filled if the
1175  // "straight path bounce action" (entry 1) is higher than the "bounce Action Threshold"
1176  // (entry 0). The vector length depends on how many different path finders are implemented in
1177  // vevacious
1178  std::vector<double> BounceActionsThermal_vec = vevaciousPlusPlus.GetThermalThresholdAndActions();
1179  std::vector<double> BounceActions_vec = vevaciousPlusPlus.GetThresholdAndActions();
1180 
1181  logger() << LogTags::debug << "Vevacious result size "<< BounceActions_vec.size();
1182  logger() << LogTags::debug << "\nVevacious thermal result size "<< BounceActionsThermal_vec.size();
1183 
1184  // set bounce actions values & the threshold if they were calculated
1185  for(std::size_t ii=0; ii<BounceActions_vec.size(); ++ii)
1186  {
1187  logger() << LogTags::debug << "\nSetting bounceActionThreshold_[" << ii << "]"<< BounceActions_vec.at(ii);
1188  result.set_results(panic_vacuum, "bounceActionThreshold_[" + std::to_string(ii) + "]", BounceActions_vec.at(ii));
1189  }
1190 
1191  // set thermal bounce actions values & the threshold if they were calculated
1192  for(std::size_t ii=0; ii<BounceActionsThermal_vec.size(); ++ii)
1193  {
1194  logger() << LogTags::debug << "\nSetting bounceActionThresholdThermal_[" << ii << "]"<< BounceActionsThermal_vec.at(ii);
1195  result.set_results(panic_vacuum, "bounceActionThresholdThermal_[" + std::to_string(ii) + "]", BounceActionsThermal_vec.at(ii));
1196  }
1197 
1198  // add entry 'straightPathGoodEnough' to result map
1199  // -> -1 if no bounce actions calculated
1200  // -> 1 if threshold > straightPath
1201  // -> 0 else
1202  // Note that this has to be done after the bounceActionThreshold results are set
1203  result.add_straightPathGoodEnough(panic_vacuum);
1204 
1205  // set lifetime & thermal probability
1206  result.set_results(panic_vacuum,"lifetime", lifetime);
1207  result.set_results(panic_vacuum,"width", hbar/lifetime);
1208  result.set_results(panic_vacuum,"thermalwidth", thermalWidth);
1209  result.set_results(panic_vacuum,"thermalProbability", thermalProbability);
1210  }
1211 
1212 
1215  void helper_catch_vevacious(VevaciousResultContainer& result, std::string panic_vacuum)
1216  {
1217 
1218  //Vevacious has crashed -- set results to fixed values
1219  double lifetime = 2.0E+100;
1220  double thermalWidth = 0.;
1221  double thermalProbability= 1;
1222 
1223  logger() << LogTags::debug << "Vevacious could not calculate lifetime. Conservatively setting it to large value."<<EOM;
1224 
1225  result.set_results(panic_vacuum,"lifetime", lifetime);
1226  result.set_results(panic_vacuum,"width", hbar/lifetime);
1227  result.set_results(panic_vacuum,"thermalwidth", thermalWidth);
1228  result.set_results(panic_vacuum,"thermalProbability", thermalProbability);
1229 
1230  }
1231 
1236  {
1237  using namespace Pipes::compare_panic_vacua;
1238 
1239  // get the object that holds all inputs that needs to be passed to vevacious
1240  SpectrumEntriesForVevacious pass_spectrum = (*Dep::pass_spectrum_to_vevacious);
1241  // create vev object to check if global and near panic vacuum are the same
1242  vevacious_1_0::VevaciousPlusPlus::VevaciousPlusPlus vevaciousPlusPlus = exec_pass_spectrum_to_vevacious(pass_spectrum);
1243 
1244  // get set with contributions to likelihood that should be calculated
1245  std::set<std::string> panic_vacua = *Dep::panic_vacua;
1246 
1247  // Check if global and nearest are requested, if so test if the happen to be
1248  // the same minimum for this point in parameters space.
1249  // If that is the case, remove the global points from the
1250  if( panic_vacua.find("global") != panic_vacua.end() and panic_vacua.find("nearest") != panic_vacua.end() )
1251  {
1252  // get vector pair with VEVs of global and nearest vacua
1253  std::pair<std::vector<double>,std::vector<double>> vevs = vevaciousPlusPlus.RunVacua("internal");
1254  std::vector<double> global = vevs.first;
1255  std::vector<double> nearest = vevs.second;
1256 
1257  // check if vectors are equal
1258  bool compare = std::equal(global.begin(), global.end(), nearest.begin());
1259 
1260  // if the minima are the same, remove global entries if the corresponding nearest
1261  // entry is contained
1262  if(compare)
1263  {
1264  if (panic_vacua.find("global") != panic_vacua.end() and panic_vacua.find("nearest") != panic_vacua.end())
1265  {
1266  panic_vacua.erase("global");
1267  }
1268  // add info to logger
1269  std::ostringstream ss;
1270  ss << "Global and nearest minimum are the same. Will only calculate tunnelling" << endl;
1271  ss << "probability once." << endl;
1272  logger() << LogTags::debug << ss.str() << EOM;
1273  }
1274  else
1275  {
1276  // add info to debug logger
1277  std::ostringstream ss;
1278  ss << "Global and nearest minimum are not the same. Will calculate tunnelling" << endl;
1279  ss << "probability to both." << endl;
1280  logger() << LogTags::debug << ss.str() << EOM;
1281  }
1282 
1283  }
1284 
1285  // Fill result map and set tunnelling strategy for the minima
1286  for (auto &panic_vacuum: panic_vacua)
1287  result[panic_vacuum] = helper_set_tunnelingStrategy(*Dep::tunnelling_strategy);
1288 
1289  }
1290 
1291 
1294  {
1296 
1297  // get a str-str map with valculations vevacious has to execute for this parameter point
1298  // note: this has to be executed for each point as it can happen that the nearest and the
1299  // global panic vaccum are the same.
1300  map_str_str panic_vacua = *Dep::compare_panic_vacua;
1301 
1302  // This is the number of different pathFinders implemented in vevacious. It should be
1303  // returned by a BE convenience function, I tried to do it but didn't manage to
1304  // with the BOSS stuff -- that should probably be fixed # todo
1305  static int pathFinder_number = 2;
1306 
1307  // get the object that holds all inputs that needs to be passed to vevacious
1308  SpectrumEntriesForVevacious pass_spectrum = (*Dep::pass_spectrum_to_vevacious);
1309 
1310  // run vevacious for different panic vacua, respecting the choices for thermal
1311  // or only quantum tunnelling calculations
1312  for(auto x : panic_vacua)
1313  {
1314  // set panic vacuum and tunnelling strategy for vevacious run
1315  std::string panic_vacuum = x.first;
1316  std::string tunnellingStrategy = x.second;
1317 
1318  // reset all entries of the of VevaciousResultContainer map holding the results
1319  // to avoid that any value could be carried over from a previous calculated point
1320  result.clear_results(panic_vacuum, pathFinder_number);
1321  try
1322  {
1323  // create vevaciousPlusPlus object new for every try since spectrum
1324  // vevacious deletes spectrum after each run => to be able to do this
1325  // we need the non-rollcalled helper function that gets executed every time
1326  // we get to this line (unlike a dependency)
1327  vevacious_1_0::VevaciousPlusPlus::VevaciousPlusPlus vevaciousPlusPlus = exec_pass_spectrum_to_vevacious(pass_spectrum);
1328 
1329  // helper function to set lifetime & thermal probability accordingly
1330  // (this is a separate function s.t. we don't have to reproduce code
1331  // for different panic vacua)
1332  helper_run_vevacious(vevaciousPlusPlus, result, panic_vacuum, pass_spectrum.get_inputPath());
1333  }
1334  catch(const std::exception& e)
1335  {
1336  // call function that sets the lifetime & thermal probability if vevacious
1337  // has crashed for some reason
1338  helper_catch_vevacious(result, panic_vacuum);
1339  logger() << LogTags::debug << "Error occurred: " << e.what() << EOM;
1340  }
1341  }
1342  }
1343 
1344  /********/
1345  /* MSSM */
1346  /********/
1347 
1350  {
1351  namespace myPipe = Pipes::vevacious_file_location_MSSM;
1352  const Options& runOptions = *myPipe::runOptions;
1353 
1354  int rank;
1355 
1356  // Get mpi rank
1357  #ifdef WITH_MPI
1358  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
1359  #else
1360  rank = 0;
1361  #endif
1362 
1363  //Creating string with rank number
1364  std::string rankstring = std::to_string(rank);
1365 
1366  // Get the path to the library and results dir
1367  std::string vevaciouslibpath = Backends::backendInfo().path_dir("vevacious", "1.0");
1368  std::string vevaciouspath = vevaciouslibpath + "/../";
1369  std::string vevaciousresultspath = vevaciouspath + "/results";
1370 
1371  // Getting the run folder for saving initialization files
1372  std::string inputspath = runOptions.getValueOrDef<std::string>(vevaciousresultspath,"where_to_save_input");
1373  result["inputspath"] = inputspath;
1374  std::string modelfilesPath = inputspath + "/ModelFiles/mpirank_"+ rankstring + "/";
1375 
1376  result["ScaleAndBlockFileSource"] = vevaciouspath + "ModelFiles/LagrangianParameters/MSSM.xml";
1377  result["ModelFileSource"] = vevaciouspath + "ModelFiles/PotentialFunctions/MSSM_StauAndStop_RealVevs.vin";
1378  result["ScaleAndBlockFile"] = modelfilesPath + "ScaleAndBlockFile.xml";
1379  result["ModelFile"] = modelfilesPath + "ModelFile.vin";
1380  }
1381 
1387  {
1389 
1390  static std::string inputspath = *myPipe::Dep::init_vevacious;
1391 
1392  // print input parameters for vevaciouswith full precision to be able to reproduce
1393  // vevacious run with the exact same parameters
1394  std::ostringstream InputsForLog;
1395  InputsForLog << std::fixed << std::setprecision(12) << "Passing parameters to Vevacious with values: ";
1396 
1397  for (auto it=myPipe::Param.begin(); it != myPipe::Param.end(); it++)
1398  {
1399  std::string name = it->first;
1400  double value = *myPipe::Param[name];
1401  InputsForLog << "\n " << name << ": " << value;
1402  }
1403  std::string InputsForLogString = InputsForLog.str();
1404  logger() << LogTags::debug << InputsForLogString << EOM;
1405 
1406  // Getting mpi rank
1407  int rank;
1408  #ifdef WITH_MPI
1409  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
1410  #else
1411  rank = 0;
1412  #endif
1413 
1414  std::string rankstring = std::to_string(rank);
1415 
1416  std::string inputFilename = inputspath + "/InitializationFiles/VevaciousPlusPlusObjectInitialization_mpirank_"+ rankstring +".xml";
1417 
1418  result.set_inputFilename(inputFilename);
1419  result.set_inputPath(inputspath);
1420 
1421  // Get the spectrum object for the MSSM
1422  const Spectrum& fullspectrum = *myPipe::Dep::MSSM_spectrum;
1423  const SubSpectrum& spectrumHE = fullspectrum.get_HE();
1424 
1425  // Get the SLHAea::Coll object & scale from the spectrum
1426  SLHAea::Coll slhaea = spectrumHE.getSLHAea(2);
1427  double scale = spectrumHE.GetScale();
1428 
1429  result.set_scale(scale);
1430 
1431  // safe parameters form the SLHAea::Coll object in SpectrumEntriesForVevacious
1432  // by calling the method .add_entry => pass name, vector with <int,double> pairs
1433  // and the third setting (some int, don't know what it does @Sanjay? )
1434  std::vector<std::pair<int,double>> gaugecouplings = { { 1 , SLHAea::to<double>(slhaea.at("GAUGE").at(1).at(1)) },
1435  { 2, SLHAea::to<double>(slhaea.at("GAUGE").at(2).at(1)) },
1436  { 3, SLHAea::to<double>(slhaea.at("GAUGE").at(3).at(1)) }};
1437  result.add_entry("GAUGE", gaugecouplings, 1);
1438 
1439  std::vector<std::pair<int,double>> Hmix = { { 1 , SLHAea::to<double>(slhaea.at("HMIX").at(1).at(1))},
1440  { 101, SLHAea::to<double>(slhaea.at("HMIX").at(101).at(1))},
1441  { 102, SLHAea::to<double>(slhaea.at("HMIX").at(102).at(1))},
1442  { 103, SLHAea::to<double>(slhaea.at("HMIX").at(103).at(1))},
1443  { 3, SLHAea::to<double>(slhaea.at("HMIX").at(3).at(1))}};
1444  result.add_entry("HMIX", Hmix, 1);
1445 
1446 
1447  std::vector<std::pair<int,double>> minpar = {{ 3, SLHAea::to<double>(slhaea.at("MINPAR").at(3).at(1))}};
1448  result.add_entry("MINPAR", minpar, 1);
1449 
1450  std::vector<std::pair<int,double>> msoft = { { 21 , SLHAea::to<double>(slhaea.at("MSOFT").at(21).at(1))},
1451  { 22 , SLHAea::to<double>(slhaea.at("MSOFT").at(22).at(1))},
1452  { 1 , SLHAea::to<double>(slhaea.at("MSOFT").at(1).at(1))},
1453  { 2 , SLHAea::to<double>(slhaea.at("MSOFT").at(2).at(1))},
1454  { 3 , SLHAea::to<double>(slhaea.at("MSOFT").at(3).at(1))}};
1455  result.add_entry("MSOFT", msoft, 1);
1456 
1457  // Check if the block "TREEMSOFT" is present
1458  try
1459  {
1460  std::vector<std::pair<int, double>> treemsoft = {{21, SLHAea::to<double>(slhaea.at("TREEMSOFT").at(21).at(1))},
1461  {22, SLHAea::to<double>(slhaea.at("TREEMSOFT").at(22).at(1))} };
1462  result.add_entry("TREEMSOFT", treemsoft, 1);
1463  }
1464  catch (const std::exception& e){ logger() << LogTags::debug << "No TREEMSOFT, skipping" << EOM;}
1465 
1466  // Check if the block "LOOPMSOFT" is present
1467  try
1468  {
1469  std::vector<std::pair<int, double>> loopmsoft = {{21, SLHAea::to<double>(slhaea.at("LOOPMSOFT").at(21).at(1))},
1470  {22, SLHAea::to<double>(slhaea.at("LOOPMSOFT").at(22).at(1))}};
1471  result.add_entry("LOOPMSOFT", loopmsoft, 1);
1472  }
1473  catch (const std::exception& e) {logger() << LogTags::debug <<"No LOOPMSOFT, skipping" << EOM;}
1474 
1475  bool diagonalYukawas = false;
1476  // Here we check if the Yukawas are diagonal or not, i.e if the "YX" blocks have off-diagonal entries.
1477  try
1478  {
1479  SLHAea::to<double>(slhaea.at("YU").at(1,2));
1480  }
1481  catch (const std::exception& e) {diagonalYukawas = true; logger() << LogTags::debug << "Diagonal Yukawas detected"<< EOM;}
1482 
1483  // If diagonal pass the diagonal values to Vevacious
1484  if (diagonalYukawas)
1485  {
1486  std::vector<std::pair<int,double>> Yu = { { 11 , SLHAea::to<double>(slhaea.at("YU").at(1,1).at(2))},
1487  { 12, 0},
1488  { 13, 0},
1489  { 21, 0},
1490  { 22, SLHAea::to<double>(slhaea.at("YU").at(2,2).at(2))},
1491  { 23, 0},
1492  { 31, 0},
1493  { 32, 0},
1494  { 33, SLHAea::to<double>(slhaea.at("YU").at(3,3).at(2))}};
1495  result.add_entry("YU", Yu, 2);
1496 
1497  std::vector<std::pair<int,double>> Yd = { { 11 , SLHAea::to<double>(slhaea.at("YD").at(1,1).at(2))},
1498  { 12, 0},
1499  { 13, 0},
1500  { 21, 0},
1501  { 22, SLHAea::to<double>(slhaea.at("YD").at(2,2).at(2))},
1502  { 23, 0},
1503  { 31, 0},
1504  { 32, 0},
1505  { 33, SLHAea::to<double>(slhaea.at("YD").at(3,3).at(2))}};
1506  result.add_entry("YD", Yd, 2);
1507 
1508  std::vector<std::pair<int,double>> Ye = { { 11 , SLHAea::to<double>(slhaea.at("YE").at(1,1).at(2))},
1509  { 12, 0},
1510  { 13, 0},
1511  { 21, 0},
1512  { 22, SLHAea::to<double>(slhaea.at("YE").at(2,2).at(2))},
1513  { 23, 0},
1514  { 31, 0},
1515  { 32, 0},
1516  { 33, SLHAea::to<double>(slhaea.at("YE").at(3,3).at(2))}};
1517  result.add_entry("YE", Ye, 2);
1518  }
1519  // If NOT diagonal pass values to Vevacious
1520  else
1521  {
1522  std::vector<std::pair<int, double>> Yu = {{11, SLHAea::to<double>(slhaea.at("YU").at(1, 1).at(2))},
1523  {12, SLHAea::to<double>(slhaea.at("YU").at(1, 2).at(2))},
1524  {13, SLHAea::to<double>(slhaea.at("YU").at(1, 3).at(2))},
1525  {21, SLHAea::to<double>(slhaea.at("YU").at(2, 1).at(2))},
1526  {22, SLHAea::to<double>(slhaea.at("YU").at(2, 2).at(2))},
1527  {23, SLHAea::to<double>(slhaea.at("YU").at(2, 3).at(2))},
1528  {31, SLHAea::to<double>(slhaea.at("YU").at(3, 1).at(2))},
1529  {32, SLHAea::to<double>(slhaea.at("YU").at(3, 2).at(2))},
1530  {33, SLHAea::to<double>(slhaea.at("YU").at(3, 3).at(2))}};
1531  result.add_entry("YU", Yu, 2);
1532 
1533  std::vector<std::pair<int, double>> Yd = {{11, SLHAea::to<double>(slhaea.at("YD").at(1, 1).at(2))},
1534  {12, SLHAea::to<double>(slhaea.at("YD").at(1, 2).at(2))},
1535  {13, SLHAea::to<double>(slhaea.at("YD").at(1, 3).at(2))},
1536  {21, SLHAea::to<double>(slhaea.at("YD").at(2, 1).at(2))},
1537  {22, SLHAea::to<double>(slhaea.at("YD").at(2, 2).at(2))},
1538  {23, SLHAea::to<double>(slhaea.at("YD").at(2, 3).at(2))},
1539  {31, SLHAea::to<double>(slhaea.at("YD").at(3, 1).at(2))},
1540  {32, SLHAea::to<double>(slhaea.at("YD").at(3, 2).at(2))},
1541  {33, SLHAea::to<double>(slhaea.at("YD").at(3, 3).at(2))}};
1542  result.add_entry("YD", Yd, 2);
1543 
1544  std::vector<std::pair<int, double>> Ye = {{11, SLHAea::to<double>(slhaea.at("YE").at(1, 1).at(2))},
1545  {12, SLHAea::to<double>(slhaea.at("YE").at(1, 2).at(2))},
1546  {13, SLHAea::to<double>(slhaea.at("YE").at(1, 3).at(2))},
1547  {21, SLHAea::to<double>(slhaea.at("YE").at(2, 1).at(2))},
1548  {22, SLHAea::to<double>(slhaea.at("YE").at(2, 2).at(2))},
1549  {23, SLHAea::to<double>(slhaea.at("YE").at(2, 3).at(2))},
1550  {31, SLHAea::to<double>(slhaea.at("YE").at(3, 1).at(2))},
1551  {32, SLHAea::to<double>(slhaea.at("YE").at(3, 2).at(2))},
1552  {33, SLHAea::to<double>(slhaea.at("YE").at(3, 3).at(2))}};
1553  result.add_entry("YE", Ye, 2);
1554  }
1555  std::vector<std::pair<int, double>> Tu = {{11, SLHAea::to<double>(slhaea.at("TU").at(1, 1).at(2))},
1556  {12, SLHAea::to<double>(slhaea.at("TU").at(1, 2).at(2))},
1557  {13, SLHAea::to<double>(slhaea.at("TU").at(1, 3).at(2))},
1558  {21, SLHAea::to<double>(slhaea.at("TU").at(2, 1).at(2))},
1559  {22, SLHAea::to<double>(slhaea.at("TU").at(2, 2).at(2))},
1560  {23, SLHAea::to<double>(slhaea.at("TU").at(2, 3).at(2))},
1561  {31, SLHAea::to<double>(slhaea.at("TU").at(3, 1).at(2))},
1562  {32, SLHAea::to<double>(slhaea.at("TU").at(3, 2).at(2))},
1563  {33, SLHAea::to<double>(slhaea.at("TU").at(3, 3).at(2))}};
1564  result.add_entry("TU", Tu, 2);
1565 
1566  std::vector<std::pair<int,double>> Td = { { 11 , SLHAea::to<double>(slhaea.at("TD").at(1,1).at(2))},
1567  { 12, SLHAea::to<double>(slhaea.at("TD").at(1,2).at(2))},
1568  { 13, SLHAea::to<double>(slhaea.at("TD").at(1,3).at(2))},
1569  { 21, SLHAea::to<double>(slhaea.at("TD").at(2,1).at(2))},
1570  { 22, SLHAea::to<double>(slhaea.at("TD").at(2,2).at(2))},
1571  { 23, SLHAea::to<double>(slhaea.at("TD").at(2,3).at(2))},
1572  { 31, SLHAea::to<double>(slhaea.at("TD").at(3,1).at(2))},
1573  { 32, SLHAea::to<double>(slhaea.at("TD").at(3,2).at(2))},
1574  { 33, SLHAea::to<double>(slhaea.at("TD").at(3,3).at(2))}};
1575  result.add_entry("TD", Td, 2);
1576 
1577  std::vector<std::pair<int,double>> Te = { { 11 , SLHAea::to<double>(slhaea.at("TE").at(1,1).at(2))},
1578  { 12, SLHAea::to<double>(slhaea.at("TE").at(1,2).at(2))},
1579  { 13, SLHAea::to<double>(slhaea.at("TE").at(1,3).at(2))},
1580  { 21, SLHAea::to<double>(slhaea.at("TE").at(2,1).at(2))},
1581  { 22, SLHAea::to<double>(slhaea.at("TE").at(2,2).at(2))},
1582  { 23, SLHAea::to<double>(slhaea.at("TE").at(2,3).at(2))},
1583  { 31, SLHAea::to<double>(slhaea.at("TE").at(3,1).at(2))},
1584  { 32, SLHAea::to<double>(slhaea.at("TE").at(3,2).at(2))},
1585  { 33, SLHAea::to<double>(slhaea.at("TE").at(3,3).at(2))}};
1586  result.add_entry("TE", Te, 2);
1587 
1588 
1589  std::vector<std::pair<int,double>> msq2 = { { 11 , SLHAea::to<double>(slhaea.at("MSQ2").at(1,1).at(2))},
1590  { 12, SLHAea::to<double>(slhaea.at("MSQ2").at(1,2).at(2))},
1591  { 13, SLHAea::to<double>(slhaea.at("MSQ2").at(1,3).at(2))},
1592  { 21, SLHAea::to<double>(slhaea.at("MSQ2").at(2,1).at(2))},
1593  { 22, SLHAea::to<double>(slhaea.at("MSQ2").at(2,2).at(2))},
1594  { 23, SLHAea::to<double>(slhaea.at("MSQ2").at(2,3).at(2))},
1595  { 31, SLHAea::to<double>(slhaea.at("MSQ2").at(3,1).at(2))},
1596  { 32, SLHAea::to<double>(slhaea.at("MSQ2").at(3,2).at(2))},
1597  { 33, SLHAea::to<double>(slhaea.at("MSQ2").at(3,3).at(2))}};
1598  result.add_entry("MSQ2", msq2, 2);
1599 
1600  std::vector<std::pair<int,double>> msl2 = { { 11 , SLHAea::to<double>(slhaea.at("MSL2").at(1,1).at(2))},
1601  { 12, SLHAea::to<double>(slhaea.at("MSL2").at(1,2).at(2))},
1602  { 13, SLHAea::to<double>(slhaea.at("MSL2").at(1,3).at(2))},
1603  { 21, SLHAea::to<double>(slhaea.at("MSL2").at(2,1).at(2))},
1604  { 22, SLHAea::to<double>(slhaea.at("MSL2").at(2,2).at(2))},
1605  { 23, SLHAea::to<double>(slhaea.at("MSL2").at(2,3).at(2))},
1606  { 31, SLHAea::to<double>(slhaea.at("MSL2").at(3,1).at(2))},
1607  { 32, SLHAea::to<double>(slhaea.at("MSL2").at(3,2).at(2))},
1608  { 33, SLHAea::to<double>(slhaea.at("MSL2").at(3,3).at(2))}};
1609  result.add_entry("MSL2", msl2, 2);
1610 
1611  std::vector<std::pair<int,double>> msd2 = { { 11 , SLHAea::to<double>(slhaea.at("MSD2").at(1,1).at(2))},
1612  { 12, SLHAea::to<double>(slhaea.at("MSD2").at(1,2).at(2))},
1613  { 13, SLHAea::to<double>(slhaea.at("MSD2").at(1,3).at(2))},
1614  { 21, SLHAea::to<double>(slhaea.at("MSD2").at(2,1).at(2))},
1615  { 22, SLHAea::to<double>(slhaea.at("MSD2").at(2,2).at(2))},
1616  { 23, SLHAea::to<double>(slhaea.at("MSD2").at(2,3).at(2))},
1617  { 31, SLHAea::to<double>(slhaea.at("MSD2").at(3,1).at(2))},
1618  { 32, SLHAea::to<double>(slhaea.at("MSD2").at(3,2).at(2))},
1619  { 33, SLHAea::to<double>(slhaea.at("MSD2").at(3,3).at(2))}};
1620  result.add_entry("MSD2", msd2, 2);
1621 
1622  std::vector<std::pair<int,double>> mse2 = { { 11 , SLHAea::to<double>(slhaea.at("MSE2").at(1,1).at(2))},
1623  { 12, SLHAea::to<double>(slhaea.at("MSE2").at(1,2).at(2))},
1624  { 13, SLHAea::to<double>(slhaea.at("MSE2").at(1,3).at(2))},
1625  { 21, SLHAea::to<double>(slhaea.at("MSE2").at(2,1).at(2))},
1626  { 22, SLHAea::to<double>(slhaea.at("MSE2").at(2,2).at(2))},
1627  { 23, SLHAea::to<double>(slhaea.at("MSE2").at(2,3).at(2))},
1628  { 31, SLHAea::to<double>(slhaea.at("MSE2").at(3,1).at(2))},
1629  { 32, SLHAea::to<double>(slhaea.at("MSE2").at(3,2).at(2))},
1630  { 33, SLHAea::to<double>(slhaea.at("MSE2").at(3,3).at(2))}};
1631  result.add_entry("MSE2", mse2, 2);
1632 
1633  std::vector<std::pair<int,double>> msu2 = { { 11 , SLHAea::to<double>(slhaea.at("MSU2").at(1,1).at(2))},
1634  { 12, SLHAea::to<double>(slhaea.at("MSU2").at(1,2).at(2))},
1635  { 13, SLHAea::to<double>(slhaea.at("MSU2").at(1,3).at(2))},
1636  { 21, SLHAea::to<double>(slhaea.at("MSU2").at(2,1).at(2))},
1637  { 22, SLHAea::to<double>(slhaea.at("MSU2").at(2,2).at(2))},
1638  { 23, SLHAea::to<double>(slhaea.at("MSU2").at(2,3).at(2))},
1639  { 31, SLHAea::to<double>(slhaea.at("MSU2").at(3,1).at(2))},
1640  { 32, SLHAea::to<double>(slhaea.at("MSU2").at(3,2).at(2))},
1641  { 33, SLHAea::to<double>(slhaea.at("MSU2").at(3,3).at(2))}};
1642  result.add_entry("MSU2", msu2, 2);
1643  }
1644  } // end namespace SpecBit
1645 } // end namespace Gambit
double get(const Par::Tags partype, const std::string &mass) const
Definition: spectrum.cpp:249
Define overloadings of the stream operator for various containers.
void set_tunnelling_strategy(std::set< std::string > &result)
Create a string set containing a list of the tunnelling strategies that vevacious should use...
Definition: SpecBit_VS.cpp:958
This class is used to deliver both information defined in the Standard Model (or potentially just QED...
Rollcall header for module SpecBit.
General small utility macros.
virtual std::unique_ptr< SubSpectrum > clone() const =0
Clone the SubSpectrum object.
Declarations of convenience (i.e.
std::string name
void clear_results(const str panic_vaccum, int pathFinder_number)
delete all entries of the vevacious results map and set lifetime, probability and all entries of boun...
bool check_perturb_to_min_lambda(const Spectrum &spec, double scale, int pts, const std::vector< SpectrumParameter > required_parameters)
Definition: SpecBit_VS.cpp:100
std::chrono::time_point< std::chrono::system_clock > time_point
Definition: logging.hpp:46
#define LOCAL_INFO
Definition: local_info.hpp:34
virtual double GetScale() const
Returns the renormalisation scale of parameters.
Type definition header for module SpecBit.
void find_min_lambda_ScalarSingletDM_Z3(dbl_dbl_bool &vs_tuple)
Definition: SpecBit_VS.cpp:343
void find_min_lambda_Helper(dbl_dbl_bool &vs_tuple, const Spectrum &fullspectrum, double high_energy_limit, int check_perturb_pts, const std::vector< SpectrumParameter > required_parameters)
Definition: SpecBit_VS.cpp:198
void helper_run_vevacious(vevacious_1_0::VevaciousPlusPlus::VevaciousPlusPlus &vevaciousPlusPlus, VevaciousResultContainer &result, std::string panic_vacuum, std::string inputPath)
Call vevacious, the result is either "Stable", "Metastable" or "Inconclusive" in case a vevacious run...
std::chrono::milliseconds ms
Spectrum Spectrum Spectrum Spectrum Spectrum Spectrum Spectrum ScalarSingletDM_Z3_spectrum
virtual SLHAstruct getSLHAea(int) const
Get spectrum information in SLHAea format (if possible)
Definition: subspectrum.cpp:56
const double hbar
void get_lambdaB(double &result)
Definition: SpecBit_VS.cpp:405
GAMBIT error class.
Definition: exceptions.hpp:136
void make_vpp_inputs(map_str_str &opts)
Helper function that takes any YAML options and makes the vevacious input, in the form of ...
Definition: SpecBit_VS.cpp:491
static double draw()
Draw a single uniform random deviate from the interval (0,1) using the chosen RNG engine...
void get_likelihood_VS(double &result)
Vacuum stability likelihood from a Vevacious run calculating the lifetime of & tunneling probability ...
Definition: SpecBit_VS.cpp:437
std::map< std::string, SpectrumEntry > map_str_SpectrumEntry
map mapping the name of a spectrum entry to the SpectrumEntry type.
virtual void raise(const std::string &)
Raise the exception, i.e. throw it. Exact override of base method.
Definition: exceptions.cpp:422
const double pi
void prepare_pass_MSSM_spectrum_to_vevacious(SpectrumEntriesForVevacious &result)
This function adds all entries of the spectrum object (as SLHAea) that need to be passed to vevacious...
void check_perturb_min_lambda(double &result)
Definition: SpecBit_VS.cpp:414
void helper_catch_vevacious(VevaciousResultContainer &result, std::string panic_vacuum)
Decide how to deal with a failed vevacious run –> set lifetime and thermalProbability conservatively...
const Logging::endofmessage EOM
Explicit const instance of the end of message struct in Gambit namespace.
Definition: logger.hpp:100
vec_pair_int_dbl parameters
std::vector< SpectrumParameter > all_parameters_with_tag(Par::Tags tag) const
Function to retreive all parameters matching a certain tag.
Header file that includes all GAMBIT headers required for a module source file.
EXPORT_SYMBOLS Logging::LogMaster & logger()
Function to retrieve a reference to the Gambit global log object.
Definition: logger.cpp:95
vevacious_1_0::VevaciousPlusPlus::VevaciousPlusPlus exec_pass_spectrum_to_vevacious(SpectrumEntriesForVevacious &pass_spectrum)
Execute the passing of the spectrum object (as SLHAea) to vevacious.
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
std::unique_ptr< SubSpectrum > clone_HE() const
Definition: spectrum.cpp:235
EXPORT_SYMBOLS const str & ensure_path_exists(const str &)
Ensure that a path exists (and then return the path, for chaining purposes)
void add_entry(std::string name, vec_pair_int_dbl vec, int dimension)
add a SpectrumEntry type to the &#39;spec_entry_map&#39; map.
TYPE getValueOrDef(TYPE def, const args &... keys) const
double lambda(double x, double y, double z)
Definition: MSSM_H.hpp:38
Virtual base class for interacting with spectrum generator output.
Definition: subspectrum.hpp:87
This class is used to wrap the QedQcd object used by SoftSUSY and FlexibleSUSY in a Gambit SubSpectru...
void find_min_lambda_ScalarSingletDM_Z2(dbl_dbl_bool &vs_tuple)
Definition: SpecBit_VS.cpp:333
void find_min_lambda_MDM(dbl_dbl_bool &vs_tuple)
Definition: SpecBit_VS.cpp:353
std::map< std::string, std::string > map_str_str
Shorthand for a string-to-string map.
Definition: util_types.hpp:78
void set_panic_vacua(std::set< std::string > &result)
Create a string set containing a list with all likelihoods that vevacious should calculate.
Definition: SpecBit_VS.cpp:916
int dimension
double pow(const double &a)
Outputs a^i.
void check_vacuum_stability_vevacious(VevaciousResultContainer &result)
Check stability of global vacuum of the potential with vevacious.
void vevacious_file_location_MSSM(map_str_str &result)
Tell GAMBIT which files to work with for the MSSM.
str helper_set_tunnelingStrategy(std::set< std::string > tunnelling_strategy)
Set tunnelling strategy for the different minima, either.
void set_results(str panic_vaccum, str name, double val)
add entries to vevacious result map
invalid_point_exception & invalid_point()
Invalid point exceptions.
std::map< std::string, double > map_str_dbl
Shorthand for a string-to-double map.
double run_lambda(double scale, void *params)
Definition: SpecBit_VS.cpp:166
void check_EW_stability_ScalarSingletDM_Z3(double &result)
Definition: SpecBit_VS.cpp:69
void compare_panic_vacua(map_str_str &result)
If tunnelling to global and nearest vacuum are requested, this capability compares if the two vacua a...
void get_VS_results(map_str_dbl &result)
get all results from VS as str to dbl map to easily print them
Definition: SpecBit_VS.cpp:468
TODO: see if we can use this one:
Definition: Analysis.hpp:33
A small wrapper object for &#39;options&#39; nodes.
void add_straightPathGoodEnough(str panic_vacuum)
add information to vevacious result map whether the action of drawing a straight path between the phy...
SubSpectrum & get_HE()
Definition: spectrum.cpp:225
"Standard Model" (low-energy) plus high-energy model container class
Definition: spectrum.hpp:110
void get_expected_vacuum_lifetime(double &lifetime)
Definition: SpecBit_VS.cpp:367
class for setting & storing all spectrum entries of type SpectrumEntry that need to be passed to veva...
void lnL_highscale_vacuum_decay_single_field(double &result)
Definition: SpecBit_VS.cpp:383
time_point get_clock_now()
Get clock time.
void initialize_vevacious(std::string &inputspath)
Parses the YAML file for any settings, then passes to make_vpp_inputs to create .xml files for vevaci...