Index: display/DelphesBranchElement.cc
===================================================================
--- display/DelphesBranchElement.cc	(revision 84dd1c8651bf904870e9b254f657f1da788ce2de)
+++ display/DelphesBranchElement.cc	(revision a3b249554af9dc531fdeb38d1b48d0e8fb00c262)
@@ -43,4 +43,5 @@
 template<> void DelphesBranchElement<TEveElementList>::Reset() { data_->DestroyElements(); }
 
+//TODO: does the type really make sense?
 // special case for track lists
 template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, const char*type, const enum EColor color):DelphesBranchBase(name, type, color) {
@@ -58,5 +59,10 @@
         data_->SetMarkerSize(0.5);
       } else {
-        throw std::exception();
+        data_ = new TEveTrackList(name);
+        data_->SetMainColor(color_);
+        data_->SetMarkerColor(color_);
+        data_->SetMarkerStyle(kCircle);
+        data_->SetMarkerSize(0.5);
+        //throw std::exception();
       }
     }
Index: display/DelphesEventDisplay.cc
===================================================================
--- display/DelphesEventDisplay.cc	(revision 84dd1c8651bf904870e9b254f657f1da788ce2de)
+++ display/DelphesEventDisplay.cc	(revision a3b249554af9dc531fdeb38d1b48d0e8fb00c262)
@@ -109,9 +109,7 @@
    for(std::vector<DelphesBranchBase*>::iterator element = gElements.begin(); element<gElements.end(); ++element) {
      DelphesBranchElement<TEveTrackList>*   item_v1 = dynamic_cast<DelphesBranchElement<TEveTrackList>*>(*element);
-     DelphesBranchElement<DelphesCaloData>* item_v2 = dynamic_cast<DelphesBranchElement<DelphesCaloData>*>(*element);
-     DelphesBranchElement<TEveElementList>* item_v3 = dynamic_cast<DelphesBranchElement<TEveElementList>*>(*element);
+     DelphesBranchElement<TEveElementList>* item_v2 = dynamic_cast<DelphesBranchElement<TEveElementList>*>(*element);
      if(item_v1) gEve->AddElement(item_v1->GetContainer());
      if(item_v2) gEve->AddElement(item_v2->GetContainer());
-     if(item_v3) gEve->AddElement(item_v3->GetContainer());
    }
 
@@ -123,5 +121,5 @@
    // 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) {
-     if(TString((*data)->GetType())=="tower") {
+     if(TString((*data)->GetType())=="tower") { // we could also use GetClassName()=="DelphesCaloData"
        DelphesCaloData* container = dynamic_cast<DelphesBranchElement<DelphesCaloData>*>((*data))->GetContainer();
        assert(container);
@@ -142,6 +140,6 @@
    }
 
-   //make_gui();
-   //load_event();
+   //make_gui(); //TODO put back!
+   //load_event(); //TODO put back!
    gEve->Redraw3D(kTRUE);   
 
@@ -163,17 +161,10 @@
    DelphesBranchElement<DelphesCaloData>* clist;
    DelphesBranchElement<TEveElementList>* elist;
+   // first loop with all but tracks
    for(Int_t b = 0; b<nBranches; ++b) {
      TString input = branches[b*3].GetString();
      TString name = branches[b*3+1].GetString();
      TString className = branches[b*3+2].GetString();
-     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);
-     } else if(className=="Tower") {
+     if(className=="Tower") {
        if(input.Contains("eflow",TString::kIgnoreCase) || name.Contains("eflow",TString::kIgnoreCase)) continue; //no eflow
        clist = new DelphesBranchElement<DelphesCaloData>(name,"tower",kBlack);
@@ -191,5 +182,5 @@
        }
      } else if(className=="Electron") {
-       tlist = new DelphesBranchElement<TEveTrackList>(name,"track",kRed);
+       tlist = new DelphesBranchElement<TEveTrackList>(name,"electron",kRed);
        elements.push_back(tlist);
        TEveTrackPropagator *trkProp = tlist->GetContainer()->GetPropagator();
@@ -205,5 +196,5 @@
        trkProp->SetMaxZ(tk_length);
      } else if(className=="Muon") {
-       tlist = new DelphesBranchElement<TEveTrackList>(name,"track",kGreen);
+       tlist = new DelphesBranchElement<TEveTrackList>(name,"muon",kGreen);
        elements.push_back(tlist);
        TEveTrackPropagator *trkProp = tlist->GetContainer()->GetPropagator();
@@ -214,5 +205,5 @@
        elements.push_back(new DelphesBranchElement<TEveElementList>(name,"vector",kViolet));
      } else if(className=="GenParticle") {
-       tlist = new DelphesBranchElement<TEveTrackList>(name,"track",kCyan);
+       tlist = new DelphesBranchElement<TEveTrackList>(name,"genparticle",kCyan);
        elements.push_back(tlist);
        tlist->GetContainer()->SetRnrSelf(false);
@@ -222,7 +213,25 @@
        trkProp->SetMaxR(tk_radius);
        trkProp->SetMaxZ(tk_length);
+     } else {
+       continue;
      }
 //TODO one possible simplification could be to add the array to the element class.
      arrays.push_back(gTreeReader->UseBranch(name));
