File indexing completed on 2025-08-03 08:18:53
0001 #ifndef MACRO_FUN4ALLREADDST_C
0002 #define MACRO_FUN4ALLREADDST_C
0003
0004 #include <g4histos/G4HitNtuple.h>
0005
0006 #include <fun4all/Fun4AllDstInputManager.h>
0007 #include <fun4all/Fun4AllDstOutputManager.h>
0008 #include <fun4all/Fun4AllDummyInputManager.h>
0009 #include <fun4all/Fun4AllInputManager.h>
0010 #include <fun4all/Fun4AllOutputManager.h>
0011 #include <fun4all/Fun4AllServer.h>
0012 #include <fun4all/SubsysReco.h>
0013
0014 #include <phool/recoConsts.h>
0015
0016 R__LOAD_LIBRARY(libfun4all.so)
0017 R__LOAD_LIBRARY(libg4testbench.so)
0018 R__LOAD_LIBRARY(libg4histos.so)
0019
0020 void Fun4All_Read_Dst(int nEvents = 1)
0021 {
0022
0023
0024
0025 Fun4AllServer *se = Fun4AllServer::instance();
0026 recoConsts *rc = recoConsts::instance();
0027
0028
0029
0030
0031 G4HitNtuple *hits = new G4HitNtuple("Hits", "HitsFromDst.root");
0032 hits->AddNode("HoleInBox", 0);
0033 se->registerSubsystem(hits);
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044 Fun4AllInputManager *in = new Fun4AllDstInputManager("DSTin");
0045 in->fileopen("G4Example01.root");
0046 se->registerInputManager(in);
0047
0048 if (nEvents < 0)
0049 {
0050 return 0;
0051 }
0052 se->run(nEvents);
0053 se->End();
0054 std::cout << "All done" << std::endl;
0055 delete se;
0056 gSystem->Exit(0);
0057 }
0058
0059 #endif