3 /**************************************************************************
4 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
5 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
6 * full copyright notice. *
7 **************************************************************************/
10 /// \file muon_clusters.C
11 /// \brief Macro to visualise clusters from MUON spectrometer
12 /// (both tracker and trigger).
14 /// Use muon_clusters() in order to run it.
16 /// Needs that alieve_init() is already called.
18 /// \author P. Pillot, L. Aphecetche; Subatech
22 #include "AliMUONVCluster.h"
23 #include "AliMUONVClusterStore.h"
25 #include "AliRunLoader.h"
27 #include "EveBase/AliEveEventManager.h"
29 #include <TEveManager.h>
30 #include <TEvePointSet.h>
33 #include <Riostream.h>
39 //______________________________________________________________________________
40 void add_muon_clusters(TIter* next, TEvePointSet* clusterList)
42 // loop over clusters and produce corresponding graphic objects
43 AliMUONVCluster* cluster;
44 while ( ( cluster = static_cast<AliMUONVCluster*>((*next)()) ) )
46 clusterList->SetNextPoint(cluster->GetX(),cluster->GetY(),cluster->GetZ());
50 //______________________________________________________________________________
54 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
55 rl->LoadRecPoints("MUON");
56 TTree* ct = rl->GetTreeR("MUON",kFALSE);
58 AliMUONVClusterStore* clusterStore = AliMUONVClusterStore::Create(*ct);
59 clusterStore->Clear();
60 clusterStore->Connect(*ct,kFALSE);
62 rl->UnloadRecPoints("MUON");
64 if (clusterStore->GetSize() == 0 && !gEve->GetKeepEmptyCont()) {
70 TEvePointSet* clusterList = new TEvePointSet(10000);
71 clusterList->SetName("MUON Clusters");
72 clusterList->SetTitle(Form("N=%d",clusterStore->GetSize()));
73 clusterList->SetPickable(kFALSE);
74 clusterList->SetMarkerStyle(20);
75 clusterList->SetMarkerColor(kCyan);
76 clusterList->SetMarkerSize(1.);
78 // add cluster to the container
79 TIter next(clusterStore->CreateIterator());
80 add_muon_clusters(&next, clusterList);
83 // add graphic containers
84 gEve->DisableRedraw();
85 gEve->AddElement(clusterList);