I’m runing PROOF using some TTree
t1
on file f1
. I have some other TTree t2
on a file f2
. t1
and t2
have different structures. t1
contains events to be analyzed, while t2
contains some other information that helps decide if the event from t1
should be analyzed or ignored. (*)
I can open f2
and get a pointer to t2
on Selector::Begin()
, but I want every worker to have a copy of t2
(which is small) so every worker can “query” the Tree (either by using Draw
or RDataFrame::Filter
). However by running t2->CloneTree()
on Selector::SlaveBegin()
it crashes. I think it may be a race condition due to all the workers trying to access the file at the same time. How can I fix this?
Snippets of code:
class Selector : TSelector {
...
private:
TFile *f1;
TFile *f2;
TTree *t1;
TTree *t2;
TTree *t2Clon;
...
}
Selector::Begin(){
...
f2 = TFile::Open("t2.root" /*from SetParameter*/,"READ");
t2 = (TTree*)f2->Get("t2");
...
}
Selector::SlaveBegin(){
...
t2Clon = t2->CloneTree(); // it fails (around) here
fOutput->Add(t2Clon);
}
@ganis I think you may know the answer
(*) t2
is a “Golden Tree” or “Golden ROOT”, the same content as the so called “Golden Json”