Index: display/DelphesBranchElement.cc
===================================================================
--- display/DelphesBranchElement.cc	(revision 369744d37d578b342b11752681364104ce8e303d)
+++ display/DelphesBranchElement.cc	(revision 4fd37d472d721c03f7ff5fd19c9afbb954188152)
@@ -18,37 +18,184 @@
 
 #include "display/DelphesBranchElement.h"
+#include "classes/DelphesClasses.h"
+#include "TEveJetCone.h"
+#include "TEveTrack.h"
+#include "TEveTrackPropagator.h"
+#include "TEveArrow.h"
+#include "TEveVector.h"
+#include <iostream>
 
 // special case for calo towers
-template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, const char*type, const enum EColor color):DelphesBranchBase(name, type, color) {
-      if(TString(type)=="tower") {
-        data_ = new DelphesCaloData(2);
-        data_->RefSliceInfo(0).Setup("ECAL", 0.1, kRed);
-        data_->RefSliceInfo(1).Setup("HCAL", 0.1, kBlue);
-        data_->IncDenyDestroy();
-      } else {
-        throw std::exception();
-      }
-    }
+template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color):DelphesBranchBase(name, branch, color) {
+    data_ = new DelphesCaloData(2);
+    data_->RefSliceInfo(0).Setup("ECAL", 0.1, kRed);
+    data_->RefSliceInfo(1).Setup("HCAL", 0.1, kBlue);
+    data_->IncDenyDestroy();
+}
 template<> void DelphesBranchElement<DelphesCaloData>::Reset() { data_->ClearTowers(); }
+template<> void DelphesBranchElement<DelphesCaloData>::ReadBranch() {
+  if(TString(GetType())=="Tower") {
+    // Loop over all towers
+    TIter itTower(branch_);
+    Tower *tower;
+    while((tower = (Tower *) itTower.Next())) {
+      data_->AddTower(tower->Edges[0], tower->Edges[1], tower->Edges[2], tower->Edges[3]);
+      data_->FillSlice(0, tower->Eem);
+      data_->FillSlice(1, tower->Ehad);
+    }
+    data_->DataChanged();
+  }
+}
 
 // special case for element lists
-template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, const char*type, const enum EColor color):DelphesBranchBase(name, type, color) {
-      if(TString(type)=="vector" || TString(type)=="jet") {
-        data_ = new TEveElementList(name);
-        data_->SetMainColor(color_);
-      } else {
-        throw std::exception();
-      }
-    }
+template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color):DelphesBranchBase(name, branch, color) {
+    data_ = new TEveElementList(name);
+    data_->SetMainColor(color_);
+}
 template<> void DelphesBranchElement<TEveElementList>::Reset() { data_->DestroyElements(); }
+template<> void DelphesBranchElement<TEveElementList>::ReadBranch() {
+  if(TString(GetType())=="Jet") {
+    TIter itJet(branch_);
+    Jet *jet;
+    TEveJetCone *eveJetCone;
+    // Loop over all jets
+    Int_t counter = 0;
+    while((jet = (Jet *) itJet.Next())) {
+      eveJetCone = new TEveJetCone();
+      eveJetCone->SetTitle(Form("jet [%d]: Pt=%f, Eta=%f, \nPhi=%f, M=%f",counter,jet->PT, jet->Eta, jet->Phi, jet->Mass));
+      eveJetCone->SetName(Form("jet [%d]", counter++));
+      eveJetCone->SetMainTransparency(60);
+      eveJetCone->SetLineColor(GetColor());
+      eveJetCone->SetFillColor(GetColor());
+      eveJetCone->SetCylinder(tkRadius_ - 10, tkHalfLength_ - 10);
+      eveJetCone->SetPickable(kTRUE);
+      eveJetCone->AddEllipticCone(jet->Eta, jet->Phi, jet->DeltaEta, jet->DeltaPhi);
+      data_->AddElement(eveJetCone);
+    }
+  } else if(TString(GetType())=="MissingET") {
+    TIter itMet(branch_);
+    MissingET *MET;
+    TEveArrow *eveMet;
+    // Missing Et
+    Double_t maxPt = 50.;
+    // TODO to be changed as we don't have access to maxPt anymore. MET scale could be a general parameter set in GUI
+    while((MET = (MissingET*) itMet.Next())) {
+      eveMet = new TEveArrow((tkRadius_ * MET->MET/maxPt)*cos(MET->Phi), (tkRadius_ * MET->MET/maxPt)*sin(MET->Phi), 0., 0., 0., 0.);
+      eveMet->SetMainColor(GetColor());
+      eveMet->SetTubeR(0.04);
+      eveMet->SetConeR(0.08);
+      eveMet->SetConeL(0.10);
+      eveMet->SetPickable(kTRUE);
+      eveMet->SetName("Missing Et");
+      eveMet->SetTitle(Form("Missing Et (%.1f GeV)",MET->MET));
+      data_->AddElement(eveMet);
+    }
+  }
+}
 
 // special case for track lists
