Changeset ad015db in git for display/DelphesPlotSummary.cc
- Timestamp:
- Oct 26, 2014, 12:16:21 AM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 2695ae1
- Parents:
- 3f51314
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.