]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
alice-data/gentle_geo_trd.root
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Apr 2008 09:09:27 +0000 (09:09 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Apr 2008 09:09:27 +0000 (09:09 +0000)
alice-macros/trd_clusters.C
alice-macros/geom_gentle_trd.C
alice-macros/visscan_init.C
test-macros/geom_extr_trd.C

Add simplified geometry for TRD and methods to extract it from the
full geometry. Optionally include it in also in visual-scanning
application.

alice-macros/tpc_clusters.C - Remove debug printout.

EVE/alice-data/gentle_geo_trd.root [new file with mode: 0644]
EVE/alice-macros/geom_gentle_trd.C [new file with mode: 0644]
EVE/alice-macros/tpc_clusters.C
EVE/alice-macros/trd_clusters.C
EVE/alice-macros/visscan_init.C
EVE/test-macros/geom_extr_trd.C [new file with mode: 0644]

diff --git a/EVE/alice-data/gentle_geo_trd.root b/EVE/alice-data/gentle_geo_trd.root
new file mode 100644 (file)
index 0000000..ec2a0a9
Binary files /dev/null and b/EVE/alice-data/gentle_geo_trd.root differ
diff --git a/EVE/alice-macros/geom_gentle_trd.C b/EVE/alice-macros/geom_gentle_trd.C
new file mode 100644 (file)
index 0000000..da4be16
--- /dev/null
@@ -0,0 +1,35 @@
+// $Id: geom_gentle.C 24242 2008-03-02 02:23:52Z 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.                                                 *
+ **************************************************************************/
+
+TEveGeoShape* geom_gentle_trd()
+{
+  TFile f("$REVESYS/alice-data/gentle_geo_trd.root");
+  TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle TRD");
+  TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
+  gEve->AddGlobalElement(gsre);
+  f.Close();
+
+  // Fix visibility, color and transparency
+  gsre->SetRnrSelf(kFALSE);
+  for (TEveElement::List_i i = gsre->BeginChildren(); i != gsre->EndChildren(); ++i)
+  {
+    TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
+    lvl1->SetRnrSelf(kFALSE);
+    for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); ++j)
+    {
+      TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
+      lvl2->SetRnrSelf(kTRUE);
+      lvl2->SetMainColor((Color_t)3);
+      lvl2->SetMainTransparency(80);
+    }
+    
+  }
+
+  return gsre;
+}
index f06b741d248770fc71ed69863c7f87102c3f034e..5d1ac09b5399158febbe10fb556a12d3067b9826 100644 (file)
@@ -52,8 +52,6 @@ TEvePointSet* tpc_clusters(TEveElement* cont=0, Float_t maxR=270)
     TClonesArray *cl = clrow->GetArray();
     Int_t ncl = cl->GetEntriesFast();
 
