macros for ITS upgrade visualization
authorshahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Nov 2012 14:47:38 +0000 (14:47 +0000)
committershahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Nov 2012 14:47:38 +0000 (14:47 +0000)
EVE/alice-macros/geom_gentle_itsU.C [new file with mode: 0644]
EVE/alice-macros/itsU_clusters.C
EVE/alice-macros/itsU_digits.C [new file with mode: 0644]
EVE/macros/visscan_itsU.C [new file with mode: 0644]

diff --git a/EVE/alice-macros/geom_gentle_itsU.C b/EVE/alice-macros/geom_gentle_itsU.C
new file mode 100644 (file)
index 0000000..626c74b
--- /dev/null
@@ -0,0 +1,164 @@
+// $Id: geom_gentle.C 54257 2012-01-30 20:52:05Z quark $
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <TFile.h>
+#include <TEveManager.h>
+#include <TEveGeoNode.h>
+#include <TEveElement.h>
+#include <TEveGeoShape.h>
+#include <TEveGeoShapeExtract.h>
+#include <AliITSUGeomTGeo.h>
+#include <TGeoManager.h>
+#include <TGeoVolume.h>
+#include <TGeoTube.h>
+#include <TSystem.h>
+#endif
+
+TEveGeoShape* GetItsUpgradeGeom(Bool_t bPrint=kTRUE);
+
+TEveGeoShape* geom_gentle_itsU(Bool_t register_as_global=kTRUE)
+{
+
+  gSystem->Load("libITSUpgradeBase");
+  gSystem->Load("libITSUpgradeSim");
+
+  TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo.root");
+  TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
+  TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
+  f.Close();
+
+  TEveElement* elPHOS = gsre->FindChild("PHOS");
+  elPHOS->SetRnrState(kTRUE);
+  elPHOS->FindChild("PHOS_4")->SetRnrState(kFALSE);
+  elPHOS->FindChild("PHOS_5")->SetRnrState(kFALSE);
+  TEveElement* elITS = gsre->FindChild("ITS");
+  elITS->SetRnrState(kFALSE);
+  
+    TEveElement* elTPC = gsre->FindChild("TPC");
+    elTPC->SetRnrState(kFALSE);
+    TEveElement* elPHOS = gsre->FindChild("PHOS");
+    elPHOS->SetRnrState(kFALSE);
+    TEveElement* elTRD = gsre->FindChild("TRD+TOF");
+    elTRD->SetRnrState(kFALSE);
+    TEveElement* elHMPID = gsre->FindChild("HMPID");
+    elHMPID->SetRnrState(kFALSE);
+  
+
+  TEveGeoShape* elITSU = GetItsUpgradeGeom(); 
+  elITSU->SetRnrState(kTRUE);
+  gsre->AddElement(elITSU);
+
+  if (register_as_global)
+  {
+    gEve->AddGlobalElement(gsre);
+  }
+
+  return gsre;
+}
+
+TEveGeoShape* geom_gentle_itsU_rphi()
+{
+  // The resulting geometry is NOT added into the global scene!
+
+  TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rphi_geo.root");
+  TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
+  TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
+  f.Close();
+
+  TEveElement* elPHOS = gsre->FindChild("PHOS");
+  elPHOS->SetRnrState(kTRUE);
+  elPHOS->FindChild("PHOS_4")->SetRnrState(kFALSE);
+  elPHOS->FindChild("PHOS_5")->SetRnrState(kFALSE);
+
+  TEveElement* elITS = gsre->FindChild("ITS");
+  elITS->SetRnrState(kFALSE);
+  TEveGeoShape* elITSupgr = GetItsUpgradeGeom(kFALSE); 
+  elITSupgr->SetRnrState(kTRUE);
+  gsre->AddElement(elITSupgr);
+
+  return gsre;
+}
+
+TEveGeoShape* geom_gentle_itsU_rhoz()
+{
+  // The resulting geometry is NOT added into the global scene!
+
+  TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rhoz_geo.root");
+  TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
+  TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
+  f.Close();
+  TEveElement* elITS = gsre->FindChild("ITS");
+  elITS->SetRnrState(kFALSE);
+  TEveGeoShape* elITSupgr = GetItsUpgradeGeom(kFALSE); 
+  elITSupgr->SetRnrState(kTRUE);
+  gsre->AddElement(elITSupgr);
+
+  return gsre;
+}
+
+
+
+TEveGeoShape* GetItsUpgradeGeom(Bool_t bPrint) {
+  
+  gGeoManager = gEve->GetGeometry("geometry.root");
+
+  AliITSUGeomTGeo* gm = new AliITSUGeomTGeo(kTRUE);
+  TGeoVolume *itsV = gGeoManager->GetVolume(gm->GetITSVolPattern());
+  if (!itsV) printf("ITS volume %s is not in the geometry\n",gm->GetITSVolPattern());
+
+
+
+  // Re-create the Volume
+  // --------------------------------------------
+
+  TEveGeoShape *itsU = new TEveGeoShape("ITSU");  
+  // Loop on all ITSV nodes, count Layer volumes by checking names
+
+  Int_t nNodes = itsV->GetNodes()->GetEntries();
+  for (Int_t j=0; j<nNodes; j++) {
+    if (strstr(itsV->GetNodes()->At(j)->GetName(),gm->GetITSLayerPattern())) {
+
+
+      
+      char laddnam[30];
+      snprintf(laddnam, 30, "%s%d", gm->GetITSLayerPattern(),j);
+      TGeoVolume* volLd = gGeoManager->GetVolume(laddnam);
+      TGeoTube *t=(TGeoTube*)volLd->GetShape();
+
+      if (bPrint) {
+       printf("%s   ",itsV->GetNodes()->At(j)->GetName());
+       printf(" r = (%3.2lf %3.2lf) ",t->GetRmin(),t->GetRmax());
+       printf(" z = %3.2lf ",t->GetDz());   
+       printf(" #lad = %d \n",gm->GetNLadders(j));   
+      }
+
+      // Add Element to EVE
+      TGeoTube *layer = new TGeoTube(t->GetRmin(),t->GetRmax(),t->GetDz());
+      TEveGeoShape *elLayer = new TEveGeoShape(Form("%s%d",gm->GetITSLayerPattern(),j));    
+      elLayer->SetShape(layer);
+      elLayer->SetMainColor(kGreen);
+      elLayer->SetMainTransparency(90);
+      itsU->AddElement(elLayer);
+
+    }
+
+  }
+  itsU->SetMainColor(kGreen);
+  
+  return itsU;
+
+
+}
index bc24ccb..bc5a58f 100644 (file)
 #include <TEveElement.h>
 #include <TEvePointSet.h>
 
-#include <AliRunLoader.h>
-#include <AliCluster.h>
-#include <AliEveEventManager.h>
-#include <AliGeomManager.h>
-#include <AliITSUGeomTGeo.h>
-#include <AliITSUSegmentationPix.h>
-#include <TGeoManager.h>
+#include "AliRunLoader.h"
+#include "AliCluster.h"
+#include "AliEveEventManager.h"
+#include "AliGeomManager.h"
+#include "../ITS/UPGRADE/AliITSUGeomTGeo.h"
+#include "../ITS/UPGRADE/AliITSUSegmentationPix.h"
+#include "../ITS/UPGRADE/AliITSUClusterPix.h"
+#include "TGeoManager.h"
 
 #else
 class TEveElement;
@@ -39,7 +40,7 @@ void itsU_clusters(TEveElement* cont=0, Float_t maxR=50)
 
   gGeoManager = gEve->GetGeometry("geometry.root");
   AliITSUGeomTGeo* gm = new AliITSUGeomTGeo(kTRUE,kTRUE);
-
+  AliITSUClusterPix::SetGeom(gm);
   TTree *cTree = rl->GetTreeR("ITS", false);
   if (cTree == 0)
     return ;
@@ -68,7 +69,7 @@ void itsU_clusters(TEveElement* cont=0, Float_t maxR=50)
     //      AliITSUSegmentationPix* segm = (AliITSUSegmentationPix*)fGM->GetSegmentation(ilr);
     Float_t maxRsqr = maxR*maxR;
     for (Int_t icl = 0; icl < ncl; ++icl) {
-      AliCluster *c = (AliCluster*) clr->UncheckedAt(icl);
+      AliITSUClusterPix *c = (AliITSUClusterPix*) clr->UncheckedAt(icl);
       Int_t mod = c->GetVolumeId();
       int lay,lad,det;
       gm->GetModuleId(mod, lay,lad,det);
@@ -85,15 +86,15 @@ void itsU_clusters(TEveElement* cont=0, Float_t maxR=50)
        evClusters->AddElement(layClusters);   
       }
       
