Skip to content

Commit

Permalink
Allow user to specify ipsat parameters from command line
Browse files Browse the repository at this point in the history
Only for proton (A=1) for now
  • Loading branch information
hejajama committed Apr 26, 2024
1 parent ebe96f3 commit eb0e775
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 8 deletions.
19 changes: 17 additions & 2 deletions src/ipsat_proton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,7 @@ Ipsat_Proton::Ipsat_Proton()
ipsat = MZSAT;
#endif
saturation=true;

// (4.939286653112, 1.1, 0.009631194037871, 3.058791613883, 1.342035015621);
;
Init();

}
Expand Down Expand Up @@ -627,6 +626,22 @@ Ipsat_Proton::Ipsat_Proton(Ipsat_version version)
Init();

}

Ipsat_Proton::Ipsat_Proton(Ipsat_version version, IPsat_fit_parameteters params)
{
if (version != MZSAT)
{
cerr << "Only MZsat ipsat setup supports different fit parameters" << endl;
exit(1);
}
ipsat = MZSAT;
mzipsat = new MZ_ipsat::DipoleAmplitude(params.C, params.mu0, params.lambdag, params.Ag, params.mc);
mzipsat->SetSaturation(params.saturation);
saturation=params.saturation;
Init();
}


Ipsat_Proton::Ipsat_Proton(DGLAPDist *gd)
{
gdist = gd;
Expand Down
12 changes: 12 additions & 0 deletions src/ipsat_proton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ enum Fluctuation_shape
LOCAL_FLUCTUATIONS
};

struct IPsat_fit_parameteters
{
// Default params: double C=2.2894; double mu0 = std::sqrt(1.1); double lambdag=0.08289; double Ag=2.1953; double mc=1.3528;
double C;
double mu0;
double lambdag;
double Ag;
double mc;
bool saturation;
};

class Ipsat_Proton : public DipoleAmplitude
{
public:
Expand All @@ -76,6 +87,7 @@ class Ipsat_Proton : public DipoleAmplitude
Ipsat_Proton();
Ipsat_Proton(DGLAPDist *gd); // Use global gdist
Ipsat_Proton(Ipsat_version version);
Ipsat_Proton(Ipsat_version version, IPsat_fit_parameteters params);
~Ipsat_Proton();

std::vector<Vec>& GetQuarks();
Expand Down
22 changes: 16 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,24 @@ int main(int argc, char* argv[])

if (A==1)
{
if (string(argv[i+2])=="ipsatproton" or string(argv[i+2])=="lcpt")
if (string(argv[i+2])=="ipsatproton" or string(argv[i+2])=="ipsatprotonparam" or string(argv[i+2])=="lcpt")
{
if (string(argv[i+2])=="ipsatproton")
amp = new Ipsat_Proton(MZSAT);
else if (string(argv[i+2])=="ipsatprotonparam")
{
IPsat_fit_parameteters ipsatparam;
ipsatparam.saturation=true;
// In this case the parameterers followinb Bp and BG are
// C, mu0, lambdag, Ag, mc
ipsatparam.C=StrToReal(argv[i+5]);
ipsatparam.mu0 = StrToReal(argv[i+6]);
ipsatparam.lambdag=StrToReal(argv[i+7]);
ipsatparam.Ag=StrToReal(argv[i+8]);
ipsatparam.mc=StrToReal(argv[i+9]);

amp = new Ipsat_Proton(MZSAT, ipsatparam);
}
else
amp = new Ipsat_Proton(LCPT);
((Ipsat_Proton*)amp)->SetProtonWidth(StrToReal(argv[i+3]));
Expand All @@ -201,11 +215,7 @@ int main(int argc, char* argv[])
}
else if (string(argv[i+5])=="com")
((Ipsat_Proton*)amp)->SetQuarkCenterOfMassToOrigin(true);
else if (string(argv[i+5]).substr(0,1)!="-")
{
cerr << "Unknown ipsatproton option " << argv[i+4] << endl;
exit(1);
}

}
}
}
Expand Down

0 comments on commit eb0e775

Please sign in to comment.