]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
fix macro
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 29 Aug 2008 15:51:17 +0000 (15:51 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 29 Aug 2008 15:51:17 +0000 (15:51 +0000)
EVE/alice-macros/trd_detectors.C

index 7489b3d5a1c4e87e1984ee702f1cb5a15575a0f4..048fa34e018e8995f224eb29ad6128658d9375b9 100644 (file)
@@ -56,16 +56,18 @@ TEveElementList* trd_detectors(Int_t sector = -1, TEveElement *cont = 0)
 
   for(Int_t i=0; i<tR->GetEntries(); i++) {
     if (!tR->GetEvent(i)) continue;
-
-    Int_t idet, ism, istk, ipla, icl=0; 
-    AliTRDcluster *c = 0x0;
+    if(!clusters->GetEntries()) continue;
+    Int_t icl=0; AliTRDcluster *c = 0x0;
     while(!(c = (AliTRDcluster*)clusters->UncheckedAt(icl++))) {;}
+    if(!c) continue;
+
+    Int_t idet, ism, istk, ipla; 
     idet = c->GetDetector();
     ism  = geo->GetSector(idet);
     istk = geo->GetStack(idet);
     ipla = geo->GetLayer(idet);
     if(sector>=0 && ism != sector) continue;
-    if(!sm){ 
+    if(!(sm = list->FindChild(Form("SM%03d", ism)))){ 
       list->AddElement(sm = new AliEveTRDNode("SM", ism));
       sm->SetElementTitle(Form("Supermodule %2d", ism));
     }