Program to create TH1D and fill according given formula.  
More...
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include "TROOT.h"
#include "TFile.h"
#include "TH1D.h"
#include "TF1.h"
#include "JLang/JToken.hh"
#include "JTools/JAbstractHistogram.hh"
#include "JGizmo/JGizmoToolkit.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
 
Go to the source code of this file.
 | 
| int  | main (int argc, char **argv) | 
|   | 
Program to create TH1D and fill according given formula. 
- Author
 - mdejong 
 
Definition in file JGizmo/JHistogram1D.cc.
 
      
        
          | int main  | 
          ( | 
          int  | 
          argc,  | 
        
        
           | 
           | 
          char **  | 
          argv  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 25 of file JGizmo/JHistogram1D.cc.
   31   typedef JAbstractHistogram<Double_t> JHistogram_t;
 
   42     JParser<> zap(
"Program to create TH1D and fill according given formula.");
 
   48     zap[
'x'] = 
make_field(X)               = JHistogram_t(100, -1.0, +1.0);
 
   53   catch(
const exception &error) {
 
   54     FATAL(error.what() << endl);
 
   58   TF1 f1(
"f1", formula.c_str());
 
   68           X.getNumberOfBins(), X.getLowerLimit(), X.getUpperLimit());
 
   72   if (numberOfEvents > 0) {
 
   74     h0.FillRandom(f1.GetName(), numberOfEvents);
 
   78     for (Int_t ix = 1; ix <= h0.GetXaxis()->GetNbins(); ++ix) {      
 
   79       h0.SetBinContent(ix, f1.Eval(h0.GetXaxis()->GetBinCenter(ix)));
 
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. 
 
Empty structure for specification of parser element that is initialised (i.e. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
Wrapper class around string.