-      Double_t l[3]={c->GetX(),c->GetY(),c->GetZ()}; 
-      Double_t g[3]; 
-      gm->LocalToGlobal(mod,l,g);
+      float g[3]; 
+      c->GetGlobalXYZ(g);
+      //      gm->LocalToGlobal(mod,l,g);
       if (g[0]*g[0] + g[1]*g[1] < maxRsqr) {
        layClusters->SetNextPoint(g[0], g[1], g[2]);
-       AliCluster *atp = new AliCluster(*c);
+       AliITSUClusterPix *atp = new AliITSUClusterPix(*c);
        layClusters->SetPointId(atp);
-       //      printf("%d: mod %d: loc(%.4lf,%.4lf,%.4lf); glob(%.4lf,%.4lf,%.4lf); \n",
-       //             icl,atp->GetVolumeId(), l[0],l[1],l[2], g[0],g[1],g[2]);
+               printf("%d: mod %d: loc(%.4lf,%.4lf,%.4lf); glob(%.4lf,%.4lf,%.4lf); \n",
+                      icl,atp->GetVolumeId(), l[0],l[1],l[2], g[0],g[1],g[2]);
       }
     }
   }
diff --git a/EVE/alice-macros/itsU_digits.C b/EVE/alice-macros/itsU_digits.C
new file mode 100644 (file)
index 0000000..027e7c6
--- /dev/null
@@ -0,0 +1,151 @@
+// $Id: its_digits.C 30728 2009-01-22 18:14:34Z mtadel $
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <vector> // bypass a cint problem in root-5.20
+#include <TSystem.h>
+#include <TEveManager.h>
+#include <TGeoManager.h>
+#include <TEveElement.h>
+#include <TEvePointSet.h>
+#include <TObjArray.h>
+#include <TClonesArray.h>
+#include <TTree.h>
+
+#include "AliEveEventManager.h"
+#include "AliGeomManager.h"
+#include "../ITS/UPGRADE/AliITSUGeomTGeo.h"
+#include "../ITS/UPGRADE/AliITSUSegmentationPix.h"
+#include "../ITS/UPGRADE/AliITSUDigitPix.h"
+#include "AliRunLoader.h"
+#include "AliEveITSUModule.h"
+
+#else
+
+class TEveElement;
+class TEvePointSet;
+
+#endif
+
+
+void itsU_digits() 
+  // Int_t mode            = 63,
+  // Bool_t check_empty    = kTRUE,
+  // Bool_t scaled_modules = kFALSE)
+{
+  gSystem->Load("libITSUpgradeBase");
+  gSystem->Load("libITSUpgradeSim");
+
+  gGeoManager = gEve->GetGeometry("geometry.root");
+  //  if (AliGeomManager::GetGeometry() == 0) AliGeomManager::LoadGeometry("geometry.root");
+
+  AliITSUGeomTGeo* gm = new AliITSUGeomTGeo(kTRUE);
+  TObjArray segmArr;
+  AliITSUSegmentationPix::LoadSegmentations(&segmArr, AliITSUGeomTGeo::GetITSsegmentationFileName());
+
+  //
+  //  Int_t nLayers = gm->GetNLayers();
+  Int_t nModules = gm->GetNModules();
+
+  AliEveEventManager::AssertGeometry();
+  AliRunLoader* rl =  AliEveEventManager::AssertRunLoader();
+  rl->LoadDigits("ITS");
+  TTree* digTree = rl->GetTreeD("ITS", false);
+
+  //  printf(" -------------------- event %d - nModules %d \n",rl->GetEventNumber(), nModules);
+
+  //DIGITS INIT
+
+  TClonesArray *digArr= new TClonesArray("AliITSUDigitPix");
+  digTree->SetBranchAddress("ITSDigitsPix",&digArr);
+
+  TEveElementList* evITSdig = new TEveElementList("ITSU Digits - as modules");
+  TEveElementList* layITSdig = 0;
+
+  TEveElementList* evITSdigPoints = new TEveElementList("ITSU Digits - as points");
+  TEvePointSet* layITSdigPoints = 0;
+  
+  Int_t layOld =-1;
+
+  for (int imod=0;imod<nModules;imod++) {
+
+    digTree->GetEntry(imod);     
+    // clone array, because digArr is reused for the next module
+    // and the digit pointers for prev. modules are lost
+    TClonesArray *digArrClone =  (TClonesArray*)digArr->Clone("digits clone");
+    int ndig  = digArrClone->GetEntries();
+    if (ndig<1) continue; 
+
+    int detType = gm->GetModuleDetTypeID(imod);
+    AliITSUSegmentationPix* segm = (AliITSUSegmentationPix*)segmArr.At(detType);
+    int lay,lad,det;
+    gm->GetModuleId(imod, lay,lad,det);
+    //   printf("\nModule %3d: (det %2d in ladder %2d of Layer %d) | NDigits: %4d\n",imod,det,lad,lay,ndig);
+    //
+    
+    if (lay!=layOld) { // assumes order in the digits !
+      layITSdigPoints = new TEvePointSet(Form("ITSU Digits (points) - Layer %d",lay),10000);
+      //  layITSdigPoints->ApplyVizTag(viz_tag, "Clusters");
+      layITSdigPoints->SetMarkerColor(kBlack);
+      layITSdigPoints->SetMarkerStyle(kFullDotMedium);
+      layITSdigPoints->SetRnrSelf(kTRUE);
+      layITSdigPoints->SetOwnIds(kTRUE);
+
+      evITSdigPoints->AddElement(layITSdigPoints);   
+
+    }
+
+    AliEveITSUModule *evMod  = new AliEveITSUModule(gm,imod,lay,lad,det);
+    for (int idig=0;idig<ndig;idig++) {
+   
+      AliITSUDigitPix *pDig = (AliITSUDigitPix*)digArrClone->At(idig);
+      evMod->SetDigitInQuad(pDig);
+  
+      /* printf("#%3d digit (0x%lx), col:%4d/row:%3d signal: %5d e-,  generated by tracks ",
+            idig,(ULong_t)pDig,pDig->GetCoord1(),pDig->GetCoord2(),pDig->GetSignalPix()); 
+      for (int itr=0;itr<pDig->GetNTracks();itr++) if (pDig->GetTrack(itr)>=0) printf(" %5d",pDig->GetTrack(itr)); printf("\n");
+      */
+   
+      // extract global coordinates
+      Float_t x,z;
+      segm->DetToLocal(pDig->GetCoord2(),pDig->GetCoord1(),x,z);
+
+      Double_t loc[3]={x,0,z}; 
+      Double_t glob[3]; 
+      gm->LocalToGlobal(imod,loc,glob);
+   
+      layITSdigPoints->SetNextPoint(glob[0], glob[1], glob[2]);
+      layITSdigPoints->SetPointId(pDig);
+   
+      //   printf("  loc(%.3lf,%.3lf,%.3lf)->glob(%.3lf,%.3lf,%.3lf) \n",loc[0],loc[1],loc[2],glob[0],glob[1],glob[2]);
+    }
+
+    if (lay!=layOld) { // assumes order in the digits !
+      if (layOld>=0) {
+       evITSdig->AddElement(layITSdig);   
+      }
+      layITSdig = new TEveElementList(Form("ITSU Digits - Layer %d",lay));  
+      layOld=lay;
+
+    }
+
+    layITSdig->AddElement(evMod);
+  
+  }
+  evITSdig->AddElement(layITSdig);     // add list of digits of last layer
+
+  //  gEve->AddElement(evITSdigPoints);
+  gEve->AddElement(evITSdig);
+
+  gEve->Redraw3D();
+}
diff --git a/EVE/macros/visscan_itsU.C b/EVE/macros/visscan_itsU.C
new file mode 100644 (file)
index 0000000..cce0db8
--- /dev/null
@@ -0,0 +1,279 @@
+// $Id: visscan_itsU.C 57800 2012-07-12 08:46:50Z quark $
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <AliQAHistViewer.h>
+#endif
+
+class AliEveMacroExecutor;
+class TEveProjectionManager;
+class TEveGeoShape;
+class TEveUtil;
+class TSystem;
+class TInterpreter;
+
+
+Bool_t gShowMuonRPhi = kFALSE;
+Bool_t gShowMuonRhoZ = kTRUE;
+
+Bool_t gCenterProjectionsAtPrimaryVertex = kFALSE;
+
+
+void visscan_itsU(const TString& cdburi = "local://$ALICE_ROOT/OCDB",
+                 const TString& path   = ".",
+                 Bool_t showMuon = kFALSE,
+                 Bool_t showTrd = kFALSE)
+{
+
+  gSystem->Load("libITSUpgradeBase");
+  gSystem->Load("libITSUpgradeSim");
+  gSystem->Load("libITSUpgradeRec");
+  
+  if (showMuon)
+  {
+    if (gSystem->Getenv("ALICE_ROOT") != 0)
+    {
+      gInterpreter->AddIncludePath(Form("%s/MUON", gSystem->Getenv("ALICE_ROOT")));
+      gInterpreter->AddIncludePath(Form("%s/MUON/mapping", gSystem->Getenv("ALICE_ROOT")));
+    }
+  }
+  else
+  {
+    gShowMuonRPhi = gShowMuonRhoZ = kFALSE;
+  }
+  
+  if (cdburi.IsNull() && ! AliCDBManager::Instance()->IsDefaultStorageSet())
+  {
+    gEnv->SetValue("Root.Stacktrace", "no");
+    Fatal("visscan_itsU.C", "OCDB path MUST be specified as the first argument.");
+  }
+
+  AliEveEventManager::AddAODfriend("AliAOD.VertexingHF.root");
+
+  TEveUtil::LoadMacro("alieve_init.C");
+  alieve_init(cdburi, path, -1);
+
+  // TEveLine::SetDefaultSmooth(1);
+
+  TEveUtil::AssertMacro("VizDB_scan.C");
+
+  AliEveMacroExecutor *exec    = AliEveEventManager::GetMaster()->GetExecutor();
+  TEveBrowser         *browser = gEve->GetBrowser();
+  browser->ShowCloseTab(kFALSE);
+
+
+  //==============================================================================
+  // Geometry, scenes, projections and viewers
+  //==============================================================================
+
+  AliEveMultiView *mv = new AliEveMultiView;
+
+  mv->SetDepth(-10);
+
+  TEveUtil::LoadMacro("geom_gentle_itsU.C");
+  mv->InitGeomGentle(geom_gentle_itsU(), geom_gentle_itsU_rphi(), geom_gentle_itsU_rhoz(), 0);
+
+  if (showTrd) {
+    TEveUtil::LoadMacro("geom_gentle_itsU_trd.C+");
+    mv->InitGeomGentleTrd(geom_gentle_trd());
+  }
+
+  if (gShowMuonRPhi || gShowMuonRhoZ) {
+    TEveUtil::LoadMacro("geom_gentle_itsU_muon.C+");
+    mv->InitGeomGentleMuon(geom_gentle_muon(kFALSE), gShowMuonRPhi, gShowMuonRhoZ, kFALSE);
+  }
+
+  mv->SetDepth(0);
+
+  //==============================================================================
+  // Registration of per-event macros
+  //==============================================================================
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Track",   "kine_tracks.C+", "kine_tracks", "", kFALSE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits ITS", "its_hits.C+",    "its_hits",    "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits TPC", "tpc_hits.C+",    "tpc_hits",    "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits T0",  "t0_hits.C+",     "t0_hits",     "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits FMD", "fmd_hits.C+",    "fmd_hits",    "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits ACORDE", "acorde_hits.C+","acorde_hits","", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits EMCAL", "emcal_hits.C+","emcal_hits",  "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits TOF",  "tof_hits.C+",   "tof_hits",    "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits TRD", "trd_hits.C+",    "trd_hits",    "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM Hits VZERO", "vzero_hits.C+","vzero_hits",  "", kFALSE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG ITSU",    "itsU_digits.C+","itsU_digits", "", kTRUE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG TPC",     "tpc_digits.C+",  "tpc_digits",  "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG TOF",     "tof_digits.C+",  "tof_digits",  "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG HMPID",   "hmpid_digits.C+","hmpid_digits","", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG FMD",     "fmd_digits.C+",  "fmd_digits",  "", kFALSE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters",     "clusters.C+",     "clusters", "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters ITS", "itsU_clusters.C+", "itsU_clusters"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters TPC", "tpc_clusters.C+", "tpc_clusters"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters TRD", "trd_clusters.C+", "trd_clusters"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters TOF", "tof_clusters.C+", "tof_clusters"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters HMPID", "hmpid_clusters.C+", "hmpid_clusters"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters PHOS", "phos_clusters.C+", "phos_clusters"));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters TPC", "vplot_tpc.C+",    "vplot_tpc", "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW ITS",     "its_raw.C+",     "its_raw",     "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW TPC",     "tpc_raw.C+",     "tpc_raw",     "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW TOF",     "tof_raw.C+",     "tof_raw",     "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW HMPID",   "hmpid_raw.C+",   "hmpid_raw",   "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW T0",      "t0_raw.C+",      "t0_raw",      "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW FMD",     "fmd_raw.C+",     "fmd_raw",     "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW VZERO",   "vzero_raw.C+",   "vzero_raw",   "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW ACORDE",  "acorde_raw.C+",  "acorde_raw",  "", kFALSE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX",             "primary_vertex.C+", "primary_vertex",             "",                kTRUE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse",     "primary_vertex.C+", "primary_vertex_ellipse",     "",                kTRUE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box",         "primary_vertex.C+", "primary_vertex_box",         "kFALSE, 3, 3, 3", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX SPD",         "primary_vertex.C+", "primary_vertex_spd",         "",                kTRUE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse SPD", "primary_vertex.C+", "primary_vertex_ellipse_spd", "",                kTRUE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box SPD",     "primary_vertex.C+", "primary_vertex_box_spd",     "kFALSE, 3, 3, 3", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX TPC",         "primary_vertex.C+", "primary_vertex_tpc",         "",                kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Ellipse TPC", "primary_vertex.C+", "primary_vertex_ellipse_tpc", "",                kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC PVTX Box TPC",     "primary_vertex.C+", "primary_vertex_box_tpc",     "kFALSE, 3, 3, 3", kFALSE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0",   "esd_V0_points.C+",       "esd_V0_points_onfly"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0",   "esd_V0_points.C+",       "esd_V0_points_offline"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC V0",   "esd_V0.C+",              "esd_V0"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC CSCD", "esd_cascade_points.C+",  "esd_cascade_points"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC CSCD", "esd_cascade.C+",         "esd_cascade"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC KINK", "esd_kink_points.C+",     "esd_kink_points"));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC KINK", "esd_kink.C+",            "esd_kink"));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks",              "esd_tracks.C+", "esd_tracks",              "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks ITS standalone",          "esd_tracks.C+", "esd_tracks_ITS_standalone",              "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks ITS",          "esd_tracks.C+", "esd_tracks_ITS",              "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks TPC",           "esd_tracks.C+", "esd_tracks_TPC",              "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks MI",           "esd_tracks.C+", "esd_tracks_MI",           "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks by category",  "esd_tracks.C+", "esd_tracks_by_category",  "", kTRUE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks by anal cuts", "esd_tracks.C+", "esd_tracks_by_anal_cuts", "", kFALSE));
+  //  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks Lego", "lego.C+", "lego", "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks Beams Info", "beams_info.C+", "beams_info", "", kFALSE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracklets SPD", "esd_spd_tracklets.C+", "esd_spd_tracklets", "", kTRUE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC ZDC",      "esd_zdc.C+", "esd_zdc", "", kFALSE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kAOD, "ANA HF",   "aod_HF.C+",   "aod_HF",   "", kFALSE));
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kAOD, "ANA Jets", "jetplane.C+", "jetplane", "", kFALSE));
+
+  exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "DUMP VZERO",   "vzero_dump.C+",   "vzero_dump",   "", kFALSE));
+  
+  if (showMuon)
+  {
+    exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "SIM TrackRef MUON", "muon_trackRefs.C+", "muon_trackRefs", "kTRUE", kFALSE));
+    exec->AddMacro(new AliEveMacro(AliEveMacro::kRawReader, "RAW MUON", "muon_raw.C+", "muon_raw", "", kFALSE));
+    exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "DIG MUON", "muon_digits.C+", "muon_digits", "", kFALSE));
+    exec->AddMacro(new AliEveMacro(AliEveMacro::kRunLoader, "REC Clusters MUON", "muon_clusters.C+", "muon_clusters", "", kTRUE));
+    exec->AddMacro(new AliEveMacro(AliEveMacro::kESD, "REC Tracks MUON", "esd_muon_tracks.C+", "esd_muon_tracks", "kTRUE,kFALSE", kTRUE));
+  }
+
+  //==============================================================================
+  // Additional GUI components
+  //==============================================================================
+
+  // Macro / data selection
+  slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
+  slot->StartEmbedding();
+  AliEveMacroExecutorWindow* exewin = new AliEveMacroExecutorWindow(exec);
+  slot->StopEmbedding("DataSelection");
+  exewin->PopulateMacros();
+
+  // Event selection tab
+  slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
+  slot->StartEmbedding();
+  new AliEveEventSelectorWindow(gClient->GetRoot(), 600, 400, AliEveEventManager::GetMaster()->GetEventSelector());
+  slot->StopEmbedding("Selections");
+
+  // QA viewer
+  slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
+  slot->StartEmbedding();
+  new AliQAHistViewer(gClient->GetRoot(), 600, 400, kTRUE);
+  slot->StopEmbedding("QA histograms");
+
+  browser->GetTabRight()->SetTab(1);
+
+  browser->StartEmbedding(TRootBrowser::kBottom);
+  new AliEveEventManagerWindow(AliEveEventManager::GetMaster());
+  browser->StopEmbedding("EventCtrl");
+
+  slot = TEveWindow::CreateWindowInTab(browser->GetTabRight());
+  TEveWindowTab *store_tab = slot->MakeTab();
+  store_tab->SetElementNameTitle("WindowStore",
+    "Undocked windows whose previous container is not known\n"
+    "are placed here when the main-frame is closed.");
+  gEve->GetWindowManager()->SetDefaultContainer(store_tab);
+
+
+  //==============================================================================
+  // AliEve objects - global tools
+  //==============================================================================
+
+  AliEveTrackFitter* fitter = new AliEveTrackFitter();
+  gEve->AddToListTree(fitter, 1);
+  gEve->AddElement(fitter, gEve->GetEventScene());
+
+  AliEveTrackCounter* g_trkcnt = new AliEveTrackCounter("Primary Counter");
+  gEve->AddToListTree(g_trkcnt, kFALSE);
+
+
+  //==============================================================================
+  // Final stuff
+  //==============================================================================
+
+  // A refresh to show proper window.
+  gEve->GetViewers()->SwitchColorSet();
+  gEve->Redraw3D(kTRUE);
+  gSystem->ProcessEvents();
+
+  // Register command to call on each event.
+  AliEveEventManager::GetMaster()->AddNewEventCommand("on_new_event();");
+  AliEveEventManager::GetMaster()->GotoEvent(0);
+
+  gEve->EditElement(g_trkcnt);
+
+  gEve->Redraw3D(kTRUE);
+}
+
+/******************************************************************************/
+
+void on_new_event()
+{
+  Double_t x[3] = { 0, 0, 0 };
+
+  if (AliEveEventManager::HasESD())
+  {
+    AliESDEvent* esd = AliEveEventManager::AssertESD();
+    esd->GetPrimaryVertex()->GetXYZ(x);
+
+    TTimeStamp ts(esd->GetTimeStamp());
+    TString win_title("Eve Main Window -- Timestamp: ");
+    win_title += ts.AsString("s");
+    win_title += "; Event # in ESD file: ";
+    win_title += esd->GetEventNumberInFile();
+    gEve->GetBrowser()->SetWindowName(win_title);
+  }
+
+  TEveElement* top = gEve->GetCurrentEvent();
+
+  AliEveMultiView *mv = AliEveMultiView::Instance();
+
+  //mv->DestroyEventRPhi();
+  if (gCenterProjectionsAtPrimaryVertex)
+    mv->SetCenterRPhi(x[0], x[1], x[2]);
+  mv->ImportEventRPhi(top);
+
+  //mv->DestroyEventRhoZ();
+  if (gCenterProjectionsAtPrimaryVertex)
+    mv->SetCenterRhoZ(x[0], x[1], x[2]);
+  mv->ImportEventRhoZ(top);
+}