Changeset 6301e02 in git
- Timestamp:
- Nov 5, 2014, 7:23:34 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 0a67548
- Parents:
- 2695ae1
- Location:
- display
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
display/DelphesBranchElement.cc
r2695ae1 r6301e02 25 25 #include "TEveVector.h" 26 26 #include <iostream> 27 28 //TODO implement GetVectors()29 27 30 28 // special case for calo towers -
display/DelphesEventDisplay.cc
r2695ae1 r6301e02 45 45 #include "TRootBrowser.h" 46 46 #include "TGButton.h" 47 #include "TGTextEntry.h" 48 #include "TGProgressBar.h" 49 #include "TGNumberEntry.h" 47 50 #include "TRootEmbeddedCanvas.h" 48 51 #include "TClonesArray.h" … … 113 116 // Create object of class ExRootTreeReader 114 117 fStatusBar_->SetText("Opening Delphes data file", 1); 118 gSystem->ProcessEvents(); 115 119 treeReader_ = new ExRootTreeReader(chain_); 116 120 … … 155 159 //ready... 156 160 fStatusBar_->SetText("Ready.", 1); 157 plotSummary_->FillSample(treeReader_, event_id_); //TODO later, control it via a GUI button.161 gSystem->ProcessEvents(); 158 162 load_event(); 159 163 gEve->Redraw3D(kTRUE); … … 243 247 // message 244 248 fStatusBar_->SetText(Form("Loading event %d.", event_id_), 1); 249 gSystem->ProcessEvents(); 245 250 246 251 // clear the previous event … … 268 273 gEve->Redraw3D(kFALSE, kTRUE); 269 274 fStatusBar_->SetText(Form("Loaded event %d.", event_id_), 1); 275 gSystem->ProcessEvents(); 270 276 } 271 277 … … 337 343 { 338 344 // Create minimal GUI for event navigation. 339 // TODO: better GUI could be made based on the ch15 of the manual (Writing a GUI)340 345 341 346 // add a tab on the left 342 347 TEveBrowser* browser = gEve->GetBrowser(); 348 browser->SetWindowName("Delphes Event Display"); 343 349 browser->StartEmbedding(TRootBrowser::kLeft); 344 350 … … 349 355 350 356 // build the navigation menu 351 TGHorizontalFrame* hf = new TGHorizontalFrame(frmMain); 357 TString icondir; 358 if(gSystem->Getenv("ROOTSYS")) 359 icondir = Form("%s/icons/", gSystem->Getenv("ROOTSYS")); 360 if(!gSystem->OpenDirectory(icondir)) 361 icondir = Form("%s/icons/", (const char*)gSystem->GetFromPipe("root-config --etcdir") ); 362 TGGroupFrame* vf = new TGGroupFrame(frmMain,"Event navigation",kVerticalFrame | kFitWidth ); 352 363 { 353 TString icondir; 354 if(gSystem->Getenv("ROOTSYS")) 355 icondir = Form("%s/icons/", gSystem->Getenv("ROOTSYS")); 356 if(!gSystem->OpenDirectory(icondir)) 357 icondir = Form("%s/icons/", (const char*)gSystem->GetFromPipe("root-config --etcdir") ); 358 TGPictureButton* b = 0; 359 360 b = new TGPictureButton(hf, gClient->GetPicture(icondir+"GoBack.gif")); 361 hf->AddFrame(b); 362 b->Connect("Clicked()", "DelphesEventDisplay", this, "Bck()"); 363 364 b = new TGPictureButton(hf, gClient->GetPicture(icondir+"GoForward.gif")); 365 hf->AddFrame(b); 366 b->Connect("Clicked()", "DelphesEventDisplay", this, "Fwd()"); 367 } 368 frmMain->AddFrame(hf); 364 TGHorizontalFrame* hf = new TGHorizontalFrame(frmMain); 365 { 366 TGPictureButton* b = 0; 367 368 b = new TGPictureButton(hf, gClient->GetPicture(icondir+"GoBack.gif")); 369 hf->AddFrame(b, new TGLayoutHints(kLHintsLeft | kLHintsCenterY , 10, 2, 10, 10)); 370 b->Connect("Clicked()", "DelphesEventDisplay", this, "Bck()"); 371 372 numberEntry_ = new TGNumberEntry(hf,0,9,-1,TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative, TGNumberFormat::kNELLimitMinMax, 0, treeReader_->GetEntries()); 373 hf->AddFrame(numberEntry_, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY , 2, 0, 10, 10)); 374 numberEntry_->Connect("ValueSet(Long_t)", "DelphesEventDisplay", this, "GoTo(Long_t)"); 375 376 b = new TGPictureButton(hf, gClient->GetPicture(icondir+"GoForward.gif")); 377 hf->AddFrame(b, new TGLayoutHints(kLHintsRight | kLHintsCenterY , 2, 10, 10, 10)); 378 b->Connect("Clicked()", "DelphesEventDisplay", this, "Fwd()"); 379 380 } 381 vf->AddFrame(hf, new TGLayoutHints(kLHintsExpandX , 2, 2, 2, 2)); 382 383 progress_ = new TGHProgressBar(frmMain, TGProgressBar::kFancy, 100); 384 progress_->SetMax( treeReader_->GetEntries()); 385 progress_->ShowPosition(kTRUE, kFALSE, "Event %.0f"); 386 progress_->SetBarColor("green"); 387 vf->AddFrame(progress_, new TGLayoutHints(kLHintsExpandX, 10, 10, 5, 5)); 388 } 389 frmMain->AddFrame(vf, new TGLayoutHints(kLHintsExpandX , 5, 5, 5, 5)); 390 vf = new TGGroupFrame(frmMain,"Batch operations",kVerticalFrame | kFitWidth ); 391 { 392 TGTextButton *b = new TGTextButton(vf, "Initialize Summary Plots"); 393 vf->AddFrame(b, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY | kLHintsExpandX, 10, 10, 10, 10)); 394 b->Connect("Clicked()", "DelphesEventDisplay", this, "InitSummaryPlots()"); 395 } 396 frmMain->AddFrame(vf, new TGLayoutHints(kLHintsExpandX , 5, 5, 5, 5)); 397 369 398 frmMain->MapSubwindows(); 370 399 frmMain->Resize(); -
display/DelphesEventDisplay.h
r2695ae1 r6301e02 32 32 #include "TClonesArray.h" 33 33 #include "TGStatusBar.h" 34 #include "TGNumberEntry.h" 35 #include "TGProgressBar.h" 36 37 34 38 35 39 /* … … 65 69 DelphesPlotSummary *plotSummary_; 66 70 TGStatusBar* fStatusBar_; 71 TGNumberEntry* numberEntry_; // event_id 72 TGHProgressBar* progress_; // event_id 73 67 74 68 75 // gui controls 69 76 public: 70 77 void Fwd() { 71 if (event_id_ < treeReader_->GetEntries() - 1) {78 if (event_id_ < treeReader_->GetEntries() - 2) { 72 79 ++event_id_; 80 numberEntry_->SetIntNumber(event_id_); 81 progress_->SetPosition(event_id_); 73 82 load_event(); 74 83 } else { … … 80 89 if (event_id_ > 0) { 81 90 --event_id_; 91 numberEntry_->SetIntNumber(event_id_); 92 progress_->SetPosition(event_id_); 82 93 load_event(); 83 94 } else { … … 85 96 } 86 97 } 98 99 void GoTo(Long_t ev) { 100 Int_t event = Int_t(numberEntry_->GetNumber()); 101 if (event < treeReader_->GetEntries()-1) { 102 event_id_ = event; 103 progress_->SetPosition(event_id_); //TODO we could provide a signal related to event_id changes 104 load_event(); 105 } else { 106 printf("Error: no such event.\n"); 107 } 108 } 109 110 void InitSummaryPlots() { 111 plotSummary_->FillSample(treeReader_, event_id_); // TODO we could add a signal to give the progress 112 plotSummary_->FillEvent(); 113 plotSummary_->Draw(); 114 } 87 115 }; 88 116 -
display/DelphesPlotSummary.cc
r2695ae1 r6301e02 8 8 9 9 DelphesPlotSummary::~DelphesPlotSummary() {} 10 11 //TODO: sort the vectors before filling.12 10 13 11 void DelphesPlotSummary::Init(std::vector<DelphesBranchBase*>& elements) { … … 98 96 } 99 97 100 void DelphesPlotSummary::FillEvent() { 98 void DelphesPlotSummary::FillEvent() { //TODO make it faster... try to reuse objects and simply change the values 101 99 // clear previous markers 102 100 for(std::map< TString, std::vector<TMarker*> >::iterator mv = eventMarkers_.begin(); mv!=eventMarkers_.end();++mv) {
Note:
See TracChangeset
for help on using the changeset viewer.