Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:13:28

0001 #ifndef MACRO_FUN4ALLMYSIMPLERECO_C
0002 #define MACRO_FUN4ALLMYSIMPLERECO_C
0003 
0004 #include <fun4all/Fun4AllServer.h>
0005 #include <fun4all/Fun4AllInputManager.h>
0006 #include <fun4all/Fun4AllDstInputManager.h>
0007 
0008 #include <waveform/WaveForm.h>
0009 
0010 R__LOAD_LIBRARY(libfun4all.so)
0011 R__LOAD_LIBRARY(libWaveForm.so)
0012 
0013 void Fun4All_WaveForm(const int nEvents = 3, const std::string &infile = "/sphenix/tg/tg01/commissioning/CaloCalibWG/sli/2024data/condor44060/condorout/OutDir7/DST_CALOR-00044060-0007.root")
0014 {
0015   ///////////////////////////////////////////
0016   // Make the Server
0017   //////////////////////////////////////////
0018   gSystem->Load("libg4dst.so");
0019   Fun4AllServer *se = Fun4AllServer::instance();
0020   WaveForm *myreco = new WaveForm();
0021   se->registerSubsystem(myreco);
0022 // this (dummy) input manager just drives the event loop
0023   Fun4AllInputManager *in = new Fun4AllDstInputManager("DSTin");
0024   in->AddFile(infile);
0025   in->Verbosity(1);
0026   se->registerInputManager( in );
0027 // events = 0 => run till end of input file
0028   if (nEvents <= 0)
0029   {
0030     return;
0031   }
0032   cout << endl << "Running over " << nEvents << " Events" << endl;
0033   se->run(nEvents);
0034   cout << endl << "Calling End in Fun4All_WaveForm.C" << endl;
0035   se->End();
0036   cout << endl << "All done, calling delete Fun4AllServer" << endl;
0037   delete se;
0038   cout << endl << "gSystem->Exit(0)" << endl;
0039   gSystem->Exit(0);
0040 }
0041 
0042 #endif // MACRO_FUN4ALLMYSIMPLERECO_C