Pass argument to fill histogram (from batch)

Hello,

I am trying to fill histogram passing the argument via batch, like in the following manner:

for i, evt in enumerate(f):

          my_histo.Fill(variableX,my_weight)

where f is my file .root and variableX takes is “value” from outside:

variableX = args[’-x’] from -----> (python my_script.py -x my_var)

The program works correctly, I mean without error but I found a problem when I want to plot the histogram: in fact the histogram is peaked at zero.

how I can avoid this problem?

Thanks you

I’m not sure to understand your question. Maybe @etejedor can help?

Hello,

Can you share an example (e.g. an image) of what the issue with plotting the histogram is?

This does not look like a Python problem in any case?

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