Dear ROOT users,
I have a TSelector that can be processed either via TProof or just with TChain::Process. My goal is to merge some files where each contain a list of TTrees in a way that the output file contains the merged TTrees.
If I run with TChain::Process the output looks as expected. However, if I use TProof the output file just contains the last TTree as if it had been overwritting each time the file.
In SlaveBegin I have these lines:
m_UsePROOF = m_mergeJob->GetUsePROOF();
if (m_UsePROOF){
m_prooffile = new TProofOutputFile(filename, "ML");
m_prooffile->SetOutputFileName(TString(subdir+"/"+filename).Data());
m_outfile = m_prooffile->OpenFile("UPDATE");
}
else {
m_outfile = new TFile(TString(subdir+"/"+filename).Data(),"UPDATE");
}
Where depending if it’s using PROOF or TChain it defines m_outfile differently, but in both cases with the option UPDATE, which I would expect to give the result I want.
Is there something else I need to do with PROOF so that the output just keeps being updated with each new merged tree?
Here are some lines I have in SlaveTerminate in case there is an issue there:
m_outfile->Purge();
m_outfile->Write();
m_outfile->Close();
if (m_UsePROOF){
TDirectory *savedir = gDirectory;
savedir->cd();
m_prooffile->Print();
fOutput->Add(m_prooffile);
}
Thanks for the help and best regards,
Sergio