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 | #include <RQ_OBJECT.h>
|
---|
37 |
|
---|
38 |
|
---|
39 |
|
---|
40 | /*
|
---|
41 | * assembly.C: sauvegarde as shape-extract -> implement in the geometry class (read/write)
|
---|
42 | * histobrowser.C: intégration d'histogrammes dans le display (on pourrait avoir Pt, eta, phi pour les principales collections)
|
---|
43 | * also from alice_esd: summary html table
|
---|
44 | *
|
---|
45 | */
|
---|
46 |
|
---|
47 | class DelphesEventDisplay
|
---|
48 | {
|
---|
49 | RQ_OBJECT("DelphesEventDisplay")
|
---|
50 | public:
|
---|
51 | DelphesEventDisplay();
|
---|
52 | DelphesEventDisplay(const char *configFile, const char *inputFile, Delphes3DGeometry& det3D);
|
---|
53 | ~DelphesEventDisplay();
|
---|
54 | void EventChanged(Int_t); // *SIGNAL*
|
---|
55 |
|
---|
56 | private:
|
---|
57 | void update_html_summary();
|
---|
58 | void make_gui();
|
---|
59 | void load_event();
|
---|
60 | void readConfig(const char *configFile, std::vector<DelphesBranchBase*>& elements);
|
---|
61 |
|
---|
62 | // Configuration and global variables.
|
---|
63 | Int_t event_id_;
|
---|
64 | Int_t event_id_tmp_;
|
---|
65 | ExRootTreeReader *treeReader_;
|
---|
66 | Double_t tkRadius_, totRadius_, tkHalfLength_, muHalfLength_, bz_;
|
---|
67 | TAxis *etaAxis_, *phiAxis_;
|
---|
68 | TChain* chain_;
|
---|
69 | std::vector<DelphesBranchBase*> elements_;
|
---|
70 | DelphesDisplay *delphesDisplay_;
|
---|
71 | DelphesHtmlSummary *htmlSummary_;
|
---|
72 | TGHtml *gHtml_;
|
---|
73 | DelphesPlotSummary *plotSummary_;
|
---|
74 | TGStatusBar* fStatusBar_;
|
---|
75 |
|
---|
76 | // gui controls
|
---|
77 | public:
|
---|
78 | void Fwd() {
|
---|
79 | if (event_id_ < treeReader_->GetEntries() - 2) {
|
---|
80 | EventChanged(event_id_+1);
|
---|
81 | } else {
|
---|
82 | printf("Already at last event.\n");
|
---|
83 | }
|
---|
84 | }
|
---|
85 |
|
---|
86 | void Bck() {
|
---|
87 | if (event_id_ > 0) {
|
---|
88 | EventChanged(event_id_-1);
|
---|
89 | } else {
|
---|
90 | printf("Already at first event.\n");
|
---|
91 | }
|
---|
92 | }
|
---|
93 |
|
---|
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_);
|
---|
101 | } else {
|
---|
102 | printf("Error: no such event.\n");
|
---|
103 | }
|
---|
104 | }
|
---|
105 |
|
---|
106 | void InitSummaryPlots() {
|
---|
107 | plotSummary_->FillSample(treeReader_, event_id_); // TODO we could add a signal to give the progress
|
---|
108 | plotSummary_->FillEvent();
|
---|
109 | plotSummary_->Draw();
|
---|
110 | }
|
---|
111 | };
|
---|
112 |
|
---|
113 | #endif //DelphesEventDisplay_h
|
---|