EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RunSampling.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RunSampling.C
1 #include <eicqa_modules/SamplingFractionReco.h>
2 
8 
9 R__LOAD_LIBRARY(libfun4all.so)
10 R__LOAD_LIBRARY(libeicqa_modules.so)
11 
12 void RunSampling(const std::string &detector, const std::string &fname, const int nevnt = 0, const std::string &outdir = ".")
13 {
14  gSystem->Load("libg4dst");
15  std::string outfile = outdir + "/SF_" + detector + ".root";
17 
18  SamplingFractionReco *sf = new SamplingFractionReco("SF",outfile);
19  sf->Detector(detector);
20  sf->add_support_eloss();
21  se->registerSubsystem(sf);
23  in->fileopen(fname);
24  se->registerInputManager(in);
25  if (nevnt < 0)
26  {
27  return;
28  }
29  se->run(nevnt);
30  se->End();
31  delete se;
32  gSystem->Exit(0);
33 }