-template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, const char*type, const enum EColor color):DelphesBranchBase(name, type, color) {
-        data_ = new TEveTrackList(name);
-        data_->SetMainColor(color_);
-        data_->SetMarkerColor(color_);
-        data_->SetMarkerStyle(kCircle);
-        data_->SetMarkerSize(0.5);
-    }
+template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color):DelphesBranchBase(name, branch, color) {
+  data_ = new TEveTrackList(name);
+  data_->SetMainColor(color_);
+  data_->SetMarkerColor(color_);
+  data_->SetMarkerStyle(kCircle);
+  data_->SetMarkerSize(0.5);
+}
+template<> void DelphesBranchElement<TEveTrackList>::SetTrackingVolume(Float_t r, Float_t l, Float_t Bz) {
+  tkRadius_ = r; 
+  tkHalfLength_ = l;
+  tk_Bz_ = Bz;
+  TEveTrackPropagator *trkProp = data_->GetPropagator();
+  trkProp->SetMagField(0., 0., -tk_Bz_);
+  trkProp->SetMaxR(tkRadius_);
+  trkProp->SetMaxZ(tkHalfLength_);
+}
 template<> void DelphesBranchElement<TEveTrackList>::Reset() { data_->DestroyElements(); }
-
+template<> void DelphesBranchElement<TEveTrackList>::ReadBranch() {
+  TString type = GetType();
+  TIter itTrack(branch_);
+  Int_t counter = 0;
+  TEveTrack *eveTrack;
+  TEveTrackPropagator *trkProp = data_->GetPropagator();
+  trkProp->SetMagField(0., 0., -tk_Bz_);
+  trkProp->SetMaxR(tkRadius_);
+  trkProp->SetMaxZ(tkHalfLength_);
+  if(type=="Track") { // CASE 1: TRACKS
+    Track *track;
+    while((track = (Track *) itTrack.Next())) {
+      TParticle pb(track->PID, 1, 0, 0, 0, 0,
+                   track->P4().Px(), track->P4().Py(),
+                   track->P4().Pz(), track->P4().E(),
+                   track->X, track->Y, track->Z, 0.0);
+      eveTrack = new TEveTrack(&pb, counter, trkProp);
+      eveTrack->SetName(Form("%s [%d]", pb.GetName(), counter++));
+      eveTrack->SetStdTitle();
+      eveTrack->SetAttLineAttMarker(data_);
+      data_->AddElement(eveTrack);
+      eveTrack->SetLineColor(GetColor());
+      eveTrack->MakeTrack();
+    }
+  } else if(type=="Electron") { // CASE 2: ELECTRONS
+    Electron *electron;
+    while((electron = (Electron *) itTrack.Next())) {
+      TParticle pb(electron->Charge<0?11:-11, 1, 0, 0, 0, 0,
+                   electron->P4().Px(), electron->P4().Py(),
+                   electron->P4().Pz(), electron->P4().E(),
+                   0., 0., 0., 0.);
+      eveTrack = new TEveTrack(&pb, counter, trkProp);
+      eveTrack->SetName(Form("%s [%d]", pb.GetName(), counter++));
+      eveTrack->SetStdTitle();
+      eveTrack->SetAttLineAttMarker(data_);
+      data_->AddElement(eveTrack);
+      eveTrack->SetLineColor(GetColor());
+      eveTrack->MakeTrack();
+    }
+  } else if(type=="Muon") { // CASE 3: MUONS
+    Muon *muon;
+    while((muon = (Muon *) itTrack.Next())) {
+      TParticle pb(muon->Charge<0?13:-13, 1, 0, 0, 0, 0,
+                   muon->P4().Px(), muon->P4().Py(),
+                   muon->P4().Pz(), muon->P4().E(),
+                   0., 0., 0., 0.);
+      eveTrack = new TEveTrack(&pb, counter, trkProp);
+      eveTrack->SetName(Form("%s [%d]", pb.GetName(), counter++));
+      eveTrack->SetStdTitle();
+      eveTrack->SetAttLineAttMarker(data_);
+      data_->AddElement(eveTrack);
+      eveTrack->SetLineColor(GetColor());
+      eveTrack->MakeTrack();
+    }
+  } else if(type=="Photon") { // CASE 4: PHOTONS
+    Photon *photon;
+    while((photon = (Photon *) itTrack.Next())) {
+      TParticle pb(22, 1, 0, 0, 0, 0,
+                   photon->P4().Px(), photon->P4().Py(),
+                   photon->P4().Pz(), photon->P4().E(),
+                   0., 0., 0., 0.);
+      eveTrack = new TEveTrack(&pb, counter, trkProp);
+      eveTrack->SetName(Form("%s [%d]", pb.GetName(), counter++));
+      eveTrack->SetStdTitle();
+      eveTrack->SetAttLineAttMarker(data_);
+      eveTrack->SetLineStyle(7);
+      data_->AddElement(eveTrack);
+      eveTrack->SetLineColor(GetColor());
+      eveTrack->MakeTrack();
+    }
+  } else if(type=="GenParticle") { // CASE 5: GENPARTICLES
+    GenParticle *particle;
+    while((particle = (GenParticle *) itTrack.Next())) {
+      TParticle pb(particle->PID, particle->Status, particle->M1, particle->M2, particle->D1, particle->D2,
+                   particle->P4().Px(), particle->P4().Py(),
+                   particle->P4().Pz(), particle->P4().E(),
+                   particle->X, particle->Y, particle->Z, particle->T);
+      eveTrack = new TEveTrack(&pb, counter, trkProp);
+      eveTrack->SetName(Form("%s [%d]", pb.GetName(), counter++));
+      eveTrack->SetStdTitle();
+      eveTrack->SetAttLineAttMarker(data_);
+      data_->AddElement(eveTrack);
+      eveTrack->SetLineColor(GetColor());
+      if(particle->Charge==0) eveTrack->SetLineStyle(7);
+      eveTrack->MakeTrack();
+    }
+  }
+}
Index: display/DelphesBranchElement.h
===================================================================
--- display/DelphesBranchElement.h	(revision 369744d37d578b342b11752681364104ce8e303d)
+++ display/DelphesBranchElement.h	(revision 4fd37d472d721c03f7ff5fd19c9afbb954188152)
@@ -22,5 +22,8 @@
 #include "TColor.h"
 #include "TString.h"
