Changeset 0a67548 in git
- Timestamp:
- Nov 6, 2014, 10:58:31 AM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 53b78e8
- Parents:
- 6301e02
- Location:
- display
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
display/DelphesEventDisplay.cc
r6301e02 r0a67548 73 73 delete chain_; 74 74 } 75 76 void DelphesEventDisplay::EventChanged(Int_t e) 77 { 78 if( e!= event_id_ ) { 79 event_id_ = e; 80 Emit("EventChanged(Int_t)",e); 81 load_event(); 82 } 83 } 84 75 85 76 86 DelphesEventDisplay::DelphesEventDisplay(const char *configFile, const char *inputFile, Delphes3DGeometry& det3D) … … 370 380 b->Connect("Clicked()", "DelphesEventDisplay", this, "Bck()"); 371 381 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)"); 382 TGNumberEntry* numberEntry = new TGNumberEntry(hf,0,9,-1,TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative, TGNumberFormat::kNELLimitMinMax, 0, treeReader_->GetEntries()); 383 hf->AddFrame(numberEntry, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY , 2, 0, 10, 10)); 384 this->Connect("EventChanged(Int_t)","TGNumberEntry",numberEntry,"SetIntNumber(Long_t)"); 385 numberEntry->GetNumberEntry()->Connect("TextChanged(char*)", "DelphesEventDisplay", this, "PreSetEv(char*)"); 386 numberEntry->GetNumberEntry()->Connect("ReturnPressed()", "DelphesEventDisplay", this, "GoTo()"); 375 387 376 388 b = new TGPictureButton(hf, gClient->GetPicture(icondir+"GoForward.gif")); … … 381 393 vf->AddFrame(hf, new TGLayoutHints(kLHintsExpandX , 2, 2, 2, 2)); 382 394 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)); 395 TGHProgressBar* progress = new TGHProgressBar(frmMain, TGProgressBar::kFancy, 100); 396 progress->SetMax( treeReader_->GetEntries()); 397 progress->ShowPosition(kTRUE, kFALSE, "Event %.0f"); 398 progress->SetBarColor("green"); 399 vf->AddFrame(progress, new TGLayoutHints(kLHintsExpandX, 10, 10, 5, 5)); 400 this->Connect("EventChanged(Int_t)","TGHProgressBar",progress,"SetPosition(Float_t)"); 388 401 } 389 402 frmMain->AddFrame(vf, new TGLayoutHints(kLHintsExpandX , 5, 5, 5, 5)); -
display/DelphesEventDisplay.h
r6301e02 r0a67548 34 34 #include "TGNumberEntry.h" 35 35 #include "TGProgressBar.h" 36 #include <RQ_OBJECT.h> 36 37 37 38 … … 46 47 class DelphesEventDisplay 47 48 { 49 RQ_OBJECT("DelphesEventDisplay") 48 50 public: 49 51 DelphesEventDisplay(); 50 52 DelphesEventDisplay(const char *configFile, const char *inputFile, Delphes3DGeometry& det3D); 51 53 ~DelphesEventDisplay(); 54 void EventChanged(Int_t); // *SIGNAL* 52 55 53 56 private: … … 59 62 // Configuration and global variables. 60 63 Int_t event_id_; 64 Int_t event_id_tmp_; 61 65 ExRootTreeReader *treeReader_; 62 66 Double_t tkRadius_, totRadius_, tkHalfLength_, muHalfLength_, bz_; … … 69 73 DelphesPlotSummary *plotSummary_; 70 74 TGStatusBar* fStatusBar_; 71 TGNumberEntry* numberEntry_; // event_id72 TGHProgressBar* progress_; // event_id73 75 74 75 76 // gui controls 76 77 public: 77 78 void Fwd() { 78 79 if (event_id_ < treeReader_->GetEntries() - 2) { 79 ++event_id_; 80 numberEntry_->SetIntNumber(event_id_); 81 progress_->SetPosition(event_id_); 82 load_event(); 80 EventChanged(event_id_+1); 83 81 } else { 84 82 printf("Already at last event.\n"); … … 88 86 void Bck() { 89 87 if (event_id_ > 0) { 90 --event_id_; 91 numberEntry_->SetIntNumber(event_id_); 92 progress_->SetPosition(event_id_); 93 load_event(); 88 EventChanged(event_id_-1); 94 89 } else { 95 90 printf("Already at first event.\n"); … … 97 92 } 98 93 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(); 94 void PreSetEv(char* ev) { 95 event_id_tmp_ = Int_t(atoi(ev)); 96 } 97 98 void GoTo() { 99 if (event_id_tmp_>=0 && event_id_tmp_ < treeReader_->GetEntries()-1) { 100 EventChanged(event_id_tmp_); 105 101 } else { 106 102 printf("Error: no such event.\n");
Note:
See TracChangeset
for help on using the changeset viewer.