Skip to content

Commit e731750

Browse files
committed
Add Ditto with injection
1 parent 671612e commit e731750

6 files changed

Lines changed: 25 additions & 12 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#---> pythia8_pp_136tev
22
[GeneratorExternal]
33
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator_DittoMC.C
4-
funcName=generator_DittoMC("https://github.com/njacazio/DittoMC/releases/download/v1.0.0/Ditto_tune_pythia8_OO_536.root")
4+
funcName=generator_DittoMC("https://github.com/njacazio/DittoMC/releases/download/v1.0.1/Ditto_tune_pythia8_OO_536.root")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#---> pythia8_pp_136tev
22
[GeneratorExternal]
33
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator_DittoMC.C
4-
funcName=generator_DittoMC("https://github.com/njacazio/DittoMC/releases/download/v1.0.0/Ditto_tune_pythia8_PbPb_536tev.root")
4+
funcName=generator_DittoMC("https://github.com/njacazio/DittoMC/releases/download/v1.0.1/Ditto_tune_pythia8_PbPb_536tev.root")
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#---> pythia8_pp_136tev
2+
[GeneratorExternal]
3+
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator_DittoMC.C
4+
funcName=generator_DittoMC("https://github.com/njacazio/DittoMC/releases/download/v1.0.1/Ditto_tune_pythia8_PbPb_536tev.root", "https://github.com/njacazio/DittoMC/releases/download/v1.0.1/signal_pbpb.root")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#---> pythia8_pp_136tev
22
[GeneratorExternal]
33
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator_DittoMC.C
4-
funcName=generator_DittoMC("https://github.com/njacazio/DittoMC/releases/download/v1.0.0/Ditto_tune_pythia8_inel_136tev.root")
4+
funcName=generator_DittoMC("https://github.com/njacazio/DittoMC/releases/download/v1.0.1/Ditto_tune_pythia8_inel_136tev.root")
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#---> pythia8_pp_136tev
2+
[GeneratorExternal]
3+
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator_DittoMC.C
4+
funcName=generator_DittoMC("https://github.com/njacazio/DittoMC/releases/download/v1.0.1/Ditto_tune_pythia8_inel_136tev.root", "https://github.com/njacazio/DittoMC/releases/download/v1.0.1/signal.root")

‎MC/config/ALICE3/pythia8/generator_DittoMC.C‎

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
// Ditto event generator
1212
class GeneratorDittoMC : public o2::eventgen::GeneratorPythia8
1313
{
14-
public:
14+
public:
1515
/// Constructor
16-
explicit GeneratorDittoMC(const TString& tuneFile) : mGenerator(makeConfig(tuneFile))
16+
explicit GeneratorDittoMC(const TString &tuneFile, const TString &signalFile) : mGenerator(makeConfig(tuneFile, signalFile))
1717
{
1818
// We use the Pythia8 event only as the container passed to the O2
1919
// GeneratorPythia8 machinery. Particle production is handled by Ditto.
@@ -31,22 +31,27 @@ class GeneratorDittoMC : public o2::eventgen::GeneratorPythia8
3131
/// Destructor
3232
~GeneratorDittoMC() override = default;
3333

34-
private:
34+
private:
3535
/// Build the Ditto runtime configuration.
36-
static Ditto::Config makeConfig(const TString& tuneFile)
36+
static Ditto::Config makeConfig(const TString &tuneFile, const TString &signalFile)
3737
{
38-
if (tuneFile.IsNull()) {
38+
if (tuneFile.IsNull())
39+
{
3940
throw std::runtime_error("Ditto tune file must be specified");
4041
}
4142

4243
Ditto::Config config;
4344
config.mTuneFile = tuneFile.Data();
45+
config.mSignalFile = signalFile.Data();
4446

4547
// Use the Grid process ID as the Ditto seed when available.
4648
// Outside the Grid, seed 0 is used.
47-
if (const char* alienProcId = std::getenv("ALIEN_PROC_ID")) {
49+
if (const char *alienProcId = std::getenv("ALIEN_PROC_ID"))
50+
{
4851
config.mSeed = static_cast<std::uint64_t>(std::strtoull(alienProcId, nullptr, 10));
49-
} else {
52+
}
53+
else
54+
{
5055
config.mSeed = static_cast<std::uint64_t>(std::time(nullptr));
5156
}
5257

@@ -58,7 +63,7 @@ class GeneratorDittoMC : public o2::eventgen::GeneratorPythia8
5863
Ditto::Generator mGenerator;
5964
};
6065

61-
FairGenerator* generator_DittoMC(const TString& tuneFile)
66+
FairGenerator *generator_DittoMC(const TString &tuneFile, const TString &signalFile = "")
6267
{
63-
return new GeneratorDittoMC(tuneFile);
68+
return new GeneratorDittoMC(tuneFile, signalFile);
6469
}

0 commit comments

Comments
 (0)