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 "external/ExRootAnalysis/ExRootTreeReader.h"
|
---|
24 | #include "display/DelphesDisplay.h"
|
---|
25 | #include "display/Delphes3DGeometry.h"
|
---|
26 | #include "TChain.h"
|
---|
27 | #include "TClonesArray.h"
|
---|
28 |
|
---|
29 | /*
|
---|
30 | * assembly.C: sauvegarde as shape-extract -> implement in the geometry class (read/write)
|
---|
31 | * histobrowser.C: intégration d'histogrammes dans le display (on pourrait avoir Pt, eta, phi pour les principales collections)
|
---|
32 | * also from alice_esd: summary html table
|
---|
33 | *
|
---|
34 | */
|
---|
35 |
|
---|
36 | class DelphesEventDisplay
|
---|
37 | {
|
---|
38 | public:
|
---|
39 | DelphesEventDisplay();
|
---|
40 | DelphesEventDisplay(const char *configFile, const char *inputFile, Delphes3DGeometry& det3D);
|
---|
41 | ~DelphesEventDisplay();
|
---|
42 | Int_t event_id;
|
---|
43 | ExRootTreeReader *gTreeReader;
|
---|
44 |
|
---|
45 | private:
|
---|
46 | void make_gui();
|
---|
47 | void load_event();
|
---|
48 | void delphes_read();
|
---|
49 | void delphes_read_towers(TClonesArray* data, DelphesBranchBase* element);
|
---|
50 | void delphes_read_tracks(TClonesArray* data, DelphesBranchBase* element);
|
---|
51 | void delphes_read_jets(TClonesArray* data, DelphesBranchBase* element);
|
---|
52 | void delphes_read_vectors(TClonesArray* data, DelphesBranchBase* element);
|
---|
53 | void readConfig(const char *configFile, Delphes3DGeometry& det3D, std::vector<DelphesBranchBase*>& elements, std::vector<TClonesArray*>& arrays);
|
---|
54 |
|
---|
55 | // Configuration and global variables.
|
---|
56 | Double_t tkRadius_, totRadius_, tkHalfLength_, bz_;
|
---|
57 | TChain* chain_;
|
---|
58 | std::vector<DelphesBranchBase*> gElements;
|
---|
59 | std::vector<TClonesArray*> gArrays;
|
---|
60 | DelphesDisplay *gDelphesDisplay;
|
---|
61 |
|
---|
62 | // EvNavHandler class is needed to connect GUI signals.
|
---|
63 | class EvNavHandler
|
---|
64 | {
|
---|
65 | public:
|
---|
66 |
|
---|
67 | EvNavHandler(DelphesEventDisplay* display):display_(display) {}
|
---|
68 |
|
---|
69 | ~EvNavHandler() {}
|
---|
70 |
|
---|
71 | void Fwd() {
|
---|
72 | if (display_->event_id < display_->gTreeReader->GetEntries() - 1) {
|
---|
73 | ++(display_->event_id);
|
---|
74 | display_->load_event();
|
---|
75 | } else {
|
---|
76 | printf("Already at last event.\n");
|
---|
77 | }
|
---|
78 | }
|
---|
79 |
|
---|
80 | void Bck() {
|
---|
81 | if (display_->event_id > 0) {
|
---|
82 | --(display_->event_id);
|
---|
83 | display_->load_event();
|
---|
84 | } else {
|
---|
85 | printf("Already at first event.\n");
|
---|
86 | }
|
---|
87 | }
|
---|
88 | private:
|
---|
89 | DelphesEventDisplay* display_;
|
---|
90 | };
|
---|
91 | };
|
---|
92 |
|
---|
93 | #endif //DelphesEventDisplay_h
|
---|