Index: display/DelphesBranchElement.cc
===================================================================
--- display/DelphesBranchElement.cc	(revision 2ca23b5dc4150d233edf09a949b2dbdf65058ecc)
+++ display/DelphesBranchElement.cc	(revision 3f51314b1497da399b338411367c61574da3f8fd)
@@ -26,4 +26,6 @@
 #include <iostream>
 
+//TODO implement GetVectors()
+
 // special case for calo towers
 template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt):DelphesBranchBase(name, branch, color, maxPt) {
@@ -46,4 +48,17 @@
     data_->DataChanged();
   }
+}
+template<> std::vector<TLorentzVector> DelphesBranchElement<DelphesCaloData>::GetVectors() {
+  std::vector<TLorentzVector> output;
+  if(TString(GetType())=="Tower") {
+    TIter itTower(branch_);
+    Tower *tower;
+    while((tower = (Tower *) itTower.Next())) {
+      TLorentzVector v;
+      v.SetPtEtaPhiM(tower->Eem+tower->Ehad,(tower->Edges[0]+tower->Edges[1])/2.,(tower->Edges[2]+tower->Edges[3])/2.,0.);
+      output.push_back(v);
+    }
+  }
+  return output;
 }
 
@@ -91,4 +106,27 @@
   }
 }
+template<> std::vector<TLorentzVector> DelphesBranchElement<TEveElementList>::GetVectors() {
+  std::vector<TLorentzVector> output;
+  if(TString(GetType())=="Jet") {
+    TIter itJet(branch_);
+    Jet *jet;
+    // Loop over all jets
+    while((jet = (Jet *) itJet.Next())) {
+      TLorentzVector v;
+      v.SetPtEtaPhiM(jet->PT, jet->Eta, jet->Phi, jet->Mass);
+      output.push_back(v);
+    }
+  } else if(TString(GetType())=="MissingET") {
+    TIter itMet(branch_);
+    MissingET *MET;
+    // Missing Et
+    while((MET = (MissingET*) itMet.Next())) {
+      TLorentzVector v;
+      v.SetPtEtaPhiM(MET->MET,MET->Eta,MET->Phi,0.);
+      output.push_back(v);
+    }
+  }
+  return output;
+}
 
 // special case for track lists
@@ -199,2 +237,35 @@
   }
 }
+template<> std::vector<TLorentzVector> DelphesBranchElement<TEveTrackList>::GetVectors() {
+  std::vector<TLorentzVector> output;
+  TString type = GetType();
+  TIter itTrack(branch_);
+  if(type=="Track") { // CASE 1: TRACKS
+    Track *track;
+    while((track = (Track *) itTrack.Next())) {
+      output.push_back(track->P4());
+    }
+  } else if(type=="Electron") { // CASE 2: ELECTRONS
+    Electron *electron;
+    while((electron = (Electron *) itTrack.Next())) {
+      output.push_back(electron->P4());
+    }
+  } else if(type=="Muon") { // CASE 3: MUONS
+    Muon *muon;
+    while((muon = (Muon *) itTrack.Next())) {
+      output.push_back(muon->P4());
+    }
+  } else if(type=="Photon") { // CASE 4: PHOTONS
+    Photon *photon;
+    while((photon = (Photon *) itTrack.Next())) {
+      output.push_back(photon->P4());
+    }
+  } else if(type=="GenParticle") { // CASE 5: GENPARTICLES
+    GenParticle *particle;
+    while((particle = (GenParticle *) itTrack.Next())) {
+      if(particle->Status != 1) continue;
+        output.push_back(particle->P4());
+    }
+  }
+  return output;
+}
Index: display/DelphesBranchElement.h
===================================================================
--- display/DelphesBranchElement.h	(revision 2ca23b5dc4150d233edf09a949b2dbdf65058ecc)
+++ display/DelphesBranchElement.h	(revision 3f51314b1497da399b338411367c61574da3f8fd)
@@ -43,4 +43,5 @@
     virtual void SetTrackingVolume(Float_t r, Float_t l, Float_t Bz=0.) { tkRadius_ = r; tkHalfLength_ = l; tk_Bz_ = Bz; }
     virtual void ReadBranch() = 0;
+    virtual std::vector<TLorentzVector> GetVectors() = 0;
 
   protected:
@@ -79,4 +80,7 @@
     virtual void ReadBranch() {}
 