+   }
+   // second loop for tracks
+   for(Int_t b = 0; b<nBranches; ++b) {
+     TString input = branches[b*3].GetString();
+     TString name = branches[b*3+1].GetString();
+     TString className = branches[b*3+2].GetString();
+     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(gTreeReader->UseBranch(name));
+     }
    }
 }
@@ -248,8 +257,4 @@
    delphes_read();
 
-//TODO: it blocks somewhere below....
-//TODO: also the event content has one weird entry "TEveCalData" -> corruption????
-//other observation: projections appear in the 3D view ! -> seems to indicate that we have a common problem there.
-//should check the content of the elements vector when filling them
    // update display
    TEveElement* top = (TEveElement*)gEve->GetCurrentEvent();
@@ -277,24 +282,12 @@
   std::vector<TClonesArray*>::iterator data = gArrays.begin();
   std::vector<DelphesBranchBase*>::iterator element = gElements.begin();
-  std::vector<TClonesArray*>::iterator data_tracks = gArrays.begin();
-  std::vector<DelphesBranchBase*>::iterator element_tracks = gElements.begin();
-  Int_t nTracks = 0;
   for(; data<gArrays.end() && element<gElements.end(); ++data, ++element) {
     TString type = (*element)->GetType();
-    // keep the most generic track collection for the end
-    if(type=="track" && TString((*element)->GetClassName())=="Track" && nTracks==0) {
-      data_tracks = data;
-      element_tracks = element;
-      nTracks = (*data_tracks)->GetEntries();
-      continue;
-    }
     // branch on the element type
     if(type=="tower") delphes_read_towers(*data,*element);
-    else if(type=="track" || type=="photon") delphes_read_tracks(*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);
   }
-  // finish whith what we consider to be the main track collection
-  if(nTracks>0) delphes_read_tracks(*data,*element);
 }
 
@@ -317,10 +310,10 @@
   TEveTrackList* container = dynamic_cast<DelphesBranchElement<TEveTrackList>*>(element)->GetContainer();
   assert(container);
-  TString className = element->GetClassName();
+  TString type = element->GetType();
   TIter itTrack(data);
   Int_t counter = 0;
   TEveTrack *eveTrack;
   TEveTrackPropagator *trkProp = container->GetPropagator();
-  if(className=="Track") {
+  if(type=="track") {
     // Loop over all tracks
     Track *track;
@@ -330,5 +323,4 @@
                    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++));
@@ -339,5 +331,5 @@
       eveTrack->MakeTrack();
     }
-  } else if(className=="Electron") {
+  } else if(type=="electron") {
     // Loop over all electrons
     Electron *electron;
@@ -346,21 +338,4 @@
                    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(className=="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.);
 
@@ -373,5 +348,22 @@
       eveTrack->MakeTrack();
     }
-  } else if(className=="Photon") {
+  } 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;
@@ -381,5 +373,21 @@
                    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++));
@@ -388,4 +396,5 @@
       container->AddElement(eveTrack);
       eveTrack->SetLineColor(element->GetColor());
+      if(particle->Charge==0) eveTrack->SetLineStyle(7);
       eveTrack->MakeTrack();
     }
