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