When searching for new particles, my typical workflow involves stacking background histograms in a THStack while keeping the signal separate in a TH1D. With multiple processes, this requires creating many histograms, carefully handling error bars and systematics, stacking, managing legends, and drawing on a canvas.
While this is manageable for a single plot, it becomes tedious and error-prone when producing many plots for different variables. The code quickly becomes difficult to maintain.
Has ROOT developed a dedicated class or tool to streamline this process and manage these tasks in a more robust, professional manner?
My first answer is: no, ROOT does not have such a tool. However, I’m not entirely sure I fully understand what you’re trying to do. From what I gather, you’d like to generalize a certain process. Could you share a simple example so I can see whether it’s possible to generalize it using standard ROOT tools?
Your Python module EventsFillerClass.py seems to be a powerful tool for working with TH1D objects, distinguishing backgrounds from signals, stacking background histograms, and visualizing signals individually in an automatic way. It’s great that you published it on the ROOT forum.
You might consider moving the post to the My ROOT App and Ideas category to receive more user feedback, perhaps adding a concrete example to illustrate how it works ?