Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Run_BBCStudy.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Run_BBCStudy.C
1 //
2 // Runs FunAll module for BBC study
3 //
4 #include <TSystem.h>
5 #include <Fun4AllServer.h>
7 #include <recoConsts.h>
8 #include <BBCStudy.h>
9 #include <g4bbc/BbcDigitization.h>
10 
11 R__LOAD_LIBRARY(libg4bbc.so)
12 R__LOAD_LIBRARY(libBBCStudy.so)
13 
14 void Run_BBCStudy(int nEvents = 1000,
15  const char *dst_bbc_file = "DST_BBC_G4HIT_sHijing_0_20fm_50kHz_bkg_0_20fm-0000000040-00000.root",
16  const char *dst_truth_file = "DST_TRUTH_sHijing_0_20fm_50kHz_bkg_0_20fm-0000000040-00000.root",
17  const char *outFile = "outfile.root")
18 {
19  gSystem->Load("libfun4all");
20  gSystem->Load("libphg4hit.so");
21  gSystem->Load("libg4detectors.so");
22  gSystem->Load("libg4decayer.so");
23  gSystem->Load("libg4eval.so");
24  gSystem->Load("libg4bbc.so");
25  gSystem->Load("libg4bbc_io.so");
26 
28  //
29  //- recoConsts setup
30  //
33 
35  //
36  //- Make the Server
37  //
40  se->Verbosity(0);
41 
42  BbcDigitization *bbcg4reco = new BbcDigitization();
43  se->registerSubsystem( bbcg4reco );
44 
45  BBCStudy *ana = new BBCStudy();
46  //ana->set_flag( BBCStudy::TRUTH, true);
47  //ana->set_flag( BBCStudy::HIST, true);
48  //ana->set_flag( BBCStudy::SF, true);
49  //ana->set_flag( BBCStudy::ALL, true);
50  ana->set_savefile( outFile );
51  se->registerSubsystem( ana );
52 
54  //
55  //- Analyze the Data.
56  //
58 
59  Fun4AllInputManager *dst_bbc_in = new Fun4AllDstInputManager( "BBCStudyBBC", "DST", "TOP");
60  se->registerInputManager( dst_bbc_in );
61  se->fileopen( dst_bbc_in->Name(), dst_bbc_file );
62  //you can put a list of files as well
63  //dstin->AddListFile( input_file );
64  Fun4AllInputManager *dst_truth_in = new Fun4AllDstInputManager( "BBCStudyTruth", "DST", "TOP");
65  se->registerInputManager( dst_truth_in );
66  se->fileopen( dst_truth_in->Name(), dst_truth_file );
67 
68  se->run(nEvents);
69  se->End();
70  delete se;
71 }