Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Run_BbcCheck.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Run_BbcCheck.C
1 //
2 // Runs module for BBC study
3 //
4 #include <TSystem.h>
5 #include <Fun4AllServer.h>
7 #include <recoConsts.h>
8 #include "BbcCheck.h"
9 //#include "get_runstr.h"
10 
11 #if defined(__CLING__)
12 R__LOAD_LIBRARY(libmbd_io.so)
13 R__LOAD_LIBRARY(libcalo_io.so)
14 R__LOAD_LIBRARY(libglobalvertex_io.so)
15 R__LOAD_LIBRARY(libBBCStudy.so)
16 #endif
17 
18 void Run_BbcCheck(int nEvents = 1000,
19  const char *dst_bbc_file = "DST_BBC_G4HIT_sHijing_0_20fm_50kHz_bkg_0_20fm-0000000040-00000.root",
20  const char *outFile = "outfile.root")
21 {
22 #ifdef __CINT__
23  gSystem->Load("libfun4all");
24  gSystem->Load("libmbd_io.so");
25  gSystem->Load("libglobalvertex_io.so");
26  cout << "CINT" << endl;
27 #endif
28 
30  //
31  //- recoConsts setup
32  //
35  /*
36  int run = get_runnumber(dst_bbc_file);
37  cout << run << endl;
38  rc->set_IntFlag("RUNNUMBER",run);
39  */
40 
42  //
43  //- Make the Server
44  //
47  se->Verbosity(0);
48 
49  BbcCheck *ana = new BbcCheck();
50  ana->set_savefile( outFile );
51  se->registerSubsystem( ana );
52 
54  //
55  //- Analyze the Data.
56  //
58 
59  Fun4AllInputManager *dst_bbc_in = new Fun4AllDstInputManager( "BBCCHECK", "DST", "TOP");
60  se->registerInputManager( dst_bbc_in );
61 
62  TString dst_bbc_fname = dst_bbc_file;
63  if ( dst_bbc_fname.EndsWith(".root") )
64  {
65  dst_bbc_in->AddFile( dst_bbc_file );
66  }
67  else
68  {
69  //you can put a list of files as well
70  cout << "Using list file " << dst_bbc_file << endl;
71  dst_bbc_in->AddListFile( dst_bbc_file );
72  }
73 
74  se->run(nEvents);
75  se->End();
76  delete se;
77 }