Skip to content

Instantly share code, notes, and snippets.

@pgjones
Created September 9, 2013 13:53
Show Gist options
  • Save pgjones/6495876 to your computer and use it in GitHub Desktop.
Save pgjones/6495876 to your computer and use it in GitHub Desktop.
Load the ratdb in root. .L RatDB.cc+ RatDB();
#include <RAT/DB.hh>
#include <RAT/Log.hh>
#include <iostream>
using namespace std;
void RatDB()
{
RAT::Log::Init("/dev/null");
RAT::DB* db = RAT::DB::Get();
assert(db);
char* glg4data = getenv("GLG4DATA");
if (glg4data == static_cast<char*>(NULL)) {
std::cerr << "ratzdab::ratdb: Environment variable $GLG4DATA must be set" << std::endl;
assert(glg4data);
}
std::string data = std::string(glg4data);
assert(data != "");
db->LoadDefaults();
cout << db->GetLink( "PMT", "r1408" )->GetS( "photocathode_surface" ) << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment