Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit 6d5069ed authored by Plaszczynski Stephane's avatar Plaszczynski Stephane
Browse files

add names to engines

parent 74c4f0fc
......@@ -120,6 +120,7 @@ public:
//get value at l ( 2<l<lmax): in units = (micro-K)^2
//don't call if FAILURE returned previously
//throws std::execption if pb
virtual std::string name() const {return "CLASS";}
double getCl(Engine::cltype t,const long &l);
void getCls(const std::vector<unsigned>& lVec, //input
......@@ -44,6 +44,9 @@ public:
//conistent with the MnUserVariables
bool updateParValues(const std::vector<double>& minuitPars);
virtual std::string name() const {return "Minuit-CLASS";}
//then read with this one
inline void getCls(const std::vector<unsigned>& lVec, //input
std::vector<double>& cltt,
......@@ -87,6 +90,8 @@ public:
double rs_rec() const {return klass->rs_rec();}
double com_distance(double z) {return klass->com_distance(z);}
virtual double get_Pklin(double k, double z) { return klass->get_Pklin(k,z);}
virtual double get_PkNL(double k, double z) { return klass->get_PkNL(k,z);}
void writeCls(std::ostream &o) {klass->writeCls(o);}
......@@ -124,6 +124,6 @@ Engine::get(const std::string& key)
Engine::undef(const char* param) const{
throw Message_error(string("derived par=")+param+" cannot be computed");
throw Message_error(name()+": Engine: cannot compute "+param);
return -1.;
......@@ -42,7 +42,8 @@ public:
virtual bool has_Pklin() const {return false;}
virtual bool has_PkNL() const {return false;}
virtual std::string name() const=0;
// units = (micro-K)^2
virtual void getCls(const std::vector<unsigned>& lVec, //input
std::vector<double>& cltt,
......@@ -59,15 +59,29 @@ int main(int argc,char** argv){
classparms.add("z_max_pk",z0); //polar +lens+clphi
//increase kmax if higher value requested
const double kmax = parser.params.find<double>("k_end",1);
for (size_t i=0;i<classparms.size();i++)
for (size_t i=0;i<classparms.size();i++) {
if (classparms.key(i)=="P_k_max_1/Mpc"){
double val;
if ( val < kmax) {
cout << "Warning: requested k_end=" <<kmax<< " while P_k_max_1/Mpc=" << classparms.value(i) << " increasing parameter" <<endl;
classparms.updateVal(i, dataToString(kmax));
cout << "CLASS \t--> "<< classparms.key(i) << "\t" << classparms.value(i) <<endl;
//precision file
string pre="";
if (parser.params.param_present("precisionFile")){
cout << "CLASS \t--> precision parameters taken from file=" << pre << endl;
e=new MnClassEngine(parser.vars(),
......@@ -186,7 +200,7 @@ int main(int argc,char** argv){
std::vector<fitscolumn> pkcols;
pkcols.push_back(fitscolumn("k", "1/Mpc",1,TDOUBLE));
pkcols.push_back(fitscolumn("Pklin", "(1/Mpc)^-3" ,1,TDOUBLE));
pkcols.push_back(fitscolumn("Pknl", "(1/Mpc)^-3",1,TDOUBLE));
if (do_nl) pkcols.push_back(fitscolumn("Pknl", "(1/Mpc)^-3",1,TDOUBLE));
// def values
......@@ -213,7 +227,6 @@ int main(int argc,char** argv){
const int npks = parser.params.find<int>("n_pks",1000);
const double kmin = parser.params.find<double>("k_beg",8.e-4);
const double kmax = parser.params.find<double>("k_end",1);
logspace(kmin,kmax,npks,kval) ;
......@@ -40,6 +40,8 @@ public:
// destructor
virtual std::string name() const {return "MnPico";}
bool has_CMB_Cl() const {return true;}
bool has_CMB_ClPol() const {return true;}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment