IAP GITLAB

Commit a2786a11 authored by Colin Baus's avatar Colin Baus

added option to use sqrt(s) instead of providing both momenta. also display...

added option to use sqrt(s) instead of providing both momenta. also display sqrt(s) when cross section is returned

git-svn-id: https://devel-ik.fzk.de/svn/mc/crmc/trunk@4943 c7a5e08c-de06-0410-9364-b41cf42a0b17
parent e038393b
......@@ -108,22 +108,25 @@ Run the program by executing
to get the following help:
Options of CRMC:
-h [ --help ] description of options
-v [ --version ] show version and exits
-o [ --output ] arg output mode: hepmc (default), hepmc.gz, root, lhe, lhe.gz
-s [ --seed ] arg random seed (default: random)
-n [ --number ] arg number of collisions
-m [ --model ] arg model [0=EPOS_LHC (default), 1=EPOS_1.99, 2=QGSJET01,
6=Sibyll_2.1, 7=QGSJETII-04, 11=QGSJETII-03]
-p [ --projectile-momentum ] arg momentum/(GeV/c) (usually >0)
-P [ --target-momentum ] arg momentum/(GeV/c) (usually =<0)
-i [ --projectile-id ] arg PDG or Z*10000+A*10 (default=proton)
-I [ --target-id ] arg PDG or Z*10000+A*10 (default=proton)
-c [ --config ] arg config file
-f [ --out ] arg output file name (auto if none provided)
-t [ --produceTables ] [=arg(=1)] create tables if none are found
-T [ --Test ] [=arg(=1)] Test mode
-h [ --help ] description of options
-v [ --version ] show version and exits
-o [ --output ] arg output mode: hepmc (default), hepmcgz,
root, lhe, lhegz
-s [ --seed ] arg random seed between 0 and 1e9 (default:
random)
-n [ --number ] arg number of collisions
-m [ --model ] arg model [0=EPOS_LHC, 1=EPOS_1.99,
6=Sibyll_2.1, 7=QGSJETII-04]
-p [ --projectile-momentum ] arg momentum/(GeV/c)
-P [ --target-momentum ] arg momentum/(GeV/c)
-S [ --sqrts ] arg sqrt(s/GeV**2)
-i [ --projectile-id ] arg PDG or Z*10000+A*10
-I [ --target-id ] arg PDG or Z*10000+A*10
-c [ --config ] arg config file
-f [ --out ] arg output file name (auto if none provided)
-t [ --produce-tables ] [=arg(=1)] create tables if none are found
-T [ --test ] [=arg(=1)] test mode
-x [ --cross-section ] [=arg(=1)] calculate and print cross section only
for projectile and target Id the following shortcuts are allowed :
1 = PDG(2212) = proton
......@@ -131,6 +134,8 @@ for projectile and target Id the following shortcuts are allowed :
12 = PDG(1000060120) = Carbon
120 = PDG(211) = pion+ (not for -I)
-120 = PDG(-211) = pion- (not for -I)
130 = PDG(321) = kaon+ (not for -I)
-130 = PDG(-321) = kaon- (not for -I)
208 = PDG(1000822080) = Lead
using these shortcuts with automatic output file name generation will create more human readable names.
......@@ -138,13 +143,13 @@ The environment variable $CRMC_OUT can be set to define the path the path of the
otherwise $PWD is used as default path.
**Example to generate 100 7 TeV pp collisions with EPOS LHC:
bin/crmc -o hepmc -p3500 -P-3500 -n100 -m0
bin/crmc -o hepmc -S7000 -n100 -m0
**Example to generate 100 1.38 ATeV PbPb collisions with EPOS 1.99:
bin/crmc -o hepmc -p1380 -P-1380 -n100 -i208 -I208 -m1
**Example to generate 100 4.4 ATeV pPb collisions with QGSJetII-04:
bin/crmc -o hepmc -p3500 -P-1380 -n100 -m7 -i2212 -I822080
**Example to generate 100 5.02 ATeV pPb collisions with QGSJetII-04:
bin/crmc -o hepmc -p4000 -P-1577 -n100 -m7 -i2212 -I822080
**Example to test Sibyll2.1
bin/crmc -T -m6
......
......@@ -11,6 +11,24 @@ namespace po = boost::program_options;
using namespace std;
double mass(int id)
///return mass in GeV
{
double mass;
switch(id)
{
case 120: // pi+
mass = 0.13957018;
break;
case 130: // k+
mass = 0.493677;
break;
default: // proton
mass = 0.938272046;
}
return mass;
}
CRMCoptions::CRMCoptions(int argc, char** argv)
: fError(false),
fOutputMode(eHepMC),
......@@ -107,6 +125,7 @@ CRMCoptions::ParseOptions(int argc, char** argv)
("model,m", po::value<int>(), model_desc.str().c_str())
("projectile-momentum,p", po::value<double>(), "momentum/(GeV/c)")
("target-momentum,P", po::value<double>(), "momentum/(GeV/c)")
("sqrts,S", po::value<double>(), "sqrt(s/GeV**2)")
("projectile-id,i", po::value<int>(), "PDG or Z*10000+A*10")
("target-id,I", po::value<int>(), "PDG or Z*10000+A*10")
("config,c", po::value<string>(), "config file")
......@@ -153,6 +172,13 @@ CRMCoptions::ParseOptions(int argc, char** argv)
}
}
// check if either sqrt(s) or the momenta option was used
if(opt.count("sqrts") && (opt.count("target-momentum") || opt.count("projectile-momentum")))
{
cerr << "You can either specify sqrt(s) or the beam momenta" << endl;
exit(1);
}
if (fOutputMode == eLHE || fOutputMode == eLHEGZ)
fTypout = 1;
......@@ -236,6 +262,22 @@ CRMCoptions::ParseOptions(int argc, char** argv)
}
}
// treat sqrts setting
if (opt.count("sqrts"))
{
const double sqrts = opt["sqrts"].as<double>();
const double e = sqrts / 2.;
fTargetMomentum = -sqrt(e*e-pow(mass(fTargetId),2));
fProjectileMomentum = sqrt(e*e-pow(mass(fProjectileId),2));
fSqrts = sqrts;
}
else //set fSqrts
{
const double eTarget = sqrt(fTargetMomentum*fTargetMomentum + pow(mass(fTargetId),2));
const double eProjectile = sqrt(fProjectileMomentum*fProjectileMomentum + pow(mass(fProjectileId),2));
fSqrts = sqrt(pow(eTarget+eProjectile,2)-pow(fTargetMomentum+fProjectileMomentum,2));
}
DumpConfig();
}
......@@ -255,7 +297,7 @@ const
case -1 : return "antip"; break; // pdg anti d-quark
case 12 : return "C"; break; // pdg: nu-e
case 208 : return "Pb"; break; // no pdg
case 2212: return "p"; break;
case 2212 : return "p"; break;
case -2212: return "antip"; break;
default:
{
......@@ -270,11 +312,11 @@ const
const int A = (pid%10000) / 10;
switch(Z) {
case 1: return "p"; break;
case 2: return "He"; break;
case 6: return "C"; break;
case 7: return "N"; break;
case 8: return "O"; break;
case 1: return "p"; break;
case 2: return "He"; break;
case 6: return "C"; break;
case 7: return "N"; break;
case 8: return "O"; break;
case 26: return "Fe"; break;
case 82: return "Pb"; break;
}
......@@ -324,15 +366,15 @@ CRMCoptions::DumpConfig() const
cout << " HE model: " << fHEModel;
switch(fHEModel) {
case 0: cout << " (EPOS-LHC) \n"; break;
case 1: cout << " (EPOS 1.99) \n"; break;
case 2: cout << " (QGSJET01) \n"; break;
case 3: cout << " (Gheisha)\n "; break;
case 4: cout << " (Pythia)\n "; break;
case 5: cout << " (Hijing)\n "; break;
case 6: cout << " (Sibyll 2.1)\n "; break;
case 7: cout << " (QGSJETII-04) \n"; break;
case 8: cout << " (Phojet) \n"; break;
case 0: cout << " (EPOS-LHC) \n"; break;
case 1: cout << " (EPOS 1.99) \n"; break;
case 2: cout << " (QGSJET01) \n"; break;
case 3: cout << " (Gheisha)\n "; break;
case 4: cout << " (Pythia)\n "; break;
case 5: cout << " (Hijing)\n "; break;
case 6: cout << " (Sibyll 2.1)\n "; break;
case 7: cout << " (QGSJETII-04) \n"; break;
case 8: cout << " (Phojet) \n"; break;
case 11: cout << " (QGSJETII-03) \n"; break;
case 12: cout << " (DPMJet 3.0-6) \n"; break;
default:
......@@ -406,17 +448,17 @@ CRMCoptions::GetOutputFileName() const
ostringstream crmcFileName;
crmcFileName << crmcOutDir << "/" << "crmc_";
switch (fHEModel) {
case 0: crmcFileName << "eposlhc"; break;
case 1: crmcFileName << "epos199"; break;
case 2: crmcFileName << "qgsjet"; break;
case 3: crmcFileName << "gheisha"; break;
case 4: crmcFileName << "pythia"; break;
case 5: crmcFileName << "hijing"; break;
case 6: crmcFileName << "sibyll"; break;
case 7: crmcFileName << "qgsjetII04"; break;
case 8: crmcFileName << "phojet"; break;
case 11:crmcFileName << "qgsjetII03"; break;
case 12: crmcFileName << "dpmjet"; break;
case 0: crmcFileName << "eposlhc"; break;
case 1: crmcFileName << "epos199"; break;
case 2: crmcFileName << "qgsjet"; break;
case 3: crmcFileName << "gheisha"; break;
case 4: crmcFileName << "pythia"; break;
case 5: crmcFileName << "hijing"; break;
case 6: crmcFileName << "sibyll"; break;
case 7: crmcFileName << "qgsjetII04"; break;
case 8: crmcFileName << "phojet"; break;
case 11: crmcFileName << "qgsjetII03"; break;
case 12: crmcFileName << "dpmjet"; break;
default:
cerr << " crmcOut: error - unknown model " << fHEModel << endl;
cerr << " exit ..." << endl;
......
......@@ -54,6 +54,7 @@ class CRMCoptions {
int fTypout;
double fProjectileMomentum;
double fTargetMomentum;
double fSqrts;
std::string fParamFileName;
std::string fOutputFileName;
......
......@@ -50,6 +50,9 @@ void
OutputPolicyNone::PrintCrossSections(const CRMCoptions& cfg)
{
cout << "\n >> Cross Sections <<\n\n"
<< " sqrt(s/GeV**2)=" << cfg.fSqrts << "\n\n"
<< " Total Cross Section (mb): " << gCRMC_data.sigtot << "\n"
<< " Elastic Cross Section (mb): " << gCRMC_data.sigela << "\n"
<< " Inel. Cross Section (mb) : " << gCRMC_data.sigine << "\n" ;
......
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