Skip to content

Commit

Permalink
Merge pull request #22 from NNPDF/read_grid_from_runcard
Browse files Browse the repository at this point in the history
read name of output grid from runcard
  • Loading branch information
scarlehoff authored Sep 13, 2022
2 parents c6082ea + 80d468a commit c370769
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/Vrap.C
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ VrapOptionsHandler::VrapOptionsHandler(){
add(new multipleValueOption<int>("PrintDirection",direction,"Forward",+1,"Reverse",-1,"Sets the order in which output is printed (for td). ") );
add(new multipleValueOption<int>("OutputFormat",o_f,"TopDrawStyle",0,"ListValues",1,"Sets the style output is printed (for td or just list dsig/dy). ") );
add(new yesOrNoOption("jacobianTau2M",jacobianTau2M,"Sets whether to use the jacobian of (M/sqrt(s))^3."));
add(new ValueSettingOption<std::string>("pineapplName",pineapplName,"Sets the output name for the pineappl grid."));
//enableDebug();
}

Expand All @@ -74,6 +75,7 @@ void defaultSettings(){
// f_NNLO_only = 0; alphat = 1./132.1; setV(gamma_only,Q,alphat,Nf,0);

useOtherPDF=false;
pineapplName="test";
pdfSet=-1;
parton_flag=1;
nbrYPnts=19;
Expand Down Expand Up @@ -271,7 +273,7 @@ int main(int argc,char* argv[]){
}

piner.rebin(qy_bins);
piner.save();
piner.save(pineapplName);

return 0;
}
10 changes: 7 additions & 3 deletions src/pineappl_interface.C
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,13 @@ void CheffPanopoulos::fill_grid(int order, LuminosityFunction lumi_function, dou
}
}

void CheffPanopoulos::save() {
char const *filename = "test.pineappl.lz4";
pineappl_grid_write(mother_grid, filename);
void CheffPanopoulos::save(std::string filename) {
const std::string extension(".pineappl.lz4");
if (filename.find(extension) == std::string::npos) {
filename += extension;
}
//char const *filename = "test.pineappl.lz4";
pineappl_grid_write(mother_grid, &filename[0]);
pineappl_grid_delete(mother_grid);
}

Expand Down
2 changes: 1 addition & 1 deletion src/pineappl_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CheffPanopoulos {
void set_prefactor(const double);
void enable(const bool state);
void rebin(const std::vector<std::pair<double, double>>);
void save();
void save(std::string);
double vegas_wgt = 1.0;

private:
Expand Down
1 change: 1 addition & 0 deletions src/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ int f_quiet = 0; // Set to 1 to suppress intermediate printing by rap_y()

std::string pdfMode;
std::string pdfFile;
std::string pineapplName;

bool useMyAlphaRunning = false;
bool useOtherPDF;
Expand Down

0 comments on commit c370769

Please sign in to comment.