Changeset 8b04b31 in git
- Timestamp:
- Oct 21, 2014, 10:26:15 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 2ca23b5
- Parents:
- 5fbcfe8
- Location:
- display
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
display/DelphesEventDisplay.cc
r5fbcfe8 r8b04b31 46 46 #include "TGButton.h" 47 47 #include "TClonesArray.h" 48 #include "TEveEventManager.h" 48 49 49 50 DelphesEventDisplay::DelphesEventDisplay() … … 255 256 delphesDisplay_->DestroyEventRhoZ(); 256 257 delphesDisplay_->ImportEventRhoZ(top); 257 //update_html_summary();258 update_html_summary(); 258 259 259 260 gEve->Redraw3D(kFALSE, kTRUE); 261 } 262 263 void DelphesEventDisplay::update_html_summary() 264 { 265 // Update summary of current event. 266 267 TEveElement::List_i i; 268 TEveElement::List_i j; 269 Int_t k; 270 TEveElement *el; 271 DelphesHtmlObjTable *table; 272 TEveEventManager *mgr = gEve ? gEve->GetCurrentEvent() : 0; 273 if (mgr) { 274 htmlSummary_->Clear("D"); 275 for (i=mgr->BeginChildren(); i!=mgr->EndChildren(); ++i) { 276 el = ((TEveElement*)(*i)); 277 if (el->IsA() == TEvePointSet::Class()) { 278 TEvePointSet *ps = (TEvePointSet *)el; 279 TString ename = ps->GetElementName(); 280 TString etitle = ps->GetElementTitle(); 281 if (ename.First('\'') != kNPOS) 282 ename.Remove(ename.First('\'')); 283 etitle.Remove(0, 2); 284 Int_t nel = atoi(etitle.Data()); 285 table = htmlSummary_->AddTable(ename, 0, nel); 286 } 287 else if (el->IsA() == TEveTrackList::Class()) { 288 TEveTrackList *tracks = (TEveTrackList *)el; 289 TString ename = tracks->GetElementName(); 290 if (ename.First('\'') != kNPOS) 291 ename.Remove(ename.First('\'')); 292 table = htmlSummary_->AddTable(ename.Data(), 5, 293 tracks->NumChildren(), kTRUE, "first"); 294 table->SetLabel(0, "Momentum"); 295 table->SetLabel(1, "P_t"); 296 table->SetLabel(2, "Phi"); 297 table->SetLabel(3, "Theta"); 298 table->SetLabel(4, "Eta"); 299 k=0; 300 for (j=tracks->BeginChildren(); j!=tracks->EndChildren(); ++j) { 301 Float_t p = ((TEveTrack*)(*j))->GetMomentum().Mag(); 302 table->SetValue(0, k, p); 303 Float_t pt = ((TEveTrack*)(*j))->GetMomentum().Perp(); 304 table->SetValue(1, k, pt); 305 Float_t phi = ((TEveTrack*)(*j))->GetMomentum().Phi(); 306 table->SetValue(2, k, phi); 307 Float_t theta = ((TEveTrack*)(*j))->GetMomentum().Theta(); 308 table->SetValue(3, k, theta); 309 Float_t eta = theta>0.0005 && theta<3.1413 ? ((TEveTrack*)(*j))->GetMomentum().Eta() : 1e10; 310 table->SetValue(4, k, eta); 311 ++k; 312 } 313 } 314 } 315 htmlSummary_->Build(); 316 gHtml_->Clear(); 317 gHtml_->ParseText((char*)htmlSummary_->Html().Data()); 318 gHtml_->Layout(); 319 } 320 260 321 } 261 322 -
display/DelphesEventDisplay.h
r5fbcfe8 r8b04b31 46 46 47 47 private: 48 void update_html_summary(); 48 49 void make_gui(); 49 50 void load_event(); -
display/DelphesHtmlSummary.cc
r5fbcfe8 r8b04b31 214 214 } 215 215 216 //==============================================================================217 218 //______________________________________________________________________________219 void update_html_summary()220 {221 // Update summary of current event.222 223 TEveElement::List_i i;224 TEveElement::List_i j;225 Int_t k;226 TEveElement *el;227 DelphesHtmlObjTable *table;228 TEveEventManager *mgr = gEve ? gEve->GetCurrentEvent() : 0;229 if (mgr) {230 fgDelphesHtmlSummary->Clear("D");231 for (i=mgr->BeginChildren(); i!=mgr->EndChildren(); ++i) {232 el = ((TEveElement*)(*i));233 if (el->IsA() == TEvePointSet::Class()) {234 TEvePointSet *ps = (TEvePointSet *)el;235 TString ename = ps->GetElementName();236 TString etitle = ps->GetElementTitle();237 if (ename.First('\'') != kNPOS)238 ename.Remove(ename.First('\''));239 etitle.Remove(0, 2);240 Int_t nel = atoi(etitle.Data());241 table = fgDelphesHtmlSummary->AddTable(ename, 0, nel);242 }243 else if (el->IsA() == TEveTrackList::Class()) {244 TEveTrackList *tracks = (TEveTrackList *)el;245 TString ename = tracks->GetElementName();246 if (ename.First('\'') != kNPOS)247 ename.Remove(ename.First('\''));248 table = fgDelphesHtmlSummary->AddTable(ename.Data(), 5,249 tracks->NumChildren(), kTRUE, "first");250 table->SetLabel(0, "Momentum");251 table->SetLabel(1, "P_t");252 table->SetLabel(2, "Phi");253 table->SetLabel(3, "Theta");254 table->SetLabel(4, "Eta");255 k=0;256 for (j=tracks->BeginChildren(); j!=tracks->EndChildren(); ++j) {257 Float_t p = ((TEveTrack*)(*j))->GetMomentum().Mag();258 table->SetValue(0, k, p);259 Float_t pt = ((TEveTrack*)(*j))->GetMomentum().Perp();260 table->SetValue(1, k, pt);261 Float_t phi = ((TEveTrack*)(*j))->GetMomentum().Phi();262 table->SetValue(2, k, phi);263 Float_t theta = ((TEveTrack*)(*j))->GetMomentum().Theta();264 table->SetValue(3, k, theta);265 Float_t eta = ((TEveTrack*)(*j))->GetMomentum().Eta();266 table->SetValue(4, k, eta);267 ++k;268 }269 }270 }271 fgDelphesHtmlSummary->Build();272 fgHtml->Clear();273 fgHtml->ParseText((char*)fgDelphesHtmlSummary->Html().Data());274 fgHtml->Layout();275 }276 }
Note:
See TracChangeset
for help on using the changeset viewer.