+#include "TClonesArray.h"
+#include "TClass.h"
 #include <exception>
+#include <iostream>
 #include "display/DelphesCaloData.h"
 #include "TEveElement.h"
@@ -31,16 +34,19 @@
 {
   public:
-    DelphesBranchBase(const char* name="", const char*type="", const enum EColor color=kBlack):name_(name),type_(type),color_(color) {}
-    virtual ~DelphesBranchBase() {};
+    DelphesBranchBase(const char* name="", TClonesArray* branch=NULL, const enum EColor color=kBlack):name_(name),branch_(branch),color_(color) {}
+    virtual ~DelphesBranchBase() {}
     const char* GetName() const { return (const char*)name_; }
-    const char* GetType() const { return (const char*)type_; }
+    const char* GetType() const { return branch_ ? branch_->GetClass()->GetName() : "None"; }
+    virtual const char* GetClassName() = 0;
     enum EColor GetColor() const { return color_; }
-    virtual const char* GetClassName() = 0;
     virtual void Reset() = 0;
+    virtual void SetTrackingVolume(Float_t r, Float_t l, Float_t Bz=0.) { tkRadius_ = r; tkHalfLength_ = l; tk_Bz_ = Bz; }
+    virtual void ReadBranch() = 0;
 
   protected:
     TString name_;
-    TString type_; // needed for parsing the branch later on
+    TClonesArray* branch_;
     const enum EColor color_;
+    Float_t tkRadius_,tkHalfLength_, tk_Bz_;
 };
 
@@ -50,5 +56,5 @@
   public:
     // constructor
