TPSTest Class Reference

#include <TPSTest.h>

List of all members.

Public Member Functions

 TPSTest ()
 TPSTest (TH1 *h1, TH1 *h2)
 ~TPSTest ()
TH1 * GetFit (const char *fitName="newFitHist") const
double GetInt (int histNum) const
double GetLogLikelihood () const
int GetNbins () const
int GetNbinsX () const
int GetNbinsY () const
int GetNbinsZ () const
double GetProb () const
double GetRatio () const
int GetStatus () const
int SetHist (int histNum, TH1 *hist)
int SetBinRangeX (int minBin, int maxBin)
int SetBinRangeY (int minBin, int maxBin)
int SetBinRangeZ (int minBin, int maxBin)

Private Member Functions

double CalcContents (TH1 *hist, double scaleFactor)
void CalcLogLikelihood ()
void CalcProb ()
void Initialize ()
int SetStatus ()

Private Attributes

TH1 * fFit
TH1 * fH1
TH1 * fH2
double fH1Conts
double fH2Conts
double fH1Scale
double fH2Scale
double fLL
int fMinBinX
int fMaxBinX
int fMinBinY
int fMaxBinY
int fMinBinZ
int fMaxBinZ
int fNbins
int fNbinsX
int fNbinsY
int fNbinsZ
double fProb
double fRatio
int fStatus
int fZeroBins

Detailed Description

TPSTest

"Point Significance Test"

Hypothesis test of the assumption that two TH1 objects were filled from the same probability distribution. A maximum likelihood method is used to find the most likely source PDF. The resulting probability is the confidence level of the hypothesis that the input TH1 objects are the result of Poisson distributed fluctuations about the maximum likelihood fit distribution.

Definition at line 21 of file TPSTest.h.


Constructor & Destructor Documentation

TPSTest::TPSTest (  ) 

Definition at line 26 of file TPSTest.cxx.

00027 {
00028   // Default constructor
00029 
00030   fH1Conts =  0.;
00031   fH2Conts =  0.;
00032   fLL      = -1.;
00033   fRatio   =  0.;
00034   fStatus  = -1 ;
00035 
00036   fMinBinX =  0 ;
00037   fMinBinY =  0 ;
00038   fMinBinZ =  0 ;
00039 
00040   fMaxBinX =  0 ;
00041   fMaxBinY =  0 ;
00042   fMaxBinZ =  0 ;
00043 
00044   fNbins   = -1 ;
00045   fNbinsX  = -1 ;
00046   fNbinsY  = -1 ;
00047   fNbinsZ  = -1 ;
00048   fZeroBins= -1 ;
00049 
00050   fFit     =  0 ;
00051 
00052   fH1      =  0 ;
00053   fH2      =  0 ;
00054 }

TPSTest::TPSTest ( TH1 *  h1,
TH1 *  h2 
)

Definition at line 56 of file TPSTest.cxx.

References fFit, fH1, fH1Conts, fH2, fH2Conts, fLL, fMaxBinX, fMaxBinY, fMaxBinZ, fMinBinX, fMinBinY, fMinBinZ, fNbins, fNbinsX, fNbinsY, fNbinsZ, fRatio, fStatus, fZeroBins, and Initialize().

00057 {
00058   // Constructor with complete initialization (incl. error checking)
00059 
00060   fH1 = dynamic_cast<TH1*>(h1->Clone("fH1"));
00061   fH2 = dynamic_cast<TH1*>(h2->Clone("fH2"));
00062 
00063   fH1Conts =  0.;
00064   fH2Conts =  0.;
00065   fLL      = -1.;
00066   fRatio   =  0.;
00067   fStatus  = -1 ;
00068 
00069   fMinBinX =  0 ;
00070   fMinBinY =  0 ;
00071   fMinBinZ =  0 ;
00072 
00073   fMaxBinX =  0 ;
00074   fMaxBinY =  0 ;
00075   fMaxBinZ =  0 ;
00076 
00077   fNbins   = -1 ;
00078   fNbinsX  = -1 ;
00079   fNbinsY  = -1 ;
00080   fNbinsZ  = -1 ;
00081   fZeroBins= -1 ;
00082 
00083   fFit     =  0 ;
00084 
00085   Initialize();
00086 }

TPSTest::~TPSTest (  ) 

Definition at line 88 of file TPSTest.cxx.

References fFit, fH1, and fH2.

