Fork me on GitHub

source: git/display/DelphesEventDisplay.h@ 6301e02

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 6301e02 was 6301e02, checked in by Christophe Delaere <christophe.delaere@…>, 10 years ago

Better GUI

Improved the event navigation widget + batch operations

  • Property mode set to 100644
File size: 3.6 KB
Line 
1/*
2 * Delphes: a framework for fast simulation of a generic collider experiment
3 * Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef DelphesEventDisplay_h
20#define DelphesEventDisplay_h
21
22#include <vector>
23#include <iostream>
24#include "external/ExRootAnalysis/ExRootTreeReader.h"
25#include "display/DelphesDisplay.h"
26#include "display/Delphes3DGeometry.h"
27#include "display/DelphesHtmlSummary.h"
28#include "display/DelphesPlotSummary.h"
29#include "TChain.h"
30#include "TAxis.h"
31#include "TGHtml.h"
32#include "TClonesArray.h"
33#include "TGStatusBar.h"
34#include "TGNumberEntry.h"
35#include "TGProgressBar.h"
36
37
38
39/*
40 * assembly.C: sauvegarde as shape-extract -> implement in the geometry class (read/write)
41 * histobrowser.C: intégration d'histogrammes dans le display (on pourrait avoir Pt, eta, phi pour les principales collections)
42 * also from alice_esd: summary html table
43 *
44 */
45
46class DelphesEventDisplay
47{
48 public:
49 DelphesEventDisplay();
50 DelphesEventDisplay(const char *configFile, const char *inputFile, Delphes3DGeometry& det3D);
51 ~DelphesEventDisplay();
52
53 private:
54 void update_html_summary();
55 void make_gui();
56 void load_event();
57 void readConfig(const char *configFile, std::vector<DelphesBranchBase*>& elements);
58
59 // Configuration and global variables.
60 Int_t event_id_;
61 ExRootTreeReader *treeReader_;
62 Double_t tkRadius_, totRadius_, tkHalfLength_, muHalfLength_, bz_;
63 TAxis *etaAxis_, *phiAxis_;
64 TChain* chain_;
65 std::vector<DelphesBranchBase*> elements_;
66 DelphesDisplay *delphesDisplay_;
67 DelphesHtmlSummary *htmlSummary_;
68 TGHtml *gHtml_;
69 DelphesPlotSummary *plotSummary_;
70 TGStatusBar* fStatusBar_;
71 TGNumberEntry* numberEntry_; // event_id
72 TGHProgressBar* progress_; // event_id
73
74
75 // gui controls
76 public:
77 void Fwd() {
78 if (event_id_ < treeReader_->GetEntries() - 2) {
79 ++event_id_;
80 numberEntry_->SetIntNumber(event_id_);
81 progress_->SetPosition(event_id_);
82 load_event();
83 } else {
84 printf("Already at last event.\n");
85 }
86 }
87
88 void Bck() {
89 if (event_id_ > 0) {
90 --event_id_;
91 numberEntry_->SetIntNumber(event_id_);
92 progress_->SetPosition(event_id_);
93 load_event();
94 } else {
95 printf("Already at first event.\n");
96 }
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 }
115};
116
117#endif //DelphesEventDisplay_h
Note: See TracBrowser for help on using the repository browser.