-    DelphesBranchElement(const char* name="", const char*type="", const enum EColor color=kBlack):DelphesBranchBase(name, type, color) {
+    DelphesBranchElement(const char* name="", TClonesArray* branch=NULL, const enum EColor color=kBlack):DelphesBranchBase(name, branch, color) {
       throw std::exception();
     }
@@ -60,4 +66,7 @@
     EveContainer* GetContainer() { return data_; }
 
+    // tracking volume
+    virtual void SetTrackingVolume(Float_t r, Float_t l, Float_t Bz=0.) { tkRadius_ = r; tkHalfLength_ = l; tk_Bz_ = Bz; }
+
     // resets the collection (before moving to the next event)
     virtual void Reset() {};
@@ -65,4 +74,7 @@
     // template class name
     virtual const char* GetClassName() { return data_->ClassName(); }
+
+    // read the branch and fill elements for display
+    virtual void ReadBranch() {}
 
   private:
@@ -73,14 +85,18 @@
 
 // special case for calo towers
-template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, const char*type, const enum EColor color);
+template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color);
 template<> void DelphesBranchElement<DelphesCaloData>::Reset();
+template<> void DelphesBranchElement<DelphesCaloData>::ReadBranch();
 
 // special case for element lists
-template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, const char*type, const enum EColor color);
+template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color);
 template<> void DelphesBranchElement<TEveElementList>::Reset();
+template<> void DelphesBranchElement<TEveElementList>::ReadBranch();
 
 // special case for track lists
-template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, const char*type, const enum EColor color);
+template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color);
+template<> void DelphesBranchElement<TEveTrackList>::SetTrackingVolume(Float_t r, Float_t l, Float_t Bz);
 template<> void DelphesBranchElement<TEveTrackList>::Reset();
+template<> void DelphesBranchElement<TEveTrackList>::ReadBranch();
 
 #endif // CINT, CLING
Index: display/DelphesEventDisplay.cc
===================================================================
--- display/DelphesEventDisplay.cc	(revision 369744d37d578b342b11752681364104ce8e303d)
+++ display/DelphesEventDisplay.cc	(revision 4fd37d472d721c03f7ff5fd19c9afbb954188152)
@@ -53,8 +53,11 @@
    totRadius_ = 2.0;
    tkHalfLength_ = 3.0;
+   muHalfLength_ = 6.0;
    bz_ = 3.8;
    chain_ = new TChain("Delphes");
    treeReader_ = 0;
    delphesDisplay_ = 0;
+   etaAxis_ = 0;
+   phiAxis_ = 0;
 }
 
@@ -83,5 +86,8 @@
    totRadius_ = det3D.getDetectorRadius();
    tkHalfLength_ = det3D.getTrackerHalfLength();
+   muHalfLength_ = det3D.getDetectorHalfLength();
    bz_ = det3D.getBField();
+   etaAxis_ = det3D.getCaloAxes().first;
+   phiAxis_ = det3D.getCaloAxes().second;
    TGeoVolume* top = det3D.getDetector(false);
    geom->SetTopVolume(top);
@@ -105,5 +111,5 @@
 
    // prepare data collections
