EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RunEval.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RunEval.C
1 #include <eicqa_modules/EvalRootTTreeReco.h>
2 
8 
9 R__LOAD_LIBRARY(libfun4all.so)
10 R__LOAD_LIBRARY(libeicqa_modules.so)
11 
12 void RunEval(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 + "/Eval_" + detector + ".root";
16  std::string outnode = "EvalTTree_" + detector;
19  eval->Detector(detector);
20  eval->DropHits(); // comment if you want to store hits (takes a lot of space)
21  se->registerSubsystem(eval);
23  in->fileopen(fname);
24  se->registerInputManager(in);
25  Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", outfile);
26  out->AddNode(outnode);
27  out->SaveRunNode(0);
28  se->registerOutputManager(out);
29  if (nevnt < 0)
30  {
31  return;
32  }
33  se->run(nevnt);
34  se->End();
35  delete se;
36  gSystem->Exit(0);
37 }