sphenix-software-l AT lists.bnl.gov
Subject: sPHENIX discussion of software
List archive
[Sphenix-software-l] calibrations files now installed under $OFFLINE_MAIN/share/calibrations
- From: pinkenburg <pinkenburg AT bnl.gov>
- To: "sphenix-software-l AT lists.bnl.gov" <sphenix-software-l AT lists.bnl.gov>
- Subject: [Sphenix-software-l] calibrations files now installed under $OFFLINE_MAIN/share/calibrations
- Date: Thu, 6 Aug 2015 20:22:10 -0400
Hi folks,
I finally got around changing our build script to copy the calibrations files in our calibrations git repository into afs as part of the daily rebuild. Instead of having to read them from some hardcoded disk you can get to them under
$OFFLINE_MAIN/share/calibrations/<path in git>
e.g.
CrystalCalorimeter/mapping/crystals_v002.txt
in your code you can construct the filename and open it like:
#include <iostream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <fstream>
using namespace std;
int main()
{
ostringstream filename;
filename << getenv("OFFLINE_MAIN") << "/share/calibrations/CrystalCalorimeter/mapping/crystals_v002.txt";
ifstream infile;
infile.open(filename.str().c_str(), ios_base::in);
string str;
while(getline(infile,str))
{
cout << str << endl;
}
infile.close();
}
Chris
--
*************************************************************
Christopher H. Pinkenburg ; pinkenburg AT bnl.gov
; http://www.phenix.bnl.gov/~pinkenbu
Brookhaven National Laboratory ; phone: (631) 344-5692
Physics Department Bldg 510 C ; fax: (631) 344-3253
Upton, NY 11973-5000
*************************************************************
- [Sphenix-software-l] calibrations files now installed under $OFFLINE_MAIN/share/calibrations, pinkenburg, 08/06/2015
Archive powered by MHonArc 2.6.24.