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.
are you sure you placed the braces correctly? The indentation looks like it’s off, but it’s hard to say if the braces are correct, as there’s one more closing brace.
Is this what you tried to do, i.e. you want to skip the event if the mass is between 0.143 and 0.147?
for (Int_t i = 0; i < nevt; i++) {
t1->GetEntry(i);
if(0.143 < dm1 && dm1 < 0.147)
continue;
D0_M.setVal(md1);
data->add(RooArgSet(D0_M));
}
This indicates that you might be filling the dataset, although you didn’t intend to do that. Look for something like this:
//Wrong: It always fills but only sometimes sets a new value
if (.....)
D0_M.setVal(xxx);
data->add(...);
// Right: It only sets and fills if desired
if (....) {
D0_M.setVal(xxx);
data->add(...);
}