1111// Ditto event generator
1212class 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