Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

RegH2F.C

Go to the documentation of this file.
00001 
00024 #include "jbltools/sfh/RegH2F.h"
00025 
00026 #include "jbltools/sfh/Binning.h"
00027 
00028 #include <cassert>
00029 
00030 static const char *ident="@(#)$Id: RegH2F.C,v 1.7 2005/07/13 11:35:50 blist Exp $";
00031 
00032 RegH2F::RegH2F (const char* name, const char* title, 
00033                 Int_t nbinsx, Axis_t xlow, Axis_t xup,
00034                 Int_t nbinsy, Axis_t ylow, Axis_t yup, 
00035                 const ROListPoR& hhl) 
00036 : TH2F (name, title, nbinsx, xlow, xup, nbinsy, ylow, yup), 
00037   RegO (hhl) 
00038 {
00039   if(fSumw2.fN == 0) Sumw2();
00040 }
00041   
00042   
00043 RegH2F::RegH2F (const char* name, const char* title, 
00044                 Int_t nbinsx, const Double_t* xbins,
00045                 Int_t nbinsy, Axis_t ylow, Axis_t yup, 
00046                 const ROListPoR& hhl) 
00047 : TH2F (name, title, nbinsx, xbins, nbinsy, ylow, yup), 
00048   RegO (hhl) 
00049 {
00050   if(fSumw2.fN == 0) Sumw2();
00051 }
00052   
00053   
00054 RegH2F::RegH2F (const char* name, const char* title, 
00055                 Int_t nbinsx, Axis_t xlow, Axis_t xup,
00056                 Int_t nbinsy, const Double_t* ybins, 
00057                 const ROListPoR& hhl) 
00058 : TH2F (name, title, nbinsx, xlow, xup, nbinsy, ybins), 
00059   RegO (hhl) 
00060 {
00061   if(fSumw2.fN == 0) Sumw2();
00062 }
00063   
00064   
00065 RegH2F::RegH2F (const char* name, const char* title, 
00066                 Int_t nbinsx, const Double_t* xbins,
00067                 Int_t nbinsy, const Double_t* ybins, 
00068                 const ROListPoR& hhl) 
00069 : TH2F (name, title, nbinsx, xbins, nbinsy, ybins), 
00070   RegO (hhl) 
00071 {
00072   if(fSumw2.fN == 0) Sumw2();
00073 }
00074 
00075 RegH2F::RegH2F (const char* name, const char* title, 
00076                 Int_t nbinsx, const Float_t* xbins,
00077                 Int_t nbinsy, const Float_t* ybins, 
00078                 const ROListPoR& hhl) 
00079 : TH2F (name, title, nbinsx, xbins, nbinsy, ybins), 
00080   RegO (hhl) 
00081 {
00082   if(fSumw2.fN == 0) Sumw2();
00083 }
00084 
00085 RegH2F::RegH2F (const char* name, const char* title, 
00086                 const Binning& xbinning,  
00087                 const Binning& ybinning,  
00088                 const ROListPoR& hhl) 
00089 : TH2F (name, title, 
00090         xbinning.getNBins(), xbinning.getLowerEdge(), xbinning.getUpperEdge(), 
00091         ybinning.getNBins(), ybinning.getLowerEdge(), ybinning.getUpperEdge()), 
00092   RegO (hhl) 
00093 {  
00094   // For an equidistant binning, everything is OK already;
00095   // for a non-equidistant binning, the number of bins is fine,
00096   // but we have to adjust the bin edges
00097   if (!xbinning.isEquidistant()) {
00098     TAxis *xaxis = GetXaxis();
00099     assert (xaxis);
00100     assert (xbinning.getEdges());
00101     xaxis->Set (xbinning.getNBins(), xbinning.getEdges());
00102   }
00103   if (xbinning.hasBinLabels()) {
00104     TAxis *xaxis = GetXaxis();
00105     assert (xaxis);
00106     for (int i = 0; i< xbinning.getNBins(); ++i) {
00107       if (const char *label = xbinning.getBinLabel (i)) {
00108         xaxis->SetBinLabel (i+1, label);
00109       }
00110     }
00111     LabelsOption ("u", "X");
00112   }
00113   if (!ybinning.isEquidistant()) {
00114     TAxis *yaxis = GetYaxis();
00115     assert (yaxis);
00116     assert (ybinning.getEdges());
00117     yaxis->Set (ybinning.getNBins(), ybinning.getEdges());
00118   }
00119   if (ybinning.hasBinLabels()) {
00120     TAxis *yaxis = GetYaxis();
00121     assert (yaxis);
00122     for (int i = 0; i< ybinning.getNBins(); ++i) {
00123       if (const char *label = ybinning.getBinLabel (i)) {
00124         yaxis->SetBinLabel (i+1, label);
00125       }
00126     }
00127     LabelsOption ("h", "Y");
00128   }
00129 
00130   if(fSumw2.fN == 0) Sumw2();
00131 }
00132 
00133 
00134 RegH2F::~RegH2F() 
00135 {}
00136 
00137 

Generated on Thu Oct 26 12:52:58 2006 for SFH by doxygen 1.3.2