00089 {
00090   // Destructor
00091 
00092   if (fH1)      delete fH1;      fH1      = 0;
00093   if (fH2)      delete fH2;      fH2      = 0;
00094   if (fFit)     delete fFit;     fFit     = 0;
00095 }


Member Function Documentation

double TPSTest::CalcContents ( TH1 *  hist,
double  scaleFactor 
) [private]

Definition at line 299 of file TPSTest.cxx.

References fMaxBinX, fMaxBinY, fMaxBinZ, fMinBinX, fMinBinY, and fMinBinZ.

Referenced by Initialize().

00300 {
00301   // Calculate the number of entries contained within the min/max bounds
00302   // set for x,y,z (adjusted for scale factors applied to the histogram)
00303   //
00304   double hCont = 0.;
00305 
00306   for (int x = fMinBinX; x <= fMaxBinX; x++)
00307     for (int y = fMinBinY; y <= fMaxBinY; y++)
00308       for (int z = fMinBinZ; z <= fMaxBinZ; z++){
00309         int bin = hist->GetBin(x,y,z);
00310         hCont += (x == 0 && y == 0 && z == 0)?
00311           0. : hist->GetBinContent(bin)/scaleFactor;
00312       }
00313   return hCont;
00314 }

void TPSTest::CalcLogLikelihood (  )  [private]

Definition at line 316 of file TPSTest.cxx.

References MuELoss::e, fFit, fH1, fH1Conts, fH1Scale, fH2, fH2Conts, fH2Scale, fLL, fMaxBinX, fMaxBinY, fMaxBinZ, fMinBinX, fMinBinY, fMinBinZ, and fNbins.

Referenced by Initialize().

00317 {
00318   // Calculate logLikelihood of the provided histograms to the
00319   // best-fit distribution
00320   //
00321 
00322   fLL  = 0.;
00323   fFit = dynamic_cast<TH1*>(fH1->Clone("FitHist"));
00324   fFit->SetBit(TH1::kCanRebin,false);
00325   fFit->Reset("ICE");
00326 
00327   for (int x = fMinBinX; x <= fMaxBinX; x++)
00328     for (int y = fMinBinY; y <= fMaxBinY; y++)
00329       for (int z = fMinBinZ; z <= fMaxBinZ; z++){
00330         int bin        = fH1->GetBin(x,y,z);
00331 
00332         double h1i     = fH1->GetBinContent(bin)/fH1Scale;
00333         double h2i     = fH2->GetBinContent(bin)/fH2Scale;
00334 
00335         double fiti    = (h1i+h2i)/(fH1Conts+fH2Conts);
00336         double fitiErr = TMath::Sqrt(h1i+h2i)/(fH1Conts+fH2Conts);
00337 
00338         fFit->SetBinContent(bin,fiti);
00339         fFit->SetBinError  (bin,fitiErr);
00340 
00341         bool bUnderFlow = (bin==0);
00342         bool bOverFlow  = (bin==fNbins+1);
00343         if (!bUnderFlow && !bOverFlow){
00344           double fit1 = fH1Conts*fiti;
00345           double p1 = (h1i > 1.e2 || fit1 > 4.e2)?
00346             TMath::Gaus(h1i,fit1,TMath::Sqrt(fit1),true) :
00347             TMath::PoissonI(h1i,fit1); // protect PoissonI from crashing
00348           double LL1 = (p1 > 1.e-10)? TMath::Log(p1) : -1.e10;
00349 
00350           double fit2 = fH2Conts*fiti;
00351           double p2 = (h2i > 1.e2 || fit2 > 4.e2)?
00352             TMath::Gaus(h2i,fit2,TMath::Sqrt(fit2),true) :
00353             TMath::PoissonI(h2i,fit2); // protect PoissonI from crashing
00354           double LL2 = (p2 > 1.e-10)? TMath::Log(p2) : -1.e10;
00355 
00356           if (fiti > 1.e-20) fLL += LL1 + LL2;
00357 
00358         } // end if there are entries in >= one histogram && not u/overflow
00359       } // end (3D) for loop over bins
00360   
00361   return;
00362 }

void TPSTest::CalcProb (  )  [private]

Definition at line 364 of file TPSTest.cxx.

References fFit, fH1, fH1Conts, fH1Scale, fH2, fH2Conts, fH2Scale, fMaxBinX, fMaxBinY, fMaxBinZ, fMinBinX, fMinBinY, fMinBinZ, fNbins, fProb, and fZeroBins.

