Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:21:37

0001 #ifndef MACRO_RUNBOTH_C
0002 #define MACRO_RUNBOTH_C
0003 
0004 // here you need your package name (set in configure.ac)
0005 #include <mytree/AnalyzeSimpleTree.h>
0006 #include <mytree/MakeSimpleTree.h>
0007 
0008 #include <fun4all/SubsysReco.h>
0009 #include <fun4all/Fun4AllServer.h>
0010 #include <fun4all/Fun4AllInputManager.h>
0011 #include <fun4all/Fun4AllDummyInputManager.h>
0012 
0013 #include <phool/recoConsts.h>
0014 
0015 
0016 R__LOAD_LIBRARY(libfun4all.so)
0017 R__LOAD_LIBRARY(libmytree.so)
0018 
0019 void  RunBoth()
0020 {
0021   Fun4AllServer *se = Fun4AllServer::instance();
0022   // since it doesn't matter we use a dummy input manager which just
0023   // drives the event loop with a runnumber of 310000
0024   recoConsts *rc = recoConsts::instance();
0025     rc->set_IntFlag( "RUNNUMBER", 310000);
0026   Fun4AllInputManager *in = new Fun4AllDummyInputManager( "DSTin");
0027   se->registerInputManager( in );
0028   // make my ttree
0029   SubsysReco *mytree = new MakeSimpleTree("MYTREE");
0030   se->registerSubsystem(mytree);
0031   // and analyze it in the same process
0032   SubsysReco *myana = new AnalyzeSimpleTree();
0033   se->registerSubsystem(myana);
0034 
0035   se->run(100);
0036   se->End();
0037   se->dumpHistos();
0038   delete se;
0039 }
0040 
0041 #endif