X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;ds=sidebyside;f=EVE%2Falice-macros%2Fits_clusters.C;h=5780170355bde46a54e91b83e70b8bd3343a8380;hb=6c49a8e133417c4a687af6075dce81efd0f608eb;hp=30875ea7f2c98620f656c998442b131f8d4fdf0b;hpb=f6afd0e1c0d6c8c103b55feeabcc8a0ff47a9f9d;p=u%2Fmrichter%2FAliRoot.git diff --git a/EVE/alice-macros/its_clusters.C b/EVE/alice-macros/its_clusters.C index 30875ea7f2c..5780170355b 100644 --- a/EVE/alice-macros/its_clusters.C +++ b/EVE/alice-macros/its_clusters.C @@ -6,22 +6,23 @@ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * * full copyright notice. * **************************************************************************/ -#ifdef __CINT__ - -class TEveElement; -class TEvePointSet; - -#else +#if !defined(__CINT__) || defined(__MAKECINT__) +#include +#include +#include #include +#include #include -#include #include #include - -#include - +#include +#else +class TEveElement; +class TEvePointSet; +class TTree; +class TBranch; #endif TEvePointSet* its_clusters(TEveElement* cont=0, Float_t maxR=50) @@ -42,18 +43,27 @@ TEvePointSet* its_clusters(TEveElement* cont=0, Float_t maxR=50) TEvePointSet* clusters = new TEvePointSet(10000); clusters->SetOwnIds(kTRUE); - Int_t nentr=(Int_t)cTree->GetEntries(); - for (Int_t i=0; iGetEntries(); + for (Int_t i=0; iGetEvent(i)) continue; - Int_t ncl=cl->GetEntriesFast(); + Int_t ncl = cl->GetEntriesFast(); Float_t maxRsqr = maxR*maxR; - while (ncl--) { - AliCluster *c=(AliCluster*)cl->UncheckedAt(ncl); + for (Int_t icl = 0; icl < ncl; ++icl) + { + AliCluster *c = (AliCluster*) cl->UncheckedAt(icl); + // This really should not happen, but did in online display once. + if (c == 0) + { + ::Warning("its_clusters", "Got NULL AliCluster*, idx=%d, N=%d.", + icl, ncl); + continue; + } Float_t g[3]; //global coordinates c->GetGlobalXYZ(g); - if (g[0]*g[0]+g[1]*g[1] < maxRsqr) + if (g[0]*g[0] + g[1]*g[1] < maxRsqr) { clusters->SetNextPoint(g[0], g[1], g[2]); AliCluster *atp = new AliCluster(*c); @@ -70,26 +80,13 @@ TEvePointSet* its_clusters(TEveElement* cont=0, Float_t maxR=50) return 0; } - char form[1000]; - sprintf(form,"ITS Clusters"); - clusters->SetName(form); + clusters->SetName("ITS Clusters"); - char tip[1000]; - sprintf(tip,"N=%d", clusters->Size()); - clusters->SetTitle(tip); + clusters->SetTitle(Form("N=%d", clusters->Size())); - const TString viz_tag("ITS Clusters"); - if (gEve->FindVizDBEntry(viz_tag) == 0) - { - TEvePointSet* m = new TEvePointSet(); - m->SetMarkerColor(4); - m->SetMarkerSize(0.2); - m->SetMarkerStyle(2); - gEve->InsertVizDBEntry(viz_tag, m); - } - // The above can be removed when going to new root - then call: - // clusters->ApplyVizTag(viz_tag, "Clusters"); - clusters->ApplyVizTag(viz_tag); + const TString viz_tag("REC Clusters ITS"); + + clusters->ApplyVizTag(viz_tag, "Clusters"); gEve->AddElement(clusters, cont);