#include #include #include "TROOT.h" #include "TFile.h" #include "TH1D.h" #include "JPhysics/JGeanx.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Example program to histogram photon emission profile from showers using JPHYSICS::JGeanx. * \author mdejong */ int main(int argc, char* argv[]) { using namespace std; string outputFile; int debug; try { JParser<> zap("Example program to histogram photon emission profile from showers."); zap['o'] = make_field(outputFile) = "geanx.root"; zap['d'] = make_field(debug) = 2; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } using namespace JPP; TFile out(outputFile.c_str(), "recreate"); TH1D h1("Probability", NULL, 1000, -1.0, +1.0); TH1D h2("Integral", NULL, 1000, -1.0, +1.0); for(int i = 1; i <= h1.GetNbinsX(); ++i) { const double x = h1.GetBinCenter(i); h1.SetBinContent(i, geanx(x)); h2.SetBinContent(i, geanx(-1.0,x)); } h1.Sumw2(kFALSE); h2.Sumw2(kFALSE); out.Write(); out.Close(); }