Commit 2f0c5a08 authored by Plaszczynski Stephane's avatar Plaszczynski Stephane
Browse files

-clik files (clikfile1 now OK) can be defined wrt to /par

- planck_data mechanism in setup. See example in par/cobesix
-better tretament of derived params for pico (tau OK)
parent e4a21881
......@@ -50,7 +50,7 @@ class sBBN\ file bbn/sBBN.dat
precisionFile=hpjul2.pre
#plikTT
clikfile=/sps/hep/cobesix/software/gcc/camel/plc_2.0/hi_l/plik/plik_dx11dr2_HM_v18_TT.clik
clikfile=planck_data/hi_l/plik/plik_dx11dr2_HM_v18_TT.clik
#bflike
clikfile2=/sps/hep/cobesix/software/gcc/camel/plc_2.0/low_l/bflike/lowl_SMW_70_dx11d_2014_10_03_v5c_Ap.clik
clikfile2=planck_data/low_l/bflike/lowl_SMW_70_dx11d_2014_10_03_v5c_Ap.clik
......@@ -46,8 +46,9 @@ fix Alens cosm 1
#high precision (NB not usefull for MC)
precisionFile=hpjul2.pre
#plikTT
clikfile=/sps/hep/cobesix/software/gcc/camel/plc_2.0/hi_l/plik/plik_dx11dr2_HM_v18_TT.clik
clikfile1=planck_data/hi_l/plik/plik_dx11dr2_HM_v18_TT.clik
#bflike
clikfile2=/sps/hep/cobesix/software/gcc/camel/plc_2.0/low_l/bflike/lowl_SMW_70_dx11d_2014_10_03_v5c_Ap.clik
clikfile2=planck_data/low_l/bflike/lowl_SMW_70_dx11d_2014_10_03_v5c_Ap.clik
......@@ -71,8 +71,6 @@ ClikLikelihood::ClikLikelihood(char* file)
//--------------
ClikLikelihood::~ClikLikelihood()
{
cout << " clenaing clik=" << _name << endl;
clik_cleanup(&clikid);
}
......
......@@ -84,7 +84,7 @@ Chi2Factory::gimeChi2(Parser& parser){
//autres clik?
int iclik=2;
while(parser.params.param_present(string("clikfile")+dataToString(iclik))){
string clikid=parser.params.find<string>(string("clikfile")+dataToString(iclik));
string clikid= Parser::getParFile(parser.params.find<string>(string("clikfile")+dataToString(iclik)));
cout << "new CLIK likelihood=" << clikid << endl;
lik=new ClikLikelihood(const_cast<char*>(clikid.c_str()));
allCl->add(lik);
......
......@@ -79,7 +79,7 @@ public:
protected:
int _lmax;
double undef(const char* c) const;
virtual double undef(const char* c) const;
};
......
......@@ -176,9 +176,9 @@ Parser::getParFile(const std::string& filename){
string s=filename;
if (!file_present(filename)) {
s=string(PARFILE)+"/"+filename;
cout << "! No direct access file: " << filename << ". Looking into: " << s << "..." "\t";
// cout << "! No direct access file: " << filename << ". Looking into: " << s << "..." "\t";
assert_present(s);
cout << "...OK found" << endl;
//cout << "...OK found" << endl;
}
return s;
}
......@@ -43,13 +43,11 @@ int main(int argc,char** argv){
double val(0.);
try{
val= theChi2->getEngine()->get(extra[i]);
cout << extra[i] << "\t" << val << endl;
}
catch (Message_error &e){
// std::cerr << "could not get: " << e.what() << std::endl;
cout <<"bon c'est pas tres grave non plus" << endl;
//std::cerr << "maybe your are using pico?"<< std::endl;
}
cout << extra[i] << "\t" << val << endl;
}
......
......@@ -178,44 +178,16 @@ MnPicoEngine::getCls(const std::vector<unsigned>& lVec, //input
}
//attention: pas compris la normalisation encore
/*
bool
MnPicoEngine::getLensing(const std::vector<unsigned>& lVec, //input
std::vector<double>& clpp,
std::vector<double>& cltp,
std::vector<double>& clep){
double* ClPP=NULL;
double* ClTP=NULL;
int lmin=lVec[0];
int lmax=lVec.back();
int sz=lmax-lmin+1;
pico_read_output(pResult,clNames[4],&ClPP,&lmin,&lmax);
pico_read_output(pResult,clNames[5],&ClTP,&lmin,&lmax);
clpp.resize(sz);cltp.resize(sz);clep.resize(sz);
for (size_t i=0;i<clpp.size();i++){
double fac=1.;
clpp[i]=ClPP[i]/fac;
cltp[i]=ClTP[i]/fac;
clep[i]=0;
}
double
MnPicoEngine::undef(const char* param) const{
throw Message_error(string("Parameter=")+param+" not available in pico");
return -1.;
}
delete [] ClPP;
delete [] ClTP;
return true;
}
*/
double
MnPicoEngine::get_tau_reio() const{
return PyFloat_AS_DOUBLE(PyDict_GetItemString(dict,picoNames[3]));
double
MnPicoEngine::error() const{
planck_assert(false,"Not implemented in PICO");
return 1;
}
......@@ -53,25 +53,12 @@ public:
std::vector<double>& clpp,
std::vector<double>& cltp,
std::vector<double>& clep) {return false;};
//none of this is implemented inside pico: stop
// double z_drag() const { return error();};
// double rs_drag() const { return error();};
// double get_Dv(double z) { return error();};
// double get_Az(double z) {return error();};
// double get_Fz(double z) {return error();};
// double get_H(double z) { return error();};
// double get_Da(double z){ return error();};
// double get_f(double z) { return error();};
// double get_sigma8(double z){ return error();};
// double get_tau_reio() const { return error();};
// double get_z_reio() const { return error();};
// double get_DMod(double z) { return error();};
// double get_H0() const {return error();}
double get_tau_reio() const;
private:
double error() const;
double undef(const char* c) const;
static char* picoNames[];
static char* classNames[];
......
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