1 // $Id: tpc_clusters.C 23497 2008-01-23 20:43:14Z mtadel $
2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
14 #include <TEveManager.h>
15 #include <TEvePointSet.h>
16 #include <EveBase/AliEveEventManager.h>
18 #include "AliRunLoader.h"
19 #include "AliCluster.h"
20 #include "TRD/AliTRDcluster.h"
23 TEvePointSet* trd_clusters(TEveElement *cont = 0)
25 const Int_t kMaxClusters = 18 * 6 * 24 *10;
26 AliEveEventManager::AssertGeometry();
28 TEvePointSet *clusters = new TEvePointSet(kMaxClusters);
29 clusters->SetOwnIds(kTRUE);
31 AliRunLoader *rl = AliEveEventManager::AssertRunLoader();
32 rl->LoadRecPoints("TRD");
34 TObjArray *TRDcluster = 0x0;
35 TTree *recPoints = rl->GetTreeR("TRD", kFALSE);
36 recPoints->SetBranchAddress("TRDcluster", &TRDcluster);
38 Int_t nentr=(Int_t)recPoints->GetEntries();
39 for (Int_t i=0; i<nentr; i++) {
40 if (!recPoints->GetEvent(i)) continue;
42 Int_t ncl=TRDcluster->GetEntriesFast();
45 AliTRDcluster *c = (AliTRDcluster*)TRDcluster->UncheckedAt(ncl);
46 Float_t g[3]; //global coordinates
48 clusters->SetNextPoint(g[0], g[1], g[2]);
49 AliCluster *atp = new AliCluster(*c);
50 clusters->SetPointId(atp);
55 if(clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
56 Warning("trd_clusters", "No TRD clusters");
61 clusters->SetMarkerStyle(2);
62 clusters->SetMarkerSize(0.2);
63 clusters->SetMarkerColor(4);
66 sprintf(form,"TRD Clusters");
67 clusters->SetName(form);
70 sprintf(tip,"N=%d", clusters->Size());
71 clusters->SetTitle(tip);
72 gEve->AddElement(clusters, cont);