]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Handle missing rec-point tree in a uniform way: return null pointer to TEvePointSet.
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 May 2008 11:01:48 +0000 (11:01 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 May 2008 11:01:48 +0000 (11:01 +0000)
EVE/alice-macros/its_clusters.C
EVE/alice-macros/tpc_clusters.C
EVE/alice-macros/trd_clusters.C

index a00b056dda137eeb24f7981448e759f0779c247d..0ddcb13ef883e2fca6f160c1656a487fec6d4030 100644 (file)
@@ -32,14 +32,16 @@ TEvePointSet* its_clusters(TEveElement* cont=0, Float_t maxR=50)
   rl->LoadRecPoints("ITS");
 
   TTree *cTree = rl->GetTreeR("ITS", false);
   rl->LoadRecPoints("ITS");
 
   TTree *cTree = rl->GetTreeR("ITS", false);
-
-  TEvePointSet* clusters = new TEvePointSet(10000);
-  clusters->SetOwnIds(kTRUE);
+  if (cTree == 0)
+    return 0;
 
   TClonesArray *cl = NULL;
   TBranch *branch  = cTree->GetBranch("ITSRecPoints");
   branch->SetAddress(&cl);
 
 
   TClonesArray *cl = NULL;
   TBranch *branch  = cTree->GetBranch("ITSRecPoints");
   branch->SetAddress(&cl);
 
+  TEvePointSet* clusters = new TEvePointSet(10000);
+  clusters->SetOwnIds(kTRUE);
+
   Int_t nentr=(Int_t)cTree->GetEntries();
   for (Int_t i=0; i<nentr; i++) {
     if (!cTree->GetEvent(i)) continue;
   Int_t nentr=(Int_t)cTree->GetEntries();
   for (Int_t i=0; i<nentr; i++) {
     if (!cTree->GetEvent(i)) continue;
@@ -61,7 +63,7 @@ TEvePointSet* its_clusters(TEveElement* cont=0, Float_t maxR=50)
   }
 
   if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
   }
 
   if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
-    Warning("its_clusters", "No ITS clusters");
+    Warning("its_clusters.C", "No ITS clusters");
     delete clusters;
     return 0;
   }
     delete clusters;
     return 0;
   }
index 8f90458f54f5fe322e67a15e3a1b7c832a1023f2..bbb0571ea7165a3785b8c3471df0e79c8d4e0930 100644 (file)
@@ -74,7 +74,7 @@ TEvePointSet* tpc_clusters(TEveElement* cont=0, Float_t maxR=270)
 
   if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE)
   {
 
   if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE)
   {
-    Warning("tpc_clusters", "No TPC clusters");
+    Warning("tpc_clusters.C", "No TPC clusters");
     delete clusters;
     return 0;
   }
     delete clusters;
     return 0;
   }
index 902c46a4a69e47680ebc936225d789c89ee83c3f..b5e0b03473c11905c43a482811342868f31a3129 100644 (file)
@@ -23,18 +23,23 @@ class TEveElement;
 TEvePointSet* trd_clusters(TEveElement *cont = 0)
 {
   const Int_t kMaxClusters = 18 * 6 * 24 *10;
 TEvePointSet* trd_clusters(TEveElement *cont = 0)
 {
   const Int_t kMaxClusters = 18 * 6 * 24 *10;
-  AliEveEventManager::AssertGeometry();
 
 
-  TEvePointSet *clusters = new TEvePointSet(kMaxClusters);
-  clusters->SetOwnIds(kTRUE);
+  AliEveEventManager::AssertGeometry();
 
   AliRunLoader *rl = AliEveEventManager::AssertRunLoader();
   rl->LoadRecPoints("TRD");
 
 
   AliRunLoader *rl = AliEveEventManager::AssertRunLoader();
   rl->LoadRecPoints("TRD");
 
-  TObjArray *TRDcluster = 0x0;
   TTree *recPoints = rl->GetTreeR("TRD", kFALSE);
   TTree *recPoints = rl->GetTreeR("TRD", kFALSE);
+  if (recPoints == 0)
+    return 0;
+
+  TObjArray *TRDcluster = 0x0;
   recPoints->SetBranchAddress("TRDcluster", &TRDcluster);
 
   recPoints->SetBranchAddress("TRDcluster", &TRDcluster);
 
+  TEvePointSet *clusters = new TEvePointSet(kMaxClusters);
+  clusters->SetOwnIds(kTRUE);
+
+
   Int_t nentr=(Int_t)recPoints->GetEntries();
   for (Int_t i=0; i<nentr; i++) {
     if (!recPoints->GetEvent(i)) continue;
   Int_t nentr=(Int_t)recPoints->GetEntries();
   for (Int_t i=0; i<nentr; i++) {
     if (!recPoints->GetEvent(i)) continue;
@@ -53,7 +58,7 @@ TEvePointSet* trd_clusters(TEveElement *cont = 0)
   }
 
   if(clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
   }
 
   if(clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
-    Warning("trd_clusters", "No TRD clusters");
+    Warning("trd_clusters.C", "No TRD clusters");
     delete clusters;
     return 0;
   }
     delete clusters;
     return 0;
   }