File indexing completed on 2026-08-31 08:14:22
0001
0002
0003
0004
0005
0006 #include <TSystem.h>
0007 #include <fun4all/Fun4AllInputManager.h>
0008 #include <fun4all/Fun4AllServer.h>
0009 #include <nodedump/Dumper.h>
0010 #include <phhepmc/Fun4AllHepMCInputManager.h>
0011
0012 R__LOAD_LIBRARY(libfun4all.so)
0013 R__LOAD_LIBRARY(libphhepmc.so)
0014 R__LOAD_LIBRARY(libphnodedump.so)
0015
0016 void Fun4All_HepMCReadTest(
0017 const std::string &infile = "/sphenix/user/hjheng/sPHENIXRepo/generator_OO200GeV/Pythia_Angantyr/pythia8317/examples/test.hepmc",
0018 const int nEvents = 10
0019 )
0020 {
0021 Fun4AllServer *se = Fun4AllServer::instance();
0022 se->Verbosity(INT_MAX);
0023
0024
0025
0026 Fun4AllHepMCInputManager *in = new Fun4AllHepMCInputManager("HEPMCin");
0027 in->Verbosity(2);
0028 in->AddFile(infile);
0029 se->registerInputManager(in);
0030
0031
0032
0033 Dumper *dumper = new Dumper("HEPMCDUMP");
0034 dumper->Select("PHHepMCGenEventMap");
0035 dumper->SetOutDir(".");
0036 se->registerSubsystem(dumper);
0037
0038 se->run(nEvents);
0039 se->End();
0040 delete se;
0041
0042 std::cout << "Fun4All_HepMCReadTest: done." << std::endl;
0043
0044 gSystem->Exit(0);
0045 }