Suggestion: new overload for TTree::Draw

Hi, would like to suggest a new overload for TTree::Draw. The signature would be:

virtual Long64_t Draw(const char* varexp, const TEntryList& entrylist, Option_t* option = "")

Basically instead of providing a TCut or a selection expression, one could pass a TEntryList (and also omit the firstentry and nentries parameters). This Draw method would only draw the entries in the TEntryList but would only use it for the draw command. The TTree’s fEntryList would be unchanged before & after the command.

This new overload would have a few benefits:

  • Is a more “functional” (in the programming sense) way to use TEntryLists - less state it stored in the TTree.
  • The user would not risk forgetting to SetEntryList(0) afterwards if more TTree processing is to be done.
  • It would be easier to try drawing with different TEntryLists.
  • It would better promote the use of pre-made TEntryLists instead of using the other TTree::Draw methods with the same cuts over and over, by making the TEntryList way more visible in the documentation.

Internally, this overload could be no different than:

  auto oldentrylist = this->GetEntryList();

but it would be more convenient.


Hi Jean-François,

To keep track it might be better to post your suggestion in Jira.
Here: … ssuetype=1

Let me know if you have problems to do it. If you do I can do it for you.