32 return object.ReadLine(in);
42 inline std::ostream&
operator<<(std::ostream& out,
const TString&
object)
44 return out <<
object.Data();
53 int main(
int argc,
char **argv)
58 JRootObjectID inputFile;
67 JParser<> zap(
"Auxiliary program to print ROOT fit results.");
69 zap[
'f'] =
make_field(inputFile,
"histogram, e.g: <file name>:<object name>");
70 zap[
'='] =
make_field(fcn,
"function name") =
".*";
78 catch(
const exception &error) {
79 FATAL(error.what() << endl);
86 FATAL(
"No object at " << inputFile << endl);
91 if (
f1 == NULL && dynamic_cast<TF1*> (p) != NULL) {
f1 =
dynamic_cast<TF1*
>(p); }
92 if (
f1 == NULL && dynamic_cast<TH1*> (p) != NULL) {
f1 =
getFunction(dynamic_cast<TH1*> (p), fcn.c_str()); };
93 if (
f1 == NULL && dynamic_cast<TGraph*> (p) != NULL) {
f1 =
getFunction(dynamic_cast<TGraph*> (p), fcn.c_str()); };
94 if (
f1 == NULL && dynamic_cast<TGraph2D*>(p) != NULL) {
f1 =
getFunction(dynamic_cast<TGraph2D*>(p), fcn.c_str()); };
97 FATAL(
"No function at " << inputFile <<
" " << fcn << endl);
100 for (
int i = 0;
i !=
f1->GetNpar(); ++
i) {
101 if (parameter.count(
f1->GetParName(
i)) != 0) {
102 cout <<
FIXED(20,10) <<
f1->GetParameter(
i) <<
' '
103 <<
FIXED(20,10) <<
f1->GetParError (
i) << endl;
108 cout <<
f1->EvalPar(
x.data()) << endl;
Utility class to parse command line options.
TObject * getObject(const JRootObjectID &id)
Get first TObject with given identifier.
TF1 * getFunction(TH1 *h1, const char *const fcn)
Get function.
int main(int argc, char *argv[])
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary data structure for floating point format specification.
const JPolynome f1(1.0, 2.0, 3.0)
Function.
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Double_t getResult(const TString &text, TObject *object=NULL)
Get result of given textual formula.
General purpose messaging.
std::istream & operator>>(std::istream &in, JAANET::JHead &header)
Read header from input.
Auxiliary class to define a range between two values.
then fatal The output file must have the wildcard in the e g root fi eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Utility class to parse command line options.
Auxiliary data structure for floating point format specification.