]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Increased the default window for the TOF signal visualization
authordecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Jun 2008 18:05:15 +0000 (18:05 +0000)
committerdecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Jun 2008 18:05:15 +0000 (18:05 +0000)
EVE/alice-macros/tof_clusters.C
EVE/alice-macros/tof_digits_strips.C
EVE/alice-macros/tof_raw.C

index 51b29772bf5e9058bfffcf7605b0f6eca1039da3..9389ff54535150576d6e13ced3c67a8c988714b0 100644 (file)
@@ -19,8 +19,6 @@ class TEvePointSet;
 #include <AliRunLoader.h>
 #include <AliCluster.h>
 
-#include <TClonesArray.h>
-
 #endif
 
 TEvePointSet* tof_clusters(TEveElement* cont=0, Float_t maxR=390)
@@ -34,30 +32,104 @@ TEvePointSet* tof_clusters(TEveElement* cont=0, Float_t maxR=390)
   if (cTree == 0)
     return 0;
 
-  TClonesArray *cl = NULL;
-  TBranch *branch = cTree->GetBranch("TOF");
-  branch->SetAddress(&cl);
+  TObjArray *cl = 0x0;
+  cTree->SetBranchAddress("TOF", &cl);
 
   TEvePointSet* clusters = new TEvePointSet(10000);
   clusters->SetOwnIds(kTRUE);
 
+  Float_t maxRsqr = maxR*maxR;
+
   Int_t nentr=(Int_t)cTree->GetEntries();
   for (Int_t i=0; i<nentr; i++) {
     if (!cTree->GetEvent(i)) continue;
 
     Int_t ncl=cl->GetEntriesFast();
     cout<<" ncl = "<<ncl<<endl;
-    Float_t maxRsqr = maxR*maxR;
     while (ncl--) {
       AliCluster *c=(AliCluster*)cl->UncheckedAt(ncl);
       Float_t g[3]; //global coordinates
       c->GetGlobalXYZ(g);
-      if (g[0]*g[0]+g[1]*g[1] < maxRsqr)
-      {
+
+      if (g[0]*g[0]+g[1]*g[1] < maxRsqr) {
        clusters->SetNextPoint(g[0], g[1], g[2]);
        AliCluster *atp = new AliCluster(*c);
        clusters->SetPointId(atp);
       }
+
+    }
+  }
+
+  if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
+    Warning("tof_clusters.C", "No TOF clusters");
+    delete clusters;
+    return 0;
+  }
+
+  clusters->SetMarkerStyle(2);
+  clusters->SetMarkerSize(0.2);
+  clusters->SetMarkerColor(4);
+
+  char form[1000];
+  sprintf(form,"TOF Clusters");
+  clusters->SetName(form);
+
+  char tip[1000];
+  sprintf(tip,"N=%d", clusters->Size());
+  clusters->SetTitle(tip);
+  gEve->AddElement(clusters, cont);
+  gEve->Redraw3D();
+
+  return clusters;
+}
+
+TEvePointSet* tof_clusters(Int_t selectedSector=-1,
+                          TEveElement* cont=0, Float_t maxR=390)
+{
+  AliEveEventManager::AssertGeometry();
+
+  AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
+  rl->LoadRecPoints("TOF");
+
+  TTree *cTree = rl->GetTreeR("TOF", false);
+  if (cTree == 0)
+    return 0;
+
+  TObjArray *cl = 0x0;
+  cTree->SetBranchAddress("TOF", &cl);
+
+  TEvePointSet* clusters = new TEvePointSet(10000);
+  clusters->SetOwnIds(kTRUE);
+
+  Float_t maxRsqr = maxR*maxR;
+  Double_t phiAngle = maxR*maxR;
+
+  Int_t nentr=(Int_t)cTree->GetEntries();
+  for (Int_t i=0; i<nentr; i++) {
+    if (!cTree->GetEvent(i)) continue;
+
+    Int_t ncl=cl->GetEntriesFast();
+    cout<<" ncl = "<<ncl<<endl;
+    while (ncl--) {
+      AliCluster *c=(AliCluster*)cl->UncheckedAt(ncl);
+      Float_t g[3]; //global coordinates
+      c->GetGlobalXYZ(g);
+
+      phiAngle = 180./TMath::Pi()*(TMath::ATan2(-g[1],-g[0])+TMath::Pi());
+
+      if (g[0]*g[0]+g[1]*g[1] < maxRsqr) {
+       if (
+           (selectedSector!=-1 &&
+            phiAngle>=selectedSector*20. && phiAngle<(selectedSector+1)*20.)
+           ||
+           selectedSector==-1)
+         {
+           clusters->SetNextPoint(g[0], g[1], g[2]);
+           AliCluster *atp = new AliCluster(*c);
+           clusters->SetPointId(atp);
+         }
+      }
+
     }
   }
 
index cb1a8c2ce0566df61dd19ce73e572ce6d231a18d..f5ef1e98c7717811dc24e6000823d249ea4c0ad4 100644 (file)
@@ -7,7 +7,7 @@
  * full copyright notice.                                                 *
  **************************************************************************/
 
-void tof_digits_strips()
+void tof_digits_strips(Int_t selectedSector=-1)
 {
   TClonesArray *array = 0x0;
 
@@ -44,7 +44,7 @@ void tof_digits_strips()
   gEve->AddElement(ll);
 
   for(Int_t iSector=0; iSector<g->NSectors(); iSector++) {
-
+    if (selectedSector!=-1 && iSector!=selectedSector) continue;
     sprintf(sectorName,"Sector%2i",iSector);
     TEveElementList* l = new TEveElementList(sectorName);
     l->SetTitle(sectorTitle);
@@ -70,7 +70,8 @@ void tof_digits_strips()
 
        array = di->GetDigits(iSector,iPlate, iStrip);
 
-       AliEveTOFStrip* m = new AliEveTOFStrip(localGeoManager,iSector,iPlate,iStrip,array);
+       AliEveTOFStrip* m = new AliEveTOFStrip(localGeoManager,
+                                              iSector,iPlate,iStrip,array);
        gEve->AddElement(m, relPlate);
 
       }
index fe9e93211a21deef830394a6c5a6b2b2a703037f..23ad892721f03b6229099b6de568def6b05da2f8 100644 (file)
@@ -38,7 +38,7 @@ void tof_raw(const char *input = "raw.root",
        di = new AliEveTOFDigitsInfo();
       }
 
-      di->ReadRaw(rawReader, ev, newDecoder);
+      di->ReadRaw(rawReader, newDecoder);
       continue;
     }