]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/alice-macros/tpc_hits_eta_split.C
Removing obsolete macros which used the AliTPCtracker
[u/mrichter/AliRoot.git] / EVE / alice-macros / tpc_hits_eta_split.C
index c0dda068684e08d8a62ffbf236d37bb0d37c1ec4..c871ae87b50966cb6d4d3d47038e6ca0cf8414c9 100644 (file)
@@ -1,46 +1,48 @@
 // $Id$
-
-void tpc_hits_eta_split(const char *varexp    = "TPC2.fArray.fR:TPC2.fArray.fFi:TPC2.fArray.fZ",
-                       const char *selection = "TPC2.fArray.fR>80",
-                       Option_t *option      = "goff")
+// 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 <TTree.h>
+#include <TEveManager.h>
+#include <TEvePointSet.h>
+#include <TEveTreeTools.h>
+
+#include <AliRunLoader.h>
+#include <AliEveEventManager.h>
+#endif
+
+void tpc_hits_eta_split(const char *varexp    =
+                       "TPC2.fArray.fR:TPC2.fArray.fFi:TPC2.fArray.fZ"
+                       ":TPC2.fArray.Eta()",
+                       const char *selection = "TPC2.fArray.fR>80")
 {
   // Extracts 'major' TPC hits (not the compressed ones).
   // This gives ~2.5% of all hits.
 
-  AliRunLoader* rl =  Alieve::Event::AssertRunLoader();
+  AliRunLoader* rl =  AliEveEventManager::AssertRunLoader();
   rl->LoadHits("TPC");
 
   TTree* ht = rl->GetTreeH("TPC", false);
-  ht->SetEstimate(800*ht->GetEntries());
-  ht->Draw(varexp, selection, option);
-
-  gReve->DisableRedraw();
 
-  Reve::PointSetArray* l = new Reve::PointSetArray
-    ("TPC hits - Eta Slices", "");
-  l->SetMarkerColor((Color_t)3);
+  TEvePointSetArray* l = new TEvePointSetArray("TPC hits - Eta Slices", "");
+  l->SetSourceCS(TEvePointSelectorConsumer::kTVT_RPhiZ);
+  l->SetMarkerColor(3);
   l->SetMarkerStyle(20); // full circle
-  l->SetMarkerSize(1);
-  
-  TGListTreeItem *ti = gReve->AddRenderElement(l);
-
-  l->InitBins(ti, "Eta", 20, -2, 2);
-
-  Double_t *vr = ht->GetV1(), *vphi = ht->GetV2(), *vz = ht->GetV3();
-  Long64_t nr  = ht->GetSelectedRows();
-  while(nr-- > 0) {
-    using namespace TMath;
-    Double_t ctg = *vz / *vr;
-    Double_t eta = -Log(Hypot(1,ctg)-Abs(ctg)); if(ctg < 0) eta = -eta;
-    Double_t cos_theta = *vz / Hypot(*vr, *vz);
-    Double_t eta1       = -0.5*Log( (1.0-cos_theta)/(1.0+cos_theta) );
-    if(Abs(eta1 - eta) > 0.01) printf("etadiff %lf %lf\n", eta1, eta);
-    l->Fill(eta, *vr * Cos(*vphi), *vr * Sin(*vphi), *vz);
-    ++vr; ++vphi; ++vz;
-  }
+  l->SetMarkerSize(.5);
+
+  gEve->AddElement(l);
+  l->InitBins("Eta", 20, -2, 2);
+
+  TEvePointSelector ps(ht, l, varexp, selection);
+  ps.Select();
 
   l->CloseBins();
 
-  gReve->DrawRenderElement(l);
-  gReve->EnableRedraw();
+  gEve->Redraw3D();
 }