Index: display/DelphesEventDisplay.cc
===================================================================
--- display/DelphesEventDisplay.cc	(revision a3b249554af9dc531fdeb38d1b48d0e8fb00c262)
+++ display/DelphesEventDisplay.cc	(revision fafc4338a61369fbe7d7b57cb98ebe9514a799bd)
@@ -31,5 +31,5 @@
 DelphesEventDisplay::DelphesEventDisplay()
 {
-   event_id = 0;
+   event_id_ = 0;
    tkRadius_ = 1.29;
    totRadius_ = 2.0;
@@ -37,6 +37,6 @@
    bz_ = 3.8;
    chain_ = new TChain("Delphes");
-   gTreeReader = 0;
-   gDelphesDisplay = 0;
+   treeReader_ = 0;
+   delphesDisplay_ = 0;
 }
 
@@ -48,5 +48,5 @@
 DelphesEventDisplay::DelphesEventDisplay(const char *configFile, const char *inputFile, Delphes3DGeometry& det3D)
 {
-   event_id = 0;
+   event_id_ = 0;
    tkRadius_ = 1.29;
    totRadius_ = 2.0;
@@ -54,6 +54,6 @@
    bz_ = 3.8;
    chain_ = new TChain("Delphes");
-   gTreeReader = 0;
-   gDelphesDisplay = 0;
+   treeReader_ = 0;
+   delphesDisplay_ = 0;
 
    // initialize the application
@@ -103,9 +103,9 @@
    // Create object of class ExRootTreeReader
    printf("*** Opening Delphes data file ***\n");
-   gTreeReader = new ExRootTreeReader(chain_);
+   treeReader_ = new ExRootTreeReader(chain_);
 
    // prepare data collections
-   readConfig(configFile, det3D, gElements, gArrays);
-   for(std::vector<DelphesBranchBase*>::iterator element = gElements.begin(); element<gElements.end(); ++element) {
+   readConfig(configFile, det3D, elements_, arrays_);
+   for(std::vector<DelphesBranchBase*>::iterator element = elements_.begin(); element<elements_.end(); ++element) {
      DelphesBranchElement<TEveTrackList>*   item_v1 = dynamic_cast<DelphesBranchElement<TEveTrackList>*>(*element);
      DelphesBranchElement<TEveElementList>* item_v2 = dynamic_cast<DelphesBranchElement<TEveElementList>*>(*element);
@@ -115,10 +115,10 @@
 
    // viewers and scenes
-   gDelphesDisplay = new DelphesDisplay;
+   delphesDisplay_ = new DelphesDisplay;
    gEve->AddGlobalElement(geometry);
-   gDelphesDisplay->ImportGeomRPhi(geometry);
-   gDelphesDisplay->ImportGeomRhoZ(geometry);
+   delphesDisplay_->ImportGeomRPhi(geometry);
+   delphesDisplay_->ImportGeomRhoZ(geometry);
    // find the first calo data and use that to initialize the calo display
-   for(std::vector<DelphesBranchBase*>::iterator data=gElements.begin();data<gElements.end();++data) {
+   for(std::vector<DelphesBranchBase*>::iterator data=elements_.begin();data<elements_.end();++data) {
      if(TString((*data)->GetType())=="tower") { // we could also use GetClassName()=="DelphesCaloData"
        DelphesCaloData* container = dynamic_cast<DelphesBranchElement<DelphesCaloData>*>((*data))->GetContainer();
@@ -128,6 +128,6 @@
        calo3d->SetEndCapPos(tkHalfLength_);
        gEve->AddGlobalElement(calo3d);
-       gDelphesDisplay->ImportCaloRPhi(calo3d);
-       gDelphesDisplay->ImportCaloRhoZ(calo3d);
+       delphesDisplay_->ImportCaloRPhi(calo3d);
+       delphesDisplay_->ImportCaloRhoZ(calo3d);
        TEveCaloLego *lego = new TEveCaloLego(container);
        lego->InitMainTrans();
@@ -135,11 +135,11 @@
        lego->SetAutoRebin(kFALSE);
        lego->Set2DMode(TEveCaloLego::kValSizeOutline);
-       gDelphesDisplay->ImportCaloLego(lego);
+       delphesDisplay_->ImportCaloLego(lego);
        break;
      }
    }
 
-   //make_gui(); //TODO put back!
-   //load_event(); //TODO put back!
+   make_gui();
+   load_event();
    gEve->Redraw3D(kTRUE);   
 
@@ -217,5 +217,5 @@
      }
 //TODO one possible simplification could be to add the array to the element class.
-     arrays.push_back(gTreeReader->UseBranch(name));
+     arrays.push_back(treeReader_->UseBranch(name));
    }
    // second loop for tracks
@@ -232,5 +232,5 @@
        trkProp->SetMaxR(tk_radius);
        trkProp->SetMaxZ(tk_length);
-       arrays.push_back(gTreeReader->UseBranch(name));
+       arrays.push_back(treeReader_->UseBranch(name));
      }
    }
