[cfc3160] | 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>
|
---|
[fafc433] | 23 | #include <iostream>
|
---|
[cfc3160] | 24 | #include "external/ExRootAnalysis/ExRootTreeReader.h"
|
---|
| 25 | #include "display/DelphesDisplay.h"
|
---|
| 26 | #include "display/Delphes3DGeometry.h"
|
---|
[5fbcfe8] | 27 | #include "display/DelphesHtmlSummary.h"
|
---|
[2ca23b5] | 28 | #include "display/DelphesPlotSummary.h"
|
---|
[53b78e8] | 29 | #include "TSystem.h"
|
---|
[cfc3160] | 30 | #include "TChain.h"
|
---|
[4fd37d4] | 31 | #include "TAxis.h"
|
---|
[5fbcfe8] | 32 | #include "TGHtml.h"
|
---|
[cfc3160] | 33 | #include "TClonesArray.h"
|
---|
[2ca23b5] | 34 | #include "TGStatusBar.h"
|
---|
[6301e02] | 35 | #include "TGNumberEntry.h"
|
---|
| 36 | #include "TGProgressBar.h"
|
---|
[0a67548] | 37 | #include <RQ_OBJECT.h>
|
---|
[6301e02] | 38 |
|
---|
| 39 |
|
---|
[cfc3160] | 40 |
|
---|
| 41 | /*
|
---|
| 42 | * assembly.C: sauvegarde as shape-extract -> implement in the geometry class (read/write)
|
---|
| 43 | * histobrowser.C: intégration d'histogrammes dans le display (on pourrait avoir Pt, eta, phi pour les principales collections)
|
---|
| 44 | * also from alice_esd: summary html table
|
---|
| 45 | *
|
---|
| 46 | */
|
---|
| 47 |
|
---|
| 48 | class DelphesEventDisplay
|
---|
| 49 | {
|
---|
[0a67548] | 50 | RQ_OBJECT("DelphesEventDisplay")
|
---|
[cfc3160] | 51 | public:
|
---|
| 52 | DelphesEventDisplay();
|
---|
| 53 | DelphesEventDisplay(const char *configFile, const char *inputFile, Delphes3DGeometry& det3D);
|
---|
| 54 | ~DelphesEventDisplay();
|
---|
[0a67548] | 55 | void EventChanged(Int_t); // *SIGNAL*
|
---|
[cfc3160] | 56 |
|
---|
| 57 | private:
|
---|
[8b04b31] | 58 | void update_html_summary();
|
---|
[cfc3160] | 59 | void make_gui();
|
---|
[fafc433] | 60 | void load_event();
|
---|
[4fd37d4] | 61 | void readConfig(const char *configFile, std::vector<DelphesBranchBase*>& elements);
|
---|
[cfc3160] | 62 |
|
---|
| 63 | // Configuration and global variables.
|
---|
[fafc433] | 64 | Int_t event_id_;
|
---|
[0a67548] | 65 | Int_t event_id_tmp_;
|
---|
[fafc433] | 66 | ExRootTreeReader *treeReader_;
|
---|
[4fd37d4] | 67 | Double_t tkRadius_, totRadius_, tkHalfLength_, muHalfLength_, bz_;
|
---|
| 68 | TAxis *etaAxis_, *phiAxis_;
|
---|
[cfc3160] | 69 | TChain* chain_;
|
---|
[fafc433] | 70 | std::vector<DelphesBranchBase*> elements_;
|
---|
| 71 | DelphesDisplay *delphesDisplay_;
|
---|
[5fbcfe8] | 72 | DelphesHtmlSummary *htmlSummary_;
|
---|
| 73 | TGHtml *gHtml_;
|
---|
[2ca23b5] | 74 | DelphesPlotSummary *plotSummary_;
|
---|
| 75 | TGStatusBar* fStatusBar_;
|
---|
[6301e02] | 76 |
|
---|
[fafc433] | 77 | // gui controls
|
---|
| 78 | public:
|
---|
| 79 | void Fwd() {
|
---|
[6301e02] | 80 | if (event_id_ < treeReader_->GetEntries() - 2) {
|
---|
[0a67548] | 81 | EventChanged(event_id_+1);
|
---|
[fafc433] | 82 | } else {
|
---|
| 83 | printf("Already at last event.\n");
|
---|
| 84 | }
|
---|
| 85 | }
|
---|
[cfc3160] | 86 |
|
---|
[fafc433] | 87 | void Bck() {
|
---|
| 88 | if (event_id_ > 0) {
|
---|
[0a67548] | 89 | EventChanged(event_id_-1);
|
---|
[fafc433] | 90 | } else {
|
---|
| 91 | printf("Already at first event.\n");
|
---|
| 92 | }
|
---|
| 93 | }
|
---|
[6301e02] | 94 |
|
---|
[0a67548] | 95 | void PreSetEv(char* ev) {
|
---|
| 96 | event_id_tmp_ = Int_t(atoi(ev));
|
---|
| 97 | }
|
---|
| 98 |
|
---|
| 99 | void GoTo() {
|
---|
| 100 | if (event_id_tmp_>=0 && event_id_tmp_ < treeReader_->GetEntries()-1) {
|
---|
| 101 | EventChanged(event_id_tmp_);
|
---|
[6301e02] | 102 | } else {
|
---|
| 103 | printf("Error: no such event.\n");
|
---|
| 104 | }
|
---|
| 105 | }
|
---|
| 106 |
|
---|
| 107 | void InitSummaryPlots() {
|
---|
[53b78e8] | 108 | plotSummary_->FillSample(treeReader_, event_id_);
|
---|
[6301e02] | 109 | plotSummary_->FillEvent();
|
---|
| 110 | plotSummary_->Draw();
|
---|
| 111 | }
|
---|
[53b78e8] | 112 |
|
---|
[c3c9ac5] | 113 | void DisplayProgress(Int_t p) {
|
---|
[53b78e8] | 114 | fStatusBar_->SetText(Form("Processing... %d %%",p), 1);
|
---|
| 115 | gSystem->ProcessEvents();
|
---|
| 116 | }
|
---|
[cfc3160] | 117 | };
|
---|
| 118 |
|
---|
| 119 | #endif //DelphesEventDisplay_h
|
---|