I am new to ROOT and I’ve a macro that repeats the same thing over and over, so it is probably a good idea to make this part of the code a function, but I don’t know how to do this partially because the function would need to take a data.txt file as an argument.
I could also download the data as a ROOT file, which has a TDirectoryFile in it, which is something I don’t know how to work with. So in short could someone help me define this piece of code as a function?
Hi,
this is more a C++ question than a ROOT question, but what you want is to pass around the string that contains the filename, so your function should take a string. It should also take whatever pions is as an argument since it uses it: