* See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
* full copyright notice. *
**************************************************************************/
-
-
#ifdef __CINT__
-namespace TEve
-{
-class Element;
-class PointSet;
-}
+class TEveElement;
+class TEvePointSet;
#else
-#include <TEve/TEve.h>
-#include <TEve/TEveManager.h>
-#include <TEve/PointSet.h>
-#include <Alieve/EventAlieve.h>
+#include <TEveManager.h>
+#include <TEvePointSet.h>
+#include <EveBase/AliEveEventManager.h>
#include <AliRunLoader.h>
#include <AliCluster.h>
TEvePointSet* tof_clusters(TEveElement* cont=0, Float_t maxR=390)
{
-
AliEveEventManager::AssertGeometry();
AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
rl->LoadRecPoints("TOF");
TTree *cTree = rl->GetTreeR("TOF", false);
+ if (cTree == 0)
+ return 0;
- TEvePointSet* clusters = new TEvePointSet(10000);
- clusters->SetOwnIds(kTRUE);
-
- TClonesArray *cl=NULL;
- TBranch *branch=cTree->GetBranch("TOF");
+ TClonesArray *cl = NULL;
+ TBranch *branch = cTree->GetBranch("TOF");
branch->SetAddress(&cl);
+ TEvePointSet* clusters = new TEvePointSet(10000);
+ clusters->SetOwnIds(kTRUE);
+
Int_t nentr=(Int_t)cTree->GetEntries();
for (Int_t i=0; i<nentr; i++) {
if (!cTree->GetEvent(i)) continue;
cout<<" ncl = "<<ncl<<endl;
Float_t maxRsqr = maxR*maxR;
while (ncl--) {
-
AliCluster *c=(AliCluster*)cl->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]);
AliCluster *atp = new AliCluster(*c);
-
clusters->SetPointId(atp);
- }
+ }
}
}
- if(clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
- Warning("tof_clusters", "No TOF clusters");
+ if (clusters->Size() == 0 && gEve->GetKeepEmptyCont() == kFALSE) {
+ Warning("tof_clusters.C", "No TOF clusters");
delete clusters;
return 0;
}
char tip[1000];
sprintf(tip,"N=%d", clusters->Size());
clusters->SetTitle(tip);
-
gEve->AddElement(clusters, cont);
gEve->Redraw3D();