Referenced by Initialize().

00365 {
00366   // Calculate the confidence level of the fit assuming Poisson distributed
00367   // measurements (does NOT include u/overflow bins in the calculation).
00368   //
00369 
00370   fProb     = 1.;
00371   fZeroBins = 0 ;
00372 
00373   double       logQ   = 0.;
00374   unsigned int nBins  = 0 ;
00375   for (int x = fMinBinX; x <= fMaxBinX; x++)
00376     for (int y = fMinBinY; y <= fMaxBinY; y++)
00377       for (int z = fMinBinZ; z <= fMaxBinZ; z++){
00378         int bin     = fH1->GetBin(x,y,z);
00379 
00380         double h1i  = fH1 ->GetBinContent(bin)/fH1Scale;
00381         double fit1 = fFit->GetBinContent(bin)*fH1Conts;
00382         
00383         double h2i  = fH2 ->GetBinContent(bin)/fH2Scale;
00384         double fit2 = fFit->GetBinContent(bin)*fH2Conts;
00385 
00386         bool bUnderFlow = (bin==0);
00387         bool bOverFlow  = (bin==fNbins+1);
00388         if (!bUnderFlow &&
00389             !bOverFlow  &&
00390             fit1 > 0.   &&
00391             fit2 > 0.    ){
00392           nBins++;
00393 
00394           // Get total probability contained within
00395           // (fit1-|fit1-h1i|,fit1+|fit1-h1i|)
00396           double diff1  = TMath::Abs(fit1-h1i);
00397           int    start1 =
00398             (fit1-diff1 > 0.)? TMath::CeilNint(fit1-diff1) : 0;
00399           int    end1   = TMath::FloorNint(fit1+diff1);
00400           double prob1  = 0.;
00401           for (int i = start1; i <= end1; i++) {
00402             prob1 += (i > 1.e2 || fit1 > 4.e2)?
00403               TMath::Gaus(i,fit1,TMath::Sqrt(fit1),true) :
00404               TMath::PoissonI(i,fit1); // protect PoissonI from crashing
00405           }
00406           
00407           // Get total probability contained within
00408           // (fit2-|fit2-h2i|,fit2+|fit2-h2i|)
00409           double diff2  = TMath::Abs(fit2-h2i);
00410           int    start2 =
00411             (fit2-diff2 > 0.)? TMath::CeilNint(fit2-diff2) : 0;
00412           int    end2   = TMath::FloorNint(fit2+diff2);
00413           double prob2  = 0.;
00414           for (int i = start2; i <= end2; i++) {
00415             prob2 += (i > 1.e2 || fit2 > 4.e2)?
00416               TMath::Gaus(i,fit2,TMath::Sqrt(fit2),true) :
00417               TMath::PoissonI(i,fit2); // protect PoissonI from crashing
00418           }
00419           
00420           // Confidence Levels
00421           double binCL1 = (1.-prob1); // c.l. for histogram1 bin i
00422           double binCL2 = (1.-prob2); // c.l. for histogram2 bin i
00423           logQ  += (binCL1 > 0.)? TMath::Log(binCL1) : 0.;
00424           logQ  += (binCL2 > 0.)? TMath::Log(binCL2) : 0.;
00425         
00426         } // end if not u/overflow bin or zero entries bin
00427         if (!(fit1 > 0.) || !(fit2 > 0.)) fZeroBins++; 
00428       } // end (3D) for loop over bins
00429 
00430   fProb = TMath::Prob(-2*logQ,2*2*nBins);
00431 
00432   return;
00433 }

TH1 * TPSTest::GetFit ( const char *  fitName = "newFitHist"  )  const

Definition at line 97 of file TPSTest.cxx.

References fFit, and fStatus.

00098 {
00099   // Return a pointer to a clone of the pdf histogram best fit to the 2 input
00100   // histograms. Optional argument, fitName, will be the name of the new
00101   // histogram (default is "newFitHist"). The pdf fit histogram is normalized
00102   // to area 1. The corresponding fit to each input histogram then is 
00103   // found by scaling the fit histogram to the number of entries in the input
00104   // histogram of interest.
00105   //
00106 
00107   if (fStatus != 0) return 0;
00108   return dynamic_cast<TH1*>(fFit->Clone(fitName));
00109 }

