Dear experts,
Recently I tried using RooUnblindPrecision to perform a blind analysis, but will always get wrong fitting results. In the following code, RooLLbarEdmPdf is a diy PDF model and has 4 free parameters (a1, a2, Rg2, Ig2). I want to blind the parameter “a1” in this fit, and the details are as follows:
void fit_blind(){
gSystem->Load("libPhysics");
R__LOAD_LIBRARY(/home/jyzhang/Tools/RooLLbarEdmPdf/lib/libRBW.so);
// Creat instance of RooLLbarEdmPdf
// Definate kinematic variables
RooRealVar Theta("Theta","Theta",-3.15,3.15);
RooRealVar Theta1("Theta1","Theta1",-3.15,3.15);
RooRealVar Theta2("Theta2","Theta2",-3.15,3.15);
RooRealVar Phi1("Phi1","Phi1",-3.15,3.15);
RooRealVar Phi2("Phi2","Phi2",-3.15,3.15);
// Definate free parameters
RooRealVar a1("a1","a1",0.7,-100,100);
RooRealVar a2("a2","a2",-0.7,-1.0,0.0);
RooUnblindPrecision a1_blind("a1_blind","a1_blind","TheBlindingString",0.7,10,a1);
RooRealVar PL("PL","PL",0); // fix to 0
RooRealVar Rg1("Rg1","Rg1",1.14e-3);
RooRealVar Ig1("Ig1","Ig1",0.0); // fix to 0
RooRealVar Rg2("Rg2","Rg2",0.689e-3,0.0,5e-2);
RooRealVar Ig2("Ig2","Ig2",0.645e-3,0.0,5e-2);
RooRealVar RFA("RFA","RFA",0); // fix to 0
RooRealVar IFA("IFA","IFA",0); // fix to 0
RooRealVar RHT("RHT","RHT",0); // fix to 0
RooRealVar IHT("IHT","IHT",0); // fix to 0
PL.setConstant();
Rg1.setConstant();
Ig1.setConstant();
RFA.setConstant();
IFA.setConstant();
RHT.setConstant();
IHT.setConstant();
// Construct virtual PDF
RooLLbarEdmPdf *pdf = new RooLLbarEdmPdf("pdf","pdf",Theta,Theta1,Theta2,Phi1,Phi2,a1_blind,a2,PL,Rg1,Ig1,Rg2,Ig2,RFA,IFA,RHT,IHT,true,1);
// Read toy phspMC
pdf->readMC("./toy_phsp_1e7.dat", "sig", "");
// Read toy data
RooRealVar Weight("Weight","Weight", -2.0, 2.0);
RooArgSet theSet(Theta,Theta1,Theta2,Phi1,Phi2,Weight);
RooDataSet *data6 = pdf->readData("./toy_data_2e5.dat", "sig", "", theSet);
RooDataSet *data = new RooDataSet( data6->GetName(),
data6->GetTitle(),
data6, *data6->get(), 0, Weight.GetName());
RooFitResult *result = pdf->fitTo(*data, Save(kTRUE));
a1.Print();
a1_blind.Print();
cout << a1_blind.getVal() << endl ;
result->Print("v");
return;
}
The input value of parameters are a1 = 0.7519, a2 = -0.7559, Rg2 = 0.689e-3, Ig2 = 0.645e-3.
However the fitting results are:
ERR MATRIX NOT POS-DEF
PARAMETER CORRELATION COEFFICIENTS
NO. GLOBAL 1 2 3 4
1 0.99900 1.000 -0.133 -0.999 0.101
2 0.13276 -0.133 1.000 0.133 -0.013
3 0.99900 -0.999 0.133 1.000 -0.101
4 0.10137 0.101 -0.013 -0.101 1.000
ERR MATRIX NOT POS-DEF
[#1] INFO:Minimization -- RooAbsMinimizerFcn::setOptimizeConst: deactivating const optimization
RooRealVar::a1 = 8.626 +/- 0.199235 L(-100 - 100)
RooUnblindPrecision::a1_blind[ state=dummyBlindState value=a1 ] = (hidden)
0.268948
RooFitResult: minimized FCN value: -1565.36, estimated distance to minimum: 555730
covariance matrix quality: Full matrix, but forced positive-definite
Status : MINIMIZE=-1 HESSE=4
Constant Parameter Value
-------------------- ------------
IFA 0.0000e+00
IHT 0.0000e+00
Ig1 0.0000e+00
PL 0.0000e+00
RFA 0.0000e+00
RHT 0.0000e+00
Rg1 1.1400e-03
Floating Parameter InitialValue FinalValue +/- Error GblCorr.
-------------------- ------------ -------------------------- --------
Ig2 6.4500e-04 3.4122e-05 +/- 4.79e-03 <none>
Rg2 6.8900e-04 9.5350e-04 +/- 3.41e-07 <none>
a1 7.0000e-01 8.6260e+00 +/- 1.99e-01 <none>
a2 -7.0000e-01 -7.2559e-03 +/- 1.78e-05 <none>
It seems that I get a wrong fitting results, but if I use parameter “a1” to construct PDF:
RooLLbarEdmPdf *pdf = new RooLLbarEdmPdf(“pdf”,“pdf”,Theta,Theta1,Theta2,Phi1,Phi2,a1,a2,PL,Rg1,Ig1,Rg2,Ig2,RFA,IFA,RHT,IHT,true,1);
Then I will get a correct fitting results:
RooFitResult: minimized FCN value: -16454.1, estimated distance to minimum: 2.15989e-07
covariance matrix quality: Full, accurate covariance matrix
Status : MINIMIZE=0 HESSE=0
Constant Parameter Value
-------------------- ------------
IFA 0.0000e+00
IHT 0.0000e+00
Ig1 0.0000e+00
PL 0.0000e+00
RFA 0.0000e+00
RHT 0.0000e+00
Rg1 1.1400e-03
Floating Parameter InitialValue FinalValue +/- Error GblCorr.
-------------------- ------------ -------------------------- --------
Ig2 5.0000e-05 6.4853e-04 +/- 6.05e-06 <none>
Rg2 5.0000e-05 6.8216e-04 +/- 9.02e-06 <none>
a1 7.0000e-01 7.5818e-01 +/- 9.52e-03 <none>
a2 -7.0000e-01 -7.4815e-01 +/- 9.40e-03 <none>
I don’t know what happend? Is there a problem with my method of using RooUnblindPrecision? I look forward to hearing from you, thank you so much for your help.
Best regards,
Jianyu