Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions MC/config/PWGGAJE/external/generator/generator_pythia8_powheg.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
R__ADD_INCLUDE_PATH($O2DPG_MC_CONFIG_ROOT)
///#include "FairGenerator.h"
//#include "Generators/GeneratorPythia8.h"
#include "Pythia8/Pythia.h"
#include "Generators/GeneratorPythia8Param.h"
#include "CommonUtils/FileSystemUtils.h"
// Pythia8 generator with POWHEG
//
// Author: Marco Giacalone (marco.giacalone@cern.ch)

// o2-sim-dpl-eventgen --nEvents 10 --generator external\
--configKeyValues "GeneratorExternal.fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/external/\
generator/generator_pythia8_powheg.C;GeneratorExternal.funcName=\
getGeneratorJEPythia8POWHEG(\"powheg.input\",\"${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGGAJE/pythia8/generator/pythia8_powheg.cfg\")"
// or with iniFile
// o2-sim -g external --noGeant -n 2 -j 8 --configFile $O2DPG_MC_CONFIG_ROOT/MC/config/PWGGAJE/ini/GeneratorPythia8POWHEG.ini

namespace o2
{
namespace eventgen
{

using namespace Pythia8;

// Pythia8 generator using POWHEG data that are generated during the initialization
// of the external generator. The POWHEG configuration file is copied to the current
// directory with the right name and the POWHEG events are generated using the pwhg_main_hvq executable.
class GeneratorJEPythia8POWHEG : public o2::eventgen::GeneratorPythia8
{
public:
/// default constructor
GeneratorJEPythia8POWHEG(std::string confpath = "pwgpath")
{
// Check if file exist and is not empty
if (std::filesystem::exists(confpath) && std::filesystem::file_size(confpath) > 0) {
// Copy the file to the current directory
ifstream src(confpath);
ofstream dst("powheg.input");
gRandom->SetSeed(0);
int seed = gRandom->Integer(900000000);
bool isseed = false;
bool isnumevts = false;
std::string line;
while (std::getline(src, line)) {
if (line.find("iseed") != std::string::npos)
{
// Set the seed to the random number
line = "iseed " + std::to_string(seed);
isseed = true;
}
if (line.find("numevts") != std::string::npos)
{
// Set the number of events to the number of events defined in the configuration
line = "numevts " + std::to_string(mSimConfig.getNEvents());
// replace it in the file
isnumevts = true;
}
dst << line << std::endl;
}
if (!isseed) {
dst << "iseed " << seed << std::endl;
}
if (!isnumevts) {
dst << "numevts " << mSimConfig.getNEvents() << std::endl;
}
src.close();
dst.close();
} else {
LOG(fatal) << "POWHEG configuration file not found or empty" << std::endl;
exit(1);
}
// Generate the POWHEG events
std::string cmd = "pwhg_main_hvq";
system(cmd.c_str());
};

private:
o2::conf::SimConfig mSimConfig = o2::conf::SimConfig::Instance(); // local sim config object
};

} // namespace eventgen
} // namespace o2

/** generator instance and settings **/

FairGenerator *getGeneratorJEPythia8POWHEG(std::string powhegconf = "pwgpath", std::string pythia8conf = "")
{
using namespace o2::eventgen;
// Expand paths for the POWHEG configuration file
powhegconf = o2::utils::expandShellVarsInFileName(powhegconf);
LOG(info) << "Using POWHEG configuration file: " << powhegconf;
auto myGen = new GeneratorJEPythia8POWHEG(powhegconf);
if(GeneratorPythia8Param::Instance().config.empty() && pythia8conf.empty()) {
LOG(fatal) << "No configuration provided for Pythia8";
}
else if (!pythia8conf.empty())
{
// Force the configuration for Pythia8 in case it is provided.
// Useful for setting up the generator in the hybrid configuration
// making it more versatile and not relying entirely on the parameters provided
// by ini file or static parameters
myGen->setConfig(pythia8conf);
}
return myGen;
}
37 changes: 37 additions & 0 deletions MC/config/PWGGAJE/external/powheg/powheg_beauty_F05.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
! Random number generator initializing parameters
iseed 0 ! initialize random number sequence

