]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/alice-macros/tpc_hits.C
Check if any hits are selected before creating Reve::PointSet.
[u/mrichter/AliRoot.git] / EVE / alice-macros / tpc_hits.C
index f85082af6b5b7faf5a6a4cc1b24eb0219e04ef54..9e9d5aa183df2f340047540290eda55fc8357b73 100644 (file)
@@ -24,6 +24,12 @@ tpc_hits(const char *varexp    = "TPC2.fArray.fR:TPC2.fArray.fFi:TPC2.fArray.fZ"
   TPointSelector ps(ht, points, varexp, selection);
   ps.Select();
 
+  if (points->Size() == 0) {
+    Warning("tpc_hits", Form("No hits match %s %s", varexp, selection));
+    delete points;
+    return 0;
+  }
+
   //PH  points->SetTitle(Form("N=%d", points->Size()));
   sprintf(form,"N=%d", points->Size());
   points->SetTitle(form);