I’m trying to compute CLs limit for a simple cut-and-count measurement using StandardHypoTestInvDemo.
The number of expected background events is obtained from the sidebands, using a transfer factor.
Using the StandardHypoTestInvDemo with AddOverallSys to take those into account, the expected CLs ± 1 sigma band is tiny, which look suspicious, and is probably not correct since we should take into account the Poissonian errors on the number of events in the sideband.
My question is how to do that in the RooHistFactory framework ?
I give it a try in the code [here](https://www.cppm.in2p3.fr/~serrano/StandardHypoTestInvDemo_test0.C)
This is a simple cut and count experiment where a sideband region is used to constraint the background yield.
However,there are two issues:
the errors on the transfert factor from the SB region to the signal region is not taken into account. They are asymmetric and not Gaussian, how is it possible to implement them ?
the code crashes with a segmentation violation that I don’t understand.
If there exist an example of a Roostat code using the ABCD method, that would help.
Let me try to reformulate the question, since I found a bug in my previous code.
I’m doing a simple cut and count experiment with 1-bin histogram.
The number of expected background b is taken from the sidebands and multiplied by a transfer factor, which has asymmetric errors (the transfer factors is taken from 2 other control regions):
transfer factor = 0.33 + 0.61 - 0.28
I believe the errors on the transfer factor should be Poissonian, and not Gaussian constraint.
How can I take into account the fact that they are asymmetric ?
Here is the code I use:
meas.SetPOI("mu");
meas.SetLumi(1.0);
meas.AddConstantParam("Lumi");
HistFactory::Channel channel("SignalRegion");
channel.SetData(hobs);
HistFactory::Sample signal("signal");
signal.AddNormFactor("mu",1,0,0.0000005); //that's the BR
signal.AddOverallSys("sig_unc", err_sig_dw,err_sig_up );
signal.SetHisto(hs);
channel.AddSample(signal);
HistFactory::Sample backg("background");
Double_t transfert = 0.33;
Double_t transfert_low = 0.33 ;
Double_t transfert_up = 0.83;
TH1D *unit = new TH1D("unit","unit",1,0,1);
unit->SetBinContent(1,1);
backg.SetHisto(unit);
backg.AddNormFactor("Transfert",transfert, 0., 3.0);
meas.AddConstantParam("Transfert");
// backg.AddOverallSys("transfert_err", 1-transfert_low/transfert, 1+ transfert_up/transfert ); // this is a Gaussian constraint
channel.AddSample(backg);
meas.AddChannel(channel);
meas.AddGammaSyst("transfer", transfert_up/transfert ); // this is a Poisson constrait, taking the max of the up and down uncertainties
HistFactory::Channel SB("SBRegion"); // no signal here
Double_t nobsSB=2.0;
SB.SetData(nobsSB);
HistFactory::Sample backgSB("background");
backgSB.SetHisto(unit);
backgSB.ActivateStatError(); // I think this should not be here but it crashes otherwise...
SB.AddSample(backgSB);
meas.AddChannel(SB);
RooWorkspace * w = HistFactory::MakeModelAndMeasurementFast(meas);