I am having some trouble using the TTree::Draw function within pyroot, which gives me the following error.
TypeError: none of the 3 overloaded methods succeeded. Full details:
void TTree::Draw(const char* opt) =>
takes at most 1 arguments (3 given)
Long64_t TTree::Draw(const char* varexp, const TCut& selection, const char* option = """", Long64_t nentries = 1000000000, Long64_t firstentry = 0) =>
could not convert argument 2
Long64_t TTree::Draw(const char* varexp, const char* selection, const char* option = """", Long64_t nentries = 1000000000, Long64_t firstentry = 0) =>
problem in C++; program state has been reset
What confuses me is that this error seems to happen for some of the “varexp” and “selection” string, and I wasn’t able to find a pattern between cases working/failing strings. For example, adding a dummy “& V_pt > -15” (V_pt is always > 0) to the varexp seems to solve the problem in some cases.
Does someone know what the issue is, and how it can be solved ? Unfortunately I can not send the code, as it is part of a large framework. I am using ROOT 6.02/05.
Another remark: if I modify the cut within the Draw function above, replacing “& V_pt > 20 & V_pt > 30 &” by
"& V_pt > 30 &", the drawing works fine. This is strange because both cuts should be equivalent.
Ah, your right ! I was always using single “&” instead of “&&” in pyroot. I have rerun the tests using double “&&” everywhere, but the result is the same as before.
The following command lead to a segmentation violation