Yes of course.
TChain chain("h1");
chain.Add("/home/emanuele/Scrivania/MC_double_corps_decay/SelppMC_0_9.root");
chain.Add("/home/emanuele/Scrivania/MC_double_corps_decay/SelppMC_10_29.root");
chain.Add("/home/emanuele/Scrivania/MC_double_corps_decay/SelppMC_30_50.root");
TChain chain1("h1");
chain1.Add("/home/emanuele/Scrivania/D_double_corps_decay/SelppD_0_9.root");
chain1.Add("/home/emanuele/Scrivania/D_double_corps_decay/SelppD_10_29.root");
chain1.Add("/home/emanuele/Scrivania/D_double_corps_decay/SelppD_30_50.root");
TH1D *hma1 = new TH1D("hma1","1", 200, 475., 510.);
//Here I create 2 chains and the 1D Histograms (I decide to use only one)
RooRealVar x("x","x",475,510);
chain.Draw("Variable>>hma1","Cuts that I want to add");
//Here I draw on the first Histogram the Variable that I want (with the cuts)
RooDataHist data("data","data",x,hma1);
RooHistPdf histpdf1("histpdf1","histpdf1",x,data,0);
chain1.Draw("Variable>>hma1","The same cuts");
RooDataHist data1("data1","data1",x,hma1);
histpdf1.fitTo(data1);
RooPlot* frame1 = x.frame(Title("..." ),Bins(200));
data1.plotOn(frame1);
histpdf1.plotOn(frame1);
frame1->Draw();
//I do the same for the DATA Values and with "RooDataHistpdf"
//I take the shape of the MC Histogram.
//At the end the program overlap the MC histogram to the DATA's one
This program is only able to Overlap the first shape to the second one. It seems that the line “histpdf1.fitTo(data1)” doesn’t work, cause it doesn’t call MINOS in order to do the fit of the second histogram.
How can I do it?
Thanks in advance.