Hello,
I have 3 trees in the same ROOT file, I use MakeSelector on my 3 trees to generate my code. If I use the code generate for the fisrt tree, I can draw one variable of the tree with ROOT and PROOF (ROOT 5.16.00).
Now I would like to access for the same event the variables of the tree1,2 and 3. I used this code :[code]Tree2 bis;
Tree3 bis2;
void Tree1::Begin(TTree * /tree/)
{
TString option = GetOption();
}
void Tree1::SlaveBegin(TTree * tree)
{
// Tree2
TFile *f = new TFile("/direct/usatlas+groups+higgs/tarrade/Samples/HiggsToTauTau-00-00-44/user.TARRADEFabien.misal1_mc12.005334.HerwigVBFH120tautaulh.A12.0.6.7.NewTest_atlfast.AAN.AANT1._00001.root");
TTree fast = (TTree)f->Get(“FastSim0”);
//printf(“new tree Tree2\n”);
bis.Init(fast);
// Tree3
TFile *f1 = new TFile("/direct/usatlas+groups+higgs/tarrade/Samples/HiggsToTauTau-00-00-44/user.TARRADEFabien.misal1_mc12.005334.HerwigVBFH120tautaulh.A12.0.6.7.NewTest_atlfast.AAN.AANT1._00001.root");
TTree truth = (TTree)f1->Get(“Truth0”);
//printf(“new tree Tree3 \n”);
bis2.Init(truth);
//initialize the Tree branch addresses("");
Init(tree);
TString option = GetOption();
hhiggsmass = new TH1F(“hhiggsmass”,“higgs mass”,40,0,200000);
hhiggsmass_fast = new TH1F(“hhiggsmass_fast”,“higgs mass fast sim”,40,0,200000);
hhiggsmass_truth = new TH1F(“hhiggsmass_truth”,“higgs mass fast sim”,40,0,200000);
fOutput->Add(hhiggsmass);
fOutput->Add(hhiggsmass_fast);
fOutput->Add(hhiggsmass_truth);
}
Bool_t Tree1::Process(Long64_t entry)
{
//fChain->GetTree()->GetEntry(entry);
b_Higgs_N->GetEntry(entry);
b_Higgs_m->GetEntry(entry);
//fill some histograms
if(Higgs_N>0){
hhiggsmass->Fill( (*Higgs_m)[0] );
}
//new
//bis.fChain->GetTree()->GetEntry(entry);
bis.b_Higgs_N->GetEntry(entry);
bis.b_Higgs_m->GetEntry(entry);
//fill some histograms
if(bis.Higgs_N>0){
hhiggsmass_fast->Fill( (*bis.Higgs_m)[0] );
}
//bis2.fChain->GetTree()->GetEntry(entry);
bis2.b_Higgs_N->GetEntry(entry);
bis2.b_Higgs_m->GetEntry(entry);
//fill some histograms
if(bis2.Higgs_N>0){
hhiggsmass_truth->Fill( (*bis2.Higgs_m)[0] );
}
return kTRUE;
}
void Tree1::SlaveTerminate()
{
}
void Tree1::Terminate()
{
hhiggsmass = dynamic_cast<TH1F*>(fOutput->FindObject(“hhiggsmass”));
hhiggsmass_fast = dynamic_cast<TH1F*>(fOutput->FindObject(“hhiggsmass_fast”));
hhiggsmass_truth = dynamic_cast<TH1F*>(fOutput->FindObject(“hhiggsmass_truth”));
//create the canvas for the h1analysis fit
gStyle->SetOptFit();
TCanvas *c1 = new TCanvas(“c1”,“example”,10,10,800,600);
c1->SetBottomMargin(0.15);
hhiggsmass_fast->SetLineColor(4);
hhiggsmass_truth->SetLineColor(2);
hhiggsmass->GetXaxis()->SetTitle(“Higgs mass”);
hhiggsmass->GetXaxis()->SetTitleOffset(1.4);
hhiggsmass_truth->Draw("");
hhiggsmass_fast->Draw(“SAME”);
hhiggsmass->Draw(“SAME”);
}[/code]
It works fine with ROOT but crash with PROOF !!! :[code]
…
Master-0: grand total: sent 0 objects, size: 0 bytes
Info in TProof::CollectInputFrom: got 1036 from 0
Info in TProof::CollectInputFrom: kPROOF_SETIDLE: enter
Info in TProof::CollectInputFrom: got 1004 from 0
Info in TProof::CollectInputFrom: got 1005 from 0
Info in TProof::CollectInputFrom: kPROOF_LOGDONE:0: status 0 parallel 24
Info in TProofPlayerRemote::Process: Call Terminate()
*** Break *** segmentation violation
(no debugging symbols found)
Using host libthread_db library “/lib/tls/libthread_db.so.1”.
Attaching to program: /proc/29207/exe, process 29207
(no debugging symbols found)…done.
[Thread debugging using libthread_db enabled]
[New Thread -1208297792 (LWP 29207)]
[New Thread -1210692688 (LWP 29213)]
(no debugging symbols found)…done.
0x0071e7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
Thread 2 (Thread -1210692688 (LWP 29213)):
#0 0x0071e7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x00e7c1d4 in poll () from /lib/tls/libc.so.6
#2 0x03041489 in XrdClientSock::RecvRaw (this=0x9551448, buffer=0x98fd0d4, length=8, substreamid=-1, usedsubstreamid=0xb7d63eec) at XrdClientSock.cc:115
#3 0x03065875 in XrdClientPhyConnection::ReadRaw (this=0x9540df0, buf=0x98fd0d4, len=8, substreamid=-1, usedsubstreamid=0xb7d63eec) at XrdClientPhyConnection.cc:355
#4 0x03060d0a in XrdClientMessage::ReadRaw (this=0x98fd0b0, phy=0x9540df0) at XrdClientMessage.cc:149
#5 0x030648e8 in XrdClientPhyConnection::BuildMessage (this=0x9540df0, IgnoreTimeouts=true, Enqueue=true) at XrdClientPhyConnection.cc:436
#6 0x0306a1b3 in SocketReaderThread (arg=0x9540df0, thr=0x9540b68) at XrdClientPhyConnection.cc:60
#7 0x0306e066 in XrdClientThreadDispatcher (arg=0x9540b74) at XrdClientThread.cc:32
#8 0x02f425f6 in XrdOucThread_Xeq () from /afs/usatlas.bnl.gov/cernsw/lcg/external/root/5.16.00-PROOF.00/slc4_ia32_gcc34/root/lib/libProofx.so
#9 0x00db13b1 in start_thread () from /lib/tls/libpthread.so.0
#10 0x00e85f7e in clone () from /lib/tls/libc.so.6
[/code]
To run my code I use :
root [1] .x chainForPROOF.C
root [2] .L Tree2.C+
root [3] .L Tree3.C+
root [4] chain.Process("Tree1.C+")
Any idea ? problem with the PROOF server ? I maybe instantiate the object Tree2 and Tree3 in a wrong place ?
Thanks a lot
Cheers
Fabien