--- /dev/null
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
+ * full copyright notice. *
+ **************************************************************************/
+
+
+#ifdef __CINT__
+
+namespace TEve
+{
+class Element;
+class PointSet;
+}
+
+#else
+
+#include <TEve/TEve.h>
+#include <TEve/TEveManager.h>
+#include <TEve/PointSet.h>
+#include <Alieve/EventAlieve.h>
+
+#include <AliRunLoader.h>
+#include <AliCluster.h>
+
+#include <TClonesArray.h>
+
+#endif
+
+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);
+
+ TEvePointSet* clusters = new TEvePointSet(10000);
+ clusters->SetOwnIds(kTRUE);
+
+ TClonesArray *cl=NULL;
+ TBranch *branch=cTree->GetBranch("TOF");
+ branch->SetAddress(&cl);
+
+ 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)
+ {
+ 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");
+ 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);
+
+ using namespace Eve;
+ gEve->AddElement(clusters, cont);
+ gEve->Redraw3D();
+
+ return clusters;
+}
* full copyright notice. *
**************************************************************************/
+
void tof_digits()
-{
+{
TClonesArray *array = 0x0;
- Int_t nDigitsInVolume[3] = {-1, -1, -1};
- Int_t nStrips=19;
TGeoManager *localGeoManager = (TGeoManager*)gEve->GetGeometry("./geometry.root");//"$REVESYS/alice-data/alice_fullgeo.root");
if (!localGeoManager) {
printf("ERROR: no TGeo\n");
di->Dump();
AliTOFGeometry* g = di->fGeom;
-
+
gStyle->SetPalette(1, 0);
gEve->DisableRedraw();
gEve->AddElement(ll);
for(Int_t iSector=0; iSector<g->NSectors(); iSector++) {
-
+
array = di->GetDigits(iSector);
-
+
AliEveTOFSector* m = new AliEveTOFSector(localGeoManager,iSector,array);
gEve->AddElement(m, ll);
void tof_digits_sector(Int_t sector=0)
{
- Int_t nDigitsInVolume[3] = {-1, -1, -1};
- Int_t nStrips=19;
+
TGeoManager *localGeoManager = (TGeoManager*)gEve->GetGeometry("./geometry.root");//"$REVESYS/alice-data/alice_fullgeo.root");
if (!localGeoManager) {
printf("ERROR: no TGeo\n");
TString bsPadZ="PadZ";
TString sPadX;
TString bsPadX="PadX";
-
+
Char_t sectorName[100];
Char_t sectorTitle[200];
sPlate+=iPlate;
TEveElementList* relPlate = new TEveElementList(sPlate.Data());
relPlate->SetMainColor((Color_t)2);
- gEve->AddElement(relPlaete, l);
+ gEve->AddElement(relPlate, l);
for(Int_t iStrip=0; iStrip<nStrips; iStrip++) {
* full copyright notice. *
**************************************************************************/
+
TEvePointSet*
tof_hits(const char *varexp = "fX:fY:fZ",
const char *selection = "",
rl->LoadHits("TOF");
TTree* ht = rl->GetTreeH("TOF", false);
-
+
//PH The line below is replaced waiting for a fix in Root
//PH which permits to use variable siza arguments in CINT
//PH on some platforms (alphalinuxgcc, solariscc5, etc.)
--- /dev/null
+void tof_raw(const char *input = "raw.root",
+ const char *geometry = "geometry.root",
+ Int_t event = 0)
+{
+
+ TClonesArray *array = 0x0;
+
+ if (gSystem->AccessPathName(input, kReadPermission))
+ {
+ Error("tof_raw", "file '%s' not found.", input);
+ return;
+ }
+
+ TGeoManager *localGeoManager = (TGeoManager*)gEve->GetGeometry(geometry);
+ if (!localGeoManager) {
+ printf("ERROR: no TGeo\n");
+ }
+
+ AliRawReader *rawReader = NULL;
+ TString fileName(input);
+ if (fileName.EndsWith("/")) {
+ rawReader = new AliRawReaderFile(fileName);
+ } else if (fileName.EndsWith(".root")) {
+ rawReader = new AliRawReaderRoot(fileName);
+ } else if (!fileName.IsNull()) {
+ rawReader = new AliRawReaderDate(fileName);
+ rawReader->SelectEvents(7);
+ }
+
+ AliEveTOFDigitsInfo* di = new AliEveTOFDigitsInfo();
+
+ for (Int_t ev=0; rawReader->NextEvent(); ev++) {
+ if (ev==event) {
+
+ if (di) {
+ di->Delete();
+ di = new AliEveTOFDigitsInfo();
+ }
+
+ di->ReadRaw(rawReader, ev);
+ continue;
+ }
+
+ else continue;
+
+ }
+
+ AliTOFGeometry* g = new AliTOFGeometry();
+
+ gStyle->SetPalette(1, 0);
+ gEve->DisableRedraw();
+
+ TEveElementList* ll = new TEveElementList("TOF");
+ ll->SetTitle("TOF detector");
+ ll->SetMainColor((Color_t)2);
+ gEve->AddElement(ll);
+
+ for(Int_t iSector=0; iSector<g->NSectors(); iSector++) {
+
+ array = di->GetDigits(iSector);
+
+ AliEveTOFSector* m = new AliEveTOFSector(localGeoManager,iSector,array);
+
+ gEve->AddElement(m, ll);
+
+ }
+
+ gEve->EnableRedraw();
+
+}