RooMCStudy with varying fractional contributions

Hello all,

We’re trying to perform a linearity test and pull calculations for our analysis, and it seems that RooMCStudy would give us the tools we need to do this, but there are a few questions we have regarding setting this up. In general, our model is set up as this (using the code at the end):

model = nbkg * PDF_bkg + nsig * (fcorr*PDF_sig(corr) + (1-fcorr)*PDF_sig(nocorr) )

The PDFs here are generated from MC@NLO both with and without spin correlation. Our goal is to perform a linearity test where these MC studies are done with a range of fcorr values from, for example, 0 to 2 at .25 intervals, with pull calculations done for each.

Is this something that RooMCStudy is capable of? If so, what would be the appropriate method for doing so?

My assumption is that I’d need to generate a toy data set from the model itself, with fcorr overrided to be the values I desire for the linearity test. I’m not certain how to accomplish this, however. Can you offer any guideance?

Thanks,
Aiken

RooRealVar x(“x”,“x”,-1,1);
RooRealVar fcorr(“fcorr”, “f_{corr}”, 0.001, 0., 2.);
RooRealVar nbkg(“nbkg”,“number of background events”,bgEstimate,bgEstimate,bgEstimate);
RooRealVar nsig(“nsig”,“number of signal events”,8000,0,150000);

RooDataHist fullCorrTemp(“fullCorrTemp”,“fullCorrTemp”,x,Corr_TemplateHist);
RooHistPdf fullCorrPdf(“fullCorrPdf”,“fullCorrPdf”,x,fullCorrTemp,0);

RooDataHist noCorrTemp(“noCorrTemp”,“noCorrTemp”,x,NoCorr_TemplateHist);
RooHistPdf noCorrPdf(“noCorrPdf”,“noCorrPdf”,x,noCorrTemp,0);

RooDataHist bgTemp(“bgTemp”, “bgTemp”, x, BG_TemplateHist);
RooHistPdf bgPdf(“bgPdf”, “bgPdf”, x, bgTemp, 0);

RooDataHist hData(“hData”,“hData”,x,Data_Hist);

RooAddPdf sigPdf(“sigPdf”, “sigPdf”, RooArgList(fullCorrPdf, noCorrPdf), fcorr);

I found this within the online tutorials and was playing with it as a way to constrain fcorr. I just narrowed the gaussian used to constrain the distribution of fcorr…it seemed reasonable, but I’m still not certain that that this is the appropriate way of doing this.

Would this be the correct way to generate toy data sets with specific fcorr for mc studies?

Thanks,
Aiken

//----------------------------------------- MC STUDY (TEST) ----------------------------------------
// Construct constraint on parameter f
RooGaussian fconstraint(“fconstraint”,“fconstraint”,fcorr,RooConst(0.99),RooConst(1.01)) ;

// Multiply constraint with p.d.f
RooProdPdf modelc(“sumc”,“sum with constraint”,RooArgSet(model,fconstraint)) ;

RooMCStudy* mcstudy = new RooMCStudy(modelc,x,Constrain(fcorr),Extended(),FitOptions(Save(kTRUE)));
mcstudy->generateAndFit(500,2000);

// Make plot of distribution of generated value of f parameter
TH1* h_f_gen = modelc.fitParDataSet().createHistogram(“f_gen”,-40) ;

// Make plot of distribution of fitted value of f parameter
RooPlot* frame1 = modelc.plotParam(fcorr,Bins(40)) ;
frame1->SetTitle(“Distribution of fitted fcorr values”) ;

// Make plot of pull distribution on f
RooPlot* frame2 = modelc.plotPull(fcorr,Bins(40),FitGauss()) ;
frame1->SetTitle(“Distribution of fcorr pull values”) ;

TCanvas* c = new TCanvas(“rf804_mcstudy_constr”,“rf804_mcstudy_constr”,1200,400) ;
c->Divide(3) ;
c->cd(1) ; gPad->SetLeftMargin(0.15) ; h_f_gen->GetYaxis()->SetTitleOffset(1.4) ; h_f_gen->Draw() ;
c->cd(2) ; gPad->SetLeftMargin(0.15) ; frame1->GetYaxis()->SetTitleOffset(1.4) ; frame1->Draw() ;
c->cd(3) ; gPad->SetLeftMargin(0.15) ; frame2->GetYaxis()->SetTitleOffset(1.4) ; frame2->Draw() ;