New files from Eleazar: geometry and hits for ACORDE.
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Oct 2007 09:47:20 +0000 (09:47 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Oct 2007 09:47:20 +0000 (09:47 +0000)
EVE/alice-macros/acorde_hits.C [new file with mode: 0644]
EVE/alice-macros/geom_acorde.C [new file with mode: 0644]

diff --git a/EVE/alice-macros/acorde_hits.C b/EVE/alice-macros/acorde_hits.C
new file mode 100644 (file)
index 0000000..040fab4
--- /dev/null
@@ -0,0 +1,43 @@
+// $Id$
+
+Reve::PointSet*
+acorde_hits(const char *varexp    = "ACORDE.fX:ACORDE.fY:ACORDE.fZ",
+        const char *selection = "",
+         Reve::RenderElement* cont = 0)
+{
+  AliRunLoader* rl =  Alieve::Event::AssertRunLoader();
+  rl->LoadHits("ACORDE");
+
+  TTree* ht = rl->GetTreeH("ACORDE", false);
+  
+  //PH The line below is replaced waiting for a fix in Root
+  //PH which permits to use variable siza arguments in CINT
+  //PH on some platforms (alphalinuxgcc, solariscc5, etc.)
+  //PH  Reve::PointSet* points = new Reve::PointSet(Form("ACORDE Hits '%s'", selection));
+  char form[1000];
+  sprintf(form,"ACORDE Hits '%s'", selection);
+  Reve::PointSet* points = new Reve::PointSet(form);
+
+  TPointSelector ps(ht, points, varexp, selection);
+  ps.Select();
+
+  if(points->Size() == 0 && gReve->GetKeepEmptyCont() == kFALSE) {
+    Warning("acorde_hits", Form("No hits match '%s'", selection));
+    delete points;
+   return 0;
+  }
+
+  //PH  points->SetTitle(Form("N=%d", points->Size()));
+  sprintf(form,"N=%d", points->Size());
+  points->SetTitle(form);
+  points->SetMarkerSize(.5);
+  points->SetMarkerColor((Color_t)2);
+
+  if(cont)
+    gReve->AddRenderElement(cont, points);
+  else 
+    gReve->AddRenderElement(points);
+  gReve->Redraw3D();
+
+  return points;
+}
diff --git a/EVE/alice-macros/geom_acorde.C b/EVE/alice-macros/geom_acorde.C
new file mode 100644 (file)
index 0000000..cfbd74b
--- /dev/null
@@ -0,0 +1,23 @@
+// $Id$
+
+void geom_acorde()
+{
+  using namespace std;
+
+  //  gGeoManager = gReve->GetGeometry("$REVESYS/alice-data/alice_fullgeo.root");
+  Reve::RenderElementList* list = new Reve::RenderElementList("ACORDE1_");
+  gReve->AddGlobalRenderElement(list);
+
+
+  for(Int_t i=1; i<60; ++i){
+    char form[10000];
+    sprintf(form, "ACORDE1_%d", i);
+    TGeoNode* node = gGeoManager->GetTopVolume()->FindNode(form);       
+    Reve::GeoTopNodeRnrEl* re =  new Reve::GeoTopNodeRnrEl(gGeoManager, node);
+    re->UseNodeTrans();
+    gReve->AddGlobalRenderElement(list, re);
+  }
+  
+  gReve->Redraw3D();
+  
+}