-   readConfig(configFile, det3D, elements_, arrays_);
+   readConfig(configFile, elements_);
    for(std::vector<DelphesBranchBase*>::iterator element = elements_.begin(); element<elements_.end(); ++element) {
      DelphesBranchElement<TEveTrackList>*   item_v1 = dynamic_cast<DelphesBranchElement<TEveTrackList>*>(*element);
@@ -120,5 +126,5 @@
    // find the first calo data and use that to initialize the calo display
    for(std::vector<DelphesBranchBase*>::iterator data=elements_.begin();data<elements_.end();++data) {
-     if(TString((*data)->GetType())=="tower") { // we could also use GetClassName()=="DelphesCaloData"
+     if(TString((*data)->GetType())=="Tower") { // we could also use GetClassName()=="DelphesCaloData"
        DelphesCaloData* container = dynamic_cast<DelphesBranchElement<DelphesCaloData>*>((*data))->GetContainer();
        assert(container);
@@ -146,14 +152,7 @@
 
 // function that parses the config to extract the branches of interest and prepare containers
-void DelphesEventDisplay::readConfig(const char *configFile, Delphes3DGeometry& det3D, std::vector<DelphesBranchBase*>& elements, std::vector<TClonesArray*>& arrays) {
+void DelphesEventDisplay::readConfig(const char *configFile, std::vector<DelphesBranchBase*>& elements) {
    ExRootConfReader *confReader = new ExRootConfReader;
    confReader->ReadFile(configFile);
-   Double_t tk_radius = det3D.getTrackerRadius();
-   Double_t tk_length = det3D.getTrackerHalfLength();
-   Double_t tk_Bz     = det3D.getBField();
-   Double_t mu_radius = det3D.getDetectorRadius();
-   Double_t mu_length = det3D.getDetectorHalfLength();
-   TAxis*   etaAxis   = det3D.getCaloAxes().first;
-   TAxis*   phiAxis   = det3D.getCaloAxes().second;
    ExRootConfParam branches = confReader->GetParam("TreeWriter::Branch");
    Int_t nBranches = branches.GetSize()/3;
@@ -168,53 +167,45 @@
      if(className=="Tower") {
        if(input.Contains("eflow",TString::kIgnoreCase) || name.Contains("eflow",TString::kIgnoreCase)) continue; //no eflow
-       clist = new DelphesBranchElement<DelphesCaloData>(name,"tower",kBlack);
-       clist->GetContainer()->SetEtaBins(etaAxis);
-       clist->GetContainer()->SetPhiBins(phiAxis);
+       clist = new DelphesBranchElement<DelphesCaloData>(name,treeReader_->UseBranch(name),kBlack);
+       clist->GetContainer()->SetEtaBins(etaAxis_);
+       clist->GetContainer()->SetPhiBins(phiAxis_);
        elements.push_back(clist);
      } else if(className=="Jet") {
        if(input.Contains("GenJetFinder")) {
-         elist = new DelphesBranchElement<TEveElementList>(name,"jet",kCyan);
+         elist = new DelphesBranchElement<TEveElementList>(name,treeReader_->UseBranch(name),kCyan);
          elist->GetContainer()->SetRnrSelf(false);
          elist->GetContainer()->SetRnrChildren(false);
+         elist->SetTrackingVolume(tkRadius_, tkHalfLength_, bz_);
          elements.push_back(elist);
        } else {
-         elements.push_back(new DelphesBranchElement<TEveElementList>(name,"jet",kYellow));
+         elist = new DelphesBranchElement<TEveElementList>(name,treeReader_->UseBranch(name),kYellow);
+         elist->SetTrackingVolume(tkRadius_, tkHalfLength_, bz_);
+         elements.push_back(elist);
        }
      } else if(className=="Electron") {
-       tlist = new DelphesBranchElement<TEveTrackList>(name,"electron",kRed);
-       elements.push_back(tlist);
-       TEveTrackPropagator *trkProp = tlist->GetContainer()->GetPropagator();
-       trkProp->SetMagField(0., 0., -tk_Bz);
-       trkProp->SetMaxR(tk_radius);
-       trkProp->SetMaxZ(tk_length);
+       tlist = new DelphesBranchElement<TEveTrackList>(name,treeReader_->UseBranch(name),kRed);
+       tlist->SetTrackingVolume(tkRadius_, tkHalfLength_, bz_);
+       elements.push_back(tlist);
      } else if(className=="Photon") {
-       tlist = new DelphesBranchElement<TEveTrackList>(name,"photon",kYellow);
-       elements.push_back(tlist);
-       TEveTrackPropagator *trkProp = tlist->GetContainer()->GetPropagator();
-       trkProp->SetMagField(0., 0., 0.);
-       trkProp->SetMaxR(tk_radius);
-       trkProp->SetMaxZ(tk_length);
+       tlist = new DelphesBranchElement<TEveTrackList>(name,treeReader_->UseBranch(name),kYellow);
+       tlist->SetTrackingVolume(tkRadius_, tkHalfLength_, bz_);
+       elements.push_back(tlist);
      } else if(className=="Muon") {
-       tlist = new DelphesBranchElement<TEveTrackList>(name,"muon",kGreen);
-       elements.push_back(tlist);
-       TEveTrackPropagator *trkProp = tlist->GetContainer()->GetPropagator();
-       trkProp->SetMagField(0., 0., -tk_Bz);
-       trkProp->SetMaxR(mu_radius);
-       trkProp->SetMaxZ(mu_length);
+       tlist = new DelphesBranchElement<TEveTrackList>(name,treeReader_->UseBranch(name),kGreen);
+       tlist->SetTrackingVolume(totRadius_, muHalfLength_, bz_);
+       elements.push_back(tlist);
      } else if(className=="MissingET") {
-       elements.push_back(new DelphesBranchElement<TEveElementList>(name,"vector",kViolet));
+       elist = new DelphesBranchElement<TEveElementList>(name,treeReader_->UseBranch(name),kViolet);
+       elist->SetTrackingVolume(tkRadius_, tkHalfLength_, bz_);
+       elements.push_back(elist);
      } else if(className=="GenParticle") {
-       tlist = new DelphesBranchElement<TEveTrackList>(name,"genparticle",kCyan);
-       elements.push_back(tlist);
+       tlist = new DelphesBranchElement<TEveTrackList>(name,treeReader_->UseBranch(name),kCyan);
+       tlist->SetTrackingVolume(tkRadius_, tkHalfLength_, bz_);
        tlist->GetContainer()->SetRnrSelf(false);
        tlist->GetContainer()->SetRnrChildren(false);
-       TEveTrackPropagator *trkProp = tlist->GetContainer()->GetPropagator();
-       trkProp->SetMagField(0., 0., -tk_Bz);
-       trkProp->SetMaxR(tk_radius);
-       trkProp->SetMaxZ(tk_length);
+       elements.push_back(tlist);
      } else {
        continue;
      }
-     arrays.push_back(treeReader_->UseBranch(name));
    }
    // second loop for tracks
@@ -225,11 +216,7 @@
      if(className=="Track") {
        if(input.Contains("eflow",TString::kIgnoreCase) || name.Contains("eflow",TString::kIgnoreCase)) continue; //no eflow
-       tlist = new DelphesBranchElement<TEveTrackList>(name,"track",kBlue);
-       elements.push_back(tlist);
-       TEveTrackPropagator *trkProp = tlist->GetContainer()->GetPropagator();
-       trkProp->SetMagField(0., 0., -tk_Bz);
-       trkProp->SetMaxR(tk_radius);
-       trkProp->SetMaxZ(tk_length);
-       arrays.push_back(treeReader_->UseBranch(name));
+       tlist = new DelphesBranchElement<TEveTrackList>(name,treeReader_->UseBranch(name),kBlue);
+       tlist->SetTrackingVolume(tkRadius_, tkHalfLength_, bz_);
+       elements.push_back(tlist);
      }
    }
@@ -255,16 +242,6 @@
    // Load selected branches with data from specified event
    treeReader_->ReadEntry(event_id_);
-
-   // loop over selected branches, and apply the proper recipe to fill the collections.
-   // this is basically to loop on arrays_ to fill elements_.
-   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
-     if(type=="tower") delphes_read_towers(*data,*element);
-     else if(type=="track" || type=="photon" || type=="electron" || type=="muon" || type=="genparticle") delphes_read_tracks(*data,*element);
-     else if(type=="jet") delphes_read_jets(*data,*element);
-     else if(type=="vector") delphes_read_vectors(*data,*element);
+   for(std::vector<DelphesBranchBase*>::iterator data=elements_.begin();data<elements_.end();++data) {
+     (*data)->ReadBranch();
    }
 
@@ -278,159 +255,4 @@
 
    gEve->Redraw3D(kFALSE, kTRUE);
-}
-
-void DelphesEventDisplay::delphes_read_towers(TClonesArray* data, DelphesBranchBase* element) {
-  DelphesCaloData* container = dynamic_cast<DelphesBranchElement<DelphesCaloData>*>(element)->GetContainer();
-  assert(container);
-  // Loop over all towers
-  TIter itTower(data);
-  Tower *tower;
-  while((tower = (Tower *) itTower.Next()))
-  {
-    container->AddTower(tower->Edges[0], tower->Edges[1], tower->Edges[2], tower->Edges[3]);
-    container->FillSlice(0, tower->Eem);
-    container->FillSlice(1, tower->Ehad);
-  }
-  container->DataChanged();
-}
-
-void DelphesEventDisplay::delphes_read_tracks(TClonesArray* data, DelphesBranchBase* element) {
-  TEveTrackList* container = dynamic_cast<DelphesBranchElement<TEveTrackList>*>(element)->GetContainer();
-  assert(container);
-  TString type = element->GetType();
-  TIter itTrack(data);
-  Int_t counter = 0;
-  TEveTrack *eveTrack;
-  TEveTrackPropagator *trkProp = container->GetPropagator();
-  if(type=="track") {
-    // Loop over all tracks
-    Track *track;
-    while((track = (Track *) itTrack.Next())) {
-      TParticle pb(track->PID, 1, 0, 0, 0, 0,
-                   track->P4().Px(), track->P4().Py(),
-                   track->P4().Pz(), track->P4().E(),
-                   track->X, track->Y, track->Z, 0.0);
-      eveTrack = new TEveTrack(&pb, counter, trkProp);
-      eveTrack->SetName(Form("%s [%d]", pb.GetName(), counter++));
-      eveTrack->SetStdTitle();
-      eveTrack->SetAttLineAttMarker(container);
-      container->AddElement(eveTrack);
-      eveTrack->SetLineColor(element->GetColor());
-      eveTrack->MakeTrack();
-    }
-  } else if(type=="electron") {
-    // Loop over all electrons
-    Electron *electron;
-    while((electron = (Electron *) itTrack.Next())) {
-      TParticle pb(electron->Charge<0?11:-11, 1, 0, 0, 0, 0,
-                   electron->P4().Px(), electron->P4().Py(),
-                   electron->P4().Pz(), electron->P4().E(),
-                   0., 0., 0., 0.);
-
-      eveTrack = new TEveTrack(&pb, counter, trkProp);
-      eveTrack->SetName(Form("%s [%d]", pb.GetName(), counter++));
-      eveTrack->SetStdTitle();
-      eveTrack->SetAttLineAttMarker(container);
-      container->AddElement(eveTrack);
-      eveTrack->SetLineColor(element->GetColor());
-      eveTrack->MakeTrack();
-    }
-  } else if(type=="muon") {
-    // Loop over all muons
-    Muon *muon;
-    while((muon = (Muon *) itTrack.Next())) {
-      TParticle pb(muon->Charge<0?13:-13, 1, 0, 0, 0, 0,
-                   muon->P4().Px(), muon->P4().Py(),
-                   muon->P4().Pz(), muon->P4().E(),
-                   0., 0., 0., 0.);
-
-      eveTrack = new TEveTrack(&pb, counter, trkProp);
-      eveTrack->SetName(Form("%s [%d]", pb.GetName(), counter++));
-      eveTrack->SetStdTitle();
-      eveTrack->SetAttLineAttMarker(container);
-      container->AddElement(eveTrack);
-      eveTrack->SetLineColor(element->GetColor());
-      eveTrack->MakeTrack();
-    }
-  } else if(type=="photon") {
-    // Loop over all photons
-    Photon *photon;
-    while((photon = (Photon *) itTrack.Next())) {
-      TParticle pb(22, 1, 0, 0, 0, 0,
-                   photon->P4().Px(), photon->P4().Py(),
-                   photon->P4().Pz(), photon->P4().E(),
-                   0., 0., 0., 0.);
-      eveTrack = new TEveTrack(&pb, counter, trkProp);
-      eveTrack->SetName(Form("%s [%d]", pb.GetName(), counter++));
-      eveTrack->SetStdTitle();
-      eveTrack->SetAttLineAttMarker(container);
-      eveTrack->SetLineStyle(7);
-      container->AddElement(eveTrack);
-      eveTrack->SetLineColor(element->GetColor());
-      eveTrack->MakeTrack();
-    }
-  } else if(type=="genparticle") {
-    // Loop over all particles
-    GenParticle *particle;
-    while((particle = (GenParticle *) itTrack.Next())) {
-      TParticle pb(particle->PID, particle->Status, particle->M1, particle->M2, particle->D1, particle->D2,
-                   particle->P4().Px(), particle->P4().Py(),
-                   particle->P4().Pz(), particle->P4().E(),
-                   particle->X, particle->Y, particle->Z, particle->T);
-      eveTrack = new TEveTrack(&pb, counter, trkProp);
-      eveTrack->SetName(Form("%s [%d]", pb.GetName(), counter++));
-      eveTrack->SetStdTitle();
-      eveTrack->SetAttLineAttMarker(container);
-      container->AddElement(eveTrack);
-      eveTrack->SetLineColor(element->GetColor());
-      if(particle->Charge==0) eveTrack->SetLineStyle(7);
-      eveTrack->MakeTrack();
-    }
-  }
-}
-
-void DelphesEventDisplay::delphes_read_jets(TClonesArray* data, DelphesBranchBase* element) {
-  TEveElementList* container = dynamic_cast<DelphesBranchElement<TEveElementList>*>(element)->GetContainer();
-  assert(container);
-  TIter itJet(data);
-  Jet *jet;
-  TEveJetCone *eveJetCone;
-  // Loop over all jets
-  Int_t counter = 0;
-  while((jet = (Jet *) itJet.Next()))
-  {
-    eveJetCone = new TEveJetCone();
-    eveJetCone->SetTitle(Form("jet [%d]: Pt=%f, Eta=%f, \nPhi=%f, M=%f",counter,jet->PT, jet->Eta, jet->Phi, jet->Mass));
-    eveJetCone->SetName(Form("jet [%d]", counter++));
-    eveJetCone->SetMainTransparency(60);
-    eveJetCone->SetLineColor(element->GetColor());
-    eveJetCone->SetFillColor(element->GetColor());
-    eveJetCone->SetCylinder(tkRadius_ - 10, tkHalfLength_ - 10);
-    eveJetCone->SetPickable(kTRUE);
-    eveJetCone->AddEllipticCone(jet->Eta, jet->Phi, jet->DeltaEta, jet->DeltaPhi);
-    container->AddElement(eveJetCone);
-  }
-}
-
-void DelphesEventDisplay::delphes_read_vectors(TClonesArray* data, DelphesBranchBase* element) {
-  TEveElementList* container = dynamic_cast<DelphesBranchElement<TEveElementList>*>(element)->GetContainer();
-  assert(container);
-  TIter itMet(data);
-  MissingET *MET;
-  TEveArrow *eveMet;
-  // Missing Et
-  Double_t maxPt = 50.;
-  // TODO to be changed as we don't have access to maxPt anymore. MET scale could be a general parameter set in GUI
-  while((MET = (MissingET*) itMet.Next())) {
-    eveMet = new TEveArrow((tkRadius_ * MET->MET/maxPt)*cos(MET->Phi), (tkRadius_ * MET->MET/maxPt)*sin(MET->Phi), 0., 0., 0., 0.);
-    eveMet->SetMainColor(element->GetColor());
-    eveMet->SetTubeR(0.04);
-    eveMet->SetConeR(0.08);
-    eveMet->SetConeL(0.10);
-    eveMet->SetPickable(kTRUE);
-    eveMet->SetName("Missing Et");
-    eveMet->SetTitle(Form("Missing Et (%.1f GeV)",MET->MET));
-    container->AddElement(eveMet);
-  }
 }
 
Index: display/DelphesEventDisplay.h
===================================================================
--- display/DelphesEventDisplay.h	(revision 369744d37d578b342b11752681364104ce8e303d)
+++ display/DelphesEventDisplay.h	(revision 4fd37d472d721c03f7ff5fd19c9afbb954188152)
@@ -26,4 +26,5 @@
 #include "display/Delphes3DGeometry.h"
 #include "TChain.h"
+#include "TAxis.h"
 #include "TClonesArray.h"
 
@@ -45,17 +46,13 @@
     void make_gui();
     void load_event();
-    void delphes_read_towers(TClonesArray* data, DelphesBranchBase* element);
-    void delphes_read_tracks(TClonesArray* data, DelphesBranchBase* element);
-    void delphes_read_jets(TClonesArray* data, DelphesBranchBase* element);
-    void delphes_read_vectors(TClonesArray* data, DelphesBranchBase* element);
-    void readConfig(const char *configFile, Delphes3DGeometry& det3D, std::vector<DelphesBranchBase*>& elements, std::vector<TClonesArray*>& arrays);
+    void readConfig(const char *configFile, std::vector<DelphesBranchBase*>& elements);
 
     // Configuration and global variables.
     Int_t event_id_;
     ExRootTreeReader *treeReader_;
-    Double_t tkRadius_, totRadius_, tkHalfLength_, bz_;
+    Double_t tkRadius_, totRadius_, tkHalfLength_, muHalfLength_, bz_;
+    TAxis *etaAxis_, *phiAxis_;
     TChain* chain_;
     std::vector<DelphesBranchBase*> elements_;
-    std::vector<TClonesArray*> arrays_;
     DelphesDisplay *delphesDisplay_;
 
