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

RegHProf.C

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

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