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
20 #if !defined(__CINT__) || defined(__MAKECINT__)
21 #include <Riostream.h>
23 #include <TEveManager.h>
24 #include <TEvePointSet.h>
26 #include <AliMUONVCluster.h>
27 #include <AliMUONVClusterStore.h>
28 #include <AliRunLoader.h>
29 #include <AliEveEventManager.h>
34 //______________________________________________________________________________
35 void add_muon_clusters(TIter* next, TEvePointSet* clusterList)
37 // loop over clusters and produce corresponding graphic objects
38 AliMUONVCluster* cluster;
39 while ( ( cluster = static_cast<AliMUONVCluster*>((*next)()) ) )
41 clusterList->SetNextPoint(cluster->GetX(),cluster->GetY(),cluster->GetZ());
45 //______________________________________________________________________________
49 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
50 rl->LoadRecPoints("MUON");
51 TTree* ct = rl->GetTreeR("MUON",kFALSE);
53 AliMUONVClusterStore* clusterStore = AliMUONVClusterStore::Create(*ct);
54 clusterStore->Clear();
55 clusterStore->Connect(*ct,kFALSE);
57 rl->UnloadRecPoints("MUON");
59 if (clusterStore->GetSize() == 0 && !gEve->GetKeepEmptyCont()) {
65 TEvePointSet* clusterList = new TEvePointSet(10000);
66 clusterList->SetName("MUON Clusters");
67 clusterList->SetTitle(Form("N=%d",clusterStore->GetSize()));
68 clusterList->SetPickable(kFALSE);
69 clusterList->SetMarkerStyle(20);
70 clusterList->SetMarkerColor(kCyan);
71 clusterList->SetMarkerSize(1.);
73 // add cluster to the container
74 TIter next(clusterStore->CreateIterator());
75 add_muon_clusters(&next, clusterList);
78 // add graphic containers
79 gEve->DisableRedraw();
80 gEve->AddElement(clusterList);