Missing "Option" definition, link or example on ROOT website

Dear all,
I have one example, then you may apply this to other examples to generalize the problem.
Every time I look at some method corresponding to any Class in ROOT website, it sometimes states there is an “option” part to you add when you use the method. I click on that option to see what it was meant, but there was no link. Is that word of “option” has some universal usage in ROOT manual that I am not aware of?

Example: For TH1, there is a method integral:

Here is the link : ROOT: TH1 Class Reference (cern.ch)
In the photo you can see the option part, and I don’t see any example. Thus, sadly I don’t know how to use it. (This is my bad.)
In the explanation, it says “if option “width” is specified, the integral is the sum of the bin contents multiplied by the bin width in x.” Can you give me one little example? Could you please also tell me how I know what my options are?

My two cents:
I also think this is something that should be documented on the Class Reference pages.
As long as it isn’t. if you continue reading the description, at the bottom it usually says “Definition at line XXX…”; if you follow the link of that line number, it takes you to the actual code, where you may find the options (you have to read the code and find what it’s doing to the “option” string that was passed). In the case of the Integral you show (the second method listed, i.e. 2/2), it actually calls the first Integral method (1/2), described just above it, and the code for that one shows that it calls DoIntegral, passing the option string as-is.
DoIntegral converts the string to lowercase and then checks whether it contains the characters “width” to do something, and something else otherwise; see the lines

   TString opt = option;
   Bool_t width   = kFALSE;
   if (opt.Contains("width")) width = kTRUE;

As there are no other checks on “option” or function calls using it, I’d say that’s the only option for this method.
I think, however, that the user should not need to go through all this just to find out this kind of information, and some reference pages do list options for some functions, but many do not, and even going through the code like above, I have found places that seem to lead to a dead end with no solution, so I agree that the documentation could be improved.

Thanks a lot. I agree about what you said. Since my Ph.D, I follow the website not so frequently, but when I needed. I appreciate with all the efforts that ROOT team put on the website. For the last 10 years, it has been updated so nicely and efficiently. Of course, there will be new updates that the users demand in the future, and that’s how it works in terms of development.

For the previous issue, I usually have a quick look at the actual code to understand some explanations in the website. Most of the time, it happens when I work on an article or some task I need to finish in time. Not always, I have enough time to go through the origin of the explanations. For me, it becomes a distraction more than a help. I lost my track on what I was actually doing on my article as an example.

Anyway, my expectation is something like that page: ROOT: THistPainter Class Reference (cern.ch)

In this example, the option concept is perfectly explained by the ROOT team as always. It is simple, elegant, and efficient. I won’t take a minute to understand for any user at any level.

I am aware of this part : " typedef const char Option_t; //Option string (const char)" or " Other data types - C++ Tutorials (cplusplus.com)".

As a user, I wish the Team also add the website a chat website, and maybe we work on a mobile phone chat application for the ROOT users to share ideas quickly and spread the information. Maybe, time to time, video session can be done via ZOOM program just to chat with users weekly base to discuss their obstacles as a teacher or expert. These are some of my ideas. If some of them already exist and I am not aware of it, please direct me to the link.

All in all, I feel safe to be in the community because I have the help when I need it.


Dr. ilker

Yes sometimes some options are not well explained or not explained at all. We need to improve. Looking at the code is of course a solution but that should not be promoted. In the example you mentioned, the option can have only one value : “width”. I agree an example can be added, or a link to an example. May be @moneta can provide one.

Appreciated. I’d like to see examples of this Option * option pointer I see every where in many methods recently.

Such as DoIntegral(…) , IntegralAndError(…), …

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.