double TPSTest::GetInt ( int  histNum  )  const

Definition at line 111 of file TPSTest.cxx.

References fH1Conts, fH2Conts, and fStatus.

00112 {
00113   // Returns the integral of the contents contained within the bounds set
00114   // by SetBinRangeX(), SetBinRangeY(), SetBinRangeZ() for histogram
00115   // 'histNum' (1 or 2).
00116   //
00117 
00118   if (histNum == 1 && fStatus == 0)
00119     return fH1Conts;
00120   else if (histNum == 2 && fStatus == 0)
00121     return fH2Conts;
00122   else
00123     return -1.;
00124 }

double TPSTest::GetLogLikelihood (  )  const

Definition at line 126 of file TPSTest.cxx.

References fLL, and fStatus.

00127 {
00128   // Returns the loglikelihood of the combined fit to the
00129   // "best-fit true" distribution
00130   //
00131 
00132   if (fStatus != 0) return -1.;
00133   return fLL;
00134 }

int TPSTest::GetNbins (  )  const

Definition at line 136 of file TPSTest.cxx.

References fNbins, and fStatus.

00137 {
00138   // Total number of bins (not including u/overflow)
00139   //
00140 
00141   if (fStatus != 0) return -1;
00142   return fNbins;
00143 }

int TPSTest::GetNbinsX (  )  const

Definition at line 145 of file TPSTest.cxx.

References fNbinsX, and fStatus.

00146 {
00147   // Number of X bins (not including u/overflow)
00148   //
00149 
00150   if (fStatus != 0) return -1;
00151   return fNbinsX;
00152 }

int TPSTest::GetNbinsY (  )  const

Definition at line 154 of file TPSTest.cxx.

References fNbinsY, and fStatus.

00155 {
00156   // Number of Y bins (not including u/overflow)
00157   //
00158 
00159   if (fStatus != 0) return -1;
00160   return fNbinsY;
00161 }

int TPSTest::GetNbinsZ (  )  const

Definition at line 163 of file TPSTest.cxx.

References fNbinsZ, and fStatus.

00164 {
00165   // Number of Z bins (not including u/overflow)
00166   //
00167 
00168   if (fStatus != 0) return -1;
00169   return fNbinsZ;
00170 }

double TPSTest::GetProb (  )  const

Definition at line 172 of file TPSTest.cxx.

References fProb, and fStatus.

00173 {
00174   //
00175   // Returns the significance of the hypothesis that both histograms
00176   // were filled from the same ('unknown') probability distribution. We
00177   // assume that the maximum likelihood fit distribution is the source
00178   // PDF, providing the bin-by-bin mean value of the Poisson-distributed
00179   // measurement. The confidence level is then calculated as the total
00180   // probability that the product of bin-by-bin confidence levels is at
00181   // most what is observed.
00182   //
00183   // Total significance (c.l.) is the (N-1)-dimensional integral of
00184   // P = Integral[Q/prod[p_i,{i,0,N-1}],{p_i,0,1}] bounded by the
00185   // (N-1)-dimensional hypercube of total volume 1.0 (where Q is the
00186   // product of significance levels we wish to combine, and N is the
00187   // number of probabilities combined; for us, N = number of bins). The
00188   // general solution to this is: P = Q*Sum[((-LnQ)^k)/k!,{k,0,(N-1)}],
00189   // verified by eqn (2) of: W.A.Wallis, Econometrica 10, 229 (1942).
00190   //
00191   // The quantity -2Ln(Q) explicitly follows a chiSquared probability
00192   // distribution with 2*(# indiv. probabilities) degrees of freedom.
00193   // Note that this statistic is *exact* and NOT an asymptotic form. Also,
00194   // this test statistic is NOT explicitly related to the chi-squared
00195   // goodness-of-fit test!
00196   //
00197   // A word of warning: for very few entries per bin (< ~5), the returned
00198   // probability will be 'low' even for compatible input histograms. The
00199   // cause of this is the assumption that the individual significance
00200   // estimates for each point (bin) are continuous. This assumption is
00201   // OK if you have many bins with a number of entries inconsistent with
00202   // zero, otherwise the discreteness of the Poisson distribution invalidates
00203   // this assumption severely. To remedy this, one must tabulate all the
00204   // possible significance values per bin and enumerate every possible
00205   // product of them across the bins. It is beyond the scope of this
00206   // particular implementation to do so.
00207   //
00208   // This test is not sensitive to the sign of the fluctuations about the
00209   // mean, so may be combined with any of a variety of sign tests to
00210   // increase the power and effect of these tests.
00211   //
00212   // Overflow and Underflow bins are explicitly not included in the
00213   // calculation.
00214   //
00215 
00216   if (fStatus != 0) return 0.;
00217   return fProb;
00218 }

