#include <string>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <limits>
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
| Auxiliary program to convert PMT QE(angle) data. More...
|
|
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Auxiliary program to convert PMT QE(angle) data.
- Author
- mdejong
Definition at line 19 of file JPMTAngularAcceptance.cc.
28 JParser<> zap(
"Auxiliary program to convert PMT QE(angle) data.");
35 catch(
const exception &error) {
36 FATAL(error.what() << endl);
40 const string DEG(
"deg");
43 if (inputFile !=
"") {
45 ifstream in(inputFile.c_str());
47 while (in.peek() ==
'#') {
48 in.ignore(numeric_limits<streamsize>::max(),
'\n');
59 istringstream is(buffer);
63 for (
double x; is >> x; ) {
68 in.ignore(numeric_limits<streamsize>::max(),
'\n');
75 istringstream is(buffer);
81 const size_t pos = key.find(DEG);
83 if (pos != string::npos) {
84 key.replace(pos, DEG.size(),
"");
89 istringstream(key) >> angle;
95 for (
double y ; is >> y; ++i) {
97 if (i != energy.size()) {
100 <<
"[" <<
FIXED(5,1) << angle <<
"]"
101 <<
"[" <<
FIXED(3,1) << energy[i] <<
"]"
107 FATAL(
"Inconsistent data " << i <<
" != " << energy.size() << endl);
111 if (i != energy.size()) {
112 FATAL(
"Inconsistent data " << i <<
" != " << energy.size() << endl);
Utility class to parse command line options.
Auxiliary data structure for floating point format specification.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.