Throw exception if a track does not have a valid index.
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Feb 2007 18:03:15 +0000 (18:03 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Feb 2007 18:03:15 +0000 (18:03 +0000)
EVE/alice-macros/clusters_from_index.C

index 8fa007b..8905dc0 100644 (file)
@@ -4,8 +4,13 @@ Reve::PointSet* clusters_from_index(Int_t index=0)
 {
   AliESD* esd = Alieve::Event::AssertESD();
 
-  if (index < 0 || index >= esd->GetNumberOfTracks()) {
-    Warning("clusters_from_index", "index out of range.");
+  if (index < 0) {
+    Warning("clusters_from_index", "index not set.");
+    return 0;
+  }
+
+  if (index >= esd->GetNumberOfTracks()) {
+    Warning("clusters_from_index", "index out of range");
     return 0;
   }