! Heavy flavour production parameters
numevts 100000 ! number of events to be generated
ih1 1 ! hadron 1 type (1: proton; -1: antiproton)
ih2 1 ! hadron 2 type (1: proton; -1: antiproton)
!ndns1 131 ! pdf for hadron 1 (when using the hvqpdf package, hvqpdf numbering)
!ndns2 131 ! pdf for hadron 2 (when using the hvqpdf package, hvqpdf numbering)
lhans1 11000 ! pdf set for hadron 1 (LHAGLUE number) (11000 = CT10NLO, 10550 = CTEQ66)
lhans2 11000 ! pdf set for hadron 2 (LHAGLUE number) (11000 = CT10NLO, 10550 = CTEQ66)
ebeam1 6800 ! energy of beam 1 in GeV
ebeam2 6800 ! energy of beam 2 in GeV
qmass 4.75 ! mass of heavy quark in GeV
facscfact 0.5 ! factorization scale factor: mufact=muref*facscfact
renscfact 1 ! renormalization scale factor: muren=muref*renscfact
!fixedscale 1 ! use ref. scale=qmass (default 0, use running scale)

! Parameters to allow or not the use of stored data
use-old-grid 1 ! if 1 use old grid if file pwggrids.dat is present (# 1: regenerate)
use-old-ubound 1 ! if 1 use norm of upper bounding function stored in pwgubound.dat, if present; # 1: regenerate

! Parameters that control the grid for Born variables generation
ncall1 10000 ! number of calls for initializing the integration grid
itmx1 5 ! number of iterations for initializing the integration grid
ncall2 100000 ! number of calls for computing the integral and finding upper bound
itmx2 5 ! number of iterations for computing the integral and finding upper bound
foldcsi 5 ! number of folds on x integration
foldy 5 ! number of folds on y integration
foldphi 1 ! number of folds on phi integration
nubound 500000 ! number of bbarra calls to setup norm of upper bounding function
iymax 1 ! <= 10, normalization of upper bounding function in iunorm X iunorm square in y, log(m2qq)
ixmax 1 ! <= 10, normalization of upper bounding function in iunorm X iunorm square in y, log(m2qq)
xupbound 2 ! increase upper bound for radiation generation
bornktmin 0 ! (default 0d0) Generation cut: minimum kt in underlying Born
bornsuppfact 0 ! (default 0d0) Mass parameter for Born suppression factor. If < 0 suppfact = 1
storemintupb 0 ! store function calls in binary file for more precise generation
37 changes: 37 additions & 0 deletions MC/config/PWGGAJE/external/powheg/powheg_beauty_F05_R05.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
! Random number generator initializing parameters
iseed 0 ! initialize random number sequence

! Heavy flavour production parameters
numevts 100000 ! number of events to be generated
ih1 1 ! hadron 1 type (1: proton; -1: antiproton)
ih2 1 ! hadron 2 type (1: proton; -1: antiproton)
!ndns1 131 ! pdf for hadron 1 (when using the hvqpdf package, hvqpdf numbering)
!ndns2 131 ! pdf for hadron 2 (when using the hvqpdf package, hvqpdf numbering)
lhans1 11000 ! pdf set for hadron 1 (LHAGLUE number) (11000 = CT10NLO, 10550 = CTEQ66)
lhans2 11000 ! pdf set for hadron 2 (LHAGLUE number) (11000 = CT10NLO, 10550 = CTEQ66)
ebeam1 6800 ! energy of beam 1 in GeV
ebeam2 6800 ! energy of beam 2 in GeV
qmass 4.75 ! mass of heavy quark in GeV
facscfact 0.5 ! factorization scale factor: mufact=muref*facscfact
renscfact 0.5 ! renormalization scale factor: muren=muref*renscfact
!fixedscale 1 ! use ref. scale=qmass (default 0, use running scale)

! Parameters to allow or not the use of stored data
use-old-grid 1 ! if 1 use old grid if file pwggrids.dat is present (# 1: regenerate)
use-old-ubound 1 ! if 1 use norm of upper bounding function stored in pwgubound.dat, if present; # 1: regenerate

! Parameters that control the grid for Born variables generation
ncall1 10000 ! number of calls for initializing the integration grid
itmx1 5 ! number of iterations for initializing the integration grid
ncall2 100000 ! number of calls for computing the integral and finding upper bound
itmx2 5 ! number of iterations for computing the integral and finding upper bound
foldcsi 5 ! number of folds on x integration
foldy 5 ! number of folds on y integration
foldphi 1 ! number of folds on phi integration
nubound 500000 ! number of bbarra calls to setup norm of upper bounding function
iymax 1 ! <= 10, normalization of upper bounding function in iunorm X iunorm square in y, log(m2qq)
ixmax 1 ! <= 10, normalization of upper bounding function in iunorm X iunorm square in y, log(m2qq)
xupbound 2 ! increase upper bound for radiation generation
bornktmin 0 ! (default 0d0) Generation cut: minimum kt in underlying Born
bornsuppfact 0 ! (default 0d0) Mass parameter for Born suppression factor. If < 0 suppfact = 1
storemintupb 0 ! store function calls in binary file for more precise generation
37 changes: 37 additions & 0 deletions MC/config/PWGGAJE/external/powheg/powheg_beauty_F2.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
! Random number generator initializing parameters
iseed 0 ! initialize random number sequence

! Heavy flavour production parameters
numevts 100000 ! number of events to be generated
ih1 1 ! hadron 1 type (1: proton; -1: antiproton)
ih2 1 ! hadron 2 type (1: proton; -1: antiproton)
!ndns1 131 ! pdf for hadron 1 (when using the hvqpdf package, hvqpdf numbering)
!ndns2 131 ! pdf for hadron 2 (when using the hvqpdf package, hvqpdf numbering)
lhans1 11000 ! pdf set for hadron 1 (LHAGLUE number) (11000 = CT10NLO, 10550 = CTEQ66)
lhans2 11000 ! pdf set for hadron 2 (LHAGLUE number) (11000 = CT10NLO, 10550 = CTEQ66)
ebeam1 6800 ! energy of beam 1 in GeV
ebeam2 6800 ! energy of beam 2 in GeV
qmass 4.75 ! mass of heavy quark in GeV
facscfact 2 ! factorization scale factor: mufact=muref*facscfact
renscfact 1 ! renormalization scale factor: muren=muref*renscfact
!fixedscale 1 ! use ref. scale=qmass (default 0, use running scale)

! Parameters to allow or not the use of stored data
use-old-grid 1 ! if 1 use old grid if file pwggrids.dat is present (# 1: regenerate)
use-old-ubound 1 ! if 1 use norm of upper bounding function stored in pwgubound.dat, if present; # 1: regenerate

! Parameters that control the grid for Born variables generation
ncall1 10000 ! number of calls for initializing the integration grid
itmx1 5 ! number of iterations for initializing the integration grid
ncall2 100000 ! number of calls for computing the integral and finding upper bound
itmx2 5 ! number of iterations for computing the integral and finding upper bound
foldcsi 5 ! number of folds on x integration
foldy 5 ! number of folds on y integration
foldphi 1 ! number of folds on phi integration
nubound 500000 ! number of bbarra calls to setup norm of upper bounding function
iymax 1 ! <= 10, normalization of upper bounding function in iunorm X iunorm square in y, log(m2qq)
ixmax 1 ! <= 10, normalization of upper bounding function in iunorm X iunorm square in y, log(m2qq)
xupbound 2 ! increase upper bound for radiation generation
bornktmin 0 ! (default 0d0) Generation cut: minimum kt in underlying Born
bornsuppfact 0 ! (default 0d0) Mass parameter for Born suppression factor. If < 0 suppfact = 1
storemintupb 0 ! store function calls in binary file for more precise generation
37 changes: 37 additions & 0 deletions MC/config/PWGGAJE/external/powheg/powheg_beauty_F2_R2.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
! Random number generator initializing parameters
iseed 0 ! initialize random number sequence

! Heavy flavour production parameters
numevts 100000 ! number of events to be generated
ih1 1 ! hadron 1 type (1: proton; -1: antiproton)
ih2 1 ! hadron 2 type (1: proton; -1: antiproton)
!ndns1 131 ! pdf for hadron 1 (when using the hvqpdf package, hvqpdf numbering)
!ndns2 131 ! pdf for hadron 2 (when using the hvqpdf package, hvqpdf numbering)
lhans1 11000 ! pdf set for hadron 1 (LHAGLUE number) (11000 = CT10NLO, 10550 = CTEQ66)
lhans2 11000 ! pdf set for hadron 2 (LHAGLUE number) (11000 = CT10NLO, 10550 = CTEQ66)
ebeam1 6800 ! energy of beam 1 in GeV
ebeam2 6800 ! energy of beam 2 in GeV
qmass 4.75 ! mass of heavy quark in GeV
facscfact 2 ! factorization scale factor: mufact=muref*facscfact
renscfact 2 ! renormalization scale factor: muren=muref*renscfact
!fixedscale 1 ! use ref. scale=qmass (default 0, use running scale)

! Parameters to allow or not the use of stored data
use-old-grid 1 ! if 1 use old grid if file pwggrids.dat is present (# 1: regenerate)
use-old-ubound 1 ! if 1 use norm of upper bounding function stored in pwgubound.dat, if present; # 1: regenerate

! Parameters that control the grid for Born variables generation
ncall1 10000 ! number of calls for initializing the integration grid
itmx1 5 ! number of iterations for initializing the integration grid
ncall2 100000 ! number of calls for computing the integral and finding upper bound
itmx2 5 ! number of iterations for computing the integral and finding upper bound
foldcsi 5 ! number of folds on x integration
foldy 5 ! number of folds on y integration
foldphi 1 ! number of folds on phi integration
nubound 500000 ! number of bbarra calls to setup norm of upper bounding function
iymax 1 ! <= 10, normalization of upper bounding function in iunorm X iunorm square in y, log(m2qq)
ixmax 1 ! <= 10, normalization of upper bounding function in iunorm X iunorm square in y, log(m2qq)
xupbound 2 ! increase upper bound for radiation generation
bornktmin 0 ! (default 0d0) Generation cut: minimum kt in underlying Born
bornsuppfact 0 ! (default 0d0) Mass parameter for Born suppression factor. If < 0 suppfact = 1
storemintupb 0 ! store function calls in binary file for more precise generation
37 changes: 37 additions & 0 deletions MC/config/PWGGAJE/external/powheg/powheg_beauty_MHigh.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
! Random number generator initializing parameters
iseed 0 ! initialize random number sequence

! Heavy flavour production parameters
numevts 100000 ! number of events to be generated
ih1 1 ! hadron 1 type (1: proton; -1: antiproton)
ih2 1 ! hadron 2 type (1: proton; -1: antiproton)
!ndns1 131 ! pdf for hadron 1 (when using the hvqpdf package, hvqpdf numbering)
!ndns2 131 ! pdf for hadron 2 (when using the hvqpdf package, hvqpdf numbering)
lhans1 11000 ! pdf set for hadron 1 (LHAGLUE number) (11000 = CT10NLO, 10550 = CTEQ66)
lhans2 11000 ! pdf set for hadron 2 (LHAGLUE number) (11000 = CT10NLO, 10550 = CTEQ66)
ebeam1 6800 ! energy of beam 1 in GeV
ebeam2 6800 ! energy of beam 2 in GeV
qmass 5.00 ! mass of heavy quark in GeV
facscfact 1 ! factorization scale factor: mufact=muref*facscfact
renscfact 1 ! renormalization scale factor: muren=muref*renscfact
!fixedscale 1 ! use ref. scale=qmass (default 0, use running scale)

! Parameters to allow or not the use of stored data
use-old-grid 1 ! if 1 use old grid if file pwggrids.dat is present (# 1: regenerate)
use-old-ubound 1 ! if 1 use norm of upper bounding function stored in pwgubound.dat, if present; # 1: regenerate

! Parameters that control the grid for Born variables generation
ncall1 10000 ! number of calls for initializing the integration grid
itmx1 5 ! number of iterations for initializing the integration grid
ncall2 100000 ! number of calls for computing the integral and finding upper bound
itmx2 5 ! number of iterations for computing the integral and finding upper bound
foldcsi 5 ! number of folds on x integration
foldy 5 ! number of folds on y integration
foldphi 1 ! number of folds on phi integration
nubound 500000 ! number of bbarra calls to setup norm of upper bounding function
iymax 1 ! <= 10, normalization of upper bounding function in iunorm X iunorm square in y, log(m2qq)
ixmax 1 ! <= 10, normalization of upper bounding function in iunorm X iunorm square in y, log(m2qq)
xupbound 2 ! increase upper bound for radiation generation
bornktmin 0 ! (default 0d0) Generation cut: minimum kt in underlying Born
bornsuppfact 0 ! (default 0d0) Mass parameter for Born suppression factor. If < 0 suppfact = 1
storemintupb 0 ! store function calls in binary file for more precise generation
37 changes: 37 additions & 0 deletions MC/config/PWGGAJE/external/powheg/powheg_beauty_MLow.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
! Random number generator initializing parameters
iseed 0 ! initialize random number sequence

! Heavy flavour production parameters
numevts 100000 ! number of events to be generated
ih1 1 ! hadron 1 type (1: proton; -1: antiproton)
ih2 1 ! hadron 2 type (1: proton; -1: antiproton)
!ndns1 131 ! pdf for hadron 1 (when using the hvqpdf package, hvqpdf numbering)
!ndns2 131 ! pdf for hadron 2 (when using the hvqpdf package, hvqpdf numbering)
lhans1 11000 ! pdf set for hadron 1 (LHAGLUE number) (11000 = CT10NLO, 10550 = CTEQ66)
lhans2 11000 ! pdf set for hadron 2 (LHAGLUE number) (11000 = CT10NLO, 10550 = CTEQ66)
ebeam1 6800 ! energy of beam 1 in GeV
ebeam2 6800 ! energy of beam 2 in GeV
qmass 4.50 ! mass of heavy quark in GeV
facscfact 1 ! factorization scale factor: mufact=muref*facscfact
renscfact 1 ! renormalization scale factor: muren=muref*renscfact
!fixedscale 1 ! use ref. scale=qmass (default 0, use running scale)

! Parameters to allow or not the use of stored data
use-old-grid 1 ! if 1 use old grid if file pwggrids.dat is present (# 1: regenerate)
use-old-ubound 1 ! if 1 use norm of upper bounding function stored in pwgubound.dat, if present; # 1: regenerate

! Parameters that control the grid for Born variables generation
ncall1 10000 ! number of calls for initializing the integration grid
itmx1 5 ! number of iterations for initializing the integration grid
ncall2 100000 ! number of calls for computing the integral and finding upper bound
itmx2 5 ! number of iterations for computing the integral and finding upper bound
foldcsi 5 ! number of folds on x integration
foldy 5 ! number of folds on y integration
foldphi 1 ! number of folds on phi integration
nubound 500000 ! number of bbarra calls to setup norm of upper bounding function
iymax 1 ! <= 10, normalization of upper bounding function in iunorm X iunorm square in y, log(m2qq)
ixmax 1 ! <= 10, normalization of upper bounding function in iunorm X iunorm square in y, log(m2qq)
xupbound 2 ! increase upper bound for radiation generation
bornktmin 0 ! (default 0d0) Generation cut: minimum kt in underlying Born
bornsuppfact 0 ! (default 0d0) Mass parameter for Born suppression factor. If < 0 suppfact = 1
storemintupb 0 ! store function calls in binary file for more precise generation
Loading