Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:12:40

0001 #include <fun4all/Fun4AllDstInputManager.h>
0002 #include <fun4all/Fun4AllInputManager.h>
0003 #include <fun4all/Fun4AllServer.h>
0004 #include <fun4all/SubsysReco.h>
0005 
0006 #include <TSystem.h>
0007 
0008 #include <hbcup/UPCTrigStudy.h>
0009 
0010 R__LOAD_LIBRARY(libhbcup.so)
0011 R__LOAD_LIBRARY(libfun4all.so)
0012 
0013 //! Simple macro to readback previous generated simulation DSTs to analyze with `UPCTrigStudy`
0014 void Fun4All_UPCTrigStudy(const int nevnt = 0, const std::string & inputfile = "DST_sPHENIX.root")
0015 {
0016   gSystem->Load("libg4dst");
0017   Fun4AllServer *se = Fun4AllServer::instance();
0018 
0019   UPCTrigStudy *upctrigstudy = new UPCTrigStudy("upctrigstudy", "upctrig_" + inputfile);
0020   upctrigstudy->Verbosity(0);
0021   se->registerSubsystem(upctrigstudy);
0022 
0023   Fun4AllInputManager *in = new Fun4AllDstInputManager("DSTin");
0024 
0025   if ( inputfile.substr(inputfile.size()-5,inputfile.size()-1) == ".root" )
0026   {
0027     in->AddFile(inputfile);
0028   }
0029   else if ( inputfile.substr(inputfile.size()-5,inputfile.size()-1) == ".list" )
0030   {
0031     in->AddListFile(inputfile);
0032   }
0033   se->registerInputManager(in);
0034 
0035   se->run(nevnt);
0036   se->End();
0037   delete se;
0038 
0039   cout <<"All done. Exiting..."<<endl;
0040 
0041   gSystem->Exit(0);
0042 }