// part 1, hypothesis testing SimpleLikelihoodRatioTestStat * testStat = new SimpleLikelihoodRatioTestStat(*bConfig->GetPdf(), *sbConfig->GetPdf()); testStat->SetNullParameters(*bConfig->GetSnapshot()); testStat->SetAltParameters(*sbConfig->GetSnapshot()); HybridCalculator * hypoCalc = new HybridCalculator(*data, *sbConfig, *bConfig); hypoCalc->SetToys(10000, 10000); hypoCalc->ForcePriorNuisanceAlt(*sbConfig->GetPriorPdf()); hypoCalc->ForcePriorNuisanceNull(*bConfig->GetPriorPdf()); ToyMCSampler * sampler = (ToyMCSampler *)hypoCalc->GetTestStatSampler(); sampler->SetNEventsPerToy(0); sampler->SetTestStatistic(testStat); HypoTestResult * htr = hypoCalc->GetHypoTest(); //htr->SetPValueIsRightTail(false); //htr->SetBackgroundAsAlt(true); htr->Print(); // how to get meaningfull CLs at this point? // part 2, inversion SimpleLikelihoodRatioTestStat * testStatFlip = new SimpleLikelihoodRatioTestStat(*sbConfig->GetPdf(), *bConfig->GetPdf()); testStatFlip->SetNullParameters(*sbConfig->GetSnapshot()); testStatFlip->SetAltParameters(*bConfig->GetSnapshot()); HybridCalculator * hypoCalcFlip = new HybridCalculator(*data, *bConfig, *sbConfig); hypoCalcFlip->SetToys(10000, 10000); hypoCalcFlip->ForcePriorNuisanceAlt(*sbConfig->GetPriorPdf()); hypoCalcFlip->ForcePriorNuisanceNull(*bConfig->GetPriorPdf()); ToyMCSampler * samplerFlip = (ToyMCSampler *)hypoCalcFlip->GetTestStatSampler(); samplerFlip->SetNEventsPerToy(0); samplerFlip->SetTestStatistic(testStatFlip); //htr = hypoCalcFlip->GetHypoTest(); //htr->Print(); HypoTestInverter * inverter = new HypoTestInverter(*hypoCalcFlip); inverter->SetConfidenceLevel(0.95); //inverter->UseCLs(false); inverter->SetFixedScan(5, 0.2, 0.8); HypoTestInverterResult * invResult = inverter->GetInterval();