+    // return the vector for all elements
+    virtual std::vector<TLorentzVector> GetVectors() { std::vector<TLorentzVector> v; return v; }
+
   private:
     EveContainer* data_;
@@ -89,4 +93,5 @@
 template<> void DelphesBranchElement<DelphesCaloData>::Reset();
 template<> void DelphesBranchElement<DelphesCaloData>::ReadBranch();
+template<> std::vector<TLorentzVector> DelphesBranchElement<DelphesCaloData>::GetVectors();
 
 // special case for element lists
@@ -94,4 +99,5 @@
 template<> void DelphesBranchElement<TEveElementList>::Reset();
 template<> void DelphesBranchElement<TEveElementList>::ReadBranch();
+template<> std::vector<TLorentzVector> DelphesBranchElement<TEveElementList>::GetVectors();
 
 // special case for track lists
@@ -100,4 +106,5 @@
 template<> void DelphesBranchElement<TEveTrackList>::Reset();
 template<> void DelphesBranchElement<TEveTrackList>::ReadBranch();
+template<> std::vector<TLorentzVector> DelphesBranchElement<TEveTrackList>::GetVectors();
 
 #endif // CINT, CLING
Index: display/DelphesEventDisplay.cc
===================================================================
--- display/DelphesEventDisplay.cc	(revision 2ca23b5dc4150d233edf09a949b2dbdf65058ecc)
+++ display/DelphesEventDisplay.cc	(revision 3f51314b1497da399b338411367c61574da3f8fd)
@@ -156,4 +156,7 @@
    fStatusBar_->SetText("Ready.", 1);
    load_event();
+   plotSummary_->FillSample(treeReader_, event_id_); //TODO later, control it via a GUI button.
+   plotSummary_->FillEvent(); //TODO later move to event loop
+   plotSummary_->Draw();
    gEve->Redraw3D(kTRUE);   
 
@@ -386,34 +389,4 @@
    plotSummary_ = new DelphesPlotSummary(tab);
    plotSummary_->Init(elements_);
-   plotSummary_->FillSample(treeReader_); //TODO later, control it via a GUI button.
-   plotSummary_->FillEvent(); //TODO later move to event loop
-
-   //for test
-   TH1F* h;
-   TRootEmbeddedCanvas* trec;
-   TCanvas* gCanvas_;
-
-   slot = tab->NewSlot();
-   trec = new TRootEmbeddedCanvas();
-   gCanvas_ = trec->GetCanvas();
-   wf = slot->MakeFrame(trec);
-   wf->SetElementName("Tracks");
-   h = new TH1F("tracks","tracks",100,0,100);
-   gCanvas_->cd();
-   h->Draw();
-
-   slot = tab->NewSlot();
-   trec = new TRootEmbeddedCanvas();
-   gCanvas_ = trec->GetCanvas();
-   wf = slot->MakeFrame(trec);
-   wf->SetElementName("Electrons");
-   h = new TH1F("electrons","electrons",100,0,100);
-   gCanvas_->cd();
-   h->Draw();
- 
-   // TODO: here we have, for each collection, Pt,Eta,Phi for all, leading, subleading
-   // for each event, we will then add a marker with the current value and/or a histo for current event.
-   // this means to create one tab with subtabs (one per collection). 
-
-}
-
+}
+
Index: display/DelphesPlotSummary.cc
===================================================================
--- display/DelphesPlotSummary.cc	(revision 2ca23b5dc4150d233edf09a949b2dbdf65058ecc)
+++ display/DelphesPlotSummary.cc	(revision 3f51314b1497da399b338411367c61574da3f8fd)
@@ -1,11 +1,141 @@
 #include "display/DelphesPlotSummary.h"
+#include "TRootEmbeddedCanvas.h"
 
-DelphesPlotSummary::DelphesPlotSummary(TEveWindowTab* tab) {}
+
+DelphesPlotSummary::DelphesPlotSummary(TEveWindowTab* tab):tab_(tab) {}
 
 DelphesPlotSummary::~DelphesPlotSummary() {}
 
-void DelphesPlotSummary::Init(std::vector<DelphesBranchBase*>& elements) {}
+void DelphesPlotSummary::Init(std::vector<DelphesBranchBase*>& elements) {
+  elements_ = &elements;
+  // loop on the elements, and create tabs
+  for(std::vector<DelphesBranchBase*>::iterator data=elements.begin();data<elements.end();++data) {
+    // the canvas
+    TEveWindowSlot* slot = tab_->NewSlot();
+    TRootEmbeddedCanvas* trec = new TRootEmbeddedCanvas();
+    TCanvas* canvas = trec->GetCanvas();
+    TEveWindowFrame * wf = slot->MakeFrame(trec);
+    wf->SetElementName((*data)->GetName());
+    canvas->Divide(3,3);
+    canvases_[(*data)->GetName()] = canvas;
+    // the histograms
+    TH1F* h;
+    std::vector<TH1F*> histograms;
+    histograms.reserve(9);
+    h = new TH1F(Form("%sPt",(*data)->GetName()),Form("%s Pt",(*data)->GetName()),100,0,-1);
+    histograms.push_back(h);
+    h = new TH1F(Form("%sEta",(*data)->GetName()),Form("%s Eta",(*data)->GetName()),100,0,-1);
+    histograms.push_back(h);
+    h = new TH1F(Form("%sPhi",(*data)->GetName()),Form("%s Phi",(*data)->GetName()),100,0,-1);
+    histograms.push_back(h);
+    h = new TH1F(Form("l%sPt",(*data)->GetName()),Form("leading %s Pt",(*data)->GetName()),100,0,-1);
+    histograms.push_back(h);
+    h = new TH1F(Form("l%sEta",(*data)->GetName()),Form("leading %s Eta",(*data)->GetName()),100,0,-1);
+    histograms.push_back(h);
+    h = new TH1F(Form("l%sPhi",(*data)->GetName()),Form("leading %s Phi",(*data)->GetName()),100,0,-1);
+    histograms.push_back(h);
+    h = new TH1F(Form("sl%sPt",(*data)->GetName()),Form("subleading %s Pt",(*data)->GetName()),100,0,-1);
+    histograms.push_back(h);
+    h = new TH1F(Form("sl%sEta",(*data)->GetName()),Form("subleading %s Eta",(*data)->GetName()),100,0,-1);
+    histograms.push_back(h);
+    h = new TH1F(Form("sl%sPhi",(*data)->GetName()),Form("subleading %s Phi",(*data)->GetName()),100,0,-1);
+    histograms.push_back(h);
+    histograms_[(*data)->GetName()] = histograms;
+  }
+}
 
-void DelphesPlotSummary::FillSample(ExRootTreeReader* treeReader) {}
+void DelphesPlotSummary::FillSample(ExRootTreeReader* treeReader, Int_t event_id) {
+  for(Int_t i=0;i<treeReader->GetEntries();++i) {
+    treeReader->ReadEntry(i);
+    for(std::vector<DelphesBranchBase*>::iterator element = elements_->begin();element<elements_->end();++element) {
+      std::vector<TLorentzVector> vectors = (*element)->GetVectors();
+      std::vector<TH1F*> histograms = histograms_[(*element)->GetName()];
+      for(std::vector<TLorentzVector>::iterator it=vectors.begin(); it<vectors.end();++it) {
+        histograms[0]->Fill(it->Pt());
+        histograms[1]->Fill(it->Eta());
+        histograms[2]->Fill(it->Phi());
+        if(it==vectors.begin()) {
+          histograms[3]->Fill(it->Pt());
+          histograms[4]->Fill(it->Eta());
+          histograms[5]->Fill(it->Phi());
+        }
+        if(it==vectors.begin()+1) {
+          histograms[6]->Fill(it->Pt());
+          histograms[7]->Fill(it->Eta());
+          histograms[8]->Fill(it->Phi());
+        }
+      }
+    }
+  }
+  treeReader->ReadEntry(event_id);
+}
 
