]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/alice-macros/trd_clusters.C
CMake: removing qpythia from the depedencies
[u/mrichter/AliRoot.git] / EVE / alice-macros / trd_clusters.C
index f5a2d773bc283693068efd0b033a031d48d6085d..5e99f57c7fe8e63c1b5e83f5692e18d6a0fed772 100644 (file)
@@ -1,4 +1,4 @@
-// $Id: tpc_clusters.C 23497 2008-01-23 20:43:14Z mtadel $
+// $Id$
 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
 
 /**************************************************************************
@@ -7,17 +7,22 @@
  * full copyright notice.                                                 *
  **************************************************************************/
 
-#ifdef __CINT__
-class TEvePointSet;
-class TEveElement;
-#else
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <TObjArray.h>
+#include <TTree.h>
 #include <TEveManager.h>
+#include <TEveElement.h>
 #include <TEvePointSet.h>
-#include <EveBase/AliEveEventManager.h>
+#include <TGeoMatrix.h>
 
-#include "AliRunLoader.h"
-#include "AliCluster.h"
-#include "TRD/AliTRDcluster.h"
+#include <AliCluster.h>
+#include <AliGeomManager.h>
+#include <AliRunLoader.h>
+#include <AliTRDcluster.h>
+#include <AliEveEventManager.h>
+#else
+class TEvePointSet;
+class TEveElement;
 #endif
 
 TEvePointSet* trd_clusters(TEveElement *cont = 0)
@@ -39,7 +44,6 @@ TEvePointSet* trd_clusters(TEveElement *cont = 0)
   TEvePointSet *clusters = new TEvePointSet(kMaxClusters);
   clusters->SetOwnIds(kTRUE);
 
-
   Int_t nentr=(Int_t)recPoints->GetEntries();
   for (Int_t i=0; i<nentr; i++) {
     if (!recPoints->GetEvent(i)) continue;
@@ -48,9 +52,21 @@ TEvePointSet* trd_clusters(TEveElement *cont = 0)
 
     while (ncl--) {
       AliTRDcluster *c = (AliTRDcluster*)TRDcluster->UncheckedAt(ncl);
-      Float_t g[3]; //global coordinates
-      c->GetGlobalXYZ(g);
-      clusters->SetNextPoint(g[0], g[1], g[2]);
+      //Float_t g[3]; //global coordinates
+      //c->GetGlobalXYZ(g);
+      
+      Int_t fVolumeId = c->GetVolumeId();
+      const TGeoHMatrix *mt =AliGeomManager::GetTracking2LocalMatrix(fVolumeId);;
+      Double_t txyz[3] = {c->GetX(), c->GetY(), c->GetZ()};
+      Double_t lxyz[3] = {0, 0, 0};
+      mt->LocalToMaster(txyz,lxyz);
+   
+      TGeoHMatrix *mlIdeal = AliGeomManager::GetOrigGlobalMatrix(fVolumeId);
+      Double_t gxyzIdeal[3] = {0, 0, 0};
+      mlIdeal->LocalToMaster(lxyz,gxyzIdeal);
+      
+      clusters->SetNextPoint(gxyzIdeal[0], gxyzIdeal[1], gxyzIdeal[2]);
+      
       AliCluster *atp = new AliCluster(*c);
       clusters->SetPointId(atp);
     }
@@ -65,18 +81,13 @@ TEvePointSet* trd_clusters(TEveElement *cont = 0)
     return 0;
   }
 
-  char form[1000];
-  sprintf(form,"TRD Clusters");
-  clusters->SetName(form);
+  clusters->SetName("TRD Clusters");
+
+  clusters->SetTitle(Form("N=%d", clusters->Size()));
 
-  char tip[1000];
-  sprintf(tip,"N=%d", clusters->Size());
-  clusters->SetTitle(tip);
+  const TString viz_tag("REC Clusters TRD");
 
-  const TString viz_tag("TRD Clusters");
-  // when going to new root call:
-  // clusters->ApplyVizTag(viz_tag, "Clusters");
-  clusters->ApplyVizTag(viz_tag);
+  clusters->ApplyVizTag(viz_tag, "Clusters");
 
   gEve->AddElement(clusters, cont);