I’m trying to display a RooPlot of an invariant mass distribution but I can’t get the Plot to display events from y=0. I have tried the following:
#Make my shapes (gaussian, exponential, etc)
#Make a list of them
#Then make my model
model = ROOT.RooAddPdf("model" , "model", argList, normArgList)
rHist = ROOT.RooDataHist("rHist", "rHist", ROOT.RooArgList(var), h)
rHist.SetNameTitle("rHist" , T)
#Make the frame
frame = var.frame()
for i in range(len(components)):
model.plotOn(frame, ROOT.RooFit.Components(components[i]), ROOT.RooFit.LineColor(colours[i]), ROOT.RooFit.LineStyle(2))
This however does not display the y axis until 0. I have tried placing the #SetMinimum(0) before plotting the models onto the frame as well. Still does not work
Any help is appreciated
I am inviting @StephanH to this post, as he may know the answer to this question.
Hi @Diyon335, according to RooPlot doxygen you can GetYaxis(). SetRangeUser(0,MaxValue).hopefully this will work
@RENATO_QUAGLIANI , thanks for your response. I just tried it but it still does not work
I am also inviting @moneta to this post. He might help to shed some light on this.
I have tried all the suggestions but as you can see, it does not go all the way to y = 0. is there some sort of override I must do in order to force it? because it seems to me that no matter what I do, ROOT just does not listen
Strange that the above line does not work. Can you please save the RooPlot object in a ROOT file and post it, so I can have a look ?
@moneta , unfortunately my permission to do this is restricted. is there any other way you could help me out?
If you don’t want to share the plot with everybody, (although you have already added the figure), you can always send it to me by private email
@moneta, sorry I should have explained better. I believe the way my Nikhef account has been set does not allow me to scp files via the remote server and my local machine. Therefore I am not able to get the file and upload it. These plots were screenshots I took
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.