Skip to content
Snippets Groups Projects
Commit d4d80f6c authored by Gerardo Ganis's avatar Gerardo Ganis
Browse files

tutorials/tree: fine-tune TEntryList support in h1Analysis

parent dc4f24bc
Branches
Tags
No related merge requests found
...@@ -188,15 +188,14 @@ void h1analysis::Begin(TTree * /*tree*/) ...@@ -188,15 +188,14 @@ void h1analysis::Begin(TTree * /*tree*/)
// This is needed to avoid warnings from output-to-members mapping // This is needed to avoid warnings from output-to-members mapping
elist = 0; elist = 0;
} }
Info("Begin", "creating an entry-list");
} }
if (fillList) Info("Begin", "creating an entry-list");
// case when one uses the entry list generated in a previous call // case when one uses the entry list generated in a previous call
if (option.Contains("useList")) { if (option.Contains("useList")) {
useList = kTRUE; useList = kTRUE;
if (fInput) { if (fInput) {
// Option "useList" not supported in PROOF directly // In PROOF option "useList" is processed in SlaveBegin and we do not need
Warning("Begin", "option 'useList' not supported in PROOF - ignoring"); // to do anything here
Warning("Begin", "the entry list must be set on the chain *before* calling Process");
} else { } else {
TFile f("elist.root"); TFile f("elist.root");
elist = (TEntryList*)f.Get("elist"); elist = (TEntryList*)f.Get("elist");
...@@ -243,6 +242,7 @@ void h1analysis::SlaveBegin(TTree *tree) ...@@ -243,6 +242,7 @@ void h1analysis::SlaveBegin(TTree *tree)
} }
} }
if (fillList) Info("SlaveBegin", "creating an entry-list"); if (fillList) Info("SlaveBegin", "creating an entry-list");
if (option.Contains("useList")) useList = kTRUE;
} }
......
...@@ -94,15 +94,14 @@ void h1analysisTreeReader::Begin(TTree* /*myTree*/) { ...@@ -94,15 +94,14 @@ void h1analysisTreeReader::Begin(TTree* /*myTree*/) {
// This is needed to avoid warnings from output-to-members mapping // This is needed to avoid warnings from output-to-members mapping
elist = 0; elist = 0;
} }
Info("Begin", "creating an entry-list");
} }
if (fillList) Info("Begin", "creating an entry-list");
// case when one uses the entry list generated in a previous call // case when one uses the entry list generated in a previous call
if (option.Contains("useList")) { if (option.Contains("useList")) {
useList = kTRUE; useList = kTRUE;
if (fInput) { if (fInput) {
// Option "useList" not supported in PROOF directly // In PROOF option "useList" is processed in SlaveBegin and we do not need
Warning("Begin", "option 'useList' not supported in PROOF - ignoring"); // to do anything here
Warning("Begin", "the entry list must be set on the chain *before* calling Process");
} else { } else {
TFile f("elist.root"); TFile f("elist.root");
elist = (TEntryList*)f.Get("elist"); elist = (TEntryList*)f.Get("elist");
...@@ -147,6 +146,7 @@ void h1analysisTreeReader::SlaveBegin(TTree *myTree){ ...@@ -147,6 +146,7 @@ void h1analysisTreeReader::SlaveBegin(TTree *myTree){
} }
} }
if (fillList) Info("SlaveBegin", "creating an entry-list"); if (fillList) Info("SlaveBegin", "creating an entry-list");
if (option.Contains("useList")) useList = kTRUE;
} }
void h1analysisTreeReader::Terminate() { void h1analysisTreeReader::Terminate() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment