Fork me on GitHub

Changeset 6301e02 in git for display/DelphesEventDisplay.h


Ignore:
Timestamp:
Nov 5, 2014, 7:23:34 PM (10 years ago)
Author:
Christophe Delaere <christophe.delaere@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
0a67548
Parents:
2695ae1
Message:

Better GUI

Improved the event navigation widget + batch operations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • display/DelphesEventDisplay.h

    r2695ae1 r6301e02  
    3232#include "TClonesArray.h"
    3333#include "TGStatusBar.h"
     34#include "TGNumberEntry.h"
     35#include "TGProgressBar.h"
     36
     37
    3438
    3539/*
     
    6569    DelphesPlotSummary *plotSummary_;
    6670    TGStatusBar* fStatusBar_;
     71    TGNumberEntry* numberEntry_; // event_id
     72    TGHProgressBar* progress_; // event_id
     73   
    6774
    6875    // gui controls
    6976  public:
    7077     void Fwd() { 
    71         if (event_id_ < treeReader_->GetEntries() - 1) {
     78        if (event_id_ < treeReader_->GetEntries() - 2) {
    7279           ++event_id_;
     80           numberEntry_->SetIntNumber(event_id_);
     81           progress_->SetPosition(event_id_);
    7382           load_event();
    7483        } else {
     
    8089        if (event_id_ > 0) {
    8190           --event_id_;
     91           numberEntry_->SetIntNumber(event_id_);
     92           progress_->SetPosition(event_id_);
    8293           load_event();
    8394        } else {
     
    8596        }
    8697     }
     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    }
    87115};
    88116
Note: See TracChangeset for help on using the changeset viewer.