@@ -241,14 +241,14 @@
 void DelphesEventDisplay::load_event()
 {
-   // Load event specified in global event_id.
+   // Load event specified in global event_id_.
    // The contents of previous event are removed.
 
    //TODO move this to the status bar ???
-   printf("Loading event %d.\n", event_id);
+   printf("Loading event %d.\n", event_id_);
 
 
    // clear the previous event
    gEve->GetViewers()->DeleteAnnotations();
-   for(std::vector<DelphesBranchBase*>::iterator data=gElements.begin();data<gElements.end();++data) {
+   for(std::vector<DelphesBranchBase*>::iterator data=elements_.begin();data<elements_.end();++data) {
      (*data)->Reset();
    }
@@ -259,8 +259,8 @@
    // update display
    TEveElement* top = (TEveElement*)gEve->GetCurrentEvent();
-   gDelphesDisplay->DestroyEventRPhi();
-   gDelphesDisplay->ImportEventRPhi(top);
-   gDelphesDisplay->DestroyEventRhoZ();
-   gDelphesDisplay->ImportEventRhoZ(top);
+   delphesDisplay_->DestroyEventRPhi();
+   delphesDisplay_->ImportEventRPhi(top);
+   delphesDisplay_->DestroyEventRhoZ();
+   delphesDisplay_->ImportEventRhoZ(top);
    //update_html_summary();
    gEve->Redraw3D(kFALSE, kTRUE);
@@ -271,16 +271,16 @@
 
   // safety
-  if(event_id >= gTreeReader->GetEntries() || event_id<0 ) return;
+  if(event_id_ >= treeReader_->GetEntries() || event_id_<0 ) return;
 
   // Load selected branches with data from specified event
-  gTreeReader->ReadEntry(event_id);
+  treeReader_->ReadEntry(event_id_);
 
   // loop over selected branches, and apply the proper recipe to fill the collections.
-  // this is basically to loop on gArrays to fill gElements.
+  // this is basically to loop on arrays_ to fill elements_.
 
 //TODO: one option would be to have templated methods in the element classes. We could simply call "element.fill()"
-  std::vector<TClonesArray*>::iterator data = gArrays.begin();
-  std::vector<DelphesBranchBase*>::iterator element = gElements.begin();
-  for(; data<gArrays.end() && element<gElements.end(); ++data, ++element) {
+  std::vector<TClonesArray*>::iterator data = arrays_.begin();
+  std::vector<DelphesBranchBase*>::iterator element = elements_.begin();
+  for(; data<arrays_.end() && element<elements_.end(); ++data, ++element) {
     TString type = (*element)->GetType();
     // branch on the element type
@@ -474,13 +474,12 @@
         icondir = Form("%s/icons/", (const char*)gSystem->GetFromPipe("root-config --etcdir") );
       TGPictureButton* b = 0;
-      EvNavHandler    *fh = new EvNavHandler(this);
 
       b = new TGPictureButton(hf, gClient->GetPicture(icondir+"GoBack.gif"));
       hf->AddFrame(b);
-      b->Connect("Clicked()", "EvNavHandler", fh, "Bck()");
+      b->Connect("Clicked()", "DelphesEventDisplay", this, "Bck()");
 
       b = new TGPictureButton(hf, gClient->GetPicture(icondir+"GoForward.gif"));
       hf->AddFrame(b);
-      b->Connect("Clicked()", "EvNavHandler", fh, "Fwd()");
+      b->Connect("Clicked()", "DelphesEventDisplay", this, "Fwd()");
    }
    frmMain->AddFrame(hf);
Index: display/DelphesEventDisplay.h
===================================================================
--- display/DelphesEventDisplay.h	(revision a3b249554af9dc531fdeb38d1b48d0e8fb00c262)
+++ display/DelphesEventDisplay.h	(revision fafc4338a61369fbe7d7b57cb98ebe9514a799bd)
@@ -21,4 +21,5 @@
 
 #include <vector>
+#include <iostream>
 #include "external/ExRootAnalysis/ExRootTreeReader.h"
 #include "display/DelphesDisplay.h"
@@ -40,10 +41,8 @@
     DelphesEventDisplay(const char *configFile, const char *inputFile, Delphes3DGeometry& det3D);
     ~DelphesEventDisplay();
-    Int_t event_id;
-    ExRootTreeReader *gTreeReader;
-    void load_event();
 
   private:
     void make_gui();
+    void load_event();
     void delphes_read();
     void delphes_read_towers(TClonesArray* data, DelphesBranchBase* element);
@@ -54,39 +53,31 @@
 
     // Configuration and global variables.
+    Int_t event_id_;
+    ExRootTreeReader *treeReader_;
     Double_t tkRadius_, totRadius_, tkHalfLength_, bz_;
     TChain* chain_;
-    std::vector<DelphesBranchBase*> gElements;
-    std::vector<TClonesArray*> gArrays;
-    DelphesDisplay *gDelphesDisplay;
+    std::vector<DelphesBranchBase*> elements_;
+    std::vector<TClonesArray*> arrays_;
+    DelphesDisplay *delphesDisplay_;
 
-    // EvNavHandler class is needed to connect GUI signals.
-    class EvNavHandler
-    {     
-      public:
-      
-         EvNavHandler(DelphesEventDisplay* display):display_(display) {}
+    // gui controls
+  public:
+     void Fwd() {  
+        if (event_id_ < treeReader_->GetEntries() - 1) {
+           ++event_id_;
+           load_event();
+        } else {
+           printf("Already at last event.\n");
+        }
+     }
 
-         ~EvNavHandler() {}
-
-         void Fwd() {  
-            if (display_->event_id < display_->gTreeReader->GetEntries() - 1) {
-               ++(display_->event_id);
-               display_->load_event();
-            } else {
-               printf("Already at last event.\n");
-            }
-         }
-
-         void Bck() {
-            if (display_->event_id > 0) {
-               --(display_->event_id);
-               display_->load_event();
-            } else {
-               printf("Already at first event.\n");
-            }
-         }
-       private:
-         DelphesEventDisplay* display_;
-    };
+     void Bck() {
+        if (event_id_ > 0) {
+           --event_id_;
+           load_event();
+        } else {
+           printf("Already at first event.\n");
+        }
+     }
 };
 
Index: examples/evdisplay.C
===================================================================
--- examples/evdisplay.C	(revision a3b249554af9dc531fdeb38d1b48d0e8fb00c262)
+++ examples/evdisplay.C	(revision fafc4338a61369fbe7d7b57cb98ebe9514a799bd)
@@ -8,5 +8,4 @@
    // load the libraries
    gSystem->Load("libGeom");
-   //gSystem->Load("../libDelphes");
    gSystem->Load("../libDelphesDisplay");
 
@@ -16,10 +15,7 @@
 
    // create the application items
-   DelphesEventDisplay display("delphes_card_CMS.tcl", "../delphes_output.root", det3D); //TODO root file as input cfg
+   DelphesEventDisplay* display = new DelphesEventDisplay("delphes_card_CMS.tcl", "../delphes_output.root", det3D);
+
 /*
-   make_gui();
-   load_event();
-   gEve->Redraw3D(kTRUE); // Reset camera after the first event has been shown.
-
    // EClipType not exported to CINT (see TGLUtil.h):
    // 0 - no clip, 1 - clip plane, 2 - clip box
