00001 #include "Event/rHisto.h"
00002
00003 #include "TROOT.h"
00004 #include "TFile.h"
00005 #include "TObject.h"
00006 #include "TObjArray.h"
00007 #include "TH1.h"
00008 #include "TH2.h"
00009 #include "TNtuple.h"
00010
00011
00012 rHisto::rHisto(std::string typ, std::string name, std::string title,
00013 double nx, double x0, double xf,
00014 double ny, double y0, double yf)
00015
00016 {
00017 m_name = name;
00018 if (typ == "H1") m_type = rHisto::H1;
00019 else if (typ == "H2") m_type = rHisto::H2;
00020 m_title = title;
00021 m_nx = nx;
00022 m_x0 = x0;
00023 m_xf = xf;
00024 m_ny = ny;
00025 m_y0 = y0;
00026 m_yf = yf;
00027
00028 defineOption();
00029 }
00030
00031 void rHisto::book()
00032
00033 {
00034 if (m_type == H1) {
00035 TH1F* histo = new TH1F(m_name.c_str(),m_title.c_str(),
00036 (float) m_nx, (float) m_x0, (float) m_xf);
00037 } else if (m_type == H2) {
00038 TH2F* histo = new TH2F(m_name.c_str(),m_title.c_str(),
00039 (float) m_nx, (float) m_x0, (float) m_xf,
00040 (float) m_ny, (float) m_y0, (float) m_yf);
00041 }
00042 }
00043
00044 void rHisto::command(std::string com)
00045
00046 {
00047 if (com == "book") book();
00048 }
00049
00050 void rHisto::defineOption()
00051
00052 {
00053 optionVI::defineOption("title",&m_title);
00054 optionVI::defineOption("nx",&m_nx);
00055 optionVI::defineOption("x0",&m_x0);
00056 optionVI::defineOption("xf",&m_xf);
00057 optionVI::defineOption("ny",&m_ny);
00058 optionVI::defineOption("y0",&m_y0);
00059 optionVI::defineOption("yf",&m_yf);
00060 };