Fill string variables in 1D and 2D histograms in running entries of filled tree

Dear Users,

I have a tree with string variables. I would like to run the loop over entries of the tree and fill the 1D histogram(string) and 2D histogram(string vs string). Please let me know how one can realize it ( particularly which type of histogram one has to define)?

Thank you in advance.

@couet can you please take a look? Thank you!

Have you tried the simple following way:


like in this example.

Hi, Thank you for suggestion. Yes, using tree I can plot. I am interested to know if it is feasible to fill histogram with string variable when reading from tree? Thank you.

Yes you can create histogram with string “bins” and fill them with tree using the > operator. Also, after the Draw command I sent before the histogram htemp exists and can be used.

Okay, I will try and update the progress ASAP. Thank you so much.