Index: display/DelphesPlotSummary.cc
===================================================================
--- display/DelphesPlotSummary.cc	(revision 1fa50c28409a44b952b4b2f1a0c4f30a60f8cc50)
+++ display/DelphesPlotSummary.cc	(revision 6455202899ab4afd733c9cc0b4d78dd392cbb843)
@@ -21,7 +21,8 @@
 #include <algorithm>
 
-bool vecsorter (TLorentzVector i,TLorentzVector j) { return (i.Pt()>j.Pt()); }
-
-DelphesPlotSummary::DelphesPlotSummary(TEveWindowTab* tab):tab_(tab) {}
+bool vecsorter(TLorentzVector i, TLorentzVector j) { return (i.Pt() > j.Pt()); }
+
+DelphesPlotSummary::DelphesPlotSummary(TEveWindowTab *tab) :
+  tab_(tab) {}
 
 DelphesPlotSummary::~DelphesPlotSummary() {}
@@ -29,47 +30,55 @@
 void DelphesPlotSummary::Progress(Int_t p)
 {
-  Emit("Progress(Int_t)",p);
-}
-
-void DelphesPlotSummary::Init(std::vector<DelphesBranchBase*>& elements) {
+  Emit("Progress(Int_t)", p);
+}
+
+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) {
+  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);
+    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);
+    canvas->Divide(3, 3);
     canvases_[(*data)->GetName()] = canvas;
     // the histograms
-    TH1F* h;
-    std::vector<TH1F*> 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);
+    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;
     // the event histograms
-    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);
-    std::vector<TH1F*> hv;
+    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);
+    std::vector<TH1F *> hv;
     hv.push_back(h1);
     hv.push_back(h2);
@@ -78,16 +87,28 @@
     // the event markers
     TMarker *m;
-    std::vector<TMarker*> mv;
-    m = new TMarker(0,0,29); m->SetMarkerColor(kBlue); m->SetMarkerSize(3);
-    mv.push_back(m);
-    m = new TMarker(0,0,29); m->SetMarkerColor(kBlue); m->SetMarkerSize(3);
-    mv.push_back(m);
-    m = new TMarker(0,0,29); m->SetMarkerColor(kBlue); m->SetMarkerSize(3);
-    mv.push_back(m);
-    m = new TMarker(0,0,29); m->SetMarkerColor(kBlue); m->SetMarkerSize(3);
-    mv.push_back(m);
-    m = new TMarker(0,0,29); m->SetMarkerColor(kBlue); m->SetMarkerSize(3);
-    mv.push_back(m);
-    m = new TMarker(0,0,29); m->SetMarkerColor(kBlue); m->SetMarkerSize(3);
+    std::vector<TMarker *> mv;
+    m = new TMarker(0, 0, 29);
+    m->SetMarkerColor(kBlue);
+    m->SetMarkerSize(3);
+    mv.push_back(m);
+    m = new TMarker(0, 0, 29);
+    m->SetMarkerColor(kBlue);
+    m->SetMarkerSize(3);
+    mv.push_back(m);
+    m = new TMarker(0, 0, 29);
+    m->SetMarkerColor(kBlue);
+    m->SetMarkerSize(3);
+    mv.push_back(m);
+    m = new TMarker(0, 0, 29);
+    m->SetMarkerColor(kBlue);
+    m->SetMarkerSize(3);
+    mv.push_back(m);
+    m = new TMarker(0, 0, 29);
+    m->SetMarkerColor(kBlue);
+    m->SetMarkerSize(3);
+    mv.push_back(m);
+    m = new TMarker(0, 0, 29);
+    m->SetMarkerColor(kBlue);
+    m->SetMarkerSize(3);
     mv.push_back(m);
     eventMarkers_[(*data)->GetName()] = mv;
@@ -95,22 +116,28 @@
 }
 
