00001
00017 #include "jbltools/sfh/SetOfHProf.h"
00018 #include "jbltools/sfh/RegHProf.h"
00019 #include "jbltools/sfh/BinningFun.h"
00020
00021 #include <TFile.h>
00022 #include <TF1.h>
00023 #include <TAxis.h>
00024
00025 #include <iostream>
00026 #include <cmath>
00027 #include <cassert>
00028
00029 static const char *ident="@(#)$Id: SetOfHProf.C,v 1.6 2005/07/08 15:01:35 blist Exp $";
00030
00031 SetOfHProf::SetOfHProf (const char* name_,
00032 const char* title_,
00033 const ROListPoR& hhl,
00034 const BinningFunPoR& binning_)
00035 : SetOfH (name_, title_, hhl, binning_),
00036 ylow (0), yup (0)
00037 {
00038 initHistos ();
00039 }
00040
00041
00042 SetOfHProf::SetOfHProf (const char* name_,
00043 const char* title_,
00044 Int_t nbinsx,
00045 Axis_t xlow,
00046 Axis_t xup,
00047 Option_t *option_,
00048 const ROListPoR& hhl,
00049 const BinningFunPoR& binning_
00050 )
00051 : SetOfH (name_, title_, hhl, binning_, option_),
00052 axisbinning (nbinsx, xlow, xup),
00053 ylow (0), yup (0)
00054 {
00055 initHistos ();
00056 }
00057 SetOfHProf::SetOfHProf (const char* name_,
00058 const char* title_,
00059 Int_t nbinsx,
00060 Axis_t xlow,
00061 Axis_t xup,
00062 Axis_t ylow_,
00063 Axis_t yup_,
00064 Option_t *option_,
00065 const ROListPoR& hhl,
00066 const BinningFunPoR& binning_
00067 )
00068 : SetOfH (name_, title_, hhl, binning_, option_),
00069 axisbinning (nbinsx, xlow, xup),
00070 ylow (ylow_), yup (yup_)
00071 {
00072 initHistos ();
00073 }
00074 SetOfHProf::SetOfHProf (const char* name_,
00075 const char* title_,
00076 Int_t nbinsx,
00077 const Float_t* xbins,
00078 Option_t *option_,
00079 const ROListPoR& hhl,
00080 const BinningFunPoR& binning_
00081 )
00082 : SetOfH (name_, title_, hhl, binning_, option_),
00083 axisbinning (nbinsx, xbins),
00084 ylow (0), yup (0)
00085 {
00086 initHistos ();
00087 }
00088 SetOfHProf::SetOfHProf (const char* name_,
00089 const char* title_,
00090 Int_t nbinsx,
00091 const Double_t* xbins,
00092 Option_t *option_,
00093 const ROListPoR& hhl,
00094 const BinningFunPoR& binning_
00095 )
00096 : SetOfH (name_, title_, hhl, binning_, option_),
00097 axisbinning (nbinsx, xbins),
00098 ylow (0), yup (0)
00099 {
00100 initHistos ();
00101 }
00102 SetOfHProf::SetOfHProf (const char* name_,
00103 const char* title_,
00104 Int_t nbinsx,
00105 const Double_t* xbins,
00106 Axis_t ylow_,
00107 Axis_t yup_,
00108 Option_t *option_,
00109 const ROListPoR& hhl,
00110 const BinningFunPoR& binning_
00111 )
00112 : SetOfH (name_, title_, hhl, binning_, option_),
00113 axisbinning (nbinsx, xbins),
00114 ylow (ylow_), yup (yup_)
00115 {
00116 initHistos ();
00117 }
00118 SetOfHProf::SetOfHProf (const char* name_,
00119 const char* title_,
00120 const Binning& axisbinning_,
00121 Option_t *option_,
00122 const ROListPoR& hhl,
00123 const BinningFunPoR& binning_
00124 )
00125 : SetOfH (name_, title_, hhl, binning_, option_),
00126 axisbinning (axisbinning_),
00127 ylow (0), yup (0)
00128 {
00129 initHistos ();
00130 }
00131 SetOfHProf::SetOfHProf (const char* name_,
00132 const char* title_,
00133 const Binning& axisbinning_,
00134 Axis_t ylow_,
00135 Axis_t yup_,
00136 Option_t *option_,
00137 const ROListPoR& hhl,
00138 const BinningFunPoR& binning_
00139 )
00140 : SetOfH (name_, title_, hhl, binning_, option_),
00141 axisbinning (axisbinning_),
00142 ylow (ylow_), yup (yup_)
00143 {
00144 initHistos ();
00145 }
00146
00147
00148 void SetOfHProf::initHisto (IndexType i)
00149 {
00150 const char *htitle = genBinTitle(i);
00151 const char *hname = genBinName(i);
00152 RegHProf *h = new RegHProf (hname, htitle, axisbinning, ylow, yup, getOption(), 0);
00153 registerObject (i, h);
00154 delete[] hname;
00155 delete[] htitle;
00156 }
00157
00158
00159
00160 RegHProf *SetOfHProf::getHisto (IndexType i) {
00161 return dynamic_cast<RegHProf *>(getEntry(i));
00162 }
00163
00164
00165 SetOfHProf::~SetOfHProf () {
00166 }
00167