Skip to content

Instantly share code, notes, and snippets.

@pgjones
Created October 15, 2013 11:52
Show Gist options
  • Save pgjones/6990400 to your computer and use it in GitHub Desktop.
Save pgjones/6990400 to your computer and use it in GitHub Desktop.
Open the RATDB and extract PMT positions
#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);
string data = getenv("GLG4DATA");
assert(data != "");
db->LoadDefaults();
db->Load(data + "/pmt/airfill2.ratdb"); // Choose this file carefully.
RAT::DBLinkPtr pmtInfo = db->GetLink("PMTINFO");
assert(pmtInfo);
vector<double> xPos = pmtInfo->GetDArray("x");
vector<double> yPos = pmtInfo->GetDArray("y");
vector<double> zPos = pmtInfo->GetDArray("z");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment