Well, I need an idea because I don’t see any light so far in the following situation (and I apologize if this has been discussed already or if it is a silly question, but I really have no clue and I’ve been reading all the I’ve found):
I have a data file, from where I’m getting different information; let’s say:
[ul] from data file name: file1
I’m getting the following names analysis1, analysis2, analysis3, analysis4 and so on.[/ul]
Inside each analysis there’s information. Let’s say I have for analysis1 the pT, theta. And so on for each analysis (analysis 2 has also pT and theta, analysis3 also…).
Now, I am interested in getting a Branch for file1, where the leaves are organized such as:
(I’m concerned about the analysis names because they already tell me a lot of information) Now, analysis1, analysis2, etc names will vary according to the data file (and let’s say that I have absolutely no idea about what their names would be or how many analysis would I have). If I have another file (file2), as a result I could have different names for the analysis: therefore, analysis1, analysis2 etc… names will be given by sort of a “function” (a definition which will just look into a pool of names and that will give me the ones that coincide with the characteristics I’m looking for, this is already working).
I know that to write a branch with PyROOT I will normally have to do something like
where the imput1 will be given by
and everything is easy if for each imput1[i] I know the corresponding leave name, that I could explicitly write in the t.Branch. But, what can I do in my case? for the analysisN leaves names…
I try to do something like leave_name[i] = whatever function I’m using to get the name (that will give me as output the names analysis1, analysis2, analysis3…) and then
where n is equal to the length of number of analysis I get. But, that doesn’t work. And I’m completely clueless about what could I possibly do.
I thank you in advance for any help .