Commit 1cb90c9e authored by Enrico Bothmann's avatar Enrico Bothmann

svn merge ^/trunk/SHERPA@29448 ^/branches/readin@29448

This reintegrates the readin branch, replacing Data_Reader with its new
subclass Default_Reader, wherever parameters are read from the run card(s) or
the command line. This simplifies this use case and and enforces consistency.
A lot of duplicate code is removed, too. Data_Reader is still used for more
low-level string parsing.
parent 28d835d4
......@@ -9,7 +9,7 @@
#include "AHADIC++/Tools/Hadronisation_Parameters.H"
#include "AHADIC++/Formation/Cluster_Formation_Handler.H"
#include "AHADIC++/Decays/Cluster_Decay_Handler.H"
#include "ATOOLS/Org/Data_Reader.H"
#include "ATOOLS/Org/Default_Reader.H"
#include "ATOOLS/Org/Shell_Tools.H"
using namespace AHADIC;
......@@ -21,12 +21,10 @@ Ahadic::Ahadic(string path, string file) :
m_fullinfo(false), m_maxtrials(3), m_clulist()
{
Data_Reader dr(" ",";","!","=");
dr.AddComment("#");
dr.AddWordSeparator("\t");
dr.SetInputPath(path);
dr.SetInputFile(file);
m_anadir = dr.GetValue<string>("FRAGMANADIR", "Fragmentation_Analysis");
Default_Reader reader;
reader.SetInputPath(path);
reader.SetInputFile(file);
m_anadir = reader.Get<string>("FRAGMANADIR", "Fragmentation_Analysis");
hadpars = new Hadronisation_Parameters();
hadpars->Init(path,file);
......
#include "AHADIC++/Tools/Hadron_Init.H"
#include "ATOOLS/Phys/Flavour.H"
#include "ATOOLS/Org/Message.H"
#include "ATOOLS/Org/Default_Reader.H"
using namespace AHADIC;
using namespace ATOOLS;
......@@ -515,24 +516,24 @@ void Hadron_Init::Init() {
s_kftable[kf_f_2_2340]->m_majorana=-1;
}
void Hadron_Init::OverWriteProperties(Data_Reader& dr)
void Hadron_Init::OverWriteProperties(Default_Reader& reader)
{
std::map<int,double> cdm, cdw;
std::map<int,int> cia, cis, cim;
std::vector<std::vector<double> > helpdvv;
if (dr.MatrixFromFile(helpdvv,"MASS"))
if (reader.ReadMatrix(helpdvv,"MASS"))
for (size_t i(0);i<helpdvv.size();++i)
if (helpdvv[i].size()==2) cdm[int(helpdvv[i][0])]=helpdvv[i][1];
if (dr.MatrixFromFile(helpdvv,"WIDTH"))
if (reader.ReadMatrix(helpdvv,"WIDTH"))
for (size_t i(0);i<helpdvv.size();++i)
if (helpdvv[i].size()==2) cdw[int(helpdvv[i][0])]=helpdvv[i][1];
if (dr.MatrixFromFile(helpdvv,"ACTIVE"))
if (reader.ReadMatrix(helpdvv,"ACTIVE"))
for (size_t i(0);i<helpdvv.size();++i)
if (helpdvv[i].size()==2) cia[int(helpdvv[i][0])]=int(helpdvv[i][1]);
if (dr.MatrixFromFile(helpdvv,"STABLE"))
if (reader.ReadMatrix(helpdvv,"STABLE"))
for (size_t i(0);i<helpdvv.size();++i)
if (helpdvv[i].size()==2) cis[int(helpdvv[i][0])]=int(helpdvv[i][1]);
if (dr.MatrixFromFile(helpdvv,"MASSIVE"))
if (reader.ReadMatrix(helpdvv,"MASSIVE"))
for (size_t i(0);i<helpdvv.size();++i)
if (helpdvv[i].size()==2) cim[int(helpdvv[i][0])]=int(helpdvv[i][1]);
......
#ifndef AHADIC_Tools_Hadron_Init_H
#define AHADIC_Tools_Hadron_Init_H
#include "ATOOLS/Org/Data_Reader.H"
namespace ATOOLS {
class Default_Reader;
}
namespace AHADIC {
......@@ -9,7 +11,7 @@ namespace AHADIC {
public:
Hadron_Init() {}
void Init();
void OverWriteProperties(ATOOLS::Data_Reader& overwrite);
void OverWriteProperties(ATOOLS::Default_Reader&);
};
}
......
This diff is collapsed.
......@@ -5,13 +5,14 @@
#include "AHADIC++/Tools/Hadron_Multiplet.H"
#include "AHADIC++/Tools/Transitions.H"
#include "ATOOLS/Math/Vector.H"
#include "ATOOLS/Org/Data_Reader.H"
#include <map>
#include <string>
namespace ATOOLS {
class Default_Reader;
}
namespace AHADIC {
class Soft_Cluster_Handler;
......@@ -30,14 +31,14 @@ namespace AHADIC {
SDiter m_piter;
void ReadParameters(std::string,std::string);
void ReadGeneralSwitches(ATOOLS::Data_Reader & dataread);
void ReadMassParameters(ATOOLS::Data_Reader & dataread);
void ReadPoppingParameters(ATOOLS::Data_Reader & dataread);
void ReadMesonWeights(ATOOLS::Data_Reader & dataread);
void ReadGluonSplittingParameters(ATOOLS::Data_Reader & dataread);
void ReadClusterDecayParameters(ATOOLS::Data_Reader & dataread);
void ReadClusterToMesonParameters(ATOOLS::Data_Reader & dataread);
void ReadDeprecatedParameters(ATOOLS::Data_Reader & dataread);
void ReadGeneralSwitches(ATOOLS::Default_Reader & reader);
void ReadMassParameters(ATOOLS::Default_Reader & reader);
void ReadPoppingParameters(ATOOLS::Default_Reader & reader);
void ReadMesonWeights(ATOOLS::Default_Reader & reader);
void ReadGluonSplittingParameters(ATOOLS::Default_Reader & reader);
void ReadClusterDecayParameters(ATOOLS::Default_Reader & reader);
void ReadClusterToMesonParameters(ATOOLS::Default_Reader & reader);
void ReadDeprecatedParameters(ATOOLS::Default_Reader & reader);
public:
Hadronisation_Parameters();
~Hadronisation_Parameters();
......
......@@ -14,7 +14,7 @@
#include "ATOOLS/Org/Run_Parameter.H"
#include "ATOOLS/Org/Shell_Tools.H"
#include "ATOOLS/Org/MyStrStream.H"
#include "ATOOLS/Org/Data_Reader.H"
#include "ATOOLS/Org/Default_Reader.H"
#include "ATOOLS/Org/Exception.H"
#include "AMEGIC++/DipoleSubtraction/FF_DipoleSplitting.H"
......@@ -79,12 +79,11 @@ Single_OSTerm::Single_OSTerm(const Process_Info &pinfo,size_t pi,size_t pj,size_
}
m_osinfo= lopi;
double helpd(5.);
Data_Reader reader(" ",";","!","=");
reader.AddComment("#");
Default_Reader reader;
reader.SetInputPath(rpa->GetPath());
reader.SetInputFile(rpa->gen.Variable("ME_DATA_FILE"));
if (reader.ReadFromFile(helpd,"OS_SUB_WINDOW")) {
double helpd;
if (reader.Read(helpd, "OS_SUB_WINDOW", 5.0)) {
m_wwindow = helpd;
msg_Tracking()<<"Set width window for os subtraction="<<m_wwindow<<"."<<std::endl;
}
......
......@@ -14,7 +14,7 @@
#include "ATOOLS/Math/Random.H"
#include "ATOOLS/Org/Shell_Tools.H"
#include "ATOOLS/Org/MyStrStream.H"
#include "ATOOLS/Org/Data_Reader.H"
#include "ATOOLS/Org/Default_Reader.H"
#include "ATOOLS/Org/My_MPI.H"
#include "PHASIC++/Process/Virtual_ME2_Base.H"
......@@ -39,62 +39,49 @@ Single_Virtual_Correction::Single_Virtual_Correction() :
m_bsum(0.0), m_vsum(0.0), m_isum(0.0), m_n(0.0),
m_mbsum(0.0), m_mvsum(0.0), m_misum(0.0), m_mn(0.0)
{
m_dalpha = 1.;
int helpi;
double helpd;
Data_Reader reader(" ",";","!","=");
reader.AddComment("#");
Default_Reader reader;
reader.SetInputPath(rpa->GetPath());
reader.SetInputFile(rpa->gen.Variable("ME_DATA_FILE"));
m_checkborn = false;
if (reader.ReadFromFile(helpi,"CHECK_BORN")) {
m_checkborn = helpi;
if (reader.Read(m_checkborn, "CHECK_BORN", false)) {
msg_Tracking()<<"Set Born check mode "<<m_checkborn<<" . "<<std::endl;
}
m_checkpoles = false;
if (reader.ReadFromFile(helpi,"CHECK_POLES")) {
m_checkpoles = helpi;
if (reader.Read(m_checkpoles, "CHECK_POLES", false)) {
msg_Tracking()<<"Set infrared poles check mode "<<m_checkpoles<<" . "<<std::endl;
}
m_checkpolesthreshold = 0.;
if (reader.ReadFromFile(helpd,"CHECK_POLES_THRESHOLD")) {
m_checkpolesthreshold = helpd;
if (reader.Read(m_checkpolesthreshold, "CHECK_POLES_THRESHOLD", 0.0)) {
msg_Tracking()<<"Set infrared poles check threshold to "<<m_checkpolesthreshold<<" . "<<std::endl;
}
m_checkfinite = false;
if (reader.ReadFromFile(helpi,"CHECK_FINITE")) {
m_checkfinite = helpi;
if (reader.Read(m_checkfinite, "CHECK_FINITE", false)) {
msg_Tracking()<<"Set infrared finite check mode "<<m_checkfinite<<" . "<<std::endl;
}
if (reader.ReadFromFile(helpd,"DIPOLE_ALPHA")) {
m_dalpha = helpd;
if (reader.Read(m_dalpha, "DIPOLE_ALPHA", 1.0)) {
msg_Tracking()<<"Set dipole cut alpha="<<m_dalpha<<" . "<<std::endl;
}
if (reader.ReadFromFile(helpd,"DIPOLE_ALPHA_FF")) {
m_dalpha_ff = helpd;
if (reader.Read(m_dalpha_ff, "DIPOLE_ALPHA_FF", 1.0)) {
msg_Tracking()<<"Set ff dipole cut alpha="<<m_dalpha_ff<<" . "<<std::endl;
} else {
m_dalpha_ff = m_dalpha;
}
else m_dalpha_ff=m_dalpha;
if (reader.ReadFromFile(helpd,"DIPOLE_ALPHA_FI")) {
m_dalpha_fi = helpd;
if (reader.Read(m_dalpha_fi, "DIPOLE_ALPHA_FI", 1.0)) {
msg_Tracking()<<"Set fi dipole cut alpha="<<m_dalpha_fi<<" . "<<std::endl;
} else {
m_dalpha_fi = m_dalpha;
}
else m_dalpha_fi=m_dalpha;
if (reader.ReadFromFile(helpd,"DIPOLE_ALPHA_IF")) {
m_dalpha_if = helpd;
if (reader.Read(m_dalpha_if, "DIPOLE_ALPHA_IF", 1.0)) {
msg_Tracking()<<"Set if dipole cut alpha="<<m_dalpha_if<<" . "<<std::endl;
} else {
m_dalpha_if = m_dalpha;
}
else m_dalpha_if=m_dalpha;
if (reader.ReadFromFile(helpd,"DIPOLE_ALPHA_II")) {
m_dalpha_ii = helpd;
msg_Tracking()<<"Set ii dipole cut alpha="<<m_dalpha_ii<<" . "<<std::endl;
}
else m_dalpha_ii=m_dalpha;
m_force_init=reader.GetValue("LOOP_ME_INIT",0);
m_checkloopmap=reader.GetValue("CHECK_LOOP_MAP",0);
m_sccmur=reader.GetValue("USR_WGT_MODE",1);
m_user_bvimode=reader.GetValue("NLO_BVI_MODE",0);
m_imode=reader.GetValue<int>("NLO_IMODE",7);
if (reader.Read(m_dalpha_ff, "DIPOLE_ALPHA_FF", 1.0)) {
msg_Tracking()<<"Set ff dipole cut alpha="<<m_dalpha_ff<<" . "<<std::endl;
} else {
m_dalpha_ff = m_dalpha;
}
m_force_init=reader.Get("LOOP_ME_INIT",0);
m_checkloopmap=reader.Get("CHECK_LOOP_MAP",0);
m_sccmur=reader.Get("USR_WGT_MODE",1);
m_user_bvimode=reader.Get("NLO_BVI_MODE",0);
m_imode=reader.Get<int>("NLO_IMODE",7);
m_cmur[0]=0.;
m_cmur[1]=0.;
......
......@@ -61,7 +61,7 @@ namespace AMEGIC {
#include "ATOOLS/Math/Poincare.H"
#include "ATOOLS/Org/Shell_Tools.H"
#include "ATOOLS/Org/Message.H"
#include "ATOOLS/Org/Data_Reader.H"
#include "ATOOLS/Org/Default_Reader.H"
#include "MODEL/UFO/UFO_Model.H"
using namespace AMEGIC;
......@@ -103,12 +103,11 @@ bool Amegic::Initialize(const std::string &path,const std::string &file,
BEAM::Beam_Spectra_Handler *const beamhandler,
PDF::ISR_Handler *const isrhandler)
{
Data_Reader read(" ",";","#","=");
read.AddWordSeparator("\t");
read.SetInputPath(m_path);
read.SetInputFile(m_file);
Default_Reader reader;
reader.SetInputPath(m_path);
reader.SetInputFile(m_file);
if (dynamic_cast<UFO::UFO_Model*>(MODEL::s_model) &&
!read.GetValue<int>("AMEGIC_ALLOW_UFO", 0))
!reader.Get<int>("AMEGIC_ALLOW_UFO", 0))
THROW(fatal_error, "AMEGIC can only be used in built-in models. Please use Comix for UFO models.");
p_mmodel=model;
p_amodel = new Amegic_Model(model);
......@@ -116,60 +115,69 @@ bool Amegic::Initialize(const std::string &path,const std::string &file,
m_file=file;
p_int->SetBeam(beamhandler);
p_int->SetISR(isrhandler);
SetPSMasses(&read);
SetPSMasses(&reader);
double helpd;
if (!read.ReadFromFile(helpd,"DIPOLE_AMIN")) helpd=Max(rpa->gen.Accu(),1.0e-8);
else msg_Info()<<METHOD<<"(): Set dipole \\alpha_{cut} "<<helpd<<".\n";
rpa->gen.SetVariable("DIPOLE_AMIN",ToString(helpd));
if (!read.ReadFromFile(helpd,"DIPOLE_ALPHA")) helpd=1.0;
else msg_Info()<<METHOD<<"(): Set dipole \\alpha_{max} "<<helpd<<".\n";
rpa->gen.SetVariable("DIPOLE_ALPHA",ToString(helpd));
if (!read.ReadFromFile(helpd,"DIPOLE_ALPHA_FF")) helpd=0.0;
else msg_Info()<<METHOD<<"(): Set FF dipole \\alpha_{max} "<<helpd<<".\n";
rpa->gen.SetVariable("DIPOLE_ALPHA_FF",ToString(helpd));
if (!read.ReadFromFile(helpd,"DIPOLE_ALPHA_FI")) helpd=0.0;
else msg_Info()<<METHOD<<"(): Set FI dipole \\alpha_{max} "<<helpd<<".\n";
rpa->gen.SetVariable("DIPOLE_ALPHA_FI",ToString(helpd));
if (!read.ReadFromFile(helpd,"DIPOLE_ALPHA_IF")) helpd=0.0;
else msg_Info()<<METHOD<<"(): Set IF dipole \\alpha_{max} "<<helpd<<".\n";
rpa->gen.SetVariable("DIPOLE_ALPHA_IF",ToString(helpd));
if (!read.ReadFromFile(helpd,"DIPOLE_ALPHA_II")) helpd=0.0;
else msg_Info()<<METHOD<<"(): Set II dipole \\alpha_{max} "<<helpd<<".\n";
rpa->gen.SetVariable("DIPOLE_ALPHA_II",ToString(helpd));
if (!read.ReadFromFile(helpd,"DIPOLE_KAPPA")) helpd=2.0/3.0;
else msg_Info()<<METHOD<<"(): Set dipole \\kappa="<<helpd<<"\n.";
rpa->gen.SetVariable("DIPOLE_KAPPA",ToString(helpd));
int helpi;
if (!read.ReadFromFile(helpi,"DIPOLE_NF_GSPLIT"))
helpi=Flavour(kf_jet).Size()/2;
else msg_Info()<<METHOD<<"(): Set dipole N_f="<<helpi<<"\n.";
rpa->gen.SetVariable("DIPOLE_NF_GSPLIT",ToString(helpi));
if (!read.ReadFromFile(helpd,"DIPOLE_KT2MAX")) helpd=sqr(rpa->gen.Ecms());
else msg_Info()<<METHOD<<"(): Set dipole \\k_{T,max}^2 "<<helpd<<".\n";
rpa->gen.SetVariable("DIPOLE_KT2MAX",ToString(helpd));
size_t helpi;
helpd = reader.Get("DIPOLE_AMIN", Max(rpa->gen.Accu(),1.0e-8),
"dipole \\alpha_{cut}", METHOD);
rpa->gen.SetVariable("DIPOLE_AMIN", ToString(helpd));
helpd = reader.Get("DIPOLE_ALPHA", 1.0,
"dipole \\alpha_{max}", METHOD);
rpa->gen.SetVariable("DIPOLE_ALPHA", ToString(helpd));
helpd = reader.Get("DIPOLE_ALPHA_FF", 0.0,
"FF dipole \\alpha_{max}", METHOD);
rpa->gen.SetVariable("DIPOLE_ALPHA_FF", ToString(helpd));
helpd = reader.Get("DIPOLE_ALPHA_FI", 0.0,
"FI dipole \\alpha_{max}", METHOD);
rpa->gen.SetVariable("DIPOLE_ALPHA_FI", ToString(helpd));
helpd = reader.Get("DIPOLE_ALPHA_IF", 0.0,
"IF dipole \\alpha_{max}", METHOD);
rpa->gen.SetVariable("DIPOLE_ALPHA_IF", ToString(helpd));
helpd = reader.Get("DIPOLE_ALPHA_II", 0.0,
"II dipole \\alpha_{max}", METHOD);
rpa->gen.SetVariable("DIPOLE_ALPHA_II", ToString(helpd));
helpd = reader.Get("DIPOLE_KAPPA", 0.0,
"dipole \\kappa", METHOD);
rpa->gen.SetVariable("DIPOLE_KAPPA", ToString(helpd));
helpi = reader.Get("DIPOLE_NF_GSPLIT", Flavour(kf_jet).Size()/2,
"dipole N_f", METHOD);
rpa->gen.SetVariable("DIPOLE_NF_GSPLIT", ToString(helpi));
helpd = reader.Get("DIPOLE_KT2MAX", sqr(rpa->gen.Ecms()),
"dipole \\k_{T,max}^2", METHOD);
rpa->gen.SetVariable("DIPOLE_KT2MAX", ToString(helpd));
rpa->gen.SetVariable("NLO_SMEAR_THRESHOLD",
ToString(read.GetValue("NLO_SMEAR_THRESHOLD",0.0)));
ToString(reader.Get("NLO_SMEAR_THRESHOLD", 0.0)));
rpa->gen.SetVariable("NLO_SMEAR_POWER",
ToString(read.GetValue("NLO_SMEAR_POWER",0.5)));
int ossub=read.GetValue<int>("OS_SUB",0);
ToString(reader.Get("NLO_SMEAR_POWER", 0.5)));
int ossub = reader.Get<int>("OS_SUB", 0);
if (ossub==1) msg_Info()<<"Set on shell subtraction on. "<<std::endl;
rpa->gen.SetVariable("OS_SUB",ToString(ossub));
int sort=read.GetValue<int>("AMEGIC_SORT_LOPROCESS",1);
int sort = reader.Get<int>("AMEGIC_SORT_LOPROCESS", 1);
rpa->gen.SetVariable("AMEGIC_SORT_LOPROCESS",ToString(sort));
int libcheck=read.GetValue<int>("ME_LIBCHECK",0);
int libcheck = reader.Get<int>("ME_LIBCHECK", 0);
rpa->gen.SetVariable("ME_LIBCHECK",ToString(libcheck));
int cvp=read.GetValue<int>("AMEGIC_CUT_MASSIVE_VECTOR_PROPAGATORS",1);
int cvp = reader.Get<int>("AMEGIC_CUT_MASSIVE_VECTOR_PROPAGATORS", 1);
rpa->gen.SetVariable("AMEGIC_CUT_MASSIVE_VECTOR_PROPAGATORS",ToString(cvp));
double alpha=read.GetValue<double>("AMEGIC_TCHANNEL_ALPHA",0.9);
double alpha = reader.Get<double>("AMEGIC_TCHANNEL_ALPHA", 0.9);
rpa->gen.SetVariable("AMEGIC_TCHANNEL_ALPHA",ToString(alpha));
double salpha=read.GetValue<double>("AMEGIC_SCHANNEL_ALPHA",0.75);
double salpha = reader.Get<double>("AMEGIC_SCHANNEL_ALPHA", 0.75);
rpa->gen.SetVariable("AMEGIC_SCHANNEL_ALPHA",ToString(salpha));
double eps=read.GetValue<double>("AMEGIC_CHANNEL_EPSILON",0.0);
double eps = reader.Get<double>("AMEGIC_CHANNEL_EPSILON", 0.0);
rpa->gen.SetVariable("AMEGIC_CHANNEL_EPSILON",ToString(eps));
int gauge(read.GetValue<int>("AMEGIC_DEFAULT_GAUGE",1));
int gauge(reader.Get<int>("AMEGIC_DEFAULT_GAUGE", 1, "gauge", METHOD));
AMEGIC::Process_Base::SetGauge(gauge);
if (gauge!=10) msg_Info()<<METHOD<<"(): Set gauge "<<gauge<<"."<<std::endl;
s_partcommit=read.GetValue<int>("AMEGIC_PARTIAL_COMMIT",0);
s_partcommit = reader.Get<int>("AMEGIC_PARTIAL_COMMIT", 0);
MakeDir(rpa->gen.Variable("SHERPA_CPP_PATH")+"/Process",true);
My_In_File::OpenDB(rpa->gen.Variable("SHERPA_CPP_PATH")+"/Process/Amegic/");
return true;
......
#include "AMEGIC++/Main/ColorSC.H"
#include "ATOOLS/Org/Message.H"
#include "ATOOLS/Org/Data_Reader.H"
#include "ATOOLS/Org/Default_Reader.H"
using namespace ATOOLS;
using namespace AMEGIC;
......@@ -21,10 +21,8 @@ void ColorSC::Init()
{
if (init) return;
init = true;
double helpd;
Data_Reader reader(" ",";","!","=");
if (reader.ReadFromFile(helpd,"N_COLOR")) {
Nc = helpd;
Default_Reader reader;
if (reader.Read(Nc, "N_COLOR", Nc)) {
msg_Out()<<"Set N_color="<<Nc<<"."<<std::endl;
CF = 0.5*(Nc-1./Nc);
CA = Nc;
......
......@@ -9,7 +9,7 @@
#include "PHASIC++/Channels/Multi_Channel.H"
#include "PHASIC++/Channels/Single_Channel.H"
#include "ATOOLS/Org/Shell_Tools.H"
#include "ATOOLS/Org/Data_Reader.H"
#include "ATOOLS/Org/Default_Reader.H"
#include "ATOOLS/Org/Exception.H"
#include "ATOOLS/Org/Message.H"
......@@ -28,8 +28,8 @@ AMEGIC::Process_Base::Process_Base():
p_channellibnames = new std::list<std::string>();
static int allowmap(-1);
if (allowmap<0) {
Data_Reader read(" ",";","!","=");
allowmap=read.GetValue<int>("AMEGIC_ALLOW_MAPPING",1);
Default_Reader read;
allowmap = read.Get<int>("AMEGIC_ALLOW_MAPPING", 1);
if (allowmap!=1) msg_Info()<<METHOD<<"(): Disable process mapping.\n";
}
m_allowmap=allowmap;
......
......@@ -12,7 +12,7 @@
#include "ATOOLS/Org/Run_Parameter.H"
#include "ATOOLS/Org/Shell_Tools.H"
#include "ATOOLS/Org/MyStrStream.H"
#include "ATOOLS/Org/Data_Reader.H"
#include "ATOOLS/Org/Default_Reader.H"
#include "ATOOLS/Org/My_MPI.H"
#include <unistd.h>
......@@ -134,9 +134,9 @@ int AMEGIC::Single_Process_Combined::InitAmplitude(Amegic_Model * model,Topology
p_hel = new Helicity(m_nin,m_nout,&m_flavs.front(),p_pl);
bool directload = true;
int libchk=0;
Data_Reader reader(" ",";","!","=");
if (reader.ReadFromFile(libchk,"ME_LIBCHECK")) {
Default_Reader reader;
int libchk;
if (reader.Read(libchk, "ME_LIBCHECK", 0)) {
if (libchk==1) {
msg_Info()<<"Enforce full library check. This may take some time"<<std::endl;
directload = false;
......@@ -152,7 +152,7 @@ int AMEGIC::Single_Process_Combined::InitAmplitude(Amegic_Model * model,Topology
p_BS->Setk0(s_gauge);
p_shand = new String_Handler(m_gen_str,p_BS,model->p_model->GetCouplings());
int ntchanmin(m_ntchanmin);
bool cvp(reader.GetValue<int>("AMEGIC_CUT_MASSIVE_VECTOR_PROPAGATORS",1));
bool cvp(reader.Get<int>("AMEGIC_CUT_MASSIVE_VECTOR_PROPAGATORS", 1));
p_ampl = new Amplitude_Handler(m_nin+m_nout,&m_flavs.front(),p_b,p_pinfo,model,top,m_maxcpl,m_mincpl,ntchanmin,
&m_cpls,p_BS,p_shand,m_print_graphs,!directload,cvp,m_ptypename+"/"+m_libname);
if (p_ampl->GetGraphNumber()==0) {
......
......@@ -12,7 +12,7 @@
#include "ATOOLS/Org/Run_Parameter.H"
#include "ATOOLS/Org/Shell_Tools.H"
#include "ATOOLS/Org/MyStrStream.H"
#include "ATOOLS/Org/Data_Reader.H"
#include "ATOOLS/Org/Default_Reader.H"
using namespace AMEGIC;
using namespace MODEL;
......@@ -31,11 +31,10 @@ using namespace std;
AMEGIC::Single_Process_External::Single_Process_External():
p_me2(NULL), p_partner(this)
{
Data_Reader reader(" ",";","!","=");
reader.AddComment("#");
Default_Reader reader;
reader.SetInputPath(rpa->GetPath());
reader.SetInputFile(rpa->gen.Variable("ME_DATA_FILE"));
m_keep_zero_procs=reader.GetValue<int>("AMEGIC_KEEP_ZERO_PROCS",0);
m_keep_zero_procs = reader.Get<int>("AMEGIC_KEEP_ZERO_PROCS", 0);
m_lastk=1.0;
}
......
......@@ -9,11 +9,10 @@
#include "AMEGIC++/Phasespace/Channel_Generator_KK.H"
#include "AMEGIC++/Phasespace/Channel_Generator_Decays.H"
#include "AMEGIC++/Main/Process_Base.H"
#include "ATOOLS/Org/Data_Reader.H"
#include "ATOOLS/Org/Default_Reader.H"
#include "ATOOLS/Org/Run_Parameter.H"
#include "ATOOLS/Org/Message.H"
#include "ATOOLS/Org/Shell_Tools.H"
#include "ATOOLS/Org/Data_Reader.H"
#include "ATOOLS/Org/My_MPI.H"
#include "AMEGIC++/String/String_Library.H"
......@@ -46,16 +45,13 @@ bool Phase_Space_Generator::Construct(std::list<std::string>* liblist,string _pa
string lmapname = rpa->gen.Variable("SHERPA_CPP_PATH")+string("/Process/Amegic/")+pathID+string("/fsrchannels");
string mapname = rpa->gen.Variable("SHERPA_CPP_PATH")+string("/Process/Amegic/")+path+string("/fsrchannels.map");
Data_Reader dr(" ",";","!","=");
dr.AddComment("#");
dr.AddWordSeparator("\t");
dr.SetInputPath(rpa->GetPath());
dr.SetInputFile(rpa->gen.Variable("INTEGRATION_DATA_FILE"));
int inttype = dr.GetValue<int>
("AMEGIC_INTEGRATOR",
(rpa->gen.Beam1().IsHadron()&&rpa->gen.Beam2().IsHadron())?6:7);
Default_Reader reader;
reader.SetInputPath(rpa->GetPath());
reader.SetInputFile(rpa->gen.Variable("INTEGRATION_DATA_FILE"));
int inttype = reader.Get<int>("AMEGIC_INTEGRATOR",
(rpa->gen.Beam1().IsHadron()&&rpa->gen.Beam2().IsHadron())?6:7);
if (proc->Info().Has(nlo_type::real)) {
inttype = dr.GetValue<int>("AMEGIC_RS_INTEGRATOR",7);
inttype = reader.Get<int>("AMEGIC_RS_INTEGRATOR", 7);
}
if (nout==1) return 0;
if (nin==1&&nout==2) return 0;
......
......@@ -2,7 +2,7 @@
#include "AMEGIC++/String/String_Output.H"
#include "ATOOLS/Org/Library_Loader.H"
#include "ATOOLS/Org/Run_Parameter.H"
#include "ATOOLS/Org/Data_Reader.H"
#include "ATOOLS/Org/Default_Reader.H"
#include "ATOOLS/Org/Message.H"
using namespace AMEGIC;
......@@ -247,8 +247,8 @@ Values* String_Handler::Set_Values(std::string& pID,Basic_Sfuncs* BS)
{
static int s_mode(-1);
if (s_mode<0) {
Data_Reader reader(" ",";","#","=");
s_mode=reader.GetValue<int>("AMEGIC_LIBRARY_MODE",1);
Default_Reader reader;
s_mode = reader.Get<int>("AMEGIC_LIBRARY_MODE", 1);
}
s_loader->AddPath(rpa->gen.Variable("SHERPA_LIB_PATH"));
if (s_mode==1) {
......
......@@ -2,7 +2,7 @@
#include "AMISIC++/Model/Simple_Chain.H"
#include "AMISIC++/Model/Simple_String.H"
#include "ATOOLS/Org/Data_Reader.H"
#include "ATOOLS/Org/Default_Reader.H"
using namespace AMISIC;
using namespace ATOOLS;
......@@ -38,30 +38,24 @@ Amisic::~Amisic()
bool Amisic::Initialize()
{
if (InputPath()=="" && InputFile()=="") return false;
Data_Reader *reader = new Data_Reader(" ",";","!","=");
reader->AddComment("#");
reader->AddWordSeparator("\t");
reader->SetInputPath(InputPath());
reader->SetInputFile(InputFile());
Default_Reader reader;
reader.SetInputPath(InputPath());
reader.SetInputFile(InputFile());
std::vector<std::string> model;
if (!reader->VectorFromFile(model,"HARD_MODEL_NAME")) {
if (!reader.ReadStringVectorNormalisingNoneLikeValues(model,"HARD_MODEL_NAME")) {
model.push_back("Simple_Chain");
}
for (size_t i=1;i<model.size();++i) model[0]+=" "+model[i];
SelectHardModel(model[0]);
if (!reader->VectorFromFile(model,"SOFT_MODEL_NAME")) {
if (!reader.ReadStringVectorNormalisingNoneLikeValues(model,"SOFT_MODEL_NAME")) {
model.push_back("None");
}
for (size_t i=1;i<model.size();++i) model[0]+=" "+model[i];
SelectSoftModel(model[0]);
std::string file;
if (!reader->ReadFromFile(file,"HARD_MODEL_FILE")) file=InputFile();
p_hardbase->SetInputPath(InputPath());
p_hardbase->SetInputFile(file);
if (!reader->ReadFromFile(file,"SOFT_MODEL_FILE")) file=InputFile();
p_hardbase->SetInputFile(reader.Get("HARD_MODEL_FILE", InputFile()));
p_softbase->SetInputPath(InputPath());
p_softbase->SetInputFile(file);
delete reader;
p_softbase->SetInputFile(reader.Get("SOFT_MODEL_FILE", InputFile()));
bool success=true;
success=success&&p_hardbase->Initialize();
success=success&&p_softbase->Initialize();
......
......@@ -3,8 +3,7 @@
#include "PHASIC++/Main/Phase_Space_Handler.H"
#include "PHASIC++/Main/Process_Integrator.H"
#include "PDF/Main/ISR_Handler.H"
#include "ATOOLS/Org/Data_Reader.H"
#include "ATOOLS/Org/Data_Writer.H"
#include "ATOOLS/Org/Default_Reader.H"
#include "ATOOLS/Phys/Blob.H"
#include "ATOOLS/Org/Run_Parameter.H"
#include "ATOOLS/Org/Exception.H"
......@@ -64,13 +63,13 @@ bool Grid_Creator::ReadInArguments(std::string tempifile,
if (tempipath!="") SetInputPath(tempipath);
if (tempifile!="") SetInputFile(tempifile);
if (InputFile()=="") return false;
ATOOLS::Data_Reader *reader = new ATOOLS::Data_Reader(" ",";","//","=");
reader->AddWordSeparator("\t");
reader->SetInputFile(InputPath()+InputFile());
ATOOLS::Default_Reader reader;
reader.SetInputPath(InputPath());
reader.SetInputFile(InputFile());
std::vector<std::string> helps;
if (!reader->VectorFromFile(helps,"X_VARIABLE")) m_gridxvariable="PT";
if (!reader.ReadVector(helps,"X_VARIABLE")) m_gridxvariable="PT";
else m_gridxvariable=MakeString(helps);
if (!reader->VectorFromFile(helps,"Y_VARIABLE")) m_gridyvariable="";
if (!reader.ReadVector(helps,"Y_VARIABLE")) m_gridyvariable="";
else m_gridyvariable=MakeString(helps);
if (m_gridxmin==0.0) {
m_gridxmin=std::numeric_limits<double>::max();
......@@ -80,21 +79,16 @@ bool Grid_Creator::ReadInArguments(std::string tempifile,
p_processes[i]->Integrator()->ISR()->PDF(1)->Q2Min())));
}
}
m_gridxmin=ATOOLS::Max(m_gridxmin,1.e-3);
if (!reader->ReadFromFile(m_griddeltax,"GRID_DELTA_X"))
m_griddeltax=(log(m_gridxmax)-log(m_gridxmin))/250.;