From d9df40bcb07fadf65e8544919649830011342b48 Mon Sep 17 00:00:00 2001 From: cvetan Date: Mon, 29 Oct 2007 09:54:21 +0000 Subject: [PATCH] New macro for visualization of the HMPID clusters (Jouri) --- EVE/alice-macros/hmpid_clusters.C | 99 +++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 EVE/alice-macros/hmpid_clusters.C diff --git a/EVE/alice-macros/hmpid_clusters.C b/EVE/alice-macros/hmpid_clusters.C new file mode 100644 index 00000000000..466e83884f7 --- /dev/null +++ b/EVE/alice-macros/hmpid_clusters.C @@ -0,0 +1,99 @@ +#ifdef __CINT__ + +namespace Reve +{ +class RenderElement; +class PointSet; +} + +#else + +#include +#include +#include +#include + +#include +#include + +#include + +#endif + +Reve::PointSet* hmpid_clusters(Reve::RenderElement* cont=0, Float_t maxR=1000) +{ + const Int_t nCh=7; + TClonesArray *cl[nCh] = {0,0,0,0,0,0,0}; + Char_t *name[nCh]={ + "HMPID0", + "HMPID1", + "HMPID2", + "HMPID3", + "HMPID4", + "HMPID5", + "HMPID6" + }; + + + Reve::PointSet* clusters = new Reve::PointSet(10000); + clusters->SetOwnIds(kTRUE); + + Alieve::Event::AssertGeometry(); + + AliRunLoader* rl = Alieve::Event::AssertRunLoader(); + rl->LoadRecPoints("HMPID"); + + TTree *cTree = rl->GetTreeR("HMPID", false); + if (!cTree) return 0; + + for (Int_t k=0; kGetBranch(name[k]); + if (!br) return 0; + br->SetAddress(&(cl[k])); + } + + if (!cTree->GetEvent(0)) return 0; + + + for (Int_t i=0; iGetEntriesFast(); + + Float_t maxRsqr = maxR*maxR; + while (ncl--) { + AliCluster3D *c=(AliCluster3D*)arr->UncheckedAt(ncl); + Float_t g[3]; //global coordinates + c->GetGlobalXYZ(g); + if (g[0]*g[0]+g[1]*g[1] < maxRsqr) + { + clusters->SetNextPoint(g[0], g[1], g[2]); + AliCluster3D *atp = new AliCluster3D(*c); + clusters->SetPointId(atp); + } + } + } + + if(clusters->Size() == 0 && gReve->GetKeepEmptyCont() == kFALSE) { + Warning("hmpid_clusters", "No HMPID clusters"); + delete clusters; + return 0; + } + + clusters->SetMarkerStyle(2); + clusters->SetMarkerSize(0.2); + clusters->SetMarkerColor(4); + + char form[1000]; + sprintf(form,"HMPID Clusters"); + clusters->SetName(form); + + char tip[1000]; + sprintf(tip,"N=%d", clusters->Size()); + clusters->SetTitle(tip); + + using namespace Reve; + gReve->AddRenderElement(clusters, cont); + gReve->Redraw3D(); + + return clusters; +} -- 2.31.1