Index: examples/geometry.C
===================================================================
--- examples/geometry.C	(revision b4cd1e739ec8d5256137436583177517fd83e59b)
+++ examples/geometry.C	(revision a844c077208c72984dbdaeb188751d762d6bcf17)
@@ -61,4 +61,5 @@
 Int_t event_id           = 0; // Current event id.
 Double_t gRadius = 1.29;
+Double_t gTotRadius = 2.0;
 Double_t gHalfLength = 3.0;
 Double_t gBz = 3.8;
@@ -73,11 +74,19 @@
 TClonesArray *gBranchTower = 0;
 TClonesArray *gBranchTrack = 0;
+TClonesArray *gBranchEle = 0;
+TClonesArray *gBranchMuon = 0;
+TClonesArray *gBranchPhoton = 0;
 TClonesArray *gBranchJet = 0;
+TClonesArray *gBranchGenJet = 0;
 TClonesArray *gBranchMet = 0;
 
 DelphesCaloData *gCaloData = 0;
 TEveElementList *gJetList = 0;
+TEveElementList *gGenJetList = 0;
 TEveArrow *gMet = 0;
 TEveTrackList *gTrackList = 0;
+TEveTrackList *gElectronList = 0;
+TEveTrackList *gMuonList = 0;
+TEveTrackList *gPhotonList = 0;
 
 DelphesDisplay *gDelphesDisplay = 0;
@@ -110,4 +119,5 @@
 
      Double_t getTrackerRadius() const { return tk_radius_; }
+     Double_t getDetectorRadius() const { return muonSystem_radius_; }
      Double_t getTrackerHalfLength() const { return tk_length_; }
      Double_t getBField() const { return tk_Bz_; }
@@ -136,4 +146,5 @@
      Double_t calo_endcap_thickness_;
      Double_t muonSystem_thickn_;
+     Double_t muonSystem_radius_;
      Double_t tk_radius_;
      Double_t tk_length_;
@@ -183,4 +194,5 @@
    tk_etamax_ = 3.0;
    tk_Bz_     = 1.;
+   muonSystem_radius_ = 200.;
 }
 
@@ -268,4 +280,6 @@
    etaAxis_ = new TAxis(caloBinning.size() - 1, etaBins);
    phiAxis_ = new TAxis(72, -TMath::Pi(), TMath::Pi()); // note that this is fixed while #phibins could vary, also with eta, which doesn't seem possible in ROOT
+
+   muonSystem_radius_ = tk_radius_ + contingency_ + (contingency_+calo_barrel_thickness_)*calorimeters_.size() + muonSystem_thickn_;
 
    delete confReader;
@@ -485,4 +499,5 @@
    // build the detector
    gRadius = det3D.getTrackerRadius();
+   gTotRadius = det3D.getDetectorRadius();
    gHalfLength = det3D.getTrackerHalfLength();
    gBz = det3D.getBField();
@@ -528,31 +543,13 @@
 
    // Get pointers to branches
-   gBranchTower = gTreeReader->UseBranch("Tower");
-   gBranchTrack = gTreeReader->UseBranch("Track");
-   gBranchJet   = gTreeReader->UseBranch("Jet");
-   gBranchMet   = gTreeReader->UseBranch("MissingET");
-
 //TODO make it configurable, for more objects (or can we guess from the config?)
-// idea: for pf objects, we could use the TEveCompound to show track + cluster ??? (nice display but little meaning)
-// for MET and SHT, show an arrow (tooltip = title)
-// for electrons and muons, create additional track collections
-// for photons, use TEveStraightLineSet
-
-/*
-  add Branch Calorimeter/eflowTracks EFlowTrack Track
-  add Branch Calorimeter/eflowPhotons EFlowPhoton Tower
-  add Branch Calorimeter/eflowNeutralHadrons EFlowNeutralHadron Tower
-
-  add Branch GenJetFinder/jets GenJet Jet
-
-  add Branch UniqueObjectFinder/jets Jet Jet
-
-  add Branch UniqueObjectFinder/electrons Electron Electron
-  add Branch UniqueObjectFinder/photons Photon Photon
-  add Branch UniqueObjectFinder/muons Muon Muon
-
-  add Branch MissingET/momentum MissingET MissingET
-  add Branch ScalarHT/energy ScalarHT ScalarHT
-*/
+   gBranchTower  = gTreeReader->UseBranch("Tower");
+   gBranchTrack  = gTreeReader->UseBranch("Track");
+   gBranchEle    = gTreeReader->UseBranch("Electron");
+   gBranchMuon   = gTreeReader->UseBranch("Muon");
+   gBranchPhoton = gTreeReader->UseBranch("Photon");
+   gBranchJet    = gTreeReader->UseBranch("Jet");
+   gBranchGenJet = gTreeReader->UseBranch("GenJet");
+   gBranchMet    = gTreeReader->UseBranch("MissingET");
 
    // data
@@ -565,5 +562,12 @@
 
    gJetList = new TEveElementList("Jets");
+   gJetList->SetMainColor(kYellow);
    gEve->AddElement(gJetList);
+
+   gGenJetList = new TEveElementList("GenJets");
+   gGenJetList->SetMainColor(kCyan);
+   gGenJetList->SetRnrSelf(false);
+   gGenJetList->SetRnrChildren(false);
+   gEve->AddElement(gGenJetList);
 
    gMet = new TEveArrow(1., 0., 0., 0., 0., 0.);
@@ -574,4 +578,28 @@
    gEve->GetCurrentEvent()->AddElement(gMet);
 
+   TEveTrackPropagator *trkProp;
+
+   gElectronList = new TEveTrackList("Electrons");
+   gElectronList->SetMainColor(kRed);
+   gElectronList->SetMarkerColor(kViolet);
+   gElectronList->SetMarkerStyle(kCircle);
+   gElectronList->SetMarkerSize(0.5);
+   gEve->AddElement(gElectronList);
+   trkProp = gElectronList->GetPropagator();
+   trkProp->SetMagField(0.0, 0.0, -gBz);
+   trkProp->SetMaxR(gRadius);
+   trkProp->SetMaxZ(gHalfLength);
+
+   gMuonList = new TEveTrackList("Muons");
+   gMuonList->SetMainColor(kGreen);
+   gMuonList->SetMarkerColor(kViolet);
+   gMuonList->SetMarkerStyle(kCircle);
+   gMuonList->SetMarkerSize(0.5);
+   gEve->AddElement(gMuonList);
+   trkProp = gMuonList->GetPropagator();
+   trkProp->SetMagField(0.0, 0.0, -gBz);
+   trkProp->SetMaxR(gTotRadius);
+   trkProp->SetMaxZ(gHalfLength);
+
    gTrackList = new TEveTrackList("Tracks");
    gTrackList->SetMainColor(kBlue);
@@ -580,7 +608,18 @@
    gTrackList->SetMarkerSize(0.5);
    gEve->AddElement(gTrackList);
-
-   TEveTrackPropagator *trkProp = gTrackList->GetPropagator();
+   trkProp = gTrackList->GetPropagator();
    trkProp->SetMagField(0.0, 0.0, -gBz);
+   trkProp->SetMaxR(gRadius);
+   trkProp->SetMaxZ(gHalfLength);
+
+   gPhotonList= new TEveTrackList("Photons");
+   gPhotonList->SetMainColor(kYellow);
+   gPhotonList->SetLineStyle(7);
+   gPhotonList->SetMarkerColor(kViolet);
+   gPhotonList->SetMarkerStyle(kCircle);
+   gPhotonList->SetMarkerSize(0.5);
+   gEve->AddElement(gPhotonList);
+   trkProp = gPhotonList->GetPropagator();
+   trkProp->SetMagField(0.0, 0.0, 0.0);
    trkProp->SetMaxR(gRadius);
    trkProp->SetMaxZ(gHalfLength);
@@ -623,5 +662,9 @@
    if(gCaloData) gCaloData->ClearTowers();
    if(gJetList) gJetList->DestroyElements();
+   if(gGenJetList) gGenJetList->DestroyElements();
    if(gTrackList) gTrackList->DestroyElements();
+   if(gElectronList) gElectronList->DestroyElements();
+   if(gMuonList) gMuonList->DestroyElements();
+   if(gPhotonList) gPhotonList->DestroyElements();
 
    delphes_read();
@@ -643,9 +686,16 @@
   TIter itTower(gBranchTower);
   TIter itTrack(gBranchTrack);
+  TIter itElectron(gBranchEle);
+  TIter itPhoton(gBranchPhoton);
+  TIter itMuon(gBranchMuon);
   TIter itJet(gBranchJet);
+  TIter itGenJet(gBranchGenJet);
   TIter itMet(gBranchMet);
 
   Tower *tower;
   Track *track;
+  Electron *electron;
+  Muon *muon;
+  Photon *photon;
   Jet *jet;
   MissingET *MET;
