Hi all-
This question is probably stupid and I am just off by a line or an option, but I cannot get this to work. All I am trying to do is fit an exponential using the RooDecay pdf. The code is copied and pasted below. I am trying to do this unbinned and it spits out that the value of tau is nan. If I fix it to 0.002 and just draw it to see how close I am, it’s right on top of the points. Am I missing an option to fitTo()? Thanks!
Leah
TFile *open =new TFile(“signalMC_masslifetime_allcuts1st.root”,“READ”);
TTree tree = (TTree) open->Get(“LifetimeInfo”);
RooRealVar truedecay(“truedecay”,“truedecay”,-0.005,0.02);
RooDataSet data(“data”,“data”,tree,truedecay);
RooTruthModel noRes(“noRes”,“Truth Model”,truedecay);
RooRealVar tau(“tau”,“lifetime”,0.002,0.02,0.1);
RooDecay decay(“decay”,“decaymodel”,truedecay,tau,noRes,RooDecay::SingleSided);
decay.fitTo(data);