TTree::Draw with formula containing filename

Hi,
I’ve got a question concerning the feature of the TTree::Draw command to pass a file name. I like this feature a lot, and because of this I use it with different “draw files” in my ROOT script. As written in the documentation, the complied proxy is not deleted after the Draw command, to avoid re-generation/compilation the proxy code. Unfortunately this does not help in my case, because, I loop over a number of files, and use two different draw scripts in sequence:

for (...) { [...] mytree->Draw("drawfile1.C"); mytree->Draw("drawfile2.C"); }

In this case the both scripts are recompiled each time, because the generated script always is called “generatedSel.h”. Is there a way to set the name of the generated script do avoid the recompilation of the scripts?

Cheers, J.

Hi,

You can use:mytree->GetPlayer()->DrawScript("selName","drawfile1.C");

Alternatively you could also combine some (or all) you script to only loop once over the file :slight_smile:

Cheers,
Philippe.