-    printf("%d: %d\n", i, ncl);
-
     while (ncl--)
     {
       AliCluster *c = (AliCluster*) cl->UncheckedAt(ncl);
index 9ab1cc450aa35180e7128cb7134df09957eb194d..902c46a4a69e47680ebc936225d789c89ee83c3f 100644 (file)
@@ -17,22 +17,23 @@ class TEveElement;
 
 #include "AliRunLoader.h"
 #include "AliCluster.h"
-#include "AliTRDcluster.h"
+#include "TRD/AliTRDcluster.h"
 #endif
 
-TEvePointSet* trd_clusters(TEveElement *cont = 0){
-       const Int_t kMaxClusters = 18 * 6 * 24 *10;
-       AliEveEventManager::AssertGeometry();
+TEvePointSet* trd_clusters(TEveElement *cont = 0)
+{
+  const Int_t kMaxClusters = 18 * 6 * 24 *10;
+  AliEveEventManager::AssertGeometry();
 
-       TEvePointSet *clusters = new TEvePointSet(kMaxClusters);
-       clusters->SetOwnIds(kTRUE);
+  TEvePointSet *clusters = new TEvePointSet(kMaxClusters);
+  clusters->SetOwnIds(kTRUE);
 
-       AliRunLoader *rl = AliEveEventManager::AssertRunLoader();
-       rl->LoadRecPoints("TRD");
+  AliRunLoader *rl = AliEveEventManager::AssertRunLoader();
+  rl->LoadRecPoints("TRD");
 
-       TObjArray *TRDcluster = 0x0;
-       TTree *recPoints = rl->GetTreeR("TRD", kFALSE);
-       recPoints->SetBranchAddress("TRDcluster", &TRDcluster);
+  TObjArray *TRDcluster = 0x0;
+  TTree *recPoints = rl->GetTreeR("TRD", kFALSE);
+  recPoints->SetBranchAddress("TRDcluster", &TRDcluster);
 
   Int_t nentr=(Int_t)recPoints->GetEntries();
   for (Int_t i=0; i<nentr; i++) {
@@ -44,9 +45,9 @@ TEvePointSet* trd_clusters(TEveElement *cont = 0){
       AliTRDcluster *c = (AliTRDcluster*)TRDcluster->UncheckedAt(ncl);
       Float_t g[3]; //global coordinates
       c->GetGlobalXYZ(g);
-                       clusters->SetNextPoint(g[0], g[1], g[2]);
-                       AliCluster *atp = new AliCluster(*c);
-                       clusters->SetPointId(atp);
+      clusters->SetNextPoint(g[0], g[1], g[2]);
+      AliCluster *atp = new AliCluster(*c);
+      clusters->SetPointId(atp);
     }
     TRDcluster->Clear();
   }
index 7b2685e5f2eaa69c4436e2f893e3e31ac6f923c1..758ba1a70b359681f5eb538d76de437bb325414b 100644 (file)
@@ -14,7 +14,10 @@ class TEveUtil;
 R__EXTERN TEveProjectionManager *gRPhiMgr;
 R__EXTERN TEveProjectionManager *gRhoZMgr;
 
-TEveGeoShape *gGeomGentle = 0;
+TEveGeoShape *gGeomGentle    = 0;
+TEveGeoShape *gGeomGentleTRD = 0;
+
+Bool_t gShowTRD = kFALSE;
 
 void visscan_init()
 {
@@ -22,11 +25,13 @@ void visscan_init()
   alieve_init(".", -1);
 
   TEveUtil::LoadMacro("geom_gentle.C");
+  if (gShowTRD) TEveUtil::LoadMacro("geom_gentle_trd.C");
 
   TEveUtil::LoadMacro("primary_vertex.C");
   TEveUtil::LoadMacro("esd_tracks.C");
   TEveUtil::LoadMacro("its_clusters.C+");
   TEveUtil::LoadMacro("tpc_clusters.C+");
+  TEveUtil::LoadMacro("trd_clusters.C+");
 
   TEveLine::SetDefaultSmooth(1);
 
@@ -49,7 +54,8 @@ void visscan_init()
 
 
   // geometry
-  gGeomGentle = geom_gentle();
+  gGeomGentle    = geom_gentle();
+  if (gShowTRD) gGeomGentleTRD = geom_gentle_trd();
 
 
   gROOT->ProcessLine(".L SplitGLView.C+g"); // !!!! debug-mode
@@ -63,7 +69,6 @@ void visscan_init()
       a->SetFontFile("comicbd");
       a->SetFontSize(10);
       gEve->GetScenes()->FindChild("R-Phi Projection")->AddElement(a);
-      gRPhiMgr->ImportElements(gGeomGentle);
    }
    if (gRhoZMgr) {
       TEveProjectionAxes* a = new TEveProjectionAxes(gRhoZMgr);
@@ -72,7 +77,6 @@ void visscan_init()
       a->SetFontFile("comicbd");
       a->SetFontSize(10);
       gEve->GetScenes()->FindChild("Rho-Z Projection")->AddElement(a);
-      gRhoZMgr->ImportElements(gGeomGentle);
    }
 
   // event
@@ -92,6 +96,11 @@ void on_new_event()
 
     TEvePointSet* tpcc = tpc_clusters();
     tpcc->SetMarkerColor(4);
+
+    TEvePointSet* trdc = trd_clusters();
+    trdc->SetMarkerColor(7);
+    trdc->SetMarkerStyle(4);
+    trdc->SetMarkerSize(0.5);
   }
   catch(TEveException& exc) {
     printf("Exception loading ITS/TPC clusters: %s\n", exc.Data());
@@ -129,12 +138,14 @@ void on_new_event()
     gRPhiMgr->DestroyElements();
     gRPhiMgr->SetCenter(x[0], x[1], x[2]);
     gRPhiMgr->ImportElements(gGeomGentle);
+    if (gShowTRD) gRPhiMgr->ImportElements(gGeomGentleTRD);
     gRPhiMgr->ImportElements(top);
   }
   if (gRhoZMgr && top) {
     gRhoZMgr->DestroyElements();
     gRhoZMgr->SetCenter(x[0], x[1], x[2]);
     gRhoZMgr->ImportElements(gGeomGentle);
+    if (gShowTRD) gRhoZMgr->ImportElements(gGeomGentleTRD);
     gRhoZMgr->ImportElements(top);
   }
 
diff --git a/EVE/test-macros/geom_extr_trd.C b/EVE/test-macros/geom_extr_trd.C
new file mode 100644 (file)
index 0000000..5f6cdad
--- /dev/null
@@ -0,0 +1,37 @@
+// $Id: geom_trd_tof.C 23442 2008-01-21 16:02:24Z 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.                                                 *
+ **************************************************************************/
+
+void geom_extr_trd()
+{
+  // Extract reasonably top-level mother-volumes of TRD and
+  // store them as geo-shape-extract.
+
+  gGeoManager = gEve->GetGeometry("$REVESYS/alice-data/alice_fullgeo.root");
+
+  TGeoNode* tnode = gGeoManager->GetTopVolume()->FindNode("B077_1");
+
+  TEveGeoTopNode* eve_tnode = new TEveGeoTopNode(gGeoManager, tnode);
+
+
+  for (Int_t i = 0; i < 18; ++i)
+  {
+    TGeoNode    * node1 = tnode->GetVolume()->FindNode(Form("BSEGMO%d_1", i));
+    printf("%2d - node1 = %p\n", i, node1);
+    TEveGeoNode * eve_node1 = new TEveGeoNode(node1);
+    eve_tnode->AddElement(eve_node1);
+
+    TGeoNode    * node2 = node1->GetVolume()->FindNode(Form("BTRD%d_1", i));
+    printf("%2d - node2 = %p\n", i, node2);
+    TEveGeoNode * eve_node2 = new TEveGeoNode(node2);
+    eve_node1->AddElement(eve_node2);
+  }
+
+  eve_tnode->Save("gentle_geo_trd.root", "Gentle TRD");
+
+}