30 typedef JToken<';'> JToken_t;
31 typedef JAbstractHistogram<Double_t> JHistogram_t;
46 JParser<> zap(
"Program to create TH2D and fill according given formula.");
54 zap[
'x'] =
make_field(
X) = JHistogram_t(100, -1.0, +1.0);
55 zap[
'y'] =
make_field(
Y) = JHistogram_t(100, -1.0, +1.0);
61 catch(
const exception &error) {
62 FATAL(error.what() << endl);
66 if ((formula !=
"" && inputFile !=
"") ||
67 (formula ==
"" && inputFile ==
"")) {
68 FATAL(
"Specify input file or formula." << endl);
74 TH2D h0(title.c_str(), NULL,
75 X.getNumberOfBins(),
X.getLowerLimit(),
X.getUpperLimit(),
76 Y.getNumberOfBins(),
Y.getLowerLimit(),
Y.getUpperLimit());
80 TF2 f2(
"f2", formula.c_str());
86 if (numberOfEvents > 0) {
89 h0.FillRandom(f2.GetName(), numberOfEvents);
93 for (Int_t ix = 1; ix <= h0.GetXaxis()->GetNbins(); ++ix) {
94 for (Int_t iy = 1; iy <= h0.GetYaxis()->GetNbins(); ++iy) {
95 h0.SetBinContent(ix, iy, f2.Eval(h0.GetXaxis()->GetBinCenter(ix),
96 h0.GetYaxis()->GetBinCenter(iy)));
100 }
else if (inputFile !=
"") {
106 ifstream
in(inputFile.c_str());
108 for (
double x, y;
in >> x >> y; ) {
Utility class to parse command line options.
double getValue(const JScale_t scale)
Get numerical value corresponding to scale.
int getParameter(const std::string &text)
Get parameter number from text string.
*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
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
then break fi done getCenter read X Y Z let X
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in