Changeset ad015db in git
- Timestamp:
- Oct 26, 2014, 12:16:21 AM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 2695ae1
- Parents:
- 3f51314
- Location:
- display
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
display/DelphesEventDisplay.cc
r3f51314 rad015db 155 155 //ready... 156 156 fStatusBar_->SetText("Ready.", 1); 157 plotSummary_->FillSample(treeReader_, event_id_); //TODO later, control it via a GUI button. 157 158 load_event(); 158 plotSummary_->FillSample(treeReader_, event_id_); //TODO later, control it via a GUI button.159 plotSummary_->FillEvent(); //TODO later move to event loop160 plotSummary_->Draw();161 159 gEve->Redraw3D(kTRUE); 162 160 … … 265 263 delphesDisplay_->ImportEventRhoZ(top); 266 264 update_html_summary(); 267 //TODO: update plot tab (show current event on top) 265 plotSummary_->FillEvent(); 266 plotSummary_->Draw(); 268 267 269 268 gEve->Redraw3D(kFALSE, kTRUE); -
display/DelphesPlotSummary.cc
r3f51314 rad015db 1 1 #include "display/DelphesPlotSummary.h" 2 2 #include "TRootEmbeddedCanvas.h" 3 #include <algorithm> 3 4 5 bool vecsorter (TLorentzVector i,TLorentzVector j) { return (i.Pt()>j.Pt()); } 4 6 5 7 DelphesPlotSummary::DelphesPlotSummary(TEveWindowTab* tab):tab_(tab) {} 6 8 7 9 DelphesPlotSummary::~DelphesPlotSummary() {} 10 11 //TODO: sort the vectors before filling. 8 12 9 13 void DelphesPlotSummary::Init(std::vector<DelphesBranchBase*>& elements) { … … 50 54 for(std::vector<DelphesBranchBase*>::iterator element = elements_->begin();element<elements_->end();++element) { 51 55 std::vector<TLorentzVector> vectors = (*element)->GetVectors(); 56 std::sort(vectors.begin(), vectors.end(), vecsorter); 52 57 std::vector<TH1F*> histograms = histograms_[(*element)->GetName()]; 53 58 for(std::vector<TLorentzVector>::iterator it=vectors.begin(); it<vectors.end();++it) { … … 80 85 c->cd(i+1); 81 86 histograms[i]->Draw(); 82 if(i<3) 87 if(i<3) { 83 88 eventProfiles[i]->Draw("same"); 84 else 85 eventMarkers[i-3]->Draw("same"); 89 } else { 90 if(eventMarkers.size()>(unsigned int)(i-3)) { 91 eventMarkers[i-3]->Draw("same"); 92 } 93 } 86 94 } 95 c->Update(); 87 96 } 88 97 } … … 104 113 // loop over the elements and fill markers with event data 105 114 TMarker *m; 106 std::vector<TMarker*> mv;107 115 for(std::vector<DelphesBranchBase*>::iterator element = elements_->begin();element<elements_->end();++element) { 116 std::vector<TMarker*> mv; 108 117 std::vector<TLorentzVector> vectors = (*element)->GetVectors(); 118 std::sort(vectors.begin(), vectors.end(), vecsorter); 109 119 std::vector<TH1F*> histograms = histograms_[(*element)->GetName()]; 110 120 TH1F* h1 = (TH1F*)histograms[0]->Clone(); h1->Reset(); h1->SetLineColor(kBlue); … … 116 126 h3->Fill(it->Phi()); 117 127 if(it==vectors.begin()) { 118 m = new TMarker(it->Pt(),0,29); m->SetMarkerColor(kBlue); 128 m = new TMarker(it->Pt(),0,29); m->SetMarkerColor(kBlue); m->SetMarkerSize(3); 119 129 mv.push_back(m); 120 m = new TMarker(it->Eta(),0,29); m->SetMarkerColor(kBlue); 130 m = new TMarker(it->Eta(),0,29); m->SetMarkerColor(kBlue); m->SetMarkerSize(3); 121 131 mv.push_back(m); 122 m = new TMarker(it->Phi(),0,29); m->SetMarkerColor(kBlue); 132 m = new TMarker(it->Phi(),0,29); m->SetMarkerColor(kBlue); m->SetMarkerSize(3); 123 133 mv.push_back(m); 124 134 } 125 135 if(it==vectors.begin()+1) { 126 m = new TMarker(it->Pt(),0,29); m->SetMarkerColor(kBlue); 136 m = new TMarker(it->Pt(),0,29); m->SetMarkerColor(kBlue); m->SetMarkerSize(3); 127 137 mv.push_back(m); 128 m = new TMarker(it->Eta(),0,29); m->SetMarkerColor(kBlue); 138 m = new TMarker(it->Eta(),0,29); m->SetMarkerColor(kBlue); m->SetMarkerSize(3); 129 139 mv.push_back(m); 130 m = new TMarker(it->Phi(),0,29); m->SetMarkerColor(kBlue); 140 m = new TMarker(it->Phi(),0,29); m->SetMarkerColor(kBlue); m->SetMarkerSize(3); 131 141 mv.push_back(m); 132 142 }
Note:
See TracChangeset
for help on using the changeset viewer.