I am using TTrees that have vector<> and vector<vector<>> data members. I am having trouble using them in TTree::Draw().
For example, if I have “vector< vector > *ADC”, how would I use it in a TTree::Draw statement? It is especially confusing because it is a pointer.
I’ve tried the following:
tree->Draw(“ADC[0][2]”,“ADC[][] > 45”);
This seems to work
tree->Draw(“ADC[][2]”,“ADC[0][2] > 45”);
This yields a plot with many entries in the bin from 0 to 1, which doesn’t make sense since there shouldn’t be any none zero ADCs in the tree.
tree->Draw(“ADC[][]”,“ADC[0][2] > 45”);
This seems to work reasonably.
tree->Draw(“ADC[][]”,“ADC[][] > 45”);
This seems to work reasonably.
I’m just not sure what is the supported syntax. Is this discussed anywhere?
I suppose my question was more of an informational question, not really a problem as of yet.
Can you just confirm the proper syntax for using vectors and vectors of vectors in the strings passed to the TTree::Draw() method? I can’t find any examples anywhere which specifies this.
[quote]I suppose my question was more of an informational question, not really a problem as of yet. [/quote]Humm … you did say:[quote]tree->Draw(“ADC[][2]”,“ADC[0][2] > 45”);
This yields a plot with many entries in the bin from 0 to 1, which doesn’t make sense since there shouldn’t be any none zero ADCs in the tree. [/quote]which may or may not be a problem depending on the data …
[quote]Can you just confirm the proper syntax for using vectors and vectors of vectors in the strings passed to the TTree::Draw() method? I can’t find any examples anywhere which specifies this. [/quote]You seem to have gotten the syntax right. The syntax is described in the documentation of TTree::Draw where the vector of vector is simply an instance of the case of a 2 dimensional array with 2 varying length dimensions.