Hi,
Normally TChain is used to run a code parallel, when using PROOF:
TChain* chain = new TChain("MyTree");
TProof::Open("");
chain->SetProof();
chain->Process("MySelector.C+");
But is it possible to run it parallel without using TChain. I use class ProofEventProc which inherits from TSelector.
int ep()
{
TFile *f = TFile::Open("Hijing_000244918_AA_05020_100.root" ,"READ");
TTree *t = static_cast<TTree*>(f->Get("T"));
ProofEventProc Parl;
Parl.Begin(t);
Parl.SlaveBegin();
for (int i = 0; i < t->GetEntriesFast() ; i++) {
Parl.Process(i);
}
Parl.Terminate();
return 0;
}
To access my TTree:
void ProofEventProc::Begin(TTree *t){
h = new Header; // event information
p = new TClonesArray("TParticle"); // particles array
p->SetOwner(true);
t->SetBranchAddress("header", &(h->run));
t->SetBranchAddress("particles", &p);
}
Is it possible somehow to avoid TChain to use PROOF.
Hope someone can help.
Thanks
ProofEventProc.h (658 Bytes)
ProofEventProc.cc (10.5 KB)