Created
October 15, 2013 11:52
-
-
Save pgjones/6990400 to your computer and use it in GitHub Desktop.
Open the RATDB and extract PMT positions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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