This is my first post here on this forum.
I’m having problems using TDset::Draw, in particular when trying to set as
const char *selection
an expression involving both && (logic “and”) and || (logic “or”).
Everything is working properly if I don’t use any “||” or if I use a TChain::Draw with the same expression on the same input chain…
Here are the two codes:
this is using ProofLite
[code]void Main(){
TChain *t = new TChain(“t”,“t”);
t->Add("/home/michele/AnalisiDati/TopPlot/data/we0j.root/MyTree");
t->Add("/home/michele/AnalisiDati/TopPlot/data/we1j.root/MyTree");
t->Add("/home/michele/AnalisiDati/TopPlot/data/we2j.root/MyTree");
t->Add("/home/michele/AnalisiDati/TopPlot/data/we3j.root/MyTree");
t->Add("/home/michele/AnalisiDati/TopPlot/data/we4j.root/MyTree");
t->Add("/home/michele/AnalisiDati/TopPlot/data/we5j.root/MyTree");
TDSet *d = new TDSet(*t);
gROOT->SetStyle(“Plain”);
TCanvas *c = new TCanvas(“c”,“c”,600,600);
TH1F *h = new TH1F(“h”,“h”,50,0,500);
TProofLite *p = TProofLite::Open("");
//d->Draw(“top_mass>>h”,Form("(e_channel>0) && nj_25>=4")); // this is working
//d->Draw(“top_mass>>h”,Form("(e_channel>0) || nj_25>=4")); // this is working
d->Draw(“top_mass>>h”,"(e_channel>0 || mu_channel>0) && nj_25>=4"); // this is not working
c->SaveAs(“test.png”);
}[/code]
this is without using Proof
[code]void Main2(){
TChain *t = new TChain(“t”,“t”);
t->Add("/home/michele/AnalisiDati/TopPlot/data/we0j.root/MyTree");
t->Add("/home/michele/AnalisiDati/TopPlot/data/we1j.root/MyTree");
t->Add("/home/michele/AnalisiDati/TopPlot/data/we2j.root/MyTree");
t->Add("/home/michele/AnalisiDati/TopPlot/data/we3j.root/MyTree");
t->Add("/home/michele/AnalisiDati/TopPlot/data/we4j.root/MyTree");
t->Add("/home/michele/AnalisiDati/TopPlot/data/we5j.root/MyTree");
gROOT->SetStyle(“Plain”);
TCanvas *c = new TCanvas(“c”,“c”,600,600);
TH1F *h = new TH1F(“h”,“h”,50,0,500);
d->Draw(“top_mass>>h”,"(e_channel>0 || mu_channel>0) && nj_25>=4"); // this is working
c->SaveAs(“test.png”);
}[/code]
And here is the output of the first code:
[code]Processing Main.C…
+++ 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)
Info in TProofLite::SetQueryRunning: starting query: 1
Info in TProofQueryResult::SetRunning: nwrks: 2
Looking up for exact location of files: OK (6 files)
Looking up for exact location of files: OK (6 files)
Info in TPacketizerAdaptive::TPacketizerAdaptive: Setting max number of workers per node to 2
Validating files: OK (6 files)
Info in TPacketizerAdaptive::InitStats: fraction of remote files 1.000000
Info in TProofLite::MarkBad: events |>…| 0.00 %
+++ Message from master at pinamonti : marking 0.0-pinamonti-1289062310-5534:-1 (0.0) as bad
+++ Reason: undefined message in TProof::CollectInputFrom(…)
+++ Most likely your code crashed
+++ Please check the session logs for error messages either using
+++ the ‘Show logs’ button or executing
+++
+++ root [] TProof::Mgr(“pinamonti”)->GetSessionLogs()->Display("*")
Error in TPacketizerAdaptive::SplitPerHost: Error removing a missing file
Info in TPacketizerAdaptive::InitStats: fraction of remote files 1.000000
Info in TProofLite::MarkBad:
+++ Message from master at pinamonti : marking 0.1-pinamonti-1289062310-5536:-1 (0.1) as bad
+++ Reason: undefined message in TProof::CollectInputFrom(…)
+++ Most likely your code crashed
+++ Please check the session logs for error messages either using
+++ the ‘Show logs’ button or executing
+++
+++ root [] TProof::Mgr(“pinamonti”)->GetSessionLogs()->Display("*")
Error in TPacketizerAdaptive::SplitPerHost: Error removing a missing file
Info in TPacketizerAdaptive::InitStats: fraction of remote files 1.000000
Lite-0: all output objects have been merged
Info in TCanvas::Print: png file test.png has been created[/code]