Accessing a Tree inside a directory

Hello all,

I would like to use PROOF when doing an analysis over a data set that contains two Trees (Analysis, and AnalysisII) under one directory. I am just interested in one of the Trees. I did the following:

root [0] TFile *f1 = TFile::Open(“dataset.root”)
root [1] directory->cd()
root [2] Analysis->MakeSelector(“MyAnalysis”)

but then, one I tried to use this Selector:

root [0] TDSet* dataset = new TDSet(“TTree”, “Analysis”);
root [1] dataset->Add(“file.root”)
(Bool_t)1
root [2] TProof *p = TProof::Open(" ");
+++ Starting PROOF-Lite with 2 workers +++
Opening connections to workers: OK (2 workers)
Setting up worker servers: OK (2 workers)
PROOF set to parallel mode (2 workers)
root [3] p->Process(dataset,“MyAnalysis.C+”);
Info in TProofLite::SetQueryRunning: starting query: 1
Looking up for exact location of files: OK (1 files)
Looking up for exact location of files: OK (1 files)
10:16:21 22391 Wrk-0.0 | Error in TDSet::GetEntries: cannot find tree “Analysis” in file.root
Error in TPacketizer::ValidateFiles: cannot get entries for file.root (
Info in TPacketizer::TPacketizer: no valid or non-empty file found: setting invalid
Error in TProofPlayerLite::InitPacketizer: instantiated packetizer object ‘TPacketizer’ is invalid
Error in TProofPlayerLite::Process: cannot init the packetizer
Info in TProofLite::UpdateDialog: processing was aborted - 0 events processed

it is the same if I tried to access with:
root [0] TDSet* dataset = new TDSet(“TTree”, “directory/Analysis”);

Any idea on how to solve this issue of accessing a Tree inside a directory?

Thanks in advance,
Ana.

Hello all,

The problem has been solved by using the “dir” argument in the TDSet, it specifies in which directory the objects are to be found, the top level directory ("/") is the default.

Ana.