Dear Rooters,
I have a problem with drawing data, I put this code and I got a plot, but it is false, the first point in the plot is very high and the rest points are almost horizontal line, the expected plot is almost Gaussian distribution, so please help me, I am biggener.
Regards
//******************************************************************************************************
TChain* t1=new TChain("kpi");
t1->Add("dstar11_all.root");
int nevt = (int) t1->GetEntries();
Double_t dm1;
Double_t md1;
t1->SetBranchAddress("D0_M", &md1);
t1->SetBranchAddress("massDifferenceMB__bo0__bc", &dm1);
RooRealVar D0_M("mass","mass",1.83,1.89,"GeV/c^{2}");
RooDataSet *data = new RooDataSet("data","data",RooArgSet(D0_M));
for (Int_t i = 0; i < nevt; i++)
{
t1->GetEntry(i);
D0_M.setVal(md1);
if(dm1 > 0.143 && dm1 < 0.147) continue;
data->add(RooArgSet(D0_M));
}
TCanvas *c1 = new TCanvas("c1","m(D)",1000,500);
c1->Divide(1,1);
RooPlot *mdplot = data->plotOn(D0_M.frame(100));
data->plotOn(mdplot);
mdplot->Draw();
mdplot->GetYaxis()->SetTitle("Events");
}