double TPSTest::GetRatio (  )  const

Definition at line 220 of file TPSTest.cxx.

References fRatio, and fStatus.

00221 {
00222   // Ratio of areas of the input histograms (0. < ratio <= 1.)
00223   //
00224 
00225   if (fStatus != 0) return 0.;
00226   return fRatio;
00227 }

int TPSTest::GetStatus (  )  const

Definition at line 229 of file TPSTest.cxx.

References fStatus.

00230 {
00231   // Status flag:
00232   //  -1 = TPSTest is not initialized (add histograms with SetHist)
00233   //   0 = OK
00234   //   1 = One of the histograms does not exist
00235   //   2 = Different histogram types
00236   //   3 = Different number of bins
00237   //   4 = One of the histograms is empty
00238   //   5 = Invalid fit range
00239   //
00240 
00241   return fStatus;
00242 }

void TPSTest::Initialize (  )  [private]

Definition at line 435 of file TPSTest.cxx.

References CalcContents(), CalcLogLikelihood(), CalcProb(), fFit, fH1, fH1Conts, fH1Scale, fH2, fH2Conts, fH2Scale, fLL, fMaxBinX, fMaxBinY, fMaxBinZ, fNbins, fNbinsX, fNbinsY, fNbinsZ, fRatio, fStatus, fZeroBins, and SetStatus().

Referenced by SetBinRangeX(), SetBinRangeY(), SetBinRangeZ(), SetHist(), and TPSTest().

00436 {
00437   // Fills in data members; does all of the initialization(!).
00438   //
00439 
00440   fLL      = -1.;
00441   fH1Conts =  0.;
00442   fH2Conts =  0.;
00443   fH1Scale =  1.;
00444   fH2Scale =  1.;
00445   fRatio   =  0.;
00446   fNbins   = -1 ;
00447   fNbinsX  = -1 ;
00448   fNbinsY  = -1 ;
00449   fNbinsZ  = -1 ;
00450   fZeroBins= -1 ;
00451   fStatus  = -1 ;
00452   if (fFit) delete fFit; fFit = 0;
00453 
00454   // are we OK to proceed?
00455   SetStatus();
00456   if (fStatus == 0) {
00457   // do all the dirty work here . . .
00458     fNbinsX  = fH1->GetNbinsX();
00459     fNbinsY  = 0;
00460     fNbinsZ  = 0;
00461     fNbins   = fNbinsX; // does NOT include under/overflow
00462     fZeroBins= 0; // will be adjusted by CalcProb();
00463 
00464     if (fH1->GetDimension() > 1) {
00465       fNbinsY = fH1->GetNbinsY();
00466       fNbins *= fNbinsY;
00467     }
00468     if (fH1->GetDimension() > 2) {
00469       fNbinsZ  = fH1->GetNbinsZ();
00470       fNbins *= fNbinsZ;
00471     }
00472 
00473     fH1Scale = 
00474       (fH1->GetSumOfWeights()      +
00475        fH1->GetBinContent(0)       +
00476        fH1->GetBinContent(fNbins+1))/
00477       fH1->GetEntries(); // accounts for a TH1::Scale()
00478     fH2Scale =
00479       (fH2->GetSumOfWeights()      +
00480        fH2->GetBinContent(0)       +
00481        fH2->GetBinContent(fNbins+1))/
00482       fH2->GetEntries(); // accounts for a TH1::Scale()
00483 
00484     if (fMaxBinX == 0) fMaxBinX = fNbinsX;
00485     if (fMaxBinY == 0) fMaxBinY = fNbinsY;
00486     if (fMaxBinZ == 0) fMaxBinZ = fNbinsZ;
00487 
00488     fH1Conts = CalcContents(fH1,fH1Scale);
00489     fH2Conts = CalcContents(fH2,fH2Scale);
00490     fRatio   = 0.;
00491     if (fH1Conts > 0 && fH2Conts > 0){
00492       fRatio = (fH1Conts > fH2Conts)?
00493         fH2Conts/fH1Conts :
00494         fH1Conts/fH2Conts ;
00495     }
00496 
00497     CalcLogLikelihood();
00498     CalcProb();
00499   } // end if status is OK
00500 
00501   if (fFit) fFit->SetBit(TH1::kCanRebin, true);
00502 
00503   return;
00504 }

