Shape Based Analysis using TSPlot

Howdy Rooters,
I’m working on some code to use TSPlot to make comparisons between background only and signal + background histograms. Right now, I’m testing it using two different gaussian distributions. Eventually I’d like to say something about signal likelihood. I don’t understand the output and have a feeling I am doing something wrong. Here is my code:

[code]
#include “TSPlot.h”
#include “TTree.h”
#include “TH1.h”
#include “TCanvas.h”
#include “TFile.h”
#include “TPaveLabel.h”
#include “TPad.h”
#include “TPaveText.h”
#include “Riostream.h”

#include <math.h>
#include
#include
#include “TBranch.h”
#include “TH1F.h”
#include “TTreeReader.h”
#include “TTreeReaderArray.h”

void ToyGaussians_Splot(){

TFile *file = TFile::Open(“ToyGaussians_1.root”);
TTree t1 = (TTree)file->Get(“t1”);

TSPlot *splot = new TSPlot(1, 1, 100000, 2, t1);
splot->SetTreeSelection(“n1_branch:n2_branch:n1_branch:n2_branch”);
Int_t ne[2];
ne[0]=100000; ne[1]=100000;
splot->SetInitialNumbersOfSpecies(ne);
splot->MakeSPlot(“VV”);
splot->FillSWeightsHists(100);
}[/code]

n1_branch and n2_branch are the histograms read in from a root files. They each have 100,000 events. Here is the output when I run the code:


** 1 **SET PRINT 0


PARAMETER DEFINITIONS:
NO. NAME VALUE STEP SIZE LIMITS
1 1.00000e+05 1.00000e+00 no limits
2 1.00000e+05 1.00000e+00 no limits


** 2 **MIGRAD


MIGRAD MINIMIZATION HAS CONVERGED.
MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
FCN=-3.0262e+06 FROM MIGRAD STATUS=CONVERGED 73 CALLS 74 TOTAL
EDM=9.22077e-06 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 2.17226e+04 7.70644e+02 2.55976e+02 -7.64757e-06
2 7.82769e+04 8.04421e+02 2.67150e+02 -1.12430e-05
estimated #of events in species 0 = 21722.621830
estimated #of events in species 1 = 78276.855473

checking sum of weights[0]=23488.788460
checking sum of weights[1]=76691.873710


** 3 **SET PRINT 0


PARAMETER DEFINITIONS:
NO. NAME VALUE STEP SIZE LIMITS
1 2.17226e+04 1.00000e+00 no limits
2 7.82769e+04 1.00000e+00 no limits


** 4 **MIGRAD


MIGRAD MINIMIZATION HAS CONVERGED.
MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
FCN=-2.10259e+06 FROM MIGRAD STATUS=CONVERGED 28 CALLS 29 TOTAL
EDM=2.91384e-07 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 2.17228e+04 5.95731e+03 7.08022e+01 -2.41321e-06
2 7.82771e+04 5.95731e+03 7.08022e+01 -2.41321e-06
estimated #of events in species 0 = 21722.825507
estimated #of events in species 1 = 78277.059151

checking sum of weights[0]=50035.289741
checking sum of weights[1]=50035.289741

Any pointers or advice is greatly appreciated. :smiley: Thanks a lot!