#include <AliRunLoader.h>
#include <AliCluster.h>
-#include <TClonesArray.h>
-
#endif
TEvePointSet* tof_clusters(TEveElement* cont=0, Float_t maxR=390)
if (cTree == 0)
return 0;
- TClonesArray *cl = NULL;
- TBranch *branch = cTree->GetBranch("TOF");
- branch->SetAddress(&cl);
+ TObjArray *cl = 0x0;
+ cTree->SetBranchAddress("TOF", &cl);
TEvePointSet* clusters = new TEvePointSet(10000);
clusters->SetOwnIds(kTRUE);
+ Float_t maxRsqr = maxR*maxR;
+
Int_t nentr=(Int_t)cTree->GetEntries();
for (Int_t i=0; i<nentr; i++) {
if (!cTree->GetEvent(i)) continue;
Int_t ncl=cl->GetEntriesFast();
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)
- {
+
+ 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.C", "No TOF clusters");
+ delete clusters;
+ return 0;
+ }
+
+ clusters->SetMarkerStyle(2);
+ clusters->SetMarkerSize(0.2);
+ clusters->SetMarkerColor(4);
+
+ char form[1000];
+ sprintf(form,"TOF Clusters");
+ clusters->SetName(form);
+
+ char tip[1000];
+ sprintf(tip,"N=%d", clusters->Size());
+ clusters->SetTitle(tip);
+ gEve->AddElement(clusters, cont);
+ gEve->Redraw3D();
+
+ return clusters;
+}
+
+TEvePointSet* tof_clusters(Int_t selectedSector=-1,
+ 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;
+
+ TObjArray *cl = 0x0;
+ cTree->SetBranchAddress("TOF", &cl);
+
+ TEvePointSet* clusters = new TEvePointSet(10000);
+ clusters->SetOwnIds(kTRUE);
+
+ Float_t maxRsqr = maxR*maxR;
+ Double_t phiAngle = maxR*maxR;
+
+ Int_t nentr=(Int_t)cTree->GetEntries();
+ for (Int_t i=0; i<nentr; i++) {
+ if (!cTree->GetEvent(i)) continue;
+
+ Int_t ncl=cl->GetEntriesFast();
+ cout<<" ncl = "<<ncl<<endl;
+ while (ncl--) {
+ AliCluster *c=(AliCluster*)cl->UncheckedAt(ncl);
+ Float_t g[3]; //global coordinates
+ c->GetGlobalXYZ(g);
+
+ phiAngle = 180./TMath::Pi()*(TMath::ATan2(-g[1],-g[0])+TMath::Pi());
+
+ if (g[0]*g[0]+g[1]*g[1] < maxRsqr) {
+ if (
+ (selectedSector!=-1 &&
+ phiAngle>=selectedSector*20. && phiAngle<(selectedSector+1)*20.)
+ ||
+ selectedSector==-1)
+ {
+ clusters->SetNextPoint(g[0], g[1], g[2]);
+ AliCluster *atp = new AliCluster(*c);
+ clusters->SetPointId(atp);
+ }
+ }
+
}
}
* full copyright notice. *
**************************************************************************/
-void tof_digits_strips()
+void tof_digits_strips(Int_t selectedSector=-1)
{
TClonesArray *array = 0x0;
gEve->AddElement(ll);
for(Int_t iSector=0; iSector<g->NSectors(); iSector++) {
-
+ if (selectedSector!=-1 && iSector!=selectedSector) continue;
sprintf(sectorName,"Sector%2i",iSector);
TEveElementList* l = new TEveElementList(sectorName);
l->SetTitle(sectorTitle);
array = di->GetDigits(iSector,iPlate, iStrip);
- AliEveTOFStrip* m = new AliEveTOFStrip(localGeoManager,iSector,iPlate,iStrip,array);
+ AliEveTOFStrip* m = new AliEveTOFStrip(localGeoManager,
+ iSector,iPlate,iStrip,array);
gEve->AddElement(m, relPlate);
}