I am currently attempting to make a fit that would include the heaviside function, however any attempt so far has resulted in an error. Here is what I believed to be the closest to correct that I have managed:
Thank you, I took a look at the page, however I cannot find more information as to how I would write the heaside function into my fit function. When I run the line I have written above I get the following errors:
[quote]Error in TFormula::Compile: Bad numerical expression : "(x-)(TMath::Erf((x-)/)))RooStats::Heaviside(x-)"
Error in TF1::TF1: function: errorFit/(x-)*(TMath::Erf((x-)/)))RooStats::Heaviside(x-)+ has 0 parameters instead of 1
Error in : function is zombie[/quote]
I know that the Erf works fine since it returned no errors prior to inserting the heaviside function.
You should have noticed by now that RooStats::Heaviside is a class, not a mathematical function: [url]Are Heaviside and DiracDelta functions defined in ROOT?
You might try something like this (but I don’t guarantee that it works): TF1 *efit = new TF1("errorFit", "*(x-)*(TMath::Erf((x-)/))*(x> ? 1.0 : 0.0)+", start, (start+a+b));
You can use the RooStats::Heaviside for fitting in ROOT (i.e. without using RooFit), you just need to create a TF1 from it. You can do it, as for all other RoOFit classes implementing the RooAbsReal interface, by using the
see root.cern.ch/root/html/RooAbsRea … sReal:asTF