Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #pragma once
0002 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
0003 #include <fun4all/SubsysReco.h>
0004 #include <fun4all/Fun4AllServer.h>
0005 #include <fun4all/Fun4AllInputManager.h>
0006 #include <fun4all/Fun4AllDstInputManager.h>
0007 
0008 #include <fun4all/Fun4AllDstOutputManager.h>
0009 #include <fun4all/Fun4AllOutputManager.h>
0010 #include <fun4all/Fun4AllServer.h>
0011 
0012 #include <phool/PHRandomSeed.h>
0013 #include <phool/recoConsts.h>
0014 
0015 #include <boost/algorithm/string/predicate.hpp>
0016 
0017 #include <hbcup/AnaUPC.h>
0018 
0019 R__LOAD_LIBRARY(libfun4all.so)
0020 R__LOAD_LIBRARY(libhbcup.so)
0021 R__LOAD_LIBRARY(libg4dst.so)
0022 
0023 #endif
0024 
0025 
0026 void Fun4All_hijbkg(const int nEvents = 0, const std::string& input_fname = "DST_TRACKS_sHijing_0_20fm_50kHz_bkg_0_20fm-0000000019-00000.root", const std::string& sysName = "ANAUPC_HIJBKG")
0027 {
0028 
0029   Fun4AllServer *se = Fun4AllServer::instance();
0030   se->Verbosity(0);
0031 
0032   recoConsts *rc = recoConsts::instance();
0033   //rc->set_IntFlag("RUNNUMBER",62);
0034 
0035   std::string outfname = std::regex_replace(input_fname,regex("DST_TRACKS"),"anaupc");
0036   AnaUPC *anaupc = new AnaUPC("anaupc", outfname);
0037   anaupc->Verbosity(0);
0038   anaupc->analyzeTracks(true);
0039   //anaupc->analyzeClusters(true);
0040   anaupc->analyzeTruth(true);
0041   se->registerSubsystem(anaupc);
0042 
0043   // DST_TRACK
0044   Fun4AllInputManager *in1 = new Fun4AllDstInputManager("DSTin1");
0045 
0046   // DST_TRUTH
0047   Fun4AllInputManager *in2 = new Fun4AllDstInputManager("DSTin2");
0048 
0049   if (boost::algorithm::ends_with(input_fname, ".root"))
0050   {
0051     in1->AddFile( input_fname );
0052     std::string dst_fname2 = std::regex_replace(input_fname,regex("DST_TRACKS"),"DST_TRUTH");
0053     in2->AddFile( dst_fname2 );
0054   }
0055   else if (boost::algorithm::ends_with(input_fname, ".list"))
0056   {
0057     in1->AddListFile( input_fname );
0058     std::string list_fname2 = std::regex_replace(input_fname,regex("dst_tracks"),"dst_truth");
0059     in2->AddListFile( list_fname2 );
0060   }
0061   else
0062   {
0063     std::cerr << "ERROR, unknown file type " << input_fname << std::endl;
0064     gSystem->Exit( 0 );
0065   }
0066 
0067 
0068   se->registerInputManager( in1 );
0069   se->registerInputManager( in2 );
0070   se->run( nEvents );
0071   se->End();
0072   std::cout << "All done!" << endl;
0073   gSystem->Exit( 0 );
0074   
0075 }