Hi,
I want to create a RooHistPdf from an observable in a dataset. The twist is that I don’t want to use the observable as it is, but apply a formula to it, but I can’t seem to do this since a RooFormulaVar isn’t of “fundamental” type. This code snippet reproduces my problem:
{
using namespace RooFitShortHand;
RooRealVar sigma(“sigma”,“sigma”,0.0,0.2);
RooLandau sigma_dist(“sigma_dist”,“sigma_dist”,sigma, C(0.05),C(0.01));
RooDataSet *datasigma = sigma_dist.generate(RooArgSet(sigma),5000);
RooFormulaVar d1(“d1”,“sqrt(@0)”,RooArgSet(sigma));
RooDataHist h1(“h1”,“h1”,d1,*datasigma);
RooHistPdf (“h1pdf”,“h1pdf”,d1,h1);
}
which gives me the error
RooAbsSet::initialize(h1): Data set cannot contain non-fundamental types, ignoring d1
Does anyone know what I am doing wrong here? Is there another way to do this?
cheers
Aras