* full copyright notice. *
**************************************************************************/
-class AliEveTPCData;
-class AliEveEventManager;
-
-AliEveTPCData *g_tpc_data = 0;
-AliEveEventManager *g_tpc_last_event = 0;
-
void tpc_digits(Int_t mode=1)
{
- if (g_tpc_data == 0 || g_tpc_last_event != gAliEveEvent)
+ AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
+ rl->LoadDigits("TPC");
+ TTree* dt = rl->GetTreeD("TPC", false);
+ if (dt == 0)
{
- AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
- rl->LoadDigits("TPC");
- TTree* dt = rl->GetTreeD("TPC", false);
-
- g_tpc_data = new AliEveTPCData;
- g_tpc_data->LoadDigits(dt, kTRUE); // Create all present sectors.
-
- g_tpc_last_event = gAliEveEvent;
+ throw TEveException("tpc_digits Can not access digits tree.");
}
- // Viewport limits.
- /*
- Float_t left, right, top, bottom;
- right = di->fOut2Seg.fNMaxPads* di->fOut2Seg.fPadWidth;
- left = -right;
- bottom = di->fInnSeg.fRlow;
- top = bottom + di->fOut2Seg.fRlow +
- di->fOut2Seg.fNRows*di->fOut2Seg.fPadLength - di->fInnSeg.fRlow;
- */
+ AliEveTPCData *x = new AliEveTPCData;
+
+ x->LoadDigits(dt, kTRUE); // Create all present sectors.
gStyle->SetPalette(1, 0);
Color_t col = 36;
case 0: { // Display a single sector
AliEveTPCSector2D* s = new AliEveTPCSector2D();
s->SetFrameColor(col);
- s->SetDataSource(g_tpc_data);
+ s->SetDataSource(x);
gEve->AddElement(s);
gEve->Redraw3D();
- //TGLViewer* cam = gEve->GetGLViewer();
+ //TGLViewer* cam = gEve->GetDefaultGLViewer();
//cam->SetCurrentCamera(TGLViewer::kCameraOrthoXOY) ;
//cam->SetOrthoCamera(TGLViewer::kCameraOrthoXOY, 2*left, 2*right, 2*top, bottom);
//printf("%f %f %f %f\n", left, right, top, bottom);
{
TEveElementList* l = new TEveElementList("TPC plate 1");
l->SetTitle("TPC Plate");
- l->SetMainColor(Color_t(col));
+ l->SetMainColor(col);
gEve->AddElement(l);
for (Int_t i = 0; i<18; i++)
{
AliEveTPCSector2D* s = new AliEveTPCSector2D(Form("AliEveTPCSector2D %d", i));
s->SetSectorID(i);
- s->SetDataSource(g_tpc_data);
+ s->SetDataSource(x);
s->SetFrameColor(col);
s->SetAutoTrans(kTRUE);
- gEve->AddElement(s, l);
+ l->AddElement(s);
}
}
{
TEveElementList* l = new TEveElementList("TPC plate 2");
l->SetTitle("TPC Plate");
- l->SetMainColor(Color_t(col));
+ l->SetMainColor(col);
gEve->AddElement(l);
for (Int_t i = 18; i<36; i++)
{
AliEveTPCSector2D* s = new AliEveTPCSector2D(Form("AliEveTPCSector2D %d", i));
s->SetSectorID(i);
- s->SetDataSource(g_tpc_data);
+ s->SetDataSource(x);
s->SetFrameColor(col);
s->SetAutoTrans(kTRUE);
- gEve->AddElement(s, l);
+ l->AddElement(s);
}
}
gEve->EnableRedraw();
case 2 : { // Display a single sector in 3D
AliEveTPCSector3D* s = new AliEveTPCSector3D();
s->SetFrameColor(col);
- s->SetDataSource(g_tpc_data);
+ s->SetDataSource(x);
gEve->AddElement(s);
gEve->Redraw3D();
break;
{
TEveElementList* l = new TEveElementList("TPC plate 1");
l->SetTitle("TPC Plate");
- l->SetMainColor(Color_t(col));
+ l->SetMainColor(col);
gEve->AddElement(l);
for (Int_t i = 0; i<18; i++)
{
AliEveTPCSector3D* s = new AliEveTPCSector3D(Form("AliEveTPCSector3D %d", i));
s->SetSectorID(i);
- s->SetDataSource(g_tpc_data);
+ s->SetDataSource(x);
s->SetFrameColor(col);
s->SetAutoTrans(kTRUE);
- gEve->AddElement(s, l);
+ l->AddElement(s);
}
}
{
TEveElementList* l = new TEveElementList("TPC plate 2");
l->SetTitle("TPC Plate");
- l->SetMainColor(Color_t(col));
+ l->SetMainColor(col);
gEve->AddElement(l);
for (Int_t i = 18; i<36; i++)
{
AliEveTPCSector3D* s = new AliEveTPCSector3D(Form("AliEveTPCSector3D %d", i));
s->SetSectorID(i);
- s->SetDataSource(g_tpc_data);
+ s->SetDataSource(x);
s->SetFrameColor(col);
s->SetAutoTrans(kTRUE);
- gEve->AddElement(s, l);
+ l->AddElement(s);
}
}
gEve->EnableRedraw();
if (start < 0) start = 0;
if (end > 35) end = 35;
- if (g_tpc_data == 0 || g_tpc_last_event != gAliEveEvent) {
- AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
- rl->LoadDigits("TPC");
- TTree* dt = rl->GetTreeD("TPC", false);
+ AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
+ rl->LoadDigits("TPC");
+ TTree* dt = rl->GetTreeD("TPC", false);
+ if (dt == 0)
+ {
+ throw TEveException("tpc_digits Can not access digits tree.");
+ }
- g_tpc_data = new AliEveTPCData;
- g_tpc_data->LoadDigits(dt, kTRUE); // Create all present sectors.
+ AliEveTPCData *x = new AliEveTPCData;
- g_tpc_last_event = gAliEveEvent;
- }
+ x->LoadDigits(dt, kTRUE); // Create all present sectors.
gStyle->SetPalette(1, 0);
Color_t col = 36;
gEve->DisableRedraw();
{
TEveElementList* l = new TEveElementList("TPC sectors");
- l->SetMainColor(Color_t(col));
+ l->SetMainColor(col);
gEve->AddElement(l);
for (Int_t i=start; i<=end; i++)
{
AliEveTPCSector2D* s = new AliEveTPCSector2D();
s->SetSectorID(i);
- s->SetDataSource(g_tpc_data);
+ s->SetDataSource(x);
s->SetFrameColor(col);
s->SetAutoTrans(kTRUE);
gEve->AddElement(s, l);