int TPSTest::SetBinRangeX ( int  minBin,
int  maxBin 
)

Definition at line 244 of file TPSTest.cxx.

References fMaxBinX, fMinBinX, fStatus, and Initialize().

00245 {
00246   // Change the bin range in the x-direction; return status
00247   //
00248 
00249   fMinBinX = minBin;
00250   fMaxBinX = maxBin;
00251 
00252   Initialize();
00253 
00254   return fStatus;
00255 }

int TPSTest::SetBinRangeY ( int  minBin,
int  maxBin 
)

Definition at line 257 of file TPSTest.cxx.

References fMaxBinY, fMinBinY, fStatus, and Initialize().

00258 {
00259   // Change the bin range in the y-direction; return status
00260   //
00261 
00262   fMinBinY = minBin;
00263   fMaxBinY = maxBin;
00264 
00265   Initialize();
00266 
00267   return fStatus;
00268 }

int TPSTest::SetBinRangeZ ( int  minBin,
int  maxBin 
)

Definition at line 270 of file TPSTest.cxx.

References fMaxBinZ, fMinBinZ, fStatus, and Initialize().

00271 {
00272   // Change the bin range in the z-direction; return status
00273   //
00274 
00275   fMinBinZ = minBin;
00276   fMaxBinZ = maxBin;
00277 
00278   Initialize();
00279 
00280   return fStatus;
00281 }

int TPSTest::SetHist ( int  histNum,
TH1 *  hist 
)

Definition at line 283 of file TPSTest.cxx.

References fH1, fH2, fStatus, and Initialize().

00284 {
00285   // Change histograms; return status (histNum must be 1 or 2)
00286   //
00287 
00288   if      (histNum == 1) fH1 = dynamic_cast<TH1*>(hist->Clone("fH1"));
00289   else if (histNum == 2) fH2 = dynamic_cast<TH1*>(hist->Clone("fH2"));
00290   else return fStatus;
00291 
00292   Initialize();
00293 
00294   return fStatus;
00295 }

int TPSTest::SetStatus (  )  [private]

Definition at line 506 of file TPSTest.cxx.

References fH1, fH2, fMaxBinX, fMaxBinY, fMaxBinZ, fMinBinX, fMinBinY, fMinBinZ, and fStatus.

Referenced by Initialize().

00507 {
00508   // Make sure our histograms are sufficient to proceed with calculation
00509   // writes detailed warnings to cout if there's a problem.
00510   // Status flag:
00511   //  -1 = TPSTest is not initialized (add histograms with SetHist)
00512   //   0 = OK
00513   //   1 = One of the histograms does not exist
00514   //   2 = Different histogram types
00515   //   3 = Different number of bins
00516   //   4 = One of the histograms is empty
00517   //   5 = Invalid fit range
00518   //
00519 
00520   fStatus  = -1; // not yet set
00521   // check for various error states that would prevent calculation
00522   if (!fH1 || !fH2)
00523     fStatus = 1; // >= 1 histogram does not exist
00524   else {
00525     TClass* cl1 = fH1->Class();
00526     TClass* cl2 = fH2->Class();
00527     if (!(cl1->InheritsFrom(cl2)) ||
00528         !(cl2->InheritsFrom(cl1))  )
00529       fStatus = 2; // different types of histogram
00530     else if ((fH1->GetNbinsX() != fH2->GetNbinsX()) ||
00531              (fH1->GetDimension() > 1 && 
00532               fH1->GetNbinsY() != fH2->GetNbinsY()) ||
00533              (fH1->GetDimension() > 2 && 
00534               fH1->GetNbinsZ() != fH2->GetNbinsZ())  )
00535       fStatus = 3; // different number of bins in each histogram
00536     else if (fH1->GetEntries() <= 0. || fH2->GetEntries() <= 0. )
00537       fStatus = 4; // one of the histograms is empty
00538     else if (fMaxBinX < fMinBinX         ||
00539              fMaxBinY < fMinBinY         ||
00540              fMaxBinZ < fMinBinZ         ||
00541              fMinBinX > fH1->GetNbinsX() ||
00542              fMinBinX > fH2->GetNbinsX() ||
00543              fMinBinY > fH1->GetNbinsY() ||
00544              fMinBinY > fH2->GetNbinsY() ||
00545              fMinBinZ > fH1->GetNbinsZ() ||
00546              fMinBinZ > fH2->GetNbinsZ() ||
00547              fMaxBinX < 0                ||
00548              fMaxBinY < 0                ||
00549              fMaxBinZ < 0                 )
00550       fStatus = 5; // histogram range is wrong
00551     else
00552       fStatus = 0; // we're A-OK
00553   } // end else: both histograms exist
00554 
00555   return fStatus;
00556 }


