File indexing completed on 2025-08-05 08:11:06
0001
0002
0003
0004 #include <TSystem.h>
0005 #include <Fun4AllServer.h>
0006 #include <Fun4AllDstInputManager.h>
0007 #include <recoConsts.h>
0008 #include <BBCStudy.h>
0009 #include <g4bbc/BbcDigitization.h>
0010
0011 R__LOAD_LIBRARY(libg4bbc.so)
0012 R__LOAD_LIBRARY(libBBCStudy.so)
0013
0014 void Run_BBCStudy(int nEvents = 1000,
0015 const char *dst_bbc_file = "DST_BBC_G4HIT_sHijing_0_20fm_50kHz_bkg_0_20fm-0000000040-00000.root",
0016 const char *dst_truth_file = "DST_TRUTH_sHijing_0_20fm_50kHz_bkg_0_20fm-0000000040-00000.root",
0017 const char *outFile = "outfile.root")
0018 {
0019 gSystem->Load("libfun4all");
0020 gSystem->Load("libphg4hit.so");
0021 gSystem->Load("libg4detectors.so");
0022 gSystem->Load("libg4decayer.so");
0023 gSystem->Load("libg4eval.so");
0024 gSystem->Load("libg4bbc.so");
0025 gSystem->Load("libg4bbc_io.so");
0026
0027
0028
0029
0030
0031
0032 recoConsts *rc = recoConsts::instance();
0033
0034
0035
0036
0037
0038
0039 Fun4AllServer *se = Fun4AllServer::instance();
0040 se->Verbosity(0);
0041
0042 BbcDigitization *bbcg4reco = new BbcDigitization();
0043 se->registerSubsystem( bbcg4reco );
0044
0045 BBCStudy *ana = new BBCStudy();
0046
0047
0048
0049
0050 ana->set_savefile( outFile );
0051 se->registerSubsystem( ana );
0052
0053
0054
0055
0056
0057
0058
0059 Fun4AllInputManager *dst_bbc_in = new Fun4AllDstInputManager( "BBCStudyBBC", "DST", "TOP");
0060 se->registerInputManager( dst_bbc_in );
0061 se->fileopen( dst_bbc_in->Name(), dst_bbc_file );
0062
0063
0064 Fun4AllInputManager *dst_truth_in = new Fun4AllDstInputManager( "BBCStudyTruth", "DST", "TOP");
0065 se->registerInputManager( dst_truth_in );
0066 se->fileopen( dst_truth_in->Name(), dst_truth_file );
0067
0068 se->run(nEvents);
0069 se->End();
0070 delete se;
0071 }