Hello,
I have a problem when using Roofit to do simultaneous fit of 3 mass spectra (3 years of data). I created previously 3 datasets, one for each year. I add a tag to each dataset, indicating which year it is, append all the data in dataset data1,
RooCategory tagCat(“tagCat”,“tagging Category”) ;
tagCat.defineType(“dat04”);
tagCat.defineType(“dat03”);
tagCat.defineType(“dat06”);
tagCat.setLabel(“dat04”) ;
data1->addColumn(tagCat) ;
tagCat.setLabel(“dat03”) ;
data2->addColumn(tagCat) ;
tagCat.setLabel(“dat06”) ;
data3->addColumn(tagCat) ;
data1->append(*data2) ;
data1->append(data3) ;
RooSimultaneous sum(“sum”, “sum”, tagCat) ;
sum.addPdf(sum1,“dat04”) ;
sum.addPdf(sum2,“dat03”) ;
sum.addPdf(sum3,“dat06”) ;
RooFitResult r1 = sum.fitTo(*data1, Range(1.4,3.5), Extended(true), Save(true)) ;
data1->plotOn(xframe1,Cut(“tagCat==tagCat::dat04”),MarkerSize(0.5)) ;
data1->statOn(xframe1,What(“N”),Cut(“tagCat==tagCat::dat04”)) ;
tagCat=“dat04”;
sum.plotOn(xframe1,Slice(tagCat),ProjWData(RooArgSet(tagCat,psimass),*data1));
sum.paramOn(xframe1,Parameters(RooArgSet(nsig1,sigmean,sigwidth1,nbkg1,slope1)),Layout(0.12,0.65,0.44));
xframe1->Draw();
…
My problem is that the first 2 datasets are complete, but the 3rd is truncated (although no
error or warning message is shown). When I run it, it produces the fits, but the number of entries in the 3rd set is smaller than it should, and error messages appear:
[#0] ERROR:Fitting – RooAbsTestStatistic::initSimMode: creating slave GOF calculator #0 for state dat04 (303 dataset entries)
[#0] ERROR:Fitting – RooAbsTestStatistic::initSimMode: creating slave GOF calculator #1 for state dat03 (628 dataset entries)
[#0] ERROR:Fitting – RooAbsTestStatistic::initSimMode: creating slave GOF calculator #2 for state dat06 (385 dataset entries)
The last line shows that it reads 385 entries instead of some 600.
What am I doing wrong? Please help me, I already lost more than 3 days trying to fix this.
Regards,
Catarina
======================================