Member Data Documentation

TH1* TPSTest::fFit [private]

Definition at line 53 of file TPSTest.h.

Referenced by CalcLogLikelihood(), CalcProb(), GetFit(), Initialize(), TPSTest(), and ~TPSTest().

TH1* TPSTest::fH1 [private]

Definition at line 54 of file TPSTest.h.

Referenced by CalcLogLikelihood(), CalcProb(), Initialize(), SetHist(), SetStatus(), TPSTest(), and ~TPSTest().

double TPSTest::fH1Conts [private]

Definition at line 56 of file TPSTest.h.

Referenced by CalcLogLikelihood(), CalcProb(), GetInt(), Initialize(), and TPSTest().

double TPSTest::fH1Scale [private]

Definition at line 58 of file TPSTest.h.

Referenced by CalcLogLikelihood(), CalcProb(), and Initialize().

TH1* TPSTest::fH2 [private]

Definition at line 55 of file TPSTest.h.

Referenced by CalcLogLikelihood(), CalcProb(), Initialize(), SetHist(), SetStatus(), TPSTest(), and ~TPSTest().

double TPSTest::fH2Conts [private]

Definition at line 57 of file TPSTest.h.

Referenced by CalcLogLikelihood(), CalcProb(), GetInt(), Initialize(), and TPSTest().

double TPSTest::fH2Scale [private]

Definition at line 59 of file TPSTest.h.

Referenced by CalcLogLikelihood(), CalcProb(), and Initialize().

double TPSTest::fLL [private]

Definition at line 60 of file TPSTest.h.

Referenced by CalcLogLikelihood(), GetLogLikelihood(), Initialize(), and TPSTest().

int TPSTest::fMaxBinX [private]
int TPSTest::fMaxBinY [private]
int TPSTest::fMaxBinZ [private]
int TPSTest::fMinBinX [private]

Definition at line 61 of file TPSTest.h.

Referenced by CalcContents(), CalcLogLikelihood(), CalcProb(), SetBinRangeX(), SetStatus(), and TPSTest().

int TPSTest::fMinBinY [private]

Definition at line 63 of file TPSTest.h.

Referenced by CalcContents(), CalcLogLikelihood(), CalcProb(), SetBinRangeY(), SetStatus(), and TPSTest().

int TPSTest::fMinBinZ [private]

Definition at line 65 of file TPSTest.h.

Referenced by CalcContents(), CalcLogLikelihood(), CalcProb(), SetBinRangeZ(), SetStatus(), and TPSTest().

int TPSTest::fNbins [private]

Definition at line 67 of file TPSTest.h.

Referenced by CalcLogLikelihood(), CalcProb(), GetNbins(), Initialize(), and TPSTest().

int TPSTest::fNbinsX [private]

Definition at line 68 of file TPSTest.h.

Referenced by GetNbinsX(), Initialize(), and TPSTest().

int TPSTest::fNbinsY [private]

Definition at line 69 of file TPSTest.h.

Referenced by GetNbinsY(), Initialize(), and TPSTest().

int TPSTest::fNbinsZ [private]

Definition at line 70 of file TPSTest.h.

Referenced by GetNbinsZ(), Initialize(), and TPSTest().

double TPSTest::fProb [private]

Definition at line 71 of file TPSTest.h.

Referenced by CalcProb(), and GetProb().

double TPSTest::fRatio [private]

Definition at line 72 of file TPSTest.h.

Referenced by GetRatio(), Initialize(), and TPSTest().

int TPSTest::fStatus [private]
int TPSTest::fZeroBins [private]

Definition at line 74 of file TPSTest.h.

Referenced by CalcProb(), Initialize(), and TPSTest().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1