File indexing completed on 2025-08-03 08:12:25
0001 int Fun4All_Pythia6(
0002 const int nEvents = 30,
0003 const char * pythiaConfigFile = "./config/phpythia6_ep_DISneutral.cfg",
0004 const char * outputFile = "DST_p250_e20_1seed_DISneutral.root"
0005 )
0006 {
0007
0008 bool runpythia6 = true;
0009
0010 bool writedst = false;
0011 bool writeascii = true;
0012
0013
0014
0015
0016
0017 gSystem->Load("libfun4all.so");
0018 gSystem->Load("libphhepmc.so");
0019 gSystem->Load("libeicana.so");
0020
0021
0022
0023
0024
0025 Fun4AllServer *se = Fun4AllServer::instance();
0026 se->Verbosity(0);
0027
0028
0029 recoConsts *rc = recoConsts::instance();
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 rc->set_FloatFlag("WorldSizex",1000);
0041 rc->set_FloatFlag("WorldSizey",1000);
0042 rc->set_FloatFlag("WorldSizez",1000);
0043 rc->set_CharFlag("WorldShape","G4Tubs");
0044
0045
0046
0047
0048
0049 if (runpythia6)
0050 {
0051 gSystem->Load("libPHPythia6.so");
0052
0053 PHPythia6 *pythia6 = new PHPythia6();
0054 pythia6->set_config_file(pythiaConfigFile);
0055
0056 PHPy6ParticleTrigger *trigger = new PHPy6ParticleTrigger();
0057
0058 trigger->SetQ2Min(1000.0);
0059
0060 pythia6->register_trigger(trigger);
0061
0062 se->registerSubsystem(pythia6);
0063 }
0064
0065
0066 DISKinematics *mcana = new DISKinematics(outputFile);
0067 se->registerSubsystem( mcana );
0068
0069
0070
0071
0072
0073
0074
0075 if ( writedst )
0076 {
0077 Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT",outputFile);
0078 se->registerOutputManager(out);
0079 }
0080
0081
0082 else if ( writeascii )
0083 {
0084 Fun4AllHepMCOutputManager *asciiout = new Fun4AllHepMCOutputManager("HEPMCOUT",outputFile);
0085 se->registerOutputManager(asciiout);
0086 }
0087
0088
0089
0090
0091 if (nEvents < 0)
0092 {
0093 return;
0094 }
0095
0096 if (nEvents == 0 && !readhits && !readhepmc)
0097 {
0098 cout << "using 0 for number of events is a bad idea when using particle generators" << endl;
0099 cout << "it will run forever, so I just return without running anything" << endl;
0100 return;
0101 }
0102
0103 se->run(nEvents);
0104
0105
0106
0107
0108
0109 se->End();
0110 std::cout << "All done" << std::endl;
0111 delete se;
0112 gSystem->Exit(0);
0113 }