Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-08-30 08:16:11

0001 // Fun4All_HerwigUE.C
0002 //
0003 // Run the HERWIG (Nashville) vs STAR UE cross-check over sPHENIX
0004 // generator-level DSTs containing PHHepMCGenEventMap.
0005 //
0006 //   root -b -q 'Fun4All_HerwigUE.C("herwig_dst.list","herwig_ue_check.root",0)'
0007 //
0008 // filelist: text file with one DST path per line
0009 // nevents : 0 = all
0010 
0011 #include <fun4all/Fun4AllBase.h>
0012 #include <fun4all/Fun4AllUtils.h>
0013 #include <fun4all/Fun4AllServer.h>
0014 #include <fun4all/Fun4AllInputManager.h>
0015 #include <fun4all/Fun4AllDstInputManager.h>
0016 #include <fun4all/SubsysReco.h>
0017 #include <ffamodules/CDBInterface.h>
0018 
0019 #include <phool/recoConsts.h>
0020 
0021 
0022 #include <herwigstaruecheck/HerwigSTARUECheck.h>
0023 
0024 R__LOAD_LIBRARY(libfun4all.so)
0025 R__LOAD_LIBRARY(libfun4allraw.so)
0026 R__LOAD_LIBRARY(libffamodules.so)
0027 R__LOAD_LIBRARY(libphool.so)
0028 R__LOAD_LIBRARY(libHerwigSTARUECheck.so)
0029 
0030 void Fun4All_HerwigUE(const int nevents = -1,
0031                       const std::string &filelist = "herwig_dst.list",
0032                       const std::string &outfile = "herwig_ue_check.root")
0033 {
0034   Fun4AllServer *se = Fun4AllServer::instance();
0035   se->Verbosity(1);
0036 
0037   auto rc = recoConsts::instance();
0038   rc->set_StringFlag("CDB_GLOBALTAG", "MDC2");
0039   rc->set_uint64Flag("TIMESTAMP", 0);
0040   CDBInterface::instance()->Verbosity(0);
0041 
0042   std::string simSample = filelist.substr(filelist.find("/")+1, filelist.find("_") - (filelist.find("/")+1));
0043   if(simSample.rfind("Pythia",0) == 0)
0044   {
0045     simSample = simSample.substr(6);
0046   }
0047   std::cout << "simSample: " << simSample << std::endl;
0048 
0049   HerwigSTARUECheck *ana = new HerwigSTARUECheck("HerwigSTARUECheck", outfile);
0050   // STAR PRD 101, 052004 defaults are already set; example variations:
0051   // ana->set_include_neutrinos(false);
0052   // ana->set_embedding_id(0);
0053   ana->SetSimSample(simSample);
0054   ana->useCSWeights(true);
0055   se->registerSubsystem(ana);
0056 
0057   Fun4AllDstInputManager *in = new Fun4AllDstInputManager("DSTin");
0058   in->AddListFile(filelist);
0059   se->registerInputManager(in);
0060 
0061   se->run(nevents);
0062   se->End();
0063 
0064   delete se;
0065   gSystem->Exit(0);
0066 }