Fork me on GitHub

Changeset 53b78e8 in git


Ignore:
Timestamp:
Nov 6, 2014, 2:00:06 PM (10 years ago)
Author:
Christophe Delaere <christophe.delaere@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
5565691
Parents:
0a67548
Message:

New signal to show the progress of plot processing

Progress is now shown in the status bar when generating std plots.

Location:
display
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • display/DelphesEventDisplay.cc

    r0a67548 r53b78e8  
    430430   plotSummary_ = new DelphesPlotSummary(tab);
    431431   plotSummary_->Init(elements_);
    432 }
    433 
     432   plotSummary_->Connect("Progress(Int_t)", "DelphesEventDisplay", this, "DisplayProgress(Int_t)");
     433
     434}
     435
     436
  • display/DelphesEventDisplay.h

    r0a67548 r53b78e8  
    2727#include "display/DelphesHtmlSummary.h"
    2828#include "display/DelphesPlotSummary.h"
     29#include "TSystem.h"
    2930#include "TChain.h"
    3031#include "TAxis.h"
     
    105106
    106107    void InitSummaryPlots() {
    107       plotSummary_->FillSample(treeReader_, event_id_); // TODO we could add a signal to give the progress
     108      plotSummary_->FillSample(treeReader_, event_id_);
    108109      plotSummary_->FillEvent();
    109110      plotSummary_->Draw();
     111    }
     112
     113    void DisplayProgress(Int_t p) { //TODO replace by a progress bar
     114         fStatusBar_->SetText(Form("Processing... %d %%",p), 1);
     115         gSystem->ProcessEvents();
    110116    }
    111117};
  • display/DelphesPlotSummary.cc

    r0a67548 r53b78e8  
    88
    99DelphesPlotSummary::~DelphesPlotSummary() {}
     10
     11void DelphesPlotSummary::Progress(Int_t p)
     12{
     13  Emit("Progress(Int_t)",p);
     14}
    1015
    1116void DelphesPlotSummary::Init(std::vector<DelphesBranchBase*>& elements) {
     
    4853
    4954void DelphesPlotSummary::FillSample(ExRootTreeReader* treeReader, Int_t event_id) {
    50   for(Int_t i=0;i<treeReader->GetEntries();++i) {
     55  Int_t entries = treeReader->GetEntries();
     56  for(Int_t i=0;i<entries;++i) {
    5157    treeReader->ReadEntry(i);
    5258    for(std::vector<DelphesBranchBase*>::iterator element = elements_->begin();element<elements_->end();++element) {
     
    7076      }
    7177    }
     78    Progress(int(100*i/entries));
    7279  }
    7380  treeReader->ReadEntry(event_id);
     81  Progress(100);
    7482}
    7583
  • display/DelphesPlotSummary.h

    r0a67548 r53b78e8  
    1010#include "DelphesBranchElement.h"
    1111#include "external/ExRootAnalysis/ExRootTreeReader.h"
     12#include <RQ_OBJECT.h>
     13
    1214
    1315class DelphesPlotSummary
    1416{
     17    RQ_OBJECT("DelphesPlotSummary")
    1518  public:
    1619    DelphesPlotSummary(TEveWindowTab* tab);
     
    2023    void FillEvent();
    2124    void Draw();
     25    void Progress(Int_t); // *SIGNAL*
    2226
    2327  private:
  • display/DisplayLinkDef.h

    r0a67548 r53b78e8  
    3636#include "display/DelphesEventDisplay.h"
    3737#include "display/DelphesHtmlSummary.h"
     38#include "display/DelphesPlotSummary.h"
    3839
    3940#ifdef __CINT__
     
    5253#pragma link C++ class DelphesHtmlObjTable;
    5354#pragma link C++ class DelphesHtmlSummary;
     55#pragma link C++ class DelphesPlotSummary;
    5456
    5557#endif
Note: See TracChangeset for help on using the changeset viewer.