@@ -658,8 +708,10 @@
 
   TEveTrackPropagator *trkProp = gTrackList->GetPropagator();
+  TEveTrackPropagator *photProp = gPhotonList->GetPropagator();
   if(event_id >= gTreeReader->GetEntries()) return;
 
   // Load selected branches with data from specified event
   gTreeReader->ReadEntry(event_id);
+
   // Loop over all towers
   itTower.Reset();
@@ -671,9 +723,9 @@
   }
   gCaloData->DataChanged();
+
   // Loop over all tracks
   itTrack.Reset();
   counter = 0;
-  while((track = (Track *) itTrack.Next()))
-  {
+  while((track = (Track *) itTrack.Next())) {
     TParticle pb(track->PID, 1, 0, 0, 0, 0,
                  track->P4().Px(), track->P4().Py(),
@@ -685,20 +737,67 @@
     eveTrack->SetStdTitle();
     eveTrack->SetAttLineAttMarker(gTrackList);
-
-    switch(TMath::Abs(track->PID))
-    {
-      case 11:
-        eveTrack->SetLineColor(kRed);
-        break;
-      case 13:
-        eveTrack->SetLineColor(kGreen);
-        break;
-      default:
-        eveTrack->SetLineColor(kBlue);
-    }
     gTrackList->AddElement(eveTrack);
+    eveTrack->SetLineColor(kBlue);
     eveTrack->MakeTrack();
     maxPt = maxPt > track->PT ? maxPt : track->PT;
   }
+
+  // Loop over all electrons
+  itElectron.Reset();
+  counter = 0;
+  while((electron = (Electron *) itElectron.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(gElectronList);
+    gElectronList->AddElement(eveTrack);
+    eveTrack->SetLineColor(kRed);
+    eveTrack->MakeTrack();
+    maxPt = maxPt > electron->PT ? maxPt : electron->PT;
+  }
+
+  // Loop over all photons
+  itPhoton.Reset();
+  counter = 0;
+  while((photon = (Photon *) itPhoton.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, photProp);
+    eveTrack->SetName(Form("%s [%d]", pb.GetName(), counter++));
+    eveTrack->SetStdTitle();
+    eveTrack->SetAttLineAttMarker(gPhotonList);
+    gPhotonList->AddElement(eveTrack);
+    eveTrack->SetLineColor(kYellow);
+    eveTrack->MakeTrack();
+    maxPt = maxPt > photon->PT ? maxPt : photon->PT;
+  }
+
+  // Loop over all muons
+  itMuon.Reset();
+  counter = 0;
+  while((muon = (Muon *) itMuon.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(gMuonList);
+    gMuonList->AddElement(eveTrack);
+    eveTrack->SetLineColor(kGreen);
+    eveTrack->MakeTrack();
+    maxPt = maxPt > muon->PT ? maxPt : muon->PT;
+  }
+
   // Loop over all jets
   itJet.Reset();
@@ -707,7 +806,9 @@
   {
     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(kYellow);
+    eveJetCone->SetFillColor(kYellow);
     eveJetCone->SetCylinder(gRadius - 10, gHalfLength - 10);
     eveJetCone->SetPickable(kTRUE);
@@ -715,4 +816,21 @@
     gJetList->AddElement(eveJetCone);
     maxPt = maxPt > jet->PT ? maxPt : jet->PT;
+  }
+
+  // Loop over all genjets
+  itJet.Reset();
+  counter = 0;
+  while((jet = (Jet *) itGenJet.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(kCyan);
+    eveJetCone->SetFillColor(kCyan);
+    eveJetCone->SetCylinder(gRadius - 10, gHalfLength - 10);
+    eveJetCone->SetPickable(kTRUE);
+    eveJetCone->AddEllipticCone(jet->Eta, jet->Phi, jet->DeltaEta, jet->DeltaPhi);
+    gGenJetList->AddElement(eveJetCone);
   }
 
@@ -724,5 +842,7 @@
     gMet = new TEveArrow((gRadius * MET->MET/maxPt)*cos(MET->Phi), (gRadius * MET->MET/maxPt)*sin(MET->Phi), 0., 0., 0., 0.);
     gMet->SetMainColor(kViolet);
-//    gMet->SetTubeR(0.04);
+    gMet->SetTubeR(0.04);
+    gMet->SetConeR(0.08);
+    gMet->SetConeL(0.10);
     gMet->SetPickable(kTRUE);
     gMet->SetName("Missing Et");
