Beispiel #1
0
void change_prompt()
{
    TRint* rint = dynamic_cast<TRint*>(gApplication);
    if (!rint) return;

    rint->SetPrompt("genie [%d] ");
}
Beispiel #2
0
int main(int argc, char** argv)
{
   KVBase::InitEnvironment();
   TRint* myapp = new TRint("kaliveda", &argc, argv, NULL, 0);
   myapp->SetPrompt("kaliveda [%d] ");
   myapp->Run();
   return 0;
}
Beispiel #3
0
void load_libs(bool MustClean = true) {
  // All the CINT exception handler does is obfuscate the stack. With this,
  // uncaught exceptions immediately show a useful backtrace under gdb.
  //  G__SetCatchException(0);

  gSystem->SetAclicMode(TSystem::kOpt);

  // This magic incantation prevents ROOT doing slow cleanup work in
  // TList::RecursiveRemove() under ~TH1(). It also tends to lead to shutdown
  // crashes. HistCache now avoids almost all of that histogram destruction, so
  // now we can leave this at the default setting and get both speed and
  // stability.
  std::cout << "gROOT->SetMustClean(" << (MustClean ? "true" : "false") << ");"
            << std::endl;
  gROOT->SetMustClean(MustClean);

  // Colorize error messages. Would be better if we could just pick up the
  // flags novasoft uses, but they don't seem to be in any env var.
  gSystem->SetFlagsDebug(
      TString(gSystem->GetFlagsDebug()) +
      " -fdiagnostics-color=auto -DDONT_USE_FQ_HARDCODED_SYST_PATHS=1");
  gSystem->SetFlagsOpt(
      TString(gSystem->GetFlagsOpt()) +
      " -fdiagnostics-color=auto -UNDEBUG "
      "-DDONT_USE_FQ_HARDCODED_SYST_PATHS=1"); // match gcc's maxopt behaviour
                                               // of retaining assert()

  // Include path
  TString includes = "-I$ROOTSYS/include -I$CAFANA/include";

  const std::vector<std::string> libs = {
      "Minuit2",          "Net",           "StandardRecord", "OscLibFunc",
      "UtilitiesFunc",    "CAFAnaCore",    "CAFAnaVars",     "CAFAnaCuts",
      "CAFAnaExperiment", "CAFAnaSysts",   "CAFAnaDecomp",   "CAFAnaExtrap",
      "CAFAnaPrediction", "CAFAnaAnalysis"};

  // Actually load the libraries
  std::cout << "Loading libraries:" << std::endl;
  for (const std::string &lib : libs)
    load(lib);
  std::cout << std::endl;

  // Magic incantation to get Reflex-based dictionaries converted into the
  // CINT-based information that ROOT needs
  //  Cintex::Enable();

  gSystem->SetIncludePath(includes);

  // Pick up standard NOvA style
  gROOT->Macro("$CAFANA/include/Utilities/rootlogon.C");
  gROOT->ForceStyle();

  TRint *rint = dynamic_cast<TRint *>(gApplication);
  if (rint) {
    rint->SetPrompt("cafe [%d] ");
  }
}