Jpp  17.3.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions
JLine.cc File Reference

Auxiliary program to create TLine. More...

#include <string>
#include <iostream>
#include "TROOT.h"
#include "TFile.h"
#include "TLine.h"
#include "Jeep/JProperties.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Classes

struct  JLine
 Auxiliary data structure for line. More...
 

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to create TLine.

Author
mdejong

Definition in file JLine.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 54 of file JLine.cc.

55 {
56  using namespace std;
57 
58  string outputFile;
60  Color_t color = kBlack;
61  Style_t style = kSolid;
62  Width_t width = 2;
63  int debug;
64 
65  try {
66 
67  JProperties properties;
68 
69  properties.insert(gmake_property(color));
70  properties.insert(gmake_property(style));
71  properties.insert(gmake_property(width));
72 
73  JParser<> zap("Auxiliary program to create TLine.");
74 
75  zap['o'] = make_field(outputFile);
76  zap['p'] = make_field(parameters, "x1 y1 x2 y2");
77  zap['@'] = make_field(properties, "line attributes") = JPARSER::initialised();
78  zap['d'] = make_field(debug) = 1;
79 
80  zap(argc, argv);
81  }
82  catch(const exception &error) {
83  FATAL(error.what() << endl);
84  }
85 
86 
87  TFile out(outputFile.c_str(), "recreate");
88 
89  TLine* p = new TLine(parameters.x1, parameters.y1, parameters.x2, parameters.y2);
90 
91  p->SetLineColor(color);
92  p->SetLineStyle(style);
93  p->SetLineWidth(width);
94 
95  out.WriteTObject(p);
96 
97  out.Write();
98  out.Close();
99 }
Utility class to parse command line options.
Definition: JParser.hh:1517
#define gmake_property(A)
macro to convert (template) parameter to JPropertiesElement object
Utility class to parse parameter values.
Definition: JProperties.hh:496
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition: JParser.hh:83
string outputFile
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1993
#define FATAL(A)
Definition: JMessage.hh:67
Auxiliary data structure for line.
Definition: JLine.cc:16
int debug
debug level