-void DelphesPlotSummary::FillEvent() {}
+void DelphesPlotSummary::Draw() {
+  for(std::map< TString, TCanvas* >::iterator it=canvases_.begin(); it!=canvases_.end(); ++it) {
+    TCanvas* c = it->second;
+    std::vector<TH1F*> histograms = histograms_[it->first];
+    std::vector<TH1F*> eventProfiles = eventProfiles_[it->first];
+    std::vector<TMarker*> eventMarkers = eventMarkers_[it->first];
+    for(Int_t i=0;i<9;++i) {
+      c->cd(i+1);
+      histograms[i]->Draw();
+      if(i<3) 
+        eventProfiles[i]->Draw("same");
+      else
+        eventMarkers[i-3]->Draw("same");
+    }
+  } 
+}
+
+void DelphesPlotSummary::FillEvent() {
+  // clear previous markers
+  for(std::map< TString, std::vector<TMarker*> >::iterator mv = eventMarkers_.begin(); mv!=eventMarkers_.end();++mv) {
+    for(std::vector<TMarker*>::iterator m = mv->second.begin(); m<mv->second.end();++m) {
+      delete *m;
+    }
+  }
+  eventMarkers_.clear();
+  for(std::map< TString, std::vector<TH1F*> >::iterator hv = eventProfiles_.begin(); hv!=eventProfiles_.end();++hv) {
+    for(std::vector<TH1F*>::iterator h = hv->second.begin(); h<hv->second.end();++h) {
+      delete *h;
+    }
+  }
+  eventProfiles_.clear();
+  // loop over the elements and fill markers with event data
+  TMarker *m;
+  std::vector<TMarker*> mv;
+  for(std::vector<DelphesBranchBase*>::iterator element = elements_->begin();element<elements_->end();++element) {
+    std::vector<TLorentzVector> vectors = (*element)->GetVectors();
+    std::vector<TH1F*> histograms = histograms_[(*element)->GetName()];
+    TH1F* h1 = (TH1F*)histograms[0]->Clone(); h1->Reset(); h1->SetLineColor(kBlue);
+    TH1F* h2 = (TH1F*)histograms[1]->Clone(); h2->Reset(); h2->SetLineColor(kBlue);
+    TH1F* h3 = (TH1F*)histograms[2]->Clone(); h3->Reset(); h3->SetLineColor(kBlue);
+    for(std::vector<TLorentzVector>::iterator it=vectors.begin(); it<vectors.end();++it) {
+      h1->Fill(it->Pt());
+      h2->Fill(it->Eta());
+      h3->Fill(it->Phi());
+      if(it==vectors.begin()) {
+        m = new TMarker(it->Pt(),0,29); m->SetMarkerColor(kBlue);
+        mv.push_back(m);
+        m = new TMarker(it->Eta(),0,29); m->SetMarkerColor(kBlue);
+        mv.push_back(m);
+        m = new TMarker(it->Phi(),0,29); m->SetMarkerColor(kBlue);
+        mv.push_back(m);
+      }
+      if(it==vectors.begin()+1) {
+        m = new TMarker(it->Pt(),0,29); m->SetMarkerColor(kBlue);
+        mv.push_back(m);
+        m = new TMarker(it->Eta(),0,29); m->SetMarkerColor(kBlue);
+        mv.push_back(m);
+        m = new TMarker(it->Phi(),0,29); m->SetMarkerColor(kBlue);
+        mv.push_back(m);
+      }
+    }
+    std::vector<TH1F*> hv;
+    hv.push_back(h1);
+    hv.push_back(h2);
+    hv.push_back(h3);
+    eventProfiles_[(*element)->GetName()] = hv;
+    eventMarkers_[(*element)->GetName()] = mv;
+  }
+}
Index: display/DelphesPlotSummary.h
===================================================================
--- display/DelphesPlotSummary.h	(revision 2ca23b5dc4150d233edf09a949b2dbdf65058ecc)
+++ display/DelphesPlotSummary.h	(revision 3f51314b1497da399b338411367c61574da3f8fd)
@@ -17,11 +17,15 @@
     virtual ~DelphesPlotSummary();
     void Init(std::vector<DelphesBranchBase*>& elements);
-    void FillSample(ExRootTreeReader* treeReader);
+    void FillSample(ExRootTreeReader* treeReader, Int_t event_id);
     void FillEvent();
+    void Draw();
 
   private:
     TEveWindowTab* tab_;
-    std::vector<TCanvas*> canvases;
-    std::map< TString, std::vector<TH1F*> > histograms;
+    std::map< TString, TCanvas* >           canvases_;
+    std::map< TString, std::vector<TH1F*> > histograms_;
+    std::vector<DelphesBranchBase*>* elements_;
+    std::map< TString, std::vector<TMarker*> > eventMarkers_;
+    std::map< TString, std::vector<TH1F*> > eventProfiles_;
 
 };