-void DelphesPlotSummary::FillSample(ExRootTreeReader* treeReader, Int_t event_id) {
+void DelphesPlotSummary::FillSample(ExRootTreeReader *treeReader, Int_t event_id)
+{
   Int_t entries = treeReader->GetEntries();
-  for(Int_t i=0;i<entries;++i) {
+  for(Int_t i = 0; i < entries; ++i)
+  {
     treeReader->ReadEntry(i);
-    for(std::vector<DelphesBranchBase*>::iterator element = elements_->begin();element<elements_->end();++element) {
+    for(std::vector<DelphesBranchBase *>::iterator element = elements_->begin(); element < elements_->end(); ++element)
+    {
       std::vector<TLorentzVector> vectors = (*element)->GetVectors();
-      std::sort(vectors.begin(), vectors.end(), vecsorter); 
-      std::vector<TH1F*> histograms = histograms_[(*element)->GetName()];
-      for(std::vector<TLorentzVector>::iterator it=vectors.begin(); it<vectors.end();++it) {
+      std::sort(vectors.begin(), vectors.end(), vecsorter);
+      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()) {
+        if(it == vectors.begin())
+        {
           histograms[3]->Fill(it->Pt());
           histograms[4]->Fill(it->Eta());
           histograms[5]->Fill(it->Phi());
         }
-        if(it==vectors.begin()+1) {
+        if(it == vectors.begin() + 1)
+        {
           histograms[6]->Fill(it->Pt());
           histograms[7]->Fill(it->Eta());
@@ -119,5 +146,5 @@
       }
     }
-    Progress(int(100*i/entries));
+    Progress(int(100 * i / entries));
   }
   treeReader->ReadEntry(event_id);
@@ -125,60 +152,84 @@
 }
 
-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);
-      if(histograms[i]->GetEntries()==0) continue;
+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);
+      if(histograms[i]->GetEntries() == 0) continue;
       histograms[i]->Draw();
-      if(i<3) {
+      if(i < 3)
+      {
         eventProfiles[i]->Draw("same");
-      } else {
-        eventMarkers[i-3]->Draw("same");
+      }
+      else
+      {
+        eventMarkers[i - 3]->Draw("same");
       }
     }
     c->Update();
-  } 
-}
-
-void DelphesPlotSummary::FillEvent() {
+  }
+}
+
+void DelphesPlotSummary::FillEvent()
+{
   // clear event histograms and markers
-  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) {
+  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)
+    {
       (*h)->Reset();
     }
   }
-  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) {
+  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)
+    {
       (*m)->SetMarkerSize(0);
     }
   }
   // loop over the elements and fill markers with event data
-  for(std::vector<DelphesBranchBase*>::iterator element = elements_->begin();element<elements_->end();++element) {
+  for(std::vector<DelphesBranchBase *>::iterator element = elements_->begin(); element < elements_->end(); ++element)
+  {
     std::vector<TLorentzVector> vectors = (*element)->GetVectors();
-    std::sort(vectors.begin(), vectors.end(), vecsorter); 
-    std::vector<TH1F*> hv = eventProfiles_[(*element)->GetName()];
-    TH1F* h1 = hv[0]; h1->Reset();
-    TH1F* h2 = hv[1]; h1->Reset();
-    TH1F* h3 = hv[2]; h1->Reset();
-    std::vector<TMarker*> mv = eventMarkers_[(*element)->GetName()];
-    for(std::vector<TLorentzVector>::iterator it=vectors.begin(); it<vectors.end();++it) {
+    std::sort(vectors.begin(), vectors.end(), vecsorter);
+    std::vector<TH1F *> hv = eventProfiles_[(*element)->GetName()];
+    TH1F *h1 = hv[0];
+    h1->Reset();
+    TH1F *h2 = hv[1];
+    h1->Reset();
+    TH1F *h3 = hv[2];
+    h1->Reset();
+    std::vector<TMarker *> mv = eventMarkers_[(*element)->GetName()];
+    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()) {
-        mv[0]->SetX(it->Pt()); mv[0]->SetMarkerSize(3);
-        mv[1]->SetX(it->Eta()); mv[1]->SetMarkerSize(3);
-        mv[2]->SetX(it->Phi()); mv[2]->SetMarkerSize(3);
-      }
-      if(it==vectors.begin()+1) {
-        mv[3]->SetX(it->Pt()); mv[3]->SetMarkerSize(3);
-        mv[4]->SetX(it->Eta()); mv[4]->SetMarkerSize(3);
-        mv[5]->SetX(it->Phi()); mv[5]->SetMarkerSize(3);
-      }
-    }
-  }
-}
+      if(it == vectors.begin())
+      {
+        mv[0]->SetX(it->Pt());
+        mv[0]->SetMarkerSize(3);
+        mv[1]->SetX(it->Eta());
+        mv[1]->SetMarkerSize(3);
+        mv[2]->SetX(it->Phi());
+        mv[2]->SetMarkerSize(3);
+      }
+      if(it == vectors.begin() + 1)
+      {
+        mv[3]->SetX(it->Pt());
+        mv[3]->SetMarkerSize(3);
+        mv[4]->SetX(it->Eta());
+        mv[4]->SetMarkerSize(3);
+        mv[5]->SetX(it->Phi());
+        mv[5]->SetMarkerSize(3);
+      }
+    }
+  }
+}
