Jpp
test_elongated_shower_pde
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
software
JGizmo
JF2.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <iomanip>
4
#include <vector>
5
6
#include "TROOT.h"
7
#include "TFile.h"
8
#include "TF2.h"
9
10
#include "
JTools/JRange.hh
"
11
#include "
JLang/JToken.hh
"
12
#include "
JGizmo/JGizmoToolkit.hh
"
13
14
#include "
Jeep/JParser.hh
"
15
#include "
Jeep/JMessage.hh
"
16
17
18
/**
19
* \file
20
* Auxiliary program to write 2D ROOT function.
21
* \author mdejong
22
*/
23
int
main
(
int
argc,
char
**argv)
24
{
25
using namespace
std;
26
using namespace
JPP;
27
28
typedef
JToken<';'> JToken_t;
29
typedef
JRange<double> JRange_t;
30
31
string
formula;
32
string
name
;
33
string
outputFile
;
34
JRange_t
x
;
35
JRange_t y;
36
vector<JToken_t>
parameters
;
37
int
N
;
38
int
debug
;
39
40
try
{
41
42
JParser<>
zap(
"Auxiliary program to write 2D ROOT function."
);
43
44
zap[
'F'
] =
make_field
(formula,
"function, e.g: \"[0]+[1]*x\""
);
45
zap[
'T'
] =
make_field
(
name
,
"name of ROOT function"
) =
"user"
;
46
zap[
'o'
] =
make_field
(
outputFile
,
"ROOT file with formula"
) =
"f2.root"
;
47
zap[
'x'
] =
make_field
(
x
,
"abscissa range"
) = JRange_t();
48
zap[
'y'
] =
make_field
(y,
"abscissa range"
) = JRange_t();
49
zap[
'@'
] =
make_field
(
parameters
,
"parameter values, e.g: \"p0 = 1.0;\""
);
50
zap[
'N'
] =
make_field
(
N
,
"number of points (for drawing)"
) = 0;
51
zap[
'd'
] =
make_field
(
debug
) = 1;
52
53
zap(argc, argv);
54
}
55
catch
(
const
exception &error) {
56
FATAL
(error.what() << endl);
57
}
58
59
TF2 f2(
name
.c_str(),
60
formula.c_str(),
61
x
.getLowerLimit(),
62
x
.getUpperLimit(),
63
y.getLowerLimit(),
64
y.getUpperLimit());
65
66
if
(
N
> 0) {
67
f2.SetNpx(
N
);
68
f2.SetNpy(
N
);
69
}
70
71
for
(
vector<JToken_t>::const_iterator
i =
parameters
.begin(); i !=
parameters
.end(); ++i) {
72
f2.SetParameter(
getParameter
(*i),
getValue
(*i,&f2));
73
}
74
75
TFile out(
outputFile
.c_str(),
"recreate"
);
76
77
out.WriteTObject(&f2);
78
79
out.Write();
80
out.Close();
81
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1500
JEEP::getValue
double getValue(const JScale_t scale)
Get numerical value corresponding to scale.
Definition:
JScale.hh:47
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JGIZMO::getParameter
int getParameter(const std::string &text)
Get parameter number from text string.
Definition:
JGizmoToolkit.hh:332
name
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition:
JCookie.sh:42
N
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
Definition:
JShowerPostfit.sh:95
parameters
*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
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
std::vector
Definition:
JSTDTypes.hh:12
x
then chmod x
Definition:
JEvtReweightMupageParameterScan.sh:413
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1961
JGizmoToolkit.hh
debug
int debug
debug level
Definition:
JSirene.cc:68
JToken.hh
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JRange.hh
Auxiliary class to define a range between two values.
JParser.hh
Utility class to